From 1ccbf0d15796ac011046d18a7a14d81bfb35f24a Mon Sep 17 00:00:00 2001 From: deepikahr Date: Wed, 22 Jan 2020 11:26:08 +0530 Subject: [PATCH 1/2] changes in gfappbar --- example/lib/fonts/icomoon.eot | Bin 0 -> 6748 bytes example/lib/fonts/icomoon.svg | 22 + example/lib/fonts/icomoon.ttf | Bin 0 -> 6584 bytes example/lib/fonts/icomoon.woff | Bin 0 -> 6660 bytes example/lib/main.dart | 411 ++++++++------ example/pubspec.yaml | 5 + example/web/index.html | 10 - lib/components/appbar/gf_appbar.dart | 623 +-------------------- lib/components/card/gf_card.dart | 8 +- lib/components/drawer/gf_drawer.dart | 25 +- lib/components/image/gf_image_overlay.dart | 3 +- lib/components/list_tile/gf_list_tile.dart | 3 +- 12 files changed, 283 insertions(+), 827 deletions(-) create mode 100644 example/lib/fonts/icomoon.eot create mode 100644 example/lib/fonts/icomoon.svg create mode 100644 example/lib/fonts/icomoon.ttf create mode 100644 example/lib/fonts/icomoon.woff delete mode 100644 example/web/index.html diff --git a/example/lib/fonts/icomoon.eot b/example/lib/fonts/icomoon.eot new file mode 100644 index 0000000000000000000000000000000000000000..9543e5a5dc38f2822a5c89afb5c1586be3070e5a GIT binary patch literal 6748 zcmeG>ZEPIJb@O)i>+X2Fcel5@JaT!Tybs=y$6MYVPbcwH7AcVwBZ`znS0A=0ilL}j zBumMtT?a+s)B!9PXp&#HlN2>-zya*KX$#nHU7$)3pdV;axP{v~DDoo(iW&`2yRZ!x ziH?1*P`L2w5RJh%v}H#O#opNXuxF#3p4@acDm| z8j*})fcz?*duOE8FI|zxf6dS=c_azH)OLpCN3sr@a2i<6r#A zhvzP0`!PcFH?FO%Ts2=AeV-7Mu^YaI2A4Q`-FcbRq!#o0|ju3_A)`py8(J<_YRq$Sg~_Y_>3;eejIL$qlJC$lR8uu z;mIMy`-zOon@q-HDIbqWxhstvA&GOlL# zRBE^BbWfQ&v}vyDY1Q`B%KZW-3sm61rw0O2A182vOrHP{_}m4XAG%lo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Oh>1w$q;hW(V{EfIHu3mawW zJr^(nlIoL!LO8E;YSh^Xw~Rw@8+fTO3K}N_C7&uGA=?gzkq-*# z9+LpDbN)#tAz2EF@cCR&tnFN6LFB1FBm%Ngx)qLV&GzSV%`oPJ&0Ma(l*=FT;L_CP z%TvczR*rEjkNn@F0bH}I(Y>elb{5}}+3%mO$T{JryV{NRDV|^LxlUQHEx^tki z_E)enx|f}ieiFso;BRsw_hb4RpXT2X#zav(Az6On|3{=?TtnO(zC&eYZ*@+?`%%cN z-r4})aO|y^(T|LyUqwF3cgk?!gq{ zQ4i)3{;~%P_(22T^gClk#4mcVAK$pVxUsr*V{2=({j12iwVj(ATboI{T)F?Jko%6h zFLH5h{n1BOcG|zO+?R5CYx7oeeQk4XXXVz~)#R1OlQXMZ^SHJ$nRY(I+`?U~<85ox l`8cyeZsGGP;;!Jk>?E0SKI_bTpLNP8b>} + + +Generated by IcoMoon + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/example/lib/fonts/icomoon.ttf b/example/lib/fonts/icomoon.ttf new file mode 100644 index 0000000000000000000000000000000000000000..5a7e0b177a3079f987f85f6106c476e398918abf GIT binary patch literal 6584 zcmeHMeQX@Zb)UDhUw6mb``Ft%9(lY^-W|y!kGH%#o=)PYEK(9FMG~nGS0A=0ijk;T zqDslAT?a+s!~rZ9Xp_HUCn;jYfCJcd(-yGPxjG?I#$szI}CN>2l)L@%I=@)G$7J z6&>1l`CDjTMZ5Rv_1jO3G6lGa-#~lnv9;x;{0lu}X#XYJ`Rhwh++^L-QMBJhJ9}g4 z`pWZjzMnGIDR_S2=Gv{>SSL#I%VL~y{(br_rZ6TwF9{02>AvY-S)F_WZ$}}J*j=U= zdndr}Zr){692J8?7F#9j0D_ySDU7*q?qH>u%=Vz)&vYi?M=bkJVDsMQrZX%14s&4I z{HKJBc{}M6BVdJg^hu1h+78Nnyie}K=;mDzzROx{5zEeN25BmO;$_7WX-dTL6R-M6 zYl2#%_=#7uQLa+CgrD;oaZs$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!4=BbrP`@uE*k@P$5Gg0x#eSa$_rf{p-Fg#Ze=5)hYzsbDxE zs}VovxFupGnAo^T@1;OIpoM%|P>GZ+DHL-SBAvz%ECZK{c%LaLLCqJ^Kq!_YVH~1H z#HT2nBSgrF5ad8f_k;vU?DL-$64te#N}nwSYTYeGS5%q%!zw|H(QQc5#@t}3)Q%t@ zY?n%dl~Q?+2Ulh;T$tIvw6tFmdF1~V3t-N!jsLq|^z46a0qBOyzKE*C!$!AjfNmok zS72q5VP^e*!pgEMW2coN#Bn7@$j{+RcX!)rPq|caZMbpUwb;ys|G)G9U%m5t-)MjQ z>y7U|5*quE1#lpvd~f!re{}EdeVrBG(ebU;DH!K`YZeDM3ZD1A_Bt3Ac6;207$(}N zPoTbv`ZVe*sOvkbXnzq^(7o!6^s^XlgTEoE(hv9>a$bH*nNU^rpqBD8|3832NDWK# z_=YOV*6f^y_b}M&-rNXZIJV{~0lwhjIp9$bmH|KJ!3zExVR^6${JaPISr@x4zJtp? zU<~xQumt$B2XnyV9xMZX%7YaaXIT$cfnV@oKfbuUyt=%0ZEfv3TV=~^ja@@sW7kiu ztlwN+yPmbHHRpb_&TfJL9pGcLDy!Xh)P0c)E0-U8bZH$zS1{4X*rRNTt>2e&cJ2DD z?B$i~E9* @override Widget build(BuildContext context) { return Scaffold( -// drawer: GFDrawer( -// colorFilter: new ColorFilter.mode(Colors.black.withOpacity(0.6), BlendMode.darken), -// backgroundImage: NetworkImage("https://cdn.pixabay.com/photo/2017/12/03/18/04/christmas-balls-2995437_960_720.jpg"), -// gradient: LinearGradient( -// begin: Alignment.topRight, -// end: Alignment.bottomLeft, -// stops: [0.1, 0.5, 0.7, 0.9], -// colors: [ -// Colors.teal[800], -// Colors.teal[600], -// Colors.teal[400], -// Colors.teal[200], -// ], -// ), -// child: ListView( -// padding: EdgeInsets.zero, -// children: [ -// GFDrawerHeader( -// currentAccountPicture: GFAvatar( -// radius: 80.0, -// backgroundImage: NetworkImage("https://cdn.pixabay.com/photo/2017/12/03/18/04/christmas-balls-2995437_960_720.jpg"), -// ), -// -// decoration: BoxDecoration( -// color: Colors.teal.withOpacity(0.45), -// ), -// otherAccountsPictures: [ -// Image( -// image: NetworkImage("https://cdn.pixabay.com/photo/2019/12/20/00/03/road-4707345_960_720.jpg"), -// fit: BoxFit.cover, -// ), -// GFAvatar( -// child: Text("dcf"), -// ) -// ], -// child: Column( -// mainAxisAlignment: MainAxisAlignment.start, -// crossAxisAlignment: CrossAxisAlignment.start, -// children: [ -// Text('user'), -// Text('user@asdf.com'), -// ], -// ), + drawer: GFDrawer( + colorFilter: new ColorFilter.mode(Colors.black.withOpacity(0.6), BlendMode.darken), + backgroundImage: NetworkImage("https://cdn.pixabay.com/photo/2017/12/03/18/04/christmas-balls-2995437_960_720.jpg"), + gradient: LinearGradient( + begin: Alignment.topRight, + end: Alignment.bottomLeft, + stops: [0.1, 0.5, 0.7, 0.9], + colors: [ + Colors.teal[800], + Colors.teal[600], + Colors.teal[400], + Colors.teal[200], + ], + ), + child: ListView( + padding: EdgeInsets.zero, + children: [ + GFDrawerHeader( + currentAccountPicture: GFAvatar( + radius: 80.0, + backgroundImage: NetworkImage("https://cdn.pixabay.com/photo/2017/12/03/18/04/christmas-balls-2995437_960_720.jpg"), + ), + + decoration: BoxDecoration( + color: Colors.teal.withOpacity(0.45), + ), + otherAccountsPictures: [ + Image( + image: NetworkImage("https://cdn.pixabay.com/photo/2019/12/20/00/03/road-4707345_960_720.jpg"), + fit: BoxFit.cover, + ), + GFAvatar( + child: Text("dcf"), + ) + ], + child: Column( + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text('user'), + Text('user@asdf.com'), + ], + ), + ), + ListTile( + title: Text('Item 1'), + onTap: () { + Navigator.pop(context); + }, + ), + ListTile( + title: Text('Item 2'), + onTap: () { + }, + ), + ], + ), + ), + appBar: GFAppBar( + backgroundColor: Colors.tealAccent, + centerTitle: true, +// leading: GFIconButton(icon: Icon(Icons.directions_bus), onPressed: null), + title: Text("ui-kit"), +// GFSegmentTabs( +// tabController: tabController, +// initialIndex: 0, +// length: 3, +// tabs: [ +// Text( +// "Tab1", // ), -// ListTile( -// title: Text('Item 1'), -// onTap: () { -// Navigator.pop(context); -// }, +// Text( +// "Tab2", // ), -// ListTile( -// title: Text('Item 2'), -// onTap: () { -// }, +// Text( +// "Tab3", // ), // ], // ), -// ), - appBar: GFAppBar( - backgroundColor: Colors.tealAccent, - centerTitle: true, - title: Text("UI KIT"), -// trailing: [ -// GFIconButton(icon: Icon(Icons.directions_bus), onPressed: null) -// ], + trailing: [ + IconButton(icon: Icon(Icons.title), onPressed: null, color: Colors.orange,), + GFIconButton(icon: Icon(Icons.title), onPressed: null,), + GFIconButton(icon: Icon(Icons.directions_bus), onPressed: null), +// GFIconButton(icon: Icon(Icons.directions_bus), onPressed: null), +// GFIconButton(icon: Icon(Icons.directions_bus), onPressed: null), +// GFIconButton(icon: Icon(Icons.directions_bus), onPressed: null), +// GFIconButton(icon: Icon(Icons.directions_bus), onPressed: null), +// GFIconButton(icon: Icon(Icons.directions_bus), onPressed: null), +// GFIconButton(icon: Icon(Icons.directions_bus), onPressed: null), +// GFIconButton(icon: Icon(Icons.directions_bus), onPressed: null), + ], ), -// backgroundColor: Colors.teal, + backgroundColor: Colors.teal, body: // GFTabBarView( // height: 200.0, @@ -208,7 +234,7 @@ class _MyHomePageState extends State type: GFTypographyType.typo6, ), GFFloatingWidget( - verticalPosition: 80, + verticalPosition: 100, child: showToast? GFToast( width: 300, text: 'Happy New Year', @@ -427,7 +453,7 @@ class _MyHomePageState extends State // ), GFListTile( - padding: EdgeInsets.all(8.0), + padding: EdgeInsets.all(30.0), color: Colors.redAccent, avatar: GFAvatar( child: Text("tb"), @@ -495,18 +521,29 @@ class _MyHomePageState extends State // ), // ), // -// GFCard( -// content: GFImageOverlay( -// height: 200.0, -// width: 200.0, -// image: AssetImage("lib/assets/food.jpeg"), -// boxFit: BoxFit.fill, -// colorFilter: new ColorFilter.mode( -// Colors.black.withOpacity(0.67), BlendMode.darken), + GFCard( + content: Row( + children: [ + GFImageOverlay( + height: 200.0, + width: 200.0, + image: AssetImage("lib/assets/food.jpeg"), + boxFit: BoxFit.fill, + colorFilter: new ColorFilter.mode( + Colors.black.withOpacity(0.67), BlendMode.darken), // shape: BoxShape.circle, -// ), -// ), -// + ), + ], + ) + ), + + Image.asset( + 'lib/assets/food.jpeg', + fit: BoxFit.cover, + color: Color(0xff0d69ff).withOpacity(1.0), + colorBlendMode: BlendMode.softLight, + ), + // GFCard( // content: Container( // width: 190.0, @@ -658,14 +695,14 @@ class _MyHomePageState extends State ], ), -// GFTabBarView( -// controller: tabController, -// children: [ -// Container(color: Colors.red), -// Container(color: Colors.green), -// Container(color: Colors.blue) -// ] -// ), + GFTabBarView( + controller: tabController, + children: [ + Container(color: Colors.red), + Container(color: Colors.green), + Container(color: Colors.blue) + ] + ), // GFItemsCarousel( @@ -715,38 +752,40 @@ class _MyHomePageState extends State // }, // ), -// -// GFTabs( -// initialIndex: 0, -// length: 3, -// tabs: [ -// Tab( + + GFTabs( + initialIndex: 0, + length: 3, + tabs: [ + Tab( // icon: Icon(Icons.directions_bike), -// child: Text( -// "Tab1", -// ), -// ), -// Tab( + icon: Icon(IconData(0xe907, fontFamily: 'icomoon'),), + child: Text( + "Tab1", + ), + ), + Tab( // icon: Icon(Icons.directions_bus), -// child: Text( -// "Tab2", -// ), -// ), -// Tab( -// icon: Icon(Icons.directions_railway), -// child: Text( -// "Tab3", -// ), -// ), -// ], -// tabBarView: GFTabBarView( -// children: [ -// Container(child: Icon(Icons.directions_bike), color: Colors.red,), -// Container(child: Icon(Icons.directions_bus), color: Colors.blue,), -// Container(child: Icon(Icons.directions_railway), color: Colors.orange,), -// ], -// ), -// ), + icon: Icon(IconData(0xe900, fontFamily: 'icomoon'), ), + child: Text( + "Tab2", + ), + ), + Tab( + icon: Icon(IconData(0xe904, fontFamily: 'icomoon'),), + child: Text( + "Tab3", + ), + ), + ], + tabBarView: GFTabBarView( + children: [ + Container(child: Icon(Icons.directions_bike), color: Colors.red,), + Container(child: Icon(Icons.directions_bus), color: Colors.blue,), + Container(child: Icon(Icons.directions_railway), color: Colors.orange,), + ], + ), + ), // // GFCarousel( // autoPlay: true, @@ -774,58 +813,66 @@ class _MyHomePageState extends State // }, // ), -// GFCard( -// boxFit: BoxFit.fill, -// colorFilter: new ColorFilter.mode( -// Colors.black.withOpacity(0.67), BlendMode.darken), -// image: Image.asset( -// "lib/assets/img.png", -// fit: BoxFit.fitWidth, -// width: 400.0, -// ), -//// imageOverlay: AssetImage("lib/assets/food.jpeg"), -// titlePosition: GFPosition.end, -// title: GFListTile( -// avatar: GFAvatar( -// child: Text("tb"), -// ), -// title: Text( -// 'title', -// style: TextStyle(color: Colors.grey), -// ), -// subTitle: Text( -// 'subtitle', -// style: TextStyle(color: Colors.grey), -// ), -// icon: GFIconButton( -// onPressed: null, -// icon: Icon(Icons.favorite_border), -// type: GFType.transparent, -// ), -// ), -// content: Text( -// "Flutter Flutter is Google's mobile UI framework for crafting" -// "Flutter Flutter is Google's mobile UI framework for crafting", -// style: TextStyle(color: Colors.grey), -// ), -//// buttonBar: GFButtonBar( -//// mainAxisSize: MainAxisSize.min, -//// children: [ -//// GFButton( -//// onPressed: null, -//// child: Text("favorite"), -//// icon: Icon(Icons.favorite_border), -//// type: GFType.transparent, -//// ), -//// GFButton( -//// onPressed: null, -//// child: Text("share"), -//// icon: Icon(Icons.share), -//// type: GFType.outline, -//// ), -//// ], -//// ), -// ), + GFCard( + boxFit: BoxFit.fill, + colorFilter: new ColorFilter.mode( + Colors.black.withOpacity(0.67), BlendMode.darken), + image: Image.asset( + "lib/assets/img.png", + fit: BoxFit.fitWidth, + width: 400.0, + ), +// imageOverlay: AssetImage("lib/assets/food.jpeg"), + titlePosition: GFPosition.end, + title: GFListTile( + avatar: GFAvatar( + child: Text("tb"), + ), + title: Text( + 'title', + style: TextStyle(color: Colors.grey), + ), + subTitle: Text( + 'subtitle' + "Flutter Flutter is Google's mobile UI framework for crafting" + "Flutter Flutter is Google's mobile UI framework for crafting", + style: TextStyle(color: Colors.grey), + ), + icon: GFIconButton( + onPressed: null, + icon: Icon(Icons.favorite), + type: GFType.transparent, + ), + ), + content: Text( + "Flutter Flutter is Google's mobile UI framework for crafting" + "Flutter Flutter is Google's mobile UI framework for crafting" + "Flutter Flutter is Google's mobile UI framework for crafting" + "Flutter Flutter is Google's mobile UI framework for crafting", + style: TextStyle(color: Colors.grey), + ), + buttonBar: GFButtonBar( + children: [ + GFButton( + onPressed: null, + child: Text("favorite"), + icon: Icon(Icons.favorite_border), + type: GFType.transparent, + ), + GFButton( + onPressed: null, + child: Text("share"), + icon: Icon(Icons.share), + type: GFType.outline, + ), + GFButton( + onPressed: null, + child: Text("share"), + icon: Icon(Icons.share), + ), + ], + ), + ), // GFButtonBar( // mainAxisSize: MainAxisSize.min, @@ -993,24 +1040,24 @@ class _MyHomePageState extends State // ), // ), -// GFIconButton( -// onPressed: (){}, -// icon: Icon(Icons.ac_unit), -//// iconSize: 12.0, -//// type: GFType.solid, -//// shape: GFIconButtonShape.pills, -//// size: GFSize.large, -//// buttonBoxShadow: true, -//// color: GFColor.warning, -//// boxShadow: BoxShadow( -//// color: Colors.pink, -//// blurRadius: 2.0, -//// spreadRadius: 1.0, -//// offset: Offset.zero, -//// ), -//// borderSide: BorderSide(color: Colors.pink, width: 1.0, style: BorderStyle.solid), -//// borderShape: RoundedRectangleBorder(side: BorderSide(color: Colors.pink, width: 2.0, style: BorderStyle.solid), borderRadius: BorderRadius.zero), -// ), + GFIconButton( + onPressed: (){}, + icon: Icon(Icons.ac_unit), +// iconSize: 12.0, +// type: GFType.solid, +// shape: GFIconButtonShape.pills, +// size: GFSize.large, +// buttonBoxShadow: true, +// color: GFColor.warning, +// boxShadow: BoxShadow( +// color: Colors.pink, +// blurRadius: 2.0, +// spreadRadius: 1.0, +// offset: Offset.zero, +// ), +// borderSide: BorderSide(color: Colors.pink, width: 1.0, style: BorderStyle.solid), +// borderShape: RoundedRectangleBorder(side: BorderSide(color: Colors.pink, width: 2.0, style: BorderStyle.solid), borderRadius: BorderRadius.zero), + ), // // GFBadge( // text: '12', diff --git a/example/pubspec.yaml b/example/pubspec.yaml index c4708b13..4f7fb984 100644 --- a/example/pubspec.yaml +++ b/example/pubspec.yaml @@ -20,6 +20,11 @@ dev_dependencies: flutter: uses-material-design: true + fonts: + - family: icomoon + fonts: + - asset: lib/fonts/icomoon.ttf + assets: - lib/assets/food.jpeg - lib/assets/img.png diff --git a/example/web/index.html b/example/web/index.html deleted file mode 100644 index 01c86d07..00000000 --- a/example/web/index.html +++ /dev/null @@ -1,10 +0,0 @@ - - - - - getflutter_example - - - - - diff --git a/lib/components/appbar/gf_appbar.dart b/lib/components/appbar/gf_appbar.dart index c3cfb533..eb2cdf4d 100644 --- a/lib/components/appbar/gf_appbar.dart +++ b/lib/components/appbar/gf_appbar.dart @@ -420,58 +420,6 @@ class _GFAppBarState extends State { } } -class _FloatingGFAppBar extends StatefulWidget { - const _FloatingGFAppBar({Key key, this.child}) : super(key: key); - - final Widget child; - - @override - _FloatingGFAppBarState createState() => _FloatingGFAppBarState(); -} - -// A wrapper for the widget created by _SliverGFAppBarDelegate that starts and -// stops the floating app bar's snap-into-view or snap-out-of-view animation. -class _FloatingGFAppBarState extends State<_FloatingGFAppBar> { - ScrollPosition _position; - - @override - void didChangeDependencies() { - super.didChangeDependencies(); - if (_position != null) - _position.isScrollingNotifier.removeListener(_isScrollingListener); - _position = Scrollable.of(context)?.position; - if (_position != null) - _position.isScrollingNotifier.addListener(_isScrollingListener); - } - - @override - void dispose() { - if (_position != null) - _position.isScrollingNotifier.removeListener(_isScrollingListener); - super.dispose(); - } - - RenderSliverFloatingPersistentHeader _headerRenderer() { - return context - .findAncestorRenderObjectOfType(); - } - - void _isScrollingListener() { - if (_position == null) return; - - // When a scroll stops, then maybe snap the appbar into view. - // Similarly, when a scroll starts, then maybe stop the snap animation. - final RenderSliverFloatingPersistentHeader header = _headerRenderer(); - if (_position.isScrollingNotifier.value) - header?.maybeStopSnapAnimation(_position.userScrollDirection); - else - header?.maybeStartSnapAnimation(_position.userScrollDirection); - } - - @override - Widget build(BuildContext context) => widget.child; -} - const double _kLeadingWidth = kToolbarHeight; class _ToolbarContainerLayout extends SingleChildLayoutDelegate { @@ -496,575 +444,7 @@ class _ToolbarContainerLayout extends SingleChildLayoutDelegate { bool shouldRelayout(_ToolbarContainerLayout oldDelegate) => false; } -class _SliverGFAppBarDelegate extends SliverPersistentHeaderDelegate { - _SliverGFAppBarDelegate({ - @required this.leading, - @required this.automaticallyImplyLeading, - @required this.title, - @required this.actions, - @required this.flexibleSpace, - @required this.bottom, - @required this.elevation, - @required this.forceElevated, - @required this.backgroundColor, - @required this.brightness, - @required this.iconTheme, - @required this.actionsIconTheme, - @required this.textTheme, - @required this.primary, - @required this.centerTitle, - @required this.titleSpacing, - @required this.expandedHeight, - @required this.collapsedHeight, - @required this.topPadding, - @required this.floating, - @required this.pinned, - @required this.snapConfiguration, - @required this.stretchConfiguration, - @required this.shape, - }) : assert(primary || topPadding == 0.0), - _bottomHeight = bottom?.preferredSize?.height ?? 0.0; - - final Widget leading; - final bool automaticallyImplyLeading; - final Widget title; - final List actions; - final Widget flexibleSpace; - final PreferredSizeWidget bottom; - final double elevation; - final bool forceElevated; - final Color backgroundColor; - final Brightness brightness; - final IconThemeData iconTheme; - final IconThemeData actionsIconTheme; - final TextTheme textTheme; - final bool primary; - final bool centerTitle; - final double titleSpacing; - final double expandedHeight; - final double collapsedHeight; - final double topPadding; - final bool floating; - final bool pinned; - final ShapeBorder shape; - - final double _bottomHeight; - - @override - double get minExtent => - collapsedHeight ?? (topPadding + kToolbarHeight + _bottomHeight); - - @override - double get maxExtent => math.max( - topPadding + (expandedHeight ?? kToolbarHeight + _bottomHeight), - minExtent); - - @override - final FloatingHeaderSnapConfiguration snapConfiguration; - - @override - final OverScrollHeaderStretchConfiguration stretchConfiguration; - - @override - Widget build( - BuildContext context, double shrinkOffset, bool overlapsContent) { - final double visibleMainHeight = maxExtent - shrinkOffset - topPadding; - - // Truth table for `toolbarOpacity`: - // pinned | floating | bottom != null || opacity - // ---------------------------------------------- - // 0 | 0 | 0 || fade - // 0 | 0 | 1 || fade - // 0 | 1 | 0 || fade - // 0 | 1 | 1 || fade - // 1 | 0 | 0 || 1.0 - // 1 | 0 | 1 || 1.0 - // 1 | 1 | 0 || 1.0 - // 1 | 1 | 1 || fade - final double toolbarOpacity = !pinned || (floating && bottom != null) - ? ((visibleMainHeight - _bottomHeight) / kToolbarHeight).clamp(0.0, 1.0) - : 1.0; - - final Widget appBar = FlexibleSpaceBar.createSettings( - minExtent: minExtent, - maxExtent: maxExtent, - currentExtent: math.max(minExtent, maxExtent - shrinkOffset), - toolbarOpacity: toolbarOpacity, - child: GFAppBar( - leading: leading, - automaticallyImplyLeading: automaticallyImplyLeading, - title: title, - trailing: actions, - flexibleSpace: (title == null && flexibleSpace != null) - ? Semantics(child: flexibleSpace, header: true) - : flexibleSpace, - bottom: bottom, - elevation: forceElevated || - overlapsContent || - (pinned && shrinkOffset > maxExtent - minExtent) - ? elevation ?? 4.0 - : 0.0, - backgroundColor: backgroundColor, - brightness: brightness, - iconTheme: iconTheme, - actionsIconTheme: actionsIconTheme, - textTheme: textTheme, - primary: primary, - centerTitle: centerTitle, - titleSpacing: titleSpacing, - shape: shape, - toolbarOpacity: toolbarOpacity, - bottomOpacity: - pinned ? 1.0 : (visibleMainHeight / _bottomHeight).clamp(0.0, 1.0), - ), - ); - return floating ? _FloatingGFAppBar(child: appBar) : appBar; - } - - @override - bool shouldRebuild(covariant _SliverGFAppBarDelegate oldDelegate) { - return leading != oldDelegate.leading || - automaticallyImplyLeading != oldDelegate.automaticallyImplyLeading || - title != oldDelegate.title || - actions != oldDelegate.actions || - flexibleSpace != oldDelegate.flexibleSpace || - bottom != oldDelegate.bottom || - _bottomHeight != oldDelegate._bottomHeight || - elevation != oldDelegate.elevation || - backgroundColor != oldDelegate.backgroundColor || - brightness != oldDelegate.brightness || - iconTheme != oldDelegate.iconTheme || - actionsIconTheme != oldDelegate.actionsIconTheme || - textTheme != oldDelegate.textTheme || - primary != oldDelegate.primary || - centerTitle != oldDelegate.centerTitle || - titleSpacing != oldDelegate.titleSpacing || - expandedHeight != oldDelegate.expandedHeight || - topPadding != oldDelegate.topPadding || - pinned != oldDelegate.pinned || - floating != oldDelegate.floating || - snapConfiguration != oldDelegate.snapConfiguration || - stretchConfiguration != oldDelegate.stretchConfiguration; - } - - @override - String toString() { - return '${describeIdentity(this)}(topPadding: ${topPadding.toStringAsFixed(1)}, bottomHeight: ${_bottomHeight.toStringAsFixed(1)}, ...)'; - } -} - -/// A material design app bar that integrates with a [CustomScrollView]. -/// -/// An app bar consists of a toolbar and potentially other widgets, such as a -/// [TabBar] and a [FlexibleSpaceBar]. App bars typically expose one or more -/// common actions with [IconButton]s which are optionally followed by a -/// [PopupMenuButton] for less common operations. -/// -/// {@youtube 560 315 https://www.youtube.com/watch?v=R9C5KMJKluE} -/// -/// Sliver app bars are typically used as the first child of a -/// [CustomScrollView], which lets the app bar integrate with the scroll view so -/// that it can vary in height according to the scroll offset or float above the -/// other content in the scroll view. For a fixed-height app bar at the top of -/// the screen see [GFAppBar], which is used in the [Scaffold.appBar] slot. -/// -/// The GFAppBar displays the toolbar widgets, [leading], [title], and -/// [actions], above the [bottom] (if any). If a [flexibleSpace] widget is -/// specified then it is stacked behind the toolbar and the bottom widget. -/// -class SliverGFAppBar extends StatefulWidget { - /// Creates a material design app bar that can be placed in a [CustomScrollView]. - /// - /// The arguments [forceElevated], [primary], [floating], [pinned], [snap] - /// and [automaticallyImplyLeading] must not be null. - const SliverGFAppBar({ - Key key, - this.leading, - this.automaticallyImplyLeading = true, - this.title, - this.actions, - this.flexibleSpace, - this.bottom, - this.elevation, - this.forceElevated = false, - this.backgroundColor, - this.brightness, - this.iconTheme, - this.actionsIconTheme, - this.textTheme, - this.primary = true, - this.centerTitle, - this.titleSpacing = NavigationToolbar.kMiddleSpacing, - this.expandedHeight, - this.floating = false, - this.pinned = false, - this.snap = false, - this.stretch = false, - this.stretchTriggerOffset = 100.0, - this.onStretchTrigger, - this.shape, - }) : assert(automaticallyImplyLeading != null), - assert(forceElevated != null), - assert(primary != null), - assert(titleSpacing != null), - assert(floating != null), - assert(pinned != null), - assert(snap != null), - assert(stretch != null), - assert(floating || !snap, - 'The "snap" argument only makes sense for floating app bars.'), - assert(stretchTriggerOffset > 0.0), - super(key: key); - - /// A widget to display before the [title]. - /// - /// If this is null and [automaticallyImplyLeading] is set to true, the [GFAppBar] will - /// imply an appropriate widget. For example, if the [GFAppBar] is in a [Scaffold] - /// that also has a [Drawer], the [Scaffold] will fill this widget with an - /// [IconButton] that opens the drawer. If there's no [Drawer] and the parent - /// [Navigator] can go back, the [GFAppBar] will use a [BackButton] that calls - /// [Navigator.maybePop]. - final Widget leading; - /// Controls whether we should try to imply the leading widget if null. - /// - /// If true and [leading] is null, automatically try to deduce what the leading - /// widget should be. If false and [leading] is null, leading space is given to [title]. - /// If leading widget is not null, this parameter has no effect. - final bool automaticallyImplyLeading; - - /// The primary widget displayed in the app bar. - /// - /// Typically a [Text] widget containing a description of the current contents - /// of the app. - final Widget title; - - /// Widgets to display after the [title] widget. - /// - /// Typically these widgets are [IconButton]s representing common operations. - /// For less common operations, consider using a [PopupMenuButton] as the - /// last action. - /// - /// {@tool sample} - /// - /// ```dart - /// Scaffold( - /// body: CustomScrollView( - /// primary: true, - /// slivers: [ - /// SliverGFAppBar( - /// title: Text('Hello World'), - /// actions: [ - /// IconButton( - /// icon: Icon(Icons.shopping_cart), - /// tooltip: 'Open shopping cart', - /// onPressed: () { - /// // handle the press - /// }, - /// ), - /// ], - /// ), - /// // ...rest of body... - /// ], - /// ), - /// ) - /// ``` - /// {@end-tool} - final List actions; - - /// This widget is stacked behind the toolbar and the tab bar. It's height will - /// be the same as the app bar's overall height. - /// - /// Typically a [FlexibleSpaceBar]. See [FlexibleSpaceBar] for details. - final Widget flexibleSpace; - - /// This widget appears across the bottom of the app bar. - /// - /// Typically a [TabBar]. Only widgets that implement [PreferredSizeWidget] can - /// be used at the bottom of an app bar. - /// - /// See also: - /// - /// * [PreferredSize], which can be used to give an arbitrary widget a preferred size. - final PreferredSizeWidget bottom; - - /// The z-coordinate at which to place this app bar when it is above other - /// content. This controls the size of the shadow below the app bar. - /// - /// If this property is null, then [ThemeData.appBarTheme.elevation] is used, - /// if that is also null, the default value is 4, the appropriate elevation - /// for app bars. - /// - /// If [forceElevated] is false, the elevation is ignored when the app bar has - /// no content underneath it. For example, if the app bar is [pinned] but no - /// content is scrolled under it, or if it scrolls with the content, then no - /// shadow is drawn, regardless of the value of [elevation]. - final double elevation; - - /// Whether to show the shadow appropriate for the [elevation] even if the - /// content is not scrolled under the [GFAppBar]. - /// - /// Defaults to false, meaning that the [elevation] is only applied when the - /// [GFAppBar] is being displayed over content that is scrolled under it. - /// - /// When set to true, the [elevation] is applied regardless. - /// - /// Ignored when [elevation] is zero. - final bool forceElevated; - - /// The color to use for the app bar's material. Typically this should be set - /// along with [brightness], [iconTheme], [textTheme]. - /// - /// If this property is null, then [ThemeData.appBarTheme.color] is used, - /// if that is also null, then [ThemeData.primaryColor] is used. - final Color backgroundColor; - - /// The brightness of the app bar's material. Typically this is set along - /// with [backgroundColor], [iconTheme], [textTheme]. - /// - /// If this property is null, then [ThemeData.appBarTheme.brightness] is used, - /// if that is also null, then [ThemeData.primaryColorBrightness] is used. - final Brightness brightness; - - /// The color, opacity, and size to use for app bar icons. Typically this - /// is set along with [backgroundColor], [brightness], [textTheme]. - /// - /// If this property is null, then [ThemeData.appBarTheme.iconTheme] is used, - /// if that is also null, then [ThemeData.primaryIconTheme] is used. - final IconThemeData iconTheme; - - /// The color, opacity, and size to use for trailing app bar icons. This - /// should only be used when the trailing icons should be themed differently - /// than the leading icons. - /// - /// If this property is null, then [ThemeData.appBarTheme.actionsIconTheme] is - /// used, if that is also null, then this falls back to [iconTheme]. - final IconThemeData actionsIconTheme; - - /// The typographic styles to use for text in the app bar. Typically this is - /// set along with [brightness] [backgroundColor], [iconTheme]. - /// - /// If this property is null, then [ThemeData.appBarTheme.textTheme] is used, - /// if that is also null, then [ThemeData.primaryTextTheme] is used. - final TextTheme textTheme; - - /// Whether this app bar is being displayed at the top of the screen. - /// - /// If this is true, the top padding specified by the [MediaQuery] will be - /// added to the top of the toolbar. - final bool primary; - - /// Whether the title should be centered. - /// - /// Defaults to being adapted to the current [TargetPlatform]. - final bool centerTitle; - - /// The spacing around [title] content on the horizontal axis. This spacing is - /// applied even if there is no [leading] content or [actions]. If you want - /// [title] to take all the space available, set this value to 0.0. - /// - /// Defaults to [NavigationToolbar.kMiddleSpacing]. - final double titleSpacing; - - /// The size of the app bar when it is fully expanded. - /// - /// By default, the total height of the toolbar and the bottom widget (if - /// any). If a [flexibleSpace] widget is specified this height should be big - /// enough to accommodate whatever that widget contains. - /// - /// This does not include the status bar height (which will be automatically - /// included if [primary] is true). - final double expandedHeight; - - /// Whether the app bar should become visible as soon as the user scrolls - /// towards the app bar. - /// - /// Otherwise, the user will need to scroll near the top of the scroll view to - /// reveal the app bar. - /// - /// If [snap] is true then a scroll that exposes the app bar will trigger an - /// animation that slides the entire app bar into view. Similarly if a scroll - /// dismisses the app bar, the animation will slide it completely out of view. - /// - /// ## Animated Examples - /// - /// The following animations show how the app bar changes its scrolling - /// behavior based on the value of this property. - /// - /// * App bar with [floating] set to false: - /// {@animation 476 400 https://flutter.github.io/assets-for-api-docs/assets/material/app_bar.mp4} - /// * App bar with [floating] set to true: - /// {@animation 476 400 https://flutter.github.io/assets-for-api-docs/assets/material/app_bar_floating.mp4} - /// - /// See also: - /// - /// * [SliverGFAppBar] for more animated examples of how this property changes the - /// behavior of the app bar in combination with [pinned] and [snap]. - final bool floating; - - /// Whether the app bar should remain visible at the start of the scroll view. - /// - /// The app bar can still expand and contract as the user scrolls, but it will - /// remain visible rather than being scrolled out of view. - /// - /// ## Animated Examples - /// - /// The following animations show how the app bar changes its scrolling - /// behavior based on the value of this property. - /// - /// * App bar with [pinned] set to false: - /// {@animation 476 400 https://flutter.github.io/assets-for-api-docs/assets/material/app_bar.mp4} - /// * App bar with [pinned] set to true: - /// {@animation 476 400 https://flutter.github.io/assets-for-api-docs/assets/material/app_bar_pinned.mp4} - /// - /// See also: - /// - /// * [SliverGFAppBar] for more animated examples of how this property changes the - /// behavior of the app bar in combination with [floating]. - final bool pinned; - - /// The material's shape as well as its shadow. - /// - /// A shadow is only displayed if the [elevation] is greater than zero. - final ShapeBorder shape; - - /// If [snap] and [floating] are true then the floating app bar will "snap" - /// into view. - /// - /// If [snap] is true then a scroll that exposes the floating app bar will - /// trigger an animation that slides the entire app bar into view. Similarly if - /// a scroll dismisses the app bar, the animation will slide the app bar - /// completely out of view. - /// - /// Snapping only applies when the app bar is floating, not when the app bar - /// appears at the top of its scroll view. - /// - /// ## Animated Examples - /// - /// The following animations show how the app bar changes its scrolling - /// behavior based on the value of this property. - /// - /// * App bar with [snap] set to false: - /// {@animation 476 400 https://flutter.github.io/assets-for-api-docs/assets/material/app_bar_floating.mp4} - /// * App bar with [snap] set to true: - /// {@animation 476 400 https://flutter.github.io/assets-for-api-docs/assets/material/app_bar_floating_snap.mp4} - /// - /// See also: - /// - /// * [SliverGFAppBar] for more animated examples of how this property changes the - /// behavior of the app bar in combination with [pinned] and [floating]. - final bool snap; - - /// Whether the app bar should stretch to fill the over-scroll area. - /// - /// The app bar can still expand and contract as the user scrolls, but it will - /// also stretch when the user over-scrolls. - final bool stretch; - - /// The offset of overscroll required to activate [onStretchTrigger]. - /// - /// This defaults to 100.0. - final double stretchTriggerOffset; - - /// The callback function to be executed when a user over-scrolls to the - /// offset specified by [stretchTriggerOffset]. - final AsyncCallback onStretchTrigger; - - @override - _SliverGFAppBarState createState() => _SliverGFAppBarState(); -} - -// This class is only Stateful because it owns the TickerProvider used -// by the floating appbar snap animation (via FloatingHeaderSnapConfiguration). -class _SliverGFAppBarState extends State - with TickerProviderStateMixin { - FloatingHeaderSnapConfiguration _snapConfiguration; - OverScrollHeaderStretchConfiguration _stretchConfiguration; - - void _updateSnapConfiguration() { - if (widget.snap && widget.floating) { - _snapConfiguration = FloatingHeaderSnapConfiguration( - vsync: this, - curve: Curves.easeOut, - duration: const Duration(milliseconds: 200), - ); - } else { - _snapConfiguration = null; - } - } - - void _updateStretchConfiguration() { - if (widget.stretch) { - _stretchConfiguration = OverScrollHeaderStretchConfiguration( - stretchTriggerOffset: widget.stretchTriggerOffset, - onStretchTrigger: widget.onStretchTrigger, - ); - } else { - _stretchConfiguration = null; - } - } - - @override - void initState() { - super.initState(); - _updateSnapConfiguration(); - _updateStretchConfiguration(); - } - - @override - void didUpdateWidget(SliverGFAppBar oldWidget) { - super.didUpdateWidget(oldWidget); - if (widget.snap != oldWidget.snap || widget.floating != oldWidget.floating) - _updateSnapConfiguration(); - if (widget.stretch != oldWidget.stretch) _updateStretchConfiguration(); - } - - @override - Widget build(BuildContext context) { - assert(!widget.primary || debugCheckHasMediaQuery(context)); - final double topPadding = - widget.primary ? MediaQuery.of(context).padding.top : 0.0; - final double collapsedHeight = - (widget.pinned && widget.floating && widget.bottom != null) - ? widget.bottom.preferredSize.height + topPadding - : null; - - return MediaQuery.removePadding( - context: context, - removeBottom: true, - child: SliverPersistentHeader( - floating: widget.floating, - pinned: widget.pinned, - delegate: _SliverGFAppBarDelegate( - leading: widget.leading, - automaticallyImplyLeading: widget.automaticallyImplyLeading, - title: widget.title, - actions: widget.actions, - flexibleSpace: widget.flexibleSpace, - bottom: widget.bottom, - elevation: widget.elevation, - forceElevated: widget.forceElevated, - backgroundColor: widget.backgroundColor, - brightness: widget.brightness, - iconTheme: widget.iconTheme, - actionsIconTheme: widget.actionsIconTheme, - textTheme: widget.textTheme, - primary: widget.primary, - centerTitle: widget.centerTitle, - titleSpacing: widget.titleSpacing, - expandedHeight: widget.expandedHeight, - collapsedHeight: collapsedHeight, - topPadding: topPadding, - floating: widget.floating, - pinned: widget.pinned, - shape: widget.shape, - snapConfiguration: _snapConfiguration, - stretchConfiguration: _stretchConfiguration, - ), - ), - ); - } -} // Layout the GFAppBar's title with unconstrained height, vertically // center it within its (NavigationToolbar) parent, and allow the @@ -1106,3 +486,6 @@ class _RenderGFAppBarTitleBox extends RenderAligningShiftedBox { alignChild(); } } + + + diff --git a/lib/components/card/gf_card.dart b/lib/components/card/gf_card.dart index b4a2fb75..3e692493 100644 --- a/lib/components/card/gf_card.dart +++ b/lib/components/card/gf_card.dart @@ -35,11 +35,16 @@ class GFCard extends StatelessWidget { this.borderRadius, this.border, this.boxFit, - this.colorFilter}) + this.colorFilter, + this.height + }) : assert(elevation == null || elevation >= 0.0), assert(borderOnForeground != null), super(key: key); + /// defines the card's height + final double height; + /// [GFPosition] titlePosition helps to set titlebar at top of card final GFPosition titlePosition; @@ -140,6 +145,7 @@ class GFCard extends StatelessWidget { ); return Container( + height: height, margin: margin ?? cardTheme.margin ?? const EdgeInsets.all(16.0), child: Material( type: MaterialType.card, diff --git a/lib/components/drawer/gf_drawer.dart b/lib/components/drawer/gf_drawer.dart index 2b3d919a..ec8664f2 100644 --- a/lib/components/drawer/gf_drawer.dart +++ b/lib/components/drawer/gf_drawer.dart @@ -127,18 +127,19 @@ class GFDrawer extends StatelessWidget { child: Material( elevation: elevation, child: Container( - decoration: new BoxDecoration( - color: Colors.teal, - gradient: gradient, - image: backgroundImage != null - ? new DecorationImage( - image: backgroundImage, - fit: BoxFit.cover, - colorFilter: colorFilter, - ) - : null, - ), - child: child), + decoration: new BoxDecoration( + color: Colors.teal, + gradient: gradient, + image: backgroundImage != null + ? new DecorationImage( + image: backgroundImage, + fit: BoxFit.cover, + colorFilter: colorFilter, + ) + : null, + ), + child: child, + ), ), ), ); diff --git a/lib/components/image/gf_image_overlay.dart b/lib/components/image/gf_image_overlay.dart index 3bb66ea3..a127eaa8 100644 --- a/lib/components/image/gf_image_overlay.dart +++ b/lib/components/image/gf_image_overlay.dart @@ -94,7 +94,8 @@ class GFImageOverlay extends StatelessWidget { image: new DecorationImage( fit: BoxFit.fill, colorFilter: child != null ? colorFilter : null, - image: image), + image: image + ), ), ); } diff --git a/lib/components/list_tile/gf_list_tile.dart b/lib/components/list_tile/gf_list_tile.dart index 19258c96..47189bf8 100644 --- a/lib/components/list_tile/gf_list_tile.dart +++ b/lib/components/list_tile/gf_list_tile.dart @@ -48,7 +48,8 @@ class GFListTile extends StatelessWidget { Widget build(BuildContext context) { return Container( constraints: BoxConstraints(minHeight: 50), - padding: padding, + padding: EdgeInsets.all(8.0), +// margin: padding, decoration: BoxDecoration( color: color, borderRadius: BorderRadius.all(Radius.circular(5)), From 5d0cd708091256a1766c7ba8c622eda8f196d68d Mon Sep 17 00:00:00 2001 From: deepikahr Date: Thu, 23 Jan 2020 12:48:24 +0530 Subject: [PATCH 2/2] import changes in all components --- example/lib/main.dart | 191 +++++++++++++++---- lib/components/appbar/gf_appbar.dart | 14 +- lib/components/avatar/gf_avatar.dart | 6 +- lib/components/badge/gf_badge.dart | 4 +- lib/components/badge/gf_button_badge.dart | 7 +- lib/components/badge/gf_icon_badge.dart | 2 +- lib/components/button/gf_button.dart | 6 +- lib/components/button/gf_button_bar.dart | 3 +- lib/components/button/gf_icon_button.dart | 5 +- lib/components/button/gf_social_button.dart | 7 +- lib/components/card/gf_card.dart | 5 +- lib/components/list_tile/gf_list_tile.dart | 3 +- lib/components/tabs/gf_segment_tabs.dart | 3 +- lib/components/tabs/gf_tabBar.dart | 2 +- lib/components/tabs/gf_tabBarView.dart | 2 +- lib/components/tabs/gf_tabs.dart | 4 +- lib/components/toast/gf_floating_widget.dart | 2 +- lib/components/toast/gf_toast.dart | 4 +- lib/components/toggle/gf_toggle.dart | 2 +- lib/components/typography/gf_typography.dart | 3 +- lib/getflutter.dart | 29 +++ 21 files changed, 204 insertions(+), 100 deletions(-) diff --git a/example/lib/main.dart b/example/lib/main.dart index fc00a9ed..dfc5e2c8 100644 --- a/example/lib/main.dart +++ b/example/lib/main.dart @@ -23,6 +23,8 @@ import 'package:getflutter/components/tabs/gf_tabs.dart'; import 'package:getflutter/components/tabs/gf_tabBarView.dart'; import 'package:getflutter/types/gf_button_type.dart'; import 'package:getflutter/position/gf_position.dart'; +import 'package:getflutter/components/tabs/gf_tabBar.dart'; +import 'dart:io'; final List imageList = [ "https://cdn.pixabay.com/photo/2017/12/03/18/04/christmas-balls-2995437_960_720.jpg", @@ -60,12 +62,16 @@ class MyHomePage extends StatefulWidget { class _MyHomePageState extends State with SingleTickerProviderStateMixin { + static final GlobalKey scaffoldKey = + new GlobalKey(); + TabController tabController; @override void initState() { super.initState(); tabController = TabController(length: 3, vsync: this); + _searchQuery = new TextEditingController(); } @override @@ -77,6 +83,101 @@ class _MyHomePageState extends State bool switchValue = true; bool showToast = false; + Widget appBarTitle = new Text("UI Kit"); + Icon actionIcon = new Icon(Icons.search); + + TextEditingController _searchQuery; + bool _isSearching = false; + String searchQuery = "Search query"; + + void _startSearch() { + ModalRoute.of(context) + .addLocalHistoryEntry(new LocalHistoryEntry(onRemove: _stopSearching)); + + setState(() { + _isSearching = true; + }); + } + + void _stopSearching() { + _clearSearchQuery(); + + setState(() { + _isSearching = false; + }); + } + + void _clearSearchQuery() { + setState(() { + _searchQuery.clear(); + updateSearchQuery("Search query"); + }); + } + + Widget _buildTitle(BuildContext context) { + var horizontalTitleAlignment = + Platform.isIOS ? CrossAxisAlignment.center : CrossAxisAlignment.start; + + return new InkWell( + onTap: () => scaffoldKey.currentState.openDrawer(), + child: new Padding( + padding: const EdgeInsets.symmetric(horizontal: 12.0), + child: new Column( + mainAxisAlignment: MainAxisAlignment.center, + crossAxisAlignment: horizontalTitleAlignment, + children: [ + const Text('Seach box'), + ], + ), + ), + ); + } + + Widget _buildSearchField() { + return new TextField( + controller: _searchQuery, + autofocus: true, + decoration: const InputDecoration( + hintText: 'Search...', + border: InputBorder.none, + hintStyle: const TextStyle(color: Colors.white30), + ), + style: const TextStyle(color: Colors.white, fontSize: 16.0), + onChanged: updateSearchQuery, + ); + } + + void updateSearchQuery(String newQuery) { + setState(() { + searchQuery = newQuery; + }); + print("search query " + newQuery); + } + + List _buildActions() { + if (_isSearching) { + return [ + new IconButton( + icon: const Icon(Icons.clear), + onPressed: () { + if (_searchQuery == null || _searchQuery.text.isEmpty) { + Navigator.pop(context); + return; + } + _clearSearchQuery(); + }, + ), + ]; + } + + return [ + new IconButton( + icon: const Icon(Icons.search), + onPressed: _startSearch, + ), + ]; + } + @override Widget build(BuildContext context) { return Scaffold( @@ -140,48 +241,50 @@ class _MyHomePageState extends State ], ), ), - appBar: GFAppBar( - backgroundColor: Colors.tealAccent, - centerTitle: true, - leading: GFIconButton(icon: Icon(Icons.directions_bus), onPressed: null), - title: Text("ui-kit"), -// GFSegmentTabs( -// tabController: tabController, -// initialIndex: 0, -// length: 3, -// tabs: [ -// Text( -// "Tab1", -// ), -// Text( -// "Tab2", -// ), -// Text( -// "Tab3", -// ), -// ], -// ), - trailing: [ - IconButton( - icon: Icon(Icons.title), - onPressed: null, - color: Colors.orange, - ), - GFIconButton( - icon: Icon(Icons.title), - onPressed: null, - ), - GFIconButton(icon: Icon(Icons.directions_bus), onPressed: null), -// GFIconButton(icon: Icon(Icons.directions_bus), onPressed: null), -// GFIconButton(icon: Icon(Icons.directions_bus), onPressed: null), -// GFIconButton(icon: Icon(Icons.directions_bus), onPressed: null), -// GFIconButton(icon: Icon(Icons.directions_bus), onPressed: null), -// GFIconButton(icon: Icon(Icons.directions_bus), onPressed: null), -// GFIconButton(icon: Icon(Icons.directions_bus), onPressed: null), -// GFIconButton(icon: Icon(Icons.directions_bus), onPressed: null), - ], + appBar: AppBar( + leading: _isSearching ? const BackButton() : null, + title: _isSearching ? _buildSearchField() : _buildTitle(context), + actions: _buildActions(), ), - backgroundColor: Colors.teal, +// GFAppBar( +//// backgroundColor: Colors.tealAccent, +// centerTitle: true, +//// leading: GFIconButton(icon: Icon(Icons.directions_bus), onPressed: (){}), +// title: appBarTitle, +//// bottom: TabBar( +//// controller: tabController, +//// tabs: [ +//// Tab(icon: Icon(Icons.directions_car)), +//// Tab(icon: Icon(Icons.directions_transit)), +//// Tab(icon: Icon(Icons.directions_bike)), +//// ], +//// ), +// actions: [ +// new IconButton( +// icon: actionIcon, +// onPressed: () { +// setState(() { +// if (this.actionIcon.icon == Icons.search) { +// this.actionIcon = new Icon(Icons.close); +// this.appBarTitle = new TextField( +// style: new TextStyle( +// color: Colors.white, +// ), +// decoration: new InputDecoration( +// prefixIcon: new Icon(Icons.search, color: Colors.white), +// hintText: "Search...", +// hintStyle: new TextStyle(color: Colors.white)), +// ); +// } else { +// this.actionIcon = new Icon(Icons.search); +// this.appBarTitle = new Text("UI Kit"); +// } +// }); +// }, +// ), +// ], +// ), +// backgroundColor: Colors.teal, body: // GFTabBarView( // height: 200.0, @@ -196,6 +299,12 @@ class _MyHomePageState extends State mainAxisAlignment: MainAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center, children: [ + GFIconButton( + icon: Icon(Icons.title), + onPressed: null, +// color: GFColor.secondary, + ), + GFCard( content: Column( children: [ diff --git a/lib/components/appbar/gf_appbar.dart b/lib/components/appbar/gf_appbar.dart index 07048c26..f0326879 100644 --- a/lib/components/appbar/gf_appbar.dart +++ b/lib/components/appbar/gf_appbar.dart @@ -1,4 +1,3 @@ -//import 'dart:math' as math; import 'package:flutter/foundation.dart'; import 'package:flutter/rendering.dart'; import 'package:flutter/services.dart'; @@ -27,7 +26,7 @@ class GFAppBar extends StatefulWidget implements PreferredSizeWidget { this.leading, this.automaticallyImplyLeading = true, this.title, - this.trailing, + this.actions, this.flexibleSpace, this.bottom, this.elevation, @@ -73,7 +72,7 @@ class GFAppBar extends StatefulWidget implements PreferredSizeWidget { /// Typically these widgets are [IconButton]s representing common operations. /// For less common operations, consider using a [PopupMenuButton] as the /// last action. - final List trailing; + final List actions; /// This widget is stacked behind the toolbar and the tab bar. It's height will /// be the same as the app bar's overall height. @@ -201,7 +200,7 @@ class GFAppBar extends StatefulWidget implements PreferredSizeWidget { case TargetPlatform.fuchsia: return false; case TargetPlatform.iOS: - return trailing == null || trailing.length < 2; + return actions == null || actions.length < 2; default: return false; } @@ -311,11 +310,11 @@ class _GFAppBarState extends State { } Widget actions; - if (widget.trailing != null && widget.trailing.isNotEmpty) { + if (widget.actions != null && widget.actions.isNotEmpty) { actions = Row( mainAxisSize: MainAxisSize.min, crossAxisAlignment: CrossAxisAlignment.stretch, - children: widget.trailing, + children: widget.actions, ); } else if (hasEndDrawer) { actions = IconButton( @@ -325,7 +324,7 @@ class _GFAppBarState extends State { ); } - // Allow the trailing actions to have their own theme if necessary. + // Allow the actions actions to have their own theme if necessary. if (actions != null) { actions = IconTheme.merge( data: actionsIconTheme, @@ -396,6 +395,7 @@ class _GFAppBarState extends State { ], ); } + final Brightness brightness = widget.brightness ?? appBarTheme.brightness ?? theme.primaryColorBrightness; diff --git a/lib/components/avatar/gf_avatar.dart b/lib/components/avatar/gf_avatar.dart index 9a9c0bec..3890914c 100644 --- a/lib/components/avatar/gf_avatar.dart +++ b/lib/components/avatar/gf_avatar.dart @@ -1,10 +1,6 @@ import 'package:flutter/widgets.dart'; import 'package:flutter/material.dart'; -import 'package:getflutter/shape/gf_avatar_shape.dart'; -import 'package:getflutter/size/gf_size.dart'; -import 'package:getflutter/colors/gf_color.dart'; -export 'package:getflutter/shape/gf_avatar_shape.dart'; -export 'package:getflutter/size/gf_size.dart'; +import 'package:getflutter/getflutter.dart'; class GFAvatar extends StatelessWidget { /// Typically a [Text] widget. If the [CircleAvatar] is to have an image, use [backgroundImage] instead. diff --git a/lib/components/badge/gf_badge.dart b/lib/components/badge/gf_badge.dart index a30baabd..b2c37521 100644 --- a/lib/components/badge/gf_badge.dart +++ b/lib/components/badge/gf_badge.dart @@ -1,7 +1,5 @@ import 'package:flutter/material.dart'; -import 'package:getflutter/shape/gf_badge_shape.dart'; -import 'package:getflutter/size/gf_size.dart'; -import 'package:getflutter/colors/gf_color.dart'; +import 'package:getflutter/getflutter.dart'; class GFBadge extends StatefulWidget { /// The border side for the badge's [Material]. diff --git a/lib/components/badge/gf_button_badge.dart b/lib/components/badge/gf_button_badge.dart index 107cb5e6..8563a1d4 100644 --- a/lib/components/badge/gf_button_badge.dart +++ b/lib/components/badge/gf_button_badge.dart @@ -2,12 +2,7 @@ import 'package:flutter/foundation.dart'; import 'package:flutter/rendering.dart'; import 'package:flutter/widgets.dart'; import 'package:flutter/material.dart'; -import 'package:getflutter/components/button/gf_button.dart'; -import 'package:getflutter/shape/gf_button_shape.dart'; -import 'package:getflutter/size/gf_size.dart'; -import 'package:getflutter/types/gf_button_type.dart'; -import 'package:getflutter/position/gf_position.dart'; -import 'package:getflutter/colors/gf_color.dart'; +import 'package:getflutter/getflutter.dart'; class GFButtonBadge extends GFButton { /// Called when the button is tapped or otherwise activated. diff --git a/lib/components/badge/gf_icon_badge.dart b/lib/components/badge/gf_icon_badge.dart index ba24d4b5..9191d11c 100644 --- a/lib/components/badge/gf_icon_badge.dart +++ b/lib/components/badge/gf_icon_badge.dart @@ -1,5 +1,5 @@ import 'package:flutter/material.dart'; -import 'package:getflutter/components/button/gf_icon_button.dart'; +import 'package:getflutter/getflutter.dart'; class GFIconBadge extends StatefulWidget { /// child of type [Widget] is used to show icon. diff --git a/lib/components/button/gf_button.dart b/lib/components/button/gf_button.dart index 399e0e12..bca0f37d 100644 --- a/lib/components/button/gf_button.dart +++ b/lib/components/button/gf_button.dart @@ -4,11 +4,7 @@ import 'package:flutter/gestures.dart'; import 'package:flutter/rendering.dart'; import 'package:flutter/widgets.dart'; import 'package:flutter/material.dart'; -import 'package:getflutter/shape/gf_button_shape.dart'; -import 'package:getflutter/size/gf_size.dart'; -import 'package:getflutter/types/gf_button_type.dart'; -import 'package:getflutter/position/gf_position.dart'; -import 'package:getflutter/colors/gf_color.dart'; +import 'package:getflutter/getflutter.dart'; class GFButton extends StatefulWidget { /// Called when the button is tapped or otherwise activated. diff --git a/lib/components/button/gf_button_bar.dart b/lib/components/button/gf_button_bar.dart index b8b0ef33..4108be6e 100644 --- a/lib/components/button/gf_button_bar.dart +++ b/lib/components/button/gf_button_bar.dart @@ -1,7 +1,6 @@ import 'package:flutter/material.dart'; -import 'package:getflutter/components/button/gf_button.dart'; -import 'package:getflutter/components/button/gf_icon_button.dart'; import 'package:flutter/rendering.dart'; +import 'package:getflutter/getflutter.dart'; class GFButtonBar extends StatelessWidget { /// Create buttons bar for all types of buttons. diff --git a/lib/components/button/gf_icon_button.dart b/lib/components/button/gf_icon_button.dart index 4f3049b0..59a22c84 100644 --- a/lib/components/button/gf_icon_button.dart +++ b/lib/components/button/gf_icon_button.dart @@ -2,10 +2,7 @@ import 'dart:math' as math; import 'package:flutter/foundation.dart'; import 'package:flutter/widgets.dart'; import 'package:flutter/material.dart'; -import 'package:getflutter/shape/gf_icon_button_shape.dart'; -import 'package:getflutter/size/gf_size.dart'; -import 'package:getflutter/types/gf_button_type.dart'; -import 'package:getflutter/colors/gf_color.dart'; +import 'package:getflutter/getflutter.dart'; class GFIconButton extends StatefulWidget { /// The size of the icon inside the button. diff --git a/lib/components/button/gf_social_button.dart b/lib/components/button/gf_social_button.dart index bef48e38..553bf3d1 100644 --- a/lib/components/button/gf_social_button.dart +++ b/lib/components/button/gf_social_button.dart @@ -2,12 +2,7 @@ import 'package:flutter/foundation.dart'; import 'package:flutter/rendering.dart'; import 'package:flutter/widgets.dart'; import 'package:flutter/material.dart'; -import 'package:getflutter/components/button/gf_button.dart'; -import 'package:getflutter/shape/gf_button_shape.dart'; -import 'package:getflutter/size/gf_size.dart'; -import 'package:getflutter/types/gf_button_type.dart'; -import 'package:getflutter/position/gf_position.dart'; -import 'package:getflutter/colors/gf_color.dart'; +import 'package:getflutter/getflutter.dart'; class GFSocialButton extends GFButton { /// Called when the button is tapped or otherwise activated. diff --git a/lib/components/card/gf_card.dart b/lib/components/card/gf_card.dart index a2ce35ad..01ac1176 100644 --- a/lib/components/card/gf_card.dart +++ b/lib/components/card/gf_card.dart @@ -1,9 +1,6 @@ import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; -import 'package:getflutter/components/button/gf_button_bar.dart'; -import 'package:getflutter/components/list_tile/gf_list_tile.dart'; -import 'package:getflutter/components/image/gf_image_overlay.dart'; -import 'package:getflutter/position/gf_position.dart'; +import 'package:getflutter/getflutter.dart'; /// A material design card. A card has slightly rounded corners and a shadow. /// diff --git a/lib/components/list_tile/gf_list_tile.dart b/lib/components/list_tile/gf_list_tile.dart index e784ba1c..6a2360e7 100644 --- a/lib/components/list_tile/gf_list_tile.dart +++ b/lib/components/list_tile/gf_list_tile.dart @@ -1,7 +1,6 @@ import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; -import 'package:getflutter/colors/gf_color.dart'; -import 'package:getflutter/components/avatar/gf_avatar.dart'; +import 'package:getflutter/getflutter.dart'; class GFListTile extends StatelessWidget { ///type of [String] used to pass text, alternative to title property and gets higher priority than title diff --git a/lib/components/tabs/gf_segment_tabs.dart b/lib/components/tabs/gf_segment_tabs.dart index 2b798bf0..7f51225b 100644 --- a/lib/components/tabs/gf_segment_tabs.dart +++ b/lib/components/tabs/gf_segment_tabs.dart @@ -2,8 +2,7 @@ import 'package:flutter/material.dart'; import 'package:flutter/foundation.dart'; import 'package:flutter/rendering.dart'; import 'package:flutter/widgets.dart'; -import 'package:getflutter/colors/gf_color.dart'; -import 'package:getflutter/components/tabs/gf_tabBar.dart'; +import 'package:getflutter/getflutter.dart'; /// Creates pills like structured tab bar. See [GFTabBar] /// [GFSegmentTabs] are best used as an alternative for [GFTabBar]. diff --git a/lib/components/tabs/gf_tabBar.dart b/lib/components/tabs/gf_tabBar.dart index 75eee5ad..add820ef 100644 --- a/lib/components/tabs/gf_tabBar.dart +++ b/lib/components/tabs/gf_tabBar.dart @@ -2,7 +2,7 @@ import 'package:flutter/material.dart'; import 'package:flutter/foundation.dart'; import 'package:flutter/rendering.dart'; import 'package:flutter/widgets.dart'; -import 'package:getflutter/colors/gf_color.dart'; +import 'package:getflutter/getflutter.dart'; /// A material design widget that displays a horizontal row of tabs. /// diff --git a/lib/components/tabs/gf_tabBarView.dart b/lib/components/tabs/gf_tabBarView.dart index 9b170925..b4251765 100644 --- a/lib/components/tabs/gf_tabBarView.dart +++ b/lib/components/tabs/gf_tabBarView.dart @@ -3,7 +3,7 @@ import 'dart:async'; import 'package:flutter/rendering.dart'; import 'package:flutter/widgets.dart'; import 'package:flutter/gestures.dart' show DragStartBehavior; -import 'package:getflutter/components/tabs/gf_segment_tabs.dart'; +import 'package:getflutter/getflutter.dart'; /// A page view that displays the widget which corresponds to the currently /// selected tab. diff --git a/lib/components/tabs/gf_tabs.dart b/lib/components/tabs/gf_tabs.dart index 439bd556..d64f9d34 100644 --- a/lib/components/tabs/gf_tabs.dart +++ b/lib/components/tabs/gf_tabs.dart @@ -2,9 +2,7 @@ import 'package:flutter/material.dart'; import 'package:flutter/foundation.dart'; import 'package:flutter/rendering.dart'; import 'package:flutter/widgets.dart'; -import 'package:getflutter/colors/gf_color.dart'; -import 'package:getflutter/components/tabs/gf_tabBarView.dart'; -import 'package:getflutter/components/tabs/gf_tabBar.dart'; +import 'package:getflutter/getflutter.dart'; /// Creates a default tab for the given [child] widget. /// diff --git a/lib/components/toast/gf_floating_widget.dart b/lib/components/toast/gf_floating_widget.dart index 8afd436e..8a950c81 100644 --- a/lib/components/toast/gf_floating_widget.dart +++ b/lib/components/toast/gf_floating_widget.dart @@ -1,5 +1,5 @@ import 'package:flutter/material.dart'; -import 'package:getflutter/components/toast/gf_toast.dart'; +import 'package:getflutter/getflutter.dart'; class GFFloatingWidget extends StatefulWidget { /// Creates a Floating body can be used to display the quick messages, warning and erros. diff --git a/lib/components/toast/gf_toast.dart b/lib/components/toast/gf_toast.dart index 2a285a10..3b68a762 100644 --- a/lib/components/toast/gf_toast.dart +++ b/lib/components/toast/gf_toast.dart @@ -1,9 +1,7 @@ import 'dart:async'; import 'package:flutter/material.dart'; import 'package:flutter/widgets.dart'; -import 'package:getflutter/colors/gf_color.dart'; -import 'package:getflutter/components/toast/gf_floating_widget.dart'; -import 'package:getflutter/types/gf_toast_type.dart'; +import 'package:getflutter/getflutter.dart'; class GFToast extends StatefulWidget { ///Creates [GFToast] that can be used to display quick warning or error messages. diff --git a/lib/components/toggle/gf_toggle.dart b/lib/components/toggle/gf_toggle.dart index 1d397cf5..636488a1 100644 --- a/lib/components/toggle/gf_toggle.dart +++ b/lib/components/toggle/gf_toggle.dart @@ -1,6 +1,6 @@ import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; -import 'package:getflutter/types/gf_toggle_type.dart'; +import 'package:getflutter/getflutter.dart'; /// A toggle button allows the user to change a setting between two states. /// diff --git a/lib/components/typography/gf_typography.dart b/lib/components/typography/gf_typography.dart index 98b480f4..9aa061d9 100644 --- a/lib/components/typography/gf_typography.dart +++ b/lib/components/typography/gf_typography.dart @@ -1,6 +1,5 @@ import 'package:flutter/material.dart'; -import 'package:getflutter/colors/gf_color.dart'; -import 'package:getflutter/types/gf_typography_type.dart'; +import 'package:getflutter/getflutter.dart'; class GFTypography extends StatelessWidget { /// Creates simple title with underline. Style of title can be changed using [GFTypographyType] diff --git a/lib/getflutter.dart b/lib/getflutter.dart index bf278aab..b3934353 100644 --- a/lib/getflutter.dart +++ b/lib/getflutter.dart @@ -1,5 +1,33 @@ library getflutter; +//exports components +export 'package:getflutter/components/appbar/gf_appbar.dart'; +export 'package:getflutter/components/avatar/gf_avatar.dart'; +export 'package:getflutter/components/badge/gf_badge.dart'; +export 'package:getflutter/components/badge/gf_button_badge.dart'; +export 'package:getflutter/components/badge/gf_icon_badge.dart'; +export 'package:getflutter/components/button/gf_button.dart'; +export 'package:getflutter/components/button/gf_icon_button.dart'; +export 'package:getflutter/components/button/gf_social_button.dart'; +export 'package:getflutter/components/button/gf_button_bar.dart'; +export 'package:getflutter/components/card/gf_card.dart'; +export 'package:getflutter/components/carousel/gf_carousel.dart'; +export 'package:getflutter/components/carousel/gf_items_carousel.dart'; +export 'package:getflutter/components/drawer/gf_drawer.dart'; +export 'package:getflutter/components/drawer/gf_drawer_header.dart'; +export 'package:getflutter/components/image/gf_image_overlay.dart'; +export 'package:getflutter/components/list_tile/gf_list_tile.dart'; +export 'package:getflutter/components/search_bar/gf_search_bar.dart'; +export 'package:getflutter/components/tabs/gf_tabBar.dart'; +export 'package:getflutter/components/tabs/gf_tabBarView.dart'; +export 'package:getflutter/components/tabs/gf_tabs.dart'; +export 'package:getflutter/components/tabs/gf_segment_tabs.dart'; +export 'package:getflutter/components/toast/gf_floating_widget.dart'; +export 'package:getflutter/components/toast/gf_toast.dart'; +export 'package:getflutter/components/toggle/gf_toggle.dart'; +export 'package:getflutter/components/typography/gf_typography.dart'; + +// exports shape, color, position, size, types export 'colors/gf_color.dart'; export 'position/gf_position.dart'; export 'shape/gf_avatar_shape.dart'; @@ -10,3 +38,4 @@ export 'size/gf_size.dart'; export 'types/gf_toggle_type.dart'; export 'types/gf_button_type.dart'; export 'types/gf_typography_type.dart'; +export 'types/gf_toast_type.dart';