diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index d56cf780..4d3fe53b 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -1,6 +1,6 @@ name: Build, Test and Analyze -on: [ push, pull_request ] +on: [push, pull_request] jobs: main: @@ -13,24 +13,20 @@ jobs: repo-token: ${{ secrets.GITHUB_TOKEN }} - uses: subosito/flutter-action@v2.10.0 with: - flutter-version: '3.10.5' - channel: 'stable' - cache-key: 'flutter-:os:-:channel:-:version:-:arch:-:hash:' - cache-path: '${{ runner.tool_cache }}/flutter/:channel:-:version:-:arch:' + flutter-version: "3.10.5" + channel: "stable" + cache-key: "flutter-:os:-:channel:-:version:-:arch:-:hash:" + cache-path: "${{ runner.tool_cache }}/flutter/:channel:-:version:-:arch:" architecture: x64 # optional, x64 or arm64 - name: Setup run: | - flutter pub get - flutter pub run build_runner build --delete-conflicting-outputs - dart pub global activate protoc_plugin - chmod +x generate_protos.sh - ./generate_protos.sh + make get - name: Static Analysis - run: flutter analyze + run: make lint - name: Unit Tests - run: flutter test test/unit + run: melos run test:unit - name: Widget Tests - run: flutter test test/widget + run: melos run test:widget - name: Build release package run: flutter build apk --release - name: Archive build artifacts @@ -39,4 +35,3 @@ jobs: name: apk path: | build/app/outputs/flutter-apk/app-release.apk - diff --git a/Makefile b/Makefile index 528b93e2..516b0a8d 100644 --- a/Makefile +++ b/Makefile @@ -1,7 +1,7 @@ .PHONY: run pods-clean get clean build languages lint format test watch -FLUTTER := flutter -DART := dart +FLUTTER := fvm flutter +DART := fvm dart run: $(FLUTTER) run diff --git a/melos.yaml b/melos.yaml index eb95a60a..1a3b743c 100644 --- a/melos.yaml +++ b/melos.yaml @@ -1,6 +1,6 @@ name: Paintroid-Flutter repository: https://github.com/Catrobat/Paintroid-Flutter -sdkPath: auto +sdkPath: .fvm/flutter_sdk packages: - packages/* diff --git a/packages/component_library/lib/src/models/path_with_action_history.dart b/packages/component_library/lib/src/models/path_with_action_history.dart index a9ad9e14..75bffb9b 100644 --- a/packages/component_library/lib/src/models/path_with_action_history.dart +++ b/packages/component_library/lib/src/models/path_with_action_history.dart @@ -42,4 +42,4 @@ class LineToAction extends PathAction { class CloseAction extends PathAction { const CloseAction(); -} \ No newline at end of file +} diff --git a/packages/features/workspace_screen/lib/src/components/bottom_nav_bar.dart b/packages/features/workspace_screen/lib/src/components/bottom_nav_bar.dart index 6db2cafe..313e27b8 100644 --- a/packages/features/workspace_screen/lib/src/components/bottom_nav_bar.dart +++ b/packages/features/workspace_screen/lib/src/components/bottom_nav_bar.dart @@ -21,7 +21,6 @@ class BottomNavBar extends StatelessWidget { ), ); } - if (index == 2) { showModalBottomSheet( context: context, diff --git a/packages/l10n/lib/src/l10n/app_localizations.dart b/packages/l10n/lib/src/l10n/app_localizations.dart index 1fecd5db..86fb2fbb 100644 --- a/packages/l10n/lib/src/l10n/app_localizations.dart +++ b/packages/l10n/lib/src/l10n/app_localizations.dart @@ -59,7 +59,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; @@ -67,7 +68,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. @@ -79,7 +81,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, @@ -87,9 +90,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')]; /// No description provided for @fullscreen. /// @@ -146,7 +147,8 @@ abstract class AppLocalizations { String get layers; } -class _AppLocalizationsDelegate extends LocalizationsDelegate { +class _AppLocalizationsDelegate + extends LocalizationsDelegate { const _AppLocalizationsDelegate(); @override @@ -155,24 +157,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.'); } diff --git a/pubspec.lock b/pubspec.lock index 7b577238..f930b3a5 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -222,6 +222,28 @@ packages: relative: true source: path version: "0.0.1" + conventional_commit: + dependency: transitive + description: + name: conventional_commit + sha256: dec15ad1118f029c618651a4359eb9135d8b88f761aa24e4016d061cd45948f2 + url: "https://pub.dev" + source: hosted + version: "1.17.1" + command: + dependency: "direct main" + description: + path: "packages/command" + relative: true + source: path + version: "0.0.1" + component_library: + dependency: "direct main" + description: + path: "packages/component_library" + relative: true + source: path + version: "0.0.1" conventional_commit: dependency: transitive description: @@ -748,7 +770,7 @@ packages: sha256: "9528f2f296073ff54cb9fee677df673ace1218163c3bc7628093e7eed5203d41" url: "https://pub.dev" source: hosted - version: "0.5.0" + version: "0.2.0" melos: dependency: "direct main" description: @@ -1456,14 +1478,6 @@ packages: url: "https://pub.dev" source: hosted version: "1.1.0" - web: - dependency: transitive - description: - name: web - sha256: afe077240a270dcfd2aafe77602b4113645af95d0ad31128cc02bce5ac5d5152 - url: "https://pub.dev" - source: hosted - version: "0.3.0" web_socket_channel: dependency: transitive description: @@ -1536,5 +1550,5 @@ packages: source: hosted version: "2.1.1" sdks: - dart: ">=3.2.0-194.0.dev <4.0.0" + dart: ">=3.0.5 <4.0.0" flutter: ">=3.10.0"