Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
115 changes: 54 additions & 61 deletions example/lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -150,29 +150,6 @@ class _MyHomePageState extends State<MyHomePage>
backgroundColor: Colors.tealAccent,
centerTitle: true,
title: Text("UI KIT"),
// GFSegmentTabs(
// tabController: tabController,
// initialIndex: 0,
// length: 3,
// tabs: <Widget>[
// Tab(
// child: Text(
// "cream",
// ),
// ),
// Tab(
// child: Text(
// "serum",
// ),
// ),
// Tab(
// child: Text(
// "toner",
// ),
// ),
// ],
//// borderRadius: BorderRadius.circular(50.0),
// ),
// trailing: <Widget>[
// GFIconButton(icon: Icon(Icons.directions_bus), onPressed: null)
// ],
Expand Down Expand Up @@ -316,7 +293,7 @@ class _MyHomePageState extends State<MyHomePage>
// dividerHeight: 2.0,
// dividerIndent: 30.0,
// dividerThickness: 5.0,
// showDivider: false,
showDivider: false,
),

GFListTile(
Expand Down Expand Up @@ -370,15 +347,11 @@ class _MyHomePageState extends State<MyHomePage>
GFCard(
content: GFImageOverlay(
height: 200.0,
width: MediaQuery.of(context).size.width,
child: Text("Dcs"),
// color: color ?? cardTheme.color ?? Theme.of(context).cardColor,
width: 200.0,
image: AssetImage("lib/assets/food.jpeg"),
boxFit: BoxFit.fill,
colorFilter: new ColorFilter.mode(
Colors.black.withOpacity(0.67), BlendMode.darken),
// border: border,
// borderRadius: borderRadius ?? BorderRadius.all(Radius.circular(4.0)),
colorFilter: new ColorFilter.mode(Colors.black.withOpacity(0.67), BlendMode.darken),
shape: BoxShape.circle,
),
),

Expand Down Expand Up @@ -506,10 +479,10 @@ class _MyHomePageState extends State<MyHomePage>
// radius: 80.0,
// backgroundImage: NetworkImage("https://cdn.pixabay.com/photo/2017/12/03/18/04/christmas-balls-2995437_960_720.jpg"),
// ),
//

GFSegmentTabs(
tabController: tabController,
// height: 38.0,
// height: 36.0,
// width: 180.0,
initialIndex: 0,
length: 3,
Expand All @@ -528,18 +501,20 @@ class _MyHomePageState extends State<MyHomePage>
),
),
],
// tabBarColor: Colors.pink.withOpacity(0.6),
// indicatorSize: TabBarIndicatorSize.tab,
// indicatorColor: Colors.tealAccent,
// indicator: BoxDecoration(
// color: Colors.pink,
// border: Border.all(color: Colors.green, width: 1.0),
// borderRadius: BorderRadius.circular(50.0)
// ),
// indicatorPadding: EdgeInsets.all(8.0),
// indicatorWeight: 2.0,
// border: Border.all(color: Colors.orange, width: 2.0),
// borderRadius: BorderRadius.circular(50.0)
tabBarColor: Colors.grey,
indicatorSize: TabBarIndicatorSize.tab,
indicatorColor: Colors.greenAccent,
labelColor: Colors.greenAccent,
unselectedLabelColor: Colors.white,
indicator: BoxDecoration(
color: Colors.black,
border: Border(bottom: BorderSide(color: Colors.greenAccent, width: 2.0,),),
// borderRadius: BorderRadius.circular(2.0)
),
indicatorPadding: EdgeInsets.all(8.0),
indicatorWeight: 2.0,
border: Border.all(color: Colors.white, width: 2.0),
borderRadius: BorderRadius.circular(2.0)
),
//
// GFTabBarView(
Expand Down Expand Up @@ -666,22 +641,22 @@ class _MyHomePageState extends State<MyHomePage>
// Icon(Icons.directions_transit),
// ],
// ),
//// indicatorColor: Colors.teal,
//// indicatorSize: TabBarIndicatorSize.label,
//// labelColor: Colors.lightGreen,
//// unselectedLabelColor: Colors.black,
//// labelStyle: TextStyle(
//// fontWeight: FontWeight.w500,
//// fontSize: 13.0,
//// color: Colors.deepOrange,
//// fontFamily: 'OpenSansBold',
//// ),
//// unselectedLabelStyle: TextStyle(
//// fontWeight: FontWeight.w500,
//// fontSize: 13.0,
//// color: Colors.black,
//// fontFamily: 'OpenSansBold',
//// ),
// indicatorColor: Colors.teal,
// indicatorSize: TabBarIndicatorSize.label,
// labelColor: Colors.lightGreen,
// unselectedLabelColor: Colors.black,
// labelStyle: TextStyle(
// fontWeight: FontWeight.w500,
// fontSize: 13.0,
// color: Colors.deepOrange,
// fontFamily: 'OpenSansBold',
// ),
// unselectedLabelStyle: TextStyle(
// fontWeight: FontWeight.w500,
// fontSize: 13.0,
// color: Colors.black,
// fontFamily: 'OpenSansBold',
// ),
// ),
//
// GFCarousel(
Expand Down Expand Up @@ -1005,6 +980,24 @@ class _MyHomePageState extends State<MyHomePage>
),
),
],
indicatorColor: Colors.teal,
// indicatorSize: TabBarIndicatorSize.label,
labelColor: Colors.lightGreen,
labelPadding: EdgeInsets.all(8.0),
tabBarColor: Colors.blueGrey,
unselectedLabelColor: Colors.black,
labelStyle: TextStyle(
fontWeight: FontWeight.w500,
fontSize: 13.0,
color: Colors.deepOrange,
fontFamily: 'OpenSansBold',
),
unselectedLabelStyle: TextStyle(
fontWeight: FontWeight.w500,
fontSize: 13.0,
color: Colors.black,
fontFamily: 'OpenSansBold',
),
),
);
}
Expand Down
50 changes: 34 additions & 16 deletions lib/components/image/gf_image_overlay.dart
Original file line number Diff line number Diff line change
Expand Up @@ -4,21 +4,23 @@ 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= const ColorFilter.mode(Colors.black26, BlendMode.colorBurn),
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 = const Text(""),
this.alignment,
this.borderRadius,
this.colorFilter= const ColorFilter.mode(Colors.black26, BlendMode.colorBurn),
this.boxFit,
this.border,
this.shape = BoxShape.rectangle,
}) : assert(shape != null),
super(key: key);

/// define image's [double] height
final double height;
Expand Down Expand Up @@ -58,6 +60,21 @@ class GFImageOverlay extends StatelessWidget {
/// A border to draw above the [GFCard].
final Border border;

/// The shape to fill the background [color], [gradient], and [image] into and
/// to cast as the [boxShadow].
///
/// If this is [BoxShape.circle] then [borderRadius] is ignored.
///
/// The [shape] cannot be interpolated; animating between two [BoxDecoration]s
/// with different [shape]s will result in a discontinuity in the rendering.
/// To interpolate between two shapes, consider using [ShapeDecoration] and
/// different [ShapeBorder]s; in particular, [CircleBorder] instead of
/// [BoxShape.circle] and [RoundedRectangleBorder] instead of
/// [BoxShape.rectangle].
///
/// {@macro flutter.painting.boxDecoration.clip}
final BoxShape shape;

@override
Widget build(BuildContext context) {
return Container(
Expand All @@ -68,11 +85,12 @@ class GFImageOverlay extends StatelessWidget {
padding: padding,
child: child,
decoration: new BoxDecoration(
shape: shape,
borderRadius: borderRadius,
border: border,
color: color,
image: new DecorationImage(
fit: BoxFit.fill, colorFilter: child != null? colorFilter: null, image: image),
fit: BoxFit.fill, colorFilter: child != null? colorFilter: null, image: image),
),
);
}
Expand Down
8 changes: 1 addition & 7 deletions lib/components/tabs/gf_segment_tabs.dart
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ class GFSegmentTabs extends StatefulWidget {
this.labelPadding,
this.unselectedLabelColor,
this.unselectedLabelStyle,
this.tabBarView,
this.tabs,
this.tabController
}):
Expand Down Expand Up @@ -139,11 +138,6 @@ class GFSegmentTabs extends StatefulWidget {
/// body2 definition is used.
final TextStyle unselectedLabelStyle;

/// One widget per tab.
/// Its length must match the length of the [GFSegmentTabs.tabs]
/// list, as well as the [controller]'s [GFSegmentTabs.length].
final GFTabBarView tabBarView;

/// Typically a list of two or more [Tab] widgets.
///
/// The length of this list must match the [controller]'s [TabController.length]
Expand Down Expand Up @@ -188,7 +182,7 @@ class _GFSegmentTabsState extends State<GFSegmentTabs> {
BoxDecoration(
color: widget.indicatorColor == null ? getGFColor(GFColor.primary) : widget.indicatorColor,
border: Border.all(color: widget.indicatorColor == null ? Colors.transparent : widget.indicatorColor, width: 2.0),
borderRadius: widget.borderRadius == null ? BorderRadius.circular(0.0) : widget.borderRadius,
borderRadius: widget.borderRadius == null ? BorderRadius.circular(2.0) : widget.borderRadius,
) : widget.indicator,
indicatorPadding: widget.indicatorPadding,
indicatorWeight: widget.indicatorWeight,
Expand Down