Skip to content

Commit 1373d22

Browse files
authored
Merge pull request #24 from ionicfirebaseapp/master
master pull
2 parents 44550ce + 39c52e7 commit 1373d22

35 files changed

+1809
-492
lines changed

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@ getflutter-app-kit
3333
getflutter-web-kit
3434
getflutter_app
3535
test/.test_coverage.dart
36-
example
3736

3837
# Android related
3938
**/android/**/gradle-wrapper.jar

CHANGELOG.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,18 @@
11
# Changelog
22

3+
## 1.0.7 - 2020-02-11
4+
5+
### Fixed
6+
* GFLoader - import issue fixed
7+
8+
### Added
9+
* added new component
10+
- GFFloatingWidget
11+
12+
13+
14+
15+
316
## 1.0.5 - 2020-02-07
417

518
### Fixed

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,11 @@
2323
## Screenshot
2424
<p align="center">
2525
<a target="_blank" href="https://www.getflutter.dev/">
26-
<img src="https://ik.imagekit.io/ionicfirebaseapp/tr:dpr-auto,tr:w-auto/GitHub-full_0QqS07XrO.png" alt="Get Flutter Screens">
26+
<img src="https://ik.imagekit.io/ionicfirebaseapp/tr:dpr-auto,tr:w-auto/gf-full_bYPXDEx6g.png" alt="Get Flutter Screens">
2727
</a>
2828
</p>
2929

30+
3031
## Quick start
3132

3233
Read the [Getting started page](https://docs.getflutter.dev)

analysis_options.yaml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,7 @@ linter:
1414
# - always_put_required_named_parameters_first
1515
- always_require_non_null_named_parameters
1616
# - annotate_overrides
17-
# required to Allow both GFColors and Colors
18-
# - avoid_annotating_with_dynamic
17+
- avoid_annotating_with_dynamic
1918
- avoid_as
2019
- avoid_bool_literals_in_conditional_expressions
2120
- avoid_catches_without_on_clauses

example/.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,4 +34,4 @@
3434
lib/generated_plugin_registrant.dart
3535

3636
# Exceptions to above rules.
37-
!/packages/flutter_tools/test/data/dart_dependencies_test/**/.packages
37+
!/packages/flutter_tools/test/data/dart_dependencies_test/**/.packages

example/lib/main.dart

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ class MyApp extends StatelessWidget {
1414
);
1515
}
1616

17+
//
1718
class MyHomePage extends StatefulWidget {
1819
@override
1920
_MyHomePageState createState() => _MyHomePageState();
@@ -66,7 +67,7 @@ class _MyHomePageState extends State<MyHomePage> {
6667
),
6768
),
6869
GFButton(
69-
size: GFSize.large,
70+
size: GFSize.LARGE,
7071
text: 'View on Github',
7172
textStyle: const TextStyle(
7273
fontSize: 16,
@@ -99,7 +100,7 @@ class _MyHomePageState extends State<MyHomePage> {
99100
),
100101
),
101102
GFButton(
102-
size: GFSize.large,
103+
size: GFSize.LARGE,
103104
text: 'View on Playstore',
104105
textStyle:
105106
const TextStyle(fontSize: 16, color: GFColors.WHITE),

example/pubspec.lock

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ packages:
9292
path: ".."
9393
relative: true
9494
source: path
95-
version: "1.0.5"
95+
version: "1.0.7"
9696
image:
9797
dependency: transitive
9898
description:

lib/colors/gf_color.dart

Lines changed: 0 additions & 64 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,5 @@
11
import 'package:flutter/material.dart';
22

3-
enum GFColor {
4-
primary,
5-
secondary,
6-
success,
7-
info,
8-
warning,
9-
danger,
10-
focus,
11-
alt,
12-
light,
13-
dark,
14-
white,
15-
transparent
16-
}
17-
183
class GFColors {
194
static const Color PRIMARY = Color(0xff3880FF);
205
static const Color SECONDARY = Color(0xffAA66CC);
@@ -28,53 +13,4 @@ class GFColors {
2813
static const Color FOCUS = Color(0xff434054);
2914
static const Color ALT = Color(0xff794c8a);
3015
static const Color TRANSPARENT = Colors.transparent;
31-
32-
/// Pass [GFColor] or [Color]
33-
static Color getGFColor(dynamic color) {
34-
if (color is Color) {
35-
return color;
36-
} else {
37-
switch (color) {
38-
case GFColor.primary:
39-
return PRIMARY;
40-
break;
41-
case GFColor.secondary:
42-
return SECONDARY;
43-
break;
44-
case GFColor.success:
45-
return SUCCESS;
46-
break;
47-
case GFColor.warning:
48-
return WARNING;
49-
break;
50-
case GFColor.info:
51-
return INFO;
52-
break;
53-
case GFColor.danger:
54-
return DANGER;
55-
break;
56-
case GFColor.focus:
57-
return FOCUS;
58-
break;
59-
case GFColor.alt:
60-
return ALT;
61-
break;
62-
case GFColor.light:
63-
return LIGHT;
64-
break;
65-
case GFColor.dark:
66-
return DARK;
67-
break;
68-
case GFColor.white:
69-
return WHITE;
70-
break;
71-
case GFColor.transparent:
72-
return TRANSPARENT;
73-
break;
74-
default:
75-
return null;
76-
break;
77-
}
78-
}
79-
}
8016
}

lib/components/accordian/gf_accordian.dart

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
import 'package:flutter/material.dart';
2-
import 'package:getflutter/colors/gf_color.dart';
2+
import 'package:getflutter/getflutter.dart';
33

44
class GFAccordion extends StatefulWidget {
55
const GFAccordion(
66
{Key key,
77
this.child,
88
this.content,
9-
this.collapsedTitlebackgroundColor = Colors.white,
9+
this.collapsedTitlebackgroundColor = GFColors.WHITE,
1010
this.expandedTitlebackgroundColor = const Color(0xFFE0E0E0),
1111
this.collapsedIcon = const Icon(Icons.keyboard_arrow_down),
1212
this.expandedIcon = const Icon(Icons.keyboard_arrow_up),
@@ -16,8 +16,8 @@ class GFAccordion extends StatefulWidget {
1616
this.contentbackgroundColor,
1717
this.contentPadding = const EdgeInsets.all(10),
1818
this.contentChild,
19-
this.titleborderColor = const Border(),
20-
this.contentBorderColor = const Border(),
19+
this.titleborder = const Border(),
20+
this.contentBorder = const Border(),
2121
this.margin})
2222
: super(key: key);
2323

@@ -30,11 +30,11 @@ class GFAccordion extends StatefulWidget {
3030
/// contentChild of type [Widget]is alternative to content key. content will get priority over contentChild
3131
final Widget contentChild;
3232

33-
/// type of [Color] or [GFColor] which is used to change the background color of the [GFAccordion] title when it is collapsed
34-
final dynamic collapsedTitlebackgroundColor;
33+
/// type of [Color] or [GFColors] which is used to change the background color of the [GFAccordion] title when it is collapsed
34+
final Color collapsedTitlebackgroundColor;
3535

36-
/// type of [Color] or [GFColor] which is used to change the background color of the [GFAccordion] title when it is expanded
37-
final dynamic expandedTitlebackgroundColor;
36+
/// type of [Color] or [GFColors] which is used to change the background color of the [GFAccordion] title when it is expanded
37+
final Color expandedTitlebackgroundColor;
3838

3939
///collapsedIcon of type [Widget] which is used to show when the [GFAccordion] is collapsed
4040
final Widget collapsedIcon;
@@ -54,17 +54,17 @@ class GFAccordion extends StatefulWidget {
5454
///descriptionPadding of type [EdgeInsets] which is used to set the padding of the [GFAccordion] description
5555
final EdgeInsets contentPadding;
5656

57-
/// type of [Color] or [GFColor] which is used to change the background color of the [GFAccordion] description
58-
final dynamic contentbackgroundColor;
57+
/// type of [Color] or [GFColors] which is used to change the background color of the [GFAccordion] description
58+
final Color contentbackgroundColor;
5959

6060
///margin of type [EdgeInsets] which is used to set the margin of the [GFAccordion]
6161
final EdgeInsets margin;
6262

63-
///titleborderColor of type [Color] or [GFColor] which is used to change the border color of title
64-
final dynamic titleborderColor;
63+
///titleborderColor of type [Color] or [GFColors] which is used to change the border color of title
64+
final Border titleborder;
6565

66-
///contentBorderColor of type [Color] or [GFColor] which is used to change the border color of content
67-
final dynamic contentBorderColor;
66+
///contentBorderColor of type [Color] or [GFColors] which is used to change the border color of content
67+
final Border contentBorder;
6868

6969
@override
7070
_GFAccordionState createState() => _GFAccordionState();
@@ -128,7 +128,7 @@ class _GFAccordionState extends State<GFAccordion>
128128
},
129129
child: Container(
130130
decoration: BoxDecoration(
131-
border: widget.titleborderColor,
131+
border: widget.titleborder,
132132
color: showAccordion
133133
? widget.expandedTitlebackgroundColor
134134
: widget.collapsedTitlebackgroundColor,
@@ -150,7 +150,7 @@ class _GFAccordionState extends State<GFAccordion>
150150
showAccordion
151151
? Container(
152152
decoration: BoxDecoration(
153-
border: widget.contentBorderColor,
153+
border: widget.contentBorder,
154154
color: widget.contentbackgroundColor ?? Colors.white70,
155155
),
156156
width: MediaQuery.of(context).size.width,

lib/components/alert/gf_alert.dart

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import 'package:flutter/material.dart';
22
import 'package:flutter/widgets.dart';
33
import 'package:getflutter/getflutter.dart';
4-
import 'package:getflutter/types/gf_alert_type.dart';
54

65
class GFAlert extends StatefulWidget {
76
/// Alert has to be wrap inside the body like [GFFloatingWidget]. See [GFFloatingWidget]
@@ -39,8 +38,8 @@ class GFAlert extends StatefulWidget {
3938
///type of [TextStyle] to change the style of the title not for the child
4039
final TextStyle titleTextStyle;
4140

42-
///pass color of type [Color] or [GFColor] for background of [GFAlert]
43-
final dynamic backgroundColor;
41+
///pass color of type [Color] or [GFColors] for background of [GFAlert]
42+
final Color backgroundColor;
4443

4544
///type of [TextStyle] to change the style of the content not for the contentchild
4645
final TextStyle contentTextStyle;
@@ -93,7 +92,7 @@ class _GFAlertState extends State<GFAlert> with TickerProviderStateMixin {
9392
Container(
9493
width: widget.type == GFAlertType.fullWidth
9594
? MediaQuery.of(context).size.width
96-
: widget.width?? MediaQuery.of(context).size.width*0.885,
95+
: widget.width ?? MediaQuery.of(context).size.width * 0.885,
9796
constraints: const BoxConstraints(minHeight: 50),
9897
margin: widget.type == GFAlertType.fullWidth
9998
? const EdgeInsets.only(left: 0, right: 0)
@@ -106,8 +105,8 @@ class _GFAlertState extends State<GFAlert> with TickerProviderStateMixin {
106105
? BorderRadius.circular(10)
107106
: BorderRadius.zero,
108107
color: widget.backgroundColor != null
109-
? GFColors.getGFColor(widget.backgroundColor)
110-
: GFColors.getGFColor(GFColor.white),
108+
? widget.backgroundColor
109+
: GFColors.WHITE,
111110
boxShadow: [
112111
BoxShadow(
113112
color: Colors.black.withOpacity(0.40), blurRadius: 3)

0 commit comments

Comments
 (0)