diff --git a/CHANGELOG.md b/CHANGELOG.md index 9006903..57dea4f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ +# [4.0.1](https://github.com/SimformSolutionsPvtLtd/flutter_credit_card/tree/4.0.1) + +- Fixed glare effect issue [#154](https://github.com/SimformSolutionsPvtLtd/flutter_credit_card/pull/154). + # [4.0.0+1](https://github.com/SimformSolutionsPvtLtd/flutter_credit_card/tree/4.0.0+1) - Added web support for example app [#148](https://github.com/SimformSolutionsPvtLtd/flutter_credit_card/pull/148). diff --git a/lib/src/credit_card_widget.dart b/lib/src/credit_card_widget.dart index ed15655..8b55432 100644 --- a/lib/src/credit_card_widget.dart +++ b/lib/src/credit_card_widget.dart @@ -458,7 +458,7 @@ class _CreditCardWidgetState extends State stream: frontCardFloatStream.stream, onEvent: (FloatingEvent? event) => floatController.transform(event, shouldAvoid: controller.isAnimating), - child: _frontCardBackground( + child: () => _frontCardBackground( defaultTextStyle: defaultTextStyle, number: number, ), @@ -601,7 +601,10 @@ class _CreditCardWidgetState extends State stream: backCardFloatStream.stream, onEvent: (FloatingEvent? event) => floatController.transform(event, shouldAvoid: controller.isAnimating), - child: _backCardBackground(defaultTextStyle: defaultTextStyle, cvv: cvv), + child: () => _backCardBackground( + defaultTextStyle: defaultTextStyle, + cvv: cvv, + ), ); } diff --git a/lib/src/float_animation_builder.dart b/lib/src/float_animation_builder.dart index 71f8055..3f01f91 100644 --- a/lib/src/float_animation_builder.dart +++ b/lib/src/float_animation_builder.dart @@ -15,7 +15,7 @@ class FloatAnimationBuilder extends StatelessWidget { final bool isEnabled; final Stream stream; final FloatEventCallback onEvent; - final Widget child; + final WidgetCallback child; @override Widget build(BuildContext context) { @@ -29,9 +29,9 @@ class FloatAnimationBuilder extends StatelessWidget { Transform( transform: onEvent(snapshot.data), alignment: FractionalOffset.center, - child: child, + child: child(), ), ) - : child; + : child(); } } diff --git a/lib/src/utils/typedefs.dart b/lib/src/utils/typedefs.dart index 4175242..cb803e7 100644 --- a/lib/src/utils/typedefs.dart +++ b/lib/src/utils/typedefs.dart @@ -1,4 +1,4 @@ -import 'package:flutter/rendering.dart'; +import 'package:flutter/widgets.dart'; import '../floating_animation/floating_event.dart'; import '../models/credit_card_brand.dart'; @@ -11,3 +11,5 @@ typedef CCBrandChangeCallback = void Function(CreditCardBrand); typedef ValidationCallback = String? Function(String?); typedef FloatEventCallback = Matrix4 Function(FloatingEvent? event); + +typedef WidgetCallback = Widget Function(); diff --git a/pubspec.yaml b/pubspec.yaml index 87472a8..cea84df 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,7 +1,7 @@ name: flutter_credit_card description: A Credit Card widget package with support of entering card details, and animations like card flip and float. -version: 4.0.0+1 +version: 4.0.1 homepage: https://github.com/simformsolutions/flutter_credit_card issue_tracker: https://github.com/simformsolutions/flutter_credit_card/issues