Skip to content

Commit dc09e8a

Browse files
committed
master pull changes
1 parent 72e8cbc commit dc09e8a

File tree

2 files changed

+116
-120
lines changed

2 files changed

+116
-120
lines changed

example/lib/main.dart

Lines changed: 107 additions & 108 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,13 @@ void main() => runApp(MyApp());
1616
class MyApp extends StatelessWidget {
1717
@override
1818
Widget build(BuildContext context) => MaterialApp(
19-
title: 'getflutter_EXAMPLE',
20-
theme: ThemeData(
21-
primarySwatch: Colors.blue,
22-
),
23-
debugShowCheckedModeBanner: false,
24-
home: const MyHomePage(title: 'getflutter_EXAMPLE'),
25-
);
19+
title: 'getflutter_EXAMPLE',
20+
theme: ThemeData(
21+
primarySwatch: Colors.blue,
22+
),
23+
debugShowCheckedModeBanner: false,
24+
home: const MyHomePage(title: 'getflutter_EXAMPLE'),
25+
);
2626
}
2727

2828
class MyHomePage extends StatefulWidget {
@@ -36,7 +36,8 @@ class MyHomePage extends StatefulWidget {
3636

3737
class _MyHomePageState extends State<MyHomePage>
3838
with SingleTickerProviderStateMixin {
39-
static final GlobalKey<ScaffoldState> scaffoldKey = GlobalKey<ScaffoldState>();
39+
static final GlobalKey<ScaffoldState> scaffoldKey =
40+
GlobalKey<ScaffoldState>();
4041

4142
TabController tabController;
4243

@@ -70,72 +71,72 @@ class _MyHomePageState extends State<MyHomePage>
7071

7172
@override
7273
Widget build(BuildContext context) => Scaffold(
73-
drawer: GFDrawer(
74+
drawer: GFDrawer(
7475
// colorFilter: new ColorFilter.mode(
7576
// Colors.teal.withOpacity(0.6), BlendMode.darken),
7677
// backgroundImage: NetworkImage(
7778
// "https://cdn.pixabay.com/photo/2017/12/03/18/04/christmas-balls-2995437_960_720.jpg"),
78-
gradient: LinearGradient(
79-
begin: Alignment.topRight,
80-
end: Alignment.bottomLeft,
81-
stops: [0.1, 0.5, 0.7, 0.9],
82-
colors: [
83-
Colors.teal[800],
84-
Colors.teal[600],
85-
Colors.teal[400],
86-
Colors.teal[200],
87-
],
88-
),
89-
color: Colors.greenAccent,
90-
child: ListView(
91-
padding: EdgeInsets.zero,
92-
children: <Widget>[
93-
GFDrawerHeader(
94-
currentAccountPicture: const GFAvatar(
95-
radius: 80,
96-
backgroundImage: NetworkImage(
97-
'https://cdn.pixabay.com/photo/2017/12/03/18/04/christmas-balls-2995437_960_720.jpg'),
98-
),
99-
decoration: BoxDecoration(
100-
color: Colors.teal,
101-
),
102-
otherAccountsPictures: const <Widget>[
103-
Image(
104-
image: NetworkImage(
105-
'https://cdn.pixabay.com/photo/2019/12/20/00/03/road-4707345_960_720.jpg'),
106-
fit: BoxFit.cover,
79+
gradient: LinearGradient(
80+
begin: Alignment.topRight,
81+
end: Alignment.bottomLeft,
82+
stops: [0.1, 0.5, 0.7, 0.9],
83+
colors: [
84+
Colors.teal[800],
85+
Colors.teal[600],
86+
Colors.teal[400],
87+
Colors.teal[200],
88+
],
89+
),
90+
color: Colors.greenAccent,
91+
child: ListView(
92+
padding: EdgeInsets.zero,
93+
children: <Widget>[
94+
GFDrawerHeader(
95+
currentAccountPicture: const GFAvatar(
96+
radius: 80,
97+
backgroundImage: NetworkImage(
98+
'https://cdn.pixabay.com/photo/2017/12/03/18/04/christmas-balls-2995437_960_720.jpg'),
10799
),
108-
GFAvatar(
109-
child: Text('dcf'),
110-
)
111-
],
112-
// closeButton: Text("Close"),
113-
child: Column(
114-
mainAxisAlignment: MainAxisAlignment.start,
115-
crossAxisAlignment: CrossAxisAlignment.start,
116-
children: const <Widget>[
117-
Text('user name'),
118-
100+
decoration: BoxDecoration(
101+
color: Colors.teal,
102+
),
103+
otherAccountsPictures: const <Widget>[
104+
Image(
105+
image: NetworkImage(
106+
'https://cdn.pixabay.com/photo/2019/12/20/00/03/road-4707345_960_720.jpg'),
107+
fit: BoxFit.cover,
108+
),
109+
GFAvatar(
110+
child: Text('dcf'),
111+
)
119112
],
113+
// closeButton: Text("Close"),
114+
child: Column(
115+
mainAxisAlignment: MainAxisAlignment.start,
116+
crossAxisAlignment: CrossAxisAlignment.start,
117+
children: const <Widget>[
118+
Text('user name'),
119+
120+
],
121+
),
120122
),
121-
),
122-
const ListTile(
123-
title: Text('Item 1'),
124-
onTap: null,
125-
),
126-
const ListTile(
127-
title: Text('Item 2'),
128-
onTap: null,
129-
),
130-
],
123+
const ListTile(
124+
title: Text('Item 1'),
125+
onTap: null,
126+
),
127+
const ListTile(
128+
title: Text('Item 2'),
129+
onTap: null,
130+
),
131+
],
132+
),
131133
),
132-
),
133134

134-
appBar: GFAppBar(
135-
backgroundColor: Colors.teal,
135+
appBar: GFAppBar(
136+
backgroundColor: Colors.teal,
136137
// centerTitle: true,
137138
// leading: GFIconButton(icon: Icon(Icons.directions_bus), onPressed: (){}),
138-
title: const Text('UI Kit'),
139+
title: const Text('UI Kit'),
139140
// bottom: TabBar(
140141
// controller: tabController,
141142
// tabs: [
@@ -144,26 +145,26 @@ class _MyHomePageState extends State<MyHomePage>
144145
// Tab(icon: Icon(Icons.directions_bike)),
145146
// ],
146147
// ),
147-
searchBar: true,
148+
searchBar: true,
148149
// searchHintText: "aaaaaaa",
149150
// searchHintStyle: TextStyle(fontSize: 18.0, color: Colors.redAccent),
150151
// searchStyle: TextStyle(fontSize: 10.0, color: Colors.green),
151152
// searchBarColorTheme: Colors.greenAccent,
152153

153-
actions: <Widget>[
154+
actions: <Widget>[
154155
// GFIconButton(icon: Icon(Icons.access_time), onPressed: () {}),
155-
GFIconButton(
156-
icon: Icon(
157-
Icons.favorite,
158-
color: Colors.white,
156+
GFIconButton(
157+
icon: Icon(
158+
Icons.favorite,
159+
color: Colors.white,
160+
),
161+
onPressed: () {},
162+
type: GFButtonType.transparent,
159163
),
160-
onPressed: () {},
161-
type: GFButtonType.transparent,
162-
),
163-
],
164-
),
164+
],
165+
),
165166
// backgroundColor: Colors.blueGrey,
166-
body:
167+
body:
167168
// GFTabBarView(
168169
// height: 200.0,
169170
// controller: tabController,
@@ -175,11 +176,10 @@ class _MyHomePageState extends State<MyHomePage>
175176

176177
// SingleChildScrollView(
177178
// child:
178-
Column(
179+
Column(
179180
mainAxisAlignment: MainAxisAlignment.start,
180181
crossAxisAlignment: CrossAxisAlignment.center,
181182
children: <Widget>[
182-
183183
GFSearchBar(
184184
// searchBoxInputDecoration: InputDecoration(
185185
// enabledBorder: OutlineInputBorder(
@@ -189,49 +189,48 @@ class _MyHomePageState extends State<MyHomePage>
189189
// borderRadius: BorderRadius.circular(50)
190190
// ),
191191
// ),
192-
searchList: list,
192+
searchList: list,
193193
// hideSearchBoxWhenItemSelected: false,
194194
// overlaySearchListHeight: 100.0,
195-
searchQueryBuilder: (query, list) => list
195+
searchQueryBuilder: (query, list) => list
196196
.where((item) =>
197197
item.toLowerCase().contains(query.toLowerCase()))
198198
.toList(),
199-
overlaySearchListItemBuilder: (item) =>Container(
200-
padding: const EdgeInsets.all(8),
201-
child: Text(
202-
item,
203-
style: const TextStyle(fontSize: 18),
204-
),
205-
),
199+
overlaySearchListItemBuilder: (item) => Container(
200+
padding: const EdgeInsets.all(8),
201+
child: Text(
202+
item,
203+
style: const TextStyle(fontSize: 18),
204+
),
205+
),
206206
// noItemsFoundWidget: Container(
207207
// color: Colors.green,
208208
// child: Text("no items found..."),
209209
// ),
210-
onItemSelected: (item) {
210+
onItemSelected: (item) {
211+
setState(() {
212+
print('ssssssss $item');
213+
});
214+
}),
215+
216+
GFRating(
217+
rating: rating,
218+
// itemSize: 65,
219+
filledIcon: Icons.star,
220+
halfFilledIcon: Icons.star_half,
221+
defaultIcon: Icons.star_border,
222+
itemCount: 5,
223+
allowHalfRating: false,
224+
spacing: 2,
225+
color: Colors.teal,
226+
borderColor: Colors.tealAccent,
227+
onRatingChanged: (value) {
211228
setState(() {
212-
print('ssssssss $item');
229+
rating = value;
213230
});
214-
}
231+
},
215232
),
216233

217-
GFRating(
218-
rating: rating,
219-
// itemSize: 65,
220-
filledIcon: Icons.star,
221-
halfFilledIcon: Icons.star_half,
222-
defaultIcon: Icons.star_border,
223-
itemCount: 5,
224-
allowHalfRating: false,
225-
spacing: 2.0,
226-
color: Colors.teal,
227-
borderColor: Colors.tealAccent,
228-
onRatingChanged: (value) {
229-
setState(() {
230-
rating = value;
231-
});
232-
},
233-
),
234-
235234
GFCard(
236235
content: Column(
237236
children: <Widget>[
@@ -1218,5 +1217,5 @@ class _MyHomePageState extends State<MyHomePage>
12181217
// fontFamily: 'OpenSansBold',
12191218
// ),
12201219
// ),
1221-
);
1220+
);
12221221
}

lib/components/rating/gf_rating.dart

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,9 @@ import 'package:flutter/material.dart';
33
typedef void RatingChangeCallback(double rating);
44

55
class GFRating extends StatelessWidget {
6-
76
GFRating({
87
this.itemCount = 5,
9-
this.spacing=0.0,
8+
this.spacing = 0.0,
109
this.rating = 0.0,
1110
this.defaultIcon,
1211
this.onRatingChanged,
@@ -53,8 +52,6 @@ class GFRating extends StatelessWidget {
5352
/// return current rating whenever rating is updated
5453
final RatingChangeCallback onRatingChanged;
5554

56-
57-
5855
Widget buildRatingBar(BuildContext context, int index) {
5956
Icon icon;
6057
if (index >= rating) {
@@ -89,11 +86,11 @@ class GFRating extends StatelessWidget {
8986

9087
@override
9188
Widget build(BuildContext context) => Material(
92-
color: Colors.transparent,
93-
child: Wrap(
94-
alignment: WrapAlignment.center,
95-
spacing: spacing,
96-
children: List.generate(
97-
itemCount, (index) => buildRatingBar(context, index))),
98-
);
99-
}
89+
color: Colors.transparent,
90+
child: Wrap(
91+
alignment: WrapAlignment.center,
92+
spacing: spacing,
93+
children: List.generate(
94+
itemCount, (index) => buildRatingBar(context, index))),
95+
);
96+
}

0 commit comments

Comments
 (0)