Skip to content

Commit 45df68b

Browse files
committed
checking all the components
1 parent c257c7d commit 45df68b

4 files changed

Lines changed: 179 additions & 106 deletions

File tree

example/lib/main.dart

Lines changed: 105 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -90,14 +90,15 @@ class _MyHomePageState extends State<MyHomePage> {
9090
child: Column(
9191
children: <Widget>[
9292

93+
9394
// GFCard(
9495
//// boxFit: BoxFit.cover,
9596
//// colorFilter: new ColorFilter.mode(
9697
//// Colors.black.withOpacity(0.67), BlendMode.darken),
9798
// image: Image.asset("lib/assets/food.jpeg"),
9899
//// imageOverlay: AssetImage("lib/assets/food.jpeg"),
99100
// titlePosition: GFPosition.end,
100-
// title: GFListItem(
101+
// title: GFListTile(
101102
// avatar: GFAvatar(
102103
// child: Text("tb"),
103104
// ),
@@ -117,56 +118,72 @@ class _MyHomePageState extends State<MyHomePage> {
117118
// ),
118119
// ),
119120

120-
//
121-
// GFCard(
122-
// title: GFListItem(
123-
// title: Text('dcrfvjn'),
124-
// subTitle: Text('fghjk'),
125-
//
126-
// ),
127-
//
128-
// ),
129-
121+
GFAvatar(),
122+
GFBadge(
123+
child: Text('1')),
124+
GFButton(onPressed: null,
125+
type: GFType.solid,
126+
text: 'CLICK',
127+
// position: GFPosition.end,
128+
icon: Icon(Icons.face),
129+
textStyle: TextStyle(color: Colors.black),
130+
),
131+
132+
GFButtonBar(
133+
children: <Widget>[
134+
Text('jk'),
135+
Icon(Icons.face)
136+
],
137+
),
130138

131139

132-
133-
134-
GFListTile(
135-
// avatar: Icon(Icons.format_align_center),
136-
// icon:Icon(Icons.format_align_center),
137-
title: Text('Header'),
138-
),
140+
139141
GFListTile(
140-
// avatar: Icon(Icons.format_align_center),
141-
// icon:Icon(Icons.format_align_center),
142-
title: Text('Header'),
142+
avatar: Icon(Icons.format_align_center),
143+
icon:Icon(Icons.format_align_center),
144+
title: GFHeader(
145+
type: GFHeadingType.typo3,
146+
text: 'GFHeader in GFListTile',
147+
148+
backgroundImage: NetworkImage('https://cdn.pixabay.com/photo/2019/12/22/19/14/christmas-4713177_960_720.jpg')
149+
),
150+
subTitle: Text('Sub Header'),
151+
description: Text('Lorem ipsum gf header used to show the header of the list tile'),
143152
showDivider: false,
144153
),
145154

146155

147-
148-
149-
150-
GFListTile(
151-
avatar: GFAvatar(),
152-
153-
icon: Icon(Icons.description),
154-
title: Text('Header'),
155-
subTitle: Text('Sub Header'),
156-
description: Text('Lorem ipsum gf header used to show the header of the list tile'),
156+
Container(
157+
margin: EdgeInsets.only(top:10),
158+
child: GFToast(
159+
backgroundColor: GFColor.primary,
160+
161+
button: GFToggle(
162+
onChanged: null,
163+
value: null,
164+
type: GFToggleType.ios,
165+
duration: Duration(milliseconds: 400),
166+
),
167+
// text: 'hjkk',
168+
child: GFHeader(
169+
text: 'GFHEADER inside GFTOAST ',
170+
type: GFHeadingType.typo5,
171+
),
172+
),
157173
),
174+
158175
Container(
159176
margin: EdgeInsets.only(top:10),
160177
child: GFToast(
161-
//
162-
//
163-
//
164-
// button: GFButton(
165-
// onPressed: null,
166-
// type: GFType.outline,
167-
// text: 'Accept',
168-
// ),
169-
text: 'Marked as Favorite.',
178+
backgroundColor: GFColor.primary,
179+
180+
button: GFButton(
181+
type: GFType.outline,
182+
text: 'CLICK',
183+
onPressed: null,
184+
// position: GFPosition.end,
185+
),
186+
text: 'Marked as Favorite ',
170187
),
171188
),
172189
Container(
@@ -241,6 +258,54 @@ class _MyHomePageState extends State<MyHomePage> {
241258
],
242259
)
243260
),
261+
262+
GFImageOverlay(
263+
height: 250,
264+
// colorFilter: ColorFilter.mode(Colors.black, BlendMode.colorBurn),
265+
child: Column(
266+
children: <Widget>[
267+
GFHeader(
268+
text: 'GET FLUTTER HEADER',
269+
type: GFHeadingType.typo3,
270+
textColor: GFColor.white,
271+
dividerColor: GFColor.white,
272+
// dividerWidth: 20,
273+
),
274+
GFListTile(
275+
avatar: GFAvatar(
276+
backgroundColor: Colors.white,
277+
),
278+
icon:Icon(Icons.keyboard_arrow_right, color: Colors.white,),
279+
title: GFHeader(
280+
type: GFHeadingType.typo3,
281+
text: 'GFHeader in GFListTile',
282+
283+
backgroundImage: NetworkImage('https://cdn.pixabay.com/photo/2019/12/22/19/14/christmas-4713177_960_720.jpg')
284+
),
285+
subTitle: Text('Sub Header', style: TextStyle(color: Colors.white),),
286+
description: Text('Lorem ipsum gf header used to show the header of the list tile', style: TextStyle(color: Colors.white),),
287+
showDivider: false,
288+
),
289+
290+
GFToast(
291+
backgroundColor: GFColor.primary,
292+
293+
button: GFButton(
294+
type: GFType.outline,
295+
text: 'CLICK',
296+
onPressed: null,
297+
// position: GFPosition.end,
298+
),
299+
text: 'Marked as Favorite ',
300+
),
301+
],
302+
),
303+
// height: screenHeight,
304+
//width: screenWidth,
305+
// image: NetworkImage('https://cdn.pixabay.com/photo/2019/12/22/19/14/christmas-4713177_960_720.jpg'),
306+
307+
image: AssetImage('lib/assets/food.jpeg')
308+
)
244309

245310

246311
],

lib/components/header/gf_header.dart

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -100,18 +100,18 @@ class GFHeader extends StatelessWidget {
100100
? Padding(padding: EdgeInsets.only(left: 10))
101101
: Container(),
102102
text != null
103-
? Text(
104-
text,
105-
style: TextStyle(
106-
color: textColor != null
107-
? getGFColor(textColor)
108-
: backgroundImage != null
109-
? Colors.white
110-
: Colors.black,
111-
fontSize: fontSize,
112-
letterSpacing: 0.3,
113-
fontWeight: FontWeight.w500),
114-
)
103+
? Expanded(child: Text(
104+
text,
105+
style: TextStyle(
106+
color: textColor != null
107+
? getGFColor(textColor)
108+
: backgroundImage != null
109+
? Colors.white
110+
: Colors.black,
111+
fontSize: fontSize,
112+
letterSpacing: 0.3,
113+
fontWeight: FontWeight.w500),
114+
))
115115
: child
116116
],
117117
),

lib/components/image/gf_image_overlay.dart

Lines changed: 20 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,24 @@
1+
import 'dart:ui';
2+
13
import 'package:flutter/cupertino.dart';
24
import 'package:flutter/material.dart';
35

46
class GFImageOverlay extends StatelessWidget {
5-
6-
const GFImageOverlay({
7-
Key key,
8-
this.height,
9-
this.width,
10-
this.color,
11-
this.padding,
12-
this.margin,
13-
this.image,
14-
this.child,
15-
this.alignment,
16-
this.borderRadius,
17-
this.colorFilter,
18-
this.boxFit,
19-
this.border
20-
}) : super(key: key);
7+
const GFImageOverlay(
8+
{Key key,
9+
this.height,
10+
this.width,
11+
this.color,
12+
this.padding,
13+
this.margin,
14+
this.image,
15+
this.child,
16+
this.alignment,
17+
this.borderRadius,
18+
this.colorFilter,
19+
this.boxFit,
20+
this.border})
21+
: super(key: key);
2122

2223
/// define image's [double] height
2324
final double height;
@@ -59,11 +60,10 @@ class GFImageOverlay extends StatelessWidget {
5960

6061
@override
6162
Widget build(BuildContext context) {
62-
6363
return Container(
6464
alignment: alignment,
65-
height: height,
66-
width: width,
65+
height: height ?? MediaQuery.of(context).size.height * 0.3,
66+
width: width ?? MediaQuery.of(context).size.width,
6767
margin: margin,
6868
padding: padding,
6969
child: child,
@@ -72,14 +72,8 @@ class GFImageOverlay extends StatelessWidget {
7272
border: border,
7373
color: color,
7474
image: new DecorationImage(
75-
fit: boxFit,
76-
colorFilter: colorFilter,
77-
image: image
78-
),
75+
fit: BoxFit.fill, colorFilter: colorFilter, image: image),
7976
),
8077
);
8178
}
8279
}
83-
84-
85-

lib/components/toast/gf_toast.dart

Lines changed: 42 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -2,21 +2,21 @@ import 'package:flutter/material.dart';
22
import 'package:ui_kit/colors/gf_color.dart';
33

44
class GFToast extends StatelessWidget {
5-
65
///
7-
GFToast({Key key,
6+
GFToast({
7+
Key key,
88
this.child,
99
this.button,
1010
this.backgroundColor,
1111
this.text,
12-
this.textStyle = const TextStyle(color: Colors.white70),
13-
}) :super(key: key);
12+
this.textStyle = const TextStyle(color: Colors.white70),
13+
}) : super(key: key);
1414

1515
/// child of type [Widget]is alternative to text key. text will get priority over child
1616
final Widget child;
1717

1818
/// button of type [Widget],or you can use [GFButton] for easy implementation with [GFToast]
19-
final Widget button;
19+
final Widget button;
2020

2121
///pass color of type [Color] or [GFColor] for background of [GFToast]
2222
final dynamic backgroundColor;
@@ -27,32 +27,46 @@ class GFToast extends StatelessWidget {
2727
/// textStyle will be applicable to text only and not for the child
2828
final TextStyle textStyle;
2929

30-
3130
@override
3231
Widget build(BuildContext context) {
33-
return
34-
ConstrainedBox(constraints: BoxConstraints(minHeight: 50.0,), child: Container(
35-
margin: EdgeInsets.only(left: 10, right: 10),
36-
padding: EdgeInsets.all(10),
37-
decoration: BoxDecoration(
38-
borderRadius: BorderRadius.all(Radius.circular(3)),
39-
color: backgroundColor!=null ?getGFColor(backgroundColor):Color(0xff323232),
32+
return ConstrainedBox(
33+
constraints: BoxConstraints(
34+
minHeight: 50.0,
4035
),
41-
child: Row(
42-
children: <Widget>[
43-
Flexible(
44-
flex: 7,
45-
fit: FlexFit.tight,
46-
child: text!=null ? Text(text , style: textStyle):(child??Container()),),
47-
SizedBox(
48-
width: 10,
49-
),
50-
button!=null?Flexible(
51-
flex: 4,
36+
child: Container(
37+
margin: EdgeInsets.only(left: 10, right: 10),
38+
padding: EdgeInsets.all(10),
39+
decoration: BoxDecoration(
40+
borderRadius: BorderRadius.all(Radius.circular(3)),
41+
color: backgroundColor != null
42+
? getGFColor(backgroundColor)
43+
: Color(0xff323232),
44+
),
45+
child: Row(
46+
// mainAxisAlignment: MainAxisAlignment.end,
47+
children: <Widget>[
48+
Flexible(
49+
flex: 7,
5250
fit: FlexFit.tight,
53-
child: button):Container()
54-
],
51+
child: text != null
52+
? Text(text, style: textStyle)
53+
: (child ?? Container()),
54+
),
55+
SizedBox(
56+
width: 10,
57+
),
58+
button != null
59+
? Flexible(
60+
flex: 4,
61+
fit: FlexFit.tight,
62+
child: Align(
63+
alignment: Alignment.topRight,
64+
child: button,
65+
))
66+
: Container()
67+
],
68+
),
5569
),
56-
),);
70+
);
5771
}
58-
}
72+
}

0 commit comments

Comments
 (0)