From 8fbb6352ca64606c8c1e8551e10c87a725a6a0b0 Mon Sep 17 00:00:00 2001 From: Jan Marsh Date: Thu, 8 Sep 2022 12:54:38 +0200 Subject: [PATCH 1/5] Add structure, conventions and convenient helpers --- .gitlab-ci.yml | 74 +++++++++++++++ .vscode/launch.json | 25 +++++ Makefile | 104 +++++++++++++++++++++ analysis_options.yaml | 33 +++---- android/app/src/main/AndroidManifest.xml | 1 + lib/main.dart | 98 +------------------ lib/src/app.dart | 17 ++++ lib/src/features/counter/counter.page.dart | 46 +++++++++ macos/Runner/DebugProfile.entitlements | 2 + macos/Runner/Release.entitlements | 2 + pubspec.yaml | 74 ++------------- 11 files changed, 291 insertions(+), 185 deletions(-) create mode 100644 .gitlab-ci.yml create mode 100644 .vscode/launch.json create mode 100644 Makefile create mode 100644 lib/src/app.dart create mode 100644 lib/src/features/counter/counter.page.dart diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml new file mode 100644 index 0000000..420396d --- /dev/null +++ b/.gitlab-ci.yml @@ -0,0 +1,74 @@ +image: cirrusci/flutter:3.3.0 + +cache: + paths: + - /flutter/bin/cache/dart-sdk + +include: + - template: 'Workflows/Branch-Pipelines.gitlab-ci.yml' + +stages: + - check + - test + - build + - release + +# Check app for format and lint exceptions (fail fast) +Check App: + stage: check + except: + - main + before_script: + - flutter --version + script: + - make format + - make clean + - make lint + +# Check code quality +code_quality: + stage: test + except: + - main + before_script: + - export PATH="$PATH":"$HOME/.pub-cache/bin" + - flutter pub global activate dart_code_metrics + script: + - metrics lib -r codeclimate > gl-code-quality-report.json + artifacts: + reports: + codequality: gl-code-quality-report.json + +# Run tests and report quality +Test: + stage: test + except: + - main + before_script: + - export PATH="$PATH":"$HOME/.pub-cache/bin" + - flutter pub global activate junitreport + script: + - flutter test --machine --coverage | tojunit -o report.xml + - lcov --summary coverage/lcov.info + - genhtml coverage/lcov.info --output=coverage + coverage: '/lines\.*: \d+\.\d+\%/' + artifacts: + name: coverage + paths: + - $CI_PROJECT_DIR/coverage + reports: + junit: report.xml + +# Build the app to check if release builds still work +Build Android (.apk): + stage: build + except: + - main + script: + - make build-android-apk + dependencies: + - Check App + artifacts: + expire_in: 2 days + paths: + - build-output/app.apk \ No newline at end of file diff --git a/.vscode/launch.json b/.vscode/launch.json new file mode 100644 index 0000000..c2af647 --- /dev/null +++ b/.vscode/launch.json @@ -0,0 +1,25 @@ +{ + // Use IntelliSense to learn about possible attributes. + // Hover to view descriptions of existing attributes. + // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 + "version": "0.2.0", + "configurations": [ + { + "name": "counter_workshop", + "request": "launch", + "type": "dart" + }, + { + "name": "counter_workshop (profile mode)", + "request": "launch", + "type": "dart", + "flutterMode": "profile" + }, + { + "name": "counter_workshop (release mode)", + "request": "launch", + "type": "dart", + "flutterMode": "release" + } + ] +} \ No newline at end of file diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..0596fb6 --- /dev/null +++ b/Makefile @@ -0,0 +1,104 @@ +# +# Makefile for CI/CD Environments and commandline users +# + +# Dev Builds +run-dev: + flutter run +run-stage: + flutter run +run-prod: + flutter run + +# Profile Builds +run-dev-profile: + flutter run --profile +run-stage-profile: + flutter run --profile +run-prod-profile: + flutter run --profile + +# Release Builds +run-dev-release: + flutter run --release +run-stage-release: + flutter run --release +run-prod-release: + flutter run --release + +# Format & Lint +format: + flutter format . --line-length 120 --set-exit-if-changed +format-fix: + flutter format . --line-length 120 +lint: + flutter analyze + +# Testing +test: + flutter test +.PHONY: test + +# Build runner +build-runner: + flutter pub run build_runner build --delete-conflicting-outputs +build-runner-watch: + flutter pub run build_runner watch --delete-conflicting-outputs + +# Clean project +clean: + flutter clean + flutter pub get + make build-runner + +# Export Archives .ipa, .aab and .apk +build-ios: + @echo "Build iOS" + make clean + flutter build ipa --obfuscate --split-debug-info=./build-output/debug/ --tree-shake-icons --export-options-plist=ios/ios-export-options.plist --suppress-analytics + cp build/ios/ipa/app.ipa build-output/app.ipa +build-ios-analyze: + @echo "Build iOS analyze" + flutter build ipa --analyze-size --suppress-analytics +build-android: + @echo "Build Store App Bundle" + make clean + flutter build appbundle --obfuscate --split-debug-info=./build-output/debug/ + cp build/app/outputs/bundle/release/app-release.aab build-output/ + mv build-output/app-release.aab build-output/app.aab +build-android-analyze: + @echo "Build Android analyze" + flutter build appbundle --analyze-size --suppress-analytics +build-android-apk: + @echo "Build self-distribution .apk" + make clean + flutter build apk --obfuscate --split-debug-info=./build-output/debug/ + cp build/app/outputs/apk/release/app-release.apk build-output/ + mv build-output/app-release.apk build-output/app.apk + +# Release Archive to AppStore/PlayStore +release-ios: + @echo "Release iOS" + cd ios; bundle exec fastlane deploy +release-android: + @echo "Release Android" + cd android; bundle exec fastlane deploy +release: + @make build-ios && @make release-ios && @make build-android-appbundle && @make release-android + +# Additional helpers +packages-outdated: + flutter pub outdated +packages-upgrade: + flutter pub upgrade +l10n: + flutter gen-l10n +appicon: + flutter pub run flutter_launcher_icons:main -f flutter_launcher_icons.yaml +deeplink: + @printf "Android:\nadb shell am start -a android.intent.action.VIEW -c andrmoid.intent.category.BROWSABLE -d de.coodoo.counter://settings" + @printf "\n\n" + @printf "iOS:\nxcrun simctl openurl booted de.coodoo.counter://settings" + + + diff --git a/analysis_options.yaml b/analysis_options.yaml index 61b6c4d..ceb7f3d 100644 --- a/analysis_options.yaml +++ b/analysis_options.yaml @@ -1,29 +1,18 @@ -# This file configures the analyzer, which statically analyzes Dart code to -# check for errors, warnings, and lints. -# -# The issues identified by the analyzer are surfaced in the UI of Dart-enabled -# IDEs (https://dart.dev/tools#ides-and-editors). The analyzer can also be -# invoked from the command line by running `flutter analyze`. - -# The following line activates a set of recommended lints for Flutter apps, -# packages, and plugins designed to encourage good coding practices. include: package:flutter_lints/flutter.yaml +analyzer: + exclude: + - "**/*.g.dart" + - "**/*.freezed.dart" + errors: + invalid_annotation_target: ignore + missing_return: error + linter: - # The lint rules applied to this project can be customized in the - # section below to disable rules from the `package:flutter_lints/flutter.yaml` - # included above or to enable additional rules. A list of all available lints - # and their documentation is published at - # https://dart-lang.github.io/linter/lints/index.html. - # - # Instead of disabling a lint rule for the entire project in the - # section below, it can also be suppressed for a single line of code - # or a specific dart file by using the `// ignore: name_of_lint` and - # `// ignore_for_file: name_of_lint` syntax on the line or in the file - # producing the lint. rules: - # avoid_print: false # Uncomment to disable the `avoid_print` rule - # prefer_single_quotes: true # Uncomment to enable the `prefer_single_quotes` rule + prefer_single_quotes: true + require_trailing_commas: true + always_use_package_imports: true # Additional information about this file can be found at # https://dart.dev/guides/language/analysis-options diff --git a/android/app/src/main/AndroidManifest.xml b/android/app/src/main/AndroidManifest.xml index 06e0368..7484486 100644 --- a/android/app/src/main/AndroidManifest.xml +++ b/android/app/src/main/AndroidManifest.xml @@ -1,5 +1,6 @@ + createState() => _MyHomePageState(); -} - -class _MyHomePageState extends State { - int _counter = 0; - - void _incrementCounter() { - setState(() { - // This call to setState tells the Flutter framework that something has - // changed in this State, which causes it to rerun the build method below - // so that the display can reflect the updated values. If we changed - // _counter without calling setState(), then the build method would not be - // called again, and so nothing would appear to happen. - _counter++; - }); - } - - @override - Widget build(BuildContext context) { - // This method is rerun every time setState is called, for instance as done - // by the _incrementCounter method above. - // - // The Flutter framework has been optimized to make rerunning build methods - // fast, so that you can just rebuild anything that needs updating rather - // than having to individually change instances of widgets. - return Scaffold( - appBar: AppBar( - // Here we take the value from the MyHomePage object that was created by - // the App.build method, and use it to set our appbar title. - title: Text(widget.title), - ), - body: Center( - // Center is a layout widget. It takes a single child and positions it - // in the middle of the parent. - child: Column( - // Column is also a layout widget. It takes a list of children and - // arranges them vertically. By default, it sizes itself to fit its - // children horizontally, and tries to be as tall as its parent. - // - // Invoke "debug painting" (press "p" in the console, choose the - // "Toggle Debug Paint" action from the Flutter Inspector in Android - // Studio, or the "Toggle Debug Paint" command in Visual Studio Code) - // to see the wireframe for each widget. - // - // Column has various properties to control how it sizes itself and - // how it positions its children. Here we use mainAxisAlignment to - // center the children vertically; the main axis here is the vertical - // axis because Columns are vertical (the cross axis would be - // horizontal). - mainAxisAlignment: MainAxisAlignment.center, - children: [ - const Text( - 'You have pushed the button this many times:', - ), - Text( - '$_counter', - style: Theme.of(context).textTheme.headline4, - ), - ], - ), - ), - floatingActionButton: FloatingActionButton( - onPressed: _incrementCounter, - tooltip: 'Increment', - child: const Icon(Icons.add), - ), // This trailing comma makes auto-formatting nicer for build methods. + home: const CounterPage(), ); } } diff --git a/lib/src/app.dart b/lib/src/app.dart new file mode 100644 index 0000000..7de08a3 --- /dev/null +++ b/lib/src/app.dart @@ -0,0 +1,17 @@ +import 'package:counter_workshop/src/features/counter/counter.page.dart'; +import 'package:flutter/material.dart'; + +class App extends StatelessWidget { + const App({super.key}); + + @override + Widget build(BuildContext context) { + return MaterialApp( + title: 'Counter Demo', + theme: ThemeData( + primarySwatch: Colors.blue, + ), + home: const CounterPage(), + ); + } +} diff --git a/lib/src/features/counter/counter.page.dart b/lib/src/features/counter/counter.page.dart new file mode 100644 index 0000000..1057806 --- /dev/null +++ b/lib/src/features/counter/counter.page.dart @@ -0,0 +1,46 @@ +import 'package:flutter/material.dart'; + +class CounterPage extends StatefulWidget { + const CounterPage({super.key}); + + @override + State createState() => _CounterPageState(); +} + +class _CounterPageState extends State { + int _counter = 0; + + void _incrementCounter() { + setState(() { + _counter++; + }); + } + + @override + Widget build(BuildContext context) { + return Scaffold( + appBar: AppBar( + title: const Text('Counter Page'), + ), + body: Center( + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + const Text( + 'You have pushed the button this many times:', + ), + Text( + '$_counter', + style: Theme.of(context).textTheme.headline4, + ), + ], + ), + ), + floatingActionButton: FloatingActionButton( + onPressed: _incrementCounter, + tooltip: 'Increment', + child: const Icon(Icons.add), + ), + ); + } +} diff --git a/macos/Runner/DebugProfile.entitlements b/macos/Runner/DebugProfile.entitlements index dddb8a3..08c3ab1 100644 --- a/macos/Runner/DebugProfile.entitlements +++ b/macos/Runner/DebugProfile.entitlements @@ -8,5 +8,7 @@ com.apple.security.network.server + com.apple.security.network.client + diff --git a/macos/Runner/Release.entitlements b/macos/Runner/Release.entitlements index 852fa1a..ee95ab7 100644 --- a/macos/Runner/Release.entitlements +++ b/macos/Runner/Release.entitlements @@ -4,5 +4,7 @@ com.apple.security.app-sandbox + com.apple.security.network.client + diff --git a/pubspec.yaml b/pubspec.yaml index d349b8f..77974e0 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,91 +1,31 @@ name: counter_workshop description: A new Flutter project. -# The following line prevents the package from being accidentally published to -# pub.dev using `flutter pub publish`. This is preferred for private packages. -publish_to: 'none' # Remove this line if you wish to publish to pub.dev +publish_to: "none" -# The following defines the version and build number for your application. -# A version number is three numbers separated by dots, like 1.2.43 -# followed by an optional build number separated by a +. -# Both the version and the builder number may be overridden in flutter -# build by specifying --build-name and --build-number, respectively. -# In Android, build-name is used as versionName while build-number used as versionCode. -# Read more about Android versioning at https://developer.android.com/studio/publish/versioning -# In iOS, build-name is used as CFBundleShortVersionString while build-number is used as CFBundleVersion. -# Read more about iOS versioning at -# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html -# In Windows, build-name is used as the major, minor, and patch parts -# of the product and file versions while build-number is used as the build suffix. version: 1.0.0+1 environment: - sdk: '>=2.18.0 <3.0.0' + sdk: ">=2.18.0 <3.0.0" -# Dependencies specify other packages that your package needs in order to work. -# To automatically upgrade your package dependencies to the latest versions -# consider running `flutter pub upgrade --major-versions`. Alternatively, -# dependencies can be manually updated by changing the version numbers below to -# the latest version available on pub.dev. To see which dependencies have newer -# versions available, run `flutter pub outdated`. dependencies: flutter: sdk: flutter - - # The following adds the Cupertino Icons font to your application. - # Use with the CupertinoIcons class for iOS style icons. cupertino_icons: ^1.0.2 dev_dependencies: flutter_test: sdk: flutter - # The "flutter_lints" package below contains a set of recommended lints to - # encourage good coding practices. The lint set provided by the package is - # activated in the `analysis_options.yaml` file located at the root of your - # package. See that file for information about deactivating specific lint - # rules and activating additional ones. flutter_lints: ^2.0.0 -# For information on the generic Dart part of this file, see the -# following page: https://dart.dev/tools/pub/pubspec - -# The following section is specific to Flutter packages. flutter: - - # The following line ensures that the Material Icons font is - # included with your application, so that you can use the icons in - # the material Icons class. uses-material-design: true - # To add assets to your application, add an assets section, like this: - # assets: - # - images/a_dot_burr.jpeg - # - images/a_dot_ham.jpeg - - # An image asset can refer to one or more resolution-specific "variants", see - # https://flutter.dev/assets-and-images/#resolution-aware - - # For details regarding adding assets from package dependencies, see - # https://flutter.dev/assets-and-images/#from-packages + assets: + - assets/images/ # .png/.jpg images + - assets/icons/ # .svg icons + - assets/fonts/ # Custom Fonts + - assets/launcher_icon/ # App icon image to generate from - # To add custom fonts to your application, add a fonts section here, - # in this "flutter" section. Each entry in this list should have a - # "family" key with the font family name, and a "fonts" key with a - # list giving the asset and other descriptors for the font. For - # example: - # fonts: - # - family: Schyler - # fonts: - # - asset: fonts/Schyler-Regular.ttf - # - asset: fonts/Schyler-Italic.ttf - # style: italic - # - family: Trajan Pro - # fonts: - # - asset: fonts/TrajanPro.ttf - # - asset: fonts/TrajanPro_Bold.ttf - # weight: 700 - # - # For details regarding fonts from package dependencies, - # see https://flutter.dev/custom-fonts/#from-packages From 3e89b13f9dba4a96ba6d41a191de0dc71c4bd0ab Mon Sep 17 00:00:00 2001 From: Jan Marsh Date: Thu, 8 Sep 2022 13:07:47 +0200 Subject: [PATCH 2/5] Adding Build-Runner --- pubspec.lock | 280 +++++++++++++++++++++++++++++++++++++++++++++++++++ pubspec.yaml | 1 + 2 files changed, 281 insertions(+) diff --git a/pubspec.lock b/pubspec.lock index e12a987..dcd008a 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -1,6 +1,27 @@ # Generated by pub # See https://dart.dev/tools/pub/glossary#lockfile packages: + _fe_analyzer_shared: + dependency: transitive + description: + name: _fe_analyzer_shared + url: "https://pub.dartlang.org" + source: hosted + version: "47.0.0" + analyzer: + dependency: transitive + description: + name: analyzer + url: "https://pub.dartlang.org" + source: hosted + version: "4.7.0" + args: + dependency: transitive + description: + name: args + url: "https://pub.dartlang.org" + source: hosted + version: "2.3.1" async: dependency: transitive description: @@ -15,6 +36,62 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "2.1.0" + build: + dependency: transitive + description: + name: build + url: "https://pub.dartlang.org" + source: hosted + version: "2.3.0" + build_config: + dependency: transitive + description: + name: build_config + url: "https://pub.dartlang.org" + source: hosted + version: "1.1.0" + build_daemon: + dependency: transitive + description: + name: build_daemon + url: "https://pub.dartlang.org" + source: hosted + version: "3.1.0" + build_resolvers: + dependency: transitive + description: + name: build_resolvers + url: "https://pub.dartlang.org" + source: hosted + version: "2.0.9" + build_runner: + dependency: "direct dev" + description: + name: build_runner + url: "https://pub.dartlang.org" + source: hosted + version: "2.2.0" + build_runner_core: + dependency: transitive + description: + name: build_runner_core + url: "https://pub.dartlang.org" + source: hosted + version: "7.2.3" + built_collection: + dependency: transitive + description: + name: built_collection + url: "https://pub.dartlang.org" + source: hosted + version: "5.1.1" + built_value: + dependency: transitive + description: + name: built_value + url: "https://pub.dartlang.org" + source: hosted + version: "8.4.1" characters: dependency: transitive description: @@ -22,6 +99,13 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "1.2.1" + checked_yaml: + dependency: transitive + description: + name: checked_yaml + url: "https://pub.dartlang.org" + source: hosted + version: "2.0.1" clock: dependency: transitive description: @@ -29,6 +113,13 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "1.1.1" + code_builder: + dependency: transitive + description: + name: code_builder + url: "https://pub.dartlang.org" + source: hosted + version: "4.2.0" collection: dependency: transitive description: @@ -36,6 +127,20 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "1.16.0" + convert: + dependency: transitive + description: + name: convert + url: "https://pub.dartlang.org" + source: hosted + version: "3.0.2" + crypto: + dependency: transitive + description: + name: crypto + url: "https://pub.dartlang.org" + source: hosted + version: "3.0.2" cupertino_icons: dependency: "direct main" description: @@ -43,6 +148,13 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "1.0.5" + dart_style: + dependency: transitive + description: + name: dart_style + url: "https://pub.dartlang.org" + source: hosted + version: "2.2.3" fake_async: dependency: transitive description: @@ -50,6 +162,20 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "1.3.1" + file: + dependency: transitive + description: + name: file + url: "https://pub.dartlang.org" + source: hosted + version: "6.1.4" + fixnum: + dependency: transitive + description: + name: fixnum + url: "https://pub.dartlang.org" + source: hosted + version: "1.0.1" flutter: dependency: "direct main" description: flutter @@ -67,6 +193,62 @@ packages: description: flutter source: sdk version: "0.0.0" + frontend_server_client: + dependency: transitive + description: + name: frontend_server_client + url: "https://pub.dartlang.org" + source: hosted + version: "2.1.3" + glob: + dependency: transitive + description: + name: glob + url: "https://pub.dartlang.org" + source: hosted + version: "2.1.0" + graphs: + dependency: transitive + description: + name: graphs + url: "https://pub.dartlang.org" + source: hosted + version: "2.1.0" + http_multi_server: + dependency: transitive + description: + name: http_multi_server + url: "https://pub.dartlang.org" + source: hosted + version: "3.2.1" + http_parser: + dependency: transitive + description: + name: http_parser + url: "https://pub.dartlang.org" + source: hosted + version: "4.0.1" + io: + dependency: transitive + description: + name: io + url: "https://pub.dartlang.org" + source: hosted + version: "1.0.3" + js: + dependency: transitive + description: + name: js + url: "https://pub.dartlang.org" + source: hosted + version: "0.6.4" + json_annotation: + dependency: transitive + description: + name: json_annotation + url: "https://pub.dartlang.org" + source: hosted + version: "4.6.0" lints: dependency: transitive description: @@ -74,6 +256,13 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "2.0.0" + logging: + dependency: transitive + description: + name: logging + url: "https://pub.dartlang.org" + source: hosted + version: "1.0.2" matcher: dependency: transitive description: @@ -95,6 +284,20 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "1.8.0" + mime: + dependency: transitive + description: + name: mime + url: "https://pub.dartlang.org" + source: hosted + version: "1.0.2" + package_config: + dependency: transitive + description: + name: package_config + url: "https://pub.dartlang.org" + source: hosted + version: "2.1.0" path: dependency: transitive description: @@ -102,6 +305,41 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "1.8.2" + pool: + dependency: transitive + description: + name: pool + url: "https://pub.dartlang.org" + source: hosted + version: "1.5.1" + pub_semver: + dependency: transitive + description: + name: pub_semver + url: "https://pub.dartlang.org" + source: hosted + version: "2.1.1" + pubspec_parse: + dependency: transitive + description: + name: pubspec_parse + url: "https://pub.dartlang.org" + source: hosted + version: "1.2.1" + shelf: + dependency: transitive + description: + name: shelf + url: "https://pub.dartlang.org" + source: hosted + version: "1.3.2" + shelf_web_socket: + dependency: transitive + description: + name: shelf_web_socket + url: "https://pub.dartlang.org" + source: hosted + version: "1.0.2" sky_engine: dependency: transitive description: flutter @@ -128,6 +366,13 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "2.1.0" + stream_transform: + dependency: transitive + description: + name: stream_transform + url: "https://pub.dartlang.org" + source: hosted + version: "2.0.0" string_scanner: dependency: transitive description: @@ -149,6 +394,20 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "0.4.12" + timing: + dependency: transitive + description: + name: timing + url: "https://pub.dartlang.org" + source: hosted + version: "1.0.0" + typed_data: + dependency: transitive + description: + name: typed_data + url: "https://pub.dartlang.org" + source: hosted + version: "1.3.1" vector_math: dependency: transitive description: @@ -156,5 +415,26 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "2.1.2" + watcher: + dependency: transitive + description: + name: watcher + url: "https://pub.dartlang.org" + source: hosted + version: "1.0.1" + web_socket_channel: + dependency: transitive + description: + name: web_socket_channel + url: "https://pub.dartlang.org" + source: hosted + version: "2.2.0" + yaml: + dependency: transitive + description: + name: yaml + url: "https://pub.dartlang.org" + source: hosted + version: "3.1.1" sdks: dart: ">=2.18.0 <3.0.0" diff --git a/pubspec.yaml b/pubspec.yaml index 77974e0..fca082e 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -19,6 +19,7 @@ dev_dependencies: sdk: flutter flutter_lints: ^2.0.0 + build_runner: ^2.2.0 flutter: uses-material-design: true From 92f470c6b99f86fa83f9d548413651c135ad261e Mon Sep 17 00:00:00 2001 From: Jan Marsh Date: Thu, 8 Sep 2022 14:21:26 +0200 Subject: [PATCH 3/5] keeping folders --- assets/fonts/.gitkeep | 0 assets/icons/.gitkeep | 0 assets/images/.gitkeep | 0 assets/launcher_icon/.gitkeep | 0 build-output/.gitkeep | 0 lib/src/core/routing/.gitkeep | 0 lib/src/core/utils/.gitkeep | 0 7 files changed, 0 insertions(+), 0 deletions(-) create mode 100644 assets/fonts/.gitkeep create mode 100644 assets/icons/.gitkeep create mode 100644 assets/images/.gitkeep create mode 100644 assets/launcher_icon/.gitkeep create mode 100644 build-output/.gitkeep create mode 100644 lib/src/core/routing/.gitkeep create mode 100644 lib/src/core/utils/.gitkeep diff --git a/assets/fonts/.gitkeep b/assets/fonts/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/assets/icons/.gitkeep b/assets/icons/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/assets/images/.gitkeep b/assets/images/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/assets/launcher_icon/.gitkeep b/assets/launcher_icon/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/build-output/.gitkeep b/build-output/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/lib/src/core/routing/.gitkeep b/lib/src/core/routing/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/lib/src/core/utils/.gitkeep b/lib/src/core/utils/.gitkeep new file mode 100644 index 0000000..e69de29 From 74e0aa0b6509beb2a630117e5f8ad9e07eb3a621 Mon Sep 17 00:00:00 2001 From: Jan Marsh Date: Thu, 8 Sep 2022 15:06:40 +0200 Subject: [PATCH 4/5] Cleanup --- lib/main.dart | 19 ++----------------- test/widget_test.dart | 5 ++--- 2 files changed, 4 insertions(+), 20 deletions(-) diff --git a/lib/main.dart b/lib/main.dart index 91b757f..e00f7b8 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -1,21 +1,6 @@ -import 'package:counter_workshop/src/features/counter/counter.page.dart'; +import 'package:counter_workshop/src/app.dart'; import 'package:flutter/material.dart'; void main() { - runApp(const MyApp()); -} - -class MyApp extends StatelessWidget { - const MyApp({super.key}); - - @override - Widget build(BuildContext context) { - return MaterialApp( - title: 'Flutter Demo', - theme: ThemeData( - primarySwatch: Colors.blue, - ), - home: const CounterPage(), - ); - } + runApp(const App()); } diff --git a/test/widget_test.dart b/test/widget_test.dart index cf75dc0..504e6ab 100644 --- a/test/widget_test.dart +++ b/test/widget_test.dart @@ -5,15 +5,14 @@ // gestures. You can also use WidgetTester to find child widgets in the widget // tree, read text, and verify that the values of widget properties are correct. +import 'package:counter_workshop/src/app.dart'; import 'package:flutter/material.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:counter_workshop/main.dart'; - void main() { testWidgets('Counter increments smoke test', (WidgetTester tester) async { // Build our app and trigger a frame. - await tester.pumpWidget(const MyApp()); + await tester.pumpWidget(const App()); // Verify that our counter starts at 0. expect(find.text('0'), findsOneWidget); From 5a9f7b7490ea72e55651e2d639d2fffb1235d07f Mon Sep 17 00:00:00 2001 From: Jan Marsh Date: Fri, 9 Sep 2022 09:44:20 +0200 Subject: [PATCH 5/5] adding more core folders --- lib/src/core/extensions/.gitkeep | 0 lib/src/core/wigets/.gitkeep | 0 2 files changed, 0 insertions(+), 0 deletions(-) create mode 100644 lib/src/core/extensions/.gitkeep create mode 100644 lib/src/core/wigets/.gitkeep diff --git a/lib/src/core/extensions/.gitkeep b/lib/src/core/extensions/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/lib/src/core/wigets/.gitkeep b/lib/src/core/wigets/.gitkeep new file mode 100644 index 0000000..e69de29