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
81 changes: 50 additions & 31 deletions example/lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import 'package:ui_kit/position/gf_position.dart';
import 'package:ui_kit/components/tabs/gf_tabs.dart';
import 'package:ui_kit/components/slider/gf_items_slider.dart';
import 'package:ui_kit/components/drawer/gf_drawer.dart';
import 'package:ui_kit/components/drawer/gf_drawer_header.dart';

final List<String> imageList = [
"https://cdn.pixabay.com/photo/2017/12/03/18/04/christmas-balls-2995437_960_720.jpg",
Expand Down Expand Up @@ -63,7 +64,7 @@ class _MyHomePageState extends State<MyHomePage> {
return Scaffold(
drawer: GFDrawer(
colorFilter: new ColorFilter.mode(Colors.black.withOpacity(0.6), BlendMode.darken),
// backgroundImage: NetworkImage("https://cdn.pixabay.com/photo/2017/12/03/18/04/christmas-balls-2995437_960_720.jpg"),
backgroundImage: NetworkImage("https://cdn.pixabay.com/photo/2017/12/03/18/04/christmas-balls-2995437_960_720.jpg"),
gradient: LinearGradient(
begin: Alignment.topRight,
end: Alignment.bottomLeft,
Expand All @@ -78,22 +79,37 @@ class _MyHomePageState extends State<MyHomePage> {
child: ListView(
padding: EdgeInsets.zero,
children: <Widget>[
UserAccountsDrawerHeader(),
DrawerHeader(
GFDrawerHeader(
currentAccountPicture: GFAvatar(
radius: 80.0,
backgroundImage: NetworkImage("https://cdn.pixabay.com/photo/2017/12/03/18/04/christmas-balls-2995437_960_720.jpg"),
),

decoration: BoxDecoration(
color: Colors.teal.withOpacity(0.45),
),
otherAccountsPictures: <Widget>[
Image(
image: NetworkImage("https://cdn.pixabay.com/photo/2019/12/20/00/03/road-4707345_960_720.jpg"),
fit: BoxFit.cover,
),
GFAvatar(
child: Text("dcf"),
)
],
child: Column(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Text('Drawer Header'),
Text('Drawer Header'),
Text('Drawer Header'),
Text('user'),
Text('user@asdf.com'),
],
),
decoration: BoxDecoration(
color: Colors.blue,
),
),
ListTile(
title: Text('Item 1'),
onTap: () {
Navigator.pop(context);
},
),
ListTile(
Expand All @@ -107,13 +123,16 @@ class _MyHomePageState extends State<MyHomePage> {
backgroundColor: Colors.cyanAccent,
appBar: AppBar(
title: Text(widget.title),

),
body: SingleChildScrollView(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center,
children: <Widget>[
GFAvatar(
radius: 80.0,
backgroundImage: NetworkImage("https://cdn.pixabay.com/photo/2017/12/03/18/04/christmas-balls-2995437_960_720.jpg"),
),

// GFItemsSlider(
// rowCount: 3,
Expand Down Expand Up @@ -167,7 +186,7 @@ class _MyHomePageState extends State<MyHomePage> {
// ),

GFButton(
color: Colors.green,
// color: Colors.green,
onPressed: null,
child: Text("share"),
type: GFType.outline,
Expand Down Expand Up @@ -482,26 +501,26 @@ class _MyHomePageState extends State<MyHomePage> {
//// 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: GFButtonShape.pills,
//// type: GFType.outline,
//// size: GFSize.small,
// counterChild: GFBadge(
// child: Text("12"),
//// color: GFColor.dark,
// shape: GFBadgeShape.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),
// ),
// ),
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: GFButtonShape.pills,
type: GFType.outline,
// size: GFSize.small,
counterChild: GFBadge(
child: Text("12"),
// color: GFColor.dark,
shape: GFBadgeShape.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,
Expand Down
4 changes: 2 additions & 2 deletions lib/components/badge/gf_button_badge.dart
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ class GFButtonBadge extends StatefulWidget {
this.type = GFType.solid,
this.shape = GFButtonShape.standard,
this.color = GFColor.primary,
this.textColor = GFColor.dark,
this.textColor,
this.position = GFPosition.end,
this.size = GFSize.medium,
this.borderSide,
Expand Down Expand Up @@ -88,7 +88,7 @@ class _GFButtonBadgeState extends State<GFButtonBadge> {
@override
void initState() {
this.color = getGFColor(widget.color);
this.textColor = getGFColor(widget.textColor);
this.textColor = widget.type == GFType.outline && widget.textColor == null ? this.color : widget.textColor == null ? getGFColor(GFColor.dark) : getGFColor(widget.textColor);
this.onPressed = widget.onPressed;
this.type = widget.type;
this.shape = widget.shape;
Expand Down
Loading