From 90e08b284f929b52581a746e7abfc1737e8b217c Mon Sep 17 00:00:00 2001 From: "Shravya.ckm" Date: Fri, 27 Dec 2019 12:01:31 +0530 Subject: [PATCH 1/7] gf header is in progress --- example/lib/main.dart | 19 +++++++++++ lib/components/header/gf_header.dart | 50 ++++++++++++++++++++++++++++ 2 files changed, 69 insertions(+) diff --git a/example/lib/main.dart b/example/lib/main.dart index 7caed510..3e1d14d2 100644 --- a/example/lib/main.dart +++ b/example/lib/main.dart @@ -29,6 +29,7 @@ import 'package:ui_kit/shape/gf_shape.dart'; import 'package:ui_kit/components/toggle/gf_toggle.dart'; import 'package:ui_kit/types/gf_toggle_type.dart'; import 'package:flutter/cupertino.dart'; +import 'package:ui_kit/components/header/gf_header.dart'; import 'package:ui_kit/components/toast/gf_toast.dart'; @@ -48,6 +49,7 @@ class MyApp extends StatelessWidget { title: 'UI_KIT_EXAMPLE', theme: ThemeData( primarySwatch: Colors.blue, + ), debugShowCheckedModeBanner: false, @@ -124,7 +126,24 @@ class _MyHomePageState extends State { ), ], ), + ), + + Container( + margin: EdgeInsets.only(left: 20), + child: GFHeader( +// icon: Icon(Icons.favorite), + text: 'GET FLUTTER HEADER', + textColor: Colors.black, + dividerColor: Colors.red, + + + +// child: Text('GF HEADER ', ), +// dividercolor: GFColor.warning, +// dividerBorderRadius: BorderRadius.all(Radius.circular(0)), + ), ) + ], ), // body: DefaultTabController( diff --git a/lib/components/header/gf_header.dart b/lib/components/header/gf_header.dart index e69de29b..b68682d1 100644 --- a/lib/components/header/gf_header.dart +++ b/lib/components/header/gf_header.dart @@ -0,0 +1,50 @@ +import 'package:flutter/material.dart'; +import 'package:ui_kit/colors/gf_color.dart'; + +class GFHeader extends StatelessWidget { + + + const GFHeader({Key key, this.child, this.text, this.icon, this.dividerBorderRadius, + this.textColor= GFColor.primary, + this.dividerColor= GFColor.primary}) : super (key:key); + + + final Widget child; + final String text; + final Icon icon; + final dynamic dividerColor; + final dynamic textColor; + final BorderRadius dividerBorderRadius; + + + + @override + Widget build(BuildContext context) { + return Container( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Row( + children: [ + icon != null ? icon: Container(), + icon != null ? Padding(padding: EdgeInsets.only(left: 10)): Container(), + text!=null?Text(text,style: + TextStyle(color: textColor != null ? getGFColor(textColor): Colors.black54, fontSize: 16, letterSpacing: 0.5, fontWeight: FontWeight.w500),) + :child + ], + ), + Container( + margin: EdgeInsets.only(top:5), + width: 70, + height: 4, + decoration: BoxDecoration( + color: dividerColor != null?getGFColor(dividerColor): GFColor.primary, + borderRadius: dividerBorderRadius != null ?dividerBorderRadius:BorderRadius.all(Radius.circular(5)) + ), + + ) + ], + ) + ); + } +} From f594e9ed731f4f06e9531f928dce1cde58a46272 Mon Sep 17 00:00:00 2001 From: "Shravya.ckm" Date: Fri, 27 Dec 2019 12:12:48 +0530 Subject: [PATCH 2/7] gf header completed --- example/lib/main.dart | 7 +++--- lib/components/header/gf_header.dart | 32 ++++++++++++++++++---------- 2 files changed, 25 insertions(+), 14 deletions(-) diff --git a/example/lib/main.dart b/example/lib/main.dart index 3e1d14d2..29954a39 100644 --- a/example/lib/main.dart +++ b/example/lib/main.dart @@ -129,12 +129,13 @@ class _MyHomePageState extends State { ), Container( - margin: EdgeInsets.only(left: 20), + padding: EdgeInsets.only(left: 20, right: 20), child: GFHeader( // icon: Icon(Icons.favorite), text: 'GET FLUTTER HEADER', - textColor: Colors.black, - dividerColor: Colors.red, +// textColor: Colors.black, +// dividerColor: Colors.red, +//dividerAlignment: Alignment.center, diff --git a/lib/components/header/gf_header.dart b/lib/components/header/gf_header.dart index b68682d1..cd8d3d2b 100644 --- a/lib/components/header/gf_header.dart +++ b/lib/components/header/gf_header.dart @@ -4,17 +4,25 @@ import 'package:ui_kit/colors/gf_color.dart'; class GFHeader extends StatelessWidget { - const GFHeader({Key key, this.child, this.text, this.icon, this.dividerBorderRadius, - this.textColor= GFColor.primary, - this.dividerColor= GFColor.primary}) : super (key:key); - - + const GFHeader({Key key, + this.child, + this.text, + this.icon, + this.dividerBorderRadius, + this.textColor= GFColor.dark, + this.dividerAlignment, + this.dividerColor= GFColor.dark + }) : super (key:key); + + + final Widget child; final String text; final Icon icon; final dynamic dividerColor; final dynamic textColor; final BorderRadius dividerBorderRadius; + final Alignment dividerAlignment; @@ -35,13 +43,15 @@ class GFHeader extends StatelessWidget { ), Container( margin: EdgeInsets.only(top:5), - width: 70, + alignment: dividerAlignment, + child: Container( + width: 70, height: 4, - decoration: BoxDecoration( - color: dividerColor != null?getGFColor(dividerColor): GFColor.primary, - borderRadius: dividerBorderRadius != null ?dividerBorderRadius:BorderRadius.all(Radius.circular(5)) - ), - + decoration: BoxDecoration( + color: dividerColor != null?getGFColor(dividerColor): GFColor.primary, + borderRadius: dividerBorderRadius != null ?dividerBorderRadius:BorderRadius.all(Radius.circular(5)) + ), + ) ) ], ) From 61fbcb9669a89aa8462ae0ac7695bc77ea021962 Mon Sep 17 00:00:00 2001 From: "Shravya.ckm" Date: Fri, 27 Dec 2019 14:46:45 +0530 Subject: [PATCH 3/7] added background image to header --- example/lib/main.dart | 9 ++++++-- lib/components/header/gf_header.dart | 34 ++++++++++++++++++++-------- 2 files changed, 32 insertions(+), 11 deletions(-) diff --git a/example/lib/main.dart b/example/lib/main.dart index 29954a39..74deb5d4 100644 --- a/example/lib/main.dart +++ b/example/lib/main.dart @@ -129,10 +129,15 @@ class _MyHomePageState extends State { ), Container( - padding: EdgeInsets.only(left: 20, right: 20), +// padding: EdgeInsets.only(left: 20, right: 20), child: GFHeader( -// icon: Icon(Icons.favorite), +// icon: Icon(Icons.image, color: Colors.white,), text: 'GET FLUTTER HEADER', +//textColor: Colors.red, +dividerWidth: 20, +//backgroundImage: NetworkImage('https://cdn.pixabay.com/photo/2017/12/03/18/04/christmas-balls-2995437_960_720.jpg'), +//showDivider: false, + // textColor: Colors.black, // dividerColor: Colors.red, //dividerAlignment: Alignment.center, diff --git a/lib/components/header/gf_header.dart b/lib/components/header/gf_header.dart index cd8d3d2b..ac5dc15f 100644 --- a/lib/components/header/gf_header.dart +++ b/lib/components/header/gf_header.dart @@ -9,50 +9,66 @@ class GFHeader extends StatelessWidget { this.text, this.icon, this.dividerBorderRadius, - this.textColor= GFColor.dark, + this.textColor, this.dividerAlignment, - this.dividerColor= GFColor.dark + this.dividerColor, + this.showDivider = true, + this.dividerWidth, + this.backgroundImage, + this.backgroundImagecolorFilter }) : super (key:key); final Widget child; final String text; - final Icon icon; + final Widget icon; final dynamic dividerColor; final dynamic textColor; final BorderRadius dividerBorderRadius; final Alignment dividerAlignment; + final bool showDivider; + final double dividerWidth; + final ImageProvider backgroundImage; + final ColorFilter backgroundImagecolorFilter; @override Widget build(BuildContext context) { return Container( + padding:EdgeInsets.all( backgroundImage != null ? 10:0) , + decoration: BoxDecoration( + image:backgroundImage != null ? DecorationImage(image: backgroundImage , fit: BoxFit.cover, + colorFilter: backgroundImagecolorFilter?? ColorFilter.mode(Colors.black54, BlendMode.darken),):null, + ), child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ Row( children: [ + icon != null ? icon: Container(), icon != null ? Padding(padding: EdgeInsets.only(left: 10)): Container(), - text!=null?Text(text,style: - TextStyle(color: textColor != null ? getGFColor(textColor): Colors.black54, fontSize: 16, letterSpacing: 0.5, fontWeight: FontWeight.w500),) + text!=null?Text(text, style: + TextStyle( + color: textColor != null ? getGFColor(textColor): backgroundImage !=null ? Colors.white: Colors.black, + fontSize: 16, letterSpacing: 0.3, fontWeight: FontWeight.w500),) :child ], ), - Container( + showDivider ? Container( margin: EdgeInsets.only(top:5), alignment: dividerAlignment, child: Container( - width: 70, + width: dividerWidth != null ? dividerWidth : 70, height: 4, decoration: BoxDecoration( - color: dividerColor != null?getGFColor(dividerColor): GFColor.primary, + color: dividerColor != null ? getGFColor(dividerColor): backgroundImage !=null ? Colors.white: Colors.black, borderRadius: dividerBorderRadius != null ?dividerBorderRadius:BorderRadius.all(Radius.circular(5)) ), ) - ) + ): Container() ], ) ); From d4df87eb22ca608bdd05c1cdc8af8340a7545e40 Mon Sep 17 00:00:00 2001 From: "Shravya.ckm" Date: Fri, 27 Dec 2019 15:30:18 +0530 Subject: [PATCH 4/7] comments added for GFHeader --- example/lib/main.dart | 19 ++-- lib/components/header/gf_header.dart | 148 +++++++++++++++++---------- lib/components/toast/gf_toast.dart | 8 +- 3 files changed, 109 insertions(+), 66 deletions(-) diff --git a/example/lib/main.dart b/example/lib/main.dart index 74deb5d4..4772b5fb 100644 --- a/example/lib/main.dart +++ b/example/lib/main.dart @@ -84,15 +84,20 @@ class _MyHomePageState extends State { body: Column( children: [ - GFToast( - bgColor: GFColor.warning, - button: GFButton( - onPressed: null, - type: GFType.outline, - text: 'Accept', - ), + Container( + margin: EdgeInsets.only(top:10), + child: GFToast( +// +// +// +// button: GFButton( +// onPressed: null, +// type: GFType.outline, +// text: 'Accept', +// ), text: 'Marked as Favorite.', ), + ), Container( margin: EdgeInsets.only(left: 10, right: 10, top: 10, bottom: 10), child: Row( diff --git a/lib/components/header/gf_header.dart b/lib/components/header/gf_header.dart index ac5dc15f..63475942 100644 --- a/lib/components/header/gf_header.dart +++ b/lib/components/header/gf_header.dart @@ -2,75 +2,113 @@ import 'package:flutter/material.dart'; import 'package:ui_kit/colors/gf_color.dart'; class GFHeader extends StatelessWidget { - - - const GFHeader({Key key, - this.child, - this.text, - this.icon, - this.dividerBorderRadius, - this.textColor, - this.dividerAlignment, - this.dividerColor, - this.showDivider = true, - this.dividerWidth, - this.backgroundImage, - this.backgroundImagecolorFilter - }) : super (key:key); - + const GFHeader( + {Key key, + this.child, + this.text, + this.icon, + this.dividerBorderRadius, + this.textColor, + this.dividerAlignment, + this.dividerColor, + this.showDivider = true, + this.dividerWidth, + this.backgroundImage, + this.backgroundImagecolorFilter}) + : super(key: key); + /// child of type [Widget] is alternative to text key. text will get priority over child final Widget child; + + /// text of type [String] is alternative to child. text will get priority over child final String text; - final Widget icon; + + ///icon of type [Widget] used to pass icon or image + final Widget icon; + + /// Pass [GFColor] or [Color] for dividerColor final dynamic dividerColor; + + /// Pass [GFColor] or [Color] for textColor final dynamic textColor; + + /// dividerBorderRadius of type [BorderRadius] to alter the radius of the divider final BorderRadius dividerBorderRadius; + + ///dividerAlignment of type [Alignment] used for aligning the divider to required alignment final Alignment dividerAlignment; + + ///Pass [bool] value to show or hide the divider final bool showDivider; + + ///pass [double] type to increase or decrease the width of the divider final double dividerWidth; + + ///backgroundImage of type [ImageProvider] to set the background of [GFHeader] final ImageProvider backgroundImage; + + ///backgroundImagecolorFilter of type [ColorFilter] to set the background color of [GFHeader] only when backgroundImage is available final ColorFilter backgroundImagecolorFilter; - - - + @override Widget build(BuildContext context) { return Container( - padding:EdgeInsets.all( backgroundImage != null ? 10:0) , - decoration: BoxDecoration( - image:backgroundImage != null ? DecorationImage(image: backgroundImage , fit: BoxFit.cover, - colorFilter: backgroundImagecolorFilter?? ColorFilter.mode(Colors.black54, BlendMode.darken),):null, - ), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Row( - children: [ - - icon != null ? icon: Container(), - icon != null ? Padding(padding: EdgeInsets.only(left: 10)): Container(), - text!=null?Text(text, style: - TextStyle( - color: textColor != null ? getGFColor(textColor): backgroundImage !=null ? Colors.white: Colors.black, - fontSize: 16, letterSpacing: 0.3, fontWeight: FontWeight.w500),) - :child - ], - ), - showDivider ? Container( - margin: EdgeInsets.only(top:5), - alignment: dividerAlignment, - child: Container( - width: dividerWidth != null ? dividerWidth : 70, - height: 4, - decoration: BoxDecoration( - color: dividerColor != null ? getGFColor(dividerColor): backgroundImage !=null ? Colors.white: Colors.black, - borderRadius: dividerBorderRadius != null ?dividerBorderRadius:BorderRadius.all(Radius.circular(5)) - ), - ) - ): Container() - ], - ) - ); + padding: EdgeInsets.all(backgroundImage != null ? 10 : 0), + decoration: BoxDecoration( + image: backgroundImage != null + ? DecorationImage( + image: backgroundImage, + fit: BoxFit.cover, + colorFilter: backgroundImagecolorFilter ?? + ColorFilter.mode(Colors.black54, BlendMode.darken), + ) + : null, + ), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Row( + children: [ + icon != null ? icon : Container(), + icon != null + ? Padding(padding: EdgeInsets.only(left: 10)) + : Container(), + text != null + ? Text( + text, + style: TextStyle( + color: textColor != null + ? getGFColor(textColor) + : backgroundImage != null + ? Colors.white + : Colors.black, + fontSize: 16, + letterSpacing: 0.3, + fontWeight: FontWeight.w500), + ) + : child + ], + ), + showDivider + ? Container( + margin: EdgeInsets.only(top: 5), + alignment: dividerAlignment, + child: Container( + width: dividerWidth != null ? dividerWidth : 70, + height: 4, + decoration: BoxDecoration( + color: dividerColor != null + ? getGFColor(dividerColor) + : backgroundImage != null + ? Colors.white + : Colors.black, + borderRadius: dividerBorderRadius != null + ? dividerBorderRadius + : BorderRadius.all(Radius.circular(5))), + )) + : Container() + ], + )); } } diff --git a/lib/components/toast/gf_toast.dart b/lib/components/toast/gf_toast.dart index b8656bb3..b3d0af01 100644 --- a/lib/components/toast/gf_toast.dart +++ b/lib/components/toast/gf_toast.dart @@ -7,9 +7,9 @@ class GFToast extends StatelessWidget { GFToast({Key key, this.child, this.button, - this.bgColor, + this.backgroundColor, this.text, - this.textStyle = const TextStyle(color: Colors.white70, height: 1.5), + this.textStyle = const TextStyle(color: Colors.white70), }) :super(key: key); /// child of type [Widget]is alternative to text key. text will get priority over child @@ -19,7 +19,7 @@ class GFToast extends StatelessWidget { final Widget button; ///pass color of type [Color] or [GFColor] for background of [GFToast] - final dynamic bgColor; + final dynamic backgroundColor; /// text of type [String] is alternative to child. text will get priority over child final String text; @@ -36,7 +36,7 @@ class GFToast extends StatelessWidget { padding: EdgeInsets.all(10), decoration: BoxDecoration( borderRadius: BorderRadius.all(Radius.circular(3)), - color: bgColor!=null ?getGFColor(bgColor):Color(0xff323232), + color: backgroundColor!=null ?getGFColor(backgroundColor):Color(0xff323232), ), child: Row( children: [ From 4b593ed3041557b01dd9e503d999af8a69d82be5 Mon Sep 17 00:00:00 2001 From: "Shravya.ckm" Date: Fri, 27 Dec 2019 16:06:40 +0530 Subject: [PATCH 5/7] list_item is in progress --- example/lib/main.dart | 12 +++++++++++- lib/components/card/gf_card.dart | 4 ++-- lib/components/header/gf_header.dart | 2 +- .../gf_list_item.dart} | 10 +++++----- 4 files changed, 19 insertions(+), 9 deletions(-) rename lib/components/{header_bar/gf_title_bar.dart => list_item/gf_list_item.dart} (79%) diff --git a/example/lib/main.dart b/example/lib/main.dart index 4772b5fb..8f63acbf 100644 --- a/example/lib/main.dart +++ b/example/lib/main.dart @@ -15,7 +15,7 @@ import 'package:ui_kit/components/badge/gf_badge.dart'; import 'package:ui_kit/components/card/gf_card.dart'; -import 'package:ui_kit/components/header_bar/gf_title_bar.dart'; +import 'package:ui_kit/components/list_item/gf_list_item.dart'; import 'package:ui_kit/components/image/gf_image_overlay.dart'; @@ -84,6 +84,16 @@ class _MyHomePageState extends State { body: Column( children: [ + GFListItem( + avatar: GFAvatar(), + + title: GFHeader( + text: 'cvbn', +// showDivider: false, + backgroundImage: NetworkImage('https://cdn.pixabay.com/photo/2017/12/03/18/04/christmas-balls-2995437_960_720.jpg'), + ), + subTitle: Text('cfghjk'), + ), Container( margin: EdgeInsets.only(top:10), child: GFToast( diff --git a/lib/components/card/gf_card.dart b/lib/components/card/gf_card.dart index 93ca4e30..b46b59b3 100644 --- a/lib/components/card/gf_card.dart +++ b/lib/components/card/gf_card.dart @@ -1,7 +1,7 @@ import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:ui_kit/components/button_bar/gf_button_bar.dart'; -import 'package:ui_kit/components/header_bar/gf_title_bar.dart'; +import 'package:ui_kit/components/list_item/gf_list_item.dart'; import 'package:ui_kit/components/image/gf_image_overlay.dart'; import 'package:ui_kit/position/gf_position.dart'; @@ -62,7 +62,7 @@ class GFCard extends StatelessWidget { final bool semanticContainer; /// The title to display inside the [GFTitleBar]. see [GFTitleBar] - final GFTitleBar title; + final GFListItem title; /// widget can be used to define content final Widget content; diff --git a/lib/components/header/gf_header.dart b/lib/components/header/gf_header.dart index 63475942..1aadb06d 100644 --- a/lib/components/header/gf_header.dart +++ b/lib/components/header/gf_header.dart @@ -92,7 +92,7 @@ class GFHeader extends StatelessWidget { ), showDivider ? Container( - margin: EdgeInsets.only(top: 5), + margin: EdgeInsets.only(top: 5, bottom: 5), alignment: dividerAlignment, child: Container( width: dividerWidth != null ? dividerWidth : 70, diff --git a/lib/components/header_bar/gf_title_bar.dart b/lib/components/list_item/gf_list_item.dart similarity index 79% rename from lib/components/header_bar/gf_title_bar.dart rename to lib/components/list_item/gf_list_item.dart index 34791b54..34b1b81f 100644 --- a/lib/components/header_bar/gf_title_bar.dart +++ b/lib/components/list_item/gf_list_item.dart @@ -2,7 +2,7 @@ import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:ui_kit/components/avatar/gf_avatar.dart'; -class GFTitleBar extends StatelessWidget { +class GFListItem extends StatelessWidget { /// The card's background color. final Color color; @@ -15,16 +15,16 @@ class GFTitleBar extends StatelessWidget { /// [GFAvatar] used to create rounded user profile final GFAvatar avatar; - /// The title to display inside the [GFTitleBar]. see [Text] + /// The title to display inside the [GFListItem]. see [Text] final Widget title; - /// The subTitle to display inside the [GFTitleBar]. see [Text] + /// The subTitle to display inside the [GFListItem]. see [Text] final Widget subTitle; - /// The icon to display inside the [GFTitleBar]. see [Icon] + /// The icon to display inside the [GFListItem]. see [Icon] final Widget icon; - const GFTitleBar( + const GFListItem( {Key key, this.color, this.padding, From d6f24ace56598cefc5aeb91df2c5534d2c918cac Mon Sep 17 00:00:00 2001 From: "Shravya.ckm" Date: Fri, 27 Dec 2019 17:13:31 +0530 Subject: [PATCH 6/7] different types of list_item is in progress --- .../com/example/example/MainActivity.kt | 12 ++++ example/lib/main.dart | 67 +++++++++++++++---- 2 files changed, 67 insertions(+), 12 deletions(-) create mode 100644 example/android/app/src/main/kotlin/com/example/example/MainActivity.kt diff --git a/example/android/app/src/main/kotlin/com/example/example/MainActivity.kt b/example/android/app/src/main/kotlin/com/example/example/MainActivity.kt new file mode 100644 index 00000000..1656503f --- /dev/null +++ b/example/android/app/src/main/kotlin/com/example/example/MainActivity.kt @@ -0,0 +1,12 @@ +package com.example.example + +import androidx.annotation.NonNull; +import io.flutter.embedding.android.FlutterActivity +import io.flutter.embedding.engine.FlutterEngine +import io.flutter.plugins.GeneratedPluginRegistrant + +class MainActivity: FlutterActivity() { + override fun configureFlutterEngine(@NonNull flutterEngine: FlutterEngine) { + GeneratedPluginRegistrant.registerWith(flutterEngine); + } +} diff --git a/example/lib/main.dart b/example/lib/main.dart index 8f63acbf..8d1e3bf6 100644 --- a/example/lib/main.dart +++ b/example/lib/main.dart @@ -30,6 +30,7 @@ import 'package:ui_kit/components/toggle/gf_toggle.dart'; import 'package:ui_kit/types/gf_toggle_type.dart'; import 'package:flutter/cupertino.dart'; import 'package:ui_kit/components/header/gf_header.dart'; +import 'package:ui_kit/position/gf_position.dart'; import 'package:ui_kit/components/toast/gf_toast.dart'; @@ -82,21 +83,62 @@ class _MyHomePageState extends State { title: Text(widget.title), ), - body: Column( + body: + + SingleChildScrollView( + child: Column( children: [ + +// GFCard( +//// boxFit: BoxFit.cover, +//// colorFilter: new ColorFilter.mode( +//// Colors.black.withOpacity(0.67), BlendMode.darken), +// image: Image.asset("lib/assets/food.jpeg"), +//// imageOverlay: AssetImage("lib/assets/food.jpeg"), +// titlePosition: GFPosition.end, +// title: GFListItem( +// 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, +// ), +// ), +// ), + +// +// GFCard( +// title: GFListItem( +// title: Text('dcrfvjn'), +// subTitle: Text('fghjk'), +// +// ), +// +// ), + GFListItem( avatar: GFAvatar(), title: GFHeader( - text: 'cvbn', -// showDivider: false, - backgroundImage: NetworkImage('https://cdn.pixabay.com/photo/2017/12/03/18/04/christmas-balls-2995437_960_720.jpg'), + text: 'HEADER', + +// backgroundImage: NetworkImage('https://cdn.pixabay.com/photo/2017/12/03/18/04/christmas-balls-2995437_960_720.jpg'), ), - subTitle: Text('cfghjk'), + subTitle: Text('Sub Header'), ), - Container( - margin: EdgeInsets.only(top:10), - child: GFToast( + Container( + margin: EdgeInsets.only(top:10), + child: GFToast( // // // @@ -105,9 +147,9 @@ class _MyHomePageState extends State { // type: GFType.outline, // text: 'Accept', // ), - text: 'Marked as Favorite.', + text: 'Marked as Favorite.', + ), ), - ), Container( margin: EdgeInsets.only(left: 10, right: 10, top: 10, bottom: 10), child: Row( @@ -149,10 +191,10 @@ class _MyHomePageState extends State { // icon: Icon(Icons.image, color: Colors.white,), text: 'GET FLUTTER HEADER', //textColor: Colors.red, -dividerWidth: 20, + dividerWidth: 20, //backgroundImage: NetworkImage('https://cdn.pixabay.com/photo/2017/12/03/18/04/christmas-balls-2995437_960_720.jpg'), //showDivider: false, - + // textColor: Colors.black, // dividerColor: Colors.red, //dividerAlignment: Alignment.center, @@ -167,6 +209,7 @@ dividerWidth: 20, ], ), + ) // body: DefaultTabController( // length: 3, // child: Scaffold( From 71a9d8f5f2f7b2721d5c61c9da83425183b66aac Mon Sep 17 00:00:00 2001 From: "Shravya.ckm" Date: Fri, 27 Dec 2019 17:38:45 +0530 Subject: [PATCH 7/7] gfListTil modified --- example/lib/main.dart | 14 ++++++-------- .../gf_list_tile.dart} | 8 -------- 2 files changed, 6 insertions(+), 16 deletions(-) rename lib/components/{list_item/gf_list_item.dart => list_tile/gf_list_tile.dart} (75%) diff --git a/example/lib/main.dart b/example/lib/main.dart index 8d1e3bf6..84b8e635 100644 --- a/example/lib/main.dart +++ b/example/lib/main.dart @@ -15,7 +15,7 @@ import 'package:ui_kit/components/badge/gf_badge.dart'; import 'package:ui_kit/components/card/gf_card.dart'; -import 'package:ui_kit/components/list_item/gf_list_item.dart'; +import 'package:ui_kit/components/list_tile/gf_list_tile.dart'; import 'package:ui_kit/components/image/gf_image_overlay.dart'; @@ -126,15 +126,13 @@ class _MyHomePageState extends State { // // ), - GFListItem( + GFListTile( avatar: GFAvatar(), - - title: GFHeader( - text: 'HEADER', - -// backgroundImage: NetworkImage('https://cdn.pixabay.com/photo/2017/12/03/18/04/christmas-balls-2995437_960_720.jpg'), - ), + + icon: Icon(Icons.description), + title: Text('Header'), subTitle: Text('Sub Header'), + description: Text('Lorem ipsum gf header used to show the header of the list tile'), ), Container( margin: EdgeInsets.only(top:10), diff --git a/lib/components/list_item/gf_list_item.dart b/lib/components/list_tile/gf_list_tile.dart similarity index 75% rename from lib/components/list_item/gf_list_item.dart rename to lib/components/list_tile/gf_list_tile.dart index 34b1b81f..900f352e 100644 --- a/lib/components/list_item/gf_list_item.dart +++ b/lib/components/list_tile/gf_list_tile.dart @@ -6,12 +6,6 @@ class GFListItem extends StatelessWidget { /// The card's background color. final Color color; - /// The empty space that surrounds the card. Defines the card's outer [Container.margin]. - final EdgeInsetsGeometry margin; - - /// The empty space that surrounds the card. Defines the card's outer [Container.padding]. - final EdgeInsetsGeometry padding; - /// [GFAvatar] used to create rounded user profile final GFAvatar avatar; @@ -27,8 +21,6 @@ class GFListItem extends StatelessWidget { const GFListItem( {Key key, this.color, - this.padding, - this.margin, this.avatar, this.title, this.subTitle,