Skip to content

Commit

Permalink
🚑 Glare Effect Hotfix (#154)
Browse files Browse the repository at this point in the history
  • Loading branch information
aditya-css committed Oct 6, 2023
1 parent ee9fdcd commit 1bac355
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 7 deletions.
4 changes: 4 additions & 0 deletions 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).
Expand Down
7 changes: 5 additions & 2 deletions lib/src/credit_card_widget.dart
Expand Up @@ -458,7 +458,7 @@ class _CreditCardWidgetState extends State<CreditCardWidget>
stream: frontCardFloatStream.stream,
onEvent: (FloatingEvent? event) =>
floatController.transform(event, shouldAvoid: controller.isAnimating),
child: _frontCardBackground(
child: () => _frontCardBackground(
defaultTextStyle: defaultTextStyle,
number: number,
),
Expand Down Expand Up @@ -601,7 +601,10 @@ class _CreditCardWidgetState extends State<CreditCardWidget>
stream: backCardFloatStream.stream,
onEvent: (FloatingEvent? event) =>
floatController.transform(event, shouldAvoid: controller.isAnimating),
child: _backCardBackground(defaultTextStyle: defaultTextStyle, cvv: cvv),
child: () => _backCardBackground(
defaultTextStyle: defaultTextStyle,
cvv: cvv,
),
);
}

Expand Down
6 changes: 3 additions & 3 deletions lib/src/float_animation_builder.dart
Expand Up @@ -15,7 +15,7 @@ class FloatAnimationBuilder extends StatelessWidget {
final bool isEnabled;
final Stream<FloatingEvent> stream;
final FloatEventCallback onEvent;
final Widget child;
final WidgetCallback child;

@override
Widget build(BuildContext context) {
Expand All @@ -29,9 +29,9 @@ class FloatAnimationBuilder extends StatelessWidget {
Transform(
transform: onEvent(snapshot.data),
alignment: FractionalOffset.center,
child: child,
child: child(),
),
)
: child;
: child();
}
}
4 changes: 3 additions & 1 deletion 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';
Expand All @@ -11,3 +11,5 @@ typedef CCBrandChangeCallback = void Function(CreditCardBrand);
typedef ValidationCallback = String? Function(String?);

typedef FloatEventCallback = Matrix4 Function(FloatingEvent? event);

typedef WidgetCallback = Widget Function();
2 changes: 1 addition & 1 deletion 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

Expand Down

0 comments on commit 1bac355

Please sign in to comment.