Skip to content

Commit 0f018c8

Browse files
authored
Merge pull request #9 from deepikahr/card
Card
2 parents 2af8b0f + 49da838 commit 0f018c8

6 files changed

Lines changed: 300 additions & 207 deletions

File tree

example/lib/main.dart

Lines changed: 200 additions & 145 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1+
import 'package:flutter/cupertino.dart';
12
import 'package:flutter/material.dart';
3+
import 'package:flutter/painting.dart';
24
import 'package:ui_kit/components/button/gf_button.dart';
35
import 'package:ui_kit/components/button/gf_icon_button.dart';
46
import 'package:ui_kit/components/badge/gf_button_badge.dart';
@@ -7,9 +9,11 @@ import 'package:ui_kit/components/avatar/gf_avatar.dart';
79
import 'package:ui_kit/components/badge/gf_badge.dart';
810
import 'package:ui_kit/components/card/gf_card.dart';
911
import 'package:ui_kit/components/header_bar/gf_title_bar.dart';
10-
import 'package:ui_kit/components/image/gf_image_overlay.dart';
1112
import 'package:ui_kit/components/button_bar/gf_button_bar.dart';
13+
import 'package:ui_kit/position/gf_position.dart';
1214
import 'package:ui_kit/types/gf_type.dart';
15+
import 'package:ui_kit/components/image/gf_image_overlay.dart';
16+
import 'package:ui_kit/shape/gf_shape.dart';
1317

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

