Skip to content

Commit ba2f2c5

Browse files
authored
Merge pull request #15 from ionicfirebaseapp/master
master pull
2 parents ce05e09 + df45070 commit ba2f2c5

File tree

9 files changed

+245
-188
lines changed

9 files changed

+245
-188
lines changed

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/accordian/gf_accordian.dart

Lines changed: 22 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -6,17 +6,18 @@ class GFAccordion extends StatefulWidget {
66
{Key key,
77
this.child,
88
this.content,
9-
this.titlebackgroundColor,
9+
this.collapsedTitlebackgroundColor = Colors.white,
10+
this.expandedTitlebackgroundColor= const Color(0xFFE0E0E0),
1011
this.collapsedIcon = const Icon(Icons.keyboard_arrow_down),
1112
this.expandedIcon = const Icon(Icons.keyboard_arrow_up),
1213
this.title,
1314
this.textStyle = const TextStyle(color: Colors.black, fontSize: 16),
14-
this.titlePadding,
15+
this.titlePadding = const EdgeInsets.all(10),
1516
this.contentbackgroundColor,
16-
this.contentPadding,
17+
this.contentPadding = const EdgeInsets.all(10),
1718
this.contentChild,
18-
this.titleborderColor,
19-
this.contentBorderColor,
19+
this.titleborderColor = const Border(),
20+
this.contentBorderColor = const Border(),
2021
this.margin})
2122
: super(key: key);
2223

@@ -29,8 +30,11 @@ class GFAccordion extends StatefulWidget {
2930
/// contentChild of type [Widget]is alternative to content key. content will get priority over contentChild
3031
final Widget contentChild;
3132

32-
/// type of [Color] or [GFColor] which is used to change the background color of the [GFAccordion] title
33-
final dynamic titlebackgroundColor;
33+
/// type of [Color] or [GFColor] which is used to change the background color of the [GFAccordion] title when it is collapsed
34+
final dynamic collapsedTitlebackgroundColor;
35+
36+
/// type of [Color] or [GFColor] which is used to change the background color of the [GFAccordion] title when it is expanded
37+
final dynamic expandedTitlebackgroundColor;
3438

3539
///collapsedIcon of type [Widget] which is used to show when the [GFAccordion] is collapsed
3640
final Widget collapsedIcon;
@@ -86,6 +90,11 @@ class _GFAccordionState extends State<GFAccordion>
8690
),
8791
);
8892
}
93+
@override
94+
void dispose() {
95+
animationController.dispose();
96+
super.dispose();
97+
}
8998

9099
bool showAccordion = false;
91100

@@ -113,21 +122,10 @@ class _GFAccordionState extends State<GFAccordion>
113122
},
114123
child: Container(
115124
decoration: BoxDecoration(
116-
border: widget.titleborderColor == null
117-
? widget.titleborderColor
118-
: Border(
119-
top: BorderSide(color: Colors.black38),
120-
left: BorderSide(color: Colors.black38),
121-
right: BorderSide(color: Colors.black38),
122-
bottom: BorderSide(color: Colors.black38)),
123-
color: showAccordion
124-
? widget.titlebackgroundColor != null
125-
? widget.titlebackgroundColor
126-
: Color(0xFFE0E0E0)
127-
: widget.titlebackgroundColor),
128-
padding: widget.titlePadding != null
129-
? widget.titlePadding
130-
: EdgeInsets.all(10),
125+
border: widget.titleborderColor,
126+
color: showAccordion ? widget.expandedTitlebackgroundColor: widget.collapsedTitlebackgroundColor),
127+
padding: widget.titlePadding
128+
,
131129
child: Row(
132130
mainAxisAlignment: MainAxisAlignment.spaceBetween,
133131
children: <Widget>[
@@ -144,20 +142,13 @@ class _GFAccordionState extends State<GFAccordion>
144142
showAccordion
145143
? Container(
146144
decoration: BoxDecoration(
147-
border: widget.contentBorderColor == null
148-
? widget.contentBorderColor
149-
: Border(
150-
bottom: BorderSide(color: Colors.black38),
151-
left: BorderSide(color: Colors.black38),
152-
right: BorderSide(color: Colors.black38)),
145+
border: widget.contentBorderColor,
153146
color: widget.contentbackgroundColor != null
154147
? widget.contentbackgroundColor
155148
: Colors.white70,
156149
),
157150
width: MediaQuery.of(context).size.width,
158-
padding: widget.contentPadding != null
159-
? widget.contentPadding
160-
: EdgeInsets.all(10),
151+
padding: widget.contentPadding ,
161152
child: SlideTransition(
162153
position: offset,
163154
child: widget.content != null

lib/components/alert/gf_alert.dart

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -16,16 +16,15 @@ class GFAlert extends StatefulWidget {
1616
this.contentChild,
1717
this.title,
1818
this.bottombar,
19-
this.animationDuration = const Duration(milliseconds: 300),
20-
this.textStyle = const TextStyle(color: Colors.black87),
19+
this.contentTextStyle = const TextStyle(color: Colors.black87),
2120
this.titleTextStyle = const TextStyle(
2221
color: Colors.black87, fontSize: 17, fontWeight: FontWeight.w500)})
2322
: super(key: key);
2423

25-
/// child of type [Widget]is alternative to text key. text will get priority over child
24+
/// child of type [Widget]is alternative to title key. title will get priority over child
2625
final Widget child;
2726

28-
/// title of type [String] used to descripe the title of the [GFAlert]
27+
/// title of type [String] used to describe the title of the [GFAlert]
2928
final String title;
3029

3130
/// child of type [Widget]is alternative to title key. title will get priority over contentchild
@@ -34,24 +33,22 @@ class GFAlert extends StatefulWidget {
3433
/// title of type [String] used to describe the content of the [GFAlert]
3534
final String content;
3635

36+
///type of [TextStyle] to change the style of the title not for the child
3737
final TextStyle titleTextStyle;
3838

3939
///pass color of type [Color] or [GFColor] for background of [GFAlert]
4040
final dynamic backgroundColor;
4141

42-
/// textStyle of type [textStyle] will be applicable to text only and not for the child
43-
final TextStyle textStyle;
42+
///type of [TextStyle] to change the style of the content not for the contentchild
43+
final TextStyle contentTextStyle;
4444

4545
/// width of type [double] used to control the width of the [GFAlert]
4646
final double width;
4747

4848
///type of [GFAlertType] which takes the type ie, basic, rounded and fullWidth for the [GFAlert]
4949
final GFAlertType type;
5050

51-
///type of [Duration] which takes the duration of the fade in animation
52-
final Duration animationDuration;
53-
54-
/// type of [Alignment] used to align the text inside the toast
51+
/// type of [Alignment] used to align the text inside the [GFAlert]
5552
final Alignment alignment;
5653

5754
///type of [Widget] used for the buttons ie, OK, Cancel for the action in [GFAlert]
@@ -71,7 +68,6 @@ class _GFAlertState extends State<GFAlert> with TickerProviderStateMixin {
7168
duration: const Duration(milliseconds: 300), vsync: this);
7269
animation = CurvedAnimation(
7370
parent: animationController, curve: Curves.fastOutSlowIn);
74-
7571
animationController.forward();
7672
super.initState();
7773
}
@@ -113,9 +109,13 @@ class _GFAlertState extends State<GFAlert> with TickerProviderStateMixin {
113109
child: Column(
114110
crossAxisAlignment: CrossAxisAlignment.start,
115111
children: <Widget>[
116-
widget.title != null
117-
? Text(widget.title, style: widget.titleTextStyle)
118-
: (widget.child ?? Container()),
112+
Align(
113+
alignment: widget.alignment!=null? widget.alignment:Alignment.topLeft,
114+
child: widget.title != null
115+
? Text(widget.title, style: widget.titleTextStyle)
116+
: (widget.child ?? Container()),
117+
),
118+
119119
SizedBox(
120120
height: 10,
121121
),
@@ -124,7 +124,7 @@ class _GFAlertState extends State<GFAlert> with TickerProviderStateMixin {
124124
? widget.alignment
125125
: Alignment.topLeft,
126126
child: widget.content != null
127-
? Text(widget.content, style: widget.textStyle)
127+
? Text(widget.content, style: widget.contentTextStyle)
128128
: (widget.contentChild ?? Container()),
129129
),
130130
SizedBox(

0 commit comments

Comments
 (0)