Skip to content

Commit 7f7a063

Browse files
committed
Merge branch 'master' of https://github.com/shravyackm/getflutter into getFlutterWeb
2 parents 47c2856 + 1a93018 commit 7f7a063

File tree

3 files changed

+89
-84
lines changed

3 files changed

+89
-84
lines changed

example/lib/main.dart

Lines changed: 54 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -150,29 +150,6 @@ class _MyHomePageState extends State<MyHomePage>
150150
backgroundColor: Colors.tealAccent,
151151
centerTitle: true,
152152
title: Text("UI KIT"),
153-
// GFSegmentTabs(
154-
// tabController: tabController,
155-
// initialIndex: 0,
156-
// length: 3,
157-
// tabs: <Widget>[
158-
// Tab(
159-
// child: Text(
160-
// "cream",
161-
// ),
162-
// ),
163-
// Tab(
164-
// child: Text(
165-
// "serum",
166-
// ),
167-
// ),
168-
// Tab(
169-
// child: Text(
170-
// "toner",
171-
// ),
172-
// ),
173-
// ],
174-
//// borderRadius: BorderRadius.circular(50.0),
175-
// ),
176153
// trailing: <Widget>[
177154
// GFIconButton(icon: Icon(Icons.directions_bus), onPressed: null)
178155
// ],
@@ -316,7 +293,7 @@ class _MyHomePageState extends State<MyHomePage>
316293
// dividerHeight: 2.0,
317294
// dividerIndent: 30.0,
318295
// dividerThickness: 5.0,
319-
// showDivider: false,
296+
showDivider: false,
320297
),
321298

322299
GFListTile(
@@ -370,15 +347,11 @@ class _MyHomePageState extends State<MyHomePage>
370347
GFCard(
371348
content: GFImageOverlay(
372349
height: 200.0,
373-
width: MediaQuery.of(context).size.width,
374-
child: Text("Dcs"),
375-
// color: color ?? cardTheme.color ?? Theme.of(context).cardColor,
350+
width: 200.0,
376351
image: AssetImage("lib/assets/food.jpeg"),
377352
boxFit: BoxFit.fill,
378-
colorFilter: new ColorFilter.mode(
379-
Colors.black.withOpacity(0.67), BlendMode.darken),
380-
// border: border,
381-
// borderRadius: borderRadius ?? BorderRadius.all(Radius.circular(4.0)),
353+
colorFilter: new ColorFilter.mode(Colors.black.withOpacity(0.67), BlendMode.darken),
354+
shape: BoxShape.circle,
382355
),
383356
),
384357

@@ -506,10 +479,10 @@ class _MyHomePageState extends State<MyHomePage>
506479
// radius: 80.0,
507480
// backgroundImage: NetworkImage("https://cdn.pixabay.com/photo/2017/12/03/18/04/christmas-balls-2995437_960_720.jpg"),
508481
// ),
509-
//
482+
510483
GFSegmentTabs(
511484
tabController: tabController,
512-
// height: 38.0,
485+
// height: 36.0,
513486
// width: 180.0,
514487
initialIndex: 0,
515488
length: 3,
@@ -528,18 +501,20 @@ class _MyHomePageState extends State<MyHomePage>
528501
),
529502
),
530503
],
531-
// tabBarColor: Colors.pink.withOpacity(0.6),
532-
// indicatorSize: TabBarIndicatorSize.tab,
533-
// indicatorColor: Colors.tealAccent,
534-
// indicator: BoxDecoration(
535-
// color: Colors.pink,
536-
// border: Border.all(color: Colors.green, width: 1.0),
537-
// borderRadius: BorderRadius.circular(50.0)
538-
// ),
539-
// indicatorPadding: EdgeInsets.all(8.0),
540-
// indicatorWeight: 2.0,
541-
// border: Border.all(color: Colors.orange, width: 2.0),
542-
// borderRadius: BorderRadius.circular(50.0)
504+
tabBarColor: Colors.grey,
505+
indicatorSize: TabBarIndicatorSize.tab,
506+
indicatorColor: Colors.greenAccent,
507+
labelColor: Colors.greenAccent,
508+
unselectedLabelColor: Colors.white,
509+
indicator: BoxDecoration(
510+
color: Colors.black,
511+
border: Border(bottom: BorderSide(color: Colors.greenAccent, width: 2.0,),),
512+
// borderRadius: BorderRadius.circular(2.0)
513+
),
514+
indicatorPadding: EdgeInsets.all(8.0),
515+
indicatorWeight: 2.0,
516+
border: Border.all(color: Colors.white, width: 2.0),
517+
borderRadius: BorderRadius.circular(2.0)
543518
),
544519
//
545520
// GFTabBarView(
@@ -666,22 +641,22 @@ class _MyHomePageState extends State<MyHomePage>
666641
// Icon(Icons.directions_transit),
667642
// ],
668643
// ),
669-
//// indicatorColor: Colors.teal,
670-
//// indicatorSize: TabBarIndicatorSize.label,
671-
//// labelColor: Colors.lightGreen,
672-
//// unselectedLabelColor: Colors.black,
673-
//// labelStyle: TextStyle(
674-
//// fontWeight: FontWeight.w500,
675-
//// fontSize: 13.0,
676-
//// color: Colors.deepOrange,
677-
//// fontFamily: 'OpenSansBold',
678-
//// ),
679-
//// unselectedLabelStyle: TextStyle(
680-
//// fontWeight: FontWeight.w500,
681-
//// fontSize: 13.0,
682-
//// color: Colors.black,
683-
//// fontFamily: 'OpenSansBold',
684-
//// ),
644+
// indicatorColor: Colors.teal,
645+
// indicatorSize: TabBarIndicatorSize.label,
646+
// labelColor: Colors.lightGreen,
647+
// unselectedLabelColor: Colors.black,
648+
// labelStyle: TextStyle(
649+
// fontWeight: FontWeight.w500,
650+
// fontSize: 13.0,
651+
// color: Colors.deepOrange,
652+
// fontFamily: 'OpenSansBold',
653+
// ),
654+
// unselectedLabelStyle: TextStyle(
655+
// fontWeight: FontWeight.w500,
656+
// fontSize: 13.0,
657+
// color: Colors.black,
658+
// fontFamily: 'OpenSansBold',
659+
// ),
685660
// ),
686661
//
687662
// GFCarousel(
@@ -1005,6 +980,24 @@ class _MyHomePageState extends State<MyHomePage>
1005980
),
1006981
),
1007982
],
983+
indicatorColor: Colors.teal,
984+
// indicatorSize: TabBarIndicatorSize.label,
985+
labelColor: Colors.lightGreen,
986+
labelPadding: EdgeInsets.all(8.0),
987+
tabBarColor: Colors.blueGrey,
988+
unselectedLabelColor: Colors.black,
989+
labelStyle: TextStyle(
990+
fontWeight: FontWeight.w500,
991+
fontSize: 13.0,
992+
color: Colors.deepOrange,
993+
fontFamily: 'OpenSansBold',
994+
),
995+
unselectedLabelStyle: TextStyle(
996+
fontWeight: FontWeight.w500,
997+
fontSize: 13.0,
998+
color: Colors.black,
999+
fontFamily: 'OpenSansBold',
1000+
),
10081001
),
10091002
);
10101003
}

lib/components/image/gf_image_overlay.dart

Lines changed: 34 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -4,21 +4,23 @@ import 'package:flutter/cupertino.dart';
44
import 'package:flutter/material.dart';
55

66
class GFImageOverlay extends StatelessWidget {
7-
const GFImageOverlay(
8-
{Key key,
9-
this.height,
10-
this.width,
11-
this.color,
12-
this.padding,
13-
this.margin,
14-
this.image,
15-
this.child,
16-
this.alignment,
17-
this.borderRadius,
18-
this.colorFilter= const ColorFilter.mode(Colors.black26, BlendMode.colorBurn),
19-
this.boxFit,
20-
this.border})
21-
: super(key: key);
7+
const GFImageOverlay({
8+
Key key,
9+
this.height,
10+
this.width,
11+
this.color,
12+
this.padding,
13+
this.margin,
14+
this.image,
15+
this.child = const Text(""),
16+
this.alignment,
17+
this.borderRadius,
18+
this.colorFilter= const ColorFilter.mode(Colors.black26, BlendMode.colorBurn),
19+
this.boxFit,
20+
this.border,
21+
this.shape = BoxShape.rectangle,
22+
}) : assert(shape != null),
23+
super(key: key);
2224

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

63+
/// The shape to fill the background [color], [gradient], and [image] into and
64+
/// to cast as the [boxShadow].
65+
///
66+
/// If this is [BoxShape.circle] then [borderRadius] is ignored.
67+
///
68+
/// The [shape] cannot be interpolated; animating between two [BoxDecoration]s
69+
/// with different [shape]s will result in a discontinuity in the rendering.
70+
/// To interpolate between two shapes, consider using [ShapeDecoration] and
71+
/// different [ShapeBorder]s; in particular, [CircleBorder] instead of
72+
/// [BoxShape.circle] and [RoundedRectangleBorder] instead of
73+
/// [BoxShape.rectangle].
74+
///
75+
/// {@macro flutter.painting.boxDecoration.clip}
76+
final BoxShape shape;
77+
6178
@override
6279
Widget build(BuildContext context) {
6380
return Container(
@@ -68,11 +85,12 @@ class GFImageOverlay extends StatelessWidget {
6885
padding: padding,
6986
child: child,
7087
decoration: new BoxDecoration(
88+
shape: shape,
7189
borderRadius: borderRadius,
7290
border: border,
7391
color: color,
7492
image: new DecorationImage(
75-
fit: BoxFit.fill, colorFilter: child != null? colorFilter: null, image: image),
93+
fit: BoxFit.fill, colorFilter: child != null? colorFilter: null, image: image),
7694
),
7795
);
7896
}

lib/components/tabs/gf_segment_tabs.dart

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ class GFSegmentTabs extends StatefulWidget {
2626
this.labelPadding,
2727
this.unselectedLabelColor,
2828
this.unselectedLabelStyle,
29-
this.tabBarView,
3029
this.tabs,
3130
this.tabController
3231
}):
@@ -139,11 +138,6 @@ class GFSegmentTabs extends StatefulWidget {
139138
/// body2 definition is used.
140139
final TextStyle unselectedLabelStyle;
141140

142-
/// One widget per tab.
143-
/// Its length must match the length of the [GFSegmentTabs.tabs]
144-
/// list, as well as the [controller]'s [GFSegmentTabs.length].
145-
final GFTabBarView tabBarView;
146-
147141
/// Typically a list of two or more [Tab] widgets.
148142
///
149143
/// The length of this list must match the [controller]'s [TabController.length]
@@ -188,7 +182,7 @@ class _GFSegmentTabsState extends State<GFSegmentTabs> {
188182
BoxDecoration(
189183
color: widget.indicatorColor == null ? getGFColor(GFColor.primary) : widget.indicatorColor,
190184
border: Border.all(color: widget.indicatorColor == null ? Colors.transparent : widget.indicatorColor, width: 2.0),
191-
borderRadius: widget.borderRadius == null ? BorderRadius.circular(0.0) : widget.borderRadius,
185+
borderRadius: widget.borderRadius == null ? BorderRadius.circular(2.0) : widget.borderRadius,
192186
) : widget.indicator,
193187
indicatorPadding: widget.indicatorPadding,
194188
indicatorWeight: widget.indicatorWeight,

0 commit comments

Comments
 (0)