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
338 changes: 183 additions & 155 deletions example/lib/main.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter/painting.dart';
import 'package:ui_kit/components/button/gf_button.dart';
import 'package:ui_kit/components/button/gf_icon_button.dart';
import 'package:ui_kit/components/badge/gf_button_badge.dart';
Expand All @@ -7,9 +9,11 @@ import 'package:ui_kit/components/avatar/gf_avatar.dart';
import 'package:ui_kit/components/badge/gf_badge.dart';
import 'package:ui_kit/components/card/gf_card.dart';
import 'package:ui_kit/components/header_bar/gf_title_bar.dart';
import 'package:ui_kit/components/image/gf_image_overlay.dart';
import 'package:ui_kit/components/button_bar/gf_button_bar.dart';
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';

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

Expand Down Expand Up @@ -48,181 +52,205 @@ class _MyHomePageState extends State<MyHomePage> {
crossAxisAlignment: CrossAxisAlignment.center,
children: <Widget>[

Card(
child: Column(
children: <Widget>[
Text("czsd"),
Row(
children: <Widget>[
OutlineButton(onPressed: null, child: Text("dscds"), color: Colors.orange, ),
FlatButton(onPressed: null, child: Text("dchbvj"))
],
)
],
),
),

GFButtonBar(
mainAxisSize: MainAxisSize.min,
children: <Widget>[
GFButton(onPressed: null, child: Text("like"), icon: Icon(Icons.favorite_border), type: GFType.transparent,),
GFButton(onPressed: null, child: Text("comment"),),
GFButton(onPressed: null, child: Text("share"), icon: Icon(Icons.share), type: GFType.outline,),
],
),

GFTitleBar(
avatar: GFAvatar(
child: Text("tb"),
),
title: Text('title'),
subTitle: Text('subtitle'),
icon: GFIconButton(
type: GFType.transparent,
icon: Icon(Icons.favorite_border),
),
),

GFCard(
avatar: GFAvatar(
child: Text("tb"),
),
title: Text('title'),
subTitle: Text('subtitle'),
icon: GFIconButton(
icon: Icon(Icons.favorite_border),
type: GFType.transparent,
),
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 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, ),
],
),

),





// GFCard(
// headertype: GFAtb(),
// po
// image
// overlaytext
// content: Text("content"),
// buttonbar: gfbb()
// GFButtonBar(
// mainAxisSize: MainAxisSize.min,
// children: <Widget>[
// GFButton(onPressed: null, child: Text("like"), icon: Icon(Icons.favorite_border), type: GFType.transparent,),
// GFButton(onPressed: null, child: Text("comment"),),
// GFButton(onPressed: null, child: Text("share"), icon: Icon(Icons.share), type: GFType.outline,),
// ],
// ),
//
// gfbb(
// children[
//
// ]
// )
// GFimageoverlay()
// GFTitleBar(
// avatar: GFAvatar(
// child: Text("tb"),
// ),
// title: Text('title'),
// subTitle: Text('subtitle'),
// icon: GFIconButton(
// onPressed: null,
// type: GFType.transparent,
// icon: Icon(Icons.favorite_border),
// ),
// ),

GFAvatar(
// radius: 20.0,
child: Text("de"),
backgroundColor: Colors.pink,
// backgroundImage: ,
// foregroundColor: Colors.deepOrangeAccent,
// shape: GFShape.standard,
// size: GFSize.medium,
// borderRadius: BorderRadius.circular(20.0),
),
GFIconBadges(
onPressed: null,
child: GFIconButton(
onPressed: null,
icon: Icon(Icons.ac_unit),
),
counterChild: GFBadge(
text: '12',
// color: GFColor.dark,
// shape: GFShape.circle,
// size: GFSize.small,
// border: BorderSide(color: Colors.pink, width: 1.0, style: BorderStyle.solid),
// textColor: GFColor.white,
// textStyle: TextStyle(fontWeight: FontWeight.w500, fontSize: 8.0),
// borderShape: RoundedRectangleBorder(side: BorderSide(color: Colors.orange, width: 2.0, style: BorderStyle.solid), borderRadius: BorderRadius.zero),
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),
),
GFIconButton(
onPressed: null,
icon: Icon(Icons.ac_unit),
// iconSize: 12.0,
// type: GFType.solid,
// shape: GFShape.pills,
// size: GFSize.large,
// buttonBoxShadow: true,
// color: GFColor.primary,
// boxShadow: BoxShadow(
// color: Colors.pink,
// blurRadius: 2.0,
// spreadRadius: 1.0,
// offset: Offset.zero,

//
// GFAvatar(
//// radius: 40.0,
// child: Text("de"),
// backgroundColor: Colors.pink,
//// backgroundImage: ,
//// foregroundColor: Colors.deepOrangeAccent,
//// shape: GFShape.square,
//// size: GFSize.medium,
//// borderRadius: BorderRadius.circular(20.0),
// ),
// GFIconBadges(
// onPressed: null,
// child: GFIconButton(
// onPressed: null,
// icon: Icon(Icons.ac_unit),
// ),
// borderSide: BorderSide(color: Colors.pink, width: 1.0, style: BorderStyle.solid),
// borderShape: RoundedRectangleBorder(side: BorderSide(color: Colors.pink, width: 2.0, style: BorderStyle.solid), borderRadius: BorderRadius.zero),
),
GFButtonBadge(
onPressed: null,
// position: GFIconPosition.start,
// borderSide: BorderSide(color: Colors.pink, width: 1.0, style: BorderStyle.solid),
// borderShape: RoundedRectangleBorder(side: BorderSide(color: Colors.pink, width: 2.0, style: BorderStyle.solid), borderRadius: BorderRadius.zero),
text: 'goodies',
// color: GFColor.danger,
// shape: GFShape.pills,
// type: GFType.outline,
// size: GFSize.small,
counterChild: GFBadge(
child: Text("12"),
// color: GFColor.dark,
// shape: GFShape.circle,
// size: GFSize.small,
// border: BorderSide(color: Colors.pink, width: 1.0, style: BorderStyle.solid),
// textColor: GFColor.white,
// textStyle: TextStyle(fontWeight: FontWeight.w500, fontSize: 8.0),
),
),
GFBadge(
text: '12',
// color: GFColor.dark,
// shape: GFShape.circle,
// size: GFSize.small,
// border: BorderSide(color: Colors.pink, width: 1.0, style: BorderStyle.solid),
// textColor: GFColor.white,
// textStyle: TextStyle(fontWeight: FontWeight.w500, fontSize: 8.0),
),
GFButton(
// type: GFType.solid,
// shape: GFShape.pills,
text: 'goodies',
onPressed: () {},
// textStyle: TextStyle(fontWeight: FontWeight.w500, fontSize: 8.0),
// size: GFSize.large,
// buttonBoxShadow: true,
// blockButton: true,
// fullWidthButton: true,
// color: GFColor.primary,
// textColor: GFColor.secondary,
// icon: Icon(Icons.error, color: Colors.white,),
// position: GFIconPosition.start,
// boxShadow: BoxShadow(
// color: Colors.pink,
// blurRadius: 2.0,
// spreadRadius: 1.0,
// offset: Offset.zero,
// counterChild: GFBadge(
// text: '12',
//// color: GFColor.dark,
//// shape: GFShape.circle,
//// size: GFSize.small,
//// border: BorderSide(color: Colors.pink, width: 1.0, style: BorderStyle.solid),
//// textColor: GFColor.white,
//// textStyle: TextStyle(fontWeight: FontWeight.w500, fontSize: 8.0),
//// borderShape: RoundedRectangleBorder(side: BorderSide(color: Colors.orange, width: 2.0, style: BorderStyle.solid), borderRadius: BorderRadius.zero),
// ),
// borderSide: BorderSide(color: Colors.pink, width: 1.0, style: BorderStyle.solid),
// borderShape: RoundedRectangleBorder(side: BorderSide(color: Colors.pink, width: 2.0, style: BorderStyle.solid), borderRadius: BorderRadius.zero),
),
// ),
// GFIconButton(
// onPressed: null,
// icon: Icon(Icons.ac_unit),
//// iconSize: 12.0,
//// type: GFType.solid,
//// shape: GFShape.pills,
//// size: GFSize.large,
//// buttonBoxShadow: true,
//// color: GFColor.primary,
//// boxShadow: BoxShadow(
//// color: Colors.pink,
//// blurRadius: 2.0,
//// spreadRadius: 1.0,
//// offset: Offset.zero,
//// ),
//// borderSide: BorderSide(color: Colors.pink, width: 1.0, style: BorderStyle.solid),
//// borderShape: RoundedRectangleBorder(side: BorderSide(color: Colors.pink, width: 2.0, style: BorderStyle.solid), borderRadius: BorderRadius.zero),
// ),
// GFButtonBadge(
// onPressed: null,
//// position: GFIconPosition.start,
//// borderSide: BorderSide(color: Colors.pink, width: 1.0, style: BorderStyle.solid),
//// borderShape: RoundedRectangleBorder(side: BorderSide(color: Colors.pink, width: 2.0, style: BorderStyle.solid), borderRadius: BorderRadius.zero),
// text: 'goodies',
//// color: GFColor.danger,
//// shape: GFShape.pills,
//// type: GFType.outline,
//// size: GFSize.small,
// counterChild: GFBadge(
// child: Text("12"),
//// color: GFColor.dark,
//// shape: GFShape.circle,
//// size: GFSize.small,
//// border: BorderSide(color: Colors.pink, width: 1.0, style: BorderStyle.solid),
//// textColor: GFColor.white,
//// textStyle: TextStyle(fontWeight: FontWeight.w500, fontSize: 8.0),
// ),
// ),
// GFBadge(
// text: '12',
//// color: GFColor.dark,
//// shape: GFShape.circle,
//// size: GFSize.small,
//// border: BorderSide(color: Colors.pink, width: 1.0, style: BorderStyle.solid),
//// textColor: GFColor.white,
//// textStyle: TextStyle(fontWeight: FontWeight.w500, fontSize: 8.0),
// ),
// GFButton(
//// type: GFType.solid,
//// shape: GFShape.pills,
// text: 'goodies',
// onPressed: () {},
//// textStyle: TextStyle(fontWeight: FontWeight.w500, fontSize: 8.0),
//// size: GFSize.large,
//// buttonBoxShadow: true,
//// blockButton: true,
//// fullWidthButton: true,
//// color: GFColor.primary,
//// textColor: GFColor.secondary,
//// icon: Icon(Icons.error, color: Colors.white,),
//// position: GFIconPosition.start,
//// boxShadow: BoxShadow(
//// color: Colors.pink,
//// blurRadius: 2.0,
//// spreadRadius: 1.0,
//// offset: Offset.zero,
//// ),
//// borderSide: BorderSide(color: Colors.pink, width: 1.0, style: BorderStyle.solid),
//// borderShape: RoundedRectangleBorder(side: BorderSide(color: Colors.pink, width: 2.0, style: BorderStyle.solid), borderRadius: BorderRadius.zero),
// ),
],
),
)
Expand Down
2 changes: 1 addition & 1 deletion lib/components/badge/gf_badge.dart
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ class GFBadge extends StatefulWidget {
this.size = GFSize.medium,
this.border,
this.text,
@required this.child,
this.child,
}) : assert(shape != null, 'Counter shape can not be null'),
super(key: key);

Expand Down
Loading