diff --git a/analysis_options.yaml b/analysis_options.yaml index 0de69bcd..5d84dd09 100644 --- a/analysis_options.yaml +++ b/analysis_options.yaml @@ -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 @@ -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 @@ -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 diff --git a/android/build.gradle b/android/build.gradle index 46409379..359fa3d0 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -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" } } @@ -25,6 +25,7 @@ apply plugin: 'com.android.library' apply plugin: 'kotlin-android' android { + namespace "com.simform.flutter_credit_card" compileSdk 31 compileOptions { diff --git a/example/android/app/build.gradle b/example/android/app/build.gradle index c4488639..d979a4f2 100644 --- a/example/android/app/build.gradle +++ b/example/android/app/build.gradle @@ -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 { diff --git a/example/android/build.gradle b/example/android/build.gradle index 9065050a..329bcf48 100644 --- a/example/android/build.gradle +++ b/example/android/build.gradle @@ -1,12 +1,12 @@ 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" } } @@ -14,7 +14,7 @@ buildscript { allprojects { repositories { google() - jcenter() + mavenCentral() } } diff --git a/example/android/gradle.properties b/example/android/gradle.properties index a5965ab8..15434851 100644 --- a/example/android/gradle.properties +++ b/example/android/gradle.properties @@ -1,4 +1,5 @@ org.gradle.jvmargs=-Xmx1536M android.enableR8=true android.useAndroidX=true -android.enableJetifier=true \ No newline at end of file +android.enableJetifier=true +android.suppressUnsupportedCompileSdk=35 \ No newline at end of file diff --git a/example/android/gradle/wrapper/gradle-wrapper.properties b/example/android/gradle/wrapper/gradle-wrapper.properties index cc5527d7..e6b38c2d 100644 --- a/example/android/gradle/wrapper/gradle-wrapper.properties +++ b/example/android/gradle/wrapper/gradle-wrapper.properties @@ -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 diff --git a/example/lib/main.dart b/example/lib/main.dart index ba6c502d..639ca5dd 100644 --- a/example/lib/main.dart +++ b/example/lib/main.dart @@ -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'; @@ -24,7 +25,7 @@ class MySampleState extends State { 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, ), ); @@ -47,7 +48,7 @@ class MySampleState extends State { 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, ), @@ -67,7 +68,7 @@ class MySampleState extends State { 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, ), @@ -292,9 +293,13 @@ class MySampleState extends State { void _onValidate() { if (formKey.currentState?.validate() ?? false) { - print('valid!'); + if (kDebugMode) { + print('valid!'); + } } else { - print('invalid!'); + if (kDebugMode) { + print('invalid!'); + } } } diff --git a/lib/flutter_credit_card.dart b/lib/flutter_credit_card.dart index 24d1d845..e50f8934 100644 --- a/lib/flutter_credit_card.dart +++ b/lib/flutter_credit_card.dart @@ -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'; diff --git a/lib/src/credit_card_widget.dart b/lib/src/credit_card_widget.dart index f5083c16..8d5e9e37 100644 --- a/lib/src/credit_card_widget.dart +++ b/lib/src/credit_card_widget.dart @@ -350,10 +350,10 @@ class _CreditCardWidgetState extends State // Add one stop for each color. Stops should increase from 0 to 1 stops: const [0.1, 0.4, 0.7, 0.9], colors: [ - 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), ], ); } diff --git a/lib/src/floating_animation/glare_effect_widget.dart b/lib/src/floating_animation/glare_effect_widget.dart index c2390052..b150d0af 100644 --- a/lib/src/floating_animation/glare_effect_widget.dart +++ b/lib/src/floating_animation/glare_effect_widget.dart @@ -15,9 +15,9 @@ class GlareEffectWidget extends StatelessWidget { final double? glarePosition; static final List _glareGradientColors = [ - 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 _gradientStop = [0.1, 0.3, 0.6]; diff --git a/pubspec.yaml b/pubspec.yaml index cea84df9..f8659947 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -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: @@ -18,7 +18,7 @@ dependencies: dev_dependencies: flutter_test: sdk: flutter - flutter_lints: ^2.0.3 + flutter_lints: ^5.0.0 flutter: plugin: