Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Flutter #179

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions analysis_options.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ analyzer:
# Ignore analyzer hints for updating pubspecs when using Future or
# Stream and not importing dart:async
# Please see https://github.com/flutter/flutter/pull/24528 for details.
sdk_version_async_exported_from_core: ignore

language:
strict-raw-types: true

Expand All @@ -42,7 +42,7 @@ linter:
- always_declare_return_types
- always_put_control_body_on_new_line
# - always_put_required_named_parameters_first # we prefer having parameters in the same order as fields https://github.com/flutter/flutter/issues/10219
- always_require_non_null_named_parameters

- always_specify_types
- annotate_overrides
# - avoid_bool_literals_in_conditional_expressions # not yet tested
Expand Down Expand Up @@ -92,12 +92,12 @@ linter:
- hash_and_equals
- implementation_imports
# - invariant_booleans # too many false positives: https://github.com/dart-lang/linter/issues/811
- iterable_contains_unrelated_type

# - join_return_with_assignment # not yet tested
- library_names
- library_prefixes
# - lines_longer_than_80_chars # not yet tested
- list_remove_unrelated_type

# - literal_only_boolean_expressions # too many false positives: https://github.com/dart-lang/sdk/issues/34181
- no_adjacent_strings_in_list
- no_duplicate_case_values
Expand Down
5 changes: 3 additions & 2 deletions android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@ group 'com.simform.flutter_credit_card'
version '1.0-SNAPSHOT'

buildscript {
ext.kotlin_version = '1.7.10'
ext.kotlin_version = '1.8.10'
repositories {
google()
mavenCentral()
}

dependencies {
classpath 'com.android.tools.build:gradle:7.3.1'
classpath 'com.android.tools.build:gradle:8.1.3'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}
}
Expand All @@ -25,6 +25,7 @@ apply plugin: 'com.android.library'
apply plugin: 'kotlin-android'

android {
namespace "com.simform.flutter_credit_card"
compileSdk 31

compileOptions {
Expand Down
1 change: 1 addition & 0 deletions example/android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ apply plugin: 'kotlin-android'
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"

android {
namespace "com.simform.flutter_credit_card"
compileSdkVersion 31

sourceSets {
Expand Down
8 changes: 4 additions & 4 deletions example/android/build.gradle
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
buildscript {
ext.kotlin_version = '1.7.10'
ext.kotlin_version = '1.8.10'
repositories {
google()
jcenter()
mavenCentral()
}

dependencies {
classpath 'com.android.tools.build:gradle:7.2.2'
classpath 'com.android.tools.build:gradle:8.1.3'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}
}

allprojects {
repositories {
google()
jcenter()
mavenCentral()
}
}

Expand Down
3 changes: 2 additions & 1 deletion example/android/gradle.properties
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
org.gradle.jvmargs=-Xmx1536M
android.enableR8=true
android.useAndroidX=true
android.enableJetifier=true
android.enableJetifier=true
android.suppressUnsupportedCompileSdk=35
2 changes: 1 addition & 1 deletion example/android/gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.4-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.3-all.zip
15 changes: 10 additions & 5 deletions example/lib/main.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import 'package:example/app_colors.dart';
import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:flutter_credit_card/flutter_credit_card.dart';
Expand All @@ -24,7 +25,7 @@ class MySampleState extends State<MySample> {
bool useFloatingAnimation = true;
final OutlineInputBorder border = OutlineInputBorder(
borderSide: BorderSide(
color: Colors.grey.withOpacity(0.7),
color: Colors.grey.withValues(alpha: 0.7),
width: 2.0,
),
);
Expand All @@ -47,7 +48,7 @@ class MySampleState extends State<MySample> {
colorScheme: ColorScheme.fromSeed(
brightness: Brightness.light,
seedColor: Colors.white,
background: Colors.black,
surface: Colors.black,
// Defines colors like cursor color of the text fields.
primary: Colors.black,
),
Expand All @@ -67,7 +68,7 @@ class MySampleState extends State<MySample> {
colorScheme: ColorScheme.fromSeed(
brightness: Brightness.dark,
seedColor: Colors.black,
background: Colors.white,
surface: Colors.white,
// Defines colors like cursor color of the text fields.
primary: Colors.white,
),
Expand Down Expand Up @@ -292,9 +293,13 @@ class MySampleState extends State<MySample> {

void _onValidate() {
if (formKey.currentState?.validate() ?? false) {
print('valid!');
if (kDebugMode) {
print('valid!');
}
} else {
print('invalid!');
if (kDebugMode) {
print('invalid!');
}
}
}

Expand Down
2 changes: 0 additions & 2 deletions lib/flutter_credit_card.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
library flutter_credit_card;

export 'src/credit_card_form.dart';
export 'src/credit_card_widget.dart';
export 'src/floating_animation/floating_config.dart';
Expand Down
8 changes: 4 additions & 4 deletions lib/src/credit_card_widget.dart
Original file line number Diff line number Diff line change
Expand Up @@ -350,10 +350,10 @@ class _CreditCardWidgetState extends State<CreditCardWidget>
// Add one stop for each color. Stops should increase from 0 to 1
stops: const <double>[0.1, 0.4, 0.7, 0.9],
colors: <Color>[
widget.cardBgColor.withOpacity(1),
widget.cardBgColor.withOpacity(0.97),
widget.cardBgColor.withOpacity(0.90),
widget.cardBgColor.withOpacity(0.86),
widget.cardBgColor.withValues(alpha: 1),
widget.cardBgColor.withValues(alpha: 0.97),
widget.cardBgColor.withValues(alpha: 0.90),
widget.cardBgColor.withValues(alpha: 0.86),
],
);
}
Expand Down
6 changes: 3 additions & 3 deletions lib/src/floating_animation/glare_effect_widget.dart
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ class GlareEffectWidget extends StatelessWidget {
final double? glarePosition;

static final List<Color> _glareGradientColors = <Color>[
AppConstants.defaultGlareColor.withOpacity(0.1),
AppConstants.defaultGlareColor.withOpacity(0.07),
AppConstants.defaultGlareColor.withOpacity(0.05),
AppConstants.defaultGlareColor.withValues(alpha: 0.1),
AppConstants.defaultGlareColor.withValues(alpha: 0.07),
AppConstants.defaultGlareColor.withValues(alpha: 0.05),
];

static const List<double> _gradientStop = <double>[0.1, 0.3, 0.6];
Expand Down
6 changes: 3 additions & 3 deletions pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ homepage: https://github.com/simformsolutions/flutter_credit_card
issue_tracker: https://github.com/simformsolutions/flutter_credit_card/issues

environment:
sdk: '>=2.17.0 <4.0.0'
flutter: '>=3.0.0'
sdk: '>=3.3.0 <4.0.0'
flutter: '>=3.3.0'

dependencies:
flutter:
Expand All @@ -18,7 +18,7 @@ dependencies:
dev_dependencies:
flutter_test:
sdk: flutter
flutter_lints: ^2.0.3
flutter_lints: ^5.0.0

flutter:
plugin:
Expand Down