Skip to content

Commit 1b765b2

Browse files
Merge pull request #38 from ionicfirebaseapp/master
master pull
2 parents 50c7177 + 3fae141 commit 1b765b2

File tree

10 files changed

+160
-152
lines changed

10 files changed

+160
-152
lines changed

lib/components/accordian/gf_accordian.dart

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -17,16 +17,14 @@ class GFAccordion extends StatefulWidget {
1717
this.contentPadding = const EdgeInsets.all(10),
1818
this.contentChild,
1919
this.titleBorder = const Border(),
20-
this.contentborder = const Border(),
20+
this.contentBorder = const Border(),
2121
this.margin,
2222
this.showAccordion = false,
2323
this.onToggleCollapsed,
2424
this.titleBorderRadius = const BorderRadius.all(Radius.circular(0)),
2525
this.contentBorderRadius = const BorderRadius.all(Radius.circular(0))})
2626
: super(key: key);
2727

28-
final Function(bool) onToggleCollapsed;
29-
3028
/// controls if the accordion should be collapsed or not making it possible to be controlled from outside
3129
final bool showAccordion;
3230

@@ -45,10 +43,10 @@ class GFAccordion extends StatefulWidget {
4543
/// type of [Color] or [GFColors] which is used to change the background color of the [GFAccordion] title when it is expanded
4644
final Color expandedTitleBackgroundColor;
4745

48-
///collapsedIcon of type [Widget] which is used to show when the [GFAccordion] is collapsed
46+
/// collapsedIcon of type [Widget] which is used to show when the [GFAccordion] is collapsed
4947
final Widget collapsedIcon;
5048

51-
///expandedIcon of type[Widget] which is used when the [GFAccordion] is expanded
49+
/// expandedIcon of type[Widget] which is used when the [GFAccordion] is expanded
5250
final Widget expandedIcon;
5351

5452
/// text of type [String] is alternative to child. text will get priority over titleChild
@@ -57,30 +55,33 @@ class GFAccordion extends StatefulWidget {
5755
/// textStyle of type [textStyle] will be applicable to text only and not for the child
5856
final TextStyle textStyle;
5957

60-
///titlePadding of type [EdgeInsets] which is used to set the padding of the [GFAccordion] title
58+
/// titlePadding of type [EdgeInsets] which is used to set the padding of the [GFAccordion] title
6159
final EdgeInsets titlePadding;
6260

63-
///descriptionPadding of type [EdgeInsets] which is used to set the padding of the [GFAccordion] description
61+
/// descriptionPadding of type [EdgeInsets] which is used to set the padding of the [GFAccordion] description
6462
final EdgeInsets contentPadding;
6563

6664
/// type of [Color] or [GFColors] which is used to change the background color of the [GFAccordion] description
6765
final Color contentBackgroundColor;
6866

69-
///margin of type [EdgeInsets] which is used to set the margin of the [GFAccordion]
67+
/// margin of type [EdgeInsets] which is used to set the margin of the [GFAccordion]
7068
final EdgeInsets margin;
7169

72-
///titleBorderColor of type [Color] or [GFColors] which is used to change the border color of title
70+
/// titleBorderColor of type [Color] or [GFColors] which is used to change the border color of title
7371
final Border titleBorder;
7472

75-
///contentBorderColor of type [Color] or [GFColors] which is used to change the border color of content
76-
final Border contentborder;
73+
/// contentBorderColor of type [Color] or [GFColors] which is used to change the border color of content
74+
final Border contentBorder;
7775

78-
///titleBorderRadius of type [Radius] which is used to change the border radius of title
76+
/// titleBorderRadius of type [Radius] which is used to change the border radius of title
7977
final BorderRadius titleBorderRadius;
8078

81-
///contentBorderRadius of type [Radius] which is used to change the border radius of content
79+
/// contentBorderRadius of type [Radius] which is used to change the border radius of content
8280
final BorderRadius contentBorderRadius;
8381

82+
/// function called when the content body collapsed
83+
final Function(bool) onToggleCollapsed;
84+
8485
@override
8586
_GFAccordionState createState() => _GFAccordionState();
8687
}
@@ -152,7 +153,7 @@ class _GFAccordionState extends State<GFAccordion>
152153
? Container(
153154
decoration: BoxDecoration(
154155
borderRadius: widget.contentBorderRadius,
155-
border: widget.contentborder,
156+
border: widget.contentBorder,
156157
color: widget.contentBackgroundColor ?? Colors.white70,
157158
),
158159
width: MediaQuery.of(context).size.width,

lib/components/animation/gf_animation.dart

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ class GFAnimation extends StatefulWidget {
3434
this.reverseDuration,
3535
}) : super(key: key);
3636

37-
/// `The duration for animation to perform`
37+
/// The duration for animation to perform
3838
final Duration duration;
3939

4040
/// The duration for animation to perform
@@ -55,13 +55,13 @@ class GFAnimation extends StatefulWidget {
5555
///type of [GFAnimation] which takes the type ie, align, size, container, rotateTransition, scaleTransition, slideTransition, and textStyle for the [GFAnimation]
5656
final GFAnimationType type;
5757

58-
/// [AnimatedContainer] initial width
58+
/// defines [AnimatedContainer] initial width
5959
final double width;
6060

6161
/// defines the width of [AnimatedContainer] upto which it can extend during animation
6262
final double changedWidth;
6363

64-
/// [AnimatedContainer] initial height
64+
/// defines [AnimatedContainer] initial height
6565
final double height;
6666

6767
/// defines the height of [AnimatedContainer] upto which it can extend during animation
@@ -127,7 +127,6 @@ class GFAnimation extends StatefulWidget {
127127
class _GFAnimationState extends State<GFAnimation>
128128
with SingleTickerProviderStateMixin {
129129
bool selected = false;
130-
131130
AnimationController controller;
132131
Animation<double> animation;
133132
Animation<Offset> offsetAnimation;

lib/components/border/gf_border.dart

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import 'dart:ui';
2+
import 'package:flutter/cupertino.dart';
23
import 'package:flutter/material.dart';
34
import 'package:getwidget/components/border/gf_dashed_border.dart';
45
import 'package:getwidget/types/gf_border_type.dart';
@@ -12,36 +13,38 @@ class GFBorder extends StatelessWidget {
1213
this.dashedLine = const <double>[3, 1],
1314
this.padding = const EdgeInsets.all(10),
1415
this.radius = const Radius.circular(0),
15-
this.customPath,
16+
// this.customPath,
1617
}) : assert(child != null),
1718
assert(_isValidDashedLine(dashedLine), 'Invalid dash pattern');
1819

19-
/// child of type [Widget] which can be any component or text, etc
20+
/// child of type [Widget] which can be any component or text, etc
2021
final Widget child;
2122

22-
/// padding of time [EdgeInsets] where in padding is given to the border types
23+
/// padding for [child] where in padding is given to the border types
2324
final EdgeInsets padding;
2425

2526
/// storkeWidth of type [double] which is used to define the thickness of the border
2627
final double strokeWidth;
2728

2829
/// color of type [Color] or GFColor which is used to change the color of the border type
29-
final Color color;
30+
final dynamic color;
3031

3132
/// dashedLine of type [List<double>] which is used for the linear and simple dashed line of border
3233
final List<double> dashedLine;
3334

3435
/// type of [GFBorderType] which is used to define the different types of borders ie, circle, Rect, RRect and oval
3536
final GFBorderType type;
3637

37-
/// radius of type [Radius] used to give a curved border only when the border type is RRect, in other cases radius will not work
38+
/// radius of type [Radius] used to give a curved border only when the border type is RRect,
39+
/// in other cases radius will not work
3840
final Radius radius;
3941

40-
/// customPath of type [PathBuilder] used for drawing the paths
41-
final PathBuilder customPath;
42+
// /// customPath of type [PathBuilder] used for drawing the paths
43+
// final PathBuilder customPath;
4244

4345
@override
4446
Widget build(BuildContext context) => Stack(
47+
alignment: AlignmentDirectional.center,
4548
children: <Widget>[
4649
Positioned.fill(
4750
child: CustomPaint(
@@ -51,7 +54,7 @@ class GFBorder extends StatelessWidget {
5154
color: color,
5255
type: type,
5356
dashedLine: dashedLine,
54-
customPath: customPath,
57+
// customPath: customPath,
5558
),
5659
),
5760
),

lib/components/border/gf_dashed_border.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ class DashedType extends CustomPainter {
2121
final List<double> dashedLine;
2222

2323
/// color of type [Color] or GFColor which is used to change the color of the border type
24-
final Color color;
24+
final dynamic color;
2525

2626
/// type of [GFBorderType] which is used to define the different types of borders ie, circle, Rect, RRect and oval
2727
final GFBorderType type;

lib/components/bottom_sheet/gf_bottom_sheet.dart

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ class GFBottomSheet extends StatefulWidget {
2323
}
2424

2525
/// [minContentHeight] controls the minimum height of the content body.
26+
/// content body with [minContentHeight] displays only when [enableExpandableContent] is false.
2627
/// It Must be greater or equal to 0. Default value is 0.
2728
final double minContentHeight;
2829

@@ -52,7 +53,7 @@ class GFBottomSheet extends StatefulWidget {
5253
/// Must be greater or equal to 0. Default value is 0.
5354
final double elevation;
5455

55-
///[enableExpandableContent] allows [contentBody] to expand.
56+
/// [enableExpandableContent] allows [contentBody] to expand.
5657
/// Default value is false.
5758
final bool enableExpandableContent;
5859

lib/components/intro_screen/gf_intro_screen.dart

Lines changed: 23 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,16 @@ class GFIntroScreen extends StatefulWidget {
66
const GFIntroScreen({
77
Key key,
88
@required this.pageController,
9+
@required this.currentIndex,
10+
@required this.pageCount,
911
@required this.slides,
1012
this.color,
1113
this.width,
1214
this.height,
1315
this.borderRadius,
1416
this.border,
1517
this.introScreenBottomNavigationBar,
16-
this.showIntroSCreenBottomNavigationBar = true,
17-
this.currentIndex = 0,
18-
this.pageCount = 0,
18+
this.showIntroScreenBottomNavigationBar = true,
1919
this.child,
2020
this.navigationBarColor = GFColors.SUCCESS,
2121
this.navigationBarHeight = 50,
@@ -68,37 +68,37 @@ class GFIntroScreen extends StatefulWidget {
6868
/// defines the list of slides
6969
final List<Widget> slides;
7070

71-
/// default controller for the [GFIntroScreen] component
71+
/// allows one to control [GFIntroScreen] slides
7272
final PageController pageController;
7373

74-
/// background color of the [GFIntroScreen] component
74+
/// defines background color of the [GFIntroScreen] slides
7575
final Color color;
7676

77-
/// defines [GFIntroScreen] height
77+
/// defines [GFIntroScreen] slides height
7878
final double height;
7979

80-
/// defines [GFIntroScreen] width
80+
/// defines [GFIntroScreen] slides width
8181
final double width;
8282

83-
/// defines [GFIntroScreen] border radius to defines slide shape
83+
/// defines [GFIntroScreen] border radius to defines slides shape
8484
final BorderRadius borderRadius;
8585

86-
/// defines [GFIntroScreen] border
86+
/// defines [GFIntroScreen] slides border
8787
final Border border;
8888

8989
/// defines [GFIntroScreen]'s bottom navigation bar
9090
final GFIntroScreenBottomNavigationBar introScreenBottomNavigationBar;
9191

9292
/// on true state, displays [GFIntroScreenBottomNavigationBar], defaults to true
93-
final bool showIntroSCreenBottomNavigationBar;
93+
final bool showIntroScreenBottomNavigationBar;
9494

9595
/// defines the currentIndex of [GFIntroScreen] slides, default value is 0
9696
final int currentIndex;
9797

9898
/// defines the length of [GFIntroScreen] slides, default value is 0
9999
final int pageCount;
100100

101-
/// defines [GFIntroScreenBottomNavigationBar], it takes any widget
101+
/// defines [GFIntroScreenBottomNavigationBar]'s child, it takes any widget
102102
final Widget child;
103103

104104
/// defines [GFIntroScreenBottomNavigationBar] height
@@ -131,28 +131,28 @@ class GFIntroScreen extends StatefulWidget {
131131
/// Called when the skip button is tapped
132132
final VoidCallback onSkipTap;
133133

134-
/// defines the backButton widget
134+
/// takes any Widget to define the backButton widget,
135135
final Widget backButton;
136136

137-
/// defines the forwardButton widget
137+
/// takes any Widget to define the forwardButton widget
138138
final Widget forwardButton;
139139

140-
/// defines the doneButton widget
140+
/// takes any Widget to define the doneButton widget
141141
final Widget doneButton;
142142

143-
/// defines the skipButton widget
143+
/// takes any Widget to define the skipButton widget
144144
final Widget skipButton;
145145

146-
/// defines the backButton text
146+
/// takes String to define backButton text
147147
final String backButtonText;
148148

149-
/// defines the forwardButton text
149+
/// takes String to define forwardButton text
150150
final String forwardButtonText;
151151

152-
/// defines the doneButton text
152+
/// takes String to define doneButton text
153153
final String doneButtonText;
154154

155-
/// defines the skipButton text
155+
/// takes String to define skipButton text
156156
final String skipButtonText;
157157

158158
/// defines the skipButton textStyle
@@ -208,29 +208,6 @@ class GFIntroScreen extends StatefulWidget {
208208
}
209209

210210
class _GFIntroScreenState extends State<GFIntroScreen> {
211-
PageController _pageController;
212-
int currentIndex;
213-
List<Widget> pages;
214-
215-
@override
216-
void initState() {
217-
_pageController = widget.pageController != null
218-
? widget.pageController
219-
: PageController(initialPage: 0);
220-
currentIndex = _pageController.initialPage;
221-
if (widget.pageController != null) {
222-
_pageController = widget.pageController;
223-
}
224-
_pageController.addListener(() {
225-
if (mounted) {
226-
setState(() {
227-
currentIndex = _pageController.page.round();
228-
});
229-
}
230-
});
231-
super.initState();
232-
}
233-
234211
@override
235212
Widget build(BuildContext context) => Center(
236213
child: Container(
@@ -247,16 +224,16 @@ class _GFIntroScreenState extends State<GFIntroScreen> {
247224
children: <Widget>[
248225
Expanded(
249226
child: PageView(
250-
controller: _pageController,
227+
controller: widget.pageController,
251228
children: widget.slides,
252229
),
253230
),
254-
widget.showIntroSCreenBottomNavigationBar
231+
widget.showIntroScreenBottomNavigationBar
255232
? widget.introScreenBottomNavigationBar ??
256233
GFIntroScreenBottomNavigationBar(
257-
pageController: _pageController,
234+
pageController: widget.pageController,
258235
pageCount: widget.slides.length,
259-
currentIndex: currentIndex,
236+
currentIndex: widget.currentIndex,
260237
child: widget.child,
261238
navigationBarColor: widget.navigationBarColor,
262239
navigationBarHeight: widget.navigationBarHeight,

0 commit comments

Comments
 (0)