From 792943e0db9b376088277fa6046c6bc2539746ce Mon Sep 17 00:00:00 2001 From: Edvaldo Martins Date: Mon, 18 Jul 2022 19:55:40 +0100 Subject: [PATCH 01/42] other improvements --- .flutter-plugins-dependencies | 2 +- android/.idea/gradle.xml | 1 - ...46186b246f5a36bd1f3f295d14a43abb1e2f38.xml | 9 -- ...46186b246f5a36bd1f3f295d14a43abb1e2f38.xml | 9 -- ...46186b246f5a36bd1f3f295d14a43abb1e2f38.xml | 11 -- ...46186b246f5a36bd1f3f295d14a43abb1e2f38.xml | 9 -- ...46186b246f5a36bd1f3f295d14a43abb1e2f38.xml | 9 -- .../libraries/Gradle__junit_junit_4_12.xml | 3 + android/.idea/modules.xml | 15 +++ .../-1630524150/android.url_launcher_web.iml | 2 +- .../android.shared_preferences_ios.iml | 2 +- .../android.url_launcher_windows.iml | 2 +- .../android.shared_preferences_linux.iml | 2 +- ...io.flutter.plugins.share.android.share.iml | 53 -------- ...mple.FlutterToast.android.fluttertoast.iml | 53 -------- .../android.shared_preferences_windows.iml | 2 +- .../-950154370/android.url_launcher.iml | 2 +- .../android.path_provider_windows.iml | 2 +- .../1160652728/android.shared_preferences.iml | 2 +- .../1411498274/android.url_launcher_linux.iml | 2 +- .../android.shared_preferences_web.iml | 2 +- .../android.path_provider_linux.iml | 2 +- .../2067546465/android.url_launcher_macos.iml | 2 +- .../301240790/android.url_launcher_ios.iml | 2 +- .../android.shared_preferences_android.iml | 58 --------- .../android.url_launcher_android.iml | 113 ------------------ .../android.shared_preferences_macos.iml | 2 +- android/.idea/modules/android.iml | 2 +- android/.idea/modules/app/android.app.iml | 75 ------------ ios/Runner.xcodeproj/project.pbxproj | 26 ++-- .../packages/base_package_service.dart | 2 +- 31 files changed, 48 insertions(+), 430 deletions(-) delete mode 100644 android/.idea/libraries/Gradle__io_flutter_arm64_v8a_debug_1_0_0_ab46186b246f5a36bd1f3f295d14a43abb1e2f38.xml delete mode 100644 android/.idea/libraries/Gradle__io_flutter_armeabi_v7a_debug_1_0_0_ab46186b246f5a36bd1f3f295d14a43abb1e2f38.xml delete mode 100644 android/.idea/libraries/Gradle__io_flutter_flutter_embedding_debug_1_0_0_ab46186b246f5a36bd1f3f295d14a43abb1e2f38.xml delete mode 100644 android/.idea/libraries/Gradle__io_flutter_x86_64_debug_1_0_0_ab46186b246f5a36bd1f3f295d14a43abb1e2f38.xml delete mode 100644 android/.idea/libraries/Gradle__io_flutter_x86_debug_1_0_0_ab46186b246f5a36bd1f3f295d14a43abb1e2f38.xml diff --git a/.flutter-plugins-dependencies b/.flutter-plugins-dependencies index d72517d..9500398 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.","plugins":{"ios":[{"name":"fluttertoast","path":"/Users/edvaldo/flutter/.pub-cache/hosted/pub.dartlang.org/fluttertoast-7.1.8/","dependencies":[]},{"name":"share","path":"/Users/edvaldo/flutter/.pub-cache/hosted/pub.dartlang.org/share-2.0.4/","dependencies":[]},{"name":"shared_preferences_ios","path":"/Users/edvaldo/flutter/.pub-cache/hosted/pub.dartlang.org/shared_preferences_ios-2.1.0/","dependencies":[]},{"name":"url_launcher_ios","path":"/Users/edvaldo/flutter/.pub-cache/hosted/pub.dartlang.org/url_launcher_ios-6.0.15/","dependencies":[]}],"android":[{"name":"fluttertoast","path":"/Users/edvaldo/flutter/.pub-cache/hosted/pub.dartlang.org/fluttertoast-7.1.8/","dependencies":[]},{"name":"share","path":"/Users/edvaldo/flutter/.pub-cache/hosted/pub.dartlang.org/share-2.0.4/","dependencies":[]},{"name":"shared_preferences_android","path":"/Users/edvaldo/flutter/.pub-cache/hosted/pub.dartlang.org/shared_preferences_android-2.0.11/","dependencies":[]},{"name":"url_launcher_android","path":"/Users/edvaldo/flutter/.pub-cache/hosted/pub.dartlang.org/url_launcher_android-6.0.15/","dependencies":[]}],"macos":[{"name":"shared_preferences_macos","path":"/Users/edvaldo/flutter/.pub-cache/hosted/pub.dartlang.org/shared_preferences_macos-2.0.3/","dependencies":[]},{"name":"url_launcher_macos","path":"/Users/edvaldo/flutter/.pub-cache/hosted/pub.dartlang.org/url_launcher_macos-3.0.0/","dependencies":[]}],"linux":[{"name":"path_provider_linux","path":"/Users/edvaldo/flutter/.pub-cache/hosted/pub.dartlang.org/path_provider_linux-2.1.5/","dependencies":[]},{"name":"shared_preferences_linux","path":"/Users/edvaldo/flutter/.pub-cache/hosted/pub.dartlang.org/shared_preferences_linux-2.1.0/","dependencies":["path_provider_linux"]},{"name":"url_launcher_linux","path":"/Users/edvaldo/flutter/.pub-cache/hosted/pub.dartlang.org/url_launcher_linux-3.0.0/","dependencies":[]}],"windows":[{"name":"path_provider_windows","path":"/Users/edvaldo/flutter/.pub-cache/hosted/pub.dartlang.org/path_provider_windows-2.0.5/","dependencies":[]},{"name":"shared_preferences_windows","path":"/Users/edvaldo/flutter/.pub-cache/hosted/pub.dartlang.org/shared_preferences_windows-2.1.0/","dependencies":["path_provider_windows"]},{"name":"url_launcher_windows","path":"/Users/edvaldo/flutter/.pub-cache/hosted/pub.dartlang.org/url_launcher_windows-3.0.0/","dependencies":[]}],"web":[{"name":"fluttertoast","path":"/Users/edvaldo/flutter/.pub-cache/hosted/pub.dartlang.org/fluttertoast-7.1.8/","dependencies":[]},{"name":"shared_preferences_web","path":"/Users/edvaldo/flutter/.pub-cache/hosted/pub.dartlang.org/shared_preferences_web-2.0.3/","dependencies":[]},{"name":"url_launcher_web","path":"/Users/edvaldo/flutter/.pub-cache/hosted/pub.dartlang.org/url_launcher_web-2.0.9/","dependencies":[]}]},"dependencyGraph":[{"name":"fluttertoast","dependencies":[]},{"name":"path_provider_linux","dependencies":[]},{"name":"path_provider_windows","dependencies":[]},{"name":"share","dependencies":[]},{"name":"shared_preferences","dependencies":["shared_preferences_android","shared_preferences_ios","shared_preferences_linux","shared_preferences_macos","shared_preferences_web","shared_preferences_windows"]},{"name":"shared_preferences_android","dependencies":[]},{"name":"shared_preferences_ios","dependencies":[]},{"name":"shared_preferences_linux","dependencies":["path_provider_linux"]},{"name":"shared_preferences_macos","dependencies":[]},{"name":"shared_preferences_web","dependencies":[]},{"name":"shared_preferences_windows","dependencies":["path_provider_windows"]},{"name":"url_launcher","dependencies":["url_launcher_android","url_launcher_ios","url_launcher_linux","url_launcher_macos","url_launcher_web","url_launcher_windows"]},{"name":"url_launcher_android","dependencies":[]},{"name":"url_launcher_ios","dependencies":[]},{"name":"url_launcher_linux","dependencies":[]},{"name":"url_launcher_macos","dependencies":[]},{"name":"url_launcher_web","dependencies":[]},{"name":"url_launcher_windows","dependencies":[]}],"date_created":"2022-07-17 22:23:11.700920","version":"2.10.5"} \ No newline at end of file +{"info":"This is a generated file; do not edit or check into version control.","plugins":{"ios":[{"name":"fluttertoast","path":"/Users/edvaldo/flutter/.pub-cache/hosted/pub.dartlang.org/fluttertoast-7.1.8/","dependencies":[]},{"name":"share","path":"/Users/edvaldo/flutter/.pub-cache/hosted/pub.dartlang.org/share-2.0.4/","dependencies":[]},{"name":"shared_preferences_ios","path":"/Users/edvaldo/flutter/.pub-cache/hosted/pub.dartlang.org/shared_preferences_ios-2.1.0/","dependencies":[]},{"name":"url_launcher_ios","path":"/Users/edvaldo/flutter/.pub-cache/hosted/pub.dartlang.org/url_launcher_ios-6.0.15/","dependencies":[]}],"android":[{"name":"fluttertoast","path":"/Users/edvaldo/flutter/.pub-cache/hosted/pub.dartlang.org/fluttertoast-7.1.8/","dependencies":[]},{"name":"share","path":"/Users/edvaldo/flutter/.pub-cache/hosted/pub.dartlang.org/share-2.0.4/","dependencies":[]},{"name":"shared_preferences_android","path":"/Users/edvaldo/flutter/.pub-cache/hosted/pub.dartlang.org/shared_preferences_android-2.0.11/","dependencies":[]},{"name":"url_launcher_android","path":"/Users/edvaldo/flutter/.pub-cache/hosted/pub.dartlang.org/url_launcher_android-6.0.15/","dependencies":[]}],"macos":[{"name":"shared_preferences_macos","path":"/Users/edvaldo/flutter/.pub-cache/hosted/pub.dartlang.org/shared_preferences_macos-2.0.3/","dependencies":[]},{"name":"url_launcher_macos","path":"/Users/edvaldo/flutter/.pub-cache/hosted/pub.dartlang.org/url_launcher_macos-3.0.0/","dependencies":[]}],"linux":[{"name":"path_provider_linux","path":"/Users/edvaldo/flutter/.pub-cache/hosted/pub.dartlang.org/path_provider_linux-2.1.5/","dependencies":[]},{"name":"shared_preferences_linux","path":"/Users/edvaldo/flutter/.pub-cache/hosted/pub.dartlang.org/shared_preferences_linux-2.1.0/","dependencies":["path_provider_linux"]},{"name":"url_launcher_linux","path":"/Users/edvaldo/flutter/.pub-cache/hosted/pub.dartlang.org/url_launcher_linux-3.0.0/","dependencies":[]}],"windows":[{"name":"path_provider_windows","path":"/Users/edvaldo/flutter/.pub-cache/hosted/pub.dartlang.org/path_provider_windows-2.0.5/","dependencies":[]},{"name":"shared_preferences_windows","path":"/Users/edvaldo/flutter/.pub-cache/hosted/pub.dartlang.org/shared_preferences_windows-2.1.0/","dependencies":["path_provider_windows"]},{"name":"url_launcher_windows","path":"/Users/edvaldo/flutter/.pub-cache/hosted/pub.dartlang.org/url_launcher_windows-3.0.0/","dependencies":[]}],"web":[{"name":"fluttertoast","path":"/Users/edvaldo/flutter/.pub-cache/hosted/pub.dartlang.org/fluttertoast-7.1.8/","dependencies":[]},{"name":"shared_preferences_web","path":"/Users/edvaldo/flutter/.pub-cache/hosted/pub.dartlang.org/shared_preferences_web-2.0.3/","dependencies":[]},{"name":"url_launcher_web","path":"/Users/edvaldo/flutter/.pub-cache/hosted/pub.dartlang.org/url_launcher_web-2.0.9/","dependencies":[]}]},"dependencyGraph":[{"name":"fluttertoast","dependencies":[]},{"name":"path_provider_linux","dependencies":[]},{"name":"path_provider_windows","dependencies":[]},{"name":"share","dependencies":[]},{"name":"shared_preferences","dependencies":["shared_preferences_android","shared_preferences_ios","shared_preferences_linux","shared_preferences_macos","shared_preferences_web","shared_preferences_windows"]},{"name":"shared_preferences_android","dependencies":[]},{"name":"shared_preferences_ios","dependencies":[]},{"name":"shared_preferences_linux","dependencies":["path_provider_linux"]},{"name":"shared_preferences_macos","dependencies":[]},{"name":"shared_preferences_web","dependencies":[]},{"name":"shared_preferences_windows","dependencies":["path_provider_windows"]},{"name":"url_launcher","dependencies":["url_launcher_android","url_launcher_ios","url_launcher_linux","url_launcher_macos","url_launcher_web","url_launcher_windows"]},{"name":"url_launcher_android","dependencies":[]},{"name":"url_launcher_ios","dependencies":[]},{"name":"url_launcher_linux","dependencies":[]},{"name":"url_launcher_macos","dependencies":[]},{"name":"url_launcher_web","dependencies":[]},{"name":"url_launcher_windows","dependencies":[]}],"date_created":"2022-07-18 19:55:11.348261","version":"2.10.5"} \ No newline at end of file diff --git a/android/.idea/gradle.xml b/android/.idea/gradle.xml index a284782..be34ff9 100644 --- a/android/.idea/gradle.xml +++ b/android/.idea/gradle.xml @@ -32,7 +32,6 @@ - diff --git a/android/.idea/libraries/Gradle__io_flutter_arm64_v8a_debug_1_0_0_ab46186b246f5a36bd1f3f295d14a43abb1e2f38.xml b/android/.idea/libraries/Gradle__io_flutter_arm64_v8a_debug_1_0_0_ab46186b246f5a36bd1f3f295d14a43abb1e2f38.xml deleted file mode 100644 index 36649e2..0000000 --- a/android/.idea/libraries/Gradle__io_flutter_arm64_v8a_debug_1_0_0_ab46186b246f5a36bd1f3f295d14a43abb1e2f38.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - - - \ No newline at end of file diff --git a/android/.idea/libraries/Gradle__io_flutter_armeabi_v7a_debug_1_0_0_ab46186b246f5a36bd1f3f295d14a43abb1e2f38.xml b/android/.idea/libraries/Gradle__io_flutter_armeabi_v7a_debug_1_0_0_ab46186b246f5a36bd1f3f295d14a43abb1e2f38.xml deleted file mode 100644 index c53d9a8..0000000 --- a/android/.idea/libraries/Gradle__io_flutter_armeabi_v7a_debug_1_0_0_ab46186b246f5a36bd1f3f295d14a43abb1e2f38.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - - - \ No newline at end of file diff --git a/android/.idea/libraries/Gradle__io_flutter_flutter_embedding_debug_1_0_0_ab46186b246f5a36bd1f3f295d14a43abb1e2f38.xml b/android/.idea/libraries/Gradle__io_flutter_flutter_embedding_debug_1_0_0_ab46186b246f5a36bd1f3f295d14a43abb1e2f38.xml deleted file mode 100644 index 89e57ff..0000000 --- a/android/.idea/libraries/Gradle__io_flutter_flutter_embedding_debug_1_0_0_ab46186b246f5a36bd1f3f295d14a43abb1e2f38.xml +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - - - - - - \ No newline at end of file diff --git a/android/.idea/libraries/Gradle__io_flutter_x86_64_debug_1_0_0_ab46186b246f5a36bd1f3f295d14a43abb1e2f38.xml b/android/.idea/libraries/Gradle__io_flutter_x86_64_debug_1_0_0_ab46186b246f5a36bd1f3f295d14a43abb1e2f38.xml deleted file mode 100644 index 04d892e..0000000 --- a/android/.idea/libraries/Gradle__io_flutter_x86_64_debug_1_0_0_ab46186b246f5a36bd1f3f295d14a43abb1e2f38.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - - - \ No newline at end of file diff --git a/android/.idea/libraries/Gradle__io_flutter_x86_debug_1_0_0_ab46186b246f5a36bd1f3f295d14a43abb1e2f38.xml b/android/.idea/libraries/Gradle__io_flutter_x86_debug_1_0_0_ab46186b246f5a36bd1f3f295d14a43abb1e2f38.xml deleted file mode 100644 index eb1cf28..0000000 --- a/android/.idea/libraries/Gradle__io_flutter_x86_debug_1_0_0_ab46186b246f5a36bd1f3f295d14a43abb1e2f38.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - - - \ No newline at end of file diff --git a/android/.idea/libraries/Gradle__junit_junit_4_12.xml b/android/.idea/libraries/Gradle__junit_junit_4_12.xml index 6c078d6..f7d27c4 100644 --- a/android/.idea/libraries/Gradle__junit_junit_4_12.xml +++ b/android/.idea/libraries/Gradle__junit_junit_4_12.xml @@ -1,5 +1,8 @@ + + + diff --git a/android/.idea/modules.xml b/android/.idea/modules.xml index b16b7b5..8376a77 100644 --- a/android/.idea/modules.xml +++ b/android/.idea/modules.xml @@ -4,10 +4,16 @@ + + + + + + @@ -15,13 +21,22 @@ + + + + + + + + + \ No newline at end of file diff --git a/android/.idea/modules/-1630524150/android.url_launcher_web.iml b/android/.idea/modules/-1630524150/android.url_launcher_web.iml index 591302e..cc43e81 100644 --- a/android/.idea/modules/-1630524150/android.url_launcher_web.iml +++ b/android/.idea/modules/-1630524150/android.url_launcher_web.iml @@ -14,7 +14,7 @@ - + diff --git a/android/.idea/modules/-1887855191/android.shared_preferences_ios.iml b/android/.idea/modules/-1887855191/android.shared_preferences_ios.iml index e9feda6..4356e63 100644 --- a/android/.idea/modules/-1887855191/android.shared_preferences_ios.iml +++ b/android/.idea/modules/-1887855191/android.shared_preferences_ios.iml @@ -14,7 +14,7 @@ - + diff --git a/android/.idea/modules/-2107231375/android.url_launcher_windows.iml b/android/.idea/modules/-2107231375/android.url_launcher_windows.iml index 0a13d52..5f990ee 100644 --- a/android/.idea/modules/-2107231375/android.url_launcher_windows.iml +++ b/android/.idea/modules/-2107231375/android.url_launcher_windows.iml @@ -14,7 +14,7 @@ - + diff --git a/android/.idea/modules/-361678384/android.shared_preferences_linux.iml b/android/.idea/modules/-361678384/android.shared_preferences_linux.iml index c090cb5..bc053bf 100644 --- a/android/.idea/modules/-361678384/android.shared_preferences_linux.iml +++ b/android/.idea/modules/-361678384/android.shared_preferences_linux.iml @@ -14,7 +14,7 @@ - + diff --git a/android/.idea/modules/-419568423/io.flutter.plugins.share.android.share.iml b/android/.idea/modules/-419568423/io.flutter.plugins.share.android.share.iml index af970dc..8b1a3e5 100644 --- a/android/.idea/modules/-419568423/io.flutter.plugins.share.android.share.iml +++ b/android/.idea/modules/-419568423/io.flutter.plugins.share.android.share.iml @@ -30,63 +30,10 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/android/.idea/modules/-719362859/com.example.FlutterToast.android.fluttertoast.iml b/android/.idea/modules/-719362859/com.example.FlutterToast.android.fluttertoast.iml index 9fa7d80..b8a7e5a 100644 --- a/android/.idea/modules/-719362859/com.example.FlutterToast.android.fluttertoast.iml +++ b/android/.idea/modules/-719362859/com.example.FlutterToast.android.fluttertoast.iml @@ -54,63 +54,10 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/android/.idea/modules/-730576737/android.shared_preferences_windows.iml b/android/.idea/modules/-730576737/android.shared_preferences_windows.iml index 202e148..d9a2ad7 100644 --- a/android/.idea/modules/-730576737/android.shared_preferences_windows.iml +++ b/android/.idea/modules/-730576737/android.shared_preferences_windows.iml @@ -14,7 +14,7 @@ - + diff --git a/android/.idea/modules/-950154370/android.url_launcher.iml b/android/.idea/modules/-950154370/android.url_launcher.iml index 769aa81..3267f76 100644 --- a/android/.idea/modules/-950154370/android.url_launcher.iml +++ b/android/.idea/modules/-950154370/android.url_launcher.iml @@ -14,7 +14,7 @@ - + diff --git a/android/.idea/modules/1020965130/android.path_provider_windows.iml b/android/.idea/modules/1020965130/android.path_provider_windows.iml index 70cd4c0..16bc476 100644 --- a/android/.idea/modules/1020965130/android.path_provider_windows.iml +++ b/android/.idea/modules/1020965130/android.path_provider_windows.iml @@ -14,7 +14,7 @@ - + diff --git a/android/.idea/modules/1160652728/android.shared_preferences.iml b/android/.idea/modules/1160652728/android.shared_preferences.iml index 1725d57..9115d82 100644 --- a/android/.idea/modules/1160652728/android.shared_preferences.iml +++ b/android/.idea/modules/1160652728/android.shared_preferences.iml @@ -14,7 +14,7 @@ - + diff --git a/android/.idea/modules/1411498274/android.url_launcher_linux.iml b/android/.idea/modules/1411498274/android.url_launcher_linux.iml index 4eb96e8..8bf9b73 100644 --- a/android/.idea/modules/1411498274/android.url_launcher_linux.iml +++ b/android/.idea/modules/1411498274/android.url_launcher_linux.iml @@ -14,7 +14,7 @@ - + diff --git a/android/.idea/modules/1499964146/android.shared_preferences_web.iml b/android/.idea/modules/1499964146/android.shared_preferences_web.iml index 87602a8..2816502 100644 --- a/android/.idea/modules/1499964146/android.shared_preferences_web.iml +++ b/android/.idea/modules/1499964146/android.shared_preferences_web.iml @@ -14,7 +14,7 @@ - + diff --git a/android/.idea/modules/1622684348/android.path_provider_linux.iml b/android/.idea/modules/1622684348/android.path_provider_linux.iml index 357f64c..485403e 100644 --- a/android/.idea/modules/1622684348/android.path_provider_linux.iml +++ b/android/.idea/modules/1622684348/android.path_provider_linux.iml @@ -14,7 +14,7 @@ - + diff --git a/android/.idea/modules/2067546465/android.url_launcher_macos.iml b/android/.idea/modules/2067546465/android.url_launcher_macos.iml index 139d255..72372d1 100644 --- a/android/.idea/modules/2067546465/android.url_launcher_macos.iml +++ b/android/.idea/modules/2067546465/android.url_launcher_macos.iml @@ -14,7 +14,7 @@ - + diff --git a/android/.idea/modules/301240790/android.url_launcher_ios.iml b/android/.idea/modules/301240790/android.url_launcher_ios.iml index e1d17ef..1bfba41 100644 --- a/android/.idea/modules/301240790/android.url_launcher_ios.iml +++ b/android/.idea/modules/301240790/android.url_launcher_ios.iml @@ -14,7 +14,7 @@ - + diff --git a/android/.idea/modules/662562694/android.shared_preferences_android.iml b/android/.idea/modules/662562694/android.shared_preferences_android.iml index 28f510a..42f2a41 100644 --- a/android/.idea/modules/662562694/android.shared_preferences_android.iml +++ b/android/.idea/modules/662562694/android.shared_preferences_android.iml @@ -30,68 +30,10 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/android/.idea/modules/908465460/android.url_launcher_android.iml b/android/.idea/modules/908465460/android.url_launcher_android.iml index 990fa34..e39902f 100644 --- a/android/.idea/modules/908465460/android.url_launcher_android.iml +++ b/android/.idea/modules/908465460/android.url_launcher_android.iml @@ -30,123 +30,10 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/android/.idea/modules/963925073/android.shared_preferences_macos.iml b/android/.idea/modules/963925073/android.shared_preferences_macos.iml index ac5138d..a478e98 100644 --- a/android/.idea/modules/963925073/android.shared_preferences_macos.iml +++ b/android/.idea/modules/963925073/android.shared_preferences_macos.iml @@ -14,7 +14,7 @@ - + diff --git a/android/.idea/modules/android.iml b/android/.idea/modules/android.iml index 4e86d15..08c63a9 100644 --- a/android/.idea/modules/android.iml +++ b/android/.idea/modules/android.iml @@ -7,7 +7,7 @@ - + diff --git a/android/.idea/modules/app/android.app.iml b/android/.idea/modules/app/android.app.iml index 3df58ad..894bd07 100644 --- a/android/.idea/modules/app/android.app.iml +++ b/android/.idea/modules/app/android.app.iml @@ -54,84 +54,9 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/ios/Runner.xcodeproj/project.pbxproj b/ios/Runner.xcodeproj/project.pbxproj index 91062d7..7dde90b 100644 --- a/ios/Runner.xcodeproj/project.pbxproj +++ b/ios/Runner.xcodeproj/project.pbxproj @@ -3,7 +3,7 @@ archiveVersion = 1; classes = { }; - objectVersion = 50; + objectVersion = 46; objects = { /* Begin PBXBuildFile section */ @@ -364,7 +364,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 14.1; + IPHONEOS_DEPLOYMENT_TARGET = 15.5; MTL_ENABLE_DEBUG_INFO = NO; SDKROOT = iphoneos; SUPPORTED_PLATFORMS = iphoneos; @@ -382,7 +382,7 @@ CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements; CODE_SIGN_IDENTITY = "iPhone Distribution"; CODE_SIGN_STYLE = Manual; - CURRENT_PROJECT_VERSION = 10; + CURRENT_PROJECT_VERSION = 11; DEVELOPMENT_TEAM = XSYCN6C3P4; ENABLE_BITCODE = NO; FRAMEWORK_SEARCH_PATHS = ( @@ -390,13 +390,13 @@ "$(PROJECT_DIR)/Flutter", ); INFOPLIST_FILE = Runner/Info.plist; - IPHONEOS_DEPLOYMENT_TARGET = 14.1; + IPHONEOS_DEPLOYMENT_TARGET = 15.5; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; LIBRARY_SEARCH_PATHS = ( "$(inherited)", "$(PROJECT_DIR)/Flutter", ); - MARKETING_VERSION = 0.0.2; + MARKETING_VERSION = 0.0.3; PRODUCT_BUNDLE_IDENTIFIER = nunioz.app.pubDev; PRODUCT_NAME = "$(TARGET_NAME)"; PROVISIONING_PROFILE_SPECIFIER = pub.release; @@ -454,7 +454,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 14.1; + IPHONEOS_DEPLOYMENT_TARGET = 15.5; MTL_ENABLE_DEBUG_INFO = YES; ONLY_ACTIVE_ARCH = YES; SDKROOT = iphoneos; @@ -503,7 +503,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 14.1; + IPHONEOS_DEPLOYMENT_TARGET = 15.5; MTL_ENABLE_DEBUG_INFO = NO; SDKROOT = iphoneos; SUPPORTED_PLATFORMS = iphoneos; @@ -522,7 +522,7 @@ CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements; CODE_SIGN_IDENTITY = "Apple Development"; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 10; + CURRENT_PROJECT_VERSION = 11; DEVELOPMENT_TEAM = XSYCN6C3P4; ENABLE_BITCODE = NO; FRAMEWORK_SEARCH_PATHS = ( @@ -530,13 +530,13 @@ "$(PROJECT_DIR)/Flutter", ); INFOPLIST_FILE = Runner/Info.plist; - IPHONEOS_DEPLOYMENT_TARGET = 14.1; + IPHONEOS_DEPLOYMENT_TARGET = 15.5; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; LIBRARY_SEARCH_PATHS = ( "$(inherited)", "$(PROJECT_DIR)/Flutter", ); - MARKETING_VERSION = 0.0.2; + MARKETING_VERSION = 0.0.3; PRODUCT_BUNDLE_IDENTIFIER = nunioz.app.pubDev; PRODUCT_NAME = "$(TARGET_NAME)"; PROVISIONING_PROFILE_SPECIFIER = ""; @@ -557,7 +557,7 @@ CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements; CODE_SIGN_IDENTITY = "iPhone Distribution"; CODE_SIGN_STYLE = Manual; - CURRENT_PROJECT_VERSION = 10; + CURRENT_PROJECT_VERSION = 11; DEVELOPMENT_TEAM = XSYCN6C3P4; ENABLE_BITCODE = NO; FRAMEWORK_SEARCH_PATHS = ( @@ -565,13 +565,13 @@ "$(PROJECT_DIR)/Flutter", ); INFOPLIST_FILE = Runner/Info.plist; - IPHONEOS_DEPLOYMENT_TARGET = 14.1; + IPHONEOS_DEPLOYMENT_TARGET = 15.5; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; LIBRARY_SEARCH_PATHS = ( "$(inherited)", "$(PROJECT_DIR)/Flutter", ); - MARKETING_VERSION = 0.0.2; + MARKETING_VERSION = 0.0.3; PRODUCT_BUNDLE_IDENTIFIER = nunioz.app.pubDev; PRODUCT_NAME = "$(TARGET_NAME)"; PROVISIONING_PROFILE_SPECIFIER = pub.release; diff --git a/lib/src/infrastructure/packages/base_package_service.dart b/lib/src/infrastructure/packages/base_package_service.dart index 5199132..efd2477 100644 --- a/lib/src/infrastructure/packages/base_package_service.dart +++ b/lib/src/infrastructure/packages/base_package_service.dart @@ -6,7 +6,7 @@ import 'package:flutter_package/src/domain/packages/i_package_repository.dart'; import 'package:flutter_package/src/domain/packages/i_package_service.dart'; class BasePackageService extends IPackageService { - BasePackageService(IPackageRepository service) : super(service); + BasePackageService(IPackageRepository repository) : super(repository); @override Future> getPackageName( From 61369ea4215bd1742f48c35b38b75a6bc61ce0f2 Mon Sep 17 00:00:00 2001 From: Edvaldo Martins Date: Mon, 18 Jul 2022 19:57:28 +0100 Subject: [PATCH 02/42] remove files --- .../package/package_view_model_test.dart | 26 ---------- .../package/base_package_repository_mock.dart | 51 ------------------- .../package/package_repository_test.dart | 27 ---------- 3 files changed, 104 deletions(-) delete mode 100644 test/src/application/package/package_view_model_test.dart delete mode 100644 test/src/infrastructure/package/base_package_repository_mock.dart delete mode 100644 test/src/infrastructure/package/package_repository_test.dart diff --git a/test/src/application/package/package_view_model_test.dart b/test/src/application/package/package_view_model_test.dart deleted file mode 100644 index a81458c..0000000 --- a/test/src/application/package/package_view_model_test.dart +++ /dev/null @@ -1,26 +0,0 @@ -import 'package:flutter_package/src/application/packages/packages_view_model.dart'; -import 'package:flutter_package/src/domain/packages/i_package_service.dart'; -import 'package:flutter_package/src/infrastructure/packages/base_package_service.dart'; -import 'package:flutter_test/flutter_test.dart'; - -import '../../infrastructure/package/base_package_repository_mock.dart'; - -void main() { - TestWidgetsFlutterBinding.ensureInitialized(); - - late IPackageService _iPackageService; - late PackagesViewModel _packagesViewModel; - - setUp(() { - _iPackageService = BasePackageService(BasePackageRepositoryMock()); - _packagesViewModel = PackagesViewModel(_iPackageService); - }); - - test('check if controller has data', () async { - expect(_packagesViewModel.hasData, false); - - await _packagesViewModel.load(); - - expect(_packagesViewModel.hasData, true); - }); -} diff --git a/test/src/infrastructure/package/base_package_repository_mock.dart b/test/src/infrastructure/package/base_package_repository_mock.dart deleted file mode 100644 index 6ee295b..0000000 --- a/test/src/infrastructure/package/base_package_repository_mock.dart +++ /dev/null @@ -1,51 +0,0 @@ -import 'package:dartz/dartz.dart'; -import 'package:flutter_package/src/domain/core/request_failure.dart'; -import 'package:flutter_package/src/domain/packages/entities/metric.dart'; -import 'package:flutter_package/src/domain/packages/entities/package.dart'; -import 'package:flutter_package/src/domain/packages/i_package_repository.dart'; -import 'package:flutter_package/src/infrastructure/core/mapper.dart'; -import 'package:mockito/mockito.dart'; - -import '../../data.dart'; - -class BasePackageRepositoryMock extends Mock implements IPackageRepository { - @override - Future> getMetricPackage( - {required String package}) { - // TODO: implement getMetricPackage - throw UnimplementedError(); - } - - @override - Future> getPackageName( - {required String namePackage}) async { - try { - var packages = List.from(DATA_FOR_TEST['packages'] as List) - .map((data) { - return Mapper.packageFromMap(data); - }).toList(); - - var index = packages.indexWhere((package) => package.name == namePackage); - - if (index >= 0) return Right(packages[index]); - } catch (error) {} - return left(RequestFailure.empty()); - } - - @override - Future>> getPackages( - {required int page}) async { - try { - var packages = List.from(DATA_FOR_TEST['packages'] as List) - .map((data) { - return Mapper.packageFromMap(data); - }).toList(); - - return (packages.isEmpty) - ? Left(RequestFailure.empty()) - : Right(packages); - } catch (error) { - return left(RequestFailure.empty()); - } - } -} diff --git a/test/src/infrastructure/package/package_repository_test.dart b/test/src/infrastructure/package/package_repository_test.dart deleted file mode 100644 index 9e349a2..0000000 --- a/test/src/infrastructure/package/package_repository_test.dart +++ /dev/null @@ -1,27 +0,0 @@ -import 'package:dartz/dartz.dart'; -import 'package:flutter_package/src/domain/packages/i_package_service.dart'; -import 'package:flutter_package/src/infrastructure/packages/base_package_service.dart'; -import 'package:flutter_test/flutter_test.dart'; - -import 'base_package_repository_mock.dart'; - -void main() { - TestWidgetsFlutterBinding.ensureInitialized(); - - late IPackageService _iPackageService; - - setUp(() { - _iPackageService = BasePackageService(BasePackageRepositoryMock()); - }); - - test('when get list of package is not empty', () async { - var result = await _iPackageService.getPackages(page: 0); - expect(result is Right, true); - }); - - test('when get package for name is successfully', () async { - var name = 'regex_builder'; - var result = await _iPackageService.getPackageName(namePackage: name); - expect(result.isRight(), true); - }); -} From 1954d3a786f2cced6bf82b953b01a62f5c1b1d53 Mon Sep 17 00:00:00 2001 From: Edvaldo Martins Date: Mon, 18 Jul 2022 19:58:22 +0100 Subject: [PATCH 03/42] remove files -v2 --- test/src/data.dart | 351 --------------------------------------------- 1 file changed, 351 deletions(-) delete mode 100644 test/src/data.dart diff --git a/test/src/data.dart b/test/src/data.dart deleted file mode 100644 index dd62436..0000000 --- a/test/src/data.dart +++ /dev/null @@ -1,351 +0,0 @@ -const DATA_FOR_TEST = { - "packages": [ - { - "name": "custom_components_flutter", - "latest": { - "version": "0.0.3", - "pubspec": { - "name": "custom_components_flutter", - "description": "A collection of customised reusable components.", - "version": "0.0.3", - "homepage": "https://github.com/mohammedismayil/custom_components_flutter", - "environment": { - "sdk": ">=2.15.0 <3.0.0", - "flutter": ">=1.17.0" - }, - "dependencies": { - "flutter": { - "sdk": "flutter" - } - }, - "dev_dependencies": { - "flutter_test": { - "sdk": "flutter" - }, - "flutter_lints": "^1.0.0" - }, - "flutter": null - }, - "archive_url": "https://pub.dartlang.org/packages/custom_components_flutter/versions/0.0.3.tar.gz", - "package_url": "https://pub.dartlang.org/api/packages/custom_components_flutter", - "url": "https://pub.dartlang.org/api/packages/custom_components_flutter/versions/0.0.3" - } - }, - { - "name": "codis_generator", - "latest": { - "version": "0.0.2", - "pubspec": { - "name": "codis_generator", - "version": "0.0.2", - "homepage": "https://github.com/codis-io/code_generator", - "description": "DartWriter provides API to generate Dart source code. It can make your job easier while developing flutter/dart tools. You can also generate Flutter UI code.", - "environment": { - "sdk": ">=2.12.0 <3.0.0" - }, - "dependencies": { - "dart_style": "^2.2.3" - }, - "dev_dependencies": { - "lints": "^2.0.0" - } - }, - "archive_url": "https://pub.dartlang.org/packages/codis_generator/versions/0.0.2.tar.gz", - "package_url": "https://pub.dartlang.org/api/packages/codis_generator", - "url": "https://pub.dartlang.org/api/packages/codis_generator/versions/0.0.2" - } - }, - { - "name": "google_play_scraper", - "latest": { - "version": "0.0.4", - "pubspec": { - "name": "google_play_scraper", - "description": "Scraper google play store apps data", - "version": "0.0.4", - "homepage": "https://github.com/shhossain/google_play_scraper", - "environment": { - "sdk": ">=2.12.0 <3.0.0" - }, - "dependencies": { - "html_unescape": "^2.0.0", - "http": "^0.13.4" - }, - "platforms": { - "android": null, - "ios": null, - "linux": null, - "macos": null, - "web": null, - "windows": null - }, - "dev_dependencies": { - "lints": "^1.0.1", - "test": "^1.21.2" - } - }, - "archive_url": "https://pub.dartlang.org/packages/google_play_scraper/versions/0.0.4.tar.gz", - "package_url": "https://pub.dartlang.org/api/packages/google_play_scraper", - "url": "https://pub.dartlang.org/api/packages/google_play_scraper/versions/0.0.4" - } - }, - { - "name": "xbr_gaode_amap", - "latest": { - "version": "2.0.1", - "pubspec": { - "name": "xbr_gaode_amap", - "description": "小镖人高德地图插件,再封装插件,增加查询功能,也可以单独使用查询插件 xbr_gaode_search,如需定位,可使用:xbr_gaode_location", - "version": "2.0.1", - "homepage": "https://gitee.com/mywentop", - "environment": { - "sdk": ">=2.12.0 <3.0.0", - "flutter": ">=1.20.0" - }, - "dependencies": { - "flutter": { - "sdk": "flutter" - }, - "flutter_plugin_android_lifecycle": "^2.0.1", - "meta": "^1.3.0", - "plugin_platform_interface": "^2.0.0", - "stream_transform": "^2.0.0", - "xbr_gaode_search": "^2.0.0" - }, - "dev_dependencies": { - "flutter_test": { - "sdk": "flutter" - } - }, - "flutter": { - "plugin": { - "platforms": { - "android": { - "package": "com.yilin.xbr.xbr_gaode_amap", - "pluginClass": "AMapFlutterMapPlugin" - }, - "ios": { - "pluginClass": "AMapFlutterMapPlugin" - } - } - } - } - }, - "archive_url": "https://pub.dartlang.org/packages/xbr_gaode_amap/versions/2.0.1.tar.gz", - "package_url": "https://pub.dartlang.org/api/packages/xbr_gaode_amap", - "url": "https://pub.dartlang.org/api/packages/xbr_gaode_amap/versions/2.0.1" - } - }, - { - "name": "regex_builder", - "latest": { - "version": "0.1.0+2", - "pubspec": { - "name": "regex_builder", - "description": "A declarative builder for Regex.", - "version": "0.1.0+2", - "homepage": "https://github.com/ailtonvivaz/regex_builder", - "environment": { - "sdk": ">=2.17.1 <3.0.0" - }, - "dependencies": { - "meta": "^1.8.0" - }, - "dev_dependencies": { - "lints": "^2.0.0", - "test": "^1.16.0" - } - }, - "archive_url": "https://pub.dartlang.org/packages/regex_builder/versions/0.1.0%2B2.tar.gz", - "package_url": "https://pub.dartlang.org/api/packages/regex_builder", - "url": "https://pub.dartlang.org/api/packages/regex_builder/versions/0.1.0%2B2" - } - }, - { - "name": "efficient_autocomplete_formfield", - "latest": { - "version": "0.3.2+1", - "pubspec": { - "name": "efficient_autocomplete_formfield", - "description": "Improve TextFormFields with efficient autocomplete features.", - "version": "0.3.2+1", - "homepage": "https://github.com/yurtemre7/efficient_autocomplete_formfield", - "dependencies": { - "flutter": { - "sdk": "flutter" - }, - "textfield_state": "^0.3.0" - }, - "dev_dependencies": { - "flutter_test": { - "sdk": "flutter" - }, - "flutter_lints": null - }, - "environment": { - "sdk": ">=2.17.0 <3.0.0" - } - }, - "archive_url": "https://pub.dartlang.org/packages/efficient_autocomplete_formfield/versions/0.3.2%2B1.tar.gz", - "package_url": "https://pub.dartlang.org/api/packages/efficient_autocomplete_formfield", - "url": "https://pub.dartlang.org/api/packages/efficient_autocomplete_formfield/versions/0.3.2%2B1" - } - }, - { - "name": "flutter_batteries", - "latest": { - "version": "0.0.5-dev", - "pubspec": { - "name": "flutter_batteries", - "description": "A set of typical classes, extensions and utilities for dart and flutter that help in development.\n", - "version": "0.0.5-dev", - "repository": "https://github.com/PlugFox/batteries", - "issue_tracker": "https://github.com/PlugFox/batteries/issues", - "homepage": "https://github.com/PlugFox/batteries", - "environment": { - "sdk": ">=2.17.0 <3.0.0", - "flutter": ">=3.0.0" - }, - "dependencies": { - "flutter": { - "sdk": "flutter" - }, - "meta": "^1.7.0", - "batteries": "^0.0.4-dev" - }, - "dev_dependencies": { - "flutter_test": { - "sdk": "flutter" - }, - "build_runner": "^2.1.8", - "mockito": "^5.1.0", - "coverage": "^1.2.0" - } - }, - "archive_url": "https://pub.dartlang.org/packages/flutter_batteries/versions/0.0.5-dev.tar.gz", - "package_url": "https://pub.dartlang.org/api/packages/flutter_batteries", - "url": "https://pub.dartlang.org/api/packages/flutter_batteries/versions/0.0.5-dev" - } - }, - { - "name": "neis", - "latest": { - "version": "1.0.5", - "pubspec": { - "name": "neis", - "description": "neis에서 시간표, 일정, 급식을 불러오는 플러그인 입니다.", - "version": "1.0.5", - "homepage": "https://github.com/minikupa/neis", - "environment": { - "sdk": ">=2.17.5 <3.0.0", - "flutter": ">=2.5.0" - }, - "dependencies": { - "flutter": { - "sdk": "flutter" - }, - "http": "^0.13.4", - "intl": "^0.17.0", - "flutter_web_plugins": { - "sdk": "flutter" - }, - "plugin_platform_interface": "^2.0.2" - }, - "dev_dependencies": { - "flutter_test": { - "sdk": "flutter" - }, - "flutter_lints": "^2.0.0" - }, - "flutter": { - "plugin": { - "platforms": { - "android": { - "package": "com.mk.neis", - "pluginClass": "NeisPlugin" - }, - "ios": { - "pluginClass": "NeisPlugin" - }, - "web": { - "pluginClass": "NeisWeb", - "fileName": "neis_web.dart" - } - } - } - } - }, - "archive_url": "https://pub.dartlang.org/packages/neis/versions/1.0.5.tar.gz", - "package_url": "https://pub.dartlang.org/api/packages/neis", - "url": "https://pub.dartlang.org/api/packages/neis/versions/1.0.5" - } - }, - { - "name": "open_library_api", - "latest": { - "version": "0.1.6", - "pubspec": { - "name": "open_library_api", - "description": "A flutter package to consume the openlibrary.org api in a simple way", - "version": "0.1.6", - "homepage": "https://github.com/Pastajello/open_library-main", - "documentation": "https://github.com/Pastajello/open_library-main", - "repository": "https://github.com/Pastajello/open_library-main", - "environment": { - "sdk": ">=2.12.0 <3.0.0" - }, - "dependencies": { - "chopper": "^4.0.4", - "equatable": "^2.0.3", - "json_annotation": "^4.4.0" - }, - "dev_dependencies": { - "chopper_generator": "^4.0.3", - "json_serializable": "^6.1.3", - "test": "^1.16.0", - "build_runner": null - } - }, - "archive_url": "https://pub.dartlang.org/packages/open_library_api/versions/0.1.6.tar.gz", - "package_url": "https://pub.dartlang.org/api/packages/open_library_api", - "url": "https://pub.dartlang.org/api/packages/open_library_api/versions/0.1.6" - } - }, - { - "name": "yaru_widgets", - "latest": { - "version": "1.1.1", - "pubspec": { - "name": "yaru_widgets", - "description": "Common flutter widgets useful for building desktop and web applications.", - "homepage": "https://github.com/ubuntu/yaru_widgets.dart", - "version": "1.1.1", - "environment": { - "sdk": ">=2.17.0 <3.0.0", - "flutter": ">=3.0.0" - }, - "dependencies": { - "flutter": { - "sdk": "flutter" - } - }, - "dev_dependencies": { - "flutter_test": { - "sdk": "flutter" - }, - "flutter_lints": "^1.0.0" - }, - "flutter": { - "assets": [ - "assets/" - ], - "uses-material-design": true - } - }, - "archive_url": "https://pub.dartlang.org/packages/yaru_widgets/versions/1.1.1.tar.gz", - "package_url": "https://pub.dartlang.org/api/packages/yaru_widgets", - "url": "https://pub.dartlang.org/api/packages/yaru_widgets/versions/1.1.1" - } - }, - ] -}; \ No newline at end of file From ad66e2ce68eaf3195632c4f528eb7bff8b41c3fe Mon Sep 17 00:00:00 2001 From: Edvaldo Martins Date: Mon, 18 Jul 2022 19:59:09 +0100 Subject: [PATCH 04/42] add mocks --- test/src/infrastructure/mocks.dart | 8 + test/src/infrastructure/mocks.mocks.dart | 462 +++++++++++++++++++++++ 2 files changed, 470 insertions(+) create mode 100644 test/src/infrastructure/mocks.dart create mode 100644 test/src/infrastructure/mocks.mocks.dart diff --git a/test/src/infrastructure/mocks.dart b/test/src/infrastructure/mocks.dart new file mode 100644 index 0000000..20b2d77 --- /dev/null +++ b/test/src/infrastructure/mocks.dart @@ -0,0 +1,8 @@ +import 'package:dio/dio.dart'; +import 'package:flutter_package/src/domain/packages/i_package_repository.dart'; +import 'package:flutter_package/src/domain/search/i_search_repository.dart'; +import 'package:mockito/annotations.dart'; + +@GenerateMocks([IPackageRepository, ISearchRepository], + customMocks: [MockSpec(as: #MockApi)]) +void main() {} diff --git a/test/src/infrastructure/mocks.mocks.dart b/test/src/infrastructure/mocks.mocks.dart new file mode 100644 index 0000000..aa78029 --- /dev/null +++ b/test/src/infrastructure/mocks.mocks.dart @@ -0,0 +1,462 @@ +// Mocks generated by Mockito 5.0.15 from annotations +// in flutter_package/test/src/infrastructure/mocks.dart. +// Do not manually edit this file. + +import 'dart:async' as _i5; + +import 'package:dartz/dartz.dart' as _i3; +import 'package:dio/dio.dart' as _i2; +import 'package:flutter_package/src/domain/core/request_failure.dart' as _i6; +import 'package:flutter_package/src/domain/packages/entities/metric.dart' + as _i8; +import 'package:flutter_package/src/domain/packages/entities/package.dart' + as _i7; +import 'package:flutter_package/src/domain/packages/i_package_repository.dart' + as _i4; +import 'package:flutter_package/src/domain/search/i_search_repository.dart' + as _i9; +import 'package:mockito/mockito.dart' as _i1; + +// ignore_for_file: avoid_redundant_argument_values +// ignore_for_file: avoid_setters_without_getters +// ignore_for_file: comment_references +// ignore_for_file: implementation_imports +// ignore_for_file: invalid_use_of_visible_for_testing_member +// ignore_for_file: prefer_const_constructors +// ignore_for_file: unnecessary_parenthesis + +class _FakeDio_0 extends _i1.Fake implements _i2.Dio {} + +class _FakeEither_1 extends _i1.Fake implements _i3.Either {} + +class _FakeBaseOptions_2 extends _i1.Fake implements _i2.BaseOptions {} + +class _FakeHttpClientAdapter_3 extends _i1.Fake + implements _i2.HttpClientAdapter {} + +class _FakeTransformer_4 extends _i1.Fake implements _i2.Transformer {} + +class _FakeInterceptors_5 extends _i1.Fake implements _i2.Interceptors {} + +class _FakeResponse_6 extends _i1.Fake implements _i2.Response {} + +/// A class which mocks [IPackageRepository]. +/// +/// See the documentation for Mockito's code generation for more information. +class MockIPackageRepository extends _i1.Mock + implements _i4.IPackageRepository { + MockIPackageRepository() { + _i1.throwOnMissingStub(this); + } + + @override + String get path => + (super.noSuchMethod(Invocation.getter(#path), returnValue: '') as String); + @override + _i2.Dio get dio => + (super.noSuchMethod(Invocation.getter(#dio), returnValue: _FakeDio_0()) + as _i2.Dio); + @override + _i5.Future<_i3.Either<_i6.RequestFailure, List<_i7.Package>>> getPackages( + {int? page}) => + (super.noSuchMethod(Invocation.method(#getPackages, [], {#page: page}), + returnValue: Future< + _i3.Either<_i6.RequestFailure, List<_i7.Package>>>.value( + _FakeEither_1<_i6.RequestFailure, List<_i7.Package>>())) + as _i5.Future<_i3.Either<_i6.RequestFailure, List<_i7.Package>>>); + @override + _i5.Future<_i3.Either<_i6.RequestFailure, _i7.Package>> getPackageName( + {String? namePackage}) => + (super.noSuchMethod( + Invocation.method(#getPackageName, [], {#namePackage: namePackage}), + returnValue: + Future<_i3.Either<_i6.RequestFailure, _i7.Package>>.value( + _FakeEither_1<_i6.RequestFailure, _i7.Package>())) as _i5 + .Future<_i3.Either<_i6.RequestFailure, _i7.Package>>); + @override + _i5.Future<_i3.Either<_i6.RequestFailure, _i8.Metric>> getMetricPackage( + {String? package}) => + (super.noSuchMethod( + Invocation.method(#getMetricPackage, [], {#package: package}), + returnValue: Future<_i3.Either<_i6.RequestFailure, _i8.Metric>>.value( + _FakeEither_1<_i6.RequestFailure, _i8.Metric>())) as _i5 + .Future<_i3.Either<_i6.RequestFailure, _i8.Metric>>); + @override + String toString() => super.toString(); +} + +/// A class which mocks [ISearchRepository]. +/// +/// See the documentation for Mockito's code generation for more information. +class MockISearchRepository extends _i1.Mock implements _i9.ISearchRepository { + MockISearchRepository() { + _i1.throwOnMissingStub(this); + } + + @override + String get path => + (super.noSuchMethod(Invocation.getter(#path), returnValue: '') as String); + @override + _i2.Dio get dio => + (super.noSuchMethod(Invocation.getter(#dio), returnValue: _FakeDio_0()) + as _i2.Dio); + @override + _i5.Future<_i3.Either<_i6.RequestFailure, List>> searchPackage( + {int? page, String? query}) => + (super.noSuchMethod( + Invocation.method(#searchPackage, [], {#page: page, #query: query}), + returnValue: + Future<_i3.Either<_i6.RequestFailure, List>>.value( + _FakeEither_1<_i6.RequestFailure, List>())) as _i5 + .Future<_i3.Either<_i6.RequestFailure, List>>); + @override + String toString() => super.toString(); +} + +/// A class which mocks [Dio]. +/// +/// See the documentation for Mockito's code generation for more information. +class MockApi extends _i1.Mock implements _i2.Dio { + MockApi() { + _i1.throwOnMissingStub(this); + } + + @override + _i2.BaseOptions get options => + (super.noSuchMethod(Invocation.getter(#options), + returnValue: _FakeBaseOptions_2()) as _i2.BaseOptions); + @override + set options(_i2.BaseOptions? _options) => + super.noSuchMethod(Invocation.setter(#options, _options), + returnValueForMissingStub: null); + @override + _i2.HttpClientAdapter get httpClientAdapter => + (super.noSuchMethod(Invocation.getter(#httpClientAdapter), + returnValue: _FakeHttpClientAdapter_3()) as _i2.HttpClientAdapter); + @override + set httpClientAdapter(_i2.HttpClientAdapter? _httpClientAdapter) => super + .noSuchMethod(Invocation.setter(#httpClientAdapter, _httpClientAdapter), + returnValueForMissingStub: null); + @override + _i2.Transformer get transformer => + (super.noSuchMethod(Invocation.getter(#transformer), + returnValue: _FakeTransformer_4()) as _i2.Transformer); + @override + set transformer(_i2.Transformer? _transformer) => + super.noSuchMethod(Invocation.setter(#transformer, _transformer), + returnValueForMissingStub: null); + @override + _i2.Interceptors get interceptors => + (super.noSuchMethod(Invocation.getter(#interceptors), + returnValue: _FakeInterceptors_5()) as _i2.Interceptors); + @override + void close({bool? force = false}) => + super.noSuchMethod(Invocation.method(#close, [], {#force: force}), + returnValueForMissingStub: null); + @override + _i5.Future<_i2.Response> get(String? path, + {Map? queryParameters, + _i2.Options? options, + _i2.CancelToken? cancelToken, + _i2.ProgressCallback? onReceiveProgress}) => + (super.noSuchMethod( + Invocation.method(#get, [ + path + ], { + #queryParameters: queryParameters, + #options: options, + #cancelToken: cancelToken, + #onReceiveProgress: onReceiveProgress + }), + returnValue: Future<_i2.Response>.value(_FakeResponse_6())) + as _i5.Future<_i2.Response>); + @override + _i5.Future<_i2.Response> getUri(Uri? uri, + {_i2.Options? options, + _i2.CancelToken? cancelToken, + _i2.ProgressCallback? onReceiveProgress}) => + (super.noSuchMethod( + Invocation.method(#getUri, [ + uri + ], { + #options: options, + #cancelToken: cancelToken, + #onReceiveProgress: onReceiveProgress + }), + returnValue: Future<_i2.Response>.value(_FakeResponse_6())) + as _i5.Future<_i2.Response>); + @override + _i5.Future<_i2.Response> post(String? path, + {dynamic data, + Map? queryParameters, + _i2.Options? options, + _i2.CancelToken? cancelToken, + _i2.ProgressCallback? onSendProgress, + _i2.ProgressCallback? onReceiveProgress}) => + (super.noSuchMethod( + Invocation.method(#post, [ + path + ], { + #data: data, + #queryParameters: queryParameters, + #options: options, + #cancelToken: cancelToken, + #onSendProgress: onSendProgress, + #onReceiveProgress: onReceiveProgress + }), + returnValue: Future<_i2.Response>.value(_FakeResponse_6())) + as _i5.Future<_i2.Response>); + @override + _i5.Future<_i2.Response> postUri(Uri? uri, + {dynamic data, + _i2.Options? options, + _i2.CancelToken? cancelToken, + _i2.ProgressCallback? onSendProgress, + _i2.ProgressCallback? onReceiveProgress}) => + (super.noSuchMethod( + Invocation.method(#postUri, [ + uri + ], { + #data: data, + #options: options, + #cancelToken: cancelToken, + #onSendProgress: onSendProgress, + #onReceiveProgress: onReceiveProgress + }), + returnValue: Future<_i2.Response>.value(_FakeResponse_6())) + as _i5.Future<_i2.Response>); + @override + _i5.Future<_i2.Response> put(String? path, + {dynamic data, + Map? queryParameters, + _i2.Options? options, + _i2.CancelToken? cancelToken, + _i2.ProgressCallback? onSendProgress, + _i2.ProgressCallback? onReceiveProgress}) => + (super.noSuchMethod( + Invocation.method(#put, [ + path + ], { + #data: data, + #queryParameters: queryParameters, + #options: options, + #cancelToken: cancelToken, + #onSendProgress: onSendProgress, + #onReceiveProgress: onReceiveProgress + }), + returnValue: Future<_i2.Response>.value(_FakeResponse_6())) + as _i5.Future<_i2.Response>); + @override + _i5.Future<_i2.Response> putUri(Uri? uri, + {dynamic data, + _i2.Options? options, + _i2.CancelToken? cancelToken, + _i2.ProgressCallback? onSendProgress, + _i2.ProgressCallback? onReceiveProgress}) => + (super.noSuchMethod( + Invocation.method(#putUri, [ + uri + ], { + #data: data, + #options: options, + #cancelToken: cancelToken, + #onSendProgress: onSendProgress, + #onReceiveProgress: onReceiveProgress + }), + returnValue: Future<_i2.Response>.value(_FakeResponse_6())) + as _i5.Future<_i2.Response>); + @override + _i5.Future<_i2.Response> head(String? path, + {dynamic data, + Map? queryParameters, + _i2.Options? options, + _i2.CancelToken? cancelToken}) => + (super.noSuchMethod( + Invocation.method(#head, [ + path + ], { + #data: data, + #queryParameters: queryParameters, + #options: options, + #cancelToken: cancelToken + }), + returnValue: Future<_i2.Response>.value(_FakeResponse_6())) + as _i5.Future<_i2.Response>); + @override + _i5.Future<_i2.Response> headUri(Uri? uri, + {dynamic data, _i2.Options? options, _i2.CancelToken? cancelToken}) => + (super.noSuchMethod( + Invocation.method(#headUri, [uri], + {#data: data, #options: options, #cancelToken: cancelToken}), + returnValue: Future<_i2.Response>.value(_FakeResponse_6())) + as _i5.Future<_i2.Response>); + @override + _i5.Future<_i2.Response> delete(String? path, + {dynamic data, + Map? queryParameters, + _i2.Options? options, + _i2.CancelToken? cancelToken}) => + (super.noSuchMethod( + Invocation.method(#delete, [ + path + ], { + #data: data, + #queryParameters: queryParameters, + #options: options, + #cancelToken: cancelToken + }), + returnValue: Future<_i2.Response>.value(_FakeResponse_6())) + as _i5.Future<_i2.Response>); + @override + _i5.Future<_i2.Response> deleteUri(Uri? uri, + {dynamic data, _i2.Options? options, _i2.CancelToken? cancelToken}) => + (super.noSuchMethod( + Invocation.method(#deleteUri, [uri], + {#data: data, #options: options, #cancelToken: cancelToken}), + returnValue: Future<_i2.Response>.value(_FakeResponse_6())) + as _i5.Future<_i2.Response>); + @override + _i5.Future<_i2.Response> patch(String? path, + {dynamic data, + Map? queryParameters, + _i2.Options? options, + _i2.CancelToken? cancelToken, + _i2.ProgressCallback? onSendProgress, + _i2.ProgressCallback? onReceiveProgress}) => + (super.noSuchMethod( + Invocation.method(#patch, [ + path + ], { + #data: data, + #queryParameters: queryParameters, + #options: options, + #cancelToken: cancelToken, + #onSendProgress: onSendProgress, + #onReceiveProgress: onReceiveProgress + }), + returnValue: Future<_i2.Response>.value(_FakeResponse_6())) + as _i5.Future<_i2.Response>); + @override + _i5.Future<_i2.Response> patchUri(Uri? uri, + {dynamic data, + _i2.Options? options, + _i2.CancelToken? cancelToken, + _i2.ProgressCallback? onSendProgress, + _i2.ProgressCallback? onReceiveProgress}) => + (super.noSuchMethod( + Invocation.method(#patchUri, [ + uri + ], { + #data: data, + #options: options, + #cancelToken: cancelToken, + #onSendProgress: onSendProgress, + #onReceiveProgress: onReceiveProgress + }), + returnValue: Future<_i2.Response>.value(_FakeResponse_6())) + as _i5.Future<_i2.Response>); + @override + void lock() => super.noSuchMethod(Invocation.method(#lock, []), + returnValueForMissingStub: null); + @override + void unlock() => super.noSuchMethod(Invocation.method(#unlock, []), + returnValueForMissingStub: null); + @override + void clear() => super.noSuchMethod(Invocation.method(#clear, []), + returnValueForMissingStub: null); + @override + _i5.Future<_i2.Response> download(String? urlPath, dynamic savePath, + {_i2.ProgressCallback? onReceiveProgress, + Map? queryParameters, + _i2.CancelToken? cancelToken, + bool? deleteOnError = true, + String? lengthHeader = r'content-length', + dynamic data, + _i2.Options? options}) => + (super.noSuchMethod( + Invocation.method(#download, [ + urlPath, + savePath + ], { + #onReceiveProgress: onReceiveProgress, + #queryParameters: queryParameters, + #cancelToken: cancelToken, + #deleteOnError: deleteOnError, + #lengthHeader: lengthHeader, + #data: data, + #options: options + }), + returnValue: Future<_i2.Response>.value( + _FakeResponse_6())) + as _i5.Future<_i2.Response>); + @override + _i5.Future<_i2.Response> downloadUri(Uri? uri, dynamic savePath, + {_i2.ProgressCallback? onReceiveProgress, + _i2.CancelToken? cancelToken, + bool? deleteOnError = true, + String? lengthHeader = r'content-length', + dynamic data, + _i2.Options? options}) => + (super.noSuchMethod( + Invocation.method(#downloadUri, [ + uri, + savePath + ], { + #onReceiveProgress: onReceiveProgress, + #cancelToken: cancelToken, + #deleteOnError: deleteOnError, + #lengthHeader: lengthHeader, + #data: data, + #options: options + }), + returnValue: Future<_i2.Response>.value( + _FakeResponse_6())) + as _i5.Future<_i2.Response>); + @override + _i5.Future<_i2.Response> request(String? path, + {dynamic data, + Map? queryParameters, + _i2.CancelToken? cancelToken, + _i2.Options? options, + _i2.ProgressCallback? onSendProgress, + _i2.ProgressCallback? onReceiveProgress}) => + (super.noSuchMethod( + Invocation.method(#request, [ + path + ], { + #data: data, + #queryParameters: queryParameters, + #cancelToken: cancelToken, + #options: options, + #onSendProgress: onSendProgress, + #onReceiveProgress: onReceiveProgress + }), + returnValue: Future<_i2.Response>.value(_FakeResponse_6())) + as _i5.Future<_i2.Response>); + @override + _i5.Future<_i2.Response> requestUri(Uri? uri, + {dynamic data, + _i2.CancelToken? cancelToken, + _i2.Options? options, + _i2.ProgressCallback? onSendProgress, + _i2.ProgressCallback? onReceiveProgress}) => + (super.noSuchMethod( + Invocation.method(#requestUri, [ + uri + ], { + #data: data, + #cancelToken: cancelToken, + #options: options, + #onSendProgress: onSendProgress, + #onReceiveProgress: onReceiveProgress + }), + returnValue: Future<_i2.Response>.value(_FakeResponse_6())) + as _i5.Future<_i2.Response>); + @override + _i5.Future<_i2.Response> fetch(_i2.RequestOptions? requestOptions) => + (super.noSuchMethod(Invocation.method(#fetch, [requestOptions]), + returnValue: Future<_i2.Response>.value(_FakeResponse_6())) + as _i5.Future<_i2.Response>); + @override + String toString() => super.toString(); +} From 3bfc054ee0d46cecac19d35b847c2b2a1a5e913f Mon Sep 17 00:00:00 2001 From: Edvaldo Martins Date: Mon, 18 Jul 2022 19:59:21 +0100 Subject: [PATCH 05/42] add data for mock --- .../core/data/package_fake_data.dart | 262 ++++++++++++++++++ 1 file changed, 262 insertions(+) create mode 100644 test/src/infrastructure/core/data/package_fake_data.dart diff --git a/test/src/infrastructure/core/data/package_fake_data.dart b/test/src/infrastructure/core/data/package_fake_data.dart new file mode 100644 index 0000000..1802d2d --- /dev/null +++ b/test/src/infrastructure/core/data/package_fake_data.dart @@ -0,0 +1,262 @@ +import 'package:flutter_package/src/infrastructure/core/mapper.dart'; + +final defaultPackage = Mapper.packageFromMap({ + "name": "avatar_letter", + "latest": { + "version": "1.0.1", + "pubspec": { + "version": "1.0.1", + "name": "avatar_letter", + "dependencies": { + "flutter": { + "sdk": "flutter" + } + }, + "flutter": { + "uses-material-design": true + }, + "author": "Edvaldo Martins ", + "description": "It is a widget that uses the first few letters of a word to create an avatar with a set of basic functions..", + "homepage": "https://github.com/EdvaldoMartins/avatar_letter", + "environment": { + "sdk": ">=2.1.0 <3.0.0" + }, + "dev_dependencies": { + "flutter_test": { + "sdk": "flutter" + } + } + }, + "archive_url": "https://pub.dartlang.org/packages/avatar_letter/versions/1.0.1.tar.gz", + "published": "2019-09-17T14:00:31.765102Z" + }, + "versions": [ + { + "version": "1.0.0", + "pubspec": { + "version": "1.0.0", + "name": "avatar_letter", + "dependencies": { + "cupertino_icons": "^0.1.2", + "flutter": { + "sdk": "flutter" + } + }, + "flutter": { + "uses-material-design": true + }, + "author": "Edvaldo Martins ", + "description": "It is a widget that uses the first few letters of a word to create an avatar with a set of basic functions..", + "homepage": "https://github.com/EdvaldoMartins/avatar_letter", + "environment": { + "sdk": ">=2.1.0 <3.0.0" + }, + "dev_dependencies": { + "flutter_test": { + "sdk": "flutter" + } + } + }, + "archive_url": "https://pub.dartlang.org/packages/avatar_letter/versions/1.0.0.tar.gz", + "published": "2019-09-17T13:18:07.978522Z" + }, + { + "version": "1.0.1", + "pubspec": { + "version": "1.0.1", + "name": "avatar_letter", + "dependencies": { + "flutter": { + "sdk": "flutter" + } + }, + "flutter": { + "uses-material-design": true + }, + "author": "Edvaldo Martins ", + "description": "It is a widget that uses the first few letters of a word to create an avatar with a set of basic functions..", + "homepage": "https://github.com/EdvaldoMartins/avatar_letter", + "environment": { + "sdk": ">=2.1.0 <3.0.0" + }, + "dev_dependencies": { + "flutter_test": { + "sdk": "flutter" + } + } + }, + "archive_url": "https://pub.dartlang.org/packages/avatar_letter/versions/1.0.1.tar.gz", + "published": "2019-09-17T14:00:31.765102Z" + } + ] +}); + +final defaultMetric = Mapper.metricFromMap({ + "score": { + "grantedPoints": 75, + "maxPoints": 130, + "likeCount": 10, + "popularityScore": 0.8305305885763989, + "tags": [ + "sdk:flutter", + "platform:android", + "platform:ios", + "platform:windows", + "platform:linux", + "platform:macos", + "platform:web", + "license:apache-2.0", + "license:fsf-libre", + "license:osi-approved" + ], + "lastUpdated": "2022-07-14T07:42:46.607237Z" + }, + "scorecard": { + "packageName": "avatar_letter", + "packageVersion": "1.0.1", + "runtimeVersion": "2022.07.05", + "updated": "2022-07-14T07:42:46.607237Z", + "packageCreated": "2019-09-17T13:18:08.064386Z", + "packageVersionCreated": "2019-09-17T14:00:31.765102Z", + "flags": [ + "latest-stable", + "uses-flutter" + ], + "dartdocReport": { + "timestamp": "2022-07-07T08:56:11.091564Z", + "reportStatus": "success", + "dartdocEntry": { + "uuid": "b1453201-3c8d-4041-90f5-7960fc21d137", + "packageName": "avatar_letter", + "packageVersion": "1.0.1", + "isLatest": true, + "isObsolete": false, + "usesFlutter": true, + "runtimeVersion": "2022.07.05", + "sdkVersion": "2.17.5", + "dartdocVersion": "5.1.2", + "flutterVersion": "3.0.4", + "timestamp": "2022-07-07T08:56:09.505117Z", + "runDuration": 114236394, + "depsResolved": true, + "hasContent": true, + "archiveSize": 151112, + "totalSize": 612158, + "blobSize": 184047, + "blobIndexSize": 1189 + }, + "documentationSection": { + "id": "documentation", + "title": "Provide documentation", + "grantedPoints": 0, + "maxPoints": 10, + "status": "failed", + "summary": "### [x] 0/10 points: 20% or more of the public API has dartdoc comments\n\n* 2 out of 29 API elements (6.9 %) have documentation comments.\n\nProviding good documentation for libraries, classes, functions, and other API elements improves code readability and helps developers find and use your API. Document at least 20% of the public API elements." + } + }, + "panaReport": { + "timestamp": "2022-07-14T07:42:46.562860Z", + "panaRuntimeInfo": { + "panaVersion": "0.21.14", + "sdkVersion": "2.17.5", + "flutterVersions": { + "frameworkVersion": "3.0.4", + "channel": "unknown", + "repositoryUrl": "unknown source", + "frameworkRevision": "85684f9300908116a78138ea4c6036c35c9a1236", + "frameworkCommitDate": "2022-06-30 13:22:47 -0700", + "engineRevision": "6ba2af10bb05c88a2731482cedf2cfd11cf5af0b", + "dartSdkVersion": "2.17.5", + "devToolsVersion": "2.12.2", + "flutterRoot": "/tool/stable/flutter" + } + }, + "reportStatus": "success", + "derivedTags": [ + "sdk:flutter", + "platform:android", + "platform:ios", + "platform:windows", + "platform:linux", + "platform:macos", + "platform:web", + "license:apache-2.0", + "license:fsf-libre", + "license:osi-approved" + ], + "allDependencies": [ + "characters", + "collection", + "flutter", + "flutter_test", + "material_color_utilities", + "meta", + "sky_engine", + "vector_math" + ], + "licenses": [ + { + "path": "LICENSE", + "spdxIdentifier": "Apache-2.0" + } + ], + "report": { + "sections": [ + { + "id": "convention", + "title": "Follow Dart file conventions", + "grantedPoints": 15, + "maxPoints": 20, + "status": "failed", + "summary": "### [*] 10/10 points: Provide a valid `pubspec.yaml`\n\n\n### [*] 5/5 points: Provide a valid `README.md`\n\n\n### [x] 0/5 points: Provide a valid `CHANGELOG.md`\n\n
\n\nCHANGELOG.md is empty.\n\n\nChangelog entries help developers follow the progress of your package. See the [example](https://raw.githubusercontent.com/dart-lang/stagehand/master/templates/package-simple/CHANGELOG.md) generated by `stagehand`.\n
" + }, + { + "id": "documentation", + "title": "Provide documentation", + "grantedPoints": 0, + "maxPoints": 10, + "status": "failed", + "summary": "### [x] 0/10 points: Package has an example\n\n
\n\nNo example found.\n\n\nSee [package layout](https://dart.dev/tools/pub/package-layout#examples) guidelines on how to add an example.\n
" + }, + { + "id": "platform", + "title": "Platform support", + "grantedPoints": 20, + "maxPoints": 20, + "status": "passed", + "summary": "### [*] 20/20 points: Supports 6 of 6 possible platforms (**iOS**, **Android**, **Web**, **Windows**, **MacOS**, **Linux**)\n\n* ✓ Android\n* ✓ iOS\n* ✓ Windows\n* ✓ Linux\n* ✓ MacOS\n* ✓ Web" + }, + { + "id": "analysis", + "title": "Pass static analysis", + "grantedPoints": 20, + "maxPoints": 30, + "status": "partial", + "summary": "### [~] 20/30 points: code has no errors, warnings, lints, or formatting issues\n\n
\n\nINFO: This class (or a class that this class inherits from) is marked as '@immutable', but one or more of its instance fields aren't final: AvatarLetter.letterType, AvatarLetter.backgroundColor, AvatarLetter.backgroundColorHex, AvatarLetter.textColor, AvatarLetter.textColorHex, AvatarLetter.size\n\n\n`lib/avatar_letter.dart:18:7`\n\n```\n ╷\n18 │ class AvatarLetter extends StatelessWidget {\n │ ^^^^^^^^^^^^\n ╵\n```\n\nTo reproduce make sure you are using the [lints_core](https://pub.dev/packages/lints) and run `flutter analyze lib/avatar_letter.dart`\n
\n
\n\nINFO: This function has a return type of 'String', but doesn't end with a return statement.\n\n\n`lib/avatar_letter.dart:79:10`\n\n```\n ╷\n79 │ String _textConfig() {\n │ ^^^^^^^^^^^\n ╵\n```\n\nTo reproduce make sure you are using the [lints_core](https://pub.dev/packages/lints) and run `flutter analyze lib/avatar_letter.dart`\n
" + }, + { + "id": "dependency", + "title": "Support up-to-date dependencies", + "grantedPoints": 20, + "maxPoints": 20, + "status": "passed", + "summary": "### [*] 10/10 points: All of the package dependencies are supported in the latest version\n\n|Package|Constraint|Compatible|Latest|\n|:-|:-|:-|:-|\n|[`flutter`]|`flutter`|0.0.0|0.0.0|\n\n
Transitive dependencies\n\n|Package|Constraint|Compatible|Latest|\n|:-|:-|:-|:-|\n|[`characters`]|-|1.2.0|1.2.1|\n|[`collection`]|-|1.16.0|1.16.0|\n|[`material_color_utilities`]|-|0.1.4|0.1.5|\n|[`meta`]|-|1.7.0|1.8.0|\n|[`sky_engine`]|-|0.0.99|0.0.99|\n|[`vector_math`]|-|2.1.2|2.1.2|\n
\n\nTo reproduce run `dart pub outdated --no-dev-dependencies --up-to-date --no-dependency-overrides`.\n\n[`flutter`]: https://pub.dev/packages/flutter\n[`characters`]: https://pub.dev/packages/characters\n[`collection`]: https://pub.dev/packages/collection\n[`material_color_utilities`]: https://pub.dev/packages/material_color_utilities\n[`meta`]: https://pub.dev/packages/meta\n[`sky_engine`]: https://pub.dev/packages/sky_engine\n[`vector_math`]: https://pub.dev/packages/vector_math\n\n\n### [*] 10/10 points: Package supports latest stable Dart and Flutter SDKs\n" + }, + { + "id": "null-safety", + "title": "Support sound null safety", + "grantedPoints": 0, + "maxPoints": 20, + "status": "partial", + "summary": "### [~] 0/20 points: Package does not opt in to null safety.\n\n
\n\nPackage language version (indicated by the sdk constraint `>=2.1.0 <3.0.0`) is less than 2.12.\n\n\nConsider [migrating](https://dart.dev/null-safety/migration-guide).\n
" + } + ] + }, + "result": { + "homepageUrl": "https://github.com/EdvaldoMartins/avatar_letter" + }, + "screenshots": [], + "urlProblems": [] + } + } +}); \ No newline at end of file From 11a7dee17def8cb217bca4af9ee5520abe5f9c84 Mon Sep 17 00:00:00 2001 From: Edvaldo Martins Date: Mon, 18 Jul 2022 19:59:42 +0100 Subject: [PATCH 06/42] add test for list of package --- .../package/get_list_of_package_test.dart | 36 +++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 test/src/infrastructure/package/get_list_of_package_test.dart diff --git a/test/src/infrastructure/package/get_list_of_package_test.dart b/test/src/infrastructure/package/get_list_of_package_test.dart new file mode 100644 index 0000000..ed1aff9 --- /dev/null +++ b/test/src/infrastructure/package/get_list_of_package_test.dart @@ -0,0 +1,36 @@ +import 'package:dartz/dartz.dart'; +import 'package:flutter_package/src/domain/core/request_failure.dart'; +import 'package:flutter_package/src/domain/packages/i_package_service.dart'; +import 'package:flutter_package/src/infrastructure/packages/base_package_service.dart'; +import 'package:flutter_test/flutter_test.dart'; +import 'package:mockito/mockito.dart'; + +import '../core/data/package_fake_data.dart'; +import '../mocks.mocks.dart'; + + +void main() { + late MockIPackageRepository repository; + late IPackageService service; + + setUp(() { + repository = MockIPackageRepository(); + service = BasePackageService(repository); + }); + + test('when get list of package is successfully', () async { + var data = [defaultPackage]; + when(repository.getPackages(page: 0)).thenAnswer((_) async => Right(data)); + var result = await service.getPackages(page: 0); + expect(result, Right(data)); + }); + + test('when get list of package is empty', () async { + when(repository.getPackages(page: 0)) + .thenAnswer((_) async => Left(RequestFailure.empty())); + + var result = await service.getPackages(page: 0); + + expect(result, equals(Left(RequestFailure.empty()))); + }); +} From f45dcfef1c5edfb3dc314f664d74af1052cdea49 Mon Sep 17 00:00:00 2001 From: Edvaldo Martins Date: Mon, 18 Jul 2022 20:00:00 +0100 Subject: [PATCH 07/42] add test for package detail --- .../package/get_package_detail_test.dart | 48 +++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 test/src/infrastructure/package/get_package_detail_test.dart diff --git a/test/src/infrastructure/package/get_package_detail_test.dart b/test/src/infrastructure/package/get_package_detail_test.dart new file mode 100644 index 0000000..b1743e6 --- /dev/null +++ b/test/src/infrastructure/package/get_package_detail_test.dart @@ -0,0 +1,48 @@ +import 'package:dartz/dartz.dart'; +import 'package:flutter_package/src/domain/core/request_failure.dart'; +import 'package:flutter_package/src/domain/packages/i_package_service.dart'; +import 'package:flutter_package/src/infrastructure/packages/base_package_service.dart'; +import 'package:flutter_test/flutter_test.dart'; +import 'package:mockito/mockito.dart'; + +import '../core/data/package_fake_data.dart'; +import '../mocks.mocks.dart'; + +void main() { + late MockIPackageRepository mockIPackageRepository; + late IPackageService iPackageService; + late String namePackage; + + setUp(() { + mockIPackageRepository = MockIPackageRepository(); + iPackageService = BasePackageService(mockIPackageRepository); + namePackage = 'avatar_letter'; + }); + + test('when get package detail is successfully', () async { + when(mockIPackageRepository.getPackageName(namePackage: namePackage)) + .thenAnswer((_) async => Right(defaultPackage)); + + var result = await iPackageService.getPackageName(namePackage: namePackage); + + expect(result, equals(Right(defaultPackage))); + }); + + test('when get package detail has failure', () async { + when(mockIPackageRepository.getPackageName(namePackage: namePackage)) + .thenAnswer((_) async => Left(RequestFailure.serverError())); + + var result = await iPackageService.getPackageName(namePackage: namePackage); + + expect(result, equals(Left(RequestFailure.serverError()))); + }); + + test('get metric of package', () async { + when(mockIPackageRepository.getMetricPackage(package: namePackage)) + .thenAnswer((_) async => Right(defaultMetric)); + + var result = await iPackageService.getMetricPackage(package: namePackage); + + expect(result, equals(Right(defaultMetric))); + }); +} From 842180248a75f590d85a472c8d5b82acaf555049 Mon Sep 17 00:00:00 2001 From: Edvaldo Martins Date: Mon, 18 Jul 2022 20:01:04 +0100 Subject: [PATCH 08/42] add test for search package --- .../package/search_package_test.dart | 38 +++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 test/src/infrastructure/package/search_package_test.dart diff --git a/test/src/infrastructure/package/search_package_test.dart b/test/src/infrastructure/package/search_package_test.dart new file mode 100644 index 0000000..d86d32d --- /dev/null +++ b/test/src/infrastructure/package/search_package_test.dart @@ -0,0 +1,38 @@ +import 'package:dartz/dartz.dart'; +import 'package:flutter_package/src/domain/core/request_failure.dart'; +import 'package:flutter_package/src/domain/search/i_search_service.dart'; +import 'package:flutter_package/src/infrastructure/search/base_search_service.dart'; +import 'package:flutter_test/flutter_test.dart'; +import 'package:mockito/mockito.dart'; +import '../mocks.mocks.dart'; + +void main() { + late MockISearchRepository repository; + late ISearchService service; + + setUp(() { + repository = MockISearchRepository(); + service = BaseSearchService(repository); + }); + + test('when search is successfully', () async { + var data = ['avatar_letter']; + var query = 'avatar'; + when(repository.searchPackage(page: 0, query: query)) + .thenAnswer((_) async => Right(data)); + + var result = await service.searchPackage(page: 0, query: query); + + expect(result, equals(Right(data))); + }); + + test('when search has empty result', () async { + var query = 'avatar'; + when(repository.searchPackage(page: 0, query: query)) + .thenAnswer((_) async => Left(RequestFailure.empty())); + + var result = await service.searchPackage(page: 0, query: query); + + expect(result, equals(Left(RequestFailure.empty()))); + }); +} From 3824a508ec5793897db1d9e9d6914331483ed84c Mon Sep 17 00:00:00 2001 From: Edvaldo Martins Date: Tue, 19 Jul 2022 12:04:57 +0100 Subject: [PATCH 09/42] update state detail package --- lib/src/application/packages/detail_package_view_model.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/src/application/packages/detail_package_view_model.dart b/lib/src/application/packages/detail_package_view_model.dart index 1b7f9d1..e6e7249 100644 --- a/lib/src/application/packages/detail_package_view_model.dart +++ b/lib/src/application/packages/detail_package_view_model.dart @@ -101,7 +101,7 @@ abstract class _DetailPackageViewModel extends BaseViewModel with Store { setBusy(false); - onRefresh(value: false); + if (refresh) onRefresh(value: false); response.fold( (failure) => this.failure = failure, From fb488e0a771f533e1a953f6fdedbb1a8fc9bdbc6 Mon Sep 17 00:00:00 2001 From: Edvaldo Martins Date: Tue, 19 Jul 2022 12:09:53 +0100 Subject: [PATCH 10/42] add test of state for get detail package --- .../get_package_state_management_test.dart | 58 +++++++++++++++++++ 1 file changed, 58 insertions(+) create mode 100644 test/src/application/package/get_package_state_management_test.dart diff --git a/test/src/application/package/get_package_state_management_test.dart b/test/src/application/package/get_package_state_management_test.dart new file mode 100644 index 0000000..600aeb8 --- /dev/null +++ b/test/src/application/package/get_package_state_management_test.dart @@ -0,0 +1,58 @@ +import 'package:dartz/dartz.dart'; +import 'package:flutter_package/src/application/packages/detail_package_view_model.dart'; +import 'package:flutter_package/src/domain/core/request_failure.dart'; +import 'package:flutter_package/src/domain/packages/i_package_service.dart'; +import 'package:flutter_package/src/infrastructure/core/default_advanced_service.dart'; +import 'package:flutter_package/src/infrastructure/packages/base_package_service.dart'; +import 'package:flutter_test/flutter_test.dart'; +import 'package:mockito/mockito.dart'; + +import '../../infrastructure/core/data/package_fake_data.dart'; +import '../../infrastructure/mocks.mocks.dart'; + +void main() { + + late MockIPackageRepository repository; + + late IPackageService service; + + late DetailPackageViewModel viewModel; + + setUp(() { + repository = MockIPackageRepository(); + service = BasePackageService(repository); + viewModel = DetailPackageViewModel(service, DefaultAdvancedService()); + }); + + test('change state when get package is successfully', () async { + var name = 'avatar_letter'; + when(repository.getPackageName(namePackage: name)) + .thenAnswer((_) async => Right(defaultPackage)); + + when(repository.getMetricPackage(package: name)) + .thenAnswer((_) async => Right(defaultMetric)); + + expect(viewModel.hasData, false); + + await viewModel.load(name); + + expect(viewModel.hasData, true); + + expect(viewModel.package, equals(defaultPackage)); + }); + + test('change state when get package has fail', () async { + var name = 'avatar_letter'; + when(repository.getPackageName(namePackage: name)) + .thenAnswer((_) async => Left(RequestFailure.empty())); + + when(repository.getMetricPackage(package: name)) + .thenAnswer((_) async => Left(RequestFailure.empty())); + + expect(viewModel.hasError, false); + + await viewModel.load(name); + + expect(viewModel.hasError, true); + }); +} From 47a448a6e6a52bf9489e3d5083e275c912c23c80 Mon Sep 17 00:00:00 2001 From: Edvaldo Martins Date: Tue, 19 Jul 2022 14:56:49 +0100 Subject: [PATCH 11/42] update state search --- lib/src/application/search/search_view_model.dart | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/lib/src/application/search/search_view_model.dart b/lib/src/application/search/search_view_model.dart index 55cd2e4..07d77ee 100644 --- a/lib/src/application/search/search_view_model.dart +++ b/lib/src/application/search/search_view_model.dart @@ -59,12 +59,11 @@ abstract class _SearchViewModel extends BaseViewModel with Store { failure = null; - final _response = - await _service.searchPackage(page: _page, query: query); + final _response = await _service.searchPackage(page: _page, query: query); setBusy(false); - onRefresh(value: false); + if (refresh) onRefresh(value: false); _response.fold( (failure) => this.failure = failure, From b9d41d1572e2be53c0772a684cb8a47e8640e413 Mon Sep 17 00:00:00 2001 From: Edvaldo Martins Date: Tue, 19 Jul 2022 14:57:30 +0100 Subject: [PATCH 12/42] update state detail test --- ...state_management_test.dart => state_detail_package_test.dart} | 1 - 1 file changed, 1 deletion(-) rename test/src/application/package/{get_package_state_management_test.dart => state_detail_package_test.dart} (99%) diff --git a/test/src/application/package/get_package_state_management_test.dart b/test/src/application/package/state_detail_package_test.dart similarity index 99% rename from test/src/application/package/get_package_state_management_test.dart rename to test/src/application/package/state_detail_package_test.dart index 600aeb8..69c9d40 100644 --- a/test/src/application/package/get_package_state_management_test.dart +++ b/test/src/application/package/state_detail_package_test.dart @@ -6,7 +6,6 @@ import 'package:flutter_package/src/infrastructure/core/default_advanced_service import 'package:flutter_package/src/infrastructure/packages/base_package_service.dart'; import 'package:flutter_test/flutter_test.dart'; import 'package:mockito/mockito.dart'; - import '../../infrastructure/core/data/package_fake_data.dart'; import '../../infrastructure/mocks.mocks.dart'; From 5e046620f152a9f11cbb5a162dedf2e09f7eac51 Mon Sep 17 00:00:00 2001 From: Edvaldo Martins Date: Tue, 19 Jul 2022 14:57:55 +0100 Subject: [PATCH 13/42] add state search test --- .../package/state_search_package_test.dart | 48 +++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 test/src/application/package/state_search_package_test.dart diff --git a/test/src/application/package/state_search_package_test.dart b/test/src/application/package/state_search_package_test.dart new file mode 100644 index 0000000..3957d65 --- /dev/null +++ b/test/src/application/package/state_search_package_test.dart @@ -0,0 +1,48 @@ +import 'package:dartz/dartz.dart'; +import 'package:flutter_package/src/application/search/search_view_model.dart'; +import 'package:flutter_package/src/domain/core/request_failure.dart'; +import 'package:flutter_package/src/domain/search/i_search_service.dart'; +import 'package:flutter_package/src/infrastructure/search/base_search_service.dart'; +import 'package:flutter_test/flutter_test.dart'; +import 'package:mockito/mockito.dart'; + +import '../../infrastructure/mocks.mocks.dart'; + +void main() { + late MockISearchRepository repository; + late ISearchService service; + late SearchViewModel viewModel; + + setUp(() { + repository = MockISearchRepository(); + service = BaseSearchService(repository); + viewModel = SearchViewModel(service); + }); + + test('change state when search is successfully', () async { + var data = ['avatar_letter']; + var query = 'avatar'; + + when(repository.searchPackage(page: 1, query: query)) + .thenAnswer((_) async => Right(data)); + + expect(viewModel.hasData, false); + + await viewModel.load(query: query); + + expect(viewModel.hasData, true); + }); + + test('state when search result is empty', () async { + var query = 'avatar'; + + when(repository.searchPackage(page: 1, query: query)) + .thenAnswer((_) async => Left(RequestFailure.empty())); + + expect(viewModel.hasData, false); + + await viewModel.load(query: query); + + expect(Left(RequestFailure.empty()), equals(Left(RequestFailure.empty()))); + }); +} From ffce2343fe542e02d52f6c451901c91d32775d20 Mon Sep 17 00:00:00 2001 From: Edvaldo Martins Date: Wed, 20 Jul 2022 19:52:07 +0100 Subject: [PATCH 14/42] static instance for page --- .../packages/detail_package_screen.dart | 153 +++++++++--------- 1 file changed, 75 insertions(+), 78 deletions(-) diff --git a/lib/src/presentation/packages/detail_package_screen.dart b/lib/src/presentation/packages/detail_package_screen.dart index 593ed0b..264dec1 100644 --- a/lib/src/presentation/packages/detail_package_screen.dart +++ b/lib/src/presentation/packages/detail_package_screen.dart @@ -9,7 +9,6 @@ import 'package:flutter_package/src/presentation/core/custom_refresh.dart'; import 'package:flutter_package/src/presentation/core/dependency_item.dart'; import 'package:flutter_package/src/presentation/core/tag.dart'; import 'package:flutter_package/src/presentation/core/version_item.dart'; -import 'package:flutter_package/src/presentation/settings/config_builder.dart'; import 'package:flutter_package/src/utils/colors.dart'; import 'package:flutter_package/src/utils/size.dart'; import 'package:flutter_package/src/application/packages/detail_package_view_model.dart'; @@ -99,21 +98,25 @@ class _VerticalTitle extends BaseComponent { class DetailPackageScreen extends StatefulWidget { static const route = '/detail_package_screen'; final String name; + final DetailPackageViewModel viewModel; - DetailPackageScreen(this.name); + DetailPackageScreen(this.name, this.viewModel); @override DetailPackageScreenState createState() => DetailPackageScreenState(); + + static Widget initialize({required String name}) { + return DetailPackageScreen(name, inject()); + } + } class DetailPackageScreenState extends State with SingleTickerProviderStateMixin { - final DetailPackageViewModel _model = inject(); - - + late DetailPackageViewModel _model; /// open new package - openDependency(String name) { + void openDependency(String name) { if (_model.isBusy) return; _model.navigateToPushNamed( routeName: DetailPackageScreen.route, arguments: name); @@ -131,7 +134,7 @@ class DetailPackageScreenState extends State } /// responsible for viewing the score - _bodyScore() { + Widget _bodyScore() { return Container( padding: EdgeInsets.all(16.0), margin: EdgeInsets.only(top: 8.0), @@ -166,7 +169,7 @@ class DetailPackageScreenState extends State } /// responsible for viewing the versions - _bodyVersions() { + Widget _bodyVersions() { if (_model.package.versions.isEmpty) return empty; return Container( @@ -212,7 +215,7 @@ class DetailPackageScreenState extends State } /// responsible for viewing the readme - _bodyReadme(ThemeData themeData) { + Widget _bodyReadme() { return Container( width: double.infinity, padding: EdgeInsets.all(_model.loadingReadme ? 16.0 : 0.0), @@ -255,9 +258,8 @@ class DetailPackageScreenState extends State selectable: true, shrinkWrap: true, data: _model.readme, - styleSheet: MarkdownStyleSheet.fromTheme(themeData), + styleSheet: MarkdownStyleSheet.fromTheme(Theme.of(context)), physics: NeverScrollableScrollPhysics(), - // imageDirectory: 'https://raw.githubusercontent.com', padding: EdgeInsets.all(16.0), styleSheetTheme: MarkdownStyleSheetBaseTheme.platform, extensionSet: md.ExtensionSet( @@ -287,7 +289,7 @@ class DetailPackageScreenState extends State } /// responsible for viewing the dependencies - _bodyDependencies( + Widget _bodyDependencies( {required List dependencies, required String title}) { if (dependencies.isEmpty) return empty; @@ -328,7 +330,7 @@ class DetailPackageScreenState extends State } /// responsible for viewing the environment - _bodyEnvironment() { + Widget _bodyEnvironment() { return Container( width: double.infinity, margin: EdgeInsets.only(top: 8.0), @@ -363,7 +365,7 @@ class DetailPackageScreenState extends State ); } - _bodyTag() { + Widget _bodyTag() { if (!_model.metric.isNotEmpty) return empty; var tags = _model.metric.tags; @@ -371,17 +373,16 @@ class DetailPackageScreenState extends State height: 38.0, padding: EdgeInsets.all(8.0), decoration: decoration( - color: kPrimaryColor.withOpacity(.60), - borderRadius: kBorder - ), + color: kPrimaryColor.withOpacity(.60), borderRadius: kBorder), child: ListView.builder( itemBuilder: (context, index) { var separator = (index == 0) ? '' : '\t•\t'; return Container( - child: Text('$separator${tags[index]}',style: styleText( - color: kBackgroundColor, - fontWeight: FontWeight.bold - ),), + child: Text( + '$separator${tags[index]}', + style: styleText( + color: kBackgroundColor, fontWeight: FontWeight.bold), + ), ); }, itemCount: tags.length, @@ -390,11 +391,12 @@ class DetailPackageScreenState extends State ); } - _bodyVersionSelected() { + Widget _bodyVersionSelected() { var isLastVersion = (_model.package.latest.version == _model.version.version); var timed = Timed.initialize(date: _model.version.date).time; + var title = '${_model.package.name}\t${_model.version.version}'.trim(); return Container( padding: EdgeInsets.all(16.0), @@ -409,10 +411,8 @@ class DetailPackageScreenState extends State crossAxisAlignment: CrossAxisAlignment.center, mainAxisSize: MainAxisSize.max, children: [ - if (_model.metric.isNullSafe ) - Tag(value: 'null_safe'.translate), - if (_model.metric.isNullSafe) - horizontalSpaceSmall(), + if (_model.metric.isNullSafe) Tag(value: 'null_safe'.translate), + if (_model.metric.isNullSafe) horizontalSpaceSmall(), Text.rich(TextSpan( text: '${'published'.translate}:', style: styleText( @@ -449,10 +449,12 @@ class DetailPackageScreenState extends State ) ]), overflow: TextOverflow.fade, - maxLines: 1,), + maxLines: 1, + ), if (!isLastVersion) verticalSpaceSmall(), Text( - '${_model.package.name}\t${_model.version.version}', + title, + key: Key(title), style: styleText( fontWeight: FontWeight.bold, fontSize: 24, @@ -470,7 +472,7 @@ class DetailPackageScreenState extends State } /// viewing - _build(ThemeData theme) { + Widget _build() { if (_model.isBusy && !_model.hasData) { return Center(child: CustomProgress()); } @@ -495,6 +497,7 @@ class DetailPackageScreenState extends State ); } return SingleChildScrollView( + key: Key('SingleChildScrollView'), child: Container( margin: EdgeInsets.all(10.0), child: Column( @@ -512,7 +515,7 @@ class DetailPackageScreenState extends State dependencies: _model.dev_dependencies), _bodyVersions(), _bodyScore(), - _bodyReadme(theme) + _bodyReadme( ) ], ), ), @@ -522,41 +525,37 @@ class DetailPackageScreenState extends State @override void initState() { super.initState(); + _model = widget.viewModel; _model.load(widget.name); } - @override - void dispose() { - super.dispose(); - } - @override Widget build(BuildContext context) { return Observer(builder: (_) { - return ConfigBuilder(builder: (_, theme) { - return Scaffold( - backgroundColor: kPlaceholderColor, - appBar: AppBar( - brightness: theme.brightness, - centerTitle: false, - actions: [ - if (_model.hasData && !_model.isBusy) - IconButton( - icon: CustomIcon( - icon: 'download', - size: 20, - ), - onPressed: () => - Util.openLink(url: _model.package.latest.archive_url)), - if (_model.hasData && !_model.isBusy) - IconButton( - icon: CustomIcon( - icon: 'share', - size: 20, - ), - onPressed: () => - Util.shareProject(package: _model.package)), - if (_model.hasData && !_model.isBusy) Builder(builder: (context) { + return Scaffold( + backgroundColor: kPlaceholderColor, + appBar: AppBar( + // brightness: theme.brightness, + centerTitle: false, + actions: [ + if (_model.hasData && !_model.isBusy) + IconButton( + icon: CustomIcon( + icon: 'download', + size: 20, + ), + onPressed: () => + Util.openLink(url: _model.package.latest.archive_url)), + if (_model.hasData && !_model.isBusy) + IconButton( + icon: CustomIcon( + icon: 'share', + size: 20, + ), + onPressed: () => + Util.shareProject(package: _model.package)), + if (_model.hasData && !_model.isBusy) + Builder(builder: (context) { var _homePage = _model.package.latest.pubspec.homepage; if (_homePage.isNotEmpty) return IconButton( @@ -564,28 +563,26 @@ class DetailPackageScreenState extends State icon: 'github', size: 20, ), - onPressed: () => Util.openLink( - url: _homePage)); + onPressed: () => Util.openLink(url: _homePage)); return SizedBox.shrink(); }) - ], - elevation: 0.0, - title: Text( - widget.name, - style: styleText( - color: kPrimaryColor, - fontWeight: FontWeight.bold, - fontSize: 16.0), - ), - ), - body: CustomRefresh( - refresh: _model.refresh, - child: _build(theme), - enablePullUp: false, - onRefresh: () => _model.load(widget.name), + ], + elevation: 0.0, + title: Text( + widget.name, + style: styleText( + color: kPrimaryColor, + fontWeight: FontWeight.bold, + fontSize: 16.0), ), - ); - }); + ), + body: CustomRefresh( + refresh: _model.refresh, + child: _build(), + enablePullUp: false, + onRefresh: () => _model.load(widget.name), + ), + ); }); } } From 73c6a28e6c1810403b5f7f94fe552468a3c880b2 Mon Sep 17 00:00:00 2001 From: Edvaldo Martins Date: Wed, 20 Jul 2022 19:52:28 +0100 Subject: [PATCH 15/42] update mocks --- test/src/infrastructure/mocks.dart | 3 ++- test/src/infrastructure/mocks.mocks.dart | 22 ++++++++++++++++++++++ 2 files changed, 24 insertions(+), 1 deletion(-) diff --git a/test/src/infrastructure/mocks.dart b/test/src/infrastructure/mocks.dart index 20b2d77..d4fc98f 100644 --- a/test/src/infrastructure/mocks.dart +++ b/test/src/infrastructure/mocks.dart @@ -1,8 +1,9 @@ import 'package:dio/dio.dart'; +import 'package:flutter_package/src/domain/core/i_advanced_service.dart'; import 'package:flutter_package/src/domain/packages/i_package_repository.dart'; import 'package:flutter_package/src/domain/search/i_search_repository.dart'; import 'package:mockito/annotations.dart'; -@GenerateMocks([IPackageRepository, ISearchRepository], +@GenerateMocks([IPackageRepository, ISearchRepository, IAdvancedService], customMocks: [MockSpec(as: #MockApi)]) void main() {} diff --git a/test/src/infrastructure/mocks.mocks.dart b/test/src/infrastructure/mocks.mocks.dart index aa78029..83f139d 100644 --- a/test/src/infrastructure/mocks.mocks.dart +++ b/test/src/infrastructure/mocks.mocks.dart @@ -6,6 +6,8 @@ import 'dart:async' as _i5; import 'package:dartz/dartz.dart' as _i3; import 'package:dio/dio.dart' as _i2; +import 'package:flutter_package/src/domain/core/i_advanced_service.dart' + as _i10; import 'package:flutter_package/src/domain/core/request_failure.dart' as _i6; import 'package:flutter_package/src/domain/packages/entities/metric.dart' as _i8; @@ -113,6 +115,26 @@ class MockISearchRepository extends _i1.Mock implements _i9.ISearchRepository { String toString() => super.toString(); } +/// A class which mocks [IAdvancedService]. +/// +/// See the documentation for Mockito's code generation for more information. +class MockIAdvancedService extends _i1.Mock implements _i10.IAdvancedService { + MockIAdvancedService() { + _i1.throwOnMissingStub(this); + } + + @override + _i5.Future<_i3.Either<_i6.RequestFailure, String>> getReadme( + {String? gitPath}) => + (super.noSuchMethod( + Invocation.method(#getReadme, [], {#gitPath: gitPath}), + returnValue: Future<_i3.Either<_i6.RequestFailure, String>>.value( + _FakeEither_1<_i6.RequestFailure, String>())) + as _i5.Future<_i3.Either<_i6.RequestFailure, String>>); + @override + String toString() => super.toString(); +} + /// A class which mocks [Dio]. /// /// See the documentation for Mockito's code generation for more information. From e46da5e9cc6ce3d88f7ae21d4294d2f1f58e54e6 Mon Sep 17 00:00:00 2001 From: Edvaldo Martins Date: Wed, 20 Jul 2022 19:52:45 +0100 Subject: [PATCH 16/42] add data for test --- .../core/data/package_fake_data.dart | 22 ++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/test/src/infrastructure/core/data/package_fake_data.dart b/test/src/infrastructure/core/data/package_fake_data.dart index 1802d2d..06cef24 100644 --- a/test/src/infrastructure/core/data/package_fake_data.dart +++ b/test/src/infrastructure/core/data/package_fake_data.dart @@ -259,4 +259,24 @@ final defaultMetric = Mapper.metricFromMap({ "urlProblems": [] } } -}); \ No newline at end of file +}); + +final defaultReadme = ''' +# demo_test_student + +A new Flutter project. + +## Getting Started + +This project is a starting point for a Flutter application. + +A few resources to get you started if this is your first Flutter project: + +- [Lab: Write your first Flutter app](https://flutter.dev/docs/get-started/codelab) +- [Cookbook: Useful Flutter samples](https://flutter.dev/docs/cookbook) + +For help getting started with Flutter, view our +[online documentation](https://flutter.dev/docs), which offers tutorials, +samples, guidance on mobile development, and a full API reference. + +'''; \ No newline at end of file From 9e6a919ef3582b6e01cb91f3078167ffc00e5b77 Mon Sep 17 00:00:00 2001 From: Edvaldo Martins Date: Wed, 14 Sep 2022 09:26:50 +0100 Subject: [PATCH 17/42] update widget and add support for test --- .../presentation/packages/item_package.dart | 4 +-- .../packages/packages_screen.dart | 4 ++- .../presentation/search/search_screen.dart | 28 ++++++++----------- lib/src/presentation/splash_view_screen.dart | 1 + 4 files changed, 17 insertions(+), 20 deletions(-) diff --git a/lib/src/presentation/packages/item_package.dart b/lib/src/presentation/packages/item_package.dart index 03620a0..72e357a 100644 --- a/lib/src/presentation/packages/item_package.dart +++ b/lib/src/presentation/packages/item_package.dart @@ -1,4 +1,3 @@ - import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:flutter_package/src/utils/colors.dart'; @@ -20,7 +19,8 @@ class ItemPackage extends StatelessWidget { {required this.package, required this.onLink, required this.onShare, - required this.onTap}); + required this.onTap}) + : super(key: Key(package.name)); _build() { return Container( diff --git a/lib/src/presentation/packages/packages_screen.dart b/lib/src/presentation/packages/packages_screen.dart index a14de55..c17ee8c 100644 --- a/lib/src/presentation/packages/packages_screen.dart +++ b/lib/src/presentation/packages/packages_screen.dart @@ -117,8 +117,8 @@ class PackagesScreenState extends State itemCount: _model.packages.length, itemBuilder: (context, index) { var package = _model.packages[index]; - return Container( + key: Key(index.toString()), child: ItemPackage( onTap: () async { _model.navigateToPushNamed( @@ -157,6 +157,8 @@ class PackagesScreenState extends State centerTitle: false, actions: [ IconButton( + tooltip: 'search', + key: Key('search'), icon: CustomIcon(icon: 'search'), onPressed: () { _model.navigateToPushNamed(routeName: SearchScreen.route); diff --git a/lib/src/presentation/search/search_screen.dart b/lib/src/presentation/search/search_screen.dart index b8604eb..f1f8e37 100644 --- a/lib/src/presentation/search/search_screen.dart +++ b/lib/src/presentation/search/search_screen.dart @@ -17,10 +17,10 @@ class SearchScreen extends StatefulWidget { static const route = '/search_screen'; @override - SearchScreenState createState() => SearchScreenState(); + _SearchScreenState createState() => _SearchScreenState(); } -class SearchScreenState extends State +class _SearchScreenState extends State with SingleTickerProviderStateMixin { final SearchViewModel _model = inject(); @@ -39,7 +39,7 @@ class SearchScreenState extends State serverError: () => 'server_failure'); /// viewing - _build() { + Widget _build() { return Observer(builder: (_) { /// when loading and data empty if (_model.isBusy && !_model.hasData) @@ -69,6 +69,7 @@ class SearchScreenState extends State return CustomRefresh( refresh: _model.refresh, child: ListView.builder( + key: Key('search-result'), shrinkWrap: true, padding: EdgeInsets.symmetric(horizontal: 10, vertical: 8), itemCount: _model.results.length, @@ -96,6 +97,9 @@ class SearchScreenState extends State setState(() => _query = newQuery); } + void onSubmitted(String value) => + _model.load(query: value, refresh: _model.hasData); + /// search field _bodyField() { var hintText = I18n.text('search_desc'); @@ -108,9 +112,7 @@ class SearchScreenState extends State children: [ Expanded( child: TextField( - onSubmitted: (value) { - _model.load(query: value, refresh: _model.hasData); - }, + onSubmitted: onSubmitted, textInputAction: TextInputAction.search, controller: _editingController, autofocus: true, @@ -140,16 +142,6 @@ class SearchScreenState extends State setState(() => _query = ''); } - @override - void initState() { - super.initState(); - } - - @override - void dispose() { - super.dispose(); - } - @override Widget build(BuildContext context) { return ConfigBuilder(builder: (_, theme) { @@ -164,7 +156,9 @@ class SearchScreenState extends State automaticallyImplyLeading: false, title: _bodyField(), )), - body: _build(), + body: Container( + child: _build(), + ), ); }); } diff --git a/lib/src/presentation/splash_view_screen.dart b/lib/src/presentation/splash_view_screen.dart index 7e35c68..f0c1dfe 100644 --- a/lib/src/presentation/splash_view_screen.dart +++ b/lib/src/presentation/splash_view_screen.dart @@ -39,6 +39,7 @@ class _SplashScreenState extends State { systemNavigationBarColor: kBackgroundColor, statusBarIconBrightness: theme.brightness), child: Container( + key: Key('dartlogo'), color: kBackgroundColor, child: Column( mainAxisSize: MainAxisSize.max, From 77094d63b009d02ef0b9ab721f0eb5ea17e58efd Mon Sep 17 00:00:00 2001 From: Edvaldo Martins Date: Wed, 14 Sep 2022 09:27:03 +0100 Subject: [PATCH 18/42] other improvements --- .flutter-plugins | 1 + .flutter-plugins-dependencies | 2 +- .idea/flutter_pub_dev.iml | 9 ++++++ .packages | 9 +++++- ios/Runner.xcodeproj/project.pbxproj | 19 +++++++++--- lib/router.dart | 25 ++++++++++++---- pubspec.lock | 43 ++++++++++++++++++++++++++++ pubspec.yaml | 2 ++ 8 files changed, 98 insertions(+), 12 deletions(-) diff --git a/.flutter-plugins b/.flutter-plugins index 7f8ddba..2c5fecb 100644 --- a/.flutter-plugins +++ b/.flutter-plugins @@ -1,5 +1,6 @@ # This is a generated file; do not edit or check into version control. fluttertoast=/Users/edvaldo/flutter/.pub-cache/hosted/pub.dartlang.org/fluttertoast-7.1.8/ +integration_test=/Users/edvaldo/flutter/packages/integration_test/ path_provider_linux=/Users/edvaldo/flutter/.pub-cache/hosted/pub.dartlang.org/path_provider_linux-2.1.5/ path_provider_windows=/Users/edvaldo/flutter/.pub-cache/hosted/pub.dartlang.org/path_provider_windows-2.0.5/ share=/Users/edvaldo/flutter/.pub-cache/hosted/pub.dartlang.org/share-2.0.4/ diff --git a/.flutter-plugins-dependencies b/.flutter-plugins-dependencies index 9500398..6ef9b79 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.","plugins":{"ios":[{"name":"fluttertoast","path":"/Users/edvaldo/flutter/.pub-cache/hosted/pub.dartlang.org/fluttertoast-7.1.8/","dependencies":[]},{"name":"share","path":"/Users/edvaldo/flutter/.pub-cache/hosted/pub.dartlang.org/share-2.0.4/","dependencies":[]},{"name":"shared_preferences_ios","path":"/Users/edvaldo/flutter/.pub-cache/hosted/pub.dartlang.org/shared_preferences_ios-2.1.0/","dependencies":[]},{"name":"url_launcher_ios","path":"/Users/edvaldo/flutter/.pub-cache/hosted/pub.dartlang.org/url_launcher_ios-6.0.15/","dependencies":[]}],"android":[{"name":"fluttertoast","path":"/Users/edvaldo/flutter/.pub-cache/hosted/pub.dartlang.org/fluttertoast-7.1.8/","dependencies":[]},{"name":"share","path":"/Users/edvaldo/flutter/.pub-cache/hosted/pub.dartlang.org/share-2.0.4/","dependencies":[]},{"name":"shared_preferences_android","path":"/Users/edvaldo/flutter/.pub-cache/hosted/pub.dartlang.org/shared_preferences_android-2.0.11/","dependencies":[]},{"name":"url_launcher_android","path":"/Users/edvaldo/flutter/.pub-cache/hosted/pub.dartlang.org/url_launcher_android-6.0.15/","dependencies":[]}],"macos":[{"name":"shared_preferences_macos","path":"/Users/edvaldo/flutter/.pub-cache/hosted/pub.dartlang.org/shared_preferences_macos-2.0.3/","dependencies":[]},{"name":"url_launcher_macos","path":"/Users/edvaldo/flutter/.pub-cache/hosted/pub.dartlang.org/url_launcher_macos-3.0.0/","dependencies":[]}],"linux":[{"name":"path_provider_linux","path":"/Users/edvaldo/flutter/.pub-cache/hosted/pub.dartlang.org/path_provider_linux-2.1.5/","dependencies":[]},{"name":"shared_preferences_linux","path":"/Users/edvaldo/flutter/.pub-cache/hosted/pub.dartlang.org/shared_preferences_linux-2.1.0/","dependencies":["path_provider_linux"]},{"name":"url_launcher_linux","path":"/Users/edvaldo/flutter/.pub-cache/hosted/pub.dartlang.org/url_launcher_linux-3.0.0/","dependencies":[]}],"windows":[{"name":"path_provider_windows","path":"/Users/edvaldo/flutter/.pub-cache/hosted/pub.dartlang.org/path_provider_windows-2.0.5/","dependencies":[]},{"name":"shared_preferences_windows","path":"/Users/edvaldo/flutter/.pub-cache/hosted/pub.dartlang.org/shared_preferences_windows-2.1.0/","dependencies":["path_provider_windows"]},{"name":"url_launcher_windows","path":"/Users/edvaldo/flutter/.pub-cache/hosted/pub.dartlang.org/url_launcher_windows-3.0.0/","dependencies":[]}],"web":[{"name":"fluttertoast","path":"/Users/edvaldo/flutter/.pub-cache/hosted/pub.dartlang.org/fluttertoast-7.1.8/","dependencies":[]},{"name":"shared_preferences_web","path":"/Users/edvaldo/flutter/.pub-cache/hosted/pub.dartlang.org/shared_preferences_web-2.0.3/","dependencies":[]},{"name":"url_launcher_web","path":"/Users/edvaldo/flutter/.pub-cache/hosted/pub.dartlang.org/url_launcher_web-2.0.9/","dependencies":[]}]},"dependencyGraph":[{"name":"fluttertoast","dependencies":[]},{"name":"path_provider_linux","dependencies":[]},{"name":"path_provider_windows","dependencies":[]},{"name":"share","dependencies":[]},{"name":"shared_preferences","dependencies":["shared_preferences_android","shared_preferences_ios","shared_preferences_linux","shared_preferences_macos","shared_preferences_web","shared_preferences_windows"]},{"name":"shared_preferences_android","dependencies":[]},{"name":"shared_preferences_ios","dependencies":[]},{"name":"shared_preferences_linux","dependencies":["path_provider_linux"]},{"name":"shared_preferences_macos","dependencies":[]},{"name":"shared_preferences_web","dependencies":[]},{"name":"shared_preferences_windows","dependencies":["path_provider_windows"]},{"name":"url_launcher","dependencies":["url_launcher_android","url_launcher_ios","url_launcher_linux","url_launcher_macos","url_launcher_web","url_launcher_windows"]},{"name":"url_launcher_android","dependencies":[]},{"name":"url_launcher_ios","dependencies":[]},{"name":"url_launcher_linux","dependencies":[]},{"name":"url_launcher_macos","dependencies":[]},{"name":"url_launcher_web","dependencies":[]},{"name":"url_launcher_windows","dependencies":[]}],"date_created":"2022-07-18 19:55:11.348261","version":"2.10.5"} \ No newline at end of file +{"info":"This is a generated file; do not edit or check into version control.","plugins":{"ios":[{"name":"fluttertoast","path":"/Users/edvaldo/flutter/.pub-cache/hosted/pub.dartlang.org/fluttertoast-7.1.8/","dependencies":[]},{"name":"integration_test","path":"/Users/edvaldo/flutter/packages/integration_test/","dependencies":[]},{"name":"share","path":"/Users/edvaldo/flutter/.pub-cache/hosted/pub.dartlang.org/share-2.0.4/","dependencies":[]},{"name":"shared_preferences_ios","path":"/Users/edvaldo/flutter/.pub-cache/hosted/pub.dartlang.org/shared_preferences_ios-2.1.0/","dependencies":[]},{"name":"url_launcher_ios","path":"/Users/edvaldo/flutter/.pub-cache/hosted/pub.dartlang.org/url_launcher_ios-6.0.15/","dependencies":[]}],"android":[{"name":"fluttertoast","path":"/Users/edvaldo/flutter/.pub-cache/hosted/pub.dartlang.org/fluttertoast-7.1.8/","dependencies":[]},{"name":"integration_test","path":"/Users/edvaldo/flutter/packages/integration_test/","dependencies":[]},{"name":"share","path":"/Users/edvaldo/flutter/.pub-cache/hosted/pub.dartlang.org/share-2.0.4/","dependencies":[]},{"name":"shared_preferences_android","path":"/Users/edvaldo/flutter/.pub-cache/hosted/pub.dartlang.org/shared_preferences_android-2.0.11/","dependencies":[]},{"name":"url_launcher_android","path":"/Users/edvaldo/flutter/.pub-cache/hosted/pub.dartlang.org/url_launcher_android-6.0.15/","dependencies":[]}],"macos":[{"name":"shared_preferences_macos","path":"/Users/edvaldo/flutter/.pub-cache/hosted/pub.dartlang.org/shared_preferences_macos-2.0.3/","dependencies":[]},{"name":"url_launcher_macos","path":"/Users/edvaldo/flutter/.pub-cache/hosted/pub.dartlang.org/url_launcher_macos-3.0.0/","dependencies":[]}],"linux":[{"name":"path_provider_linux","path":"/Users/edvaldo/flutter/.pub-cache/hosted/pub.dartlang.org/path_provider_linux-2.1.5/","dependencies":[]},{"name":"shared_preferences_linux","path":"/Users/edvaldo/flutter/.pub-cache/hosted/pub.dartlang.org/shared_preferences_linux-2.1.0/","dependencies":["path_provider_linux"]},{"name":"url_launcher_linux","path":"/Users/edvaldo/flutter/.pub-cache/hosted/pub.dartlang.org/url_launcher_linux-3.0.0/","dependencies":[]}],"windows":[{"name":"path_provider_windows","path":"/Users/edvaldo/flutter/.pub-cache/hosted/pub.dartlang.org/path_provider_windows-2.0.5/","dependencies":[]},{"name":"shared_preferences_windows","path":"/Users/edvaldo/flutter/.pub-cache/hosted/pub.dartlang.org/shared_preferences_windows-2.1.0/","dependencies":["path_provider_windows"]},{"name":"url_launcher_windows","path":"/Users/edvaldo/flutter/.pub-cache/hosted/pub.dartlang.org/url_launcher_windows-3.0.0/","dependencies":[]}],"web":[{"name":"fluttertoast","path":"/Users/edvaldo/flutter/.pub-cache/hosted/pub.dartlang.org/fluttertoast-7.1.8/","dependencies":[]},{"name":"shared_preferences_web","path":"/Users/edvaldo/flutter/.pub-cache/hosted/pub.dartlang.org/shared_preferences_web-2.0.3/","dependencies":[]},{"name":"url_launcher_web","path":"/Users/edvaldo/flutter/.pub-cache/hosted/pub.dartlang.org/url_launcher_web-2.0.9/","dependencies":[]}]},"dependencyGraph":[{"name":"fluttertoast","dependencies":[]},{"name":"integration_test","dependencies":[]},{"name":"path_provider_linux","dependencies":[]},{"name":"path_provider_windows","dependencies":[]},{"name":"share","dependencies":[]},{"name":"shared_preferences","dependencies":["shared_preferences_android","shared_preferences_ios","shared_preferences_linux","shared_preferences_macos","shared_preferences_web","shared_preferences_windows"]},{"name":"shared_preferences_android","dependencies":[]},{"name":"shared_preferences_ios","dependencies":[]},{"name":"shared_preferences_linux","dependencies":["path_provider_linux"]},{"name":"shared_preferences_macos","dependencies":[]},{"name":"shared_preferences_web","dependencies":[]},{"name":"shared_preferences_windows","dependencies":["path_provider_windows"]},{"name":"url_launcher","dependencies":["url_launcher_android","url_launcher_ios","url_launcher_linux","url_launcher_macos","url_launcher_web","url_launcher_windows"]},{"name":"url_launcher_android","dependencies":[]},{"name":"url_launcher_ios","dependencies":[]},{"name":"url_launcher_linux","dependencies":[]},{"name":"url_launcher_macos","dependencies":[]},{"name":"url_launcher_web","dependencies":[]},{"name":"url_launcher_windows","dependencies":[]}],"date_created":"2022-07-21 21:32:41.144396","version":"2.10.5"} \ No newline at end of file diff --git a/.idea/flutter_pub_dev.iml b/.idea/flutter_pub_dev.iml index 8e3b4e6..13722dc 100644 --- a/.idea/flutter_pub_dev.iml +++ b/.idea/flutter_pub_dev.iml @@ -78,6 +78,15 @@ + + + + + + + + + diff --git a/.packages b/.packages index 71b98e5..5cdcda4 100644 --- a/.packages +++ b/.packages @@ -3,9 +3,10 @@ # # For more info see: https://dart.dev/go/dot-packages-deprecation # -# Generated by pub on 2022-07-17 14:12:33.340356. +# Generated by pub on 2022-07-21 19:47:31.189507. _fe_analyzer_shared:file:///Users/edvaldo/flutter/.pub-cache/hosted/pub.dartlang.org/_fe_analyzer_shared-22.0.0/lib/ analyzer:file:///Users/edvaldo/flutter/.pub-cache/hosted/pub.dartlang.org/analyzer-1.7.2/lib/ +archive:file:///Users/edvaldo/flutter/.pub-cache/hosted/pub.dartlang.org/archive-3.1.6/lib/ args:file:///Users/edvaldo/flutter/.pub-cache/hosted/pub.dartlang.org/args-2.3.0/lib/ async:file:///Users/edvaldo/flutter/.pub-cache/hosted/pub.dartlang.org/async-2.8.2/lib/ boolean_selector:file:///Users/edvaldo/flutter/.pub-cache/hosted/pub.dartlang.org/boolean_selector-2.1.0/lib/ @@ -37,6 +38,7 @@ ffi:file:///Users/edvaldo/flutter/.pub-cache/hosted/pub.dartlang.org/ffi-1.1.2/l file:file:///Users/edvaldo/flutter/.pub-cache/hosted/pub.dartlang.org/file-6.1.2/lib/ fixnum:file:///Users/edvaldo/flutter/.pub-cache/hosted/pub.dartlang.org/fixnum-1.0.0/lib/ flutter:file:///Users/edvaldo/flutter/packages/flutter/lib/ +flutter_driver:file:///Users/edvaldo/flutter/packages/flutter_driver/lib/ flutter_localizations:file:///Users/edvaldo/flutter/packages/flutter_localizations/lib/ flutter_markdown:file:///Users/edvaldo/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_markdown-0.6.9+1/lib/ flutter_mobx:file:///Users/edvaldo/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_mobx-2.0.4/lib/ @@ -48,12 +50,14 @@ fluttertoast:file:///Users/edvaldo/flutter/.pub-cache/hosted/pub.dartlang.org/fl freezed:file:///Users/edvaldo/flutter/.pub-cache/hosted/pub.dartlang.org/freezed-0.14.2/lib/ freezed_annotation:file:///Users/edvaldo/flutter/.pub-cache/hosted/pub.dartlang.org/freezed_annotation-0.14.3/lib/ frontend_server_client:file:///Users/edvaldo/flutter/.pub-cache/hosted/pub.dartlang.org/frontend_server_client-2.1.2/lib/ +fuchsia_remote_debug_protocol:file:///Users/edvaldo/flutter/packages/fuchsia_remote_debug_protocol/lib/ get_it:file:///Users/edvaldo/flutter/.pub-cache/hosted/pub.dartlang.org/get_it-7.2.0/lib/ glob:file:///Users/edvaldo/flutter/.pub-cache/hosted/pub.dartlang.org/glob-2.0.2/lib/ graphs:file:///Users/edvaldo/flutter/.pub-cache/hosted/pub.dartlang.org/graphs-2.1.0/lib/ html:file:///Users/edvaldo/flutter/.pub-cache/hosted/pub.dartlang.org/html-0.14.0+4/lib/ http_multi_server:file:///Users/edvaldo/flutter/.pub-cache/hosted/pub.dartlang.org/http_multi_server-3.2.0/lib/ http_parser:file:///Users/edvaldo/flutter/.pub-cache/hosted/pub.dartlang.org/http_parser-4.0.0/lib/ +integration_test:file:///Users/edvaldo/flutter/packages/integration_test/lib/ intl:file:///Users/edvaldo/flutter/.pub-cache/hosted/pub.dartlang.org/intl-0.17.0/lib/ io:file:///Users/edvaldo/flutter/.pub-cache/hosted/pub.dartlang.org/io-1.0.3/lib/ js:file:///Users/edvaldo/flutter/.pub-cache/hosted/pub.dartlang.org/js-0.6.3/lib/ @@ -102,6 +106,7 @@ stack_trace:file:///Users/edvaldo/flutter/.pub-cache/hosted/pub.dartlang.org/sta stream_channel:file:///Users/edvaldo/flutter/.pub-cache/hosted/pub.dartlang.org/stream_channel-2.1.0/lib/ stream_transform:file:///Users/edvaldo/flutter/.pub-cache/hosted/pub.dartlang.org/stream_transform-2.0.0/lib/ string_scanner:file:///Users/edvaldo/flutter/.pub-cache/hosted/pub.dartlang.org/string_scanner-1.1.0/lib/ +sync_http:file:///Users/edvaldo/flutter/.pub-cache/hosted/pub.dartlang.org/sync_http-0.3.0/lib/ term_glyph:file:///Users/edvaldo/flutter/.pub-cache/hosted/pub.dartlang.org/term_glyph-1.2.0/lib/ test_api:file:///Users/edvaldo/flutter/.pub-cache/hosted/pub.dartlang.org/test_api-0.4.8/lib/ timing:file:///Users/edvaldo/flutter/.pub-cache/hosted/pub.dartlang.org/timing-1.0.0/lib/ @@ -115,8 +120,10 @@ url_launcher_platform_interface:file:///Users/edvaldo/flutter/.pub-cache/hosted/ url_launcher_web:file:///Users/edvaldo/flutter/.pub-cache/hosted/pub.dartlang.org/url_launcher_web-2.0.9/lib/ url_launcher_windows:file:///Users/edvaldo/flutter/.pub-cache/hosted/pub.dartlang.org/url_launcher_windows-3.0.0/lib/ vector_math:file:///Users/edvaldo/flutter/.pub-cache/hosted/pub.dartlang.org/vector_math-2.1.1/lib/ +vm_service:file:///Users/edvaldo/flutter/.pub-cache/hosted/pub.dartlang.org/vm_service-7.5.0/lib/ watcher:file:///Users/edvaldo/flutter/.pub-cache/hosted/pub.dartlang.org/watcher-1.0.1/lib/ web_socket_channel:file:///Users/edvaldo/flutter/.pub-cache/hosted/pub.dartlang.org/web_socket_channel-2.1.0/lib/ +webdriver:file:///Users/edvaldo/flutter/.pub-cache/hosted/pub.dartlang.org/webdriver-3.0.0/lib/ win32:file:///Users/edvaldo/flutter/.pub-cache/hosted/pub.dartlang.org/win32-2.5.1/lib/ xdg_directories:file:///Users/edvaldo/flutter/.pub-cache/hosted/pub.dartlang.org/xdg_directories-0.2.0+1/lib/ xml:file:///Users/edvaldo/flutter/.pub-cache/hosted/pub.dartlang.org/xml-5.3.1/lib/ diff --git a/ios/Runner.xcodeproj/project.pbxproj b/ios/Runner.xcodeproj/project.pbxproj index 7dde90b..b8d484e 100644 --- a/ios/Runner.xcodeproj/project.pbxproj +++ b/ios/Runner.xcodeproj/project.pbxproj @@ -3,7 +3,7 @@ archiveVersion = 1; classes = { }; - objectVersion = 46; + objectVersion = 50; objects = { /* Begin PBXBuildFile section */ @@ -222,6 +222,7 @@ "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh", "${BUILT_PRODUCTS_DIR}/Toast/Toast.framework", "${BUILT_PRODUCTS_DIR}/fluttertoast/fluttertoast.framework", + "${BUILT_PRODUCTS_DIR}/integration_test/integration_test.framework", "${BUILT_PRODUCTS_DIR}/share/share.framework", "${BUILT_PRODUCTS_DIR}/shared_preferences_ios/shared_preferences_ios.framework", "${BUILT_PRODUCTS_DIR}/url_launcher_ios/url_launcher_ios.framework", @@ -230,6 +231,7 @@ outputPaths = ( "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Toast.framework", "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/fluttertoast.framework", + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/integration_test.framework", "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/share.framework", "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/shared_preferences_ios.framework", "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/url_launcher_ios.framework", @@ -391,7 +393,10 @@ ); INFOPLIST_FILE = Runner/Info.plist; IPHONEOS_DEPLOYMENT_TARGET = 15.5; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); LIBRARY_SEARCH_PATHS = ( "$(inherited)", "$(PROJECT_DIR)/Flutter", @@ -531,7 +536,10 @@ ); INFOPLIST_FILE = Runner/Info.plist; IPHONEOS_DEPLOYMENT_TARGET = 15.5; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); LIBRARY_SEARCH_PATHS = ( "$(inherited)", "$(PROJECT_DIR)/Flutter", @@ -566,7 +574,10 @@ ); INFOPLIST_FILE = Runner/Info.plist; IPHONEOS_DEPLOYMENT_TARGET = 15.5; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); LIBRARY_SEARCH_PATHS = ( "$(inherited)", "$(PROJECT_DIR)/Flutter", diff --git a/lib/router.dart b/lib/router.dart index a85938b..d7e7969 100644 --- a/lib/router.dart +++ b/lib/router.dart @@ -1,3 +1,5 @@ +import 'dart:io'; + import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:flutter_package/src/presentation/packages/packages_screen.dart'; @@ -21,20 +23,31 @@ class AnimationRouterPager extends MaterialPageRoute { class AppRouter { static Route generateRoute(RouteSettings settings) { + Widget page; + switch (settings.name) { case '/': - return AnimationRouterPager(builder: (_) => SplashScreen()); + page = SplashScreen(); + break; case PackagesScreen.route: - return AnimationRouterPager(builder: (_) => PackagesScreen()); + page = PackagesScreen(); + break; case DetailPackageScreen.route: var name = settings.arguments as String; - return AnimationRouterPager(builder: (_) => DetailPackageScreen(name)); + page = DetailPackageScreen.initialize(name: name); + break; case SettingScreen.route: - return AnimationRouterPager(builder: (_) => SettingScreen()); + page = SettingScreen(); + break; case SearchScreen.route: - return AnimationRouterPager(builder: (_) => SearchScreen()); + page = SearchScreen(); + break; default: - return AnimationRouterPager(builder: (_) => SplashScreen()); + page = SplashScreen(); + break; } + return Platform.isIOS + ? CupertinoPageRoute(builder: (context) => page) + : AnimationRouterPager(builder: (_) => page); } } diff --git a/pubspec.lock b/pubspec.lock index 227b0c5..58abc77 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -15,6 +15,13 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "1.7.2" + archive: + dependency: transitive + description: + name: archive + url: "https://pub.dartlang.org" + source: hosted + version: "3.1.6" args: dependency: transitive description: @@ -230,6 +237,11 @@ packages: description: flutter source: sdk version: "0.0.0" + flutter_driver: + dependency: transitive + description: flutter + source: sdk + version: "0.0.0" flutter_localizations: dependency: "direct main" description: flutter @@ -301,6 +313,11 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "2.1.2" + fuchsia_remote_debug_protocol: + dependency: transitive + description: flutter + source: sdk + version: "0.0.0" get_it: dependency: "direct main" description: @@ -343,6 +360,11 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "4.0.0" + integration_test: + dependency: "direct dev" + description: flutter + source: sdk + version: "0.0.0" intl: dependency: "direct main" description: @@ -677,6 +699,13 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "1.1.0" + sync_http: + dependency: transitive + description: + name: sync_http + url: "https://pub.dartlang.org" + source: hosted + version: "0.3.0" term_glyph: dependency: transitive description: @@ -768,6 +797,13 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "2.1.1" + vm_service: + dependency: transitive + description: + name: vm_service + url: "https://pub.dartlang.org" + source: hosted + version: "7.5.0" watcher: dependency: transitive description: @@ -782,6 +818,13 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "2.1.0" + webdriver: + dependency: transitive + description: + name: webdriver + url: "https://pub.dartlang.org" + source: hosted + version: "3.0.0" win32: dependency: transitive description: diff --git a/pubspec.yaml b/pubspec.yaml index a1a1c20..938bff1 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -55,6 +55,8 @@ dependencies: dev_dependencies: flutter_test: sdk: flutter + integration_test: + sdk: flutter mobx_codegen: ^2.0.1+3 build_runner: ^2.0.1 json_serializable: ^4.1.1 From c76bc6ebfb3ab9d1576d6e9cabadf461698bf606 Mon Sep 17 00:00:00 2001 From: Edvaldo Martins Date: Fri, 7 Oct 2022 11:09:22 +0100 Subject: [PATCH 19/42] add test for details package --- .../package/detail_package_page_test.dart | 55 +++++++++++++++++++ 1 file changed, 55 insertions(+) create mode 100644 test/src/presentation/package/detail_package_page_test.dart diff --git a/test/src/presentation/package/detail_package_page_test.dart b/test/src/presentation/package/detail_package_page_test.dart new file mode 100644 index 0000000..9a8a271 --- /dev/null +++ b/test/src/presentation/package/detail_package_page_test.dart @@ -0,0 +1,55 @@ +import 'package:dartz/dartz.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter_package/src/application/packages/detail_package_view_model.dart'; +import 'package:flutter_package/src/domain/packages/i_package_service.dart'; +import 'package:flutter_package/src/infrastructure/packages/base_package_service.dart'; +import 'package:flutter_package/src/presentation/core/styles.dart'; +import 'package:flutter_package/src/presentation/packages/detail_package_screen.dart'; +import 'package:flutter_test/flutter_test.dart'; +import 'package:mockito/mockito.dart'; + +import '../../infrastructure/core/data/package_fake_data.dart'; +import '../../infrastructure/mocks.mocks.dart'; + +void main() { + TestWidgetsFlutterBinding.ensureInitialized(); + + late MockIPackageRepository repository; + late MockIAdvancedService iAdvancedService; + late IPackageService service; + late String namePackage; + late DetailPackageViewModel viewModel; + + setUp(() { + repository = MockIPackageRepository(); + service = BasePackageService(repository); + iAdvancedService = MockIAdvancedService(); + viewModel = DetailPackageViewModel(service, iAdvancedService); + namePackage = 'avatar_letter'; + }); + + Widget createWidgetForTest() { + return MaterialApp( + theme: lightTheme(), + home: DetailPackageScreen(namePackage, viewModel), + ); + } + + testWidgets('test has data for detail', (tester) async { + when(repository.getPackageName(namePackage: namePackage)) + .thenAnswer((_) async => Right(defaultPackage)); + + when(repository.getMetricPackage(package: namePackage)) + .thenAnswer((_) async => Right(defaultMetric)); + + when(iAdvancedService.getReadme( + gitPath: defaultPackage.latest.pubspec.homepage)) + .thenAnswer((_) async => Right(defaultReadme)); + + await tester.pumpWidget(createWidgetForTest()); + + await viewModel.load(namePackage); + + expect(viewModel.hasData, true); + }); +} From 71ce0d41dce2a3a4f10fe08843c11eea10d7b6bf Mon Sep 17 00:00:00 2001 From: Edvaldo Martins Date: Fri, 7 Oct 2022 12:29:20 +0100 Subject: [PATCH 20/42] integration test implemented --- integration_test/app_test.dart | 143 +++++++++++++++++++++++++++++++++ 1 file changed, 143 insertions(+) create mode 100644 integration_test/app_test.dart diff --git a/integration_test/app_test.dart b/integration_test/app_test.dart new file mode 100644 index 0000000..a2bb99a --- /dev/null +++ b/integration_test/app_test.dart @@ -0,0 +1,143 @@ +import 'dart:math'; + +import 'package:flutter/material.dart'; +import 'package:flutter_test/flutter_test.dart'; +import 'package:integration_test/integration_test.dart'; +import 'package:flutter_package/main.dart' as app; + +void main() { + IntegrationTestWidgetsFlutterBinding.ensureInitialized(); + TestWidgetsFlutterBinding.ensureInitialized(); + + testWidgets('search package', (tester) async { + await tester.pumpAndSettle(Duration(seconds: 2)); + + var button = find.byTooltip('search'); + + await tester.tap(button); + + await tester.pumpAndSettle(Duration(milliseconds: 800)); + + expect(find.byType(TextField), findsOneWidget); + + var editText = find.byType(TextField); + await tester.enterText(editText, 'avatar_letter'); + await tester.testTextInput.receiveAction(TextInputAction.done); + + await tester.pump(); + await tester.pumpAndSettle(const Duration(seconds: 2)); + await tester.pumpAndSettle(); + + var _find = await find.byWidgetPredicate((widget) => + widget.key != null && widget.key == ValueKey('search-result')); + expect(_find, findsWidgets); + }); + + testWidgets('open detail of package', (tester) async { + app.main(); + + await tester.pumpAndSettle(Duration(seconds: 2)); + + var index = Random().nextInt(50) + 1; + + final listFinder = find.byType(Scrollable); + + var itemFinder = find.byKey(ValueKey('package_$index')); + + expect(itemFinder, findsOneWidget); + + await tester.pump(); + await tester.pumpAndSettle(const Duration(seconds: 1)); + await tester.pumpAndSettle(); + + if (index >= 5) { + await tester.scrollUntilVisible(itemFinder, 500.0, + duration: Duration(milliseconds: 300), + scrollable: listFinder, + maxScrolls: 500); + } + + await tester.pump(); + await tester.pumpAndSettle(const Duration(seconds: 1)); + await tester.pumpAndSettle(); + + await tester.tap(itemFinder); + + await tester.pump(); + await tester.pumpAndSettle(const Duration(seconds: 2)); + await tester.pumpAndSettle(); + + var backButton = find.byKey(ValueKey('BackButton')); + + await tester.pumpAndSettle(const Duration(seconds: 1)); + + await tester.tap(backButton); + + + }); + + group('full test', () { + testWidgets('full test app', (tester) async { + app.main(); + + await tester.pumpAndSettle(Duration(seconds: 2)); + + var index = Random().nextInt(50) + 1; + + final listFinder = find.byType(Scrollable); + + var itemFinder = find.byKey(ValueKey('package_$index')); + + expect(itemFinder, findsOneWidget); + + await tester.pump(); + await tester.pumpAndSettle(const Duration(seconds: 1)); + await tester.pumpAndSettle(); + + if (index >= 5) { + await tester.scrollUntilVisible(itemFinder, 500.0, + duration: Duration(milliseconds: 300), + scrollable: listFinder, + maxScrolls: 500); + } + + await tester.pump(); + await tester.pumpAndSettle(const Duration(seconds: 1)); + await tester.pumpAndSettle(); + + await tester.tap(itemFinder); + + await tester.pump(); + await tester.pumpAndSettle(const Duration(seconds: 2)); + await tester.pumpAndSettle(); + + var backButton = find.byKey(ValueKey('BackButton')); + + await tester.pumpAndSettle(const Duration(seconds: 1)); + + await tester.tap(backButton); + + await tester.pumpAndSettle(Duration(seconds: 2)); + + var button = find.byTooltip('search'); + + await tester.tap(button); + + await tester.pumpAndSettle(Duration(milliseconds: 800)); + + expect(find.byType(TextField), findsOneWidget); + + var editText = find.byType(TextField); + await tester.enterText(editText, 'avatar_letter'); + await tester.testTextInput.receiveAction(TextInputAction.done); + + await tester.pump(); + await tester.pumpAndSettle(const Duration(seconds: 2)); + await tester.pumpAndSettle(); + + var _find = await find.byWidgetPredicate((widget) => + widget.key != null && widget.key == ValueKey('search-result')); + expect(_find, findsWidgets); + }); + }); +} From a8eba1319095f7b65e5d50960ffd50a2d2158459 Mon Sep 17 00:00:00 2001 From: Edvaldo Martins Date: Fri, 7 Oct 2022 12:30:52 +0100 Subject: [PATCH 21/42] change name of file test --- integration_test/{app_test.dart => integration_test.dart} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename integration_test/{app_test.dart => integration_test.dart} (100%) diff --git a/integration_test/app_test.dart b/integration_test/integration_test.dart similarity index 100% rename from integration_test/app_test.dart rename to integration_test/integration_test.dart From d2bc8698bf47801955792d3cbcbfdd2ceef0260e Mon Sep 17 00:00:00 2001 From: Edvaldo Martins Date: Fri, 7 Oct 2022 12:39:13 +0100 Subject: [PATCH 22/42] add integration test for open detail package --- integration_test/detail_package_test.dart | 50 +++++++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 integration_test/detail_package_test.dart diff --git a/integration_test/detail_package_test.dart b/integration_test/detail_package_test.dart new file mode 100644 index 0000000..428618e --- /dev/null +++ b/integration_test/detail_package_test.dart @@ -0,0 +1,50 @@ +import 'package:flutter_test/flutter_test.dart'; +import 'package:integration_test/integration_test.dart'; +import 'package:flutter_package/main.dart' as app; +import 'dart:math'; +import 'package:flutter/material.dart'; + +void main() { + IntegrationTestWidgetsFlutterBinding.ensureInitialized(); + + testWidgets('detail of package', (tester) async { + app.main(); + + await tester.pumpAndSettle(Duration(seconds: 2)); + + var index = Random().nextInt(50) + 1; + + final listFinder = find.byType(Scrollable); + + var itemFinder = find.byKey(ValueKey('package_$index')); + + expect(itemFinder, findsOneWidget); + + await tester.pump(); + await tester.pumpAndSettle(const Duration(seconds: 1)); + await tester.pumpAndSettle(); + + if (index >= 5) { + await tester.scrollUntilVisible(itemFinder, 500.0, + duration: Duration(milliseconds: 300), + scrollable: listFinder, + maxScrolls: 500); + } + + await tester.pump(); + await tester.pumpAndSettle(const Duration(seconds: 1)); + await tester.pumpAndSettle(); + + await tester.tap(itemFinder); + + await tester.pump(); + await tester.pumpAndSettle(const Duration(seconds: 2)); + await tester.pumpAndSettle(); + + var backButton = find.byKey(ValueKey('BackButton')); + + await tester.pumpAndSettle(const Duration(seconds: 1)); + + await tester.tap(backButton); + }); +} From c0e6f6fe23a1e7db21b1e8375c33e6362616add1 Mon Sep 17 00:00:00 2001 From: Edvaldo Martins Date: Fri, 7 Oct 2022 12:39:22 +0100 Subject: [PATCH 23/42] add integration test for search detail package --- integration_test/search_package_test.dart | 34 +++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 integration_test/search_package_test.dart diff --git a/integration_test/search_package_test.dart b/integration_test/search_package_test.dart new file mode 100644 index 0000000..ba46ab1 --- /dev/null +++ b/integration_test/search_package_test.dart @@ -0,0 +1,34 @@ +import 'package:flutter_test/flutter_test.dart'; +import 'package:integration_test/integration_test.dart'; +import 'package:flutter_package/main.dart' as app; +import 'package:flutter/material.dart'; + +void main() { + IntegrationTestWidgetsFlutterBinding.ensureInitialized(); + + testWidgets('search package', (tester) async { + app.main(); + + await tester.pumpAndSettle(Duration(seconds: 2)); + + var button = find.byTooltip('search'); + + await tester.tap(button); + + await tester.pumpAndSettle(Duration(milliseconds: 800)); + + expect(find.byType(TextField), findsOneWidget); + + var editText = find.byType(TextField); + await tester.enterText(editText, 'avatar_letter'); + await tester.testTextInput.receiveAction(TextInputAction.done); + + await tester.pump(); + await tester.pumpAndSettle(const Duration(seconds: 2)); + await tester.pumpAndSettle(); + + var _find = await find.byWidgetPredicate((widget) => + widget.key != null && widget.key == ValueKey('search-result')); + expect(_find, findsWidgets); + }); +} From 07d0f3d2beb4eee6c4fe7e8d1e03d6c1e818a286 Mon Sep 17 00:00:00 2001 From: Edvaldo Martins Date: Fri, 7 Oct 2022 12:39:53 +0100 Subject: [PATCH 24/42] change name -v2 --- integration_test/app_test.dart | 73 +++++++++++++ integration_test/integration_test.dart | 143 ------------------------- 2 files changed, 73 insertions(+), 143 deletions(-) create mode 100644 integration_test/app_test.dart delete mode 100644 integration_test/integration_test.dart diff --git a/integration_test/app_test.dart b/integration_test/app_test.dart new file mode 100644 index 0000000..ed81d49 --- /dev/null +++ b/integration_test/app_test.dart @@ -0,0 +1,73 @@ +import 'dart:math'; + +import 'package:flutter/material.dart'; +import 'package:flutter_test/flutter_test.dart'; +import 'package:integration_test/integration_test.dart'; +import 'package:flutter_package/main.dart' as app; + +void main() { + IntegrationTestWidgetsFlutterBinding.ensureInitialized(); + + testWidgets('full test app', (tester) async { + app.main(); + + await tester.pumpAndSettle(Duration(seconds: 2)); + + var index = Random().nextInt(50) + 1; + + final listFinder = find.byType(Scrollable); + + var itemFinder = find.byKey(ValueKey('package_$index')); + + expect(itemFinder, findsOneWidget); + + await tester.pump(); + await tester.pumpAndSettle(const Duration(seconds: 1)); + await tester.pumpAndSettle(); + + if (index >= 5) { + await tester.scrollUntilVisible(itemFinder, 500.0, + duration: Duration(milliseconds: 300), + scrollable: listFinder, + maxScrolls: 500); + } + + await tester.pump(); + await tester.pumpAndSettle(const Duration(seconds: 1)); + await tester.pumpAndSettle(); + + await tester.tap(itemFinder); + + await tester.pump(); + await tester.pumpAndSettle(const Duration(seconds: 2)); + await tester.pumpAndSettle(); + + var backButton = find.byKey(ValueKey('BackButton')); + + await tester.pumpAndSettle(const Duration(seconds: 1)); + + await tester.tap(backButton); + + await tester.pumpAndSettle(Duration(seconds: 2)); + + var button = find.byTooltip('search'); + + await tester.tap(button); + + await tester.pumpAndSettle(Duration(milliseconds: 800)); + + expect(find.byType(TextField), findsOneWidget); + + var editText = find.byType(TextField); + await tester.enterText(editText, 'avatar_letter'); + await tester.testTextInput.receiveAction(TextInputAction.done); + + await tester.pump(); + await tester.pumpAndSettle(const Duration(seconds: 2)); + await tester.pumpAndSettle(); + + var _find = await find.byWidgetPredicate((widget) => + widget.key != null && widget.key == ValueKey('search-result')); + expect(_find, findsWidgets); + }); +} diff --git a/integration_test/integration_test.dart b/integration_test/integration_test.dart deleted file mode 100644 index a2bb99a..0000000 --- a/integration_test/integration_test.dart +++ /dev/null @@ -1,143 +0,0 @@ -import 'dart:math'; - -import 'package:flutter/material.dart'; -import 'package:flutter_test/flutter_test.dart'; -import 'package:integration_test/integration_test.dart'; -import 'package:flutter_package/main.dart' as app; - -void main() { - IntegrationTestWidgetsFlutterBinding.ensureInitialized(); - TestWidgetsFlutterBinding.ensureInitialized(); - - testWidgets('search package', (tester) async { - await tester.pumpAndSettle(Duration(seconds: 2)); - - var button = find.byTooltip('search'); - - await tester.tap(button); - - await tester.pumpAndSettle(Duration(milliseconds: 800)); - - expect(find.byType(TextField), findsOneWidget); - - var editText = find.byType(TextField); - await tester.enterText(editText, 'avatar_letter'); - await tester.testTextInput.receiveAction(TextInputAction.done); - - await tester.pump(); - await tester.pumpAndSettle(const Duration(seconds: 2)); - await tester.pumpAndSettle(); - - var _find = await find.byWidgetPredicate((widget) => - widget.key != null && widget.key == ValueKey('search-result')); - expect(_find, findsWidgets); - }); - - testWidgets('open detail of package', (tester) async { - app.main(); - - await tester.pumpAndSettle(Duration(seconds: 2)); - - var index = Random().nextInt(50) + 1; - - final listFinder = find.byType(Scrollable); - - var itemFinder = find.byKey(ValueKey('package_$index')); - - expect(itemFinder, findsOneWidget); - - await tester.pump(); - await tester.pumpAndSettle(const Duration(seconds: 1)); - await tester.pumpAndSettle(); - - if (index >= 5) { - await tester.scrollUntilVisible(itemFinder, 500.0, - duration: Duration(milliseconds: 300), - scrollable: listFinder, - maxScrolls: 500); - } - - await tester.pump(); - await tester.pumpAndSettle(const Duration(seconds: 1)); - await tester.pumpAndSettle(); - - await tester.tap(itemFinder); - - await tester.pump(); - await tester.pumpAndSettle(const Duration(seconds: 2)); - await tester.pumpAndSettle(); - - var backButton = find.byKey(ValueKey('BackButton')); - - await tester.pumpAndSettle(const Duration(seconds: 1)); - - await tester.tap(backButton); - - - }); - - group('full test', () { - testWidgets('full test app', (tester) async { - app.main(); - - await tester.pumpAndSettle(Duration(seconds: 2)); - - var index = Random().nextInt(50) + 1; - - final listFinder = find.byType(Scrollable); - - var itemFinder = find.byKey(ValueKey('package_$index')); - - expect(itemFinder, findsOneWidget); - - await tester.pump(); - await tester.pumpAndSettle(const Duration(seconds: 1)); - await tester.pumpAndSettle(); - - if (index >= 5) { - await tester.scrollUntilVisible(itemFinder, 500.0, - duration: Duration(milliseconds: 300), - scrollable: listFinder, - maxScrolls: 500); - } - - await tester.pump(); - await tester.pumpAndSettle(const Duration(seconds: 1)); - await tester.pumpAndSettle(); - - await tester.tap(itemFinder); - - await tester.pump(); - await tester.pumpAndSettle(const Duration(seconds: 2)); - await tester.pumpAndSettle(); - - var backButton = find.byKey(ValueKey('BackButton')); - - await tester.pumpAndSettle(const Duration(seconds: 1)); - - await tester.tap(backButton); - - await tester.pumpAndSettle(Duration(seconds: 2)); - - var button = find.byTooltip('search'); - - await tester.tap(button); - - await tester.pumpAndSettle(Duration(milliseconds: 800)); - - expect(find.byType(TextField), findsOneWidget); - - var editText = find.byType(TextField); - await tester.enterText(editText, 'avatar_letter'); - await tester.testTextInput.receiveAction(TextInputAction.done); - - await tester.pump(); - await tester.pumpAndSettle(const Duration(seconds: 2)); - await tester.pumpAndSettle(); - - var _find = await find.byWidgetPredicate((widget) => - widget.key != null && widget.key == ValueKey('search-result')); - expect(_find, findsWidgets); - }); - }); -} From 582e5d6a71441d880f05eb65be3782cbfedf91ed Mon Sep 17 00:00:00 2001 From: Edvaldo Martins Date: Fri, 7 Oct 2022 12:46:17 +0100 Subject: [PATCH 25/42] update dependencies --- .flutter-plugins-dependencies | 2 +- .packages | 4 ++-- pubspec.lock | 2 +- pubspec.yaml | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.flutter-plugins-dependencies b/.flutter-plugins-dependencies index 6ef9b79..b53bb16 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.","plugins":{"ios":[{"name":"fluttertoast","path":"/Users/edvaldo/flutter/.pub-cache/hosted/pub.dartlang.org/fluttertoast-7.1.8/","dependencies":[]},{"name":"integration_test","path":"/Users/edvaldo/flutter/packages/integration_test/","dependencies":[]},{"name":"share","path":"/Users/edvaldo/flutter/.pub-cache/hosted/pub.dartlang.org/share-2.0.4/","dependencies":[]},{"name":"shared_preferences_ios","path":"/Users/edvaldo/flutter/.pub-cache/hosted/pub.dartlang.org/shared_preferences_ios-2.1.0/","dependencies":[]},{"name":"url_launcher_ios","path":"/Users/edvaldo/flutter/.pub-cache/hosted/pub.dartlang.org/url_launcher_ios-6.0.15/","dependencies":[]}],"android":[{"name":"fluttertoast","path":"/Users/edvaldo/flutter/.pub-cache/hosted/pub.dartlang.org/fluttertoast-7.1.8/","dependencies":[]},{"name":"integration_test","path":"/Users/edvaldo/flutter/packages/integration_test/","dependencies":[]},{"name":"share","path":"/Users/edvaldo/flutter/.pub-cache/hosted/pub.dartlang.org/share-2.0.4/","dependencies":[]},{"name":"shared_preferences_android","path":"/Users/edvaldo/flutter/.pub-cache/hosted/pub.dartlang.org/shared_preferences_android-2.0.11/","dependencies":[]},{"name":"url_launcher_android","path":"/Users/edvaldo/flutter/.pub-cache/hosted/pub.dartlang.org/url_launcher_android-6.0.15/","dependencies":[]}],"macos":[{"name":"shared_preferences_macos","path":"/Users/edvaldo/flutter/.pub-cache/hosted/pub.dartlang.org/shared_preferences_macos-2.0.3/","dependencies":[]},{"name":"url_launcher_macos","path":"/Users/edvaldo/flutter/.pub-cache/hosted/pub.dartlang.org/url_launcher_macos-3.0.0/","dependencies":[]}],"linux":[{"name":"path_provider_linux","path":"/Users/edvaldo/flutter/.pub-cache/hosted/pub.dartlang.org/path_provider_linux-2.1.5/","dependencies":[]},{"name":"shared_preferences_linux","path":"/Users/edvaldo/flutter/.pub-cache/hosted/pub.dartlang.org/shared_preferences_linux-2.1.0/","dependencies":["path_provider_linux"]},{"name":"url_launcher_linux","path":"/Users/edvaldo/flutter/.pub-cache/hosted/pub.dartlang.org/url_launcher_linux-3.0.0/","dependencies":[]}],"windows":[{"name":"path_provider_windows","path":"/Users/edvaldo/flutter/.pub-cache/hosted/pub.dartlang.org/path_provider_windows-2.0.5/","dependencies":[]},{"name":"shared_preferences_windows","path":"/Users/edvaldo/flutter/.pub-cache/hosted/pub.dartlang.org/shared_preferences_windows-2.1.0/","dependencies":["path_provider_windows"]},{"name":"url_launcher_windows","path":"/Users/edvaldo/flutter/.pub-cache/hosted/pub.dartlang.org/url_launcher_windows-3.0.0/","dependencies":[]}],"web":[{"name":"fluttertoast","path":"/Users/edvaldo/flutter/.pub-cache/hosted/pub.dartlang.org/fluttertoast-7.1.8/","dependencies":[]},{"name":"shared_preferences_web","path":"/Users/edvaldo/flutter/.pub-cache/hosted/pub.dartlang.org/shared_preferences_web-2.0.3/","dependencies":[]},{"name":"url_launcher_web","path":"/Users/edvaldo/flutter/.pub-cache/hosted/pub.dartlang.org/url_launcher_web-2.0.9/","dependencies":[]}]},"dependencyGraph":[{"name":"fluttertoast","dependencies":[]},{"name":"integration_test","dependencies":[]},{"name":"path_provider_linux","dependencies":[]},{"name":"path_provider_windows","dependencies":[]},{"name":"share","dependencies":[]},{"name":"shared_preferences","dependencies":["shared_preferences_android","shared_preferences_ios","shared_preferences_linux","shared_preferences_macos","shared_preferences_web","shared_preferences_windows"]},{"name":"shared_preferences_android","dependencies":[]},{"name":"shared_preferences_ios","dependencies":[]},{"name":"shared_preferences_linux","dependencies":["path_provider_linux"]},{"name":"shared_preferences_macos","dependencies":[]},{"name":"shared_preferences_web","dependencies":[]},{"name":"shared_preferences_windows","dependencies":["path_provider_windows"]},{"name":"url_launcher","dependencies":["url_launcher_android","url_launcher_ios","url_launcher_linux","url_launcher_macos","url_launcher_web","url_launcher_windows"]},{"name":"url_launcher_android","dependencies":[]},{"name":"url_launcher_ios","dependencies":[]},{"name":"url_launcher_linux","dependencies":[]},{"name":"url_launcher_macos","dependencies":[]},{"name":"url_launcher_web","dependencies":[]},{"name":"url_launcher_windows","dependencies":[]}],"date_created":"2022-07-21 21:32:41.144396","version":"2.10.5"} \ No newline at end of file +{"info":"This is a generated file; do not edit or check into version control.","plugins":{"ios":[{"name":"fluttertoast","path":"/Users/edvaldo/flutter/.pub-cache/hosted/pub.dartlang.org/fluttertoast-7.1.8/","dependencies":[]},{"name":"integration_test","path":"/Users/edvaldo/flutter/packages/integration_test/","dependencies":[]},{"name":"share","path":"/Users/edvaldo/flutter/.pub-cache/hosted/pub.dartlang.org/share-2.0.4/","dependencies":[]},{"name":"shared_preferences_ios","path":"/Users/edvaldo/flutter/.pub-cache/hosted/pub.dartlang.org/shared_preferences_ios-2.1.0/","dependencies":[]},{"name":"url_launcher_ios","path":"/Users/edvaldo/flutter/.pub-cache/hosted/pub.dartlang.org/url_launcher_ios-6.0.15/","dependencies":[]}],"android":[{"name":"fluttertoast","path":"/Users/edvaldo/flutter/.pub-cache/hosted/pub.dartlang.org/fluttertoast-7.1.8/","dependencies":[]},{"name":"integration_test","path":"/Users/edvaldo/flutter/packages/integration_test/","dependencies":[]},{"name":"share","path":"/Users/edvaldo/flutter/.pub-cache/hosted/pub.dartlang.org/share-2.0.4/","dependencies":[]},{"name":"shared_preferences_android","path":"/Users/edvaldo/flutter/.pub-cache/hosted/pub.dartlang.org/shared_preferences_android-2.0.11/","dependencies":[]},{"name":"url_launcher_android","path":"/Users/edvaldo/flutter/.pub-cache/hosted/pub.dartlang.org/url_launcher_android-6.0.15/","dependencies":[]}],"macos":[{"name":"shared_preferences_macos","path":"/Users/edvaldo/flutter/.pub-cache/hosted/pub.dartlang.org/shared_preferences_macos-2.0.3/","dependencies":[]},{"name":"url_launcher_macos","path":"/Users/edvaldo/flutter/.pub-cache/hosted/pub.dartlang.org/url_launcher_macos-3.0.0/","dependencies":[]}],"linux":[{"name":"path_provider_linux","path":"/Users/edvaldo/flutter/.pub-cache/hosted/pub.dartlang.org/path_provider_linux-2.1.5/","dependencies":[]},{"name":"shared_preferences_linux","path":"/Users/edvaldo/flutter/.pub-cache/hosted/pub.dartlang.org/shared_preferences_linux-2.1.0/","dependencies":["path_provider_linux"]},{"name":"url_launcher_linux","path":"/Users/edvaldo/flutter/.pub-cache/hosted/pub.dartlang.org/url_launcher_linux-3.0.0/","dependencies":[]}],"windows":[{"name":"path_provider_windows","path":"/Users/edvaldo/flutter/.pub-cache/hosted/pub.dartlang.org/path_provider_windows-2.0.5/","dependencies":[]},{"name":"shared_preferences_windows","path":"/Users/edvaldo/flutter/.pub-cache/hosted/pub.dartlang.org/shared_preferences_windows-2.1.0/","dependencies":["path_provider_windows"]},{"name":"url_launcher_windows","path":"/Users/edvaldo/flutter/.pub-cache/hosted/pub.dartlang.org/url_launcher_windows-3.0.0/","dependencies":[]}],"web":[{"name":"fluttertoast","path":"/Users/edvaldo/flutter/.pub-cache/hosted/pub.dartlang.org/fluttertoast-7.1.8/","dependencies":[]},{"name":"shared_preferences_web","path":"/Users/edvaldo/flutter/.pub-cache/hosted/pub.dartlang.org/shared_preferences_web-2.0.3/","dependencies":[]},{"name":"url_launcher_web","path":"/Users/edvaldo/flutter/.pub-cache/hosted/pub.dartlang.org/url_launcher_web-2.0.9/","dependencies":[]}]},"dependencyGraph":[{"name":"fluttertoast","dependencies":[]},{"name":"integration_test","dependencies":[]},{"name":"path_provider_linux","dependencies":[]},{"name":"path_provider_windows","dependencies":[]},{"name":"share","dependencies":[]},{"name":"shared_preferences","dependencies":["shared_preferences_android","shared_preferences_ios","shared_preferences_linux","shared_preferences_macos","shared_preferences_web","shared_preferences_windows"]},{"name":"shared_preferences_android","dependencies":[]},{"name":"shared_preferences_ios","dependencies":[]},{"name":"shared_preferences_linux","dependencies":["path_provider_linux"]},{"name":"shared_preferences_macos","dependencies":[]},{"name":"shared_preferences_web","dependencies":[]},{"name":"shared_preferences_windows","dependencies":["path_provider_windows"]},{"name":"url_launcher","dependencies":["url_launcher_android","url_launcher_ios","url_launcher_linux","url_launcher_macos","url_launcher_web","url_launcher_windows"]},{"name":"url_launcher_android","dependencies":[]},{"name":"url_launcher_ios","dependencies":[]},{"name":"url_launcher_linux","dependencies":[]},{"name":"url_launcher_macos","dependencies":[]},{"name":"url_launcher_web","dependencies":[]},{"name":"url_launcher_windows","dependencies":[]}],"date_created":"2022-10-07 12:38:46.414210","version":"2.10.5"} \ No newline at end of file diff --git a/.packages b/.packages index 5cdcda4..1846483 100644 --- a/.packages +++ b/.packages @@ -3,7 +3,7 @@ # # For more info see: https://dart.dev/go/dot-packages-deprecation # -# Generated by pub on 2022-07-21 19:47:31.189507. +# Generated by pub on 2022-10-07 10:43:40.530775. _fe_analyzer_shared:file:///Users/edvaldo/flutter/.pub-cache/hosted/pub.dartlang.org/_fe_analyzer_shared-22.0.0/lib/ analyzer:file:///Users/edvaldo/flutter/.pub-cache/hosted/pub.dartlang.org/analyzer-1.7.2/lib/ archive:file:///Users/edvaldo/flutter/.pub-cache/hosted/pub.dartlang.org/archive-3.1.6/lib/ @@ -42,7 +42,7 @@ flutter_driver:file:///Users/edvaldo/flutter/packages/flutter_driver/lib/ flutter_localizations:file:///Users/edvaldo/flutter/packages/flutter_localizations/lib/ flutter_markdown:file:///Users/edvaldo/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_markdown-0.6.9+1/lib/ flutter_mobx:file:///Users/edvaldo/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_mobx-2.0.4/lib/ -flutter_staggered_grid_view:file:///Users/edvaldo/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_staggered_grid_view-0.4.1/lib/ +flutter_staggered_grid_view:file:///Users/edvaldo/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_staggered_grid_view-0.6.2/lib/ flutter_svg:file:///Users/edvaldo/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_svg-0.22.0/lib/ flutter_test:file:///Users/edvaldo/flutter/packages/flutter_test/lib/ flutter_web_plugins:file:///Users/edvaldo/flutter/packages/flutter_web_plugins/lib/ diff --git a/pubspec.lock b/pubspec.lock index 58abc77..69ec2d1 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -267,7 +267,7 @@ packages: name: flutter_staggered_grid_view url: "https://pub.dartlang.org" source: hosted - version: "0.4.1" + version: "0.6.2" flutter_svg: dependency: "direct main" description: diff --git a/pubspec.yaml b/pubspec.yaml index 938bff1..a895bab 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -20,7 +20,7 @@ dependencies: flutter_svg: ^0.22.0 html: ^0.14.0+2 pull_to_refresh: ^2.0.0 - flutter_staggered_grid_view: ^0.4.0 + flutter_staggered_grid_view: ^0.6.2 #state mobx: ^2.0.1 From ecdacb438dd257c97f913cb937122c416650eaf0 Mon Sep 17 00:00:00 2001 From: Edvaldo Martins Date: Fri, 7 Oct 2022 12:47:29 +0100 Subject: [PATCH 26/42] config key for test support --- lib/src/presentation/core/base_widget.dart | 3 ++- lib/src/presentation/core/failure_message_view.dart | 3 ++- lib/src/presentation/packages/detail_package_screen.dart | 8 ++++++-- lib/src/presentation/search/search_screen.dart | 2 +- 4 files changed, 11 insertions(+), 5 deletions(-) diff --git a/lib/src/presentation/core/base_widget.dart b/lib/src/presentation/core/base_widget.dart index 962150c..39531fc 100644 --- a/lib/src/presentation/core/base_widget.dart +++ b/lib/src/presentation/core/base_widget.dart @@ -2,5 +2,6 @@ import 'package:flutter/material.dart'; abstract class BaseComponent extends StatelessWidget { final String? value; - BaseComponent({this.value}); + + BaseComponent({Key? key, this.value}) : super(key: key); } diff --git a/lib/src/presentation/core/failure_message_view.dart b/lib/src/presentation/core/failure_message_view.dart index 528d2ab..5cf07a7 100644 --- a/lib/src/presentation/core/failure_message_view.dart +++ b/lib/src/presentation/core/failure_message_view.dart @@ -21,6 +21,7 @@ class FailureMessageView extends BaseComponent { FailureMessageView( {required String message, + Key? key, this.onTap, this.textButton = 'try_again', this.icon, @@ -28,7 +29,7 @@ class FailureMessageView extends BaseComponent { this.button, this.isColor = false, this.sizeIcon = 50.0}) - : super(value: message); + : super(value: message,key: key); Center _center({required Widget child}) { return Center( diff --git a/lib/src/presentation/packages/detail_package_screen.dart b/lib/src/presentation/packages/detail_package_screen.dart index 264dec1..388a7bc 100644 --- a/lib/src/presentation/packages/detail_package_screen.dart +++ b/lib/src/presentation/packages/detail_package_screen.dart @@ -217,6 +217,7 @@ class DetailPackageScreenState extends State /// responsible for viewing the readme Widget _bodyReadme() { return Container( + key: ValueKey('BodyReadmeKey'), width: double.infinity, padding: EdgeInsets.all(_model.loadingReadme ? 16.0 : 0.0), margin: EdgeInsets.only(top: 8.0), @@ -399,6 +400,7 @@ class DetailPackageScreenState extends State var title = '${_model.package.name}\t${_model.version.version}'.trim(); return Container( + key: ValueKey('BodyVersionSelectedKey'), padding: EdgeInsets.all(16.0), decoration: decoration(borderRadius: 8.0, color: kBackgroundColor), child: Column( @@ -478,6 +480,7 @@ class DetailPackageScreenState extends State } if (_model.hasError && !_model.hasData) { return FailureMessageView( + key: ValueKey('FailureMessageViewFailure'), isColor: true, sizeIcon: 80, message: _message(), @@ -488,6 +491,7 @@ class DetailPackageScreenState extends State } if (!_model.hasData) { return FailureMessageView( + key: ValueKey('FailureMessageViewNotFound'), isColor: true, sizeIcon: 80, message: _message(), @@ -497,7 +501,7 @@ class DetailPackageScreenState extends State ); } return SingleChildScrollView( - key: Key('SingleChildScrollView'), + key: ValueKey('SingleChildScrollViewKey'), child: Container( margin: EdgeInsets.all(10.0), child: Column( @@ -535,7 +539,7 @@ class DetailPackageScreenState extends State return Scaffold( backgroundColor: kPlaceholderColor, appBar: AppBar( - // brightness: theme.brightness, + leading: BackButton(key: ValueKey('BackButton'),), centerTitle: false, actions: [ if (_model.hasData && !_model.isBusy) diff --git a/lib/src/presentation/search/search_screen.dart b/lib/src/presentation/search/search_screen.dart index f1f8e37..5351c74 100644 --- a/lib/src/presentation/search/search_screen.dart +++ b/lib/src/presentation/search/search_screen.dart @@ -69,7 +69,7 @@ class _SearchScreenState extends State return CustomRefresh( refresh: _model.refresh, child: ListView.builder( - key: Key('search-result'), + key: const ValueKey('search-result'), shrinkWrap: true, padding: EdgeInsets.symmetric(horizontal: 10, vertical: 8), itemCount: _model.results.length, From c699c386f8b511879ab69e7aa8ef13985eda526e Mon Sep 17 00:00:00 2001 From: Edvaldo Martins Date: Fri, 7 Oct 2022 12:48:05 +0100 Subject: [PATCH 27/42] fix list items --- .../packages/packages_screen.dart | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/lib/src/presentation/packages/packages_screen.dart b/lib/src/presentation/packages/packages_screen.dart index c17ee8c..dff09ee 100644 --- a/lib/src/presentation/packages/packages_screen.dart +++ b/lib/src/presentation/packages/packages_screen.dart @@ -106,19 +106,21 @@ class PackagesScreenState extends State ); } + var length = _model.packages.length; + var packages = _model.packages; + /// list results return CustomRefresh( refresh: _model.refresh, - child: StaggeredGridView.countBuilder( - controller: _controllerList, - crossAxisCount: 4, + child: StaggeredGrid.count( + key: ValueKey('StaggeredGridList'), + crossAxisCount: 2, mainAxisSpacing: 10, crossAxisSpacing: 10, - itemCount: _model.packages.length, - itemBuilder: (context, index) { - var package = _model.packages[index]; + children: List.generate(length, (index) { + var package = packages[index]; return Container( - key: Key(index.toString()), + key: ValueKey('package_$index'), child: ItemPackage( onTap: () async { _model.navigateToPushNamed( @@ -132,8 +134,7 @@ class PackagesScreenState extends State package: package, ), ); - }, - staggeredTileBuilder: (index) => const StaggeredTile.fit(2), + }), ), enablePullDown: true, onRefresh: () => _model.load(refresh: true), From 6f12ce24d4af880b4507616ea076afc92721f908 Mon Sep 17 00:00:00 2001 From: Edvaldo Martins Date: Fri, 7 Oct 2022 12:51:37 +0100 Subject: [PATCH 28/42] update --- .flutter-plugins-dependencies | 2 +- README.md | 16 ++++++++++++---- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/.flutter-plugins-dependencies b/.flutter-plugins-dependencies index b53bb16..ee906df 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.","plugins":{"ios":[{"name":"fluttertoast","path":"/Users/edvaldo/flutter/.pub-cache/hosted/pub.dartlang.org/fluttertoast-7.1.8/","dependencies":[]},{"name":"integration_test","path":"/Users/edvaldo/flutter/packages/integration_test/","dependencies":[]},{"name":"share","path":"/Users/edvaldo/flutter/.pub-cache/hosted/pub.dartlang.org/share-2.0.4/","dependencies":[]},{"name":"shared_preferences_ios","path":"/Users/edvaldo/flutter/.pub-cache/hosted/pub.dartlang.org/shared_preferences_ios-2.1.0/","dependencies":[]},{"name":"url_launcher_ios","path":"/Users/edvaldo/flutter/.pub-cache/hosted/pub.dartlang.org/url_launcher_ios-6.0.15/","dependencies":[]}],"android":[{"name":"fluttertoast","path":"/Users/edvaldo/flutter/.pub-cache/hosted/pub.dartlang.org/fluttertoast-7.1.8/","dependencies":[]},{"name":"integration_test","path":"/Users/edvaldo/flutter/packages/integration_test/","dependencies":[]},{"name":"share","path":"/Users/edvaldo/flutter/.pub-cache/hosted/pub.dartlang.org/share-2.0.4/","dependencies":[]},{"name":"shared_preferences_android","path":"/Users/edvaldo/flutter/.pub-cache/hosted/pub.dartlang.org/shared_preferences_android-2.0.11/","dependencies":[]},{"name":"url_launcher_android","path":"/Users/edvaldo/flutter/.pub-cache/hosted/pub.dartlang.org/url_launcher_android-6.0.15/","dependencies":[]}],"macos":[{"name":"shared_preferences_macos","path":"/Users/edvaldo/flutter/.pub-cache/hosted/pub.dartlang.org/shared_preferences_macos-2.0.3/","dependencies":[]},{"name":"url_launcher_macos","path":"/Users/edvaldo/flutter/.pub-cache/hosted/pub.dartlang.org/url_launcher_macos-3.0.0/","dependencies":[]}],"linux":[{"name":"path_provider_linux","path":"/Users/edvaldo/flutter/.pub-cache/hosted/pub.dartlang.org/path_provider_linux-2.1.5/","dependencies":[]},{"name":"shared_preferences_linux","path":"/Users/edvaldo/flutter/.pub-cache/hosted/pub.dartlang.org/shared_preferences_linux-2.1.0/","dependencies":["path_provider_linux"]},{"name":"url_launcher_linux","path":"/Users/edvaldo/flutter/.pub-cache/hosted/pub.dartlang.org/url_launcher_linux-3.0.0/","dependencies":[]}],"windows":[{"name":"path_provider_windows","path":"/Users/edvaldo/flutter/.pub-cache/hosted/pub.dartlang.org/path_provider_windows-2.0.5/","dependencies":[]},{"name":"shared_preferences_windows","path":"/Users/edvaldo/flutter/.pub-cache/hosted/pub.dartlang.org/shared_preferences_windows-2.1.0/","dependencies":["path_provider_windows"]},{"name":"url_launcher_windows","path":"/Users/edvaldo/flutter/.pub-cache/hosted/pub.dartlang.org/url_launcher_windows-3.0.0/","dependencies":[]}],"web":[{"name":"fluttertoast","path":"/Users/edvaldo/flutter/.pub-cache/hosted/pub.dartlang.org/fluttertoast-7.1.8/","dependencies":[]},{"name":"shared_preferences_web","path":"/Users/edvaldo/flutter/.pub-cache/hosted/pub.dartlang.org/shared_preferences_web-2.0.3/","dependencies":[]},{"name":"url_launcher_web","path":"/Users/edvaldo/flutter/.pub-cache/hosted/pub.dartlang.org/url_launcher_web-2.0.9/","dependencies":[]}]},"dependencyGraph":[{"name":"fluttertoast","dependencies":[]},{"name":"integration_test","dependencies":[]},{"name":"path_provider_linux","dependencies":[]},{"name":"path_provider_windows","dependencies":[]},{"name":"share","dependencies":[]},{"name":"shared_preferences","dependencies":["shared_preferences_android","shared_preferences_ios","shared_preferences_linux","shared_preferences_macos","shared_preferences_web","shared_preferences_windows"]},{"name":"shared_preferences_android","dependencies":[]},{"name":"shared_preferences_ios","dependencies":[]},{"name":"shared_preferences_linux","dependencies":["path_provider_linux"]},{"name":"shared_preferences_macos","dependencies":[]},{"name":"shared_preferences_web","dependencies":[]},{"name":"shared_preferences_windows","dependencies":["path_provider_windows"]},{"name":"url_launcher","dependencies":["url_launcher_android","url_launcher_ios","url_launcher_linux","url_launcher_macos","url_launcher_web","url_launcher_windows"]},{"name":"url_launcher_android","dependencies":[]},{"name":"url_launcher_ios","dependencies":[]},{"name":"url_launcher_linux","dependencies":[]},{"name":"url_launcher_macos","dependencies":[]},{"name":"url_launcher_web","dependencies":[]},{"name":"url_launcher_windows","dependencies":[]}],"date_created":"2022-10-07 12:38:46.414210","version":"2.10.5"} \ No newline at end of file +{"info":"This is a generated file; do not edit or check into version control.","plugins":{"ios":[{"name":"fluttertoast","path":"/Users/edvaldo/flutter/.pub-cache/hosted/pub.dartlang.org/fluttertoast-7.1.8/","dependencies":[]},{"name":"integration_test","path":"/Users/edvaldo/flutter/packages/integration_test/","dependencies":[]},{"name":"share","path":"/Users/edvaldo/flutter/.pub-cache/hosted/pub.dartlang.org/share-2.0.4/","dependencies":[]},{"name":"shared_preferences_ios","path":"/Users/edvaldo/flutter/.pub-cache/hosted/pub.dartlang.org/shared_preferences_ios-2.1.0/","dependencies":[]},{"name":"url_launcher_ios","path":"/Users/edvaldo/flutter/.pub-cache/hosted/pub.dartlang.org/url_launcher_ios-6.0.15/","dependencies":[]}],"android":[{"name":"fluttertoast","path":"/Users/edvaldo/flutter/.pub-cache/hosted/pub.dartlang.org/fluttertoast-7.1.8/","dependencies":[]},{"name":"integration_test","path":"/Users/edvaldo/flutter/packages/integration_test/","dependencies":[]},{"name":"share","path":"/Users/edvaldo/flutter/.pub-cache/hosted/pub.dartlang.org/share-2.0.4/","dependencies":[]},{"name":"shared_preferences_android","path":"/Users/edvaldo/flutter/.pub-cache/hosted/pub.dartlang.org/shared_preferences_android-2.0.11/","dependencies":[]},{"name":"url_launcher_android","path":"/Users/edvaldo/flutter/.pub-cache/hosted/pub.dartlang.org/url_launcher_android-6.0.15/","dependencies":[]}],"macos":[{"name":"shared_preferences_macos","path":"/Users/edvaldo/flutter/.pub-cache/hosted/pub.dartlang.org/shared_preferences_macos-2.0.3/","dependencies":[]},{"name":"url_launcher_macos","path":"/Users/edvaldo/flutter/.pub-cache/hosted/pub.dartlang.org/url_launcher_macos-3.0.0/","dependencies":[]}],"linux":[{"name":"path_provider_linux","path":"/Users/edvaldo/flutter/.pub-cache/hosted/pub.dartlang.org/path_provider_linux-2.1.5/","dependencies":[]},{"name":"shared_preferences_linux","path":"/Users/edvaldo/flutter/.pub-cache/hosted/pub.dartlang.org/shared_preferences_linux-2.1.0/","dependencies":["path_provider_linux"]},{"name":"url_launcher_linux","path":"/Users/edvaldo/flutter/.pub-cache/hosted/pub.dartlang.org/url_launcher_linux-3.0.0/","dependencies":[]}],"windows":[{"name":"path_provider_windows","path":"/Users/edvaldo/flutter/.pub-cache/hosted/pub.dartlang.org/path_provider_windows-2.0.5/","dependencies":[]},{"name":"shared_preferences_windows","path":"/Users/edvaldo/flutter/.pub-cache/hosted/pub.dartlang.org/shared_preferences_windows-2.1.0/","dependencies":["path_provider_windows"]},{"name":"url_launcher_windows","path":"/Users/edvaldo/flutter/.pub-cache/hosted/pub.dartlang.org/url_launcher_windows-3.0.0/","dependencies":[]}],"web":[{"name":"fluttertoast","path":"/Users/edvaldo/flutter/.pub-cache/hosted/pub.dartlang.org/fluttertoast-7.1.8/","dependencies":[]},{"name":"shared_preferences_web","path":"/Users/edvaldo/flutter/.pub-cache/hosted/pub.dartlang.org/shared_preferences_web-2.0.3/","dependencies":[]},{"name":"url_launcher_web","path":"/Users/edvaldo/flutter/.pub-cache/hosted/pub.dartlang.org/url_launcher_web-2.0.9/","dependencies":[]}]},"dependencyGraph":[{"name":"fluttertoast","dependencies":[]},{"name":"integration_test","dependencies":[]},{"name":"path_provider_linux","dependencies":[]},{"name":"path_provider_windows","dependencies":[]},{"name":"share","dependencies":[]},{"name":"shared_preferences","dependencies":["shared_preferences_android","shared_preferences_ios","shared_preferences_linux","shared_preferences_macos","shared_preferences_web","shared_preferences_windows"]},{"name":"shared_preferences_android","dependencies":[]},{"name":"shared_preferences_ios","dependencies":[]},{"name":"shared_preferences_linux","dependencies":["path_provider_linux"]},{"name":"shared_preferences_macos","dependencies":[]},{"name":"shared_preferences_web","dependencies":[]},{"name":"shared_preferences_windows","dependencies":["path_provider_windows"]},{"name":"url_launcher","dependencies":["url_launcher_android","url_launcher_ios","url_launcher_linux","url_launcher_macos","url_launcher_web","url_launcher_windows"]},{"name":"url_launcher_android","dependencies":[]},{"name":"url_launcher_ios","dependencies":[]},{"name":"url_launcher_linux","dependencies":[]},{"name":"url_launcher_macos","dependencies":[]},{"name":"url_launcher_web","dependencies":[]},{"name":"url_launcher_windows","dependencies":[]}],"date_created":"2022-10-07 12:49:31.829087","version":"2.10.5"} \ No newline at end of file diff --git a/README.md b/README.md index 72acb70..05bb3e1 100644 --- a/README.md +++ b/README.md @@ -30,6 +30,10 @@ the https://pub.dartlang.org/api/ flutter pub run build_runner build --delete-conflicting-outputs ``` +```sh +flutter test integration_test/app_test.dart +``` + ## Features - **List packages** @@ -50,11 +54,15 @@ flutter pub run build_runner build --delete-conflicting-outputs - [**Share link package**](https://pub.dev/packages) ## 📸 Screenshots -![Home](./screenshots/smartmockups_klcem8w7.png) -![Details1](./screenshots/smartmockups_klceoqtt.png) -![Details2](./screenshots/smartmockups_klcesngj.png) -![Search](./screenshots/smartmockups_klcen4ty.png) + + + + + + + +
1222
###### If you have any features you want to see in this package, feel free to make a suggestion. 🎉 From 4cb41030e51d84a06b981a434dc31a2d6fd8eb47 Mon Sep 17 00:00:00 2001 From: Edvaldo Martins Date: Fri, 7 Oct 2022 13:47:40 +0100 Subject: [PATCH 29/42] add key to translate --- assets/locale/i18n_en.json | 5 ++++- assets/locale/i18n_pt.json | 5 ++++- assets/locale/i18n_zh.json | 5 ++++- 3 files changed, 12 insertions(+), 3 deletions(-) diff --git a/assets/locale/i18n_en.json b/assets/locale/i18n_en.json index ca3ece7..f7504eb 100644 --- a/assets/locale/i18n_en.json +++ b/assets/locale/i18n_en.json @@ -47,5 +47,8 @@ "years": "Years", "year": "Year", "now": "Now", - "null_safe": "Null-safe" + "null_safe": "Null-safe", + "changelog": "Changelog", + "publisher": "Publisher", + "publisher_not_found": "Unverified Uploader" } \ No newline at end of file diff --git a/assets/locale/i18n_pt.json b/assets/locale/i18n_pt.json index 0c9b95f..278b979 100644 --- a/assets/locale/i18n_pt.json +++ b/assets/locale/i18n_pt.json @@ -47,5 +47,8 @@ "years": "Anos", "year": "Ano", "now": "Agora", - "null_safe": "Null-safe" + "null_safe": "Null-safe", + "changelog": "Changelog", + "publisher": "Editor", + "publisher_not_found": "Uploader não verificado" } \ No newline at end of file diff --git a/assets/locale/i18n_zh.json b/assets/locale/i18n_zh.json index 9748a1e..32ce2d4 100644 --- a/assets/locale/i18n_zh.json +++ b/assets/locale/i18n_zh.json @@ -47,5 +47,8 @@ "years": "Years", "year": "Year", "now": "Now", - "null_safe": "Null-safe" + "null_safe": "Null-safe", + "changelog": "Changelog", + "publisher": "Publisher", + "publisher_not_found": "Unverified Uploader" } \ No newline at end of file From b4a4e08dce04539d434f182f3cc9bd693cc9d39e Mon Sep 17 00:00:00 2001 From: Edvaldo Martins Date: Fri, 7 Oct 2022 13:48:05 +0100 Subject: [PATCH 30/42] get publisher of package --- .../domain/packages/i_package_repository.dart | 8 +++- .../domain/packages/i_package_service.dart | 8 +++- .../packages/base_package_repository.dart | 41 ++++++++++++++++++- .../packages/base_package_service.dart | 9 +++- 4 files changed, 60 insertions(+), 6 deletions(-) diff --git a/lib/src/domain/packages/i_package_repository.dart b/lib/src/domain/packages/i_package_repository.dart index c8472c6..4d0a19a 100644 --- a/lib/src/domain/packages/i_package_repository.dart +++ b/lib/src/domain/packages/i_package_repository.dart @@ -17,11 +17,17 @@ abstract class IPackageRepository extends Api { Future>> getPackages( {required int page}); + /// [getPublisher] get publisher of package [packageName] + /// This return String when the request is successful + /// and [RequestFailure] when the request is not successful + Future> getPublisher( + {required String packageName}); + /// [getPackageName] This method searches for a package by name /// This return [Package] when the request is successful /// and [RequestFailure] when the request is not successful Future> getPackageName( - {required String namePackage}); + {required String packageName}); /// [getMetricPackage] This method gets the metrics of a package /// This return [Metric] when the request is successful diff --git a/lib/src/domain/packages/i_package_service.dart b/lib/src/domain/packages/i_package_service.dart index 35c96e6..80436ad 100644 --- a/lib/src/domain/packages/i_package_service.dart +++ b/lib/src/domain/packages/i_package_service.dart @@ -15,11 +15,17 @@ abstract class IPackageService { Future>> getPackages( {required int page}); + /// [getPublisher] get publisher of package [packageName] + /// This return String when the request is successful + /// and [RequestFailure] when the request is not successful + Future> getPublisher( + {required String packageName}); + /// [getPackageName] This method searches for a package by name /// This return [Package] when the request is successful /// and [RequestFailure] when the request is not successful Future> getPackageName( - {required String namePackage}); + {required String packageName}); /// [getMetricPackage] This method gets the metrics of a package /// This return [Metric] when the request is successful diff --git a/lib/src/infrastructure/packages/base_package_repository.dart b/lib/src/infrastructure/packages/base_package_repository.dart index abf1936..8e50bec 100644 --- a/lib/src/infrastructure/packages/base_package_repository.dart +++ b/lib/src/infrastructure/packages/base_package_repository.dart @@ -55,9 +55,9 @@ class BasePackageRepository extends IPackageRepository { @override Future> getPackageName( - {required String namePackage}) async { + {required String packageName}) async { try { - final response = await dio.get('$path/$namePackage', + final response = await dio.get('$path/$packageName', options: Options( headers: { 'Content-Type': 'application/json', @@ -127,4 +127,41 @@ class BasePackageRepository extends IPackageRepository { return left(RequestFailure.serverError()); } } + + @override + Future> getPublisher( + {required String packageName}) async { + try { + final response = await dio.get('$path/$packageName/publisher', + options: Options( + headers: { + 'Content-Type': 'application/json', + 'Accept': 'application/json', + }, + )); + if (response.statusCode != 200) return Left(RequestFailure.serverError()); + + var publisher = response.data['publisherId'] ?? ''; + + return Right(publisher); + } on DioError catch (e) { + if (e.error is OSError || e.error is SocketException) { + return left(RequestFailure.networkError()); + } + + if (e.type == DioErrorType.connectTimeout || + e.type == DioErrorType.receiveTimeout || + e.type == DioErrorType.sendTimeout) { + return left(RequestFailure.serverError()); + } + + if (e.response == null || e.response!.statusCode == 500) { + return Left(RequestFailure.serverError()); + } + + return Left(RequestFailure.serverError()); + } catch (error) { + return left(RequestFailure.serverError()); + } + } } diff --git a/lib/src/infrastructure/packages/base_package_service.dart b/lib/src/infrastructure/packages/base_package_service.dart index efd2477..fc69e2a 100644 --- a/lib/src/infrastructure/packages/base_package_service.dart +++ b/lib/src/infrastructure/packages/base_package_service.dart @@ -10,8 +10,8 @@ class BasePackageService extends IPackageService { @override Future> getPackageName( - {required String namePackage}) async => - await repository.getPackageName(namePackage: namePackage); + {required String packageName}) async => + await repository.getPackageName(packageName: packageName); @override Future>> getPackages( @@ -22,4 +22,9 @@ class BasePackageService extends IPackageService { Future> getMetricPackage( {required String package}) async => await repository.getMetricPackage(package: package); + + @override + Future> getPublisher( + {required String packageName}) async => + await repository.getPublisher(packageName: packageName); } From 96cfd3b4a7d3de7efab28db5ffcb9c7948dab77c Mon Sep 17 00:00:00 2001 From: Edvaldo Martins Date: Fri, 7 Oct 2022 13:48:23 +0100 Subject: [PATCH 31/42] read generic doc .md --- lib/src/domain/core/i_advanced_service.dart | 4 ++-- lib/src/infrastructure/core/default_advanced_service.dart | 5 +++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/lib/src/domain/core/i_advanced_service.dart b/lib/src/domain/core/i_advanced_service.dart index 02239bd..10422dd 100644 --- a/lib/src/domain/core/i_advanced_service.dart +++ b/lib/src/domain/core/i_advanced_service.dart @@ -2,8 +2,8 @@ import 'package:dartz/dartz.dart'; import 'package:flutter_package/src/domain/core/request_failure.dart'; abstract class IAdvancedService { - /// [getReadme] Responsible for reading the project readme file + /// [readFile] Responsible for reading the project readme file /// This return [String] when the request is successful /// and [RequestFailure] when the request is not successful - Future> getReadme({required String gitPath}); + Future> readFile({required String gitPath,required String fileName}); } diff --git a/lib/src/infrastructure/core/default_advanced_service.dart b/lib/src/infrastructure/core/default_advanced_service.dart index 5b1c594..e892789 100644 --- a/lib/src/infrastructure/core/default_advanced_service.dart +++ b/lib/src/infrastructure/core/default_advanced_service.dart @@ -5,7 +5,8 @@ import 'package:flutter_package/src/infrastructure/core/network_builder.dart'; class DefaultAdvancedService extends IAdvancedService { @override - Future> getReadme({String? gitPath}) async { + Future> readFile( + {String? gitPath, String? fileName}) async { if (gitPath == null || gitPath.isEmpty) return Left(RequestFailure.serverError()); @@ -14,7 +15,7 @@ class DefaultAdvancedService extends IAdvancedService { .replaceAll('https://', '') .replaceAll('tree/', '') .replaceAll('master/', ''); - var url = 'https://raw.githubusercontent.com/$gitPath/master/README.md'; + var url = 'https://raw.githubusercontent.com/$gitPath/master/$fileName'; var network = NetworkBuilder(); var dio = network.build(); From 0a072082d77ae4e379495a22b361d68a62c5660f Mon Sep 17 00:00:00 2001 From: Edvaldo Martins Date: Fri, 7 Oct 2022 13:48:58 +0100 Subject: [PATCH 32/42] show changelog and publisher other improvements --- .../packages/detail_package_screen.dart | 140 +++++++++++++++--- 1 file changed, 123 insertions(+), 17 deletions(-) diff --git a/lib/src/presentation/packages/detail_package_screen.dart b/lib/src/presentation/packages/detail_package_screen.dart index 388a7bc..5a85ee3 100644 --- a/lib/src/presentation/packages/detail_package_screen.dart +++ b/lib/src/presentation/packages/detail_package_screen.dart @@ -108,7 +108,6 @@ class DetailPackageScreen extends StatefulWidget { static Widget initialize({required String name}) { return DetailPackageScreen(name, inject()); } - } class DetailPackageScreenState extends State @@ -259,7 +258,8 @@ class DetailPackageScreenState extends State selectable: true, shrinkWrap: true, data: _model.readme, - styleSheet: MarkdownStyleSheet.fromTheme(Theme.of(context)), + styleSheet: + MarkdownStyleSheet.fromTheme(Theme.of(context)), physics: NeverScrollableScrollPhysics(), padding: EdgeInsets.all(16.0), styleSheetTheme: MarkdownStyleSheetBaseTheme.platform, @@ -289,6 +289,82 @@ class DetailPackageScreenState extends State ); } + /// responsible for viewing the changelog + Widget _bodyChangelog() { + return Container( + key: ValueKey('ChangelogKey'), + width: double.infinity, + padding: EdgeInsets.all(_model.loadingChangelog ? 16.0 : 0.0), + margin: EdgeInsets.only(top: 8.0), + decoration: decoration(borderRadius: 8.0, color: kBackgroundColor), + child: (_model.loadingChangelog) + ? Column( + mainAxisAlignment: MainAxisAlignment.center, + crossAxisAlignment: CrossAxisAlignment.center, + mainAxisSize: MainAxisSize.max, + children: [ + Container( + child: CustomProgress(), + width: 20, + height: 20, + ) + ], + ) + : ExpansionTile( + initiallyExpanded: true, + childrenPadding: EdgeInsets.all(0.0), + tilePadding: EdgeInsets.only(left: 16.0, right: 16.0), + title: Text( + 'changelog'.translate, + style: styleText( + fontWeight: FontWeight.bold, + color: kTitleTextColor, + fontSize: 18, + ), + ), + children: [ + Column( + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisSize: MainAxisSize.max, + children: [ + verticalSpaceSmall(), + if (_model.hasChangelog) + Markdown( + selectable: true, + shrinkWrap: true, + data: _model.changelog, + styleSheet: + MarkdownStyleSheet.fromTheme(Theme.of(context)), + physics: NeverScrollableScrollPhysics(), + padding: EdgeInsets.all(16.0), + styleSheetTheme: MarkdownStyleSheetBaseTheme.platform, + extensionSet: md.ExtensionSet( + md.ExtensionSet.gitHubFlavored.blockSyntaxes, [ + md.EmojiSyntax(), + ...md.ExtensionSet.gitHubFlavored.inlineSyntaxes + ]), + onTapLink: (text, href, title) { + if (href == null) return; + Util.openLink(url: href); + }, + ), + if (!_model.hasChangelog) + Container( + padding: EdgeInsets.all(16.0), + child: FailureMessageView( + icon: 'info', + sizeIcon: 80, + message: 'error_readme'.translate, + onTap: _model.loadReadme, + )) + ], + ) + ], + ), + ); + } + /// responsible for viewing the dependencies Widget _bodyDependencies( {required List dependencies, required String title}) { @@ -398,6 +474,9 @@ class DetailPackageScreenState extends State var timed = Timed.initialize(date: _model.version.date).time; var title = '${_model.package.name}\t${_model.version.version}'.trim(); + var publisher = _model.publisher; + publisher = + publisher.isNotEmpty ? publisher : 'publisher_not_found'.translate; return Container( key: ValueKey('BodyVersionSelectedKey'), @@ -413,23 +492,23 @@ class DetailPackageScreenState extends State crossAxisAlignment: CrossAxisAlignment.center, mainAxisSize: MainAxisSize.max, children: [ - if (_model.metric.isNullSafe) Tag(value: 'null_safe'.translate), - if (_model.metric.isNullSafe) horizontalSpaceSmall(), - Text.rich(TextSpan( - text: '${'published'.translate}:', - style: styleText( - color: kPrimaryColor, - fontWeight: FontWeight.bold, - fontSize: 14.0), - children: [ + Expanded( + child: Text.rich(TextSpan( + text: '${'published'.translate}:', + style: styleText( + color: kPrimaryColor, + fontWeight: FontWeight.bold, + fontSize: 14.0), + children: [ TextSpan( text: '\t$timed', style: styleText(fontSize: 14.0), ) - ])), + ]))), + if (_model.metric.isNullSafe) Tag(value: 'null_safe'.translate), + // if (_model.metric.isNullSafe) horizontalSpaceSmall(), ], ), - if (!isLastVersion) verticalSpaceSmall(), if (!isLastVersion) Text.rich( TextSpan( @@ -454,6 +533,30 @@ class DetailPackageScreenState extends State maxLines: 1, ), if (!isLastVersion) verticalSpaceSmall(), + Divider(), + Text.rich( + TextSpan( + text: '', + style: styleText( + color: kPrimaryColor, + fontWeight: FontWeight.bold, + fontSize: 14.0), + children: [ + TextSpan( + text: '${'publisher'.translate}:', + style: styleText( + color: kPrimaryColor, + fontWeight: FontWeight.bold, + fontSize: 14.0)), + TextSpan( + text: '\t$publisher', + style: styleText(fontSize: 14.0), + ) + ]), + overflow: TextOverflow.fade, + maxLines: 1, + ), + Divider(), Text( title, key: Key(title), @@ -519,7 +622,9 @@ class DetailPackageScreenState extends State dependencies: _model.dev_dependencies), _bodyVersions(), _bodyScore(), - _bodyReadme( ) + _bodyReadme(), + _bodyChangelog(), + verticalSpaceMedium() ], ), ), @@ -539,7 +644,9 @@ class DetailPackageScreenState extends State return Scaffold( backgroundColor: kPlaceholderColor, appBar: AppBar( - leading: BackButton(key: ValueKey('BackButton'),), + leading: BackButton( + key: ValueKey('BackButton'), + ), centerTitle: false, actions: [ if (_model.hasData && !_model.isBusy) @@ -556,8 +663,7 @@ class DetailPackageScreenState extends State icon: 'share', size: 20, ), - onPressed: () => - Util.shareProject(package: _model.package)), + onPressed: () => Util.shareProject(package: _model.package)), if (_model.hasData && !_model.isBusy) Builder(builder: (context) { var _homePage = _model.package.latest.pubspec.homepage; From edc533d3ee082d80fdc2d6a037d690507dbed91f Mon Sep 17 00:00:00 2001 From: Edvaldo Martins Date: Fri, 7 Oct 2022 13:49:20 +0100 Subject: [PATCH 33/42] config read publisher other improvements --- .../packages/detail_package_view_model.dart | 59 ++++++++-- .../packages/detail_package_view_model.g.dart | 101 +++++++++++++++++- lib/src/presentation/core/tag.dart | 2 +- 3 files changed, 150 insertions(+), 12 deletions(-) diff --git a/lib/src/application/packages/detail_package_view_model.dart b/lib/src/application/packages/detail_package_view_model.dart index e6e7249..e2d5489 100644 --- a/lib/src/application/packages/detail_package_view_model.dart +++ b/lib/src/application/packages/detail_package_view_model.dart @@ -35,9 +35,18 @@ abstract class _DetailPackageViewModel extends BaseViewModel with Store { @observable String _readme = ''; + @observable + String _publisher = ''; + + @observable + String _changelog = ''; + @observable bool _loadingReadme = false; + @observable + bool _loadingChangelog = false; + @observable RequestFailure? failure = null; @@ -68,19 +77,29 @@ abstract class _DetailPackageViewModel extends BaseViewModel with Store { @computed String get readme => _readme; + @computed + String get changelog => _changelog; + + @computed + String get publisher => _publisher; + @computed bool get hasData => _package != null; @computed - bool get hasReadme => (_readme != null && _readme.isNotEmpty); + bool get hasReadme => (_readme.isNotEmpty); + + @computed + bool get hasChangelog => (_changelog.isNotEmpty); @computed bool get loadingReadme => _loadingReadme; + @computed + bool get loadingChangelog => _loadingChangelog; + @action - void setPackage(Package package) { - this._package = package; - } + void setPackage(Package package) => this._package = package; @action void setVersion(Version version) { @@ -88,7 +107,7 @@ abstract class _DetailPackageViewModel extends BaseViewModel with Store { } @action - Future load(String namePackage, {bool refresh = false}) async { + Future load(String packageName, {bool refresh = false}) async { if (isBusy) return; if (refresh) onRefresh(value: refresh); @@ -97,7 +116,7 @@ abstract class _DetailPackageViewModel extends BaseViewModel with Store { failure = null; - final response = await _service.getPackageName(namePackage: namePackage); + final response = await _service.getPackageName(packageName: packageName); setBusy(false); @@ -108,22 +127,46 @@ abstract class _DetailPackageViewModel extends BaseViewModel with Store { (data) { setPackage(data); setVersion(data.latest); + loadPublisher(packageName); loadReadme(); + loadChangelog(); loadScore(); }, ); } + @action + Future loadPublisher(String namePackage) async { + final response = await _service.getPublisher(packageName: namePackage); + + setBusy(false); + + response.fold( + (failure) => this.failure = failure, + (data) => _publisher = data, + ); + } + @action Future loadReadme() async { _loadingReadme = true; - var response = await _advancedService.getReadme( - gitPath: package.latest.pubspec.homepage); + var response = await _advancedService.readFile( + gitPath: package.latest.pubspec.homepage, fileName: 'README.md'); _loadingReadme = false; response.fold( (failure) => this._readme = '', (data) => this._readme = data); } + @action + Future loadChangelog() async { + _loadingChangelog = true; + var response = await _advancedService.readFile( + gitPath: package.latest.pubspec.homepage, fileName: 'CHANGELOG.md'); + _loadingChangelog = false; + response.fold( + (failure) => this._changelog = '', (data) => this._changelog = data); + } + @action Future loadScore() async { var response = await _service.getMetricPackage(package: package.name); diff --git a/lib/src/application/packages/detail_package_view_model.g.dart b/lib/src/application/packages/detail_package_view_model.g.dart index d70d736..5717832 100644 --- a/lib/src/application/packages/detail_package_view_model.g.dart +++ b/lib/src/application/packages/detail_package_view_model.g.dart @@ -71,6 +71,20 @@ mixin _$DetailPackageViewModel on _DetailPackageViewModel, Store { (_$readmeComputed ??= Computed(() => super.readme, name: '_DetailPackageViewModel.readme')) .value; + Computed? _$changelogComputed; + + @override + String get changelog => + (_$changelogComputed ??= Computed(() => super.changelog, + name: '_DetailPackageViewModel.changelog')) + .value; + Computed? _$publisherComputed; + + @override + String get publisher => + (_$publisherComputed ??= Computed(() => super.publisher, + name: '_DetailPackageViewModel.publisher')) + .value; Computed? _$hasDataComputed; @override @@ -84,6 +98,13 @@ mixin _$DetailPackageViewModel on _DetailPackageViewModel, Store { (_$hasReadmeComputed ??= Computed(() => super.hasReadme, name: '_DetailPackageViewModel.hasReadme')) .value; + Computed? _$hasChangelogComputed; + + @override + bool get hasChangelog => + (_$hasChangelogComputed ??= Computed(() => super.hasChangelog, + name: '_DetailPackageViewModel.hasChangelog')) + .value; Computed? _$loadingReadmeComputed; @override @@ -91,6 +112,13 @@ mixin _$DetailPackageViewModel on _DetailPackageViewModel, Store { (_$loadingReadmeComputed ??= Computed(() => super.loadingReadme, name: '_DetailPackageViewModel.loadingReadme')) .value; + Computed? _$loadingChangelogComputed; + + @override + bool get loadingChangelog => (_$loadingChangelogComputed ??= Computed( + () => super.loadingChangelog, + name: '_DetailPackageViewModel.loadingChangelog')) + .value; final _$_packageAtom = Atom(name: '_DetailPackageViewModel._package'); @@ -152,6 +180,36 @@ mixin _$DetailPackageViewModel on _DetailPackageViewModel, Store { }); } + final _$_publisherAtom = Atom(name: '_DetailPackageViewModel._publisher'); + + @override + String get _publisher { + _$_publisherAtom.reportRead(); + return super._publisher; + } + + @override + set _publisher(String value) { + _$_publisherAtom.reportWrite(value, super._publisher, () { + super._publisher = value; + }); + } + + final _$_changelogAtom = Atom(name: '_DetailPackageViewModel._changelog'); + + @override + String get _changelog { + _$_changelogAtom.reportRead(); + return super._changelog; + } + + @override + set _changelog(String value) { + _$_changelogAtom.reportWrite(value, super._changelog, () { + super._changelog = value; + }); + } + final _$_loadingReadmeAtom = Atom(name: '_DetailPackageViewModel._loadingReadme'); @@ -168,6 +226,22 @@ mixin _$DetailPackageViewModel on _DetailPackageViewModel, Store { }); } + final _$_loadingChangelogAtom = + Atom(name: '_DetailPackageViewModel._loadingChangelog'); + + @override + bool get _loadingChangelog { + _$_loadingChangelogAtom.reportRead(); + return super._loadingChangelog; + } + + @override + set _loadingChangelog(bool value) { + _$_loadingChangelogAtom.reportWrite(value, super._loadingChangelog, () { + super._loadingChangelog = value; + }); + } + final _$failureAtom = Atom(name: '_DetailPackageViewModel.failure'); @override @@ -186,9 +260,18 @@ mixin _$DetailPackageViewModel on _DetailPackageViewModel, Store { final _$loadAsyncAction = AsyncAction('_DetailPackageViewModel.load'); @override - Future load(String namePackage, {bool refresh = false}) { + Future load(String packageName, {bool refresh = false}) { return _$loadAsyncAction - .run(() => super.load(namePackage, refresh: refresh)); + .run(() => super.load(packageName, refresh: refresh)); + } + + final _$loadPublisherAsyncAction = + AsyncAction('_DetailPackageViewModel.loadPublisher'); + + @override + Future loadPublisher(String namePackage) { + return _$loadPublisherAsyncAction + .run(() => super.loadPublisher(namePackage)); } final _$loadReadmeAsyncAction = @@ -199,6 +282,14 @@ mixin _$DetailPackageViewModel on _DetailPackageViewModel, Store { return _$loadReadmeAsyncAction.run(() => super.loadReadme()); } + final _$loadChangelogAsyncAction = + AsyncAction('_DetailPackageViewModel.loadChangelog'); + + @override + Future loadChangelog() { + return _$loadChangelogAsyncAction.run(() => super.loadChangelog()); + } + final _$loadScoreAsyncAction = AsyncAction('_DetailPackageViewModel.loadScore'); @@ -245,9 +336,13 @@ dependencies: ${dependencies}, dev_dependencies: ${dev_dependencies}, environment: ${environment}, readme: ${readme}, +changelog: ${changelog}, +publisher: ${publisher}, hasData: ${hasData}, hasReadme: ${hasReadme}, -loadingReadme: ${loadingReadme} +hasChangelog: ${hasChangelog}, +loadingReadme: ${loadingReadme}, +loadingChangelog: ${loadingChangelog} '''; } } diff --git a/lib/src/presentation/core/tag.dart b/lib/src/presentation/core/tag.dart index 567f0b3..f541fbd 100644 --- a/lib/src/presentation/core/tag.dart +++ b/lib/src/presentation/core/tag.dart @@ -14,7 +14,7 @@ class Tag extends BaseComponent { padding: EdgeInsets.all(4.0), constraints: BoxConstraints(minWidth: 40.0), decoration: decoration( - color: kPrimaryColor, borderRadius: kBorder), + color: kPrimaryColor, borderRadius: kBorder/2), child: Center( child: Text( value!, From f8de53324c2bed01570ee62f167842e22ae5a9a9 Mon Sep 17 00:00:00 2001 From: Edvaldo Martins Date: Fri, 7 Oct 2022 13:49:36 +0100 Subject: [PATCH 34/42] other improvements -v2 --- .../package/state_detail_package_test.dart | 4 ++-- test/src/infrastructure/mocks.mocks.dart | 19 ++++++++++++++----- .../package/get_package_detail_test.dart | 8 ++++---- .../package/detail_package_page_test.dart | 12 +++++++++--- 4 files changed, 29 insertions(+), 14 deletions(-) diff --git a/test/src/application/package/state_detail_package_test.dart b/test/src/application/package/state_detail_package_test.dart index 69c9d40..717d75f 100644 --- a/test/src/application/package/state_detail_package_test.dart +++ b/test/src/application/package/state_detail_package_test.dart @@ -25,7 +25,7 @@ void main() { test('change state when get package is successfully', () async { var name = 'avatar_letter'; - when(repository.getPackageName(namePackage: name)) + when(repository.getPackageName(packageName: name)) .thenAnswer((_) async => Right(defaultPackage)); when(repository.getMetricPackage(package: name)) @@ -42,7 +42,7 @@ void main() { test('change state when get package has fail', () async { var name = 'avatar_letter'; - when(repository.getPackageName(namePackage: name)) + when(repository.getPackageName(packageName: name)) .thenAnswer((_) async => Left(RequestFailure.empty())); when(repository.getMetricPackage(package: name)) diff --git a/test/src/infrastructure/mocks.mocks.dart b/test/src/infrastructure/mocks.mocks.dart index 83f139d..ccc193b 100644 --- a/test/src/infrastructure/mocks.mocks.dart +++ b/test/src/infrastructure/mocks.mocks.dart @@ -67,10 +67,18 @@ class MockIPackageRepository extends _i1.Mock _FakeEither_1<_i6.RequestFailure, List<_i7.Package>>())) as _i5.Future<_i3.Either<_i6.RequestFailure, List<_i7.Package>>>); @override + _i5.Future<_i3.Either<_i6.RequestFailure, String>> getPublisher( + {String? packageName}) => + (super.noSuchMethod( + Invocation.method(#getPublisher, [], {#packageName: packageName}), + returnValue: Future<_i3.Either<_i6.RequestFailure, String>>.value( + _FakeEither_1<_i6.RequestFailure, String>())) + as _i5.Future<_i3.Either<_i6.RequestFailure, String>>); + @override _i5.Future<_i3.Either<_i6.RequestFailure, _i7.Package>> getPackageName( - {String? namePackage}) => + {String? packageName}) => (super.noSuchMethod( - Invocation.method(#getPackageName, [], {#namePackage: namePackage}), + Invocation.method(#getPackageName, [], {#packageName: packageName}), returnValue: Future<_i3.Either<_i6.RequestFailure, _i7.Package>>.value( _FakeEither_1<_i6.RequestFailure, _i7.Package>())) as _i5 @@ -124,10 +132,11 @@ class MockIAdvancedService extends _i1.Mock implements _i10.IAdvancedService { } @override - _i5.Future<_i3.Either<_i6.RequestFailure, String>> getReadme( - {String? gitPath}) => + _i5.Future<_i3.Either<_i6.RequestFailure, String>> readFile( + {String? gitPath, String? fileName}) => (super.noSuchMethod( - Invocation.method(#getReadme, [], {#gitPath: gitPath}), + Invocation.method( + #readFile, [], {#gitPath: gitPath, #fileName: fileName}), returnValue: Future<_i3.Either<_i6.RequestFailure, String>>.value( _FakeEither_1<_i6.RequestFailure, String>())) as _i5.Future<_i3.Either<_i6.RequestFailure, String>>); diff --git a/test/src/infrastructure/package/get_package_detail_test.dart b/test/src/infrastructure/package/get_package_detail_test.dart index b1743e6..7b86f3d 100644 --- a/test/src/infrastructure/package/get_package_detail_test.dart +++ b/test/src/infrastructure/package/get_package_detail_test.dart @@ -20,19 +20,19 @@ void main() { }); test('when get package detail is successfully', () async { - when(mockIPackageRepository.getPackageName(namePackage: namePackage)) + when(mockIPackageRepository.getPackageName(packageName: namePackage)) .thenAnswer((_) async => Right(defaultPackage)); - var result = await iPackageService.getPackageName(namePackage: namePackage); + var result = await iPackageService.getPackageName(packageName: namePackage); expect(result, equals(Right(defaultPackage))); }); test('when get package detail has failure', () async { - when(mockIPackageRepository.getPackageName(namePackage: namePackage)) + when(mockIPackageRepository.getPackageName(packageName: namePackage)) .thenAnswer((_) async => Left(RequestFailure.serverError())); - var result = await iPackageService.getPackageName(namePackage: namePackage); + var result = await iPackageService.getPackageName(packageName: namePackage); expect(result, equals(Left(RequestFailure.serverError()))); }); diff --git a/test/src/presentation/package/detail_package_page_test.dart b/test/src/presentation/package/detail_package_page_test.dart index 9a8a271..7d52e77 100644 --- a/test/src/presentation/package/detail_package_page_test.dart +++ b/test/src/presentation/package/detail_package_page_test.dart @@ -36,14 +36,20 @@ void main() { } testWidgets('test has data for detail', (tester) async { - when(repository.getPackageName(namePackage: namePackage)) + when(repository.getPackageName(packageName: namePackage)) .thenAnswer((_) async => Right(defaultPackage)); when(repository.getMetricPackage(package: namePackage)) .thenAnswer((_) async => Right(defaultMetric)); - when(iAdvancedService.getReadme( - gitPath: defaultPackage.latest.pubspec.homepage)) + when(iAdvancedService.readFile( + gitPath: defaultPackage.latest.pubspec.homepage, + fileName: 'README.md')) + .thenAnswer((_) async => Right(defaultReadme)); + + when(iAdvancedService.readFile( + gitPath: defaultPackage.latest.pubspec.homepage, + fileName: 'CHANGELOG.md')) .thenAnswer((_) async => Right(defaultReadme)); await tester.pumpWidget(createWidgetForTest()); From 67706928675e5cd5dc066d323a2d9514ad9c8a50 Mon Sep 17 00:00:00 2001 From: Edvaldo Martins Date: Fri, 7 Oct 2022 14:17:20 +0100 Subject: [PATCH 35/42] define tags supported --- lib/src/utils/constants.dart | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/lib/src/utils/constants.dart b/lib/src/utils/constants.dart index 29bc66d..aa88e71 100644 --- a/lib/src/utils/constants.dart +++ b/lib/src/utils/constants.dart @@ -3,3 +3,13 @@ const GITHUB = 'https://github.com/EdvaldoMartins/flutter_pub_dev'; const PUBDEV = 'https://pub.dev/packages'; String get fontName => 'Font'; + +List get tagList => [ + "web", + "windows", + "linux", + "macos", + "android", + "ios", + "fuchsia", + ]; From ccb80a866d1ec8e0e6f63d2d4c330a5aa6b7efd3 Mon Sep 17 00:00:00 2001 From: Edvaldo Martins Date: Fri, 7 Oct 2022 14:17:28 +0100 Subject: [PATCH 36/42] filter tags --- lib/src/infrastructure/core/mapper.dart | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/lib/src/infrastructure/core/mapper.dart b/lib/src/infrastructure/core/mapper.dart index 680d54b..aa09c7e 100644 --- a/lib/src/infrastructure/core/mapper.dart +++ b/lib/src/infrastructure/core/mapper.dart @@ -6,6 +6,8 @@ import 'package:flutter_package/src/domain/packages/entities/pubspec.dart'; import 'package:flutter_package/src/domain/packages/entities/score.dart'; import 'package:flutter_package/src/domain/packages/entities/version.dart'; +import '../../utils/constants.dart'; + /// [Mapper] parsed values abstract class Mapper { /// [dependencyFromMap] parse map to dependency object @@ -129,6 +131,12 @@ abstract class Mapper { if (index >= 0) tags.removeAt(index); tags.removeWhere((tag) => tag.trim().isEmpty); + + tags.removeWhere((tag) => + tagList.indexWhere((element) => + tag.trim().toLowerCase() == element.trim().toLowerCase()) < + 0); + return Metric( tags: tags.toSet().toList(), isNullSafe: (index >= 0), score: score); } From eeaa86cd29ebf7d1a60618de6f6ed1d9120ac2d7 Mon Sep 17 00:00:00 2001 From: Edvaldo Martins Date: Fri, 7 Oct 2022 14:17:44 +0100 Subject: [PATCH 37/42] update version ui item --- lib/src/presentation/core/version_item.dart | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/lib/src/presentation/core/version_item.dart b/lib/src/presentation/core/version_item.dart index b4c377c..ab0f21b 100644 --- a/lib/src/presentation/core/version_item.dart +++ b/lib/src/presentation/core/version_item.dart @@ -3,6 +3,7 @@ import 'package:flutter/material.dart'; import 'package:flutter_package/src/domain/packages/entities/version.dart'; import 'package:flutter_package/src/utils/colors.dart'; import 'package:flutter_package/src/presentation/core/styles.dart'; +import 'package:flutter_package/src/utils/size.dart'; class VersionItem extends StatelessWidget { final Version version; @@ -14,10 +15,12 @@ class VersionItem extends StatelessWidget { @override Widget build(BuildContext context) { - return Chip( + return Container( padding: EdgeInsets.zero, - backgroundColor: selected ? kPrimaryColor : kPlaceholderColor, - label: InkWell( + decoration: decoration( + color: selected ? kPrimaryColor : kPlaceholderColor, + borderRadius: kBorder), + child: InkWell( onTap: onTap, child: Container( constraints: BoxConstraints(maxWidth: 100.0), From 11e2df463c1735a5feac1226ff976cb20a3bed91 Mon Sep 17 00:00:00 2001 From: Edvaldo Martins Date: Fri, 7 Oct 2022 14:18:52 +0100 Subject: [PATCH 38/42] update detail of package show publisher change tag type other improvements --- .flutter-plugins-dependencies | 2 +- .../domain/core/request_failure.freezed.dart | 351 ++++++++++++++++++ .../packages/detail_package_screen.dart | 74 ++-- 3 files changed, 379 insertions(+), 48 deletions(-) create mode 100644 lib/src/domain/core/request_failure.freezed.dart diff --git a/.flutter-plugins-dependencies b/.flutter-plugins-dependencies index ee906df..0bca700 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.","plugins":{"ios":[{"name":"fluttertoast","path":"/Users/edvaldo/flutter/.pub-cache/hosted/pub.dartlang.org/fluttertoast-7.1.8/","dependencies":[]},{"name":"integration_test","path":"/Users/edvaldo/flutter/packages/integration_test/","dependencies":[]},{"name":"share","path":"/Users/edvaldo/flutter/.pub-cache/hosted/pub.dartlang.org/share-2.0.4/","dependencies":[]},{"name":"shared_preferences_ios","path":"/Users/edvaldo/flutter/.pub-cache/hosted/pub.dartlang.org/shared_preferences_ios-2.1.0/","dependencies":[]},{"name":"url_launcher_ios","path":"/Users/edvaldo/flutter/.pub-cache/hosted/pub.dartlang.org/url_launcher_ios-6.0.15/","dependencies":[]}],"android":[{"name":"fluttertoast","path":"/Users/edvaldo/flutter/.pub-cache/hosted/pub.dartlang.org/fluttertoast-7.1.8/","dependencies":[]},{"name":"integration_test","path":"/Users/edvaldo/flutter/packages/integration_test/","dependencies":[]},{"name":"share","path":"/Users/edvaldo/flutter/.pub-cache/hosted/pub.dartlang.org/share-2.0.4/","dependencies":[]},{"name":"shared_preferences_android","path":"/Users/edvaldo/flutter/.pub-cache/hosted/pub.dartlang.org/shared_preferences_android-2.0.11/","dependencies":[]},{"name":"url_launcher_android","path":"/Users/edvaldo/flutter/.pub-cache/hosted/pub.dartlang.org/url_launcher_android-6.0.15/","dependencies":[]}],"macos":[{"name":"shared_preferences_macos","path":"/Users/edvaldo/flutter/.pub-cache/hosted/pub.dartlang.org/shared_preferences_macos-2.0.3/","dependencies":[]},{"name":"url_launcher_macos","path":"/Users/edvaldo/flutter/.pub-cache/hosted/pub.dartlang.org/url_launcher_macos-3.0.0/","dependencies":[]}],"linux":[{"name":"path_provider_linux","path":"/Users/edvaldo/flutter/.pub-cache/hosted/pub.dartlang.org/path_provider_linux-2.1.5/","dependencies":[]},{"name":"shared_preferences_linux","path":"/Users/edvaldo/flutter/.pub-cache/hosted/pub.dartlang.org/shared_preferences_linux-2.1.0/","dependencies":["path_provider_linux"]},{"name":"url_launcher_linux","path":"/Users/edvaldo/flutter/.pub-cache/hosted/pub.dartlang.org/url_launcher_linux-3.0.0/","dependencies":[]}],"windows":[{"name":"path_provider_windows","path":"/Users/edvaldo/flutter/.pub-cache/hosted/pub.dartlang.org/path_provider_windows-2.0.5/","dependencies":[]},{"name":"shared_preferences_windows","path":"/Users/edvaldo/flutter/.pub-cache/hosted/pub.dartlang.org/shared_preferences_windows-2.1.0/","dependencies":["path_provider_windows"]},{"name":"url_launcher_windows","path":"/Users/edvaldo/flutter/.pub-cache/hosted/pub.dartlang.org/url_launcher_windows-3.0.0/","dependencies":[]}],"web":[{"name":"fluttertoast","path":"/Users/edvaldo/flutter/.pub-cache/hosted/pub.dartlang.org/fluttertoast-7.1.8/","dependencies":[]},{"name":"shared_preferences_web","path":"/Users/edvaldo/flutter/.pub-cache/hosted/pub.dartlang.org/shared_preferences_web-2.0.3/","dependencies":[]},{"name":"url_launcher_web","path":"/Users/edvaldo/flutter/.pub-cache/hosted/pub.dartlang.org/url_launcher_web-2.0.9/","dependencies":[]}]},"dependencyGraph":[{"name":"fluttertoast","dependencies":[]},{"name":"integration_test","dependencies":[]},{"name":"path_provider_linux","dependencies":[]},{"name":"path_provider_windows","dependencies":[]},{"name":"share","dependencies":[]},{"name":"shared_preferences","dependencies":["shared_preferences_android","shared_preferences_ios","shared_preferences_linux","shared_preferences_macos","shared_preferences_web","shared_preferences_windows"]},{"name":"shared_preferences_android","dependencies":[]},{"name":"shared_preferences_ios","dependencies":[]},{"name":"shared_preferences_linux","dependencies":["path_provider_linux"]},{"name":"shared_preferences_macos","dependencies":[]},{"name":"shared_preferences_web","dependencies":[]},{"name":"shared_preferences_windows","dependencies":["path_provider_windows"]},{"name":"url_launcher","dependencies":["url_launcher_android","url_launcher_ios","url_launcher_linux","url_launcher_macos","url_launcher_web","url_launcher_windows"]},{"name":"url_launcher_android","dependencies":[]},{"name":"url_launcher_ios","dependencies":[]},{"name":"url_launcher_linux","dependencies":[]},{"name":"url_launcher_macos","dependencies":[]},{"name":"url_launcher_web","dependencies":[]},{"name":"url_launcher_windows","dependencies":[]}],"date_created":"2022-10-07 12:49:31.829087","version":"2.10.5"} \ No newline at end of file +{"info":"This is a generated file; do not edit or check into version control.","plugins":{"ios":[{"name":"fluttertoast","path":"/Users/edvaldo/flutter/.pub-cache/hosted/pub.dartlang.org/fluttertoast-7.1.8/","dependencies":[]},{"name":"integration_test","path":"/Users/edvaldo/flutter/packages/integration_test/","dependencies":[]},{"name":"share","path":"/Users/edvaldo/flutter/.pub-cache/hosted/pub.dartlang.org/share-2.0.4/","dependencies":[]},{"name":"shared_preferences_ios","path":"/Users/edvaldo/flutter/.pub-cache/hosted/pub.dartlang.org/shared_preferences_ios-2.1.0/","dependencies":[]},{"name":"url_launcher_ios","path":"/Users/edvaldo/flutter/.pub-cache/hosted/pub.dartlang.org/url_launcher_ios-6.0.15/","dependencies":[]}],"android":[{"name":"fluttertoast","path":"/Users/edvaldo/flutter/.pub-cache/hosted/pub.dartlang.org/fluttertoast-7.1.8/","dependencies":[]},{"name":"integration_test","path":"/Users/edvaldo/flutter/packages/integration_test/","dependencies":[]},{"name":"share","path":"/Users/edvaldo/flutter/.pub-cache/hosted/pub.dartlang.org/share-2.0.4/","dependencies":[]},{"name":"shared_preferences_android","path":"/Users/edvaldo/flutter/.pub-cache/hosted/pub.dartlang.org/shared_preferences_android-2.0.11/","dependencies":[]},{"name":"url_launcher_android","path":"/Users/edvaldo/flutter/.pub-cache/hosted/pub.dartlang.org/url_launcher_android-6.0.15/","dependencies":[]}],"macos":[{"name":"shared_preferences_macos","path":"/Users/edvaldo/flutter/.pub-cache/hosted/pub.dartlang.org/shared_preferences_macos-2.0.3/","dependencies":[]},{"name":"url_launcher_macos","path":"/Users/edvaldo/flutter/.pub-cache/hosted/pub.dartlang.org/url_launcher_macos-3.0.0/","dependencies":[]}],"linux":[{"name":"path_provider_linux","path":"/Users/edvaldo/flutter/.pub-cache/hosted/pub.dartlang.org/path_provider_linux-2.1.5/","dependencies":[]},{"name":"shared_preferences_linux","path":"/Users/edvaldo/flutter/.pub-cache/hosted/pub.dartlang.org/shared_preferences_linux-2.1.0/","dependencies":["path_provider_linux"]},{"name":"url_launcher_linux","path":"/Users/edvaldo/flutter/.pub-cache/hosted/pub.dartlang.org/url_launcher_linux-3.0.0/","dependencies":[]}],"windows":[{"name":"path_provider_windows","path":"/Users/edvaldo/flutter/.pub-cache/hosted/pub.dartlang.org/path_provider_windows-2.0.5/","dependencies":[]},{"name":"shared_preferences_windows","path":"/Users/edvaldo/flutter/.pub-cache/hosted/pub.dartlang.org/shared_preferences_windows-2.1.0/","dependencies":["path_provider_windows"]},{"name":"url_launcher_windows","path":"/Users/edvaldo/flutter/.pub-cache/hosted/pub.dartlang.org/url_launcher_windows-3.0.0/","dependencies":[]}],"web":[{"name":"fluttertoast","path":"/Users/edvaldo/flutter/.pub-cache/hosted/pub.dartlang.org/fluttertoast-7.1.8/","dependencies":[]},{"name":"shared_preferences_web","path":"/Users/edvaldo/flutter/.pub-cache/hosted/pub.dartlang.org/shared_preferences_web-2.0.3/","dependencies":[]},{"name":"url_launcher_web","path":"/Users/edvaldo/flutter/.pub-cache/hosted/pub.dartlang.org/url_launcher_web-2.0.9/","dependencies":[]}]},"dependencyGraph":[{"name":"fluttertoast","dependencies":[]},{"name":"integration_test","dependencies":[]},{"name":"path_provider_linux","dependencies":[]},{"name":"path_provider_windows","dependencies":[]},{"name":"share","dependencies":[]},{"name":"shared_preferences","dependencies":["shared_preferences_android","shared_preferences_ios","shared_preferences_linux","shared_preferences_macos","shared_preferences_web","shared_preferences_windows"]},{"name":"shared_preferences_android","dependencies":[]},{"name":"shared_preferences_ios","dependencies":[]},{"name":"shared_preferences_linux","dependencies":["path_provider_linux"]},{"name":"shared_preferences_macos","dependencies":[]},{"name":"shared_preferences_web","dependencies":[]},{"name":"shared_preferences_windows","dependencies":["path_provider_windows"]},{"name":"url_launcher","dependencies":["url_launcher_android","url_launcher_ios","url_launcher_linux","url_launcher_macos","url_launcher_web","url_launcher_windows"]},{"name":"url_launcher_android","dependencies":[]},{"name":"url_launcher_ios","dependencies":[]},{"name":"url_launcher_linux","dependencies":[]},{"name":"url_launcher_macos","dependencies":[]},{"name":"url_launcher_web","dependencies":[]},{"name":"url_launcher_windows","dependencies":[]}],"date_created":"2022-10-07 14:14:22.250878","version":"2.10.5"} \ No newline at end of file diff --git a/lib/src/domain/core/request_failure.freezed.dart b/lib/src/domain/core/request_failure.freezed.dart new file mode 100644 index 0000000..66a6586 --- /dev/null +++ b/lib/src/domain/core/request_failure.freezed.dart @@ -0,0 +1,351 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND +// ignore_for_file: unused_element, deprecated_member_use, deprecated_member_use_from_same_package, use_function_type_syntax_for_parameters, unnecessary_const, avoid_init_to_null, invalid_override_different_default_values_named, prefer_expression_function_bodies, annotate_overrides + +part of 'request_failure.dart'; + +// ************************************************************************** +// FreezedGenerator +// ************************************************************************** + +T _$identity(T value) => value; + +final _privateConstructorUsedError = UnsupportedError( + 'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more informations: https://github.com/rrousselGit/freezed#custom-getters-and-methods'); + +/// @nodoc +class _$RequestFailureTearOff { + const _$RequestFailureTearOff(); + + _NetworkFailure networkError() { + return _NetworkFailure(); + } + + _Empty empty() { + return _Empty(); + } + + _ServerError serverError() { + return _ServerError(); + } +} + +/// @nodoc +const $RequestFailure = _$RequestFailureTearOff(); + +/// @nodoc +mixin _$RequestFailure { + @optionalTypeArgs + TResult when({ + required TResult Function() networkError, + required TResult Function() empty, + required TResult Function() serverError, + }) => + throw _privateConstructorUsedError; + @optionalTypeArgs + TResult maybeWhen({ + TResult Function()? networkError, + TResult Function()? empty, + TResult Function()? serverError, + required TResult orElse(), + }) => + throw _privateConstructorUsedError; + @optionalTypeArgs + TResult map({ + required TResult Function(_NetworkFailure value) networkError, + required TResult Function(_Empty value) empty, + required TResult Function(_ServerError value) serverError, + }) => + throw _privateConstructorUsedError; + @optionalTypeArgs + TResult maybeMap({ + TResult Function(_NetworkFailure value)? networkError, + TResult Function(_Empty value)? empty, + TResult Function(_ServerError value)? serverError, + required TResult orElse(), + }) => + throw _privateConstructorUsedError; +} + +/// @nodoc +abstract class $RequestFailureCopyWith<$Res> { + factory $RequestFailureCopyWith( + RequestFailure value, $Res Function(RequestFailure) then) = + _$RequestFailureCopyWithImpl<$Res>; +} + +/// @nodoc +class _$RequestFailureCopyWithImpl<$Res> + implements $RequestFailureCopyWith<$Res> { + _$RequestFailureCopyWithImpl(this._value, this._then); + + final RequestFailure _value; + // ignore: unused_field + final $Res Function(RequestFailure) _then; +} + +/// @nodoc +abstract class _$NetworkFailureCopyWith<$Res> { + factory _$NetworkFailureCopyWith( + _NetworkFailure value, $Res Function(_NetworkFailure) then) = + __$NetworkFailureCopyWithImpl<$Res>; +} + +/// @nodoc +class __$NetworkFailureCopyWithImpl<$Res> + extends _$RequestFailureCopyWithImpl<$Res> + implements _$NetworkFailureCopyWith<$Res> { + __$NetworkFailureCopyWithImpl( + _NetworkFailure _value, $Res Function(_NetworkFailure) _then) + : super(_value, (v) => _then(v as _NetworkFailure)); + + @override + _NetworkFailure get _value => super._value as _NetworkFailure; +} + +/// @nodoc + +class _$_NetworkFailure implements _NetworkFailure { + _$_NetworkFailure(); + + @override + String toString() { + return 'RequestFailure.networkError()'; + } + + @override + bool operator ==(dynamic other) { + return identical(this, other) || (other is _NetworkFailure); + } + + @override + int get hashCode => runtimeType.hashCode; + + @override + @optionalTypeArgs + TResult when({ + required TResult Function() networkError, + required TResult Function() empty, + required TResult Function() serverError, + }) { + return networkError(); + } + + @override + @optionalTypeArgs + TResult maybeWhen({ + TResult Function()? networkError, + TResult Function()? empty, + TResult Function()? serverError, + required TResult orElse(), + }) { + if (networkError != null) { + return networkError(); + } + return orElse(); + } + + @override + @optionalTypeArgs + TResult map({ + required TResult Function(_NetworkFailure value) networkError, + required TResult Function(_Empty value) empty, + required TResult Function(_ServerError value) serverError, + }) { + return networkError(this); + } + + @override + @optionalTypeArgs + TResult maybeMap({ + TResult Function(_NetworkFailure value)? networkError, + TResult Function(_Empty value)? empty, + TResult Function(_ServerError value)? serverError, + required TResult orElse(), + }) { + if (networkError != null) { + return networkError(this); + } + return orElse(); + } +} + +abstract class _NetworkFailure implements RequestFailure { + factory _NetworkFailure() = _$_NetworkFailure; +} + +/// @nodoc +abstract class _$EmptyCopyWith<$Res> { + factory _$EmptyCopyWith(_Empty value, $Res Function(_Empty) then) = + __$EmptyCopyWithImpl<$Res>; +} + +/// @nodoc +class __$EmptyCopyWithImpl<$Res> extends _$RequestFailureCopyWithImpl<$Res> + implements _$EmptyCopyWith<$Res> { + __$EmptyCopyWithImpl(_Empty _value, $Res Function(_Empty) _then) + : super(_value, (v) => _then(v as _Empty)); + + @override + _Empty get _value => super._value as _Empty; +} + +/// @nodoc + +class _$_Empty implements _Empty { + _$_Empty(); + + @override + String toString() { + return 'RequestFailure.empty()'; + } + + @override + bool operator ==(dynamic other) { + return identical(this, other) || (other is _Empty); + } + + @override + int get hashCode => runtimeType.hashCode; + + @override + @optionalTypeArgs + TResult when({ + required TResult Function() networkError, + required TResult Function() empty, + required TResult Function() serverError, + }) { + return empty(); + } + + @override + @optionalTypeArgs + TResult maybeWhen({ + TResult Function()? networkError, + TResult Function()? empty, + TResult Function()? serverError, + required TResult orElse(), + }) { + if (empty != null) { + return empty(); + } + return orElse(); + } + + @override + @optionalTypeArgs + TResult map({ + required TResult Function(_NetworkFailure value) networkError, + required TResult Function(_Empty value) empty, + required TResult Function(_ServerError value) serverError, + }) { + return empty(this); + } + + @override + @optionalTypeArgs + TResult maybeMap({ + TResult Function(_NetworkFailure value)? networkError, + TResult Function(_Empty value)? empty, + TResult Function(_ServerError value)? serverError, + required TResult orElse(), + }) { + if (empty != null) { + return empty(this); + } + return orElse(); + } +} + +abstract class _Empty implements RequestFailure { + factory _Empty() = _$_Empty; +} + +/// @nodoc +abstract class _$ServerErrorCopyWith<$Res> { + factory _$ServerErrorCopyWith( + _ServerError value, $Res Function(_ServerError) then) = + __$ServerErrorCopyWithImpl<$Res>; +} + +/// @nodoc +class __$ServerErrorCopyWithImpl<$Res> + extends _$RequestFailureCopyWithImpl<$Res> + implements _$ServerErrorCopyWith<$Res> { + __$ServerErrorCopyWithImpl( + _ServerError _value, $Res Function(_ServerError) _then) + : super(_value, (v) => _then(v as _ServerError)); + + @override + _ServerError get _value => super._value as _ServerError; +} + +/// @nodoc + +class _$_ServerError implements _ServerError { + _$_ServerError(); + + @override + String toString() { + return 'RequestFailure.serverError()'; + } + + @override + bool operator ==(dynamic other) { + return identical(this, other) || (other is _ServerError); + } + + @override + int get hashCode => runtimeType.hashCode; + + @override + @optionalTypeArgs + TResult when({ + required TResult Function() networkError, + required TResult Function() empty, + required TResult Function() serverError, + }) { + return serverError(); + } + + @override + @optionalTypeArgs + TResult maybeWhen({ + TResult Function()? networkError, + TResult Function()? empty, + TResult Function()? serverError, + required TResult orElse(), + }) { + if (serverError != null) { + return serverError(); + } + return orElse(); + } + + @override + @optionalTypeArgs + TResult map({ + required TResult Function(_NetworkFailure value) networkError, + required TResult Function(_Empty value) empty, + required TResult Function(_ServerError value) serverError, + }) { + return serverError(this); + } + + @override + @optionalTypeArgs + TResult maybeMap({ + TResult Function(_NetworkFailure value)? networkError, + TResult Function(_Empty value)? empty, + TResult Function(_ServerError value)? serverError, + required TResult orElse(), + }) { + if (serverError != null) { + return serverError(this); + } + return orElse(); + } +} + +abstract class _ServerError implements RequestFailure { + factory _ServerError() = _$_ServerError; +} diff --git a/lib/src/presentation/packages/detail_package_screen.dart b/lib/src/presentation/packages/detail_package_screen.dart index 5a85ee3..a0ae85c 100644 --- a/lib/src/presentation/packages/detail_package_screen.dart +++ b/lib/src/presentation/packages/detail_package_screen.dart @@ -356,7 +356,7 @@ class DetailPackageScreenState extends State icon: 'info', sizeIcon: 80, message: 'error_readme'.translate, - onTap: _model.loadReadme, + onTap: _model.loadChangelog, )) ], ) @@ -446,25 +446,23 @@ class DetailPackageScreenState extends State if (!_model.metric.isNotEmpty) return empty; var tags = _model.metric.tags; - return Container( - height: 38.0, - padding: EdgeInsets.all(8.0), - decoration: decoration( - color: kPrimaryColor.withOpacity(.60), borderRadius: kBorder), - child: ListView.builder( - itemBuilder: (context, index) { - var separator = (index == 0) ? '' : '\t•\t'; - return Container( - child: Text( - '$separator${tags[index]}', - style: styleText( - color: kBackgroundColor, fontWeight: FontWeight.bold), - ), - ); - }, - itemCount: tags.length, - scrollDirection: Axis.horizontal, - ), + + return Wrap( + crossAxisAlignment: WrapCrossAlignment.center, + runSpacing: 8.0, + spacing: 8.0, + children: List.generate(tags.length, (index) { + return Container( + padding: EdgeInsets.all(8.0), + decoration: decoration(borderRadius: kBorder, color: kPrimaryColor), + constraints: BoxConstraints(minWidth: 60.0), + child: Text( + '${tags[index]}', + textAlign: TextAlign.center, + style: styleText(color: kTitleTextColor, fontSize: kSubtitleSize), + ), + ); + }), ); } @@ -534,29 +532,6 @@ class DetailPackageScreenState extends State ), if (!isLastVersion) verticalSpaceSmall(), Divider(), - Text.rich( - TextSpan( - text: '', - style: styleText( - color: kPrimaryColor, - fontWeight: FontWeight.bold, - fontSize: 14.0), - children: [ - TextSpan( - text: '${'publisher'.translate}:', - style: styleText( - color: kPrimaryColor, - fontWeight: FontWeight.bold, - fontSize: 14.0)), - TextSpan( - text: '\t$publisher', - style: styleText(fontSize: 14.0), - ) - ]), - overflow: TextOverflow.fade, - maxLines: 1, - ), - Divider(), Text( title, key: Key(title), @@ -565,6 +540,11 @@ class DetailPackageScreenState extends State fontSize: 24, ), ), + Text( + publisher, + key: Key(publisher), + style: styleText(fontSize: 14.0, color: kSubtitleTextColor), + ), verticalSpaceSmall(), Text( '${_model.version.pubspec.description}', @@ -649,7 +629,7 @@ class DetailPackageScreenState extends State ), centerTitle: false, actions: [ - if (_model.hasData && !_model.isBusy) + if (_model.hasData) IconButton( icon: CustomIcon( icon: 'download', @@ -657,14 +637,14 @@ class DetailPackageScreenState extends State ), onPressed: () => Util.openLink(url: _model.package.latest.archive_url)), - if (_model.hasData && !_model.isBusy) + if (_model.hasData) IconButton( icon: CustomIcon( icon: 'share', size: 20, ), onPressed: () => Util.shareProject(package: _model.package)), - if (_model.hasData && !_model.isBusy) + if (_model.hasData) Builder(builder: (context) { var _homePage = _model.package.latest.pubspec.homepage; if (_homePage.isNotEmpty) @@ -690,7 +670,7 @@ class DetailPackageScreenState extends State refresh: _model.refresh, child: _build(), enablePullUp: false, - onRefresh: () => _model.load(widget.name), + onRefresh: () => _model.load(widget.name, refresh: true), ), ); }); From ca3079e245391990ca2ed61aa5a80915cc0d8608 Mon Sep 17 00:00:00 2001 From: Edvaldo Martins Date: Fri, 7 Oct 2022 14:29:15 +0100 Subject: [PATCH 39/42] other improvements -v3 --- .flutter-plugins-dependencies | 2 +- test/src/presentation/package/detail_package_page_test.dart | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/.flutter-plugins-dependencies b/.flutter-plugins-dependencies index 0bca700..8ffd55c 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.","plugins":{"ios":[{"name":"fluttertoast","path":"/Users/edvaldo/flutter/.pub-cache/hosted/pub.dartlang.org/fluttertoast-7.1.8/","dependencies":[]},{"name":"integration_test","path":"/Users/edvaldo/flutter/packages/integration_test/","dependencies":[]},{"name":"share","path":"/Users/edvaldo/flutter/.pub-cache/hosted/pub.dartlang.org/share-2.0.4/","dependencies":[]},{"name":"shared_preferences_ios","path":"/Users/edvaldo/flutter/.pub-cache/hosted/pub.dartlang.org/shared_preferences_ios-2.1.0/","dependencies":[]},{"name":"url_launcher_ios","path":"/Users/edvaldo/flutter/.pub-cache/hosted/pub.dartlang.org/url_launcher_ios-6.0.15/","dependencies":[]}],"android":[{"name":"fluttertoast","path":"/Users/edvaldo/flutter/.pub-cache/hosted/pub.dartlang.org/fluttertoast-7.1.8/","dependencies":[]},{"name":"integration_test","path":"/Users/edvaldo/flutter/packages/integration_test/","dependencies":[]},{"name":"share","path":"/Users/edvaldo/flutter/.pub-cache/hosted/pub.dartlang.org/share-2.0.4/","dependencies":[]},{"name":"shared_preferences_android","path":"/Users/edvaldo/flutter/.pub-cache/hosted/pub.dartlang.org/shared_preferences_android-2.0.11/","dependencies":[]},{"name":"url_launcher_android","path":"/Users/edvaldo/flutter/.pub-cache/hosted/pub.dartlang.org/url_launcher_android-6.0.15/","dependencies":[]}],"macos":[{"name":"shared_preferences_macos","path":"/Users/edvaldo/flutter/.pub-cache/hosted/pub.dartlang.org/shared_preferences_macos-2.0.3/","dependencies":[]},{"name":"url_launcher_macos","path":"/Users/edvaldo/flutter/.pub-cache/hosted/pub.dartlang.org/url_launcher_macos-3.0.0/","dependencies":[]}],"linux":[{"name":"path_provider_linux","path":"/Users/edvaldo/flutter/.pub-cache/hosted/pub.dartlang.org/path_provider_linux-2.1.5/","dependencies":[]},{"name":"shared_preferences_linux","path":"/Users/edvaldo/flutter/.pub-cache/hosted/pub.dartlang.org/shared_preferences_linux-2.1.0/","dependencies":["path_provider_linux"]},{"name":"url_launcher_linux","path":"/Users/edvaldo/flutter/.pub-cache/hosted/pub.dartlang.org/url_launcher_linux-3.0.0/","dependencies":[]}],"windows":[{"name":"path_provider_windows","path":"/Users/edvaldo/flutter/.pub-cache/hosted/pub.dartlang.org/path_provider_windows-2.0.5/","dependencies":[]},{"name":"shared_preferences_windows","path":"/Users/edvaldo/flutter/.pub-cache/hosted/pub.dartlang.org/shared_preferences_windows-2.1.0/","dependencies":["path_provider_windows"]},{"name":"url_launcher_windows","path":"/Users/edvaldo/flutter/.pub-cache/hosted/pub.dartlang.org/url_launcher_windows-3.0.0/","dependencies":[]}],"web":[{"name":"fluttertoast","path":"/Users/edvaldo/flutter/.pub-cache/hosted/pub.dartlang.org/fluttertoast-7.1.8/","dependencies":[]},{"name":"shared_preferences_web","path":"/Users/edvaldo/flutter/.pub-cache/hosted/pub.dartlang.org/shared_preferences_web-2.0.3/","dependencies":[]},{"name":"url_launcher_web","path":"/Users/edvaldo/flutter/.pub-cache/hosted/pub.dartlang.org/url_launcher_web-2.0.9/","dependencies":[]}]},"dependencyGraph":[{"name":"fluttertoast","dependencies":[]},{"name":"integration_test","dependencies":[]},{"name":"path_provider_linux","dependencies":[]},{"name":"path_provider_windows","dependencies":[]},{"name":"share","dependencies":[]},{"name":"shared_preferences","dependencies":["shared_preferences_android","shared_preferences_ios","shared_preferences_linux","shared_preferences_macos","shared_preferences_web","shared_preferences_windows"]},{"name":"shared_preferences_android","dependencies":[]},{"name":"shared_preferences_ios","dependencies":[]},{"name":"shared_preferences_linux","dependencies":["path_provider_linux"]},{"name":"shared_preferences_macos","dependencies":[]},{"name":"shared_preferences_web","dependencies":[]},{"name":"shared_preferences_windows","dependencies":["path_provider_windows"]},{"name":"url_launcher","dependencies":["url_launcher_android","url_launcher_ios","url_launcher_linux","url_launcher_macos","url_launcher_web","url_launcher_windows"]},{"name":"url_launcher_android","dependencies":[]},{"name":"url_launcher_ios","dependencies":[]},{"name":"url_launcher_linux","dependencies":[]},{"name":"url_launcher_macos","dependencies":[]},{"name":"url_launcher_web","dependencies":[]},{"name":"url_launcher_windows","dependencies":[]}],"date_created":"2022-10-07 14:14:22.250878","version":"2.10.5"} \ No newline at end of file +{"info":"This is a generated file; do not edit or check into version control.","plugins":{"ios":[{"name":"fluttertoast","path":"/Users/edvaldo/flutter/.pub-cache/hosted/pub.dartlang.org/fluttertoast-7.1.8/","dependencies":[]},{"name":"integration_test","path":"/Users/edvaldo/flutter/packages/integration_test/","dependencies":[]},{"name":"share","path":"/Users/edvaldo/flutter/.pub-cache/hosted/pub.dartlang.org/share-2.0.4/","dependencies":[]},{"name":"shared_preferences_ios","path":"/Users/edvaldo/flutter/.pub-cache/hosted/pub.dartlang.org/shared_preferences_ios-2.1.0/","dependencies":[]},{"name":"url_launcher_ios","path":"/Users/edvaldo/flutter/.pub-cache/hosted/pub.dartlang.org/url_launcher_ios-6.0.15/","dependencies":[]}],"android":[{"name":"fluttertoast","path":"/Users/edvaldo/flutter/.pub-cache/hosted/pub.dartlang.org/fluttertoast-7.1.8/","dependencies":[]},{"name":"integration_test","path":"/Users/edvaldo/flutter/packages/integration_test/","dependencies":[]},{"name":"share","path":"/Users/edvaldo/flutter/.pub-cache/hosted/pub.dartlang.org/share-2.0.4/","dependencies":[]},{"name":"shared_preferences_android","path":"/Users/edvaldo/flutter/.pub-cache/hosted/pub.dartlang.org/shared_preferences_android-2.0.11/","dependencies":[]},{"name":"url_launcher_android","path":"/Users/edvaldo/flutter/.pub-cache/hosted/pub.dartlang.org/url_launcher_android-6.0.15/","dependencies":[]}],"macos":[{"name":"shared_preferences_macos","path":"/Users/edvaldo/flutter/.pub-cache/hosted/pub.dartlang.org/shared_preferences_macos-2.0.3/","dependencies":[]},{"name":"url_launcher_macos","path":"/Users/edvaldo/flutter/.pub-cache/hosted/pub.dartlang.org/url_launcher_macos-3.0.0/","dependencies":[]}],"linux":[{"name":"path_provider_linux","path":"/Users/edvaldo/flutter/.pub-cache/hosted/pub.dartlang.org/path_provider_linux-2.1.5/","dependencies":[]},{"name":"shared_preferences_linux","path":"/Users/edvaldo/flutter/.pub-cache/hosted/pub.dartlang.org/shared_preferences_linux-2.1.0/","dependencies":["path_provider_linux"]},{"name":"url_launcher_linux","path":"/Users/edvaldo/flutter/.pub-cache/hosted/pub.dartlang.org/url_launcher_linux-3.0.0/","dependencies":[]}],"windows":[{"name":"path_provider_windows","path":"/Users/edvaldo/flutter/.pub-cache/hosted/pub.dartlang.org/path_provider_windows-2.0.5/","dependencies":[]},{"name":"shared_preferences_windows","path":"/Users/edvaldo/flutter/.pub-cache/hosted/pub.dartlang.org/shared_preferences_windows-2.1.0/","dependencies":["path_provider_windows"]},{"name":"url_launcher_windows","path":"/Users/edvaldo/flutter/.pub-cache/hosted/pub.dartlang.org/url_launcher_windows-3.0.0/","dependencies":[]}],"web":[{"name":"fluttertoast","path":"/Users/edvaldo/flutter/.pub-cache/hosted/pub.dartlang.org/fluttertoast-7.1.8/","dependencies":[]},{"name":"shared_preferences_web","path":"/Users/edvaldo/flutter/.pub-cache/hosted/pub.dartlang.org/shared_preferences_web-2.0.3/","dependencies":[]},{"name":"url_launcher_web","path":"/Users/edvaldo/flutter/.pub-cache/hosted/pub.dartlang.org/url_launcher_web-2.0.9/","dependencies":[]}]},"dependencyGraph":[{"name":"fluttertoast","dependencies":[]},{"name":"integration_test","dependencies":[]},{"name":"path_provider_linux","dependencies":[]},{"name":"path_provider_windows","dependencies":[]},{"name":"share","dependencies":[]},{"name":"shared_preferences","dependencies":["shared_preferences_android","shared_preferences_ios","shared_preferences_linux","shared_preferences_macos","shared_preferences_web","shared_preferences_windows"]},{"name":"shared_preferences_android","dependencies":[]},{"name":"shared_preferences_ios","dependencies":[]},{"name":"shared_preferences_linux","dependencies":["path_provider_linux"]},{"name":"shared_preferences_macos","dependencies":[]},{"name":"shared_preferences_web","dependencies":[]},{"name":"shared_preferences_windows","dependencies":["path_provider_windows"]},{"name":"url_launcher","dependencies":["url_launcher_android","url_launcher_ios","url_launcher_linux","url_launcher_macos","url_launcher_web","url_launcher_windows"]},{"name":"url_launcher_android","dependencies":[]},{"name":"url_launcher_ios","dependencies":[]},{"name":"url_launcher_linux","dependencies":[]},{"name":"url_launcher_macos","dependencies":[]},{"name":"url_launcher_web","dependencies":[]},{"name":"url_launcher_windows","dependencies":[]}],"date_created":"2022-10-07 14:21:22.176745","version":"2.10.5"} \ No newline at end of file diff --git a/test/src/presentation/package/detail_package_page_test.dart b/test/src/presentation/package/detail_package_page_test.dart index 7d52e77..48e37d7 100644 --- a/test/src/presentation/package/detail_package_page_test.dart +++ b/test/src/presentation/package/detail_package_page_test.dart @@ -42,6 +42,9 @@ void main() { when(repository.getMetricPackage(package: namePackage)) .thenAnswer((_) async => Right(defaultMetric)); + when(repository.getPublisher(packageName: namePackage)) + .thenAnswer((_) async => Right('srnunio@default.com')); + when(iAdvancedService.readFile( gitPath: defaultPackage.latest.pubspec.homepage, fileName: 'README.md')) From 9de2e15aa5c9cd35fe1168d524129f2b65e809bd Mon Sep 17 00:00:00 2001 From: Edvaldo Martins Date: Fri, 7 Oct 2022 14:32:25 +0100 Subject: [PATCH 40/42] other improvements -v4 --- README.md | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 05bb3e1..007a3dc 100644 --- a/README.md +++ b/README.md @@ -55,12 +55,17 @@ flutter test integration_test/app_test.dart ## 📸 Screenshots + + + + + +
12
+ - - - - + +
122222
From b7d57c78e78ad9a46b64968d852bd2435563d7c0 Mon Sep 17 00:00:00 2001 From: Edvaldo Martins Date: Fri, 7 Oct 2022 14:39:22 +0100 Subject: [PATCH 41/42] improvement -v5 --- README.md | 22 +++++++++------------- 1 file changed, 9 insertions(+), 13 deletions(-) diff --git a/README.md b/README.md index 007a3dc..300d9ff 100644 --- a/README.md +++ b/README.md @@ -30,6 +30,7 @@ the https://pub.dartlang.org/api/ flutter pub run build_runner build --delete-conflicting-outputs ``` +> Before that, use this command line to run automated tests ```sh flutter test integration_test/app_test.dart ``` @@ -41,6 +42,7 @@ flutter test integration_test/app_test.dart - **Package details** - name package - description for package + - publisher - versions - scores - readme @@ -55,19 +57,13 @@ flutter test integration_test/app_test.dart ## 📸 Screenshots - - - - - -
12
- - - - - - -
22
+

+ + + + +

+ ###### If you have any features you want to see in this package, feel free to make a suggestion. 🎉 From 9a10aa7a372c8732f59b724c24b83dceb49fa593 Mon Sep 17 00:00:00 2001 From: Edvaldo Martins Date: Sat, 8 Oct 2022 08:39:44 +0100 Subject: [PATCH 42/42] other improvements --- .flutter-plugins-dependencies | 2 +- README.md | 2 +- android/.idea/gradle.xml | 1 + ..._test_espresso_espresso_core_3_1_1_aar.xml | 17 -------- ...sso_espresso_idling_resource_3_1_1_aar.xml | 17 -------- ...radle__androidx_test_monitor_1_1_1_aar.xml | 17 -------- ...Gradle__androidx_test_runner_1_1_1_aar.xml | 17 -------- ..._com_google_code_findbugs_jsr305_2_0_1.xml | 9 ----- android/.idea/modules.xml | 4 ++ ...mple.FlutterToast.android.fluttertoast.iml | 1 + android/.idea/modules/app/android.app.iml | 1 + android/app/build.gradle | 4 +- ios/Podfile | 2 +- ios/Runner.xcodeproj/project.pbxproj | 39 +++++++------------ .../packages/detail_package_screen.dart | 12 +++--- 15 files changed, 33 insertions(+), 112 deletions(-) delete mode 100644 android/.idea/libraries/Gradle__androidx_test_espresso_espresso_core_3_1_1_aar.xml delete mode 100644 android/.idea/libraries/Gradle__androidx_test_espresso_espresso_idling_resource_3_1_1_aar.xml delete mode 100644 android/.idea/libraries/Gradle__androidx_test_monitor_1_1_1_aar.xml delete mode 100644 android/.idea/libraries/Gradle__androidx_test_runner_1_1_1_aar.xml delete mode 100644 android/.idea/libraries/Gradle__com_google_code_findbugs_jsr305_2_0_1.xml diff --git a/.flutter-plugins-dependencies b/.flutter-plugins-dependencies index 8ffd55c..2252ac3 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.","plugins":{"ios":[{"name":"fluttertoast","path":"/Users/edvaldo/flutter/.pub-cache/hosted/pub.dartlang.org/fluttertoast-7.1.8/","dependencies":[]},{"name":"integration_test","path":"/Users/edvaldo/flutter/packages/integration_test/","dependencies":[]},{"name":"share","path":"/Users/edvaldo/flutter/.pub-cache/hosted/pub.dartlang.org/share-2.0.4/","dependencies":[]},{"name":"shared_preferences_ios","path":"/Users/edvaldo/flutter/.pub-cache/hosted/pub.dartlang.org/shared_preferences_ios-2.1.0/","dependencies":[]},{"name":"url_launcher_ios","path":"/Users/edvaldo/flutter/.pub-cache/hosted/pub.dartlang.org/url_launcher_ios-6.0.15/","dependencies":[]}],"android":[{"name":"fluttertoast","path":"/Users/edvaldo/flutter/.pub-cache/hosted/pub.dartlang.org/fluttertoast-7.1.8/","dependencies":[]},{"name":"integration_test","path":"/Users/edvaldo/flutter/packages/integration_test/","dependencies":[]},{"name":"share","path":"/Users/edvaldo/flutter/.pub-cache/hosted/pub.dartlang.org/share-2.0.4/","dependencies":[]},{"name":"shared_preferences_android","path":"/Users/edvaldo/flutter/.pub-cache/hosted/pub.dartlang.org/shared_preferences_android-2.0.11/","dependencies":[]},{"name":"url_launcher_android","path":"/Users/edvaldo/flutter/.pub-cache/hosted/pub.dartlang.org/url_launcher_android-6.0.15/","dependencies":[]}],"macos":[{"name":"shared_preferences_macos","path":"/Users/edvaldo/flutter/.pub-cache/hosted/pub.dartlang.org/shared_preferences_macos-2.0.3/","dependencies":[]},{"name":"url_launcher_macos","path":"/Users/edvaldo/flutter/.pub-cache/hosted/pub.dartlang.org/url_launcher_macos-3.0.0/","dependencies":[]}],"linux":[{"name":"path_provider_linux","path":"/Users/edvaldo/flutter/.pub-cache/hosted/pub.dartlang.org/path_provider_linux-2.1.5/","dependencies":[]},{"name":"shared_preferences_linux","path":"/Users/edvaldo/flutter/.pub-cache/hosted/pub.dartlang.org/shared_preferences_linux-2.1.0/","dependencies":["path_provider_linux"]},{"name":"url_launcher_linux","path":"/Users/edvaldo/flutter/.pub-cache/hosted/pub.dartlang.org/url_launcher_linux-3.0.0/","dependencies":[]}],"windows":[{"name":"path_provider_windows","path":"/Users/edvaldo/flutter/.pub-cache/hosted/pub.dartlang.org/path_provider_windows-2.0.5/","dependencies":[]},{"name":"shared_preferences_windows","path":"/Users/edvaldo/flutter/.pub-cache/hosted/pub.dartlang.org/shared_preferences_windows-2.1.0/","dependencies":["path_provider_windows"]},{"name":"url_launcher_windows","path":"/Users/edvaldo/flutter/.pub-cache/hosted/pub.dartlang.org/url_launcher_windows-3.0.0/","dependencies":[]}],"web":[{"name":"fluttertoast","path":"/Users/edvaldo/flutter/.pub-cache/hosted/pub.dartlang.org/fluttertoast-7.1.8/","dependencies":[]},{"name":"shared_preferences_web","path":"/Users/edvaldo/flutter/.pub-cache/hosted/pub.dartlang.org/shared_preferences_web-2.0.3/","dependencies":[]},{"name":"url_launcher_web","path":"/Users/edvaldo/flutter/.pub-cache/hosted/pub.dartlang.org/url_launcher_web-2.0.9/","dependencies":[]}]},"dependencyGraph":[{"name":"fluttertoast","dependencies":[]},{"name":"integration_test","dependencies":[]},{"name":"path_provider_linux","dependencies":[]},{"name":"path_provider_windows","dependencies":[]},{"name":"share","dependencies":[]},{"name":"shared_preferences","dependencies":["shared_preferences_android","shared_preferences_ios","shared_preferences_linux","shared_preferences_macos","shared_preferences_web","shared_preferences_windows"]},{"name":"shared_preferences_android","dependencies":[]},{"name":"shared_preferences_ios","dependencies":[]},{"name":"shared_preferences_linux","dependencies":["path_provider_linux"]},{"name":"shared_preferences_macos","dependencies":[]},{"name":"shared_preferences_web","dependencies":[]},{"name":"shared_preferences_windows","dependencies":["path_provider_windows"]},{"name":"url_launcher","dependencies":["url_launcher_android","url_launcher_ios","url_launcher_linux","url_launcher_macos","url_launcher_web","url_launcher_windows"]},{"name":"url_launcher_android","dependencies":[]},{"name":"url_launcher_ios","dependencies":[]},{"name":"url_launcher_linux","dependencies":[]},{"name":"url_launcher_macos","dependencies":[]},{"name":"url_launcher_web","dependencies":[]},{"name":"url_launcher_windows","dependencies":[]}],"date_created":"2022-10-07 14:21:22.176745","version":"2.10.5"} \ No newline at end of file +{"info":"This is a generated file; do not edit or check into version control.","plugins":{"ios":[{"name":"fluttertoast","path":"/Users/edvaldo/flutter/.pub-cache/hosted/pub.dartlang.org/fluttertoast-7.1.8/","dependencies":[]},{"name":"integration_test","path":"/Users/edvaldo/flutter/packages/integration_test/","dependencies":[]},{"name":"share","path":"/Users/edvaldo/flutter/.pub-cache/hosted/pub.dartlang.org/share-2.0.4/","dependencies":[]},{"name":"shared_preferences_ios","path":"/Users/edvaldo/flutter/.pub-cache/hosted/pub.dartlang.org/shared_preferences_ios-2.1.0/","dependencies":[]},{"name":"url_launcher_ios","path":"/Users/edvaldo/flutter/.pub-cache/hosted/pub.dartlang.org/url_launcher_ios-6.0.15/","dependencies":[]}],"android":[{"name":"fluttertoast","path":"/Users/edvaldo/flutter/.pub-cache/hosted/pub.dartlang.org/fluttertoast-7.1.8/","dependencies":[]},{"name":"integration_test","path":"/Users/edvaldo/flutter/packages/integration_test/","dependencies":[]},{"name":"share","path":"/Users/edvaldo/flutter/.pub-cache/hosted/pub.dartlang.org/share-2.0.4/","dependencies":[]},{"name":"shared_preferences_android","path":"/Users/edvaldo/flutter/.pub-cache/hosted/pub.dartlang.org/shared_preferences_android-2.0.11/","dependencies":[]},{"name":"url_launcher_android","path":"/Users/edvaldo/flutter/.pub-cache/hosted/pub.dartlang.org/url_launcher_android-6.0.15/","dependencies":[]}],"macos":[{"name":"shared_preferences_macos","path":"/Users/edvaldo/flutter/.pub-cache/hosted/pub.dartlang.org/shared_preferences_macos-2.0.3/","dependencies":[]},{"name":"url_launcher_macos","path":"/Users/edvaldo/flutter/.pub-cache/hosted/pub.dartlang.org/url_launcher_macos-3.0.0/","dependencies":[]}],"linux":[{"name":"path_provider_linux","path":"/Users/edvaldo/flutter/.pub-cache/hosted/pub.dartlang.org/path_provider_linux-2.1.5/","dependencies":[]},{"name":"shared_preferences_linux","path":"/Users/edvaldo/flutter/.pub-cache/hosted/pub.dartlang.org/shared_preferences_linux-2.1.0/","dependencies":["path_provider_linux"]},{"name":"url_launcher_linux","path":"/Users/edvaldo/flutter/.pub-cache/hosted/pub.dartlang.org/url_launcher_linux-3.0.0/","dependencies":[]}],"windows":[{"name":"path_provider_windows","path":"/Users/edvaldo/flutter/.pub-cache/hosted/pub.dartlang.org/path_provider_windows-2.0.5/","dependencies":[]},{"name":"shared_preferences_windows","path":"/Users/edvaldo/flutter/.pub-cache/hosted/pub.dartlang.org/shared_preferences_windows-2.1.0/","dependencies":["path_provider_windows"]},{"name":"url_launcher_windows","path":"/Users/edvaldo/flutter/.pub-cache/hosted/pub.dartlang.org/url_launcher_windows-3.0.0/","dependencies":[]}],"web":[{"name":"fluttertoast","path":"/Users/edvaldo/flutter/.pub-cache/hosted/pub.dartlang.org/fluttertoast-7.1.8/","dependencies":[]},{"name":"shared_preferences_web","path":"/Users/edvaldo/flutter/.pub-cache/hosted/pub.dartlang.org/shared_preferences_web-2.0.3/","dependencies":[]},{"name":"url_launcher_web","path":"/Users/edvaldo/flutter/.pub-cache/hosted/pub.dartlang.org/url_launcher_web-2.0.9/","dependencies":[]}]},"dependencyGraph":[{"name":"fluttertoast","dependencies":[]},{"name":"integration_test","dependencies":[]},{"name":"path_provider_linux","dependencies":[]},{"name":"path_provider_windows","dependencies":[]},{"name":"share","dependencies":[]},{"name":"shared_preferences","dependencies":["shared_preferences_android","shared_preferences_ios","shared_preferences_linux","shared_preferences_macos","shared_preferences_web","shared_preferences_windows"]},{"name":"shared_preferences_android","dependencies":[]},{"name":"shared_preferences_ios","dependencies":[]},{"name":"shared_preferences_linux","dependencies":["path_provider_linux"]},{"name":"shared_preferences_macos","dependencies":[]},{"name":"shared_preferences_web","dependencies":[]},{"name":"shared_preferences_windows","dependencies":["path_provider_windows"]},{"name":"url_launcher","dependencies":["url_launcher_android","url_launcher_ios","url_launcher_linux","url_launcher_macos","url_launcher_web","url_launcher_windows"]},{"name":"url_launcher_android","dependencies":[]},{"name":"url_launcher_ios","dependencies":[]},{"name":"url_launcher_linux","dependencies":[]},{"name":"url_launcher_macos","dependencies":[]},{"name":"url_launcher_web","dependencies":[]},{"name":"url_launcher_windows","dependencies":[]}],"date_created":"2022-10-08 08:34:47.429746","version":"2.10.5"} \ No newline at end of file diff --git a/README.md b/README.md index 300d9ff..8d43f05 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # pub.dev (mobile) -![Badge](https://img.shields.io/static/v1?label=playstore&message=v0.0.7&color=blue&?style=flat) ![Badge](https://img.shields.io/static/v1?label=build&message=passing&color=green&?style=flat) ![Badge](https://img.shields.io/static/v1?label=android&message=4.1&color=darkgreen&?style=flat) ![Badge](https://img.shields.io/static/v1?label=iOS&message=13.0&color=orange&?style=flat) ![Badge](https://img.shields.io/static/v1?label=status&message=completed&color=green&?style=flat) +![Badge](https://img.shields.io/static/v1?label=playstore&message=v0.0.10&color=blue&?style=flat) ![Badge](https://img.shields.io/static/v1?label=build&message=passing&color=green&?style=flat) ![Badge](https://img.shields.io/static/v1?label=android&message=4.1&color=darkgreen&?style=flat) ![Badge](https://img.shields.io/static/v1?label=iOS&message=15.5&color=orange&?style=flat) ![Badge](https://img.shields.io/static/v1?label=status&message=completed&color=green&?style=flat)

diff --git a/android/.idea/gradle.xml b/android/.idea/gradle.xml index be34ff9..e1954cb 100644 --- a/android/.idea/gradle.xml +++ b/android/.idea/gradle.xml @@ -30,6 +30,7 @@ diff --git a/android/.idea/libraries/Gradle__androidx_test_espresso_espresso_core_3_1_1_aar.xml b/android/.idea/libraries/Gradle__androidx_test_espresso_espresso_core_3_1_1_aar.xml deleted file mode 100644 index f50d330..0000000 --- a/android/.idea/libraries/Gradle__androidx_test_espresso_espresso_core_3_1_1_aar.xml +++ /dev/null @@ -1,17 +0,0 @@ - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/android/.idea/libraries/Gradle__androidx_test_espresso_espresso_idling_resource_3_1_1_aar.xml b/android/.idea/libraries/Gradle__androidx_test_espresso_espresso_idling_resource_3_1_1_aar.xml deleted file mode 100644 index a639daa..0000000 --- a/android/.idea/libraries/Gradle__androidx_test_espresso_espresso_idling_resource_3_1_1_aar.xml +++ /dev/null @@ -1,17 +0,0 @@ - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/android/.idea/libraries/Gradle__androidx_test_monitor_1_1_1_aar.xml b/android/.idea/libraries/Gradle__androidx_test_monitor_1_1_1_aar.xml deleted file mode 100644 index d65c0f1..0000000 --- a/android/.idea/libraries/Gradle__androidx_test_monitor_1_1_1_aar.xml +++ /dev/null @@ -1,17 +0,0 @@ - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/android/.idea/libraries/Gradle__androidx_test_runner_1_1_1_aar.xml b/android/.idea/libraries/Gradle__androidx_test_runner_1_1_1_aar.xml deleted file mode 100644 index 1569a6c..0000000 --- a/android/.idea/libraries/Gradle__androidx_test_runner_1_1_1_aar.xml +++ /dev/null @@ -1,17 +0,0 @@ - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/android/.idea/libraries/Gradle__com_google_code_findbugs_jsr305_2_0_1.xml b/android/.idea/libraries/Gradle__com_google_code_findbugs_jsr305_2_0_1.xml deleted file mode 100644 index 2b834ea..0000000 --- a/android/.idea/libraries/Gradle__com_google_code_findbugs_jsr305_2_0_1.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - - - \ No newline at end of file diff --git a/android/.idea/modules.xml b/android/.idea/modules.xml index 8376a77..63232ed 100644 --- a/android/.idea/modules.xml +++ b/android/.idea/modules.xml @@ -7,6 +7,10 @@ + + + + diff --git a/android/.idea/modules/-719362859/com.example.FlutterToast.android.fluttertoast.iml b/android/.idea/modules/-719362859/com.example.FlutterToast.android.fluttertoast.iml index b8a7e5a..7e31a7e 100644 --- a/android/.idea/modules/-719362859/com.example.FlutterToast.android.fluttertoast.iml +++ b/android/.idea/modules/-719362859/com.example.FlutterToast.android.fluttertoast.iml @@ -35,6 +35,7 @@