Skip to content

Commit 3319447

Browse files
committed
GFTabs created
2 parents 71b94e3 + c1361bc commit 3319447

8 files changed

Lines changed: 670 additions & 920 deletions

File tree

example/lib/main.dart

Lines changed: 427 additions & 324 deletions
Large diffs are not rendered by default.

lib/colors/gf_color.dart

Lines changed: 16 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -12,19 +12,21 @@ enum GFColor {
1212
light,
1313
dark,
1414
white,
15+
transparent
1516
}
1617

17-
const PRIMARY = Colors.blue;
18-
const SECONDARY = Colors.grey;
19-
const SUCCESS = Colors.green;
20-
const INFO = Colors.yellow;
21-
const WARNING = Colors.lightBlueAccent;
22-
const DANGER = Colors.red;
23-
const FOCUS = Colors.black38;
24-
const ALT = Colors.purple;
25-
const LIGHT = Colors.white30;
26-
const DARK = Colors.black;
27-
const WHITE = Colors.white;
18+
const PRIMARY = Color(0xff3f6ad8);
19+
const SECONDARY = Color(0xff6c757c);
20+
const SUCCESS =Color(0xff3ac47c);
21+
const INFO = Color(0xff13aaff);
22+
const WARNING = Color(0xfff7b825);
23+
const DANGER = Color(0xffd92550);
24+
const FOCUS = Color(0xff434054);
25+
const ALT = Color(0xff794c8a);
26+
const LIGHT = Color(0xffededed);
27+
const DARK = Color(0xff333a40);
28+
const WHITE = Color(0xffffffff);
29+
const TRANSPARENT = Colors.transparent;
2830

2931
/// Pass [GFColor] or [Color]
3032
Color getGFColor(dynamic color) {
@@ -65,6 +67,9 @@ Color getGFColor(dynamic color) {
6567
case GFColor.white:
6668
return WHITE;
6769
break;
70+
case GFColor.transparent:
71+
return TRANSPARENT;
72+
break;
6873
default:
6974
return PRIMARY;
7075
break;

lib/components/header/gf_header.dart

Whitespace-only changes.

lib/components/slider/gf_slider.dart

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import 'dart:async';
2-
import 'dart:ffi';
32
import 'package:flutter/material.dart';
43

54
List<T> map<T>(List list, Function handler) {

lib/components/tabs/gf_tabs.dart

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
2+
3+
4+
5+
6+
7+
8+
9+
10+
11+
12+
13+
14+
15+
16+
17+

lib/components/toast/gf_toast.dart

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
import 'package:flutter/material.dart';
2+
import 'package:ui_kit/colors/gf_color.dart';
3+
4+
class GFToast extends StatelessWidget {
5+
6+
///
7+
GFToast({Key key,
8+
this.child,
9+
this.button,
10+
this.bgColor,
11+
this.text,
12+
this.textStyle = const TextStyle(color: Colors.white70, height: 1.5),
13+
}) :super(key: key);
14+
15+
/// child of type [Widget]is alternative to text key. text will get priority over child
16+
final Widget child;
17+
18+
/// button of type [Widget],or you can use [GFButton] for easy implementation with [GFToast]
19+
final Widget button;
20+
21+
///pass color of type [Color] or [GFColor] for background of [GFToast]
22+
final dynamic bgColor;
23+
24+
/// text of type [String] is alternative to child. text will get priority over child
25+
final String text;
26+
27+
/// textStyle will be applicable to text only and not for the child
28+
final TextStyle textStyle;
29+
30+
31+
@override
32+
Widget build(BuildContext context) {
33+
return
34+
ConstrainedBox(constraints: BoxConstraints(minHeight: 50.0,), child: Container(
35+
margin: EdgeInsets.only(left: 10, right: 10),
36+
padding: EdgeInsets.all(10),
37+
decoration: BoxDecoration(
38+
borderRadius: BorderRadius.all(Radius.circular(3)),
39+
color: bgColor!=null ?getGFColor(bgColor):Color(0xff323232),
40+
),
41+
child: Row(
42+
children: <Widget>[
43+
Flexible(
44+
flex: 7,
45+
fit: FlexFit.tight,
46+
child: text!=null ? Text(text , style: textStyle):(child??Container()),),
47+
SizedBox(
48+
width: 10,
49+
),
50+
button!=null?Flexible(
51+
flex: 4,
52+
fit: FlexFit.tight,
53+
child: button):Container()
54+
],
55+
),
56+
),);
57+
}
58+
}

0 commit comments

Comments
 (0)