Skip to content

Commit e17fcc5

Browse files
committed
Merge branch 'master' of https://github.com/shravyackm/getflutter into toast
2 parents 634e2a8 + d7a2e83 commit e17fcc5

6 files changed

Lines changed: 207 additions & 142 deletions

File tree

README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
</a>
88
</p>
99

10-
[**GetFlutter**](https://www.getflutter.dev) is a 100% free Flutter open-source UI library that is built to make Flutter development easier and more joyful than ever. GetFlutter has 1000+ pre-build widgets that you can reuse to develop both Flutter mobile app and web app. Our motto is to provide the best Flutter UI library to the Flutter community to speed up their development process and build awesome apps with pre-build Flutter Library Components.
10+
[**GetFlutter**](https://www.getflutter.dev) is a 100% free Flutter open-source UI library built with <a href="https://flutter.dev/" target="_blank">Flutter SDK</a> to make Flutter development easier and more joyful than ever. GetFlutter has 1000+ pre-build widgets that you can reuse to develop both Flutter mobile app and web app. Our motto is to provide the best Flutter UI library to the Flutter community to speed up their development process and build awesome apps with pre-build Flutter Library Components.
1111

1212
## Table of contents
1313

@@ -78,7 +78,8 @@ Facebook: <https://www.facebook.com/getflutter>
7878
Linkedin: <https://www.linkedin.com/company/getflutter>
7979

8080
Instagram: <https://www.instagram.com/getflutter.dev/>
81-
81+
82+
### Note: GetFlutter is not directly and/or indirectly associated/affiliated with Flutter or Google LLC. We are the team of Flutter Developers and we built this open-source library for the Flutter development community to made app development more easier.
8283

8384
## Copyright-and-license
8485
Code and documentation Copyright 2017-2020 the [GETFLUTTER Authors](https://www.getflutter.dev) and [IONICFIREBASEAPP](https://ionicfirebaseapp.com) Code released under the [MIT License]. Docs released under [Creative Commons](https://creativecommons.org/licenses/by/3.0/).

example/lib/main.dart

Lines changed: 25 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -74,10 +74,10 @@ class _MyHomePageState extends State<MyHomePage>
7474
Widget build(BuildContext context) {
7575
return Scaffold(
7676
drawer: GFDrawer(
77-
colorFilter: new ColorFilter.mode(
78-
Colors.black.withOpacity(0.6), BlendMode.darken),
79-
backgroundImage: NetworkImage(
80-
"https://cdn.pixabay.com/photo/2017/12/03/18/04/christmas-balls-2995437_960_720.jpg"),
77+
// colorFilter: new ColorFilter.mode(
78+
// Colors.teal.withOpacity(0.6), BlendMode.darken),
79+
// backgroundImage: NetworkImage(
80+
// "https://cdn.pixabay.com/photo/2017/12/03/18/04/christmas-balls-2995437_960_720.jpg"),
8181
gradient: LinearGradient(
8282
begin: Alignment.topRight,
8383
end: Alignment.bottomLeft,
@@ -89,6 +89,7 @@ class _MyHomePageState extends State<MyHomePage>
8989
Colors.teal[200],
9090
],
9191
),
92+
color: Colors.greenAccent,
9293
child: ListView(
9394
padding: EdgeInsets.zero,
9495
children: <Widget>[
@@ -99,7 +100,7 @@ class _MyHomePageState extends State<MyHomePage>
99100
"https://cdn.pixabay.com/photo/2017/12/03/18/04/christmas-balls-2995437_960_720.jpg"),
100101
),
101102
decoration: BoxDecoration(
102-
color: Colors.teal.withOpacity(0.45),
103+
color: Colors.teal,
103104
),
104105
otherAccountsPictures: <Widget>[
105106
Image(
@@ -111,24 +112,23 @@ class _MyHomePageState extends State<MyHomePage>
111112
child: Text("dcf"),
112113
)
113114
],
115+
// closeButton: Text("Close"),
114116
child: Column(
115117
mainAxisAlignment: MainAxisAlignment.start,
116118
crossAxisAlignment: CrossAxisAlignment.start,
117119
children: <Widget>[
118-
Text('user'),
119-
Text('user@asdf.com'),
120+
Text('user name'),
121+
Text('user@userid.com'),
120122
],
121123
),
122124
),
123125
ListTile(
124126
title: Text('Item 1'),
125-
onTap: () {
126-
Navigator.pop(context);
127-
},
127+
onTap: null,
128128
),
129129
ListTile(
130130
title: Text('Item 2'),
131-
onTap: () {},
131+
onTap: null,
132132
),
133133
],
134134
),
@@ -175,15 +175,17 @@ class _MyHomePageState extends State<MyHomePage>
175175
// Container(color: Colors.green),
176176
// Container(color: Colors.blue)
177177
// ]),
178+
179+
178180
SingleChildScrollView(
179181
child: Column(
180182
mainAxisAlignment: MainAxisAlignment.center,
181183
crossAxisAlignment: CrossAxisAlignment.center,
182184
children: <Widget>[
183185
GFSearchBar(
184186
searchList: list,
185-
hideSearchBoxWhenItemSelected: false,
186-
overlaySearchListHeight: 100.0,
187+
// hideSearchBoxWhenItemSelected: false,
188+
// overlaySearchListHeight: 100.0,
187189
searchQueryBuilder: (query, list) {
188190
return list
189191
.where((item) =>
@@ -192,17 +194,17 @@ class _MyHomePageState extends State<MyHomePage>
192194
},
193195
overlaySearchListItemBuilder: (item) {
194196
return Container(
195-
padding: const EdgeInsets.all(12),
197+
padding: const EdgeInsets.all(8),
196198
child: Text(
197199
item,
198200
style: const TextStyle(fontSize: 18),
199201
),
200202
);
201203
},
202-
noItemsFoundWidget: Container(
203-
color: Colors.green,
204-
child: Text("no items found"),
205-
),
204+
// noItemsFoundWidget: Container(
205+
// color: Colors.green,
206+
// child: Text("no items found..."),
207+
// ),
206208
onItemSelected: (item) {
207209
setState(() {
208210
print('ssssssss $item');
@@ -646,6 +648,7 @@ class _MyHomePageState extends State<MyHomePage>
646648
// ),
647649
//
648650
GFButton(
651+
// position: GFPosition.end,
649652
// icon: GFBadge(
650653
// child: Text("12"),
651654
// color: GFColor.dark,
@@ -662,9 +665,9 @@ class _MyHomePageState extends State<MyHomePage>
662665
// hoverColor: GFColor.dark,
663666
color: GFColor.secondary,
664667
// focusColor: GFColor.danger,
665-
type: GFButtonType.solid,
666-
shape: GFButtonShape.pills,
667-
buttonBoxShadow: true,
668+
// type: GFButtonType.solid,
669+
// shape: GFButtonShape.pills,
670+
// buttonBoxShadow: true,
668671
// boxShadow: BoxShadow(
669672
// color: Colors.pink,
670673
// blurRadius: 2.0,
@@ -676,7 +679,7 @@ class _MyHomePageState extends State<MyHomePage>
676679
// size: GFSize.large,
677680
// disabledColor: GFColor.dark,
678681
// disabledTextColor: GFColor.light,
679-
blockButton: true,
682+
// blockButton: true,
680683
// fullWidthButton: true,
681684
// borderSide: BorderSide(color: Colors.pink, width: 1.0, style: BorderStyle.solid),
682685
// borderShape: RoundedRectangleBorder(side: BorderSide(color: Colors.pink, width: 2.0, style: BorderStyle.solid), borderRadius: BorderRadius.zero),

lib/components/appbar/gf_appbar.dart

Lines changed: 27 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -408,41 +408,38 @@ class _GFAppBarState extends State<GFAppBar> {
408408
);
409409
}
410410

411-
searchBar = ListTile(
412-
contentPadding: EdgeInsets.zero,
413-
title: TextField(
414-
cursorColor: widget.searchBarColorTheme,
415-
style: widget.searchTextStyle,
416-
decoration: new InputDecoration(
417-
prefixIcon: new Icon(
418-
Icons.search,
411+
searchBar = TextField(
412+
cursorColor: widget.searchBarColorTheme,
413+
style: widget.searchTextStyle,
414+
decoration: new InputDecoration(
415+
prefixIcon: new Icon(
416+
Icons.search,
417+
color: widget.searchBarColorTheme,
418+
size: 18.0,
419+
),
420+
suffixIcon: GFIconButton(
421+
icon: Icon(
422+
Icons.close,
419423
color: widget.searchBarColorTheme,
420-
size: 18.0,
421-
),
422-
hintText: widget.searchHintText,
423-
hintStyle: widget.searchHintStyle,
424-
focusedBorder: UnderlineInputBorder(
425-
borderSide: BorderSide(width: 1, color: widget.searchBarColorTheme),
424+
size: 20.0,
426425
),
426+
type: GFButtonType.transparent,
427+
onPressed: () {
428+
setState(() {
429+
showSearchBar = !showSearchBar;
430+
});
431+
},
427432
),
428-
onTap: widget.onTap,
429-
onChanged: widget.onChanged,
430-
controller: widget.searchController,
431-
onSubmitted: widget.onSubmitted,
432-
),
433-
trailing: GFIconButton(
434-
icon: Icon(
435-
Icons.close,
436-
color: widget.searchBarColorTheme,
437-
size: 20.0,
433+
hintText: widget.searchHintText,
434+
hintStyle: widget.searchHintStyle,
435+
focusedBorder: UnderlineInputBorder(
436+
borderSide: BorderSide(width: 1, color: widget.searchBarColorTheme),
438437
),
439-
type: GFButtonType.transparent,
440-
onPressed: () {
441-
setState(() {
442-
showSearchBar = !showSearchBar;
443-
});
444-
},
445438
),
439+
onTap: widget.onTap,
440+
onChanged: widget.onChanged,
441+
controller: widget.searchController,
442+
onSubmitted: widget.onSubmitted,
446443
);
447444

448445
if (!showSearchBar) {

lib/components/drawer/gf_drawer.dart

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -57,15 +57,16 @@ class GFDrawer extends StatelessWidget {
5757
/// Typically used in the [Scaffold.drawer] property.
5858
///
5959
/// The [elevation] must be non-negative.
60-
const GFDrawer(
61-
{Key key,
62-
this.elevation = 16.0,
63-
this.child,
64-
this.semanticLabel,
65-
this.backgroundImage,
66-
this.colorFilter,
67-
this.gradient})
68-
: assert(elevation != null && elevation >= 0.0),
60+
const GFDrawer({
61+
Key key,
62+
this.elevation = 16.0,
63+
this.child,
64+
this.semanticLabel,
65+
this.backgroundImage,
66+
this.colorFilter,
67+
this.gradient,
68+
this.color,
69+
}) : assert(elevation != null && elevation >= 0.0),
6970
super(key: key);
7071

7172
/// The z-coordinate at which to place this drawer relative to its parent.
@@ -105,6 +106,9 @@ class GFDrawer extends StatelessWidget {
105106
/// applying the same transform to the entire canvas.
106107
final Gradient gradient;
107108

109+
/// Defines the background color of the drawer
110+
final dynamic color;
111+
108112
@override
109113
Widget build(BuildContext context) {
110114
assert(debugCheckHasMaterialLocalizations(context));
@@ -131,7 +135,7 @@ class GFDrawer extends StatelessWidget {
131135
elevation: elevation,
132136
child: Container(
133137
decoration: new BoxDecoration(
134-
color: Colors.teal,
138+
color: color,
135139
gradient: gradient,
136140
image: backgroundImage != null
137141
? new DecorationImage(

lib/components/drawer/gf_drawer_header.dart

Lines changed: 39 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,39 @@
11
import 'package:flutter/widgets.dart';
22
import 'package:flutter/foundation.dart';
33
import 'package:flutter/material.dart';
4+
import 'package:getflutter/components/button/gf_icon_button.dart';
5+
import 'package:getflutter/getflutter.dart';
46

57
class GFDrawerHeaderPictures extends StatelessWidget {
6-
const GFDrawerHeaderPictures({
7-
Key key,
8-
this.currentAccountPicture,
9-
this.otherAccountsPictures,
10-
}) : super(key: key);
8+
const GFDrawerHeaderPictures(
9+
{Key key,
10+
this.currentAccountPicture,
11+
this.otherAccountsPictures,
12+
this.closeButton})
13+
: super(key: key);
1114

1215
final Widget currentAccountPicture;
1316
final List<Widget> otherAccountsPictures;
1417

18+
/// widget onTap drawer get closed
19+
final Widget closeButton;
20+
1521
@override
1622
Widget build(BuildContext context) {
1723
return Stack(
1824
children: <Widget>[
25+
closeButton == null
26+
? GFIconButton(
27+
icon: Icon(
28+
Icons.close,
29+
color: Colors.white,
30+
),
31+
onPressed: (){
32+
Navigator.pop(context);
33+
},
34+
type: GFButtonType.transparent,
35+
)
36+
: closeButton,
1937
PositionedDirectional(
2038
top: 0.0,
2139
end: 0.0,
@@ -39,7 +57,7 @@ class GFDrawerHeaderPictures extends StatelessWidget {
3957
),
4058
),
4159
Positioned(
42-
top: 0.0,
60+
top: 40.0,
4361
child: Semantics(
4462
explicitChildNodes: true,
4563
child: SizedBox(
@@ -71,6 +89,7 @@ class GFDrawerHeader extends StatefulWidget {
7189
this.child,
7290
this.duration = const Duration(milliseconds: 250),
7391
this.curve = Curves.fastOutSlowIn,
92+
this.closeButton
7493
}) : super(key: key);
7594

7695
/// The header's background. If decoration is null then a [BoxDecoration]
@@ -103,6 +122,9 @@ class GFDrawerHeader extends StatefulWidget {
103122
/// The curve for animations of the [decoration].
104123
final Curve curve;
105124

125+
/// widget onTap drawer get closed
126+
final Widget closeButton;
127+
106128
@override
107129
_GFDrawerHeaderState createState() => _GFDrawerHeaderState();
108130
}
@@ -112,10 +134,13 @@ class _GFDrawerHeaderState extends State<GFDrawerHeader> {
112134
Widget build(BuildContext context) {
113135
assert(debugCheckHasMaterial(context));
114136
assert(debugCheckHasMaterialLocalizations(context));
137+
final double statusBarHeight = MediaQuery.of(context).padding.top;
138+
115139
return Semantics(
116140
container: true,
117141
label: MaterialLocalizations.of(context).signedInLabel,
118-
child: DrawerHeader(
142+
child: Container(
143+
height: statusBarHeight + 185.0,
119144
decoration: widget.decoration ??
120145
BoxDecoration(
121146
color: Theme.of(context).primaryColor,
@@ -125,6 +150,7 @@ class _GFDrawerHeaderState extends State<GFDrawerHeader> {
125150
child: SafeArea(
126151
bottom: false,
127152
child: Column(
153+
mainAxisAlignment: MainAxisAlignment.center,
128154
crossAxisAlignment: CrossAxisAlignment.stretch,
129155
children: <Widget>[
130156
Expanded(
@@ -133,14 +159,16 @@ class _GFDrawerHeaderState extends State<GFDrawerHeader> {
133159
child: GFDrawerHeaderPictures(
134160
currentAccountPicture: widget.currentAccountPicture,
135161
otherAccountsPictures: widget.otherAccountsPictures,
162+
closeButton: widget.closeButton,
136163
),
137164
),
138165
),
139166
AnimatedContainer(
140-
padding: EdgeInsets.only(bottom: 16.0),
141-
duration: widget.duration,
142-
curve: widget.curve,
143-
child: widget.child),
167+
padding: EdgeInsets.only(bottom: 16.0),
168+
duration: widget.duration,
169+
curve: widget.curve,
170+
child: widget.child,
171+
),
144172
],
145173
),
146174
),

0 commit comments

Comments
 (0)