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
41 changes: 13 additions & 28 deletions lib/components/animation/gf_animation.dart
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,10 @@ class GFAnimation extends StatefulWidget {
this.reverseDuration,
}) : super(key: key);

/// `The duration for animation to perform`
/// The duration for animations of the [Decoration].
final Duration duration;

/// The duration for animation to perform
/// The duration for animations of the type[Size].
final Duration reverseDuration;

/// Defines how the animated widget is aligned within the Animation.
Expand All @@ -49,7 +49,7 @@ class GFAnimation extends StatefulWidget {
/// The child of type [Widget] to display animation effect.
final Widget child;

/// Determines the animation curve. Defaults to [Curves.linear].
/// Determines the animation curve physics. Defaults to [Curves.linear].
final Curve curve;

///type of [GFAnimation] which takes the type ie, align, size, container, rotateTransition, scaleTransition, slideTransition, and textStyle for the [GFAnimation]
Expand All @@ -58,66 +58,51 @@ class GFAnimation extends StatefulWidget {
/// [AnimatedContainer] initial width
final double width;

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

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

/// defines the height of [AnimatedContainer] upto which it can extend during animation
/// [AnimatedContainer] changed height
final double changedHeight;

/// defines the color of [AnimatedContainer] when onTap triggers
/// defines the color of items when onTap triggers
final Color activeColor;

/// defines the color of [AnimatedContainer]
/// defines the color of items
final Color color;

/// defines [child]'s or [AnimatedContainer] padding
/// The empty space that surrounds the animation. Defines the animation outer [Container.padding]..
final EdgeInsetsGeometry padding;

/// defines [child]'s or [AnimatedContainer] margin
/// The empty space that surrounds the animation. Defines the animation outer [Container.margin].
final EdgeInsetsGeometry margin;

/// Called when the user taps the [child]
final Function onTap;

/// Here's an illustration of the [RotationTransition] widget, with it's [turnsAnimation]
/// animated by a stuckValue set to animate
/// animated by a [Tween] set to [animate]:
final Animation<double> turnsAnimation;

/// Here's an illustration of the [ScaleTransition] widget, with it's [scaleAnimation]
/// animated by a [CurvedAnimation] set to [Curves.linear]
/// animated by a [CurvedAnimation] set to [Curves.linear]:
final Animation<double> scaleAnimation;

/// controls animation
final AnimationController controller;

///direction of the [AnimatedDefaultTextStyle] TextDirection for [ltr,rtl]
final TextDirection textDirection;

/// [ScaleTransition], which animates the scale of a widget.
/// * [ScaleTransition], which animates the scale of a widget.
final Animation<Offset> slidePosition;

/// defines the [TextStyle] of [AnimatedDefaultTextStyle]
final TextStyle style;

/// defines the [TextAlign] of [AnimatedDefaultTextStyle]
final TextAlign textAlign;

/// defines the [TextOverflow] of [AnimatedDefaultTextStyle]
final TextOverflow textOverflow;

/// defines the [maxLines] of [AnimatedDefaultTextStyle]
/// [AnimatedDefaultTextStyle] maxlines
final int maxLines;

/// defines the [TextWidthBasis] of [AnimatedDefaultTextStyle]
final TextWidthBasis textWidthBasis;

/// defines the [fontSize] of [AnimatedDefaultTextStyle]
final double fontSize;

/// defines the [fontWeight] of [AnimatedDefaultTextStyle]
final FontWeight fontWeight;

@override
Expand Down
6 changes: 3 additions & 3 deletions lib/components/border/gf_border.dart
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ class GFBorder extends StatelessWidget {
this.radius = const Radius.circular(0),
this.customPath,
}) : assert(child != null),
assert(_isValidDashedLine(dashedLine), 'Invalid dash pattern');
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
Expand Down Expand Up @@ -61,7 +61,7 @@ class GFBorder extends StatelessWidget {
}

/// the value of dashedLine cannot be 0 or null, it should have some definite and proper value
bool _isValidDashedLine(List<double> dash) {
bool _isValiddashedLine(List<double> dash) {
final Set<double> _dashSet = dash.toSet();
if (_dashSet == null) {
return false;
Expand Down
4 changes: 2 additions & 2 deletions lib/components/button/gf_button_bar.dart
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ class GFButtonBar extends StatelessWidget {
/// are placed relative to each other in the cross axis.
final WrapAlignment alignment;

/// How much space to place bestuckValue children in a run in the main axis.
/// How much space to place between children in a run in the main axis.
///
/// For example, if [spacing] is 10.0, the children will be spaced at least
/// 10.0 logical pixels apart in the main axis.
Expand Down Expand Up @@ -73,7 +73,7 @@ class GFButtonBar extends StatelessWidget {
/// are placed relative to each other in the cross axis.
final WrapAlignment runAlignment;

/// How much space to place bestuckValue the runs themselves in the cross axis.
/// How much space to place between the runs themselves in the cross axis.
///
/// For example, if [runSpacing] is 10.0, the runs will be spaced at least
/// 10.0 logical pixels apart in the cross axis.
Expand Down
4 changes: 2 additions & 2 deletions lib/components/carousel/gf_carousel.dart
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ class GFCarousel extends StatefulWidget {
/// Sets Duration to determent the frequency of slides when [autoPlay] is set to true. Defaults to 4 seconds.
final Duration autoPlayInterval;

/// The animation duration bestuckValue two transitioning pages while in auto playback. Defaults to 800 ms.
/// The animation duration between two transitioning pages while in auto playback. Defaults to 800 ms.
final Duration autoPlayAnimationDuration;

/// Determines the animation curve physics. Defaults to [Curves.fastOutSlowIn].
Expand Down Expand Up @@ -344,7 +344,7 @@ class _GFCarouselState extends State<GFCarousel> with TickerProviderStateMixin {
/// For example; We have a Carousel of 10000(simulating infinity) but only 6 images.
/// We need to repeat the images to give the illusion of a never ending stream.
/// By calling _getRealIndex with position and base we get an offset.
/// This offset modulo our length, 6, will return a number bestuckValue 0 and 5, which represent the image
/// This offset modulo our length, 6, will return a number between 0 and 5, which represent the image
/// to be placed in the given position.
int _getRealIndex(int position, int base, int length) {
final int offset = position - base;
Expand Down
17 changes: 8 additions & 9 deletions lib/components/checkbox/gf_checkbox.dart
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,13 @@ class GFCheckbox extends StatefulWidget {
: assert(autofocus != null),
super(key: key);

/// type of [GFCheckboxType] which is of four type is basic, square, circular and custom
/// type of [GFCheckboxType] which is of four type is basic, sqaure, circular and custom
final GFCheckboxType type;

/// type of [double] which is GFSize ie, small, medium and large and can use any double value
final double size;

/// type of [Color] used to change the checkcolor when the checkbox is active
/// type pf [Color] used to change the checkcolor when the checkbox is active
final Color checkColor;

/// type of [Color] used to change the backgroundColor of the active checkbox
Expand All @@ -49,23 +49,22 @@ class GFCheckbox extends StatefulWidget {
/// Called when the user checks or unchecks the checkbox.
final ValueChanged<bool> onChanged;

/// Used to set the current state of the checkbox
///Used to set the current state of the checkbox
final bool value;

/// type of [Widget] used to change the checkbox's active icon
///type of Widget used to change the checkbox's active icon
final Widget activeIcon;

/// type of [Widget] used to change the checkbox's inactive icon
///type of [Widget] used to change the checkbox's inactive icon
final Widget inactiveIcon;

/// type of [Color] used to change the background color of the custom active checkbox only
/// type of [Color] used to change the background color of the custom active checkbox only
final Color custombgColor;

/// on true state this widget will be selected as the initial focus
/// when no other node in its scope is currently focused
/// {@macro flutter.widgets.Focus.autofocus}
final bool autofocus;

/// an optional focus node to use as the focus node for this widget.
/// {@macro flutter.widgets.Focus.focusNode}
final FocusNode focusNode;

@override
Expand Down
4 changes: 2 additions & 2 deletions lib/components/image/gf_image_overlay.dart
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,9 @@ class GFImageOverlay extends StatelessWidget {
///
/// If this is [BoxShape.circle] then [borderRadius] is ignored.
///
/// The [shape] cannot be interpolated; animating bestuckValue two [BoxDecoration]s
/// The [shape] cannot be interpolated; animating between two [BoxDecoration]s
/// with different [shape]s will result in a discontinuity in the rendering.
/// To interpolate bestuckValue two shapes, consider using [ShapeDecoration] and
/// To interpolate between two shapes, consider using [ShapeDecoration] and
/// different [ShapeBorder]s; in particular, [CircleBorder] instead of
/// [BoxShape.circle] and [RoundedRectangleBorder] instead of
/// [BoxShape.rectangle].
Expand Down
160 changes: 160 additions & 0 deletions lib/components/intro_screen/gf__intro_bottom_navigation.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,160 @@
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';

class GFIntroBottomNavigation extends StatelessWidget {
const GFIntroBottomNavigation({
Key key,
this.rightText = 'NEXT',
this.pageNumber = 0,
this.onNext,
this.showDivider = true,
this.dividerColor = Colors.grey,
this.dividerHeight = 1,
this.dividerThickness = 0.0,
this.child,
this.padding = const EdgeInsets.all(8),
this.margin = const EdgeInsets.all(8),
this.pagesCount = 0,
this.skipText = 'SKIP',
this.onSkipTap,
this.skipWidget,
this.rightWidget,
this.dotShape = BoxShape.circle,
this.defaultColor,
this.activeColor,
this.dotHeight,
this.dotWidth,
this.dotMargin,
this.skipStyle,
this.rightStyle,
this.onDoneTap,
this.doneText = 'GO',
}) : super(key: key);

final String rightText;
final int pageNumber;
final VoidCallback onNext;
final bool showDivider;
final double dividerHeight;
final double dividerThickness;
final Color dividerColor;
final Widget child;
final int pagesCount;
final String skipText;
final VoidCallback onSkipTap;
final VoidCallback onDoneTap;
final EdgeInsets padding;
final EdgeInsets margin;
final Widget skipWidget;
final Widget rightWidget;
final TextStyle skipStyle;
final TextStyle rightStyle;
final String doneText;

///dot
final BoxShape dotShape;
final Color defaultColor;
final Color activeColor;
final double dotHeight;
final double dotWidth;
final EdgeInsets dotMargin;

@override
Widget build(BuildContext context) => Container(
child: DefaultTextStyle(
style: const TextStyle(
color: Colors.black,
fontSize: 16,
),
child: Column(
mainAxisAlignment: MainAxisAlignment.end,
children: <Widget>[
showDivider
? Divider(
height: dividerHeight,
thickness: dividerThickness,
color: dividerColor,
)
: Container(),
Container(
padding: padding,
margin: margin,
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: <Widget>[
GestureDetector(
behavior: HitTestBehavior.translucent,
child: Padding(
padding: const EdgeInsets.only(
top: 8,
bottom: 8,
left: 24,
right: 32,
),
child: skipWidget ??
Text(
skipText,
style: skipStyle ??
const TextStyle(
color: Colors.black,
fontSize: 16,
),
)),
onTap: onSkipTap,
),
Expanded(
child: Container(
child: Stack(
children: [
Row(
mainAxisAlignment: MainAxisAlignment.center,
children: getDotsList(),
)
],
),
),
),
GestureDetector(
behavior: HitTestBehavior.translucent,
child: Padding(
padding: const EdgeInsets.only(
top: 8, bottom: 8, left: 32, right: 24),
child: rightWidget ??
Text(
pageNumber == pagesCount - 1
? doneText
: rightText,
style: rightStyle ??
const TextStyle(
color: Colors.black,
fontSize: 16,
)),
),
onTap: pageNumber == pagesCount - 1 ? onDoneTap : onNext,
),
],
),
)
],
),
),
);

List<Widget> getDotsList() {
final List<Widget> list = [];
for (int i = 0; i < pagesCount; i++) {
list.add(Container(
width: dotWidth ?? 12,
height: dotHeight ?? 12,
margin: dotMargin ?? const EdgeInsets.symmetric(horizontal: 4),
decoration: BoxDecoration(
shape: dotShape,
color: pageNumber == i
? activeColor ?? Colors.blue
: defaultColor ?? Colors.grey.withOpacity(0.5),
),
));
}
return list;
}
}
Loading