@@ -48,52 +52,123 @@ class _MyHomePageState extends State<MyHomePage> {
4852
crossAxisAlignment: CrossAxisAlignment.center,
4953
children: <Widget>[
5054

51-
Card(
55+
// Card(
56+
// child: Stack(
57+
// alignment: AlignmentDirectional.center,
58+
// children: <Widget>[
59+
//// Container(
60+
////// child: new Text(
61+
////// 'Hello world',
62+
////// style: Theme.of(context).textTheme.display4
63+
////// ),
64+
//// decoration: new BoxDecoration(
65+
//// color: const Color(0xff7c94b6),
66+
//// image: new DecorationImage(
67+
//// fit: BoxFit.cover,
68+
//// colorFilter: new ColorFilter.mode(Colors.black.withOpacity(0.2), BlendMode.dstATop),
69+
//// image: new NetworkImage(
70+
//// 'http://www.allwhitebackground.com/images/2/2582-190x190.jpg',
71+
//// ),
72+
//// ),
73+
//// ),
74+
//// ),
75+
// Image.network(
76+
// 'http://www.allwhitebackground.com/images/2/2582-190x190.jpg',
77+
// ),
78+
// Column(
79+
// mainAxisAlignment: MainAxisAlignment.spaceEvenly,
80+
// crossAxisAlignment: CrossAxisAlignment.center,
81+
// children: <Widget>[
82+
// GFTitleBar(
83+
// avatar: GFAvatar(
84+
// child: Text("tb"),
85+
// ),
86+
// title: Text('title'),
87+
// subTitle: Text('subtitle'),
88+
// icon: GFIconButton(
89+
// onPressed: null,
90+
// type: GFType.transparent,
91+
// icon: Icon(Icons.favorite_border),
92+
// ),
93+
// ),
94+
// Text("Flutter "
95+
// "Flutter is Google's mobile UI framework for crafting high-quality native interfaces on iOS and Android in "),
96+
// GFButtonBar(
97+
// mainAxisSize: MainAxisSize.min,
98+
// children: <Widget>[
99+
// GFButton(onPressed: null, child: Text("favorite"), icon: Icon(Icons.favorite_border), type: GFType.transparent, ),
100+
// GFButton(onPressed: null, child: Text("share"), icon: Icon(Icons.share), type: GFType.outline, ),
101+
// ],
102+
// ),
103+
//
104+
// ],
105+
// ),
106+
// ],
107+
// ),
108+
// ),
109+
//
110+
GFImageOverlay(
111+
height: 200.0,
112+
width: MediaQuery.of(context).size.width,
113+
margin: EdgeInsets.all(16.0),
114+
padding: EdgeInsets.all(16.0),
52115
child: Column(
116+
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
117+
crossAxisAlignment: CrossAxisAlignment.center,
53118
children: <Widget>[
54-
Text("czsd"),
55-
Row(
56-
children: <Widget>[
57-
OutlineButton(onPressed: null, child: Text("dscds"), color: Colors.orange, ),
58-
FlatButton(onPressed: null, child: Text("dchbvj"))
59-
],
60-
)
119+
new Text(
120+
'Hello world', style: TextStyle(color: Colors.white),
121+
),new Text(
122+
'Hello world', style: TextStyle(color: Colors.white),
123+
),
61124
],
62125
),
126+
// color: Colors.orange,
127+
image: AssetImage("lib/assets/pizza.jpeg"),
128+
boxFit: BoxFit.cover,
129+
colorFilter: new ColorFilter.mode(Colors.black.withOpacity(0.6), BlendMode.darken),
130+
borderRadius: new BorderRadius.circular(5.0),
131+
// border: Border.all(color: Colors.pink, width: 2.0),
63132
),
64133

65-
GFButtonBar(
66-
mainAxisSize: MainAxisSize.min,
67-
children: <Widget>[
68-
GFButton(onPressed: null, child: Text("like"), icon: Icon(Icons.favorite_border), type: GFType.transparent,),
69-
GFButton(onPressed: null, child: Text("comment"),),
70-
GFButton(onPressed: null, child: Text("share"), icon: Icon(Icons.share), type: GFType.outline,),
71-
],
72-
),
73-
74-
GFTitleBar(
75-
avatar: GFAvatar(
76-
child: Text("tb"),
77-
),
78-
title: Text('title'),
79-
subTitle: Text('subtitle'),
80-
icon: GFIconButton(
81-
type: GFType.transparent,
82-
icon: Icon(Icons.favorite_border),
83-
),
84-
),
134+
// GFButtonBar(
135+
// mainAxisSize: MainAxisSize.min,
136+
// children: <Widget>[
137+
// GFButton(onPressed: null, child: Text("like"), icon: Icon(Icons.favorite_border), type: GFType.transparent,),
138+
// GFButton(onPressed: null, child: Text("comment"),),
139+
// GFButton(onPressed: null, child: Text("share"), icon: Icon(Icons.share), type: GFType.outline,),
140+
// ],
141+
// ),
142+
//
143+
// GFTitleBar(
144+
// avatar: GFAvatar(
145+
// child: Text("tb"),
146+
// ),
147+
// title: Text('title'),
148+
// subTitle: Text('subtitle'),
149+
// icon: GFIconButton(
150+
// onPressed: null,
151+
// type: GFType.transparent,
152+
// icon: Icon(Icons.favorite_border),
153+
// ),
154+
// ),
85155

86156
GFCard(
157+
margin: EdgeInsets.all(16.0),
158+
// color: Colors.pink,
159+
titlePosition: GFPosition.end,
87160
avatar: GFAvatar(
88161
child: Text("tb"),
89162
),
90163
title: Text('title'),
91164
subTitle: Text('subtitle'),
92165
icon: GFIconButton(
166+
onPressed: null,
93167
icon: Icon(Icons.favorite_border),
94168
type: GFType.transparent,
95169
),
96-
image: Image.asset("lib/assets/pizza.jpeg"),
170+
// image: Image.asset("lib/assets/pizza.jpeg"),
171+
// imageOverlay: Image.asset("lib/assets/pizza.jpeg"),
97172
content: Text("Flutter "
98173
"Flutter is Google's mobile UI framework for crafting high-quality native interfaces on iOS and Android in "),
99174
buttonBar: GFButtonBar(
@@ -105,124 +180,104 @@ class _MyHomePageState extends State<MyHomePage> {
105180
),
106181

107182
),
108-
109-
110-
111-
112-
113-
// GFCard(
114-
// headertype: GFAtb(),
115-
// po
116-
// image
117-
// overlaytext
118-
// content: Text("content"),
119-
// buttonbar: gfbb()
120-
// ),
121-
//
122-
// gfbb(
123-
// children[
124183
//
125-
// ]
126-
// )
127-
// GFimageoverlay()
128-
129-
GFAvatar(
130-
// radius: 20.0,
131-
child: Text("de"),
132-
backgroundColor: Colors.pink,
133-
// backgroundImage: ,
134-
// foregroundColor: Colors.deepOrangeAccent,
135-
// shape: GFShape.standard,
136-
// size: GFSize.medium,
137-
// borderRadius: BorderRadius.circular(20.0),
138-
),
139-
GFIconBadges(
140-
onPressed: null,
141-
child: GFIconButton(
142-
onPressed: null,
143-
icon: Icon(Icons.ac_unit),
144-
),
145-
counterChild: GFBadge(
146-
text: '12',
147-
// color: GFColor.dark,
148-
// shape: GFShape.circle,
149-
// size: GFSize.small,
150-
// border: BorderSide(color: Colors.pink, width: 1.0, style: BorderStyle.solid),
151-
// textColor: GFColor.white,
152-
// textStyle: TextStyle(fontWeight: FontWeight.w500, fontSize: 8.0),
153-
// borderShape: RoundedRectangleBorder(side: BorderSide(color: Colors.orange, width: 2.0, style: BorderStyle.solid), borderRadius: BorderRadius.zero),
154-
),
155-
),
156-
GFIconButton(
157-
onPressed: null,
158-
icon: Icon(Icons.ac_unit),
159-
// iconSize: 12.0,
160-
// type: GFType.solid,
161-
// shape: GFShape.pills,
162-
// size: GFSize.large,
163-
// buttonBoxShadow: true,
164-
// color: GFColor.primary,
165-
// boxShadow: BoxShadow(
166-
// color: Colors.pink,
167-
// blurRadius: 2.0,
168-
// spreadRadius: 1.0,
169-
// offset: Offset.zero,
184+
// GFAvatar(
185+
//// radius: 40.0,
186+
// child: Text("de"),
187+
// backgroundColor: Colors.pink,
188+
//// backgroundImage: ,
189+
//// foregroundColor: Colors.deepOrangeAccent,
190+
//// shape: GFShape.square,
191+
//// size: GFSize.medium,
192+
//// borderRadius: BorderRadius.circular(20.0),
193+
// ),
194+
// GFIconBadges(
195+
// onPressed: null,
196+
// child: GFIconButton(
197+
// onPressed: null,
198+
// icon: Icon(Icons.ac_unit),
170199
// ),
171-
// borderSide: BorderSide(color: Colors.pink, width: 1.0, style: BorderStyle.solid),
172-
// borderShape: RoundedRectangleBorder(side: BorderSide(color: Colors.pink, width: 2.0, style: BorderStyle.solid), borderRadius: BorderRadius.zero),
173-
),
174-
GFButtonBadge(
175-
onPressed: null,
176-
// position: GFIconPosition.start,
177-
// borderSide: BorderSide(color: Colors.pink, width: 1.0, style: BorderStyle.solid),
178-
// borderShape: RoundedRectangleBorder(side: BorderSide(color: Colors.pink, width: 2.0, style: BorderStyle.solid), borderRadius: BorderRadius.zero),
179-
text: 'goodies',
180-
// color: GFColor.danger,
181-
// shape: GFShape.pills,
182-
// type: GFType.outline,
183-
// size: GFSize.small,
184-
counterChild: GFBadge(
185-
child: Text("12"),
186-
// color: GFColor.dark,
187-
// shape: GFShape.circle,
188-
// size: GFSize.small,
189-
// border: BorderSide(color: Colors.pink, width: 1.0, style: BorderStyle.solid),
190-
// textColor: GFColor.white,
191-
// textStyle: TextStyle(fontWeight: FontWeight.w500, fontSize: 8.0),
192-
),
193-
),
194-
GFBadge(
195-
text: '12',
196-
// color: GFColor.dark,
197-
// shape: GFShape.circle,
198-
// size: GFSize.small,
199-
// border: BorderSide(color: Colors.pink, width: 1.0, style: BorderStyle.solid),
200-
// textColor: GFColor.white,
201-
// textStyle: TextStyle(fontWeight: FontWeight.w500, fontSize: 8.0),
202-
),
203-
GFButton(
204-
// type: GFType.solid,
205-
// shape: GFShape.pills,
206-
text: 'goodies',
207-
onPressed: () {},
208-
// textStyle: TextStyle(fontWeight: FontWeight.w500, fontSize: 8.0),
209-
// size: GFSize.large,
210-
// buttonBoxShadow: true,
211-
// blockButton: true,
212-
// fullWidthButton: true,
213-
// color: GFColor.primary,
214-
// textColor: GFColor.secondary,
215-
// icon: Icon(Icons.error, color: Colors.white,),
216-
// position: GFIconPosition.start,
217-
// boxShadow: BoxShadow(
218-
// color: Colors.pink,
219-
// blurRadius: 2.0,
220-
// spreadRadius: 1.0,
221-
// offset: Offset.zero,
200+
// counterChild: GFBadge(
201+
// text: '12',
202+
//// color: GFColor.dark,
203+
//// shape: GFShape.circle,
204+
//// size: GFSize.small,
205+
//// border: BorderSide(color: Colors.pink, width: 1.0, style: BorderStyle.solid),
206+
//// textColor: GFColor.white,
207+
//// textStyle: TextStyle(fontWeight: FontWeight.w500, fontSize: 8.0),
208+
//// borderShape: RoundedRectangleBorder(side: BorderSide(color: Colors.orange, width: 2.0, style: BorderStyle.solid), borderRadius: BorderRadius.zero),
222209
// ),
223-
// borderSide: BorderSide(color: Colors.pink, width: 1.0, style: BorderStyle.solid),
224-
// borderShape: RoundedRectangleBorder(side: BorderSide(color: Colors.pink, width: 2.0, style: BorderStyle.solid), borderRadius: BorderRadius.zero),
225-
),
210+
// ),
211+
// GFIconButton(
212+
// onPressed: null,
213+
// icon: Icon(Icons.ac_unit),
214+
//// iconSize: 12.0,
215+
//// type: GFType.solid,
216+
//// shape: GFShape.pills,
217+
//// size: GFSize.large,
218+
//// buttonBoxShadow: true,
219+
//// color: GFColor.primary,
220+
//// boxShadow: BoxShadow(
221+
//// color: Colors.pink,
222+
//// blurRadius: 2.0,
223+
//// spreadRadius: 1.0,
224+
//// offset: Offset.zero,
225+
//// ),
226+
//// borderSide: BorderSide(color: Colors.pink, width: 1.0, style: BorderStyle.solid),
227+
//// borderShape: RoundedRectangleBorder(side: BorderSide(color: Colors.pink, width: 2.0, style: BorderStyle.solid), borderRadius: BorderRadius.zero),
228+
// ),
229+
// GFButtonBadge(
230+
// onPressed: null,
231+
//// position: GFIconPosition.start,
232+
//// borderSide: BorderSide(color: Colors.pink, width: 1.0, style: BorderStyle.solid),
233+
//// borderShape: RoundedRectangleBorder(side: BorderSide(color: Colors.pink, width: 2.0, style: BorderStyle.solid), borderRadius: BorderRadius.zero),
234+
// text: 'goodies',
235+
//// color: GFColor.danger,
236+
//// shape: GFShape.pills,
237+
//// type: GFType.outline,
238+
//// size: GFSize.small,
239+
// counterChild: GFBadge(
240+
// child: Text("12"),
241+
//// color: GFColor.dark,
242+
//// shape: GFShape.circle,
243+
//// size: GFSize.small,
244+
//// border: BorderSide(color: Colors.pink, width: 1.0, style: BorderStyle.solid),
245+
//// textColor: GFColor.white,
246+
//// textStyle: TextStyle(fontWeight: FontWeight.w500, fontSize: 8.0),
247+
// ),
248+
// ),
249+
// GFBadge(
250+
// text: '12',
251+
//// color: GFColor.dark,
252+
//// shape: GFShape.circle,
253+
//// size: GFSize.small,
254+
//// border: BorderSide(color: Colors.pink, width: 1.0, style: BorderStyle.solid),
255+
//// textColor: GFColor.white,
256+
//// textStyle: TextStyle(fontWeight: FontWeight.w500, fontSize: 8.0),
257+
// ),
258+
// GFButton(
259+
//// type: GFType.solid,
260+
//// shape: GFShape.pills,
261+
// text: 'goodies',
262+
// onPressed: () {},
263+
//// textStyle: TextStyle(fontWeight: FontWeight.w500, fontSize: 8.0),
264+
//// size: GFSize.large,
265+
//// buttonBoxShadow: true,
266+
//// blockButton: true,
267+
//// fullWidthButton: true,
268+
//// color: GFColor.primary,
269+
//// textColor: GFColor.secondary,
270+
//// icon: Icon(Icons.error, color: Colors.white,),
271+
//// position: GFIconPosition.start,
272+
//// boxShadow: BoxShadow(
273+
//// color: Colors.pink,
274+
//// blurRadius: 2.0,
275+
//// spreadRadius: 1.0,
276+
//// offset: Offset.zero,
277+
//// ),
278+
//// borderSide: BorderSide(color: Colors.pink, width: 1.0, style: BorderStyle.solid),
279+
//// borderShape: RoundedRectangleBorder(side: BorderSide(color: Colors.pink, width: 2.0, style: BorderStyle.solid), borderRadius: BorderRadius.zero),
280+
// ),
226281
],
227282
),
228283
)

0 commit comments

Comments
 (0)