Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added example/lib/assets/food.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
272 changes: 159 additions & 113 deletions example/lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,15 @@ import 'package:ui_kit/position/gf_position.dart';
import 'package:ui_kit/types/gf_type.dart';
import 'package:ui_kit/components/image/gf_image_overlay.dart';
import 'package:ui_kit/shape/gf_shape.dart';
import 'package:ui_kit/components/slider/gf_slider.dart';

final List<String> imageList = [
"https://cdn.pixabay.com/photo/2017/12/03/18/04/christmas-balls-2995437_960_720.jpg",
"https://cdn.pixabay.com/photo/2017/12/13/00/23/christmas-3015776_960_720.jpg",
"https://cdn.pixabay.com/photo/2019/12/19/10/55/christmas-market-4705877_960_720.jpg",
"https://cdn.pixabay.com/photo/2019/12/20/00/03/road-4707345_960_720.jpg"
];


void main() => runApp(MyApp());

Expand Down Expand Up @@ -51,56 +60,93 @@ class _MyHomePageState extends State<MyHomePage> {
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center,
children: <Widget>[
GFCard(
boxFit: BoxFit.cover,
colorFilter: new ColorFilter.mode(
Colors.black.withOpacity(0.67), BlendMode.darken),
image: Image.asset("lib/assets/pizza.jpeg"),
// imageOverlay: AssetImage("lib/assets/pizza.jpeg"),
titlePosition: GFPosition.end,
title: GFTitleBar(
avatar: GFAvatar(
child: Text("tb"),
),
title: Text(
'title',
style: TextStyle(color: Colors.grey),
),
subTitle: Text(
'subtitle',
style: TextStyle(color: Colors.grey),
),
icon: GFIconButton(
onPressed: null,
icon: Icon(Icons.favorite_border),
type: GFType.transparent,
),
),
content: Text(
"Flutter "
"Flutter is Google's mobile UI framework for crafting"
" high-quality native interfaces on iOS and Android in "
"Flutter ",
style: TextStyle(color: Colors.grey),
),
buttonBar: GFButtonBar(
mainAxisSize: MainAxisSize.min,
children: <Widget>[
GFButton(
onPressed: null,
child: Text("favorite"),
icon: Icon(Icons.favorite_border),
type: GFType.transparent,
),
GFButton(
onPressed: null,
child: Text("share"),
icon: Icon(Icons.share),
type: GFType.outline,

GFSlider(
viewportFraction: 0.9,
aspectRatio: 2.0,
autoPlay: true,
enlargeMainPage: true,
items: imageList.map(
(url) {
return Container(
margin: EdgeInsets.all(5.0),
child: ClipRRect(
borderRadius: BorderRadius.all(Radius.circular(5.0)),
child: Image.network(
url,
fit: BoxFit.cover,
width: 1000.0,
),
],
),
),
),
);
},
).toList(),
),

// GFSlider(
// autoPlay: true,
// viewportFraction: 1.0,
// aspectRatio: MediaQuery.of(context).size.aspectRatio,
// items: imageList.map((url) {
// return Image.network(
// url,
// fit: BoxFit.cover,
// width: 1000.0,
// );
// },
// ).toList(),
// ),

// GFCard(
// boxFit: BoxFit.cover,
// colorFilter: new ColorFilter.mode(
// Colors.black.withOpacity(0.67), BlendMode.darken),
// image: Image.asset("lib/assets/food.jpeg"),
//// imageOverlay: AssetImage("lib/assets/food.jpeg"),
// titlePosition: GFPosition.end,
// title: GFTitleBar(
// avatar: GFAvatar(
// child: Text("tb"),
// ),
// title: Text(
// 'title',
// style: TextStyle(color: Colors.grey),
// ),
// subTitle: Text(
// 'subtitle',
// style: TextStyle(color: Colors.grey),
// ),
// icon: GFIconButton(
// onPressed: null,
// icon: Icon(Icons.favorite_border),
// type: GFType.transparent,
// ),
// ),
// content: Text(
// "Flutter "
// "Flutter is Google's mobile UI framework for crafting"
// " high-quality native interfaces on iOS and Android in "
// "Flutter ",
// style: TextStyle(color: Colors.grey),
// ),
// buttonBar: GFButtonBar(
// mainAxisSize: MainAxisSize.min,
// children: <Widget>[
// GFButton(
// onPressed: null,
// child: Text("favorite"),
// icon: Icon(Icons.favorite_border),
// type: GFType.transparent,
// ),
// GFButton(
// onPressed: null,
// child: Text("share"),
// icon: Icon(Icons.share),
// type: GFType.outline,
// ),
// ],
// ),
// ),

// GFButtonBar(
// mainAxisSize: MainAxisSize.min,
Expand All @@ -124,70 +170,70 @@ class _MyHomePageState extends State<MyHomePage> {
// ),
// ),

GFImageOverlay(
width: MediaQuery.of(context).size.width,
margin: EdgeInsets.all(16.0),
padding: EdgeInsets.all(16.0),
child: Column(
children: <Widget>[
new Text(
'Hello world',
style: TextStyle(color: Colors.white),
),
new Text(
'Hello world',
style: TextStyle(color: Colors.white),
),
new Text(
'Hello world',
style: TextStyle(color: Colors.white),
),
new Text(
'Hello world',
style: TextStyle(color: Colors.white),
),
new Text(
'Hello world',
style: TextStyle(color: Colors.white),
),
new Text(
'Hello world',
style: TextStyle(color: Colors.white),
),
new Text(
'Hello world',
style: TextStyle(color: Colors.white),
),
new Text(
'Hello world',
style: TextStyle(color: Colors.white),
),
new Text(
'Hello world',
style: TextStyle(color: Colors.white),
),
new Text(
'Hello world',
style: TextStyle(color: Colors.white),
),
new Text(
'Hello world',
style: TextStyle(color: Colors.white),
),
new Text(
'Hello world',
style: TextStyle(color: Colors.white),
),
],
),
// color: Colors.orange,
image: AssetImage("lib/assets/pizza.jpeg"),
boxFit: BoxFit.cover,
colorFilter: new ColorFilter.mode(
Colors.black.withOpacity(0.6), BlendMode.darken),
borderRadius: new BorderRadius.circular(5.0),
// border: Border.all(color: Colors.pink, width: 2.0),
),
// GFImageOverlay(
// width: MediaQuery.of(context).size.width,
// margin: EdgeInsets.all(16.0),
// padding: EdgeInsets.all(16.0),
// child: Column(
// children: <Widget>[
// new Text(
// 'Hello world',
// style: TextStyle(color: Colors.white),
// ),
// new Text(
// 'Hello world',
// style: TextStyle(color: Colors.white),
// ),
// new Text(
// 'Hello world',
// style: TextStyle(color: Colors.white),
// ),
// new Text(
// 'Hello world',
// style: TextStyle(color: Colors.white),
// ),
// new Text(
// 'Hello world',
// style: TextStyle(color: Colors.white),
// ),
// new Text(
// 'Hello world',
// style: TextStyle(color: Colors.white),
// ),
// new Text(
// 'Hello world',
// style: TextStyle(color: Colors.white),
// ),
// new Text(
// 'Hello world',
// style: TextStyle(color: Colors.white),
// ),
// new Text(
// 'Hello world',
// style: TextStyle(color: Colors.white),
// ),
// new Text(
// 'Hello world',
// style: TextStyle(color: Colors.white),
// ),
// new Text(
// 'Hello world',
// style: TextStyle(color: Colors.white),
// ),
// new Text(
// 'Hello world',
// style: TextStyle(color: Colors.white),
// ),
// ],
// ),
//// color: Colors.orange,
// image: AssetImage("lib/assets/food.jpeg"),
// boxFit: BoxFit.cover,
// colorFilter: new ColorFilter.mode(
// Colors.black.withOpacity(0.6), BlendMode.darken),
// borderRadius: new BorderRadius.circular(5.0),
//// border: Border.all(color: Colors.pink, width: 2.0),
// ),

//
// GFAvatar(
Expand Down
6 changes: 4 additions & 2 deletions example/pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: ui_kit_example
name: example
description: A new Flutter project.

version: 1.0.0+1
Expand All @@ -19,4 +19,6 @@ dev_dependencies:
sdk: flutter

flutter:
uses-material-design: true
uses-material-design: true
assets:
- lib/assets/food.jpeg
Loading