From e8a34fa35ccbac8662067da2dc3ead84306d6e14 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicola=CC=81s=20Lantean?= Date: Mon, 21 Jul 2025 16:02:15 -0300 Subject: [PATCH 01/13] chore: update Flutter to 3.32.0 --- .fvmrc | 3 +- android/app/build.gradle | 24 +-- android/build.gradle | 13 -- android/gradle.properties | 2 +- .../gradle/wrapper/gradle-wrapper.properties | 2 +- android/settings.gradle | 30 ++- .../design_system_gallery/pubspec.lock | 80 +++---- design_system/lib/theme/app_theme.dart | 2 +- lib/l10n/app_localizations.dart | 199 ++++++++++++++++++ lib/l10n/app_localizations_en.dart | 49 +++++ lib/ui/extensions/context_extensions.dart | 2 +- lib/ui/main/main_screen.dart | 2 +- lib/ui/resources.dart | 2 +- lib/ui/welcome/welcome_screen.dart | 8 +- pubspec.lock | 178 ++++++++++------ pubspec.yaml | 8 +- 16 files changed, 453 insertions(+), 151 deletions(-) create mode 100644 lib/l10n/app_localizations.dart create mode 100644 lib/l10n/app_localizations_en.dart diff --git a/.fvmrc b/.fvmrc index 4efffa7b..eb1057a7 100644 --- a/.fvmrc +++ b/.fvmrc @@ -1,3 +1,4 @@ { - "flutter": "3.22.1" + "flutter": "3.32.0", + "flavors": {} } \ No newline at end of file diff --git a/android/app/build.gradle b/android/app/build.gradle index d1e126ba..6ed7609f 100644 --- a/android/app/build.gradle +++ b/android/app/build.gradle @@ -1,4 +1,8 @@ -apply from: rootProject.file('read_properties.gradle') +plugins { + id "com.android.application" + id "kotlin-android" + id "dev.flutter.flutter-gradle-plugin" +} def localProperties = new Properties() def localPropertiesFile = rootProject.file('local.properties') @@ -8,11 +12,6 @@ if (localPropertiesFile.exists()) { } } -def flutterRoot = localProperties.getProperty('flutter.sdk') -if (flutterRoot == null) { - throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.") -} - def flutterVersionCode = localProperties.getProperty('flutter.versionCode') if (flutterVersionCode == null) { flutterVersionCode = '1' @@ -23,11 +22,10 @@ if (flutterVersionName == null) { flutterVersionName = '1.0' } -apply plugin: 'com.android.application' -apply plugin: 'kotlin-android' -apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle" +apply from: rootProject.file('read_properties.gradle') android { + namespace "com.xmartlabs.flutter_template" // ----- BEGIN flavorDimensions (autogenerated by flutter_flavorizr) ----- flavorDimensions "flavor-type" @@ -52,7 +50,7 @@ android { // ----- END flavorDimensions (autogenerated by flutter_flavorizr) ----- - compileSdkVersion 33 + compileSdk 36 compileOptions { sourceCompatibility JavaVersion.VERSION_1_8 @@ -70,7 +68,7 @@ android { // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html). applicationId "com.xmartlabs.flutter_template" minSdkVersion 21 - targetSdkVersion 33 + targetSdkVersion 36 versionCode flutterVersionCode.toInteger() versionName flutterVersionName } @@ -97,7 +95,3 @@ android { flutter { source '../..' } - -dependencies { - implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" -} diff --git a/android/build.gradle b/android/build.gradle index c3b1e6bc..b42eb3a7 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -1,16 +1,3 @@ -buildscript { - ext.kotlin_version = '1.6.10' - repositories { - google() - mavenCentral() - } - - dependencies { - classpath "com.android.tools.build:gradle:7.1.3" - classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" - } -} - allprojects { repositories { google() diff --git a/android/gradle.properties b/android/gradle.properties index 94adc3a3..bee0af88 100644 --- a/android/gradle.properties +++ b/android/gradle.properties @@ -1,3 +1,3 @@ -org.gradle.jvmargs=-Xmx1536M +org.gradle.jvmargs=-Xmx4g android.useAndroidX=true android.enableJetifier=true diff --git a/android/gradle/wrapper/gradle-wrapper.properties b/android/gradle/wrapper/gradle-wrapper.properties index b776d4b5..9162f100 100644 --- a/android/gradle/wrapper/gradle-wrapper.properties +++ b/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.2-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.11.1-all.zip diff --git a/android/settings.gradle b/android/settings.gradle index 44e62bcf..48aaf463 100644 --- a/android/settings.gradle +++ b/android/settings.gradle @@ -1,11 +1,25 @@ -include ':app' +pluginManagement { + def flutterSdkPath = { + def properties = new Properties() + file("local.properties").withInputStream { properties.load(it) } + def flutterSdkPath = properties.getProperty("flutter.sdk") + assert flutterSdkPath != null, "flutter.sdk not set in local.properties" + return flutterSdkPath + }() -def localPropertiesFile = new File(rootProject.projectDir, "local.properties") -def properties = new Properties() + includeBuild("$flutterSdkPath/packages/flutter_tools/gradle") -assert localPropertiesFile.exists() -localPropertiesFile.withReader("UTF-8") { reader -> properties.load(reader) } + repositories { + google() + mavenCentral() + gradlePluginPortal() + } +} -def flutterSdkPath = properties.getProperty("flutter.sdk") -assert flutterSdkPath != null, "flutter.sdk not set in local.properties" -apply from: "$flutterSdkPath/packages/flutter_tools/gradle/app_plugin_loader.gradle" +plugins { + id "dev.flutter.flutter-plugin-loader" version "1.0.0" + id "com.android.application" version "8.9.2" apply false + id "org.jetbrains.kotlin.android" version "1.8.21" apply false +} + +include ":app" diff --git a/design_system/design_system_gallery/pubspec.lock b/design_system/design_system_gallery/pubspec.lock index e8fd2e4f..0d61b7cc 100644 --- a/design_system/design_system_gallery/pubspec.lock +++ b/design_system/design_system_gallery/pubspec.lock @@ -37,10 +37,10 @@ packages: dependency: transitive description: name: async - sha256: "947bfcf187f74dbc5e146c9eb9c0f10c9f8b30743e341481c1e2ed3ecc18c20c" + sha256: "758e6d74e971c3e5aceb4110bfd6698efc7f501675bcfe0c775459a8140750eb" url: "https://pub.dev" source: hosted - version: "2.11.0" + version: "2.13.0" auto_route: dependency: "direct main" description: @@ -61,10 +61,10 @@ packages: dependency: transitive description: name: boolean_selector - sha256: "6cfb5af12253eaf2b368f07bacc5a80d1301a071c73360d746b7f2e32d762c66" + sha256: "8aab1771e1243a5063b8b0ff68042d67334e3feab9e95b9490f9a6ebf73b42ea" url: "https://pub.dev" source: hosted - version: "2.1.1" + version: "2.1.2" build: dependency: transitive description: @@ -133,10 +133,10 @@ packages: dependency: transitive description: name: characters - sha256: "04a925763edad70e8443c99234dc3328f442e811f1d8fd1a72f1c8ad0f69a605" + sha256: f71061c654a3380576a52b451dd5532377954cf9dbd272a78fc8479606670803 url: "https://pub.dev" source: hosted - version: "1.3.0" + version: "1.4.0" checked_yaml: dependency: transitive description: @@ -157,10 +157,10 @@ packages: dependency: transitive description: name: clock - sha256: cb6d7f03e1de671e34607e909a7213e31d7752be4fb66a86d29fe1eb14bfb5cf + sha256: fddb70d9b5277016c77a80201021d40a2247104d9f4aa7bab7157b7e3f05b84b url: "https://pub.dev" source: hosted - version: "1.1.1" + version: "1.1.2" code_builder: dependency: transitive description: @@ -173,10 +173,10 @@ packages: dependency: transitive description: name: collection - sha256: ee67cb0715911d28db6bf4af1026078bd6f0128b07a5f66fb2ed94ec6783c09a + sha256: "2f5709ae4d3d59dd8f7cd309b4e023046b57d8a6c82130785d2b0e5868084e76" url: "https://pub.dev" source: hosted - version: "1.18.0" + version: "1.19.1" color: dependency: transitive description: @@ -236,10 +236,10 @@ packages: dependency: transitive description: name: fake_async - sha256: "511392330127add0b769b75a987850d136345d9227c6b94c96a04cf4a391bf78" + sha256: "5368f224a74523e8d2e7399ea1638b37aecfca824a3cc4dfdf77bf1fa905ac44" url: "https://pub.dev" source: hosted - version: "1.3.1" + version: "1.3.3" ffi: dependency: transitive description: @@ -435,18 +435,18 @@ packages: dependency: transitive description: name: leak_tracker - sha256: "7f0df31977cb2c0b88585095d168e689669a2cc9b97c309665e3386f3e9d341a" + sha256: "6bb818ecbdffe216e81182c2f0714a2e62b593f4a4f13098713ff1685dfb6ab0" url: "https://pub.dev" source: hosted - version: "10.0.4" + version: "10.0.9" leak_tracker_flutter_testing: dependency: transitive description: name: leak_tracker_flutter_testing - sha256: "06e98f569d004c1315b991ded39924b21af84cf14cc94791b8aea337d25b57f8" + sha256: f8b613e7e6a13ec79cfdc0e97638fddb3ab848452eff057653abd3edba760573 url: "https://pub.dev" source: hosted - version: "3.0.3" + version: "3.0.9" leak_tracker_testing: dependency: transitive description: @@ -475,10 +475,10 @@ packages: dependency: transitive description: name: matcher - sha256: d2323aa2060500f906aa31a895b4030b6da3ebdcc5619d14ce1aada65cd161cb + sha256: dc58c723c3c24bf8d3e2d3ad3f2f9d7bd9cf43ec6feaa64181775e60190153f2 url: "https://pub.dev" source: hosted - version: "0.12.16+1" + version: "0.12.17" material_color_generator: dependency: "direct main" description: @@ -491,18 +491,18 @@ packages: dependency: transitive description: name: material_color_utilities - sha256: "0e0a020085b65b6083975e499759762399b4475f766c21668c4ecca34ea74e5a" + sha256: f7142bb1154231d7ea5f96bc7bde4bda2a0945d2806bb11670e30b850d56bdec url: "https://pub.dev" source: hosted - version: "0.8.0" + version: "0.11.1" meta: dependency: transitive description: name: meta - sha256: "7687075e408b093f36e6bbf6c91878cc0d4cd10f409506f7bc996f68220b9136" + sha256: e3641ec5d63ebf0d9b41bd43201a66e3fc79a65db5f61fc181f04cd27aab950c url: "https://pub.dev" source: hosted - version: "1.12.0" + version: "1.16.0" mime: dependency: transitive description: @@ -523,10 +523,10 @@ packages: dependency: transitive description: name: path - sha256: "087ce49c3f0dc39180befefc60fdb4acd8f8620e5682fe2476afd0b3688bb4af" + sha256: "75cca69d1490965be98c73ceaea117e8a04dd21217b37b292c9ddbec0d955bc5" url: "https://pub.dev" source: hosted - version: "1.9.0" + version: "1.9.1" path_provider: dependency: transitive description: @@ -651,7 +651,7 @@ packages: dependency: transitive description: flutter source: sdk - version: "0.0.99" + version: "0.0.0" source_gen: dependency: transitive description: @@ -664,10 +664,10 @@ packages: dependency: transitive description: name: source_span - sha256: "53e943d4206a5e30df338fd4c6e7a077e02254531b138a15aec3bd143c1a8b3c" + sha256: "254ee5351d6cb365c859e20ee823c3bb479bf4a293c22d17a9f1bf144ce86f7c" url: "https://pub.dev" source: hosted - version: "1.10.0" + version: "1.10.1" sprintf: dependency: transitive description: @@ -680,18 +680,18 @@ packages: dependency: transitive description: name: stack_trace - sha256: "73713990125a6d93122541237550ee3352a2d84baad52d375a4cad2eb9b7ce0b" + sha256: "8b27215b45d22309b5cddda1aa2b19bdfec9df0e765f2de506401c071d38d1b1" url: "https://pub.dev" source: hosted - version: "1.11.1" + version: "1.12.1" stream_channel: dependency: transitive description: name: stream_channel - sha256: ba2aa5d8cc609d96bbb2899c28934f9e1af5cddbd60a827822ea467161eb54e7 + sha256: "969e04c80b8bcdf826f8f16579c7b14d780458bd97f56d107d3950fdbeef059d" url: "https://pub.dev" source: hosted - version: "2.1.2" + version: "2.1.4" stream_transform: dependency: transitive description: @@ -704,26 +704,26 @@ packages: dependency: transitive description: name: string_scanner - sha256: "556692adab6cfa87322a115640c11f13cb77b3f076ddcc5d6ae3c20242bedcde" + sha256: "921cd31725b72fe181906c6a94d987c78e3b98c2e205b397ea399d4054872b43" url: "https://pub.dev" source: hosted - version: "1.2.0" + version: "1.4.1" term_glyph: dependency: transitive description: name: term_glyph - sha256: a29248a84fbb7c79282b40b8c72a1209db169a2e0542bce341da992fe1bc7e84 + sha256: "7f554798625ea768a7518313e58f83891c7f5024f88e46e7182a4558850a4b8e" url: "https://pub.dev" source: hosted - version: "1.2.1" + version: "1.2.2" test_api: dependency: transitive description: name: test_api - sha256: "9955ae474176f7ac8ee4e989dadfb411a58c30415bcfb648fa04b2b8a03afa7f" + sha256: fb31f383e2ee25fbbfe06b40fe21e1e458d14080e3c67e7ba0acfde4df4e0bbd url: "https://pub.dev" source: hosted - version: "0.7.0" + version: "0.7.4" time: dependency: transitive description: @@ -768,10 +768,10 @@ packages: dependency: transitive description: name: vm_service - sha256: "3923c89304b715fb1eb6423f017651664a03bf5f4b29983627c4da791f74a4ec" + sha256: ddfa8d30d89985b96407efce8acbdd124701f96741f2d981ca860662f1c0dc02 url: "https://pub.dev" source: hosted - version: "14.2.1" + version: "15.0.0" watcher: dependency: transitive description: @@ -821,5 +821,5 @@ packages: source: hosted version: "3.1.2" sdks: - dart: ">=3.3.0 <4.0.0" + dart: ">=3.7.0-0 <4.0.0" flutter: ">=3.22.1" diff --git a/design_system/lib/theme/app_theme.dart b/design_system/lib/theme/app_theme.dart index 4b06a302..099e2a0c 100644 --- a/design_system/lib/theme/app_theme.dart +++ b/design_system/lib/theme/app_theme.dart @@ -37,7 +37,7 @@ class AppTheme { .semibold(), contentTextStyle: textTheme.bodyMedium ?.copyWith(color: customColors.textColor!.getShade(400)), - ), + ).data, inputDecorationTheme: InputDecorationTheme( labelStyle: textTheme.bodyMedium ?.copyWith(color: customColors.textColor!.getShade(400)), diff --git a/lib/l10n/app_localizations.dart b/lib/l10n/app_localizations.dart new file mode 100644 index 00000000..1ecc1f14 --- /dev/null +++ b/lib/l10n/app_localizations.dart @@ -0,0 +1,199 @@ +import 'dart:async'; + +import 'package:flutter/foundation.dart'; +import 'package:flutter/widgets.dart'; +import 'package:flutter_localizations/flutter_localizations.dart'; +import 'package:intl/intl.dart' as intl; + +import 'app_localizations_en.dart'; + +// ignore_for_file: type=lint + +/// Callers can lookup localized strings with an instance of AppLocalizations +/// returned by `AppLocalizations.of(context)`. +/// +/// Applications need to include `AppLocalizations.delegate()` in their app's +/// `localizationDelegates` list, and the locales they support in the app's +/// `supportedLocales` list. For example: +/// +/// ```dart +/// import 'l10n/app_localizations.dart'; +/// +/// return MaterialApp( +/// localizationsDelegates: AppLocalizations.localizationsDelegates, +/// supportedLocales: AppLocalizations.supportedLocales, +/// home: MyApplicationHome(), +/// ); +/// ``` +/// +/// ## Update pubspec.yaml +/// +/// Please make sure to update your pubspec.yaml to include the following +/// packages: +/// +/// ```yaml +/// dependencies: +/// # Internationalization support. +/// flutter_localizations: +/// sdk: flutter +/// intl: any # Use the pinned version from flutter_localizations +/// +/// # Rest of dependencies +/// ``` +/// +/// ## iOS Applications +/// +/// iOS applications define key application metadata, including supported +/// locales, in an Info.plist file that is built into the application bundle. +/// To configure the locales supported by your app, you’ll need to edit this +/// file. +/// +/// First, open your project’s ios/Runner.xcworkspace Xcode workspace file. +/// Then, in the Project Navigator, open the Info.plist file under the Runner +/// project’s Runner folder. +/// +/// Next, select the Information Property List item, select Add Item from the +/// Editor menu, then select Localizations from the pop-up menu. +/// +/// Select and expand the newly-created Localizations item then, for each +/// locale your application supports, add a new item and select the locale +/// you wish to add from the pop-up menu in the Value field. This list should +/// be consistent with the languages listed in the AppLocalizations.supportedLocales +/// property. +abstract class AppLocalizations { + AppLocalizations(String locale) + : localeName = intl.Intl.canonicalizedLocale(locale.toString()); + + final String localeName; + + static AppLocalizations? of(BuildContext context) { + return Localizations.of(context, AppLocalizations); + } + + static const LocalizationsDelegate delegate = + _AppLocalizationsDelegate(); + + /// A list of this localizations delegate along with the default localizations + /// delegates. + /// + /// Returns a list of localizations delegates containing this delegate along with + /// GlobalMaterialLocalizations.delegate, GlobalCupertinoLocalizations.delegate, + /// and GlobalWidgetsLocalizations.delegate. + /// + /// Additional delegates can be added by appending to this list in + /// MaterialApp. This list does not have to be used at all if a custom list + /// of delegates is preferred or required. + static const List> localizationsDelegates = + >[ + delegate, + GlobalMaterialLocalizations.delegate, + GlobalCupertinoLocalizations.delegate, + GlobalWidgetsLocalizations.delegate, + ]; + + /// A list of this localizations delegate's supported locales. + static const List supportedLocales = [Locale('en')]; + + /// Gives the user an error explanation + /// + /// In en, this message translates to: + /// **'Error: {text}'** + String error(String text); + + /// No description provided for @error_button_ok. + /// + /// In en, this message translates to: + /// **'Ok'** + String get error_button_ok; + + /// No description provided for @error_button_retry. + /// + /// In en, this message translates to: + /// **'Retry'** + String get error_button_retry; + + /// No description provided for @error_no_internet_connection_error_description. + /// + /// In en, this message translates to: + /// **'You have no internet connection'** + String get error_no_internet_connection_error_description; + + /// No description provided for @error_no_internet_connection_error_title. + /// + /// In en, this message translates to: + /// **'Error'** + String get error_no_internet_connection_error_title; + + /// No description provided for @error_unknown_error_description. + /// + /// In en, this message translates to: + /// **'Something went wrong!'** + String get error_unknown_error_description; + + /// No description provided for @error_unknown_error_title. + /// + /// In en, this message translates to: + /// **'Ops!'** + String get error_unknown_error_title; + + /// No description provided for @log_out. + /// + /// In en, this message translates to: + /// **'Log out'** + String get log_out; + + /// No description provided for @mail. + /// + /// In en, this message translates to: + /// **'Mail'** + String get mail; + + /// No description provided for @password. + /// + /// In en, this message translates to: + /// **'Password'** + String get password; + + /// No description provided for @sign_in. + /// + /// In en, this message translates to: + /// **'Sign In'** + String get sign_in; + + /// No description provided for @xmartlabs_projects. + /// + /// In en, this message translates to: + /// **'Xmartlabs\' projects'** + String get xmartlabs_projects; +} + +class _AppLocalizationsDelegate + extends LocalizationsDelegate { + const _AppLocalizationsDelegate(); + + @override + Future load(Locale locale) { + return SynchronousFuture(lookupAppLocalizations(locale)); + } + + @override + bool isSupported(Locale locale) => + ['en'].contains(locale.languageCode); + + @override + bool shouldReload(_AppLocalizationsDelegate old) => false; +} + +AppLocalizations lookupAppLocalizations(Locale locale) { + // Lookup logic when only language code is specified. + switch (locale.languageCode) { + case 'en': + return AppLocalizationsEn(); + } + + throw FlutterError( + 'AppLocalizations.delegate failed to load unsupported locale "$locale". This is likely ' + 'an issue with the localizations generation tool. Please file an issue ' + 'on GitHub with a reproducible sample app and the gen-l10n configuration ' + 'that was used.'); +} diff --git a/lib/l10n/app_localizations_en.dart b/lib/l10n/app_localizations_en.dart new file mode 100644 index 00000000..6a32ff9f --- /dev/null +++ b/lib/l10n/app_localizations_en.dart @@ -0,0 +1,49 @@ +// ignore: unused_import +import 'package:intl/intl.dart' as intl; +import 'app_localizations.dart'; + +// ignore_for_file: type=lint + +/// The translations for English (`en`). +class AppLocalizationsEn extends AppLocalizations { + AppLocalizationsEn([String locale = 'en']) : super(locale); + + @override + String error(String text) { + return 'Error: $text'; + } + + @override + String get error_button_ok => 'Ok'; + + @override + String get error_button_retry => 'Retry'; + + @override + String get error_no_internet_connection_error_description => + 'You have no internet connection'; + + @override + String get error_no_internet_connection_error_title => 'Error'; + + @override + String get error_unknown_error_description => 'Something went wrong!'; + + @override + String get error_unknown_error_title => 'Ops!'; + + @override + String get log_out => 'Log out'; + + @override + String get mail => 'Mail'; + + @override + String get password => 'Password'; + + @override + String get sign_in => 'Sign In'; + + @override + String get xmartlabs_projects => 'Xmartlabs\' projects'; +} diff --git a/lib/ui/extensions/context_extensions.dart b/lib/ui/extensions/context_extensions.dart index cd2b33d4..e34c9b7c 100644 --- a/lib/ui/extensions/context_extensions.dart +++ b/lib/ui/extensions/context_extensions.dart @@ -1,5 +1,5 @@ import 'package:flutter/material.dart'; -import 'package:flutter_gen/gen_l10n/app_localizations.dart'; +import 'package:flutter_template/l10n/app_localizations.dart'; extension ContextExtensions on BuildContext { AppLocalizations get localizations => AppLocalizations.of(this)!; diff --git a/lib/ui/main/main_screen.dart b/lib/ui/main/main_screen.dart index 6b6b5579..f374a331 100644 --- a/lib/ui/main/main_screen.dart +++ b/lib/ui/main/main_screen.dart @@ -1,8 +1,8 @@ import 'package:design_system/theme/app_theme.dart'; import 'package:flutter/material.dart'; -import 'package:flutter_gen/gen_l10n/app_localizations.dart'; import 'package:flutter_localizations/flutter_localizations.dart'; import 'package:flutter_template/core/di/di_provider.dart'; +import 'package:flutter_template/l10n/app_localizations.dart'; import 'package:flutter_template/ui/resources.dart'; import 'package:flutter_template/ui/router/app_router.dart'; diff --git a/lib/ui/resources.dart b/lib/ui/resources.dart index 8e208016..ce299efa 100644 --- a/lib/ui/resources.dart +++ b/lib/ui/resources.dart @@ -1,5 +1,5 @@ import 'package:flutter/material.dart'; -import 'package:flutter_gen/gen_l10n/app_localizations.dart'; +import 'package:flutter_template/l10n/app_localizations.dart'; import 'package:flutter_template/ui/extensions/context_extensions.dart'; abstract class Resources { diff --git a/lib/ui/welcome/welcome_screen.dart b/lib/ui/welcome/welcome_screen.dart index 3862482a..6b602b19 100644 --- a/lib/ui/welcome/welcome_screen.dart +++ b/lib/ui/welcome/welcome_screen.dart @@ -6,7 +6,7 @@ import 'package:flutter_template/core/model/project.dart'; import 'package:flutter_template/ui/extensions/context_extensions.dart'; import 'package:flutter_template/ui/section/error_handler/global_event_handler_cubit.dart'; import 'package:flutter_template/ui/welcome/welcome_cubit.dart'; -import 'package:flutter_web_browser/flutter_web_browser.dart'; +import 'package:url_launcher/url_launcher.dart'; @RoutePage() class WelcomeScreen extends StatelessWidget { @@ -62,14 +62,16 @@ class _WelcomeContentScreen extends StatelessWidget { class _ProjectWidget extends StatelessWidget { const _ProjectWidget({ required this.project, - super.key, }); final Project project; @override Widget build(BuildContext context) => GestureDetector( - onTap: () => FlutterWebBrowser.openWebPage(url: project.url), + onTap: () async { + final uri = Uri.parse(project.url); + await launchUrl(uri); + }, child: Card( child: Column( children: [ diff --git a/pubspec.lock b/pubspec.lock index ce3fd26e..98aa55d3 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -53,10 +53,10 @@ packages: dependency: transitive description: name: async - sha256: "947bfcf187f74dbc5e146c9eb9c0f10c9f8b30743e341481c1e2ed3ecc18c20c" + sha256: "758e6d74e971c3e5aceb4110bfd6698efc7f501675bcfe0c775459a8140750eb" url: "https://pub.dev" source: hosted - version: "2.11.0" + version: "2.13.0" auto_route: dependency: "direct main" description: @@ -93,10 +93,10 @@ packages: dependency: transitive description: name: boolean_selector - sha256: "6cfb5af12253eaf2b368f07bacc5a80d1301a071c73360d746b7f2e32d762c66" + sha256: "8aab1771e1243a5063b8b0ff68042d67334e3feab9e95b9490f9a6ebf73b42ea" url: "https://pub.dev" source: hosted - version: "2.1.1" + version: "2.1.2" build: dependency: transitive description: @@ -165,10 +165,10 @@ packages: dependency: transitive description: name: characters - sha256: "04a925763edad70e8443c99234dc3328f442e811f1d8fd1a72f1c8ad0f69a605" + sha256: f71061c654a3380576a52b451dd5532377954cf9dbd272a78fc8479606670803 url: "https://pub.dev" source: hosted - version: "1.3.0" + version: "1.4.0" checked_yaml: dependency: transitive description: @@ -197,10 +197,10 @@ packages: dependency: transitive description: name: clock - sha256: cb6d7f03e1de671e34607e909a7213e31d7752be4fb66a86d29fe1eb14bfb5cf + sha256: fddb70d9b5277016c77a80201021d40a2247104d9f4aa7bab7157b7e3f05b84b url: "https://pub.dev" source: hosted - version: "1.1.1" + version: "1.1.2" code_builder: dependency: transitive description: @@ -213,10 +213,10 @@ packages: dependency: transitive description: name: collection - sha256: ee67cb0715911d28db6bf4af1026078bd6f0128b07a5f66fb2ed94ec6783c09a + sha256: "2f5709ae4d3d59dd8f7cd309b4e023046b57d8a6c82130785d2b0e5868084e76" url: "https://pub.dev" source: hosted - version: "1.18.0" + version: "1.19.1" color: dependency: transitive description: @@ -324,10 +324,10 @@ packages: dependency: transitive description: name: fake_async - sha256: "511392330127add0b769b75a987850d136345d9227c6b94c96a04cf4a391bf78" + sha256: "5368f224a74523e8d2e7399ea1638b37aecfca824a3cc4dfdf77bf1fa905ac44" url: "https://pub.dev" source: hosted - version: "1.3.1" + version: "1.3.3" ffi: dependency: transitive description: @@ -492,14 +492,6 @@ packages: description: flutter source: sdk version: "0.0.0" - flutter_web_browser: - dependency: "direct main" - description: - name: flutter_web_browser - sha256: a5564b736253f745e147b8c4eff86de436324d081974cc1f16bff881134a400f - url: "https://pub.dev" - source: hosted - version: "0.17.1" flutter_web_plugins: dependency: transitive description: flutter @@ -639,10 +631,10 @@ packages: dependency: "direct main" description: name: intl - sha256: d6f56758b7d3014a48af9701c085700aac781a92a87a62b1333b46d8879661cf + sha256: "3df61194eb431efc39c4ceba583b95633a403f46c9fd341e550ce0bfa50e9aa5" url: "https://pub.dev" source: hosted - version: "0.19.0" + version: "0.20.2" io: dependency: transitive description: @@ -679,18 +671,18 @@ packages: dependency: transitive description: name: leak_tracker - sha256: "7f0df31977cb2c0b88585095d168e689669a2cc9b97c309665e3386f3e9d341a" + sha256: "6bb818ecbdffe216e81182c2f0714a2e62b593f4a4f13098713ff1685dfb6ab0" url: "https://pub.dev" source: hosted - version: "10.0.4" + version: "10.0.9" leak_tracker_flutter_testing: dependency: transitive description: name: leak_tracker_flutter_testing - sha256: "06e98f569d004c1315b991ded39924b21af84cf14cc94791b8aea337d25b57f8" + sha256: f8b613e7e6a13ec79cfdc0e97638fddb3ab848452eff057653abd3edba760573 url: "https://pub.dev" source: hosted - version: "3.0.3" + version: "3.0.9" leak_tracker_testing: dependency: transitive description: @@ -727,10 +719,10 @@ packages: dependency: transitive description: name: matcher - sha256: d2323aa2060500f906aa31a895b4030b6da3ebdcc5619d14ce1aada65cd161cb + sha256: dc58c723c3c24bf8d3e2d3ad3f2f9d7bd9cf43ec6feaa64181775e60190153f2 url: "https://pub.dev" source: hosted - version: "0.12.16+1" + version: "0.12.17" material_color_generator: dependency: "direct main" description: @@ -743,18 +735,18 @@ packages: dependency: transitive description: name: material_color_utilities - sha256: "0e0a020085b65b6083975e499759762399b4475f766c21668c4ecca34ea74e5a" + sha256: f7142bb1154231d7ea5f96bc7bde4bda2a0945d2806bb11670e30b850d56bdec url: "https://pub.dev" source: hosted - version: "0.8.0" + version: "0.11.1" meta: dependency: transitive description: name: meta - sha256: "7687075e408b093f36e6bbf6c91878cc0d4cd10f409506f7bc996f68220b9136" + sha256: e3641ec5d63ebf0d9b41bd43201a66e3fc79a65db5f61fc181f04cd27aab950c url: "https://pub.dev" source: hosted - version: "1.12.0" + version: "1.16.0" mime: dependency: transitive description: @@ -807,10 +799,10 @@ packages: dependency: transitive description: name: path - sha256: "087ce49c3f0dc39180befefc60fdb4acd8f8620e5682fe2476afd0b3688bb4af" + sha256: "75cca69d1490965be98c73ceaea117e8a04dd21217b37b292c9ddbec0d955bc5" url: "https://pub.dev" source: hosted - version: "1.9.0" + version: "1.9.1" path_parsing: dependency: transitive description: @@ -879,10 +871,10 @@ packages: dependency: transitive description: name: platform - sha256: "12220bb4b65720483f8fa9450b4332347737cf8213dd2840d8b2c823e47243ec" + sha256: "5d6b1b0036a5f331ebc77c850ebc8506cbc1e9416c27e59b439f917a902a4984" url: "https://pub.dev" source: hosted - version: "3.1.4" + version: "3.1.6" plugin_platform_interface: dependency: "direct dev" description: @@ -903,10 +895,10 @@ packages: dependency: transitive description: name: process - sha256: "21e54fd2faf1b5bdd5102afd25012184a6793927648ea81eea80552ac9405b32" + sha256: "107d8be718f120bbba9dcd1e95e3bd325b1b4a4f07db64154635ba03f2567a0d" url: "https://pub.dev" source: hosted - version: "5.0.2" + version: "5.0.3" provider: dependency: transitive description: @@ -1039,7 +1031,7 @@ packages: dependency: transitive description: flutter source: sdk - version: "0.0.99" + version: "0.0.0" source_gen: dependency: transitive description: @@ -1076,10 +1068,10 @@ packages: dependency: transitive description: name: source_span - sha256: "53e943d4206a5e30df338fd4c6e7a077e02254531b138a15aec3bd143c1a8b3c" + sha256: "254ee5351d6cb365c859e20ee823c3bb479bf4a293c22d17a9f1bf144ce86f7c" url: "https://pub.dev" source: hosted - version: "1.10.0" + version: "1.10.1" sprintf: dependency: transitive description: @@ -1108,10 +1100,10 @@ packages: dependency: "direct main" description: name: stack_trace - sha256: "73713990125a6d93122541237550ee3352a2d84baad52d375a4cad2eb9b7ce0b" + sha256: "8b27215b45d22309b5cddda1aa2b19bdfec9df0e765f2de506401c071d38d1b1" url: "https://pub.dev" source: hosted - version: "1.11.1" + version: "1.12.1" stock: dependency: "direct main" description: @@ -1124,10 +1116,10 @@ packages: dependency: transitive description: name: stream_channel - sha256: ba2aa5d8cc609d96bbb2899c28934f9e1af5cddbd60a827822ea467161eb54e7 + sha256: "969e04c80b8bcdf826f8f16579c7b14d780458bd97f56d107d3950fdbeef059d" url: "https://pub.dev" source: hosted - version: "2.1.2" + version: "2.1.4" stream_transform: dependency: transitive description: @@ -1140,10 +1132,10 @@ packages: dependency: transitive description: name: string_scanner - sha256: "556692adab6cfa87322a115640c11f13cb77b3f076ddcc5d6ae3c20242bedcde" + sha256: "921cd31725b72fe181906c6a94d987c78e3b98c2e205b397ea399d4054872b43" url: "https://pub.dev" source: hosted - version: "1.2.0" + version: "1.4.1" sync_http: dependency: transitive description: @@ -1164,34 +1156,34 @@ packages: dependency: transitive description: name: term_glyph - sha256: a29248a84fbb7c79282b40b8c72a1209db169a2e0542bce341da992fe1bc7e84 + sha256: "7f554798625ea768a7518313e58f83891c7f5024f88e46e7182a4558850a4b8e" url: "https://pub.dev" source: hosted - version: "1.2.1" + version: "1.2.2" test: dependency: transitive description: name: test - sha256: "7ee446762c2c50b3bd4ea96fe13ffac69919352bd3b4b17bac3f3465edc58073" + sha256: "301b213cd241ca982e9ba50266bd3f5bd1ea33f1455554c5abb85d1be0e2d87e" url: "https://pub.dev" source: hosted - version: "1.25.2" + version: "1.25.15" test_api: dependency: transitive description: name: test_api - sha256: "9955ae474176f7ac8ee4e989dadfb411a58c30415bcfb648fa04b2b8a03afa7f" + sha256: fb31f383e2ee25fbbfe06b40fe21e1e458d14080e3c67e7ba0acfde4df4e0bbd url: "https://pub.dev" source: hosted - version: "0.7.0" + version: "0.7.4" test_core: dependency: transitive description: name: test_core - sha256: "2bc4b4ecddd75309300d8096f781c0e3280ca1ef85beda558d33fcbedc2eead4" + sha256: "84d17c3486c8dfdbe5e12a50c8ae176d15e2a771b96909a9442b40173649ccaa" url: "https://pub.dev" source: hosted - version: "0.6.0" + version: "0.6.8" time: dependency: transitive description: @@ -1224,6 +1216,70 @@ packages: url: "https://pub.dev" source: hosted version: "2.2.2" + url_launcher: + dependency: "direct main" + description: + name: url_launcher + sha256: "21b704ce5fa560ea9f3b525b43601c678728ba46725bab9b01187b4831377ed3" + url: "https://pub.dev" + source: hosted + version: "6.3.0" + url_launcher_android: + dependency: transitive + description: + name: url_launcher_android + sha256: "8582d7f6fe14d2652b4c45c9b6c14c0b678c2af2d083a11b604caeba51930d79" + url: "https://pub.dev" + source: hosted + version: "6.3.16" + url_launcher_ios: + dependency: transitive + description: + name: url_launcher_ios + sha256: "7f2022359d4c099eea7df3fdf739f7d3d3b9faf3166fb1dd390775176e0b76cb" + url: "https://pub.dev" + source: hosted + version: "6.3.3" + url_launcher_linux: + dependency: transitive + description: + name: url_launcher_linux + sha256: "4e9ba368772369e3e08f231d2301b4ef72b9ff87c31192ef471b380ef29a4935" + url: "https://pub.dev" + source: hosted + version: "3.2.1" + url_launcher_macos: + dependency: transitive + description: + name: url_launcher_macos + sha256: "17ba2000b847f334f16626a574c702b196723af2a289e7a93ffcb79acff855c2" + url: "https://pub.dev" + source: hosted + version: "3.2.2" + url_launcher_platform_interface: + dependency: transitive + description: + name: url_launcher_platform_interface + sha256: "552f8a1e663569be95a8190206a38187b531910283c3e982193e4f2733f01029" + url: "https://pub.dev" + source: hosted + version: "2.3.2" + url_launcher_web: + dependency: transitive + description: + name: url_launcher_web + sha256: "4bd2b7b4dc4d4d0b94e5babfffbca8eac1a126c7f3d6ecbc1a11013faa3abba2" + url: "https://pub.dev" + source: hosted + version: "2.4.1" + url_launcher_windows: + dependency: transitive + description: + name: url_launcher_windows + sha256: "3284b6d2ac454cf34f114e1d3319866fdd1e19cdc329999057e44ffe936cfa77" + url: "https://pub.dev" + source: hosted + version: "3.1.4" uuid: dependency: transitive description: @@ -1260,10 +1316,10 @@ packages: dependency: transitive description: name: vm_service - sha256: "3923c89304b715fb1eb6423f017651664a03bf5f4b29983627c4da791f74a4ec" + sha256: ddfa8d30d89985b96407efce8acbdd124701f96741f2d981ca860662f1c0dc02 url: "https://pub.dev" source: hosted - version: "14.2.1" + version: "15.0.0" watcher: dependency: transitive description: @@ -1292,10 +1348,10 @@ packages: dependency: transitive description: name: webdriver - sha256: "003d7da9519e1e5f329422b36c4dcdf18d7d2978d1ba099ea4e45ba490ed845e" + sha256: "2f3a14ca026957870cfd9c635b83507e0e51d8091568e90129fbf805aba7cade" url: "https://pub.dev" source: hosted - version: "3.0.3" + version: "3.1.0" webkit_inspection_protocol: dependency: transitive description: @@ -1337,5 +1393,5 @@ packages: source: hosted version: "3.1.3" sdks: - dart: ">=3.4.0 <4.0.0" - flutter: ">=3.22.1" + dart: ">=3.7.0-0 <4.0.0" + flutter: ">=3.32.0" diff --git a/pubspec.yaml b/pubspec.yaml index 17cdc4df..586766e3 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -7,7 +7,7 @@ version: 1.0.0+1 environment: sdk: ">=3.0.0 <4.0.0" - flutter: 3.22.1 + flutter: 3.32.0 dependencies: flutter: @@ -27,18 +27,18 @@ dependencies: flutter_native_splash: 2.4.0 flutter_screenutil: 5.9.3 flutter_secure_storage: 9.2.2 - flutter_web_browser: 0.17.1 # This can be removed + url_launcher: 6.3.0 freezed_annotation: 2.4.1 get_it: 7.7.0 google_fonts: 6.2.1 - intl: 0.19.0 + intl: 0.20.2 json_annotation: 4.9.0 logger: 2.3.0 material_color_generator: 1.1.0 rxdart: 0.27.7 shared_preferences: 2.2.3 sqflite: 2.3.3+1 - stack_trace: 1.11.1 + stack_trace: 1.12.1 stock: 1.1.1 hive: 2.2.3 path_provider: 2.1.3 From 3e81666230cce46b8e9aa1616f787964c1fd7162 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicola=CC=81s=20Lantean?= Date: Tue, 22 Jul 2025 12:22:06 -0300 Subject: [PATCH 02/13] fix: minor changes due to linter errors --- design_system/design_system_gallery/lib/main.dart | 2 +- design_system/lib/extensions/color_extensions.dart | 14 +++++++------- lib/core/common/logger.dart | 2 +- lib/ui/welcome/welcome_screen.dart | 6 ++++-- test/mocks/mock_app.dart | 1 - 5 files changed, 13 insertions(+), 12 deletions(-) diff --git a/design_system/design_system_gallery/lib/main.dart b/design_system/design_system_gallery/lib/main.dart index 0b3d44f7..64dede34 100644 --- a/design_system/design_system_gallery/lib/main.dart +++ b/design_system/design_system_gallery/lib/main.dart @@ -24,7 +24,7 @@ class MyApp extends StatelessWidget { class _GalleryAppContentScreen extends StatelessWidget { final GalleryRouter _router; - const _GalleryAppContentScreen(this._router, {super.key}); + const _GalleryAppContentScreen(this._router); @override Widget build(BuildContext context) => MaterialApp.router( diff --git a/design_system/lib/extensions/color_extensions.dart b/design_system/lib/extensions/color_extensions.dart index 33736b9c..dc2d2dbb 100644 --- a/design_system/lib/extensions/color_extensions.dart +++ b/design_system/lib/extensions/color_extensions.dart @@ -6,7 +6,7 @@ extension ColorExtension on Color { ? (this as MaterialColor)[shade]! : _generateMaterialColor(); - MaterialColor _generateMaterialColor() => MaterialColor(value, { + MaterialColor _generateMaterialColor() => MaterialColor(toARGB32(), { 50: _tintColor(0.9), 100: _tintColor(0.8), 200: _tintColor(0.6), @@ -23,9 +23,9 @@ extension ColorExtension on Color { max(0, min((value + ((255 - value) * factor)).round(), 255)); Color _tintColor(double factor) => Color.fromRGBO( - _tintValue(red, factor), - _tintValue(green, factor), - _tintValue(blue, factor), + _tintValue((r * 255.0).round() & 0xff, factor), + _tintValue((g * 255.0).round() & 0xff, factor), + _tintValue((b * 255.0).round() & 0xff, factor), 1, ); @@ -33,9 +33,9 @@ extension ColorExtension on Color { max(0, min(value - (value * factor).round(), 255)); Color _shadeColor(double factor) => Color.fromRGBO( - _shadeValue(red, factor), - _shadeValue(green, factor), - _shadeValue(blue, factor), + _shadeValue((r * 255.0).round() & 0xff, factor), + _shadeValue((g * 255.0).round() & 0xff, factor), + _shadeValue((b * 255.0).round() & 0xff, factor), 1, ); diff --git a/lib/core/common/logger.dart b/lib/core/common/logger.dart index e58aa122..9415aedd 100644 --- a/lib/core/common/logger.dart +++ b/lib/core/common/logger.dart @@ -94,7 +94,7 @@ class _CrashReportWrappedPrinter extends LogPrinter { } class _PrintableTrace extends Trace { - _PrintableTrace(super.frames, {super.original}); + _PrintableTrace(super.frames); // It's equal to VMTrace.toString() Method. // Firebase use it to generate the stacktrace diff --git a/lib/ui/welcome/welcome_screen.dart b/lib/ui/welcome/welcome_screen.dart index 6b602b19..364c597f 100644 --- a/lib/ui/welcome/welcome_screen.dart +++ b/lib/ui/welcome/welcome_screen.dart @@ -1,3 +1,5 @@ +import 'dart:async'; + import 'package:auto_route/auto_route.dart'; import 'package:design_system/design_system.dart'; import 'package:flutter/material.dart'; @@ -68,9 +70,9 @@ class _ProjectWidget extends StatelessWidget { @override Widget build(BuildContext context) => GestureDetector( - onTap: () async { + onTap: () { final uri = Uri.parse(project.url); - await launchUrl(uri); + unawaited(launchUrl(uri)); }, child: Card( child: Column( diff --git a/test/mocks/mock_app.dart b/test/mocks/mock_app.dart index 777e96df..a34b1db1 100644 --- a/test/mocks/mock_app.dart +++ b/test/mocks/mock_app.dart @@ -20,7 +20,6 @@ class SimpleTesteableApp extends MyApp { final String initialRoute; const SimpleTesteableApp._({ - super.key, this.apiOverrides, this.initialRoute = '/', }) : super(); From 49f96c2720cb46dd3f977dd71b4f27e3dd9b032a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicola=CC=81s=20Lantean?= Date: Wed, 23 Jul 2025 14:37:45 -0300 Subject: [PATCH 03/13] chore: upgrade to 3.32.7 --- .fvmrc | 2 +- lib/l10n/app_localizations.dart | 33 ++++++++++++++++----------------- 2 files changed, 17 insertions(+), 18 deletions(-) diff --git a/.fvmrc b/.fvmrc index eb1057a7..cb8a5fa5 100644 --- a/.fvmrc +++ b/.fvmrc @@ -1,4 +1,4 @@ { - "flutter": "3.32.0", + "flutter": "3.32.7", "flavors": {} } \ No newline at end of file diff --git a/lib/l10n/app_localizations.dart b/lib/l10n/app_localizations.dart index 1ecc1f14..f4971d88 100644 --- a/lib/l10n/app_localizations.dart +++ b/lib/l10n/app_localizations.dart @@ -61,8 +61,7 @@ import 'app_localizations_en.dart'; /// be consistent with the languages listed in the AppLocalizations.supportedLocales /// property. abstract class AppLocalizations { - AppLocalizations(String locale) - : localeName = intl.Intl.canonicalizedLocale(locale.toString()); + AppLocalizations(String locale) : localeName = intl.Intl.canonicalizedLocale(locale.toString()); final String localeName; @@ -70,8 +69,7 @@ abstract class AppLocalizations { return Localizations.of(context, AppLocalizations); } - static const LocalizationsDelegate delegate = - _AppLocalizationsDelegate(); + static const LocalizationsDelegate delegate = _AppLocalizationsDelegate(); /// A list of this localizations delegate along with the default localizations /// delegates. @@ -83,8 +81,7 @@ abstract class AppLocalizations { /// Additional delegates can be added by appending to this list in /// MaterialApp. This list does not have to be used at all if a custom list /// of delegates is preferred or required. - static const List> localizationsDelegates = - >[ + static const List> localizationsDelegates = >[ delegate, GlobalMaterialLocalizations.delegate, GlobalCupertinoLocalizations.delegate, @@ -92,7 +89,9 @@ abstract class AppLocalizations { ]; /// A list of this localizations delegate's supported locales. - static const List supportedLocales = [Locale('en')]; + static const List supportedLocales = [ + Locale('en') + ]; /// Gives the user an error explanation /// @@ -167,8 +166,7 @@ abstract class AppLocalizations { String get xmartlabs_projects; } -class _AppLocalizationsDelegate - extends LocalizationsDelegate { +class _AppLocalizationsDelegate extends LocalizationsDelegate { const _AppLocalizationsDelegate(); @override @@ -177,23 +175,24 @@ class _AppLocalizationsDelegate } @override - bool isSupported(Locale locale) => - ['en'].contains(locale.languageCode); + bool isSupported(Locale locale) => ['en'].contains(locale.languageCode); @override bool shouldReload(_AppLocalizationsDelegate old) => false; } AppLocalizations lookupAppLocalizations(Locale locale) { + + // Lookup logic when only language code is specified. switch (locale.languageCode) { - case 'en': - return AppLocalizationsEn(); + case 'en': return AppLocalizationsEn(); } throw FlutterError( - 'AppLocalizations.delegate failed to load unsupported locale "$locale". This is likely ' - 'an issue with the localizations generation tool. Please file an issue ' - 'on GitHub with a reproducible sample app and the gen-l10n configuration ' - 'that was used.'); + 'AppLocalizations.delegate failed to load unsupported locale "$locale". This is likely ' + 'an issue with the localizations generation tool. Please file an issue ' + 'on GitHub with a reproducible sample app and the gen-l10n configuration ' + 'that was used.' + ); } From fc9b52d3f863ff4b16fcad3429d3df8469a4eca2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicola=CC=81s=20Lantean?= Date: Wed, 23 Jul 2025 14:37:45 -0300 Subject: [PATCH 04/13] chore: upgrade to 3.32.7 --- .fvmrc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.fvmrc b/.fvmrc index eb1057a7..cb8a5fa5 100644 --- a/.fvmrc +++ b/.fvmrc @@ -1,4 +1,4 @@ { - "flutter": "3.32.0", + "flutter": "3.32.7", "flavors": {} } \ No newline at end of file From 3b9ab19f3c572388f9c26656cbf2e7d92b31ff74 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicola=CC=81s=20Lantean?= Date: Wed, 23 Jul 2025 14:49:59 -0300 Subject: [PATCH 05/13] fix: format --- lib/l10n/app_localizations.dart | 33 +++++++++++++++++---------------- 1 file changed, 17 insertions(+), 16 deletions(-) diff --git a/lib/l10n/app_localizations.dart b/lib/l10n/app_localizations.dart index f4971d88..1ecc1f14 100644 --- a/lib/l10n/app_localizations.dart +++ b/lib/l10n/app_localizations.dart @@ -61,7 +61,8 @@ import 'app_localizations_en.dart'; /// be consistent with the languages listed in the AppLocalizations.supportedLocales /// property. abstract class AppLocalizations { - AppLocalizations(String locale) : localeName = intl.Intl.canonicalizedLocale(locale.toString()); + AppLocalizations(String locale) + : localeName = intl.Intl.canonicalizedLocale(locale.toString()); final String localeName; @@ -69,7 +70,8 @@ abstract class AppLocalizations { return Localizations.of(context, AppLocalizations); } - static const LocalizationsDelegate delegate = _AppLocalizationsDelegate(); + static const LocalizationsDelegate delegate = + _AppLocalizationsDelegate(); /// A list of this localizations delegate along with the default localizations /// delegates. @@ -81,7 +83,8 @@ abstract class AppLocalizations { /// Additional delegates can be added by appending to this list in /// MaterialApp. This list does not have to be used at all if a custom list /// of delegates is preferred or required. - static const List> localizationsDelegates = >[ + static const List> localizationsDelegates = + >[ delegate, GlobalMaterialLocalizations.delegate, GlobalCupertinoLocalizations.delegate, @@ -89,9 +92,7 @@ abstract class AppLocalizations { ]; /// A list of this localizations delegate's supported locales. - static const List supportedLocales = [ - Locale('en') - ]; + static const List supportedLocales = [Locale('en')]; /// Gives the user an error explanation /// @@ -166,7 +167,8 @@ abstract class AppLocalizations { String get xmartlabs_projects; } -class _AppLocalizationsDelegate extends LocalizationsDelegate { +class _AppLocalizationsDelegate + extends LocalizationsDelegate { const _AppLocalizationsDelegate(); @override @@ -175,24 +177,23 @@ class _AppLocalizationsDelegate extends LocalizationsDelegate } @override - bool isSupported(Locale locale) => ['en'].contains(locale.languageCode); + bool isSupported(Locale locale) => + ['en'].contains(locale.languageCode); @override bool shouldReload(_AppLocalizationsDelegate old) => false; } AppLocalizations lookupAppLocalizations(Locale locale) { - - // Lookup logic when only language code is specified. switch (locale.languageCode) { - case 'en': return AppLocalizationsEn(); + case 'en': + return AppLocalizationsEn(); } throw FlutterError( - 'AppLocalizations.delegate failed to load unsupported locale "$locale". This is likely ' - 'an issue with the localizations generation tool. Please file an issue ' - 'on GitHub with a reproducible sample app and the gen-l10n configuration ' - 'that was used.' - ); + 'AppLocalizations.delegate failed to load unsupported locale "$locale". This is likely ' + 'an issue with the localizations generation tool. Please file an issue ' + 'on GitHub with a reproducible sample app and the gen-l10n configuration ' + 'that was used.'); } From 858010b384743c3600f7aa77b02ee49bcbf0073a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicola=CC=81s=20Lantean?= Date: Wed, 23 Jul 2025 15:53:13 -0300 Subject: [PATCH 06/13] fix: check diff --- fastlane/Fastfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fastlane/Fastfile b/fastlane/Fastfile index 827f34c2..1ce08d6f 100644 --- a/fastlane/Fastfile +++ b/fastlane/Fastfile @@ -60,7 +60,7 @@ end desc "**Lint: Check code format**" lane :lint_format do # https://github.com/dart-lang/dart_style/issues/864#issuecomment-1092199174 - dart_command(command: "format --set-exit-if-changed lib") + dart_command(command: "format -o show --set-exit-if-changed lib") end desc "**Lint: Check code format**" From 27039f6d6fc3a3b91afb878cdd3ce6c7a10d9f80 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicola=CC=81s=20Lantean?= Date: Wed, 23 Jul 2025 16:02:35 -0300 Subject: [PATCH 07/13] fix: dart format command --- fastlane/Fastfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fastlane/Fastfile b/fastlane/Fastfile index 1ce08d6f..afd34b34 100644 --- a/fastlane/Fastfile +++ b/fastlane/Fastfile @@ -60,7 +60,7 @@ end desc "**Lint: Check code format**" lane :lint_format do # https://github.com/dart-lang/dart_style/issues/864#issuecomment-1092199174 - dart_command(command: "format -o show --set-exit-if-changed lib") + dart_command(command: "format -o none --set-exit-if-changed lib") end desc "**Lint: Check code format**" From 6723c69632376a11556450307f49676196243684 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicola=CC=81s=20Lantean?= Date: Wed, 23 Jul 2025 16:12:31 -0300 Subject: [PATCH 08/13] fix: log diff --- .github/workflows/flutter-ci.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/flutter-ci.yml b/.github/workflows/flutter-ci.yml index 5bd483d2..0a8d0b71 100644 --- a/.github/workflows/flutter-ci.yml +++ b/.github/workflows/flutter-ci.yml @@ -41,6 +41,11 @@ jobs: uses: maierj/fastlane-action@v3.0.0 with: lane: 'fetch_dependencies' + - name: 'Show localizations diff' + run: | + echo "=== Git diff for lib/l10n/app_localizations.dart ===" + git diff lib/l10n/app_localizations.dart || echo "No changes in app_localizations.dart" + echo "=== End of diff ===" - name: 'Run lints' uses: maierj/fastlane-action@v3.0.0 with: From 59ec70897deae849287f1367ba77f03a48fcaad6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicola=CC=81s=20Lantean?= Date: Thu, 24 Jul 2025 11:11:00 -0300 Subject: [PATCH 09/13] fix: add exclude to dart format --- fastlane/Fastfile | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/fastlane/Fastfile b/fastlane/Fastfile index afd34b34..c96d37bd 100644 --- a/fastlane/Fastfile +++ b/fastlane/Fastfile @@ -59,8 +59,7 @@ end desc "**Lint: Check code format**" lane :lint_format do - # https://github.com/dart-lang/dart_style/issues/864#issuecomment-1092199174 - dart_command(command: "format -o none --set-exit-if-changed lib") + sh_on_root(command: "find lib -name '*.dart' ! -path 'lib/l10n/*' -print0 | xargs -0 fvm dart format -o none --set-exit-if-changed") end desc "**Lint: Check code format**" From b4fe0ad7753c4ab11ae5eace787df06aa5f45f90 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicola=CC=81s=20Lantean?= Date: Thu, 24 Jul 2025 11:24:09 -0300 Subject: [PATCH 10/13] fix: remove diff --- .github/workflows/flutter-ci.yml | 5 ----- 1 file changed, 5 deletions(-) diff --git a/.github/workflows/flutter-ci.yml b/.github/workflows/flutter-ci.yml index 0a8d0b71..5bd483d2 100644 --- a/.github/workflows/flutter-ci.yml +++ b/.github/workflows/flutter-ci.yml @@ -41,11 +41,6 @@ jobs: uses: maierj/fastlane-action@v3.0.0 with: lane: 'fetch_dependencies' - - name: 'Show localizations diff' - run: | - echo "=== Git diff for lib/l10n/app_localizations.dart ===" - git diff lib/l10n/app_localizations.dart || echo "No changes in app_localizations.dart" - echo "=== End of diff ===" - name: 'Run lints' uses: maierj/fastlane-action@v3.0.0 with: From 4132ccef779afb6aa19b47710551c96469d22927 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicola=CC=81s=20Lantean?= Date: Thu, 24 Jul 2025 13:55:24 -0300 Subject: [PATCH 11/13] fix: format --- lib/l10n/app_localizations.dart | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/lib/l10n/app_localizations.dart b/lib/l10n/app_localizations.dart index 1ecc1f14..a214e3a8 100644 --- a/lib/l10n/app_localizations.dart +++ b/lib/l10n/app_localizations.dart @@ -192,8 +192,9 @@ AppLocalizations lookupAppLocalizations(Locale locale) { } throw FlutterError( - 'AppLocalizations.delegate failed to load unsupported locale "$locale". This is likely ' - 'an issue with the localizations generation tool. Please file an issue ' - 'on GitHub with a reproducible sample app and the gen-l10n configuration ' - 'that was used.'); + 'AppLocalizations.delegate failed to load unsupported locale "$locale". This is likely ' + 'an issue with the localizations generation tool. Please file an issue ' + 'on GitHub with a reproducible sample app and the gen-l10n configuration ' + 'that was used.', + ); } From ce57d816bc6cf72a1c73d543c1b234eef4cc83bb Mon Sep 17 00:00:00 2001 From: Federico Correa Date: Thu, 24 Jul 2025 15:24:04 -0300 Subject: [PATCH 12/13] fix: format --- lib/l10n/app_localizations.dart | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/lib/l10n/app_localizations.dart b/lib/l10n/app_localizations.dart index a214e3a8..cc163c90 100644 --- a/lib/l10n/app_localizations.dart +++ b/lib/l10n/app_localizations.dart @@ -62,7 +62,7 @@ import 'app_localizations_en.dart'; /// property. abstract class AppLocalizations { AppLocalizations(String locale) - : localeName = intl.Intl.canonicalizedLocale(locale.toString()); + : localeName = intl.Intl.canonicalizedLocale(locale.toString()); final String localeName; @@ -85,11 +85,11 @@ abstract class AppLocalizations { /// of delegates is preferred or required. static const List> localizationsDelegates = >[ - delegate, - GlobalMaterialLocalizations.delegate, - GlobalCupertinoLocalizations.delegate, - GlobalWidgetsLocalizations.delegate, - ]; + delegate, + GlobalMaterialLocalizations.delegate, + GlobalCupertinoLocalizations.delegate, + GlobalWidgetsLocalizations.delegate, + ]; /// A list of this localizations delegate's supported locales. static const List supportedLocales = [Locale('en')]; From 74fb28f66a545396b79af9c22af98de834196c5f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicola=CC=81s=20Lantean?= Date: Tue, 29 Jul 2025 11:53:14 -0300 Subject: [PATCH 13/13] fix: change java version on CI --- .github/workflows/actions/flutter-setup/action.yml | 4 ++-- .github/workflows/flutter-ci.yml | 4 +++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/.github/workflows/actions/flutter-setup/action.yml b/.github/workflows/actions/flutter-setup/action.yml index 92ed82b7..bba3ad42 100644 --- a/.github/workflows/actions/flutter-setup/action.yml +++ b/.github/workflows/actions/flutter-setup/action.yml @@ -1,4 +1,4 @@ -# IMPORTANT: FVM_VERSION, ANDROID_APP_FOLDER and IOS_APP_FOLDER have to be set on github variables +# IMPORTANT: FVM_VERSION, JAVA_VERSION, ANDROID_APP_FOLDER and IOS_APP_FOLDER have to be set on github variables name: Setup flutter description: "Setup infra" @@ -16,7 +16,7 @@ runs: - uses: actions/setup-java@v3 with: distribution: "zulu" - java-version: "17" + java-version: ${{ vars.JAVA_VERSION }} - uses: dart-lang/setup-dart@v1.4 - name: Cache FVM & Flutter uses: actions/cache@v3 diff --git a/.github/workflows/flutter-ci.yml b/.github/workflows/flutter-ci.yml index 5bd483d2..829a152c 100644 --- a/.github/workflows/flutter-ci.yml +++ b/.github/workflows/flutter-ci.yml @@ -1,3 +1,5 @@ +## IMPORTANT: JAVA_VERSION has to be set on github variables + name: Flutter CI on: pull_request: @@ -13,7 +15,7 @@ jobs: - uses: actions/setup-java@v3 with: distribution: 'zulu' - java-version: '11' + java-version: ${{ vars.JAVA_VERSION }} - uses: dart-lang/setup-dart@v1.4 - uses: subosito/flutter-action@v2 with: