diff --git a/example/lib/main.dart b/example/lib/main.dart index 4e4d618..81a613d 100644 --- a/example/lib/main.dart +++ b/example/lib/main.dart @@ -191,7 +191,7 @@ class MySampleState extends State { shape: RoundedRectangleBorder( borderRadius: BorderRadius.circular(8.0), ), - primary: const Color(0xff1b447b), + backgroundColor: const Color(0xff1b447b), ), child: Container( margin: const EdgeInsets.all(12), diff --git a/lib/credit_card_form.dart b/lib/credit_card_form.dart index e8f5d06..ee4a9d0 100644 --- a/lib/credit_card_form.dart +++ b/lib/credit_card_form.dart @@ -1,8 +1,5 @@ import 'package:flutter/material.dart'; import 'package:flutter_credit_card/flutter_credit_card.dart'; -import 'package:jiffy/jiffy.dart'; - -import 'flutter_credit_card.dart'; class CreditCardForm extends StatefulWidget { const CreditCardForm({ @@ -114,7 +111,7 @@ class _CreditCardFormState extends State { super.initState(); createCreditCardModel(); - + _cardNumberController.text = widget.cardNumber; _expiryDateController.text = widget.expiryDate; _cardHolderNameController.text = widget.cardHolderName; @@ -248,8 +245,11 @@ class _CreditCardFormState extends State { final List date = value.split(RegExp(r'/')); final int month = int.parse(date.first); final int year = int.parse('20${date.last}'); - final int lastDayofMonth = DateTime(year, Jiffy( DateTime(year,month)).add(months: 1).month, 0 ).day; - final DateTime cardDate = DateTime(year, month, lastDayofMonth); + final int lastDayOfMonth = month < 12 + ? DateTime(year, month + 1, 0).day + : DateTime(year + 1, 1, 0).day; + final DateTime cardDate = DateTime( + year, month, lastDayOfMonth, 23, 59, 59, 999); if (cardDate.isBefore(now) || month > 12 || diff --git a/pubspec.lock b/pubspec.lock deleted file mode 100644 index 290a5eb..0000000 --- a/pubspec.lock +++ /dev/null @@ -1,160 +0,0 @@ -# Generated by pub -# See https://dart.dev/tools/pub/glossary#lockfile -packages: - async: - dependency: transitive - description: - name: async - url: "https://pub.dartlang.org" - source: hosted - version: "2.6.1" - boolean_selector: - dependency: transitive - description: - name: boolean_selector - url: "https://pub.dartlang.org" - source: hosted - version: "2.1.0" - characters: - dependency: transitive - description: - name: characters - url: "https://pub.dartlang.org" - source: hosted - version: "1.1.0" - charcode: - dependency: transitive - description: - name: charcode - url: "https://pub.dartlang.org" - source: hosted - version: "1.2.0" - clock: - dependency: transitive - description: - name: clock - url: "https://pub.dartlang.org" - source: hosted - version: "1.1.0" - collection: - dependency: transitive - description: - name: collection - url: "https://pub.dartlang.org" - source: hosted - version: "1.15.0" - fake_async: - dependency: transitive - description: - name: fake_async - url: "https://pub.dartlang.org" - source: hosted - version: "1.2.0" - 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" - intl: - dependency: transitive - description: - name: intl - url: "https://pub.dartlang.org" - source: hosted - version: "0.17.0" - jiffy: - dependency: "direct main" - description: - name: jiffy - url: "https://pub.dartlang.org" - source: hosted - version: "4.1.0" - matcher: - dependency: transitive - description: - name: matcher - url: "https://pub.dartlang.org" - source: hosted - version: "0.12.10" - meta: - dependency: transitive - description: - name: meta - url: "https://pub.dartlang.org" - source: hosted - version: "1.3.0" - path: - dependency: transitive - description: - name: path - url: "https://pub.dartlang.org" - source: hosted - version: "1.8.0" - 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.8.1" - stack_trace: - dependency: transitive - description: - name: stack_trace - url: "https://pub.dartlang.org" - source: hosted - version: "1.10.0" - stream_channel: - dependency: transitive - description: - name: stream_channel - url: "https://pub.dartlang.org" - source: hosted - version: "2.1.0" - string_scanner: - dependency: transitive - description: - name: string_scanner - url: "https://pub.dartlang.org" - source: hosted - version: "1.1.0" - term_glyph: - dependency: transitive - description: - name: term_glyph - url: "https://pub.dartlang.org" - source: hosted - version: "1.2.0" - test_api: - dependency: transitive - description: - name: test_api - url: "https://pub.dartlang.org" - source: hosted - version: "0.3.0" - typed_data: - dependency: transitive - description: - name: typed_data - url: "https://pub.dartlang.org" - source: hosted - version: "1.3.0" - vector_math: - dependency: transitive - description: - name: vector_math - url: "https://pub.dartlang.org" - source: hosted - version: "2.1.0" -sdks: - dart: ">=2.12.0 <3.0.0" diff --git a/pubspec.yaml b/pubspec.yaml index 75c4b2f..df8cc6b 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -10,7 +10,6 @@ environment: dependencies: flutter: sdk: flutter - jiffy: ^4.1.0 dev_dependencies: flutter_test: