Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 15 additions & 14 deletions lib/components/accordian/gf_accordian.dart
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,14 @@ class GFAccordion extends StatefulWidget {
this.contentPadding = const EdgeInsets.all(10),
this.contentChild,
this.titleBorder = const Border(),
this.contentborder = const Border(),
this.contentBorder = const Border(),
this.margin,
this.showAccordion = false,
this.onToggleCollapsed,
this.titleBorderRadius = const BorderRadius.all(Radius.circular(0)),
this.contentBorderRadius = const BorderRadius.all(Radius.circular(0))})
: super(key: key);

final Function(bool) onToggleCollapsed;

/// controls if the accordion should be collapsed or not making it possible to be controlled from outside
final bool showAccordion;

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

///collapsedIcon of type [Widget] which is used to show when the [GFAccordion] is collapsed
/// collapsedIcon of type [Widget] which is used to show when the [GFAccordion] is collapsed
final Widget collapsedIcon;

///expandedIcon of type[Widget] which is used when the [GFAccordion] is expanded
/// expandedIcon of type[Widget] which is used when the [GFAccordion] is expanded
final Widget expandedIcon;

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

///titlePadding of type [EdgeInsets] which is used to set the padding of the [GFAccordion] title
/// titlePadding of type [EdgeInsets] which is used to set the padding of the [GFAccordion] title
final EdgeInsets titlePadding;

///descriptionPadding of type [EdgeInsets] which is used to set the padding of the [GFAccordion] description
/// descriptionPadding of type [EdgeInsets] which is used to set the padding of the [GFAccordion] description
final EdgeInsets contentPadding;

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

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

///titleBorderColor of type [Color] or [GFColors] which is used to change the border color of title
/// titleBorderColor of type [Color] or [GFColors] which is used to change the border color of title
final Border titleBorder;

///contentBorderColor of type [Color] or [GFColors] which is used to change the border color of content
final Border contentborder;
/// contentBorderColor of type [Color] or [GFColors] which is used to change the border color of content
final Border contentBorder;

///titleBorderRadius of type [Radius] which is used to change the border radius of title
/// titleBorderRadius of type [Radius] which is used to change the border radius of title
final BorderRadius titleBorderRadius;

///contentBorderRadius of type [Radius] which is used to change the border radius of content
/// contentBorderRadius of type [Radius] which is used to change the border radius of content
final BorderRadius contentBorderRadius;

/// function called when the content body collapsed
final Function(bool) onToggleCollapsed;

@override
_GFAccordionState createState() => _GFAccordionState();
}
Expand Down Expand Up @@ -152,7 +153,7 @@ class _GFAccordionState extends State<GFAccordion>
? Container(
decoration: BoxDecoration(
borderRadius: widget.contentBorderRadius,
border: widget.contentborder,
border: widget.contentBorder,
color: widget.contentBackgroundColor ?? Colors.white70,
),
width: MediaQuery.of(context).size.width,
Expand Down
7 changes: 3 additions & 4 deletions lib/components/animation/gf_animation.dart
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ class GFAnimation extends StatefulWidget {
this.reverseDuration,
}) : super(key: key);

/// `The duration for animation to perform`
/// The duration for animation to perform
final Duration duration;

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

/// [AnimatedContainer] initial width
/// defines [AnimatedContainer] initial width
final double width;

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

/// [AnimatedContainer] initial height
/// defines [AnimatedContainer] initial height
final double height;

/// defines the height of [AnimatedContainer] upto which it can extend during animation
Expand Down Expand Up @@ -127,7 +127,6 @@ class GFAnimation extends StatefulWidget {
class _GFAnimationState extends State<GFAnimation>
with SingleTickerProviderStateMixin {
bool selected = false;

AnimationController controller;
Animation<double> animation;
Animation<Offset> offsetAnimation;
Expand Down
19 changes: 11 additions & 8 deletions lib/components/border/gf_border.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import 'dart:ui';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:getwidget/components/border/gf_dashed_border.dart';
import 'package:getwidget/types/gf_border_type.dart';
Expand All @@ -12,36 +13,38 @@ class GFBorder extends StatelessWidget {
this.dashedLine = const <double>[3, 1],
this.padding = const EdgeInsets.all(10),
this.radius = const Radius.circular(0),
this.customPath,
// this.customPath,
}) : assert(child != null),
assert(_isValidDashedLine(dashedLine), 'Invalid dash pattern');

/// child of type [Widget] which can be any component or text, etc
/// child of type [Widget] which can be any component or text, etc
final Widget child;

/// padding of time [EdgeInsets] where in padding is given to the border types
/// padding for [child] where in padding is given to the border types
final EdgeInsets padding;

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

/// color of type [Color] or GFColor which is used to change the color of the border type
final Color color;
final dynamic color;

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

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

/// radius of type [Radius] used to give a curved border only when the border type is RRect, in other cases radius will not work
/// radius of type [Radius] used to give a curved border only when the border type is RRect,
/// in other cases radius will not work
final Radius radius;

/// customPath of type [PathBuilder] used for drawing the paths
final PathBuilder customPath;
// /// customPath of type [PathBuilder] used for drawing the paths
// final PathBuilder customPath;

@override
Widget build(BuildContext context) => Stack(
alignment: AlignmentDirectional.center,
children: <Widget>[
Positioned.fill(
child: CustomPaint(
Expand All @@ -51,7 +54,7 @@ class GFBorder extends StatelessWidget {
color: color,
type: type,
dashedLine: dashedLine,
customPath: customPath,
// customPath: customPath,
),
),
),
Expand Down
2 changes: 1 addition & 1 deletion lib/components/border/gf_dashed_border.dart
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class DashedType extends CustomPainter {
final List<double> dashedLine;

/// color of type [Color] or GFColor which is used to change the color of the border type
final Color color;
final dynamic color;

/// type of [GFBorderType] which is used to define the different types of borders ie, circle, Rect, RRect and oval
final GFBorderType type;
Expand Down
3 changes: 2 additions & 1 deletion lib/components/bottom_sheet/gf_bottom_sheet.dart
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ class GFBottomSheet extends StatefulWidget {
}

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

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

///[enableExpandableContent] allows [contentBody] to expand.
/// [enableExpandableContent] allows [contentBody] to expand.
/// Default value is false.
final bool enableExpandableContent;

Expand Down
69 changes: 23 additions & 46 deletions lib/components/intro_screen/gf_intro_screen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,16 @@ class GFIntroScreen extends StatefulWidget {
const GFIntroScreen({
Key key,
@required this.pageController,
@required this.currentIndex,
@required this.pageCount,
@required this.slides,
this.color,
this.width,
this.height,
this.borderRadius,
this.border,
this.introScreenBottomNavigationBar,
this.showIntroSCreenBottomNavigationBar = true,
this.currentIndex = 0,
this.pageCount = 0,
this.showIntroScreenBottomNavigationBar = true,
this.child,
this.navigationBarColor = GFColors.SUCCESS,
this.navigationBarHeight = 50,
Expand Down Expand Up @@ -68,37 +68,37 @@ class GFIntroScreen extends StatefulWidget {
/// defines the list of slides
final List<Widget> slides;

/// default controller for the [GFIntroScreen] component
/// allows one to control [GFIntroScreen] slides
final PageController pageController;

/// background color of the [GFIntroScreen] component
/// defines background color of the [GFIntroScreen] slides
final Color color;

/// defines [GFIntroScreen] height
/// defines [GFIntroScreen] slides height
final double height;

/// defines [GFIntroScreen] width
/// defines [GFIntroScreen] slides width
final double width;

/// defines [GFIntroScreen] border radius to defines slide shape
/// defines [GFIntroScreen] border radius to defines slides shape
final BorderRadius borderRadius;

/// defines [GFIntroScreen] border
/// defines [GFIntroScreen] slides border
final Border border;

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

/// on true state, displays [GFIntroScreenBottomNavigationBar], defaults to true
final bool showIntroSCreenBottomNavigationBar;
final bool showIntroScreenBottomNavigationBar;

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

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

/// defines [GFIntroScreenBottomNavigationBar], it takes any widget
/// defines [GFIntroScreenBottomNavigationBar]'s child, it takes any widget
final Widget child;

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

/// defines the backButton widget
/// takes any Widget to define the backButton widget,
final Widget backButton;

/// defines the forwardButton widget
/// takes any Widget to define the forwardButton widget
final Widget forwardButton;

/// defines the doneButton widget
/// takes any Widget to define the doneButton widget
final Widget doneButton;

/// defines the skipButton widget
/// takes any Widget to define the skipButton widget
final Widget skipButton;

/// defines the backButton text
/// takes String to define backButton text
final String backButtonText;

/// defines the forwardButton text
/// takes String to define forwardButton text
final String forwardButtonText;

/// defines the doneButton text
/// takes String to define doneButton text
final String doneButtonText;

/// defines the skipButton text
/// takes String to define skipButton text
final String skipButtonText;

/// defines the skipButton textStyle
Expand Down Expand Up @@ -208,29 +208,6 @@ class GFIntroScreen extends StatefulWidget {
}

class _GFIntroScreenState extends State<GFIntroScreen> {
PageController _pageController;
int currentIndex;
List<Widget> pages;

@override
void initState() {
_pageController = widget.pageController != null
? widget.pageController
: PageController(initialPage: 0);
currentIndex = _pageController.initialPage;
if (widget.pageController != null) {
_pageController = widget.pageController;
}
_pageController.addListener(() {
if (mounted) {
setState(() {
currentIndex = _pageController.page.round();
});
}
});
super.initState();
}

@override
Widget build(BuildContext context) => Center(
child: Container(
Expand All @@ -247,16 +224,16 @@ class _GFIntroScreenState extends State<GFIntroScreen> {
children: <Widget>[
Expanded(
child: PageView(
controller: _pageController,
controller: widget.pageController,
children: widget.slides,
),
),
widget.showIntroSCreenBottomNavigationBar
widget.showIntroScreenBottomNavigationBar
? widget.introScreenBottomNavigationBar ??
GFIntroScreenBottomNavigationBar(
pageController: _pageController,
pageController: widget.pageController,
pageCount: widget.slides.length,
currentIndex: currentIndex,
currentIndex: widget.currentIndex,
child: widget.child,
navigationBarColor: widget.navigationBarColor,
navigationBarHeight: widget.navigationBarHeight,
Expand Down
Loading