diff --git a/example/lib/main.dart b/example/lib/main.dart index 53010060..f7154474 100644 --- a/example/lib/main.dart +++ b/example/lib/main.dart @@ -21,6 +21,8 @@ import 'package:ui_kit/components/image/gf_image_overlay.dart'; import 'package:ui_kit/components/button_bar/gf_button_bar.dart'; +import 'package:ui_kit/components/list_tile/gf_list_tile.dart'; + import 'package:ui_kit/types/gf_type.dart'; import 'package:ui_kit/shape/gf_shape.dart'; import 'package:ui_kit/components/slider/gf_slider.dart'; @@ -45,7 +47,6 @@ class MyApp extends StatelessWidget { title: 'UI_KIT_EXAMPLE', theme: ThemeData( primarySwatch: Colors.blue, - ), debugShowCheckedModeBanner: false, home: MyHomePage(title: 'UI_KIT_EXAMPLE'), @@ -135,7 +136,10 @@ class _MyHomePageState extends State { // }, // ), - RawMaterialButton(onPressed: null, child: Text("fv"),), + RawMaterialButton( + onPressed: null, + child: Text("fv"), + ), FlatButton(onPressed: null, child: Text("cds")), // Container( @@ -197,7 +201,10 @@ class _MyHomePageState extends State { mainAxisAlignment: MainAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center, children: [ - RawMaterialButton(onPressed: null, child: Text("fv"),), + RawMaterialButton( + onPressed: null, + child: Text("fv"), + ), FlatButton(onPressed: null, child: Text("cds")), Icon(Icons.directions_railway), GFButton( @@ -264,7 +271,7 @@ class _MyHomePageState extends State { image: Image.asset("lib/assets/food.jpeg"), // imageOverlay: AssetImage("lib/assets/food.jpeg"), titlePosition: GFPosition.end, - title: GFListItem( + title: GFListTile( avatar: GFAvatar( child: Text("tb"), ), diff --git a/lib/components/card/gf_card.dart b/lib/components/card/gf_card.dart index 1d1e479f..a99df63d 100644 --- a/lib/components/card/gf_card.dart +++ b/lib/components/card/gf_card.dart @@ -62,7 +62,7 @@ class GFCard extends StatelessWidget { final bool semanticContainer; /// The title to display inside the [GFTitleBar]. see [GFTitleBar] - final GFListItem title; + final GFListTile 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 1aadb06d..20f1709f 100644 --- a/lib/components/header/gf_header.dart +++ b/lib/components/header/gf_header.dart @@ -1,9 +1,11 @@ import 'package:flutter/material.dart'; import 'package:ui_kit/colors/gf_color.dart'; +import 'package:ui_kit/types/gf_heading_type.dart'; class GFHeader extends StatelessWidget { const GFHeader( {Key key, + this.type, this.child, this.text, this.icon, @@ -18,6 +20,8 @@ class GFHeader extends StatelessWidget { : super(key: key); + + /// child of type [Widget] is alternative to text key. text will get priority over child final Widget child; @@ -51,8 +55,29 @@ class GFHeader extends StatelessWidget { ///backgroundImagecolorFilter of type [ColorFilter] to set the background color of [GFHeader] only when backgroundImage is available final ColorFilter backgroundImagecolorFilter; + + /// header type of [GFHeaderType] i.e, typo1, typo2, typo3, typo4, typo5, typo6 + final GFHeadingType type; + @override Widget build(BuildContext context) { + + double fontSize; + + if(type == GFHeadingType.typo1){ + fontSize = 25.0; + }else if(type == GFHeadingType.typo2){ + fontSize = 22.0; + }else if (type == GFHeadingType.typo3){ + fontSize = 19.0; + }else if(type == GFHeadingType.typo4){ + fontSize = 17.0; + }else if (type == GFHeadingType.typo5){ + fontSize = 15.0; + }else if(type == GFHeadingType.typo6){ + fontSize = 13.0; + } + return Container( padding: EdgeInsets.all(backgroundImage != null ? 10 : 0), decoration: BoxDecoration( @@ -75,28 +100,28 @@ class GFHeader extends StatelessWidget { ? 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), - ) + ? Expanded(child: Text( + text, + style: TextStyle( + color: textColor != null + ? getGFColor(textColor) + : backgroundImage != null + ? Colors.white + : Colors.black, + fontSize: fontSize, + letterSpacing: 0.3, + fontWeight: FontWeight.w500), + )) : child ], ), showDivider ? Container( - margin: EdgeInsets.only(top: 5, bottom: 5), + margin: EdgeInsets.only(top: 3, bottom: 3), alignment: dividerAlignment, child: Container( width: dividerWidth != null ? dividerWidth : 70, - height: 4, + height: fontSize/5, decoration: BoxDecoration( color: dividerColor != null ? getGFColor(dividerColor) diff --git a/lib/components/image/gf_image_overlay.dart b/lib/components/image/gf_image_overlay.dart index d373e7a8..9733d742 100644 --- a/lib/components/image/gf_image_overlay.dart +++ b/lib/components/image/gf_image_overlay.dart @@ -1,23 +1,24 @@ +import 'dart:ui'; + import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; class GFImageOverlay extends StatelessWidget { - - const GFImageOverlay({ - Key key, - this.height, - this.width, - this.color, - this.padding, - this.margin, - this.image, - this.child, - this.alignment, - this.borderRadius, - this.colorFilter, - this.boxFit, - this.border - }) : super(key: key); + const GFImageOverlay( + {Key key, + this.height, + this.width, + this.color, + this.padding, + this.margin, + this.image, + this.child, + this.alignment, + this.borderRadius, + this.colorFilter= const ColorFilter.mode(Colors.black26, BlendMode.colorBurn), + this.boxFit, + this.border}) + : super(key: key); /// define image's [double] height final double height; @@ -49,7 +50,7 @@ class GFImageOverlay extends StatelessWidget { final BoxFit boxFit; /// A color filter to apply to the image before painting it. - final ColorFilter colorFilter; + final ColorFilter colorFilter ; /// The corners of this [GFCard] are rounded by this [BorderRadius]. final BorderRadiusGeometry borderRadius; @@ -59,11 +60,10 @@ class GFImageOverlay extends StatelessWidget { @override Widget build(BuildContext context) { - return Container( alignment: alignment, - height: height, - width: width, + height: height ?? MediaQuery.of(context).size.height * 0.3, + width: width ?? MediaQuery.of(context).size.width, margin: margin, padding: padding, child: child, @@ -72,14 +72,8 @@ class GFImageOverlay extends StatelessWidget { border: border, color: color, image: new DecorationImage( - fit: boxFit, - colorFilter: colorFilter, - image: image - ), + fit: BoxFit.fill, colorFilter: child != null? colorFilter: null, image: image), ), ); } } - - - diff --git a/lib/components/list_tile/gf_list_tile.dart b/lib/components/list_tile/gf_list_tile.dart index 900f352e..34fb92f5 100644 --- a/lib/components/list_tile/gf_list_tile.dart +++ b/lib/components/list_tile/gf_list_tile.dart @@ -2,38 +2,64 @@ import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:ui_kit/components/avatar/gf_avatar.dart'; -class GFListItem extends StatelessWidget { +class GFListTile extends StatelessWidget { /// The card's background color. final Color color; - /// [GFAvatar] used to create rounded user profile - final GFAvatar avatar; + /// type of [Widget] or [GFAvatar] used to create rounded user profile + final Widget avatar; - /// The title to display inside the [GFListItem]. see [Text] + /// The title to display inside the [GFListTile]. see [Text] final Widget title; - /// The subTitle to display inside the [GFListItem]. see [Text] + /// The subTitle to display inside the [GFListTile]. see [Text] final Widget subTitle; - /// The icon to display inside the [GFListItem]. see [Icon] + /// The descriprion to display inside the [GFListTile]. see [Text] + final Widget description; + + /// The icon to display inside the [GFListTile]. see [Icon] final Widget icon; - const GFListItem( + ///type of [bool] corresponds to true or false to show or hide the divider + final bool showDivider; + + const GFListTile( {Key key, this.color, this.avatar, this.title, this.subTitle, - this.icon}) + this.description, + this.icon, + this.showDivider = true + }) : super(key: key); @override Widget build(BuildContext context) { - return ListTile( - leading: avatar, - title: title, - subtitle: subTitle, - trailing: icon, + return Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + ListTile( + leading: avatar, + title: title, + subtitle: subTitle != null || description != null ? Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + subTitle ?? Container(), + description ?? Container() + ], + ): null, + trailing: icon != null ? Column( + children: [ + Padding(padding: EdgeInsets.only(top: description != null ? 0.0 : 8.0), child: + icon ) + ], + ): null + ), + showDivider ? Divider() : Container() + ], ); } } \ No newline at end of file diff --git a/lib/components/slider/gf_slider.dart b/lib/components/slider/gf_slider.dart index 852403e4..fe3a4846 100644 --- a/lib/components/slider/gf_slider.dart +++ b/lib/components/slider/gf_slider.dart @@ -1,4 +1,5 @@ import 'dart:async'; +//import 'dart:ffi'; import 'package:flutter/material.dart'; List map(List list, Function handler) { @@ -12,30 +13,32 @@ List map(List list, Function handler) { class GFSlider extends StatefulWidget { GFSlider( {@required this.items, - this.pagerSize, - this.passiveIndicator, - this.activeIndicator, - this.pagination, - this.height, - this.aspectRatio: 16 / 9, - this.viewportFraction: 0.8, - this.initialPage: 0, - int realPage: 10000, - this.enableInfiniteScroll: true, - this.reverse: false, - this.autoPlay: false, - this.autoPlayInterval: const Duration(seconds: 4), - this.autoPlayAnimationDuration = const Duration(milliseconds: 800), - this.autoPlayCurve: Curves.fastOutSlowIn, - this.pauseAutoPlayOnTouch, - this.enlargeMainPage = false, - this.onPageChanged, - this.scrollPhysics, - this.scrollDirection: Axis.horizontal}) - : this.realPage = enableInfiniteScroll ? realPage + initialPage : initialPage, + this.pagerSize, + this.passiveIndicator, + this.activeIndicator, + this.pagination, + this.height, + this.aspectRatio: 16 / 9, + this.viewportFraction: 0.8, + this.initialPage: 0, + int realPage: 10000, + this.enableInfiniteScroll: true, + this.reverse: false, + this.autoPlay: false, + this.autoPlayInterval: const Duration(seconds: 4), + this.autoPlayAnimationDuration = const Duration(milliseconds: 800), + this.autoPlayCurve: Curves.fastOutSlowIn, + this.pauseAutoPlayOnTouch, + this.enlargeMainPage = false, + this.onPageChanged, + this.scrollPhysics, + this.scrollDirection: Axis.horizontal}) + : this.realPage = + enableInfiniteScroll ? realPage + initialPage : initialPage, this.pageController = PageController( viewportFraction: viewportFraction, - initialPage: enableInfiniteScroll ? realPage + initialPage : initialPage, + initialPage: + enableInfiniteScroll ? realPage + initialPage : initialPage, ); /// The pagination dots size can be defined using [double]. @@ -135,8 +138,10 @@ class GFSlider extends StatefulWidget { /// Jumps the page position from its current value to the given value, /// without animation, and without checking if the new value is in range. void jumpToPage(int page) { - final index = _getRealIndex(pageController.page.toInt(), realPage, items.length); - return pageController.jumpToPage(pageController.page.toInt() + page - index); + final index = + _getRealIndex(pageController.page.toInt(), realPage, items.length); + return pageController + .jumpToPage(pageController.page.toInt() + page - index); } /// Animates the controlled [GFSlider] from the current page to the given page. @@ -144,9 +149,12 @@ class GFSlider extends StatefulWidget { /// The animation lasts for the given duration and follows the given curve. /// The returned [Future] resolves when the animation completes. Future animateToPage(int page, {Duration duration, Curve curve}) { - final index = _getRealIndex(pageController.page.toInt(), realPage, items.length); - return pageController.animateToPage(pageController.page.toInt() + page - index, - duration: duration, curve: curve); + final index = + _getRealIndex(pageController.page.toInt(), realPage, items.length); + return pageController.animateToPage( + pageController.page.toInt() + page - index, + duration: duration, + curve: curve); } @override @@ -165,8 +173,9 @@ class _GFSliderState extends State with TickerProviderStateMixin { Timer getPlayTimer() { return Timer.periodic(widget.autoPlayInterval, (_) { if (widget.autoPlay) { - widget.pageController - .nextPage(duration: widget.autoPlayAnimationDuration, curve: widget.autoPlayCurve); + widget.pageController.nextPage( + duration: widget.autoPlayAnimationDuration, + curve: widget.autoPlayCurve); } }); } @@ -185,7 +194,8 @@ class _GFSliderState extends State with TickerProviderStateMixin { ? addGestureDetection(wrapper) : wrapper; } else { - final Widget wrapper = AspectRatio(aspectRatio: widget.aspectRatio, child: child); + final Widget wrapper = + AspectRatio(aspectRatio: widget.aspectRatio, child: child); return widget.autoPlay && widget.pauseAutoPlayOnTouch != null ? addGestureDetection(wrapper) : wrapper; @@ -214,8 +224,8 @@ class _GFSliderState extends State with TickerProviderStateMixin { reverse: widget.reverse, itemCount: widget.enableInfiniteScroll ? null : widget.items.length, onPageChanged: (int index) { - - int currentPage = _getRealIndex(index + widget.initialPage, widget.realPage, widget.items.length); + int currentPage = _getRealIndex(index + widget.initialPage, + widget.realPage, widget.items.length); if (widget.onPageChanged != null) { widget.onPageChanged(currentPage); _current = currentPage; @@ -223,8 +233,8 @@ class _GFSliderState extends State with TickerProviderStateMixin { _current = currentPage; }, itemBuilder: (BuildContext context, int i) { - final int index = - _getRealIndex(i + widget.initialPage, widget.realPage, widget.items.length); + final int index = _getRealIndex( + i + widget.initialPage, widget.realPage, widget.items.length); return AnimatedBuilder( animation: widget.pageController, @@ -242,48 +252,63 @@ class _GFSliderState extends State with TickerProviderStateMixin { double value = widget.pageController.page - i; value = (1 - (value.abs() * 0.3)).clamp(0.0, 1.0); - final double height = - widget.height ?? MediaQuery.of(context).size.width * (1 / widget.aspectRatio); - final double distortionValue = - widget.enlargeMainPage ? Curves.easeOut.transform(value) : 1.0; + final double height = widget.height ?? + MediaQuery.of(context).size.width * + (1 / widget.aspectRatio); + final double distortionValue = widget.enlargeMainPage + ? Curves.easeOut.transform(value) + : 1.0; if (widget.scrollDirection == Axis.horizontal) { - return Center(child: SizedBox(height: distortionValue * height, child: child)); + return Center( + child: SizedBox( + height: distortionValue * height, child: child)); } else { return Center( child: SizedBox( - width: distortionValue * MediaQuery.of(context).size.width, child: child)); + width: distortionValue * + MediaQuery.of(context).size.width, + child: child)); } }, ); }, )), - widget.pagination == true ? Positioned( - left: 0.0, - right: 0.0, - bottom: 0.0, - child: Container( - child: Row( - mainAxisAlignment: MainAxisAlignment.center, - children: map( - widget.items, - (indexx, url) { - return Container( - width: widget.pagerSize == null ? 8.0 : widget.pagerSize, - height: widget.pagerSize == null ? 8.0 : widget.pagerSize, - margin: EdgeInsets.symmetric(vertical: 10.0, horizontal: 2.0), - decoration: BoxDecoration( - shape: BoxShape.circle, - color: _current == indexx - ? widget.activeIndicator == null ? Color.fromRGBO(0, 0, 0, 0.9) : widget.activeIndicator - : widget.passiveIndicator == null ? Color.fromRGBO(0, 0, 0, 0.4) : widget.passiveIndicator, + widget.pagination == true + ? Positioned( + left: 0.0, + right: 0.0, + bottom: 0.0, + child: Container( + child: Row( + mainAxisAlignment: MainAxisAlignment.center, + children: map( + widget.items, + (indexx, url) { + return Container( + width: + widget.pagerSize == null ? 8.0 : widget.pagerSize, + height: + widget.pagerSize == null ? 8.0 : widget.pagerSize, + margin: EdgeInsets.symmetric( + vertical: 10.0, horizontal: 2.0), + decoration: BoxDecoration( + shape: BoxShape.circle, + color: _current == indexx + ? widget.activeIndicator == null + ? Color.fromRGBO(0, 0, 0, 0.9) + : widget.activeIndicator + : widget.passiveIndicator == null + ? Color.fromRGBO(0, 0, 0, 0.4) + : widget.passiveIndicator, + ), + ); + }, ), - ); - }, - ), - ), - ), - ) : Container(), + ), + ), + ) + : Container(), ], ); } @@ -310,4 +335,4 @@ int _getRealIndex(int position, int base, int length) { int _remainder(int input, int source) { final int result = input % source; return result < 0 ? source + result : result; -} \ No newline at end of file +} diff --git a/lib/components/toast/gf_floating_widget.dart b/lib/components/toast/gf_floating_widget.dart new file mode 100644 index 00000000..bb2c59de --- /dev/null +++ b/lib/components/toast/gf_floating_widget.dart @@ -0,0 +1,51 @@ +import 'package:flutter/material.dart'; +import 'package:ui_kit/components/toast/gf_toast.dart'; + +class GFFloatingWidget extends StatefulWidget { + const GFFloatingWidget( + {Key key, + this.child, + this.horizontalPosition, + this.verticalPosition, + this.body}) + : super(key: key); + + ///child of type [Widget] which floats across the body based on horizontal and vertical position + final Widget child; + + ///body of type [Widget] which is same as Scaffold's body + final Widget body; + + /// horizontalPosition of type [double] which aligns the child horizontally across the body + final double horizontalPosition; + + /// verticalPosition of type [double] which aligns the child vertically across the body + final double verticalPosition; + + @override + _GFFloatingWidgetState createState() => _GFFloatingWidgetState(); +} + +class _GFFloatingWidgetState extends State { + @override + Widget build(BuildContext context) { + var screenWidth = MediaQuery.of(context).size.width; + var screenHeight = MediaQuery.of(context).size.height; + return Stack( + children: [ + Container( + child: widget.body ?? Container(), + ), + Positioned( + top: widget.horizontalPosition != null + ? widget.horizontalPosition + : 0, + left: widget.verticalPosition != null ? widget.verticalPosition : 0, + child: Container( + width: MediaQuery.of(context).size.width, + child: widget.child ?? Container(), + )), + ], + ); + } +} diff --git a/lib/components/toast/gf_toast.dart b/lib/components/toast/gf_toast.dart index b3d0af01..182e42c7 100644 --- a/lib/components/toast/gf_toast.dart +++ b/lib/components/toast/gf_toast.dart @@ -1,4 +1,5 @@ import 'package:flutter/material.dart'; +import 'package:flutter/widgets.dart'; import 'package:ui_kit/colors/gf_color.dart'; class GFToast extends StatelessWidget { @@ -31,7 +32,7 @@ class GFToast extends StatelessWidget { @override Widget build(BuildContext context) { return - ConstrainedBox(constraints: BoxConstraints(minHeight: 50.0,), child: Container( + ConstrainedBox(constraints: BoxConstraints(minHeight: 50.0, minWidth: 340), child: Container( margin: EdgeInsets.only(left: 10, right: 10), padding: EdgeInsets.all(10), decoration: BoxDecoration( @@ -50,7 +51,11 @@ class GFToast extends StatelessWidget { button!=null?Flexible( flex: 4, fit: FlexFit.tight, - child: button):Container() + child: Align( + alignment: Alignment.topRight, + child: button, + ) + ):Container() ], ), ),); diff --git a/lib/components/toggle/gf_toggle.dart b/lib/components/toggle/gf_toggle.dart index bf86b7ae..8fdb3e6c 100644 --- a/lib/components/toggle/gf_toggle.dart +++ b/lib/components/toggle/gf_toggle.dart @@ -18,10 +18,9 @@ class GFToggle extends StatefulWidget { this.type, this.boxShape, this.borderRadius, - this.duration}) + this.duration = const Duration(milliseconds: 400)}) : super(key: key); - ///type [String] used to add custom text i.e, ON,ENABLE final String enabledText; @@ -37,7 +36,7 @@ class GFToggle extends StatefulWidget { // ///type of [Color] used for the active thumb color final Color enabledThumbColor; - ///type of [Color] used for the inactive thumb color + ///type of [Color] used for the inactive thumb color final Color disabledThumbColor; ///type of [Color] used for the active track color @@ -55,7 +54,7 @@ class GFToggle extends StatefulWidget { ///type of animation [Duration] called when the switch animates during the specific duration final Duration duration; - /// Button type of [GFToggleType] i.e, android, ios, custom, sqaure + /// Button type of [GFToggleType] i.e, android, ios, custom, sqaure GFToggleType type; /// This property must not be null. Used to set the current state of toggle @@ -64,7 +63,7 @@ class GFToggle extends StatefulWidget { /// Called when the user toggles the switch on or off. final ValueChanged onChanged; - @override + @override _GFToggleState createState() => _GFToggleState(); } @@ -80,7 +79,8 @@ class _GFToggleState extends State with TickerProviderStateMixin { void initState() { super.initState(); controller = AnimationController(vsync: this, duration: widget.duration); - offset = Tween(begin: Offset.zero, end: Offset(1.0, 0.0)).animate(controller); + offset = Tween(begin: Offset.zero, end: Offset(1.0, 0.0)) + .animate(controller); } @override @@ -105,10 +105,9 @@ class _GFToggleState extends State with TickerProviderStateMixin { break; default: } - if(widget.onChanged!=null){ + if (widget.onChanged != null) { widget.onChanged(isOn); } - }, child: Stack( children: [ @@ -130,25 +129,31 @@ class _GFToggleState extends State with TickerProviderStateMixin { : widget.borderRadius ?? BorderRadius.all(Radius.circular(20))), child: Padding( - padding: widget.type == GFToggleType.ios ? EdgeInsets.only(left: 3.5, right: 3.5, top: 5.4): EdgeInsets.only(left: 3, right: 3, top: 3.4), + padding: widget.type == GFToggleType.ios + ? EdgeInsets.only(left: 3.5, right: 3.5, top: 5.4) + : EdgeInsets.only(left: 3, right: 3, top: 3.4), child: isOn ? Text( widget.enabledText ?? - ( widget.type == GFToggleType.custom - ? 'ON' - : ''), + (widget.type == GFToggleType.custom + ? 'ON' + : ''), style: widget.enabledTextStyle ?? - ( widget.type == GFToggleType.ios ?TextStyle(color: Colors.white, fontSize: 12): TextStyle(color: Colors.white, fontSize: 8)) - ) + (widget.type == GFToggleType.ios + ? TextStyle( + color: Colors.white, fontSize: 12) + : TextStyle( + color: Colors.white, fontSize: 8))) : Text( widget.disabledText ?? - ( widget.type == GFToggleType.custom - ? 'OFF' - : ''), + (widget.type == GFToggleType.custom + ? 'OFF' + : ''), textAlign: TextAlign.end, style: widget.disabledTextStyle ?? - ( widget.type == GFToggleType.ios ?TextStyle(color: Colors.white, fontSize: 12): TextStyle(color: Colors.white, fontSize: 8)) - ))), + (widget.type == GFToggleType.ios + ? TextStyle(color: Colors.white, fontSize: 12) + : TextStyle(color: Colors.white, fontSize: 8))))), ), Positioned( top: widget.type == GFToggleType.ios ? 7.5 : 3, @@ -167,7 +172,7 @@ class _GFToggleState extends State with TickerProviderStateMixin { break; default: } - if(widget.onChanged!=null){ + if (widget.onChanged != null) { widget.onChanged(isOn); } }, @@ -181,8 +186,9 @@ class _GFToggleState extends State with TickerProviderStateMixin { shape: widget.type == GFToggleType.square ? BoxShape.rectangle : widget.boxShape ?? BoxShape.circle, - color: isOn ? widget.enabledThumbColor ?? Colors.white - : widget.disabledThumbColor ?? Colors.white, + color: isOn + ? widget.enabledThumbColor ?? Colors.white + : widget.disabledThumbColor ?? Colors.white, boxShadow: [ new BoxShadow( color: Colors.black.withOpacity(0.16), @@ -190,9 +196,7 @@ class _GFToggleState extends State with TickerProviderStateMixin { spreadRadius: 0.0), ]), ), - ) - ) - ), + ))), ], ), ); diff --git a/lib/types/gf_heading_type.dart b/lib/types/gf_heading_type.dart new file mode 100644 index 00000000..23d7cdc6 --- /dev/null +++ b/lib/types/gf_heading_type.dart @@ -0,0 +1 @@ +enum GFHeadingType { typo1, typo2, typo3, typo4, typo5, typo6 } \ No newline at end of file