Skip to content

Commit

Permalink
Additional package dependencies removed.
Browse files Browse the repository at this point in the history
  • Loading branch information
ocakliemre committed Sep 9, 2022
1 parent f98e69c commit 52c1cf3
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 168 deletions.
2 changes: 1 addition & 1 deletion example/lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ class MySampleState extends State<MySample> {
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(8.0),
),
primary: const Color(0xff1b447b),
backgroundColor: const Color(0xff1b447b),
),
child: Container(
margin: const EdgeInsets.all(12),
Expand Down
12 changes: 6 additions & 6 deletions lib/credit_card_form.dart
Original file line number Diff line number Diff line change
@@ -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({
Expand Down Expand Up @@ -114,7 +111,7 @@ class _CreditCardFormState extends State<CreditCardForm> {
super.initState();

createCreditCardModel();

_cardNumberController.text = widget.cardNumber;
_expiryDateController.text = widget.expiryDate;
_cardHolderNameController.text = widget.cardHolderName;
Expand Down Expand Up @@ -248,8 +245,11 @@ class _CreditCardFormState extends State<CreditCardForm> {
final List<String> 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 ||
Expand Down
160 changes: 0 additions & 160 deletions pubspec.lock

This file was deleted.

1 change: 0 additions & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ environment:
dependencies:
flutter:
sdk: flutter
jiffy: ^4.1.0

dev_dependencies:
flutter_test:
Expand Down

0 comments on commit 52c1cf3

Please sign in to comment.