diff --git a/.flutter-plugins-dependencies b/.flutter-plugins-dependencies index ee15714..fa93230 100644 --- a/.flutter-plugins-dependencies +++ b/.flutter-plugins-dependencies @@ -1 +1 @@ -{"_info":"// This is a generated file; do not edit or check into version control.","dependencyGraph":[{"name":"shared_preferences","dependencies":["shared_preferences_macos","shared_preferences_web"]},{"name":"shared_preferences_macos","dependencies":[]},{"name":"shared_preferences_web","dependencies":[]}]} \ No newline at end of file +{"info":"This is a generated file; do not edit or check into version control.","plugins":{"ios":[{"name":"shared_preferences","path":"/Users/manurueda/.pub-cache/hosted/pub.dartlang.org/shared_preferences-0.5.6/","native_build":true,"dependencies":[]}],"android":[{"name":"shared_preferences","path":"/Users/manurueda/.pub-cache/hosted/pub.dartlang.org/shared_preferences-0.5.6/","native_build":true,"dependencies":[]}],"macos":[{"name":"shared_preferences_macos","path":"/Users/manurueda/.pub-cache/hosted/pub.dartlang.org/shared_preferences_macos-0.0.1+3/","native_build":true,"dependencies":[]}],"linux":[],"windows":[],"web":[{"name":"shared_preferences_web","path":"/Users/manurueda/.pub-cache/hosted/pub.dartlang.org/shared_preferences_web-0.1.2+2/","dependencies":[]}]},"dependencyGraph":[{"name":"shared_preferences","dependencies":["shared_preferences_macos","shared_preferences_web"]},{"name":"shared_preferences_macos","dependencies":[]},{"name":"shared_preferences_web","dependencies":[]}],"date_created":"2022-10-15 19:32:23.812846","version":"3.5.0-3.0.pre.10"} \ No newline at end of file diff --git a/.fvm/flutter_sdk b/.fvm/flutter_sdk new file mode 120000 index 0000000..d81c6a2 --- /dev/null +++ b/.fvm/flutter_sdk @@ -0,0 +1 @@ +/Users/manurueda/fvm/versions/3.3.4 \ No newline at end of file diff --git a/.fvm/fvm_config.json b/.fvm/fvm_config.json new file mode 100644 index 0000000..86d87fc --- /dev/null +++ b/.fvm/fvm_config.json @@ -0,0 +1,4 @@ +{ + "flutterSdkVersion": "3.3.4", + "flavors": {} +} \ No newline at end of file diff --git a/android/app/src/main/AndroidManifest.xml b/android/app/src/main/AndroidManifest.xml index 9a07a92..e530990 100644 --- a/android/app/src/main/AndroidManifest.xml +++ b/android/app/src/main/AndroidManifest.xml @@ -7,11 +7,10 @@ additional functionality it is fine to subclass or reimplement FlutterApplication and put your custom class here. --> + diff --git a/android/app/src/main/kotlin/com/resocoder/clean_architecture_tdd_course/MainActivity.kt b/android/app/src/main/kotlin/com/resocoder/clean_architecture_tdd_course/MainActivity.kt deleted file mode 100644 index 27bc908..0000000 --- a/android/app/src/main/kotlin/com/resocoder/clean_architecture_tdd_course/MainActivity.kt +++ /dev/null @@ -1,13 +0,0 @@ -package com.resocoder.clean_architecture_tdd_course - -import android.os.Bundle - -import io.flutter.app.FlutterActivity -import io.flutter.plugins.GeneratedPluginRegistrant - -class MainActivity: FlutterActivity() { - override fun onCreate(savedInstanceState: Bundle?) { - super.onCreate(savedInstanceState) - GeneratedPluginRegistrant.registerWith(this) - } -} diff --git a/ios/Flutter/Debug.xcconfig b/ios/Flutter/Debug.xcconfig index 592ceee..ec97fc6 100644 --- a/ios/Flutter/Debug.xcconfig +++ b/ios/Flutter/Debug.xcconfig @@ -1 +1,2 @@ +#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig" #include "Generated.xcconfig" diff --git a/ios/Flutter/Release.xcconfig b/ios/Flutter/Release.xcconfig index 592ceee..c4855bf 100644 --- a/ios/Flutter/Release.xcconfig +++ b/ios/Flutter/Release.xcconfig @@ -1 +1,2 @@ +#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig" #include "Generated.xcconfig" diff --git a/ios/Flutter/flutter_export_environment.sh b/ios/Flutter/flutter_export_environment.sh index 047511c..62239c8 100755 --- a/ios/Flutter/flutter_export_environment.sh +++ b/ios/Flutter/flutter_export_environment.sh @@ -1,10 +1,13 @@ #!/bin/sh # This is a generated file; do not edit or check into version control. -export "FLUTTER_ROOT=C:\Flutter\flutter" -export "FLUTTER_APPLICATION_PATH=D:\Projects\Playground_and_Learning\flutter-tdd-clean-architecture-course" +export "FLUTTER_ROOT=C:\Users\Arun\Documents\flutter" +export "FLUTTER_APPLICATION_PATH=C:\Users\Arun\Documents\Arun - Project Files\FlutterProjects\flutter-tdd-clean-architecture-course" export "FLUTTER_TARGET=lib\main.dart" export "FLUTTER_BUILD_DIR=build" export "SYMROOT=${SOURCE_ROOT}/../build\ios" -export "FLUTTER_FRAMEWORK_DIR=C:\Flutter\flutter\bin\cache\artifacts\engine\ios" export "FLUTTER_BUILD_NAME=1.0.0" export "FLUTTER_BUILD_NUMBER=1" +export "DART_OBFUSCATION=false" +export "TRACK_WIDGET_CREATION=false" +export "TREE_SHAKE_ICONS=false" +export "PACKAGE_CONFIG=.packages" diff --git a/ios/Podfile b/ios/Podfile new file mode 100644 index 0000000..88359b2 --- /dev/null +++ b/ios/Podfile @@ -0,0 +1,41 @@ +# Uncomment this line to define a global platform for your project +# platform :ios, '11.0' + +# CocoaPods analytics sends network stats synchronously affecting flutter build latency. +ENV['COCOAPODS_DISABLE_STATS'] = 'true' + +project 'Runner', { + 'Debug' => :debug, + 'Profile' => :release, + 'Release' => :release, +} + +def flutter_root + generated_xcode_build_settings_path = File.expand_path(File.join('..', 'Flutter', 'Generated.xcconfig'), __FILE__) + unless File.exist?(generated_xcode_build_settings_path) + raise "#{generated_xcode_build_settings_path} must exist. If you're running pod install manually, make sure flutter pub get is executed first" + end + + File.foreach(generated_xcode_build_settings_path) do |line| + matches = line.match(/FLUTTER_ROOT\=(.*)/) + return matches[1].strip if matches + end + raise "FLUTTER_ROOT not found in #{generated_xcode_build_settings_path}. Try deleting Generated.xcconfig, then run flutter pub get" +end + +require File.expand_path(File.join('packages', 'flutter_tools', 'bin', 'podhelper'), flutter_root) + +flutter_ios_podfile_setup + +target 'Runner' do + use_frameworks! + use_modular_headers! + + flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__)) +end + +post_install do |installer| + installer.pods_project.targets.each do |target| + flutter_additional_ios_build_settings(target) + end +end diff --git a/lib/features/number_trivia/presentation/pages/number_trivia_page.dart b/lib/features/number_trivia/presentation/pages/number_trivia_page.dart index d3332b1..0dea631 100644 --- a/lib/features/number_trivia/presentation/pages/number_trivia_page.dart +++ b/lib/features/number_trivia/presentation/pages/number_trivia_page.dart @@ -44,6 +44,7 @@ class NumberTriviaPage extends StatelessWidget { message: state.message, ); } + return null; }, ), SizedBox(height: 20), diff --git a/lib/features/number_trivia/presentation/widgets/trivia_controls.dart b/lib/features/number_trivia/presentation/widgets/trivia_controls.dart index 4774ea1..1c366cf 100644 --- a/lib/features/number_trivia/presentation/widgets/trivia_controls.dart +++ b/lib/features/number_trivia/presentation/widgets/trivia_controls.dart @@ -37,16 +37,15 @@ class _TriviaControlsState extends State { Row( children: [ Expanded( - child: RaisedButton( - child: Text('Search'), - color: Theme.of(context).accentColor, - textTheme: ButtonTextTheme.primary, + child: ElevatedButton( + child: Text('Search', + style: TextStyle(backgroundColor: Colors.blue)), onPressed: dispatchConcrete, ), ), SizedBox(width: 10), Expanded( - child: RaisedButton( + child: ElevatedButton( child: Text('Get random trivia'), onPressed: dispatchRandom, ), diff --git a/pubspec.lock b/pubspec.lock index 31a1964..43f029a 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -1,27 +1,34 @@ # Generated by pub # See https://dart.dev/tools/pub/glossary#lockfile packages: - archive: + _fe_analyzer_shared: dependency: transitive description: - name: archive + name: _fe_analyzer_shared url: "https://pub.dartlang.org" source: hosted - version: "2.0.11" + version: "49.0.0" + analyzer: + dependency: transitive + description: + name: analyzer + url: "https://pub.dartlang.org" + source: hosted + version: "5.1.0" args: dependency: transitive description: name: args url: "https://pub.dartlang.org" source: hosted - version: "1.5.2" + version: "2.3.1" async: dependency: transitive description: name: async url: "https://pub.dartlang.org" source: hosted - version: "2.4.0" + version: "2.9.0" bloc: dependency: transitive description: @@ -35,35 +42,84 @@ packages: name: boolean_selector url: "https://pub.dartlang.org" source: hosted - version: "1.0.5" + version: "2.1.0" + build: + dependency: transitive + description: + name: build + url: "https://pub.dartlang.org" + source: hosted + version: "2.3.1" + 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: + name: characters + url: "https://pub.dartlang.org" + source: hosted + version: "1.2.1" charcode: dependency: transitive description: name: charcode url: "https://pub.dartlang.org" source: hosted - version: "1.1.2" + version: "1.2.0" + clock: + dependency: transitive + description: + name: clock + 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.3.0" collection: dependency: transitive description: name: collection url: "https://pub.dartlang.org" source: hosted - version: "1.14.11" + version: "1.16.0" convert: dependency: transitive description: name: convert url: "https://pub.dartlang.org" source: hosted - version: "2.1.1" + version: "3.1.1" crypto: dependency: transitive description: name: crypto url: "https://pub.dartlang.org" source: hosted - version: "2.1.3" + version: "3.0.2" + dart_style: + dependency: transitive + description: + name: dart_style + url: "https://pub.dartlang.org" + source: hosted + version: "2.2.4" dartz: dependency: "direct main" description: @@ -85,6 +141,27 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "1.0.1" + fake_async: + dependency: transitive + description: + name: fake_async + 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 @@ -114,6 +191,13 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "3.1.0" + glob: + dependency: transitive + description: + name: glob + url: "https://pub.dartlang.org" + source: hosted + version: "2.1.0" http: dependency: "direct main" description: @@ -128,34 +212,48 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "3.1.3" - image: + js: dependency: transitive description: - name: image + name: js url: "https://pub.dartlang.org" source: hosted - version: "2.1.4" + version: "0.6.4" + logging: + dependency: transitive + description: + name: logging + url: "https://pub.dartlang.org" + source: hosted + version: "1.1.0" matcher: dependency: transitive description: name: matcher url: "https://pub.dartlang.org" source: hosted - version: "0.12.6" + version: "0.12.12" + material_color_utilities: + dependency: transitive + description: + name: material_color_utilities + url: "https://pub.dartlang.org" + source: hosted + version: "0.2.0" meta: dependency: transitive description: name: meta url: "https://pub.dartlang.org" source: hosted - version: "1.1.8" + version: "1.8.0" mockito: dependency: "direct dev" description: name: mockito url: "https://pub.dartlang.org" source: hosted - version: "4.1.1" + version: "5.3.2" nested: dependency: transitive description: @@ -163,13 +261,20 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "0.0.4" + package_config: + dependency: transitive + description: + name: package_config + url: "https://pub.dartlang.org" + source: hosted + version: "2.1.0" path: dependency: transitive description: name: path url: "https://pub.dartlang.org" source: hosted - version: "1.6.4" + version: "1.8.2" pedantic: dependency: transitive description: @@ -177,13 +282,6 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "1.8.0+1" - petitparser: - dependency: transitive - description: - name: petitparser - url: "https://pub.dartlang.org" - source: hosted - version: "2.4.0" provider: dependency: transitive description: @@ -191,13 +289,13 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "4.0.1" - quiver: + pub_semver: dependency: transitive description: - name: quiver + name: pub_semver url: "https://pub.dartlang.org" source: hosted - version: "2.0.5" + version: "2.1.2" rxdart: dependency: transitive description: @@ -238,69 +336,83 @@ packages: description: flutter source: sdk version: "0.0.99" + source_gen: + dependency: transitive + description: + name: source_gen + url: "https://pub.dartlang.org" + source: hosted + version: "1.2.6" source_span: dependency: transitive description: name: source_span url: "https://pub.dartlang.org" source: hosted - version: "1.5.5" + version: "1.9.1" stack_trace: dependency: transitive description: name: stack_trace url: "https://pub.dartlang.org" source: hosted - version: "1.9.3" + version: "1.10.0" stream_channel: dependency: transitive description: name: stream_channel url: "https://pub.dartlang.org" source: hosted - version: "2.0.0" + version: "2.1.1" string_scanner: dependency: transitive description: name: string_scanner url: "https://pub.dartlang.org" source: hosted - version: "1.0.5" + version: "1.1.1" term_glyph: dependency: transitive description: name: term_glyph url: "https://pub.dartlang.org" source: hosted - version: "1.1.0" + version: "1.2.1" test_api: dependency: transitive description: name: test_api url: "https://pub.dartlang.org" source: hosted - version: "0.2.11" + version: "0.4.14" typed_data: dependency: transitive description: name: typed_data url: "https://pub.dartlang.org" source: hosted - version: "1.1.6" + version: "1.3.0" vector_math: dependency: transitive description: name: vector_math url: "https://pub.dartlang.org" source: hosted - version: "2.0.8" - xml: + version: "2.1.4" + watcher: + dependency: transitive + description: + name: watcher + url: "https://pub.dartlang.org" + source: hosted + version: "1.0.2" + yaml: dependency: transitive description: - name: xml + name: yaml url: "https://pub.dartlang.org" source: hosted - version: "3.5.0" + version: "3.1.1" sdks: - dart: ">=2.6.0 <3.0.0" - flutter: ">=1.12.13+hotfix.4 <2.0.0" + dart: ">=2.18.0 <3.0.0" + flutter: ">=1.12.13+hotfix.4" diff --git a/pubspec.yaml b/pubspec.yaml index dcdb532..978c897 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -4,7 +4,7 @@ description: TDD Clean Architecture for Flutter version: 1.0.0+1 environment: - sdk: '>=2.6.0 <3.0.0' + sdk: ">=2.6.0 <3.0.0" dependencies: flutter: @@ -26,7 +26,7 @@ dependencies: dev_dependencies: flutter_test: sdk: flutter - mockito: ^4.1.1 + mockito: flutter: uses-material-design: true diff --git a/test/features/number_trivia/domain/usecases/get_random_number_trivia_test.dart b/test/features/number_trivia/domain/usecases/get_random_number_trivia_test.dart index f07116b..bdcdcf5 100644 --- a/test/features/number_trivia/domain/usecases/get_random_number_trivia_test.dart +++ b/test/features/number_trivia/domain/usecases/get_random_number_trivia_test.dart @@ -1,7 +1,6 @@ import 'package:clean_architecture_tdd_course/core/usecases/usecase.dart'; import 'package:clean_architecture_tdd_course/features/number_trivia/domain/entities/number_trivia.dart'; import 'package:clean_architecture_tdd_course/features/number_trivia/domain/repositories/number_trivia_repository.dart'; -import 'package:clean_architecture_tdd_course/features/number_trivia/domain/usecases/get_concrete_number_trivia.dart'; import 'package:clean_architecture_tdd_course/features/number_trivia/domain/usecases/get_random_number_trivia.dart'; import 'package:dartz/dartz.dart'; import 'package:mockito/mockito.dart';