Skip to content

Commit 0a085cc

Browse files
authored
Merge pull request #72 from Sandipkakadiya/review
Review
2 parents 73602eb + 32c2562 commit 0a085cc

File tree

75 files changed

+7673
-7296
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

75 files changed

+7673
-7296
lines changed

.travis.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,3 +26,4 @@ before_script:
2626
script:
2727
- ./../flutter/bin/flutter analyze .
2828
- ./../flutter/bin/cache/dart-sdk/bin/dartfmt --dry-run lib
29+
- ./../flutter/bin/flutter test

CHANGELOG.md

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,13 @@
11
# Changelog
22

33

4-
## 1.2.3 - 2020-11-12
4+
## 2.0.0-nullsafety.3 - 2021-03-09
5+
6+
### Added
7+
* Added nullsafety.
8+
9+
10+
## 1.2.4 - 2020-11-12
511

612
### Fixed
713
* [GFProgressBar] issue.
@@ -11,6 +17,11 @@
1117
* [GFCarousel] issue. #185
1218
* Many more minor improvements.
1319

20+
### Added
21+
* Test cases added for couple of components
22+
- GFLoader
23+
- GFTypography
24+
1425

1526

1627
## 1.2.2 - 2020-10-02

example/pubspec.lock

Lines changed: 28 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -7,42 +7,42 @@ packages:
77
name: async
88
url: "https://pub.dartlang.org"
99
source: hosted
10-
version: "2.5.0-nullsafety.1"
10+
version: "2.5.0"
1111
boolean_selector:
1212
dependency: transitive
1313
description:
1414
name: boolean_selector
1515
url: "https://pub.dartlang.org"
1616
source: hosted
17-
version: "2.1.0-nullsafety.1"
17+
version: "2.1.0"
1818
characters:
1919
dependency: transitive
2020
description:
2121
name: characters
2222
url: "https://pub.dartlang.org"
2323
source: hosted
24-
version: "1.1.0-nullsafety.3"
24+
version: "1.1.0"
2525
charcode:
2626
dependency: transitive
2727
description:
2828
name: charcode
2929
url: "https://pub.dartlang.org"
3030
source: hosted
31-
version: "1.2.0-nullsafety.1"
31+
version: "1.2.0"
3232
clock:
3333
dependency: transitive
3434
description:
3535
name: clock
3636
url: "https://pub.dartlang.org"
3737
source: hosted
38-
version: "1.1.0-nullsafety.1"
38+
version: "1.1.0"
3939
collection:
4040
dependency: transitive
4141
description:
4242
name: collection
4343
url: "https://pub.dartlang.org"
4444
source: hosted
45-
version: "1.15.0-nullsafety.3"
45+
version: "1.15.0"
4646
convert:
4747
dependency: transitive
4848
description:
@@ -63,7 +63,7 @@ packages:
6363
name: fake_async
6464
url: "https://pub.dartlang.org"
6565
source: hosted
66-
version: "1.2.0-nullsafety.1"
66+
version: "1.2.0"
6767
flutter:
6868
dependency: "direct main"
6969
description: flutter
@@ -92,28 +92,35 @@ packages:
9292
path: ".."
9393
relative: true
9494
source: path
95-
version: "1.2.3"
95+
version: "2.0.0-nullsafety.3"
96+
js:
97+
dependency: transitive
98+
description:
99+
name: js
100+
url: "https://pub.dartlang.org"
101+
source: hosted
102+
version: "0.6.3"
96103
matcher:
97104
dependency: transitive
98105
description:
99106
name: matcher
100107
url: "https://pub.dartlang.org"
101108
source: hosted
102-
version: "0.12.10-nullsafety.1"
109+
version: "0.12.10"
103110
meta:
104111
dependency: transitive
105112
description:
106113
name: meta
107114
url: "https://pub.dartlang.org"
108115
source: hosted
109-
version: "1.3.0-nullsafety.3"
116+
version: "1.3.0"
110117
path:
111118
dependency: transitive
112119
description:
113120
name: path
114121
url: "https://pub.dartlang.org"
115122
source: hosted
116-
version: "1.8.0-nullsafety.1"
123+
version: "1.8.0"
117124
path_drawing:
118125
dependency: transitive
119126
description:
@@ -153,49 +160,49 @@ packages:
153160
name: source_span
154161
url: "https://pub.dartlang.org"
155162
source: hosted
156-
version: "1.8.0-nullsafety.2"
163+
version: "1.8.0"
157164
stack_trace:
158165
dependency: transitive
159166
description:
160167
name: stack_trace
161168
url: "https://pub.dartlang.org"
162169
source: hosted
163-
version: "1.10.0-nullsafety.1"
170+
version: "1.10.0"
164171
stream_channel:
165172
dependency: transitive
166173
description:
167174
name: stream_channel
168175
url: "https://pub.dartlang.org"
169176
source: hosted
170-
version: "2.1.0-nullsafety.1"
177+
version: "2.1.0"
171178
string_scanner:
172179
dependency: transitive
173180
description:
174181
name: string_scanner
175182
url: "https://pub.dartlang.org"
176183
source: hosted
177-
version: "1.1.0-nullsafety.1"
184+
version: "1.1.0"
178185
term_glyph:
179186
dependency: transitive
180187
description:
181188
name: term_glyph
182189
url: "https://pub.dartlang.org"
183190
source: hosted
184-
version: "1.2.0-nullsafety.1"
191+
version: "1.2.0"
185192
test_api:
186193
dependency: transitive
187194
description:
188195
name: test_api
189196
url: "https://pub.dartlang.org"
190197
source: hosted
191-
version: "0.2.19-nullsafety.2"
198+
version: "0.2.19"
192199
typed_data:
193200
dependency: transitive
194201
description:
195202
name: typed_data
196203
url: "https://pub.dartlang.org"
197204
source: hosted
198-
version: "1.3.0-nullsafety.3"
205+
version: "1.3.0"
199206
url_launcher:
200207
dependency: "direct main"
201208
description:
@@ -244,7 +251,7 @@ packages:
244251
name: vector_math
245252
url: "https://pub.dartlang.org"
246253
source: hosted
247-
version: "2.1.0-nullsafety.3"
254+
version: "2.1.0"
248255
xml:
249256
dependency: transitive
250257
description:
@@ -253,5 +260,5 @@ packages:
253260
source: hosted
254261
version: "4.5.1"
255262
sdks:
256-
dart: ">=2.10.0-110 <2.11.0"
257-
flutter: ">=1.22.0 <2.0.0"
263+
dart: ">=2.12.0 <3.0.0"
264+
flutter: ">=1.22.0"

lib/components/accordian/gf_accordian.dart

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import 'package:getwidget/getwidget.dart';
44
class GFAccordion extends StatefulWidget {
55
/// An accordion is used to show (and hide) content. Use [showAccordion] to hide & show the accordion content.
66
const GFAccordion(
7-
{Key key,
7+
{Key? key,
88
this.title,
99
this.content,
1010
this.titleChild,
@@ -30,13 +30,13 @@ class GFAccordion extends StatefulWidget {
3030
final bool showAccordion;
3131

3232
/// child of type [Widget]is alternative to title key. title will get priority over titleChild
33-
final Widget titleChild;
33+
final Widget? titleChild;
3434

3535
/// content of type[String] which shows the messages after the [GFAccordion] is expanded
36-
final String content;
36+
final String? content;
3737

3838
/// contentChild of type [Widget]is alternative to content key. content will get priority over contentChild
39-
final Widget contentChild;
39+
final Widget? contentChild;
4040

4141
/// type of [Color] or [GFColors] which is used to change the background color of the [GFAccordion] title when it is collapsed
4242
final Color collapsedTitleBackgroundColor;
@@ -51,7 +51,7 @@ class GFAccordion extends StatefulWidget {
5151
final Widget expandedIcon;
5252

5353
/// text of type [String] is alternative to child. text will get priority over titleChild
54-
final String title;
54+
final String? title;
5555

5656
/// textStyle of type [textStyle] will be applicable to text only and not for the child
5757
final TextStyle textStyle;
@@ -63,10 +63,10 @@ class GFAccordion extends StatefulWidget {
6363
final EdgeInsets contentPadding;
6464

6565
/// type of [Color] or [GFColors] which is used to change the background color of the [GFAccordion] description
66-
final Color contentBackgroundColor;
66+
final Color? contentBackgroundColor;
6767

6868
/// margin of type [EdgeInsets] which is used to set the margin of the [GFAccordion]
69-
final EdgeInsets margin;
69+
final EdgeInsets? margin;
7070

7171
/// titleBorderColor of type [Color] or [GFColors] which is used to change the border color of title
7272
final Border titleBorder;
@@ -81,18 +81,18 @@ class GFAccordion extends StatefulWidget {
8181
final BorderRadius contentBorderRadius;
8282

8383
/// function called when the content body collapsed
84-
final Function(bool) onToggleCollapsed;
84+
final Function(bool)? onToggleCollapsed;
8585

8686
@override
8787
_GFAccordionState createState() => _GFAccordionState();
8888
}
8989

9090
class _GFAccordionState extends State<GFAccordion>
9191
with TickerProviderStateMixin {
92-
AnimationController animationController;
93-
AnimationController controller;
94-
Animation<Offset> offset;
95-
bool showAccordion;
92+
late AnimationController animationController;
93+
late AnimationController controller;
94+
late Animation<Offset> offset;
95+
late bool showAccordion;
9696

9797
@override
9898
void initState() {
@@ -142,7 +142,7 @@ class _GFAccordionState extends State<GFAccordion>
142142
children: <Widget>[
143143
Expanded(
144144
child: widget.title != null
145-
? Text(widget.title, style: widget.textStyle)
145+
? Text(widget.title!, style: widget.textStyle)
146146
: (widget.titleChild ?? Container()),
147147
),
148148
showAccordion ? widget.expandedIcon : widget.collapsedIcon
@@ -162,7 +162,7 @@ class _GFAccordionState extends State<GFAccordion>
162162
child: SlideTransition(
163163
position: offset,
164164
child: widget.content != null
165-
? Text(widget.content)
165+
? Text(widget.content!)
166166
: (widget.contentChild ?? Container()),
167167
))
168168
: Container()
@@ -183,7 +183,7 @@ class _GFAccordionState extends State<GFAccordion>
183183
}
184184
showAccordion = !showAccordion;
185185
if (widget.onToggleCollapsed != null) {
186-
widget.onToggleCollapsed(showAccordion);
186+
widget.onToggleCollapsed!(showAccordion);
187187
}
188188
});
189189
}

lib/components/alert/gf_alert.dart

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import 'package:getwidget/getwidget.dart';
55
class GFAlert extends StatefulWidget {
66
/// Alert has to be wrap inside the body like [GFFloatingWidget]. See [GFFloatingWidget]
77
const GFAlert(
8-
{Key key,
8+
{Key? key,
99
this.content,
1010
this.title,
1111
this.child,
@@ -24,45 +24,45 @@ class GFAlert extends StatefulWidget {
2424
: super(key: key);
2525

2626
/// child of type [Widget]is alternative to title key. title will get priority over child
27-
final Widget child;
27+
final Widget? child;
2828

2929
/// title of type [String] used to describe the title of the [GFAlert]
30-
final String title;
30+
final String? title;
3131

3232
/// child of type [Widget]is alternative to title key. title will get priority over contentchild
33-
final Widget contentChild;
33+
final Widget? contentChild;
3434

3535
/// title of type [String] used to describe the content of the [GFAlert]
36-
final String content;
36+
final String? content;
3737

3838
///type of [TextStyle] to change the style of the title not for the child
3939
final TextStyle titleTextStyle;
4040

4141
///pass color of type [Color] or [GFColors] for background of [GFAlert]
42-
final Color backgroundColor;
42+
final Color? backgroundColor;
4343

4444
///type of [TextStyle] to change the style of the content not for the contentchild
4545
final TextStyle contentTextStyle;
4646

4747
/// width of type [double] used to control the width of the [GFAlert]
48-
final double width;
48+
final double? width;
4949

5050
///type of [GFAlertType] which takes the type ie, basic, rounded and fullWidth for the [GFAlert]
5151
final GFAlertType type;
5252

5353
/// type of [Alignment] used to align the text inside the [GFAlert]
54-
final Alignment alignment;
54+
final Alignment? alignment;
5555

5656
///type of [Widget] used for the buttons ie, OK, Cancel for the action in [GFAlert]
57-
final Widget bottombar;
57+
final Widget? bottombar;
5858

5959
@override
6060
_GFAlertState createState() => _GFAlertState();
6161
}
6262

6363
class _GFAlertState extends State<GFAlert> with TickerProviderStateMixin {
64-
AnimationController animationController;
65-
Animation<double> animation;
64+
late AnimationController animationController;
65+
late Animation<double> animation;
6666

6767
@override
6868
void initState() {
@@ -115,7 +115,7 @@ class _GFAlertState extends State<GFAlert> with TickerProviderStateMixin {
115115
Align(
116116
alignment: widget.alignment ?? Alignment.topLeft,
117117
child: widget.title != null
118-
? Text(widget.title, style: widget.titleTextStyle)
118+
? Text(widget.title!, style: widget.titleTextStyle)
119119
: (widget.child ?? Container()),
120120
),
121121
const SizedBox(
@@ -124,7 +124,7 @@ class _GFAlertState extends State<GFAlert> with TickerProviderStateMixin {
124124
Align(
125125
alignment: widget.alignment ?? Alignment.topLeft,
126126
child: widget.content != null
127-
? Text(widget.content, style: widget.contentTextStyle)
127+
? Text(widget.content!, style: widget.contentTextStyle)
128128
: (widget.contentChild ?? Container()),
129129
),
130130
const SizedBox(

0 commit comments

Comments
 (0)