diff --git a/lib/components/accordian/gf_accordian.dart b/lib/components/accordian/gf_accordian.dart index 84fb3c32..506d68bc 100644 --- a/lib/components/accordian/gf_accordian.dart +++ b/lib/components/accordian/gf_accordian.dart @@ -97,9 +97,11 @@ class _GFAccordionState extends State showAccordion = widget.showAccordion; animationController = AnimationController( duration: const Duration(seconds: 2), + vsync: this ); controller = AnimationController( duration: const Duration(milliseconds: 300), + vsync: this ); offset = Tween( begin: const Offset(0, -0.06), diff --git a/lib/components/alert/gf_alert.dart b/lib/components/alert/gf_alert.dart index 13f062d8..0a7100d5 100644 --- a/lib/components/alert/gf_alert.dart +++ b/lib/components/alert/gf_alert.dart @@ -68,6 +68,7 @@ class _GFAlertState extends State with TickerProviderStateMixin { void initState() { animationController = AnimationController( duration: const Duration(milliseconds: 300), + vsync: this ); animation = CurvedAnimation( parent: animationController, diff --git a/lib/components/animation/gf_animation.dart b/lib/components/animation/gf_animation.dart index f006e3ed..59bd97fd 100644 --- a/lib/components/animation/gf_animation.dart +++ b/lib/components/animation/gf_animation.dart @@ -118,7 +118,7 @@ class _GFAnimationState extends State if (widget.type == GFAnimationType.rotateTransition) { controller = widget.controller ?? AnimationController( - duration: widget.duration ?? const Duration(seconds: 2)); + duration: widget.duration ?? const Duration(seconds: 2), vsync: this); animation = widget.turnsAnimation ?? Tween(begin: 0, end: 20).animate(controller); if (widget.turnsAnimation == null) { @@ -127,14 +127,14 @@ class _GFAnimationState extends State } else if (widget.type == GFAnimationType.scaleTransition) { controller = widget.controller ?? AnimationController( - duration: widget.duration ?? const Duration(seconds: 2)); + duration: widget.duration ?? const Duration(seconds: 2), vsync: this); animation = widget.scaleAnimation ?? CurvedAnimation( parent: controller, curve: widget.curve ?? Curves.ease); controller.forward(); } else if (widget.type == GFAnimationType.slideTransition) { controller = AnimationController( - duration: widget.duration ?? const Duration(seconds: 2), + duration: widget.duration ?? const Duration(seconds: 2), vsync: this )..repeat(reverse: true); offsetAnimation = Tween( begin: Offset.zero, @@ -252,7 +252,7 @@ class _GFAnimationState extends State fontWeight: widget.fontWeight ?? FontWeight.normal, fontSize: widget.fontSize ?? 16, color: widget.color ?? Colors.blue), - textWidthBasis: widget.textWidthBasis ?? TextWidthBasis.parent, +// textWidthBasis: widget.textWidthBasis ?? TextWidthBasis.parent, textAlign: widget.textAlign ?? TextAlign.start, curve: widget.curve ?? Curves.linear, duration: widget.duration ?? const Duration(seconds: 2), diff --git a/lib/components/appbar/gf_appbar.dart b/lib/components/appbar/gf_appbar.dart index d32582e7..8196fd60 100644 --- a/lib/components/appbar/gf_appbar.dart +++ b/lib/components/appbar/gf_appbar.dart @@ -322,12 +322,12 @@ class _GFAppBarState extends State { IconThemeData actionsIconTheme = widget.actionsIconTheme ?? appBarTheme.actionsIconTheme ?? overallIconTheme; - TextStyle centerStyle = widget.textTheme?.headline5 ?? - appBarTheme.textTheme?.headline5 ?? - theme.primaryTextTheme.headline5; - TextStyle sideStyle = widget.textTheme?.bodyText1 ?? - appBarTheme.textTheme?.bodyText1 ?? - theme.primaryTextTheme.bodyText1; + TextStyle centerStyle = widget.textTheme?.headline ?? + appBarTheme.textTheme?.headline ?? + theme.primaryTextTheme.headline; + TextStyle sideStyle = widget.textTheme?.body1 ?? + appBarTheme.textTheme?.body1 ?? + theme.primaryTextTheme.body1; if (widget.toolbarOpacity != 1.0) { final double opacity = const Interval( diff --git a/lib/components/avatar/gf_avatar.dart b/lib/components/avatar/gf_avatar.dart index 320c263c..baee7e65 100644 --- a/lib/components/avatar/gf_avatar.dart +++ b/lib/components/avatar/gf_avatar.dart @@ -87,7 +87,7 @@ class GFAvatar extends StatelessWidget { final Color foregroundColor = this.foregroundColor; assert(debugCheckHasMediaQuery(context)); final ThemeData theme = Theme.of(context); - TextStyle textStyle = theme.primaryTextTheme.subtitle1.copyWith( + TextStyle textStyle = theme.primaryTextTheme.subtitle.copyWith( color: foregroundColor, ); Color effectiveBackgroundColor = backgroundColor; diff --git a/lib/components/carousel/gf_items_carousel.dart b/lib/components/carousel/gf_items_carousel.dart index 87e10542..a79c29cf 100644 --- a/lib/components/carousel/gf_items_carousel.dart +++ b/lib/components/carousel/gf_items_carousel.dart @@ -83,6 +83,7 @@ class _GFItemsCarouselState extends State offset = 0; animationController = AnimationController( duration: const Duration(milliseconds: dragAnimationDuration), + vsync: this ); Future.delayed(Duration.zero, () { setState(() { @@ -132,6 +133,7 @@ class _GFItemsCarouselState extends State animationController = AnimationController( duration: const Duration(milliseconds: dragAnimationDuration), + vsync: this ); final Tween tween = @@ -163,6 +165,7 @@ class _GFItemsCarouselState extends State final double endAnimation = size * (offset / size).round().toDouble(); animationController = AnimationController( duration: const Duration(milliseconds: shiftAnimationDuration), + vsync: this ); final Tween tween = Tween(begin: beginAnimation, end: endAnimation); final Animation animation = tween.animate(animationController); diff --git a/lib/components/loader/gf_loader.dart b/lib/components/loader/gf_loader.dart index c398d4cf..b09425ef 100644 --- a/lib/components/loader/gf_loader.dart +++ b/lib/components/loader/gf_loader.dart @@ -73,6 +73,7 @@ class _GFLoaderState extends State controller = AnimationController( duration: widget.duration, + vsync: this ); loaderanimation1 = Tween(begin: 0, end: 1).animate( diff --git a/lib/components/progress_bar/gf_progress_bar.dart b/lib/components/progress_bar/gf_progress_bar.dart index 136f2ce3..b06b8cf3 100644 --- a/lib/components/progress_bar/gf_progress_bar.dart +++ b/lib/components/progress_bar/gf_progress_bar.dart @@ -130,7 +130,7 @@ class _GFProgressBarState extends State super.initState(); if (widget.animation) { _animationController = AnimationController( - duration: Duration(milliseconds: widget.animationDuration)); + duration: Duration(milliseconds: widget.animationDuration), vsync: this); _animation = Tween(begin: 0, end: widget.percentage).animate(_animationController) ..addListener(() { @@ -145,7 +145,7 @@ class _GFProgressBarState extends State if (widget.animation) { circularAnimationController = AnimationController( - duration: Duration(milliseconds: widget.animationDuration)); + duration: Duration(milliseconds: widget.animationDuration), vsync: this); circularAnimation = Tween(begin: 0, end: widget.percentage) .animate(circularAnimationController) ..addListener(() { diff --git a/lib/components/shimmer/gf_shimmer.dart b/lib/components/shimmer/gf_shimmer.dart index 66737f7f..40acda88 100644 --- a/lib/components/shimmer/gf_shimmer.dart +++ b/lib/components/shimmer/gf_shimmer.dart @@ -65,7 +65,7 @@ class _GFShimmerState extends State void initState() { super.initState(); _count = 0; - _controller = AnimationController(duration: widget.duration) + _controller = AnimationController(duration: widget.duration, vsync: this) ..addStatusListener((AnimationStatus status) { if (status != AnimationStatus.completed) { return; diff --git a/lib/components/toast/gf_toast.dart b/lib/components/toast/gf_toast.dart index f406616b..1fde843a 100644 --- a/lib/components/toast/gf_toast.dart +++ b/lib/components/toast/gf_toast.dart @@ -71,6 +71,7 @@ class _GFToastState extends State with TickerProviderStateMixin { void initState() { animationController = AnimationController( duration: widget.duration, + vsync: this ); animation = CurvedAnimation( parent: animationController, @@ -81,6 +82,7 @@ class _GFToastState extends State with TickerProviderStateMixin { animationController.forward(); fadeanimationController = AnimationController( duration: widget.animationDuration, + vsync: this )..addListener(() => setState(() {})); fadeanimation = Tween( begin: 0, diff --git a/lib/components/toggle/gf_toggle.dart b/lib/components/toggle/gf_toggle.dart index aef51bcb..248e9bfa 100644 --- a/lib/components/toggle/gf_toggle.dart +++ b/lib/components/toggle/gf_toggle.dart @@ -89,7 +89,7 @@ class _GFToggleState extends State with TickerProviderStateMixin { setState(() { isOn = widget.value ?? false; }); - controller = AnimationController(duration: widget.duration); + controller = AnimationController(duration: widget.duration, vsync: this); offset = (isOn ? Tween( begin: const Offset(1, 0), diff --git a/pubspec.lock b/pubspec.lock index e69de29b..67a7df16 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -0,0 +1,188 @@ +# Generated by pub +# See https://dart.dev/tools/pub/glossary#lockfile +packages: + archive: + dependency: transitive + description: + name: archive + url: "https://pub.dartlang.org" + source: hosted + version: "2.0.11" + args: + dependency: transitive + description: + name: args + url: "https://pub.dartlang.org" + source: hosted + version: "1.5.2" + async: + dependency: transitive + description: + name: async + url: "https://pub.dartlang.org" + source: hosted + version: "2.4.0" + boolean_selector: + dependency: transitive + description: + name: boolean_selector + url: "https://pub.dartlang.org" + source: hosted + version: "1.0.5" + charcode: + dependency: transitive + description: + name: charcode + url: "https://pub.dartlang.org" + source: hosted + version: "1.1.2" + collection: + dependency: transitive + description: + name: collection + url: "https://pub.dartlang.org" + source: hosted + version: "1.14.11" + convert: + dependency: transitive + description: + name: convert + url: "https://pub.dartlang.org" + source: hosted + version: "2.1.1" + crypto: + dependency: transitive + description: + name: crypto + url: "https://pub.dartlang.org" + source: hosted + version: "2.1.3" + flutter: + dependency: "direct main" + description: flutter + source: sdk + version: "0.0.0" + flutter_test: + dependency: "direct dev" + description: flutter + source: sdk + version: "0.0.0" + image: + dependency: transitive + description: + name: image + url: "https://pub.dartlang.org" + source: hosted + version: "2.1.4" + matcher: + dependency: transitive + description: + name: matcher + url: "https://pub.dartlang.org" + source: hosted + version: "0.12.6" + meta: + dependency: transitive + description: + name: meta + url: "https://pub.dartlang.org" + source: hosted + version: "1.1.8" + path: + dependency: transitive + description: + name: path + url: "https://pub.dartlang.org" + source: hosted + version: "1.6.4" + pedantic: + dependency: transitive + description: + name: pedantic + url: "https://pub.dartlang.org" + source: hosted + version: "1.8.0+1" + petitparser: + dependency: transitive + description: + name: petitparser + url: "https://pub.dartlang.org" + source: hosted + version: "2.4.0" + quiver: + dependency: transitive + description: + name: quiver + url: "https://pub.dartlang.org" + source: hosted + version: "2.0.5" + sky_engine: + dependency: transitive + description: flutter + source: sdk + version: "0.0.99" + source_span: + dependency: transitive + description: + name: source_span + url: "https://pub.dartlang.org" + source: hosted + version: "1.5.5" + stack_trace: + dependency: transitive + description: + name: stack_trace + url: "https://pub.dartlang.org" + source: hosted + version: "1.9.3" + stream_channel: + dependency: transitive + description: + name: stream_channel + url: "https://pub.dartlang.org" + source: hosted + version: "2.0.0" + string_scanner: + dependency: transitive + description: + name: string_scanner + url: "https://pub.dartlang.org" + source: hosted + version: "1.0.5" + term_glyph: + dependency: transitive + description: + name: term_glyph + url: "https://pub.dartlang.org" + source: hosted + version: "1.1.0" + test_api: + dependency: transitive + description: + name: test_api + url: "https://pub.dartlang.org" + source: hosted + version: "0.2.11" + typed_data: + dependency: transitive + description: + name: typed_data + url: "https://pub.dartlang.org" + source: hosted + version: "1.1.6" + vector_math: + dependency: transitive + description: + name: vector_math + url: "https://pub.dartlang.org" + source: hosted + version: "2.0.8" + xml: + dependency: transitive + description: + name: xml + url: "https://pub.dartlang.org" + source: hosted + version: "3.5.0" +sdks: + dart: ">=2.4.0 <3.0.0"