From 03e551a53bf7a6860df5b7ceb4cbb39f60aa7c9d Mon Sep 17 00:00:00 2001 From: Rolly Date: Tue, 2 Apr 2024 03:58:34 +0300 Subject: [PATCH 01/18] chore: update gradle --- android/app/build.gradle | 22 ++++++++++++------- android/build.gradle | 10 ++++----- .../gradle/wrapper/gradle-wrapper.properties | 6 ++--- 3 files changed, 22 insertions(+), 16 deletions(-) diff --git a/android/app/build.gradle b/android/app/build.gradle index 1b85482..cb41471 100644 --- a/android/app/build.gradle +++ b/android/app/build.gradle @@ -34,6 +34,16 @@ apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle" android { compileSdkVersion flutter.compileSdkVersion + ndkVersion flutter.ndkVersion + + compileOptions { + sourceCompatibility JavaVersion.VERSION_1_8 + targetCompatibility JavaVersion.VERSION_1_8 + } + + kotlinOptions { + jvmTarget = '1.8' + } sourceSets { main.java.srcDirs += 'src/main/kotlin' @@ -42,19 +52,13 @@ android { defaultConfig { // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html). applicationId "io.fireship.quizapp" - minSdkVersion 19 + minSdkVersion 24 targetSdkVersion flutter.targetSdkVersion versionCode flutterVersionCode.toInteger() versionName flutterVersionName multiDexEnabled true } - // TODO: Remove when below fix is available in stable channel. - // https://github.com/flutter/flutter/pull/82309 - lintOptions { - checkReleaseBuilds false - } - signingConfigs { if (System.getenv("ANDROID_KEYSTORE_PATH")) { release { @@ -78,10 +82,12 @@ android { production { dimension "default" applicationIdSuffix "" + manifestPlaceholders = [appName: "Quiz App"] } development { dimension "default" applicationIdSuffix ".dev" + manifestPlaceholders = [appName: "[DEV] Quiz App"] } } @@ -89,13 +95,13 @@ android { release { signingConfig signingConfigs.release minifyEnabled true - useProguard true proguardFiles getDefaultProguardFile('proguard-android.txt') } debug { signingConfig signingConfigs.debug } } + namespace 'io.fireship.quizapp' } flutter { diff --git a/android/build.gradle b/android/build.gradle index ac24c35..e6aaae5 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -1,21 +1,21 @@ buildscript { - ext.kotlin_version = '1.6.10' + ext.kotlin_version = '1.7.10' repositories { google() - jcenter() + mavenCentral() } dependencies { - classpath 'com.android.tools.build:gradle:4.1.0' + classpath 'com.android.tools.build:gradle:7.4.2' classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" - classpath 'com.google.gms:google-services:4.3.8' + classpath 'com.google.gms:google-services:4.4.1' } } allprojects { repositories { google() - jcenter() + mavenCentral() } } diff --git a/android/gradle/wrapper/gradle-wrapper.properties b/android/gradle/wrapper/gradle-wrapper.properties index bc6a58a..1ec6390 100644 --- a/android/gradle/wrapper/gradle-wrapper.properties +++ b/android/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ -#Fri Jun 23 08:50:38 CEST 2017 +#Tue Apr 02 02:12:39 EEST 2024 distributionBase=GRADLE_USER_HOME +distributionUrl=https\://services.gradle.org/distributions/gradle-8.1.1-bin.zip distributionPath=wrapper/dists -zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-6.7-all.zip +zipStoreBase=GRADLE_USER_HOME From dae1374b0fc2e214eab0349feaeb911a01e6409d Mon Sep 17 00:00:00 2001 From: Rolly Date: Tue, 2 Apr 2024 03:59:56 +0300 Subject: [PATCH 02/18] chore: set android:exported on `AndroidManifest` --- android/app/src/debug/AndroidManifest.xml | 3 +-- android/app/src/main/AndroidManifest.xml | 4 ++-- android/app/src/profile/AndroidManifest.xml | 3 +-- 3 files changed, 4 insertions(+), 6 deletions(-) diff --git a/android/app/src/debug/AndroidManifest.xml b/android/app/src/debug/AndroidManifest.xml index 8edef3a..f880684 100644 --- a/android/app/src/debug/AndroidManifest.xml +++ b/android/app/src/debug/AndroidManifest.xml @@ -1,5 +1,4 @@ - + diff --git a/android/app/src/main/AndroidManifest.xml b/android/app/src/main/AndroidManifest.xml index be82552..49f8bbc 100644 --- a/android/app/src/main/AndroidManifest.xml +++ b/android/app/src/main/AndroidManifest.xml @@ -1,10 +1,10 @@ - + + From 3e9f8b6771a83f984bb3e848b792ddebac4d5a15 Mon Sep 17 00:00:00 2001 From: Rolly Date: Tue, 2 Apr 2024 04:00:13 +0300 Subject: [PATCH 03/18] chore: update deps --- packages/api_client/pubspec.yaml | 12 +- packages/app_core/pubspec.yaml | 6 +- packages/app_ui/pubspec.yaml | 8 +- packages/quizzes_repository/pubspec.yaml | 6 +- packages/topics_repository/pubspec.yaml | 6 +- packages/user_repository/pubspec.yaml | 6 +- pubspec.lock | 336 ++++++++++++----------- pubspec.yaml | 12 +- 8 files changed, 208 insertions(+), 184 deletions(-) diff --git a/packages/api_client/pubspec.yaml b/packages/api_client/pubspec.yaml index 3b6d1bb..e0c465a 100644 --- a/packages/api_client/pubspec.yaml +++ b/packages/api_client/pubspec.yaml @@ -9,14 +9,14 @@ environment: dependencies: app_core: path: ../app_core - cloud_firestore: ^4.8.0 - firebase_auth: ^4.6.2 - firebase_core: ^2.13.1 + cloud_firestore: ^4.15.10 + firebase_auth: ^4.18.0 + firebase_core: ^2.27.2 flutter: sdk: flutter - google_sign_in: ^6.1.3 - sign_in_with_apple: ^4.3.0 + google_sign_in: ^6.2.1 + sign_in_with_apple: ^6.0.0 dev_dependencies: - very_good_analysis: ^5.0.0+1 + very_good_analysis: ^5.1.0 diff --git a/packages/app_core/pubspec.yaml b/packages/app_core/pubspec.yaml index fc17f5b..c5726e2 100644 --- a/packages/app_core/pubspec.yaml +++ b/packages/app_core/pubspec.yaml @@ -7,14 +7,14 @@ environment: sdk: '>=3.0.0 <4.0.0' dependencies: - bloc: ^8.1.2 + bloc: ^8.1.4 crypto: ^3.0.3 equatable: ^2.0.5 flutter: sdk: flutter json_annotation: ^4.8.1 - provider: ^6.0.5 + provider: ^6.1.2 rxdart: ^0.27.7 dev_dependencies: - very_good_analysis: ^5.0.0+1 + very_good_analysis: ^5.1.0 diff --git a/packages/app_ui/pubspec.yaml b/packages/app_ui/pubspec.yaml index 8f29025..47435a3 100644 --- a/packages/app_ui/pubspec.yaml +++ b/packages/app_ui/pubspec.yaml @@ -9,10 +9,10 @@ environment: dependencies: flutter: sdk: flutter - flutter_spinkit: ^5.2.0 - font_awesome_flutter: ^10.4.0 - google_fonts: ^4.0.4 + flutter_spinkit: ^5.2.1 + font_awesome_flutter: ^10.7.0 + google_fonts: ^6.2.1 transparent_image: ^2.0.1 dev_dependencies: - very_good_analysis: ^5.0.0+1 + very_good_analysis: ^5.1.0 diff --git a/packages/quizzes_repository/pubspec.yaml b/packages/quizzes_repository/pubspec.yaml index 8904cf6..7373682 100644 --- a/packages/quizzes_repository/pubspec.yaml +++ b/packages/quizzes_repository/pubspec.yaml @@ -15,6 +15,6 @@ dependencies: sdk: flutter dev_dependencies: - build_runner: ^2.4.4 - json_serializable: ^6.7.0 - very_good_analysis: ^5.0.0+1 + build_runner: ^2.4.9 + json_serializable: ^6.7.1 + very_good_analysis: ^5.1.0 diff --git a/packages/topics_repository/pubspec.yaml b/packages/topics_repository/pubspec.yaml index e7443a9..be8d085 100644 --- a/packages/topics_repository/pubspec.yaml +++ b/packages/topics_repository/pubspec.yaml @@ -15,6 +15,6 @@ dependencies: sdk: flutter dev_dependencies: - build_runner: ^2.4.4 - json_serializable: ^6.7.0 - very_good_analysis: ^5.0.0+1 + build_runner: ^2.4.9 + json_serializable: ^6.7.1 + very_good_analysis: ^5.1.0 diff --git a/packages/user_repository/pubspec.yaml b/packages/user_repository/pubspec.yaml index f7adf83..287a359 100644 --- a/packages/user_repository/pubspec.yaml +++ b/packages/user_repository/pubspec.yaml @@ -15,6 +15,6 @@ dependencies: sdk: flutter dev_dependencies: - build_runner: ^2.4.4 - json_serializable: ^6.7.0 - very_good_analysis: ^5.0.0+1 + build_runner: ^2.4.9 + json_serializable: ^6.7.1 + very_good_analysis: ^5.1.0 diff --git a/pubspec.lock b/pubspec.lock index f8003ae..0fe1747 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -5,26 +5,26 @@ packages: dependency: transitive description: name: _fe_analyzer_shared - sha256: ae92f5d747aee634b87f89d9946000c2de774be1d6ac3e58268224348cd0101a + sha256: "0b2f2bd91ba804e53a61d757b986f89f1f9eaed5b11e4b2f5a2468d86d6c9fc7" url: "https://pub.dev" source: hosted - version: "61.0.0" + version: "67.0.0" _flutterfire_internals: dependency: transitive description: name: _flutterfire_internals - sha256: "9ebe81588e666f7e2b21309f2b5653bd9642d7f27fd0a6894278d2ff40cb9481" + sha256: "53d06f578b8e988f60324f46fcd6ab919ccdc2dc8cbf0cd4161829b1dba7a62b" url: "https://pub.dev" source: hosted - version: "1.3.2" + version: "1.3.27" analyzer: dependency: transitive description: name: analyzer - sha256: ea3d8652bda62982addfd92fdc2d0214e5f82e43325104990d4f4c4a2a313562 + sha256: "37577842a27e4338429a1cbc32679d508836510b056f1eedf0c8d20e39c1383d" url: "https://pub.dev" source: hosted - version: "5.13.0" + version: "6.4.1" api_client: dependency: "direct main" description: @@ -50,10 +50,10 @@ packages: dependency: transitive description: name: args - sha256: c372bb384f273f0c2a8aaaa226dad84dc27c8519a691b888725dec59518ad53a + sha256: eef6c46b622e0494a36c5a12d10d77fb4e855501a91c1b9ef9339326e58f0596 url: "https://pub.dev" source: hosted - version: "2.4.1" + version: "2.4.2" async: dependency: transitive description: @@ -66,10 +66,10 @@ packages: dependency: transitive description: name: bloc - sha256: "3820f15f502372d979121de1f6b97bfcf1630ebff8fe1d52fb2b0bfa49be5b49" + sha256: "106842ad6569f0b60297619e9e0b1885c2fb9bf84812935490e6c5275777804e" url: "https://pub.dev" source: hosted - version: "8.1.2" + version: "8.1.4" boolean_selector: dependency: transitive description: @@ -82,10 +82,10 @@ packages: dependency: transitive description: name: build - sha256: "43865b79fbb78532e4bff7c33087aa43b1d488c4fdef014eaef568af6d8016dc" + sha256: "80184af8b6cb3e5c1c4ec6d8544d27711700bc3e6d2efad04238c7b5290889f0" url: "https://pub.dev" source: hosted - version: "2.4.0" + version: "2.4.1" build_config: dependency: transitive description: @@ -98,34 +98,34 @@ packages: dependency: transitive description: name: build_daemon - sha256: "5f02d73eb2ba16483e693f80bee4f088563a820e47d1027d4cdfe62b5bb43e65" + sha256: "0343061a33da9c5810b2d6cee51945127d8f4c060b7fbdd9d54917f0a3feaaa1" url: "https://pub.dev" source: hosted - version: "4.0.0" + version: "4.0.1" build_resolvers: dependency: transitive description: name: build_resolvers - sha256: db49b8609ef8c81cca2b310618c3017c00f03a92af44c04d310b907b2d692d95 + sha256: "339086358431fa15d7eca8b6a36e5d783728cf025e559b834f4609a1fcfb7b0a" url: "https://pub.dev" source: hosted - version: "2.2.0" + version: "2.4.2" build_runner: dependency: "direct dev" description: name: build_runner - sha256: "220ae4553e50d7c21a17c051afc7b183d28a24a420502e842f303f8e4e6edced" + sha256: "3ac61a79bfb6f6cc11f693591063a7f19a7af628dc52f141743edac5c16e8c22" url: "https://pub.dev" source: hosted - version: "2.4.4" + version: "2.4.9" build_runner_core: dependency: transitive description: name: build_runner_core - sha256: "88a57f2ac99849362e73878334caa9f06ee25f31d2adced882b8337838c84e1e" + sha256: "4ae8ffe5ac758da294ecf1802f2aff01558d8b1b00616aa7538ea9a8a5d50799" url: "https://pub.dev" source: hosted - version: "7.2.9" + version: "7.3.0" built_collection: dependency: transitive description: @@ -138,10 +138,10 @@ packages: dependency: transitive description: name: built_value - sha256: "7dd62d9faf105c434f3d829bbe9c4be02ec67f5ed94832222116122df67c5452" + sha256: fedde275e0a6b798c3296963c5cd224e3e1b55d0e478d5b7e65e6b540f363a0e url: "https://pub.dev" source: hosted - version: "8.6.0" + version: "8.9.1" characters: dependency: transitive description: @@ -170,42 +170,42 @@ packages: dependency: transitive description: name: cloud_firestore - sha256: "095a8c0e67da96610b6f4e6da7ac5853bc86d7664409ab71d7b934469ca99c6f" + sha256: ed89b3103dc35234dfb513af9e4f8f9fb0608e6e06cc93b77489e23f38a52f93 url: "https://pub.dev" source: hosted - version: "4.8.0" + version: "4.15.10" cloud_firestore_platform_interface: dependency: transitive description: name: cloud_firestore_platform_interface - sha256: dd5d1c3ed9a09e620ac59351f20fa635e112101bdc6f90e84b29c5a19fa1bf59 + sha256: "31c60ecb186c8356cca417e4151d6c383eb81c92933e3a0f3a9509688f5ec319" url: "https://pub.dev" source: hosted - version: "5.15.0" + version: "6.1.11" cloud_firestore_web: dependency: transitive description: name: cloud_firestore_web - sha256: "51f22dfbe07638075287e171b469ef545bee9f5fa0f8d0ed4aa98aceb0259a5d" + sha256: "9d952d3c8d5b87c34712537154ff7580bdc29b8b9fb3bf43002304999e585653" url: "https://pub.dev" source: hosted - version: "3.6.0" + version: "3.10.10" code_builder: dependency: transitive description: name: code_builder - sha256: "4ad01d6e56db961d29661561effde45e519939fdaeb46c351275b182eac70189" + sha256: f692079e25e7869c14132d39f223f8eec9830eb76131925143b2129c4bb01b37 url: "https://pub.dev" source: hosted - version: "4.5.0" + version: "4.10.0" collection: dependency: transitive description: name: collection - sha256: "4a07be6cb69c84d677a6c3096fcf960cc3285a8330b4603e0d463d15d9bd934c" + sha256: ee67cb0715911d28db6bf4af1026078bd6f0128b07a5f66fb2ed94ec6783c09a url: "https://pub.dev" source: hosted - version: "1.17.1" + version: "1.18.0" color: dependency: transitive description: @@ -234,18 +234,18 @@ packages: dependency: transitive description: name: dart_style - sha256: f4f1f73ab3fd2afcbcca165ee601fe980d966af6a21b5970c6c9376955c528ad + sha256: "99e066ce75c89d6b29903d788a7bb9369cf754f7b24bf70bf4b6d6d6b26853b9" url: "https://pub.dev" source: hosted - version: "2.3.1" + version: "2.3.6" dartx: dependency: transitive description: name: dartx - sha256: "45d7176701f16c5a5e00a4798791c1964bc231491b879369c818dd9a9c764871" + sha256: "8b25435617027257d43e6508b5fe061012880ddfdaa75a71d607c3de2a13d244" url: "https://pub.dev" source: hosted - version: "1.1.0" + version: "1.2.0" equatable: dependency: "direct main" description: @@ -266,66 +266,66 @@ packages: dependency: transitive description: name: ffi - sha256: ed5337a5660c506388a9f012be0288fb38b49020ce2b45fe1f8b8323fe429f99 + sha256: "493f37e7df1804778ff3a53bd691d8692ddf69702cf4c1c1096a2e41b4779e21" url: "https://pub.dev" source: hosted - version: "2.0.2" + version: "2.1.2" file: dependency: transitive description: name: file - sha256: "1b92bec4fc2a72f59a8e15af5f52cd441e4a7860b49499d69dfa817af20e925d" + sha256: "5fc22d7c25582e38ad9a8515372cd9a93834027aacf1801cf01164dac0ffa08c" url: "https://pub.dev" source: hosted - version: "6.1.4" + version: "7.0.0" firebase_auth: dependency: transitive description: name: firebase_auth - sha256: "19508428ca37f611ae47067ee6ebb3ba5a27014941177cc224f71bf7d0720cdd" + sha256: "376cdf5048e3552afa6e7883334a03450d332c68466759a63f5fcbe990feaecc" url: "https://pub.dev" source: hosted - version: "4.6.2" + version: "4.18.0" firebase_auth_platform_interface: dependency: transitive description: name: firebase_auth_platform_interface - sha256: e46e136a6f6eec88b30f12445ff7f5b19b23b7ede694921ced4f8eba8eb634f6 + sha256: "316c8dae2aaa5920aa752807a773f06d9b0da48efda2efbae14b93f0ee835ddd" url: "https://pub.dev" source: hosted - version: "6.15.2" + version: "7.2.0" firebase_auth_web: dependency: transitive description: name: firebase_auth_web - sha256: "553bd576d793d05b920971a2c7ab02bd049d4971153702074ea2555877efd392" + sha256: "1859c548568fc5f979130c694222504cf255a4b3af5186d1b4d6e5772ae6d08f" url: "https://pub.dev" source: hosted - version: "5.5.2" + version: "5.10.1" firebase_core: dependency: transitive description: name: firebase_core - sha256: e9b36b391690cf329c6fb1de220045e97c13784c303820cd33962319580a56c6 + sha256: "4e8728edb3053ffcc194315cb0c10f4676947db793581409e36040065918c94f" url: "https://pub.dev" source: hosted - version: "2.13.1" + version: "2.27.2" firebase_core_platform_interface: dependency: transitive description: name: firebase_core_platform_interface - sha256: b63e3be6c96ef5c33bdec1aab23c91eb00696f6452f0519401d640938c94cba2 + sha256: c437ae5d17e6b5cc7981cf6fd458a5db4d12979905f9aafd1fea930428a9fe63 url: "https://pub.dev" source: hosted - version: "4.8.0" + version: "5.0.0" firebase_core_web: dependency: transitive description: name: firebase_core_web - sha256: "8c0f4c87d20e2d001a5915df238c1f9c88704231f591324205f5a5d2a7740a45" + sha256: "6afef1b46818eabdc6058df1148307f80e5653c0eaf26beeec693c89154752d4" url: "https://pub.dev" source: hosted - version: "2.5.0" + version: "2.13.0" fixnum: dependency: transitive description: @@ -338,10 +338,10 @@ packages: dependency: "direct main" description: name: flow_builder - sha256: "212a5c6575e87bec2003fa3f31dd7d80f0d89f6152db54f43fb0b6f45943e955" + sha256: e5f7c0fbff5ac9c4c65728939e00d96c288e2a482ec740d2d57562d7e918e5f2 url: "https://pub.dev" source: hosted - version: "0.0.9" + version: "0.0.10" flutter: dependency: "direct main" description: flutter @@ -351,26 +351,26 @@ packages: dependency: "direct main" description: name: flutter_bloc - sha256: e74efb89ee6945bcbce74a5b3a5a3376b088e5f21f55c263fc38cbdc6237faae + sha256: f0ecf6e6eb955193ca60af2d5ca39565a86b8a142452c5b24d96fb477428f4d2 url: "https://pub.dev" source: hosted - version: "8.1.3" + version: "8.1.5" flutter_gen_core: dependency: transitive description: name: flutter_gen_core - sha256: e8637dd6a59860f89e5e71be0a27101ec32dad1a0ed7fd879fd23b6e91d5004d + sha256: "3a6c3dbc1c0e260088e9c7ed1ba905436844e8c01a44799f6281edada9e45308" url: "https://pub.dev" source: hosted - version: "5.3.1" + version: "5.4.0" flutter_gen_runner: dependency: "direct dev" description: name: flutter_gen_runner - sha256: "7de1bf4fc0439be0fef3178b6423d5c7f1f9f3a38a7c6fafe75d7f70ff4856d7" + sha256: "24889d5140b03997f7148066a9c5fab8b606dff36093434c782d7a7fb22c6fb6" url: "https://pub.dev" source: hosted - version: "5.3.1" + version: "5.4.0" flutter_localizations: dependency: "direct main" description: flutter @@ -380,10 +380,10 @@ packages: dependency: transitive description: name: flutter_spinkit - sha256: b39c753e909d4796906c5696a14daf33639a76e017136c8d82bf3e620ce5bb8e + sha256: d2696eed13732831414595b98863260e33e8882fc069ee80ec35d4ac9ddb0472 url: "https://pub.dev" source: hosted - version: "5.2.0" + version: "5.2.1" flutter_test: dependency: "direct dev" description: flutter @@ -398,18 +398,18 @@ packages: dependency: transitive description: name: font_awesome_flutter - sha256: "959ef4add147753f990b4a7c6cccb746d5792dbdc81b1cde99e62e7edb31b206" + sha256: "275ff26905134bcb59417cf60ad979136f1f8257f2f449914b2c3e05bbb4cd6f" url: "https://pub.dev" source: hosted - version: "10.4.0" + version: "10.7.0" frontend_server_client: dependency: transitive description: name: frontend_server_client - sha256: "408e3ca148b31c20282ad6f37ebfa6f4bdc8fede5b74bc2f08d9d92b55db3612" + sha256: f64a0333a82f30b0cca061bc3d143813a486dc086b574bfb233b7c1372427694 url: "https://pub.dev" source: hosted - version: "3.2.0" + version: "4.0.0" glob: dependency: transitive description: @@ -422,58 +422,58 @@ packages: dependency: transitive description: name: google_fonts - sha256: "6b6f10f0ce3c42f6552d1c70d2c28d764cf22bb487f50f66cca31dcd5194f4d6" + sha256: b1ac0fe2832c9cc95e5e88b57d627c5e68c223b9657f4b96e1487aa9098c7b82 url: "https://pub.dev" source: hosted - version: "4.0.4" + version: "6.2.1" google_identity_services_web: dependency: transitive description: name: google_identity_services_web - sha256: "7940fdc3b1035db4d65d387c1bdd6f9574deaa6777411569c05ecc25672efacd" + sha256: "9482364c9f8b7bd36902572ebc3a7c2b5c8ee57a9c93e6eb5099c1a9ec5265d8" url: "https://pub.dev" source: hosted - version: "0.2.1" + version: "0.3.1+1" google_sign_in: dependency: transitive description: name: google_sign_in - sha256: "03bdb90147f299b02165313fc0e93ae90e7532ae90cb611a655b8e17cd036a98" + sha256: "0b8787cb9c1a68ad398e8010e8c8766bfa33556d2ab97c439fb4137756d7308f" url: "https://pub.dev" source: hosted - version: "6.1.3" + version: "6.2.1" google_sign_in_android: dependency: transitive description: name: google_sign_in_android - sha256: "2a8b90b766ce00b03e7543f4ffeec97b6eb51fb6c3f31ce2a364bd1f1b9dd7fc" + sha256: "38cef11ed22fc0c9bfa7b00bf7f2d91012138f5613089522917fd26c853be93e" url: "https://pub.dev" source: hosted - version: "6.1.14" + version: "6.1.22" google_sign_in_ios: dependency: transitive description: name: google_sign_in_ios - sha256: "6ec0e13a4c5c646471b9f6a25ceb3ae76d339889d4c0f79b729bf0714215a63e" + sha256: "1e0d4fde6cc07a8ff423f6bc931e83a74163d6af702004bacaee752649fdd2e7" url: "https://pub.dev" source: hosted - version: "5.6.2" + version: "5.7.5" google_sign_in_platform_interface: dependency: transitive description: name: google_sign_in_platform_interface - sha256: e69553c0fc6a76216e9d06a8c3767e291ad9be42171f879aab7ab708569d4393 + sha256: "1f6e5787d7a120cc0359ddf315c92309069171306242e181c09472d1b00a2971" url: "https://pub.dev" source: hosted - version: "2.4.1" + version: "2.4.5" google_sign_in_web: dependency: transitive description: name: google_sign_in_web - sha256: "7b154bc84da4c6a578072fc53c0a68ce3168beb39fab8235657d17c18ea12924" + sha256: fc0f14ed45ea616a6cfb4d1c7534c2221b7092cc4f29a709f0c3053cc3e821bd url: "https://pub.dev" source: hosted - version: "0.12.0+1" + version: "0.12.4" graphs: dependency: transitive description: @@ -486,10 +486,10 @@ packages: dependency: transitive description: name: http - sha256: "5895291c13fa8a3bd82e76d5627f69e0d85ca6a30dcac95c4ea19a5d555879c2" + sha256: "761a297c042deedc1ffbb156d6e2af13886bb305c2a343a4d972504cd67dd938" url: "https://pub.dev" source: hosted - version: "0.13.6" + version: "1.2.1" http_multi_server: dependency: transitive description: @@ -510,10 +510,10 @@ packages: dependency: "direct main" description: name: intl - sha256: a3715e3bc90294e971cb7dc063fbf3cd9ee0ebf8604ffeafabd9e6f16abbdbe6 + sha256: "3bc132a9dbce73a7e4a21a17d06e1878839ffbf975568bc875c60537824b0c4d" url: "https://pub.dev" source: hosted - version: "0.18.0" + version: "0.18.1" io: dependency: transitive description: @@ -538,6 +538,30 @@ packages: url: "https://pub.dev" source: hosted version: "4.8.1" + leak_tracker: + dependency: transitive + description: + name: leak_tracker + sha256: "78eb209deea09858f5269f5a5b02be4049535f568c07b275096836f01ea323fa" + url: "https://pub.dev" + source: hosted + version: "10.0.0" + leak_tracker_flutter_testing: + dependency: transitive + description: + name: leak_tracker_flutter_testing + sha256: b46c5e37c19120a8a01918cfaf293547f47269f7cb4b0058f21531c2465d6ef0 + url: "https://pub.dev" + source: hosted + version: "2.0.1" + leak_tracker_testing: + dependency: transitive + description: + name: leak_tracker_testing + sha256: a597f72a664dbd293f3bfc51f9ba69816f84dcd403cdac7066cb3f6003f3ab47 + url: "https://pub.dev" + source: hosted + version: "2.0.1" logging: dependency: transitive description: @@ -550,34 +574,34 @@ packages: dependency: transitive description: name: matcher - sha256: "6501fbd55da300384b768785b83e5ce66991266cec21af89ab9ae7f5ce1c4cbb" + sha256: d2323aa2060500f906aa31a895b4030b6da3ebdcc5619d14ce1aada65cd161cb url: "https://pub.dev" source: hosted - version: "0.12.15" + version: "0.12.16+1" material_color_utilities: dependency: transitive description: name: material_color_utilities - sha256: d92141dc6fe1dad30722f9aa826c7fbc896d021d792f80678280601aff8cf724 + sha256: "0e0a020085b65b6083975e499759762399b4475f766c21668c4ecca34ea74e5a" url: "https://pub.dev" source: hosted - version: "0.2.0" + version: "0.8.0" meta: dependency: transitive description: name: meta - sha256: "3c74dbf8763d36539f114c799d8a2d87343b5067e9d796ca22b5eb8437090ee3" + sha256: d584fa6707a52763a52446f02cc621b077888fb63b93bbcb1143a7be5a0c0c04 url: "https://pub.dev" source: hosted - version: "1.9.1" + version: "1.11.0" mime: dependency: transitive description: name: mime - sha256: e4ff8e8564c03f255408decd16e7899da1733852a9110a58fe6d1b817684a63e + sha256: "2e123074287cc9fd6c09de8336dae606d1ddb88d9ac47358826db698c176a1f2" url: "https://pub.dev" source: hosted - version: "1.0.4" + version: "1.0.5" nested: dependency: transitive description: @@ -598,82 +622,82 @@ packages: dependency: transitive description: name: path - sha256: "8829d8a55c13fc0e37127c29fedf290c102f4e40ae94ada574091fe0ff96c917" + sha256: "087ce49c3f0dc39180befefc60fdb4acd8f8620e5682fe2476afd0b3688bb4af" url: "https://pub.dev" source: hosted - version: "1.8.3" + version: "1.9.0" path_provider: dependency: transitive description: name: path_provider - sha256: "3087813781ab814e4157b172f1a11c46be20179fcc9bea043e0fba36bc0acaa2" + sha256: b27217933eeeba8ff24845c34003b003b2b22151de3c908d0e679e8fe1aa078b url: "https://pub.dev" source: hosted - version: "2.0.15" + version: "2.1.2" path_provider_android: dependency: transitive description: name: path_provider_android - sha256: "2cec049d282c7f13c594b4a73976b0b4f2d7a1838a6dd5aaf7bd9719196bee86" + sha256: "477184d672607c0a3bf68fbbf601805f92ef79c82b64b4d6eb318cbca4c48668" url: "https://pub.dev" source: hosted - version: "2.0.27" + version: "2.2.2" path_provider_foundation: dependency: transitive description: name: path_provider_foundation - sha256: "1995d88ec2948dac43edf8fe58eb434d35d22a2940ecee1a9fefcd62beee6eb3" + sha256: "5a7999be66e000916500be4f15a3633ebceb8302719b47b9cc49ce924125350f" url: "https://pub.dev" source: hosted - version: "2.2.3" + version: "2.3.2" path_provider_linux: dependency: transitive description: name: path_provider_linux - sha256: ffbb8cc9ed2c9ec0e4b7a541e56fd79b138e8f47d2fb86815f15358a349b3b57 + sha256: f7a1fe3a634fe7734c8d3f2766ad746ae2a2884abe22e241a8b301bf5cac3279 url: "https://pub.dev" source: hosted - version: "2.1.11" + version: "2.2.1" path_provider_platform_interface: dependency: transitive description: name: path_provider_platform_interface - sha256: "57585299a729335f1298b43245842678cb9f43a6310351b18fb577d6e33165ec" + sha256: "88f5779f72ba699763fa3a3b06aa4bf6de76c8e5de842cf6f29e2e06476c2334" url: "https://pub.dev" source: hosted - version: "2.0.6" + version: "2.1.2" path_provider_windows: dependency: transitive description: name: path_provider_windows - sha256: d3f80b32e83ec208ac95253e0cd4d298e104fbc63cb29c5c69edaed43b0c69d6 + sha256: "8bc9f22eee8690981c22aa7fc602f5c85b497a6fb2ceb35ee5a5e5ed85ad8170" url: "https://pub.dev" source: hosted - version: "2.1.6" + version: "2.2.1" petitparser: dependency: transitive description: name: petitparser - sha256: cb3798bef7fc021ac45b308f4b51208a152792445cce0448c9a4ba5879dd8750 + sha256: c15605cd28af66339f8eb6fbe0e541bfe2d1b72d5825efc6598f3e0a31b9ad27 url: "https://pub.dev" source: hosted - version: "5.4.0" + version: "6.0.2" platform: dependency: transitive description: name: platform - sha256: "4a451831508d7d6ca779f7ac6e212b4023dd5a7d08a27a63da33756410e32b76" + sha256: "12220bb4b65720483f8fa9450b4332347737cf8213dd2840d8b2c823e47243ec" url: "https://pub.dev" source: hosted - version: "3.1.0" + version: "3.1.4" plugin_platform_interface: dependency: transitive description: name: plugin_platform_interface - sha256: "6a2128648c854906c53fa8e33986fc0247a1116122f9534dd20e3ab9e16a32bc" + sha256: "4820fbfdb9478b1ebae27888254d445073732dae3d6ea81f0b7e06d5dedc3f02" url: "https://pub.dev" source: hosted - version: "2.1.4" + version: "2.1.8" pool: dependency: transitive description: @@ -682,22 +706,14 @@ packages: url: "https://pub.dev" source: hosted version: "1.5.1" - process: - dependency: transitive - description: - name: process - sha256: "53fd8db9cec1d37b0574e12f07520d582019cb6c44abf5479a01505099a34a09" - url: "https://pub.dev" - source: hosted - version: "4.2.4" provider: dependency: transitive description: name: provider - sha256: cdbe7530b12ecd9eb455bdaa2fcb8d4dad22e80b8afb4798b41479d5ce26847f + sha256: c8a055ee5ce3fd98d6fc872478b03823ffdb448699c6ebdbbc71d59b596fd48c url: "https://pub.dev" source: hosted - version: "6.0.5" + version: "6.1.2" pub_semver: dependency: transitive description: @@ -714,14 +730,6 @@ packages: url: "https://pub.dev" source: hosted version: "1.2.3" - quiver: - dependency: transitive - description: - name: quiver - sha256: b1c1ac5ce6688d77f65f3375a9abb9319b3cb32486bdc7a1e0fdf004d7ba4e47 - url: "https://pub.dev" - source: hosted - version: "3.2.1" quizzes_repository: dependency: "direct main" description: @@ -757,10 +765,10 @@ packages: dependency: transitive description: name: sign_in_with_apple - sha256: ac3b113767dfdd765078c507dad9d4d9fe96b669cc7bd88fc36fc15376fb3400 + sha256: "3dcc472f6d3ef6915828b4aa536da14df20a6d1fee65c02eaa7e75b5c4f3f599" url: "https://pub.dev" source: hosted - version: "4.3.0" + version: "6.0.0" sign_in_with_apple_platform_interface: dependency: transitive description: @@ -773,10 +781,10 @@ packages: dependency: transitive description: name: sign_in_with_apple_web - sha256: "44b66528f576e77847c14999d5e881e17e7223b7b0625a185417829e5306f47a" + sha256: ffe74793bc31e7e7cc7e149fe14711a59e50a9cbbb3198e1f67fda92492f7b54 url: "https://pub.dev" source: hosted - version: "1.0.1" + version: "2.0.0" sky_engine: dependency: transitive description: flutter @@ -786,26 +794,26 @@ packages: dependency: transitive description: name: source_span - sha256: dd904f795d4b4f3b870833847c461801f6750a9fa8e61ea5ac53f9422b31f250 + sha256: "53e943d4206a5e30df338fd4c6e7a077e02254531b138a15aec3bd143c1a8b3c" url: "https://pub.dev" source: hosted - version: "1.9.1" + version: "1.10.0" stack_trace: dependency: transitive description: name: stack_trace - sha256: c3c7d8edb15bee7f0f74debd4b9c5f3c2ea86766fe4178eb2a18eb30a0bdaed5 + sha256: "73713990125a6d93122541237550ee3352a2d84baad52d375a4cad2eb9b7ce0b" url: "https://pub.dev" source: hosted - version: "1.11.0" + version: "1.11.1" stream_channel: dependency: transitive description: name: stream_channel - sha256: "83615bee9045c1d322bbbd1ba209b7a749c2cbcdcb3fdd1df8eb488b3279c1c8" + sha256: ba2aa5d8cc609d96bbb2899c28934f9e1af5cddbd60a827822ea467161eb54e7 url: "https://pub.dev" source: hosted - version: "2.1.1" + version: "2.1.2" stream_transform: dependency: transitive description: @@ -834,18 +842,18 @@ packages: dependency: transitive description: name: test_api - sha256: eb6ac1540b26de412b3403a163d919ba86f6a973fe6cc50ae3541b80092fdcfb + sha256: "5c2f730018264d276c20e4f1503fd1308dfbbae39ec8ee63c5236311ac06954b" url: "https://pub.dev" source: hosted - version: "0.5.1" + version: "0.6.1" time: dependency: transitive description: name: time - sha256: "83427e11d9072e038364a5e4da559e85869b227cf699a541be0da74f14140124" + sha256: ad8e018a6c9db36cb917a031853a1aae49467a93e0d464683e029537d848c221 url: "https://pub.dev" source: hosted - version: "2.1.3" + version: "2.1.4" timing: dependency: transitive description: @@ -896,10 +904,18 @@ packages: dependency: "direct dev" description: name: very_good_analysis - sha256: "5e4ea72d2a9188630f0dd8f120a541de730090ef8863243fedca8267a84508b8" + sha256: "9ae7f3a3bd5764fb021b335ca28a34f040cd0ab6eec00a1b213b445dae58a4b8" + url: "https://pub.dev" + source: hosted + version: "5.1.0" + vm_service: + dependency: transitive + description: + name: vm_service + sha256: b3d56ff4341b8f182b96aceb2fa20e3dcb336b9f867bc0eafc0de10f1048e957 url: "https://pub.dev" source: hosted - version: "5.0.0+1" + version: "13.0.0" watcher: dependency: transitive description: @@ -908,38 +924,46 @@ packages: url: "https://pub.dev" source: hosted version: "1.1.0" + web: + dependency: transitive + description: + name: web + sha256: "97da13628db363c635202ad97068d47c5b8aa555808e7a9411963c533b449b27" + url: "https://pub.dev" + source: hosted + version: "0.5.1" web_socket_channel: dependency: transitive description: name: web_socket_channel - sha256: d88238e5eac9a42bb43ca4e721edba3c08c6354d4a53063afaa568516217621b + sha256: "1d8e795e2a8b3730c41b8a98a2dff2e0fb57ae6f0764a1c46ec5915387d257b2" url: "https://pub.dev" source: hosted - version: "2.4.0" + version: "2.4.4" win32: dependency: transitive description: name: win32 - sha256: "5a751eddf9db89b3e5f9d50c20ab8612296e4e8db69009788d6c8b060a84191c" + sha256: "0a989dc7ca2bb51eac91e8fd00851297cfffd641aa7538b165c62637ca0eaa4a" url: "https://pub.dev" source: hosted - version: "4.1.4" + version: "5.4.0" xdg_directories: dependency: transitive description: name: xdg_directories - sha256: ee1505df1426458f7f60aac270645098d318a8b4766d85fde75f76f2e21807d1 + sha256: faea9dee56b520b55a566385b84f2e8de55e7496104adada9962e0bd11bcff1d url: "https://pub.dev" source: hosted - version: "1.0.0" + version: "1.0.4" xml: dependency: transitive description: name: xml - sha256: "5bc72e1e45e941d825fd7468b9b4cc3b9327942649aeb6fc5cdbf135f0a86e84" + sha256: b015a8ad1c488f66851d762d3090a21c600e479dc75e68328c52774040cf9226 url: "https://pub.dev" source: hosted - version: "6.3.0" + version: "6.5.0" yaml: dependency: transitive description: @@ -949,5 +973,5 @@ packages: source: hosted version: "3.1.2" sdks: - dart: ">=3.0.0 <4.0.0" - flutter: ">=3.3.0" + dart: ">=3.3.0 <4.0.0" + flutter: ">=3.19.2" diff --git a/pubspec.yaml b/pubspec.yaml index 25d1a3c..fca5c3e 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -14,13 +14,13 @@ dependencies: app_ui: path: packages/app_ui equatable: ^2.0.5 - flow_builder: ^0.0.9 + flow_builder: ^0.0.10 flutter: sdk: flutter - flutter_bloc: ^8.1.3 + flutter_bloc: ^8.1.5 flutter_localizations: sdk: flutter - intl: ^0.18.0 + intl: ^0.18.1 quizzes_repository: path: packages/quizzes_repository topics_repository: @@ -29,11 +29,11 @@ dependencies: path: packages/user_repository dev_dependencies: - build_runner: ^2.4.4 - flutter_gen_runner: ^5.3.1 + build_runner: ^2.4.9 + flutter_gen_runner: ^5.4.0 flutter_test: sdk: flutter - very_good_analysis: ^5.0.0+1 + very_good_analysis: ^5.1.0 flutter_gen: output: packages/app_ui/lib/src/gen From 0135c1c2919d1b66e7f351503198d181c6fc25af Mon Sep 17 00:00:00 2001 From: Rolly Date: Tue, 2 Apr 2024 04:01:21 +0300 Subject: [PATCH 04/18] style: fix formatting --- packages/app_ui/lib/src/widgets.dart | 2 +- packages/user_repository/lib/src/user_repository.dart | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/app_ui/lib/src/widgets.dart b/packages/app_ui/lib/src/widgets.dart index d4ce01f..a6b9afc 100644 --- a/packages/app_ui/lib/src/widgets.dart +++ b/packages/app_ui/lib/src/widgets.dart @@ -169,7 +169,7 @@ class ActionButton extends StatelessWidget { onPressed: onPressed, style: style, child: label, - ) + ), ], ); } diff --git a/packages/user_repository/lib/src/user_repository.dart b/packages/user_repository/lib/src/user_repository.dart index 515f66b..a8ee9fd 100644 --- a/packages/user_repository/lib/src/user_repository.dart +++ b/packages/user_repository/lib/src/user_repository.dart @@ -1,5 +1,5 @@ -import 'package:api_client/api_client.dart' hide User; import 'package:api_client/api_client.dart' as firebase show User; +import 'package:api_client/api_client.dart' hide User; import 'package:app_core/app_core.dart'; import 'package:user_repository/src/failures.dart'; import 'package:user_repository/src/models/models.dart'; @@ -132,7 +132,7 @@ class UserRepository { 'total': FieldValue.increment(1), 'completedQuizzes': { topicId: FieldValue.arrayUnion([quizId]), - } + }, }, SetOptions(merge: true), ); From 4aac201fed6393870c2e9483defb62431f7d2a66 Mon Sep 17 00:00:00 2001 From: Rolly Date: Tue, 2 Apr 2024 04:02:16 +0300 Subject: [PATCH 05/18] refactor: replace `WillPopScope` with `PopScope` --- lib/topics/view/topic_page.dart | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/lib/topics/view/topic_page.dart b/lib/topics/view/topic_page.dart index 8f3a0e6..6c7bc16 100644 --- a/lib/topics/view/topic_page.dart +++ b/lib/topics/view/topic_page.dart @@ -21,10 +21,12 @@ class TopicPage extends StatelessWidget { @override Widget build(BuildContext context) { - return WillPopScope( - onWillPop: () async { - context.flow().deselectTopic(); - return false; + return PopScope( + canPop: false, + onPopInvoked: (didPop) { + if (!didPop) { + context.flow().deselectTopic(); + } }, child: Scaffold( appBar: AppBar( @@ -87,7 +89,7 @@ class QuizList extends StatelessWidget { final quizzes = context.select((Topic topic) => topic.quizzes); return Column( children: [ - for (final quiz in quizzes) QuizItem(quiz: quiz, topicId: topicId) + for (final quiz in quizzes) QuizItem(quiz: quiz, topicId: topicId), ], ); } From 95024c8c6e3852d699a53718a7b747ae696c67ba Mon Sep 17 00:00:00 2001 From: Rolly Date: Tue, 2 Apr 2024 04:14:20 +0300 Subject: [PATCH 06/18] refactor: rename `requiresReauthentication` to `needsReauthentication` --- lib/app/cubit/app_cubit.dart | 2 +- packages/user_repository/lib/src/failures.dart | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/app/cubit/app_cubit.dart b/lib/app/cubit/app_cubit.dart index 5adfe25..4a85e16 100644 --- a/lib/app/cubit/app_cubit.dart +++ b/lib/app/cubit/app_cubit.dart @@ -44,7 +44,7 @@ class AppCubit extends Cubit { void _onUserFailed(UserFailure failure) { final currentState = state; emit(AppState.failure(failure: failure, user: currentState.user)); - if (failure.requiresReauthentication) { + if (failure.needsReauthentication) { emit(const AppState.unauthenticated()); } else { emit(currentState); diff --git a/packages/user_repository/lib/src/failures.dart b/packages/user_repository/lib/src/failures.dart index f8e5f1c..0bbc2bb 100644 --- a/packages/user_repository/lib/src/failures.dart +++ b/packages/user_repository/lib/src/failures.dart @@ -15,7 +15,7 @@ class UserFailure extends Failure { static const none = UserNoFailure(); - bool get requiresReauthentication { + bool get needsReauthentication { return this is AuthUserChangesFailure; } } From 820b44c87c56b55027bca814d952b21f66ac6895 Mon Sep 17 00:00:00 2001 From: Rolly Date: Tue, 2 Apr 2024 04:15:40 +0300 Subject: [PATCH 07/18] refactor: move `needsReauthentication` on base `Failure` --- packages/app_core/lib/src/failure.dart | 2 ++ packages/user_repository/lib/src/failures.dart | 7 +++---- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/packages/app_core/lib/src/failure.dart b/packages/app_core/lib/src/failure.dart index b2eb624..03d502e 100644 --- a/packages/app_core/lib/src/failure.dart +++ b/packages/app_core/lib/src/failure.dart @@ -1,3 +1,5 @@ abstract class Failure implements Exception { const Failure(); + + bool get needsReauthentication => false; } diff --git a/packages/user_repository/lib/src/failures.dart b/packages/user_repository/lib/src/failures.dart index 0bbc2bb..9265fec 100644 --- a/packages/user_repository/lib/src/failures.dart +++ b/packages/user_repository/lib/src/failures.dart @@ -14,10 +14,6 @@ class UserFailure extends Failure { const AppleSignInNotSupportedFailure(); static const none = UserNoFailure(); - - bool get needsReauthentication { - return this is AuthUserChangesFailure; - } } class UserNoFailure extends UserFailure { @@ -26,6 +22,9 @@ class UserNoFailure extends UserFailure { class AuthUserChangesFailure extends UserFailure { const AuthUserChangesFailure() : super._(); + + @override + bool get needsReauthentication => true; } class SignOutFailure extends UserFailure { From d49f420b1b4ff096732a129abd6a6c37a95aa4bb Mon Sep 17 00:00:00 2001 From: Rolly Date: Tue, 2 Apr 2024 04:18:13 +0300 Subject: [PATCH 08/18] refactor: rename `UserFailure.none` to `UserFailure.empty` --- lib/app/cubit/app_state.dart | 2 +- lib/login/cubit/login_state.dart | 2 +- packages/user_repository/lib/src/failures.dart | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/app/cubit/app_state.dart b/lib/app/cubit/app_state.dart index 3392a27..2642a6a 100644 --- a/lib/app/cubit/app_state.dart +++ b/lib/app/cubit/app_state.dart @@ -18,7 +18,7 @@ final class AppState extends Equatable { const AppState._({ required this.status, this.user = User.none, - this.failure = UserFailure.none, + this.failure = UserFailure.empty, }); const AppState.unauthenticated() : this._(status: AppStatus.unauthenticated); diff --git a/lib/login/cubit/login_state.dart b/lib/login/cubit/login_state.dart index ae31c02..8d6aa9d 100644 --- a/lib/login/cubit/login_state.dart +++ b/lib/login/cubit/login_state.dart @@ -18,7 +18,7 @@ final class LoginState extends Equatable { const LoginState._({ this.status = LoginStatus.initial, this.signInMethod = SignInMethod.none, - this.failure = UserFailure.none, + this.failure = UserFailure.empty, }); const LoginState.initial() : this._(); diff --git a/packages/user_repository/lib/src/failures.dart b/packages/user_repository/lib/src/failures.dart index 9265fec..9371738 100644 --- a/packages/user_repository/lib/src/failures.dart +++ b/packages/user_repository/lib/src/failures.dart @@ -13,11 +13,11 @@ class UserFailure extends Failure { factory UserFailure.fromSignInWithAppleNotSupported() => const AppleSignInNotSupportedFailure(); - static const none = UserNoFailure(); + static const empty = EmptyUserFailure(); } -class UserNoFailure extends UserFailure { - const UserNoFailure() : super._(); +class EmptyUserFailure extends UserFailure { + const EmptyUserFailure() : super._(); } class AuthUserChangesFailure extends UserFailure { From 5ad550553e400b8f5fa881a2c8ec74776fb3481b Mon Sep 17 00:00:00 2001 From: Rolly Date: Tue, 2 Apr 2024 04:23:03 +0300 Subject: [PATCH 09/18] refactor: rename `TopicsFailure.none` to `TopicsFailure.empty` --- lib/topics/cubit/topics_state.dart | 2 +- packages/topics_repository/lib/src/failures.dart | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/topics/cubit/topics_state.dart b/lib/topics/cubit/topics_state.dart index 88d29b0..a645d43 100644 --- a/lib/topics/cubit/topics_state.dart +++ b/lib/topics/cubit/topics_state.dart @@ -7,7 +7,7 @@ final class TopicsState extends Equatable { this.user = User.none, this.status = TopicsStatus.initial, this.topics = const [], - this.failure = TopicsFailure.none, + this.failure = TopicsFailure.empty, }); const TopicsState.initial() : this._(); diff --git a/packages/topics_repository/lib/src/failures.dart b/packages/topics_repository/lib/src/failures.dart index fd116dd..a14e94f 100644 --- a/packages/topics_repository/lib/src/failures.dart +++ b/packages/topics_repository/lib/src/failures.dart @@ -5,11 +5,11 @@ class TopicsFailure extends Failure { factory TopicsFailure.fromGetTopics() => const GetTopicsFailure(); - static const none = TopicsNoFailure(); + static const empty = EmptyTopicsFailure(); } -class TopicsNoFailure extends TopicsFailure { - const TopicsNoFailure() : super._(); +class EmptyTopicsFailure extends TopicsFailure { + const EmptyTopicsFailure() : super._(); } class GetTopicsFailure extends TopicsFailure { From e7b5e94f3fc75571e473023312f84d4f3368c49a Mon Sep 17 00:00:00 2001 From: Rolly Date: Tue, 2 Apr 2024 04:24:00 +0300 Subject: [PATCH 10/18] refactor: rename `QuizzesFailure.none` to `QuizzesFailure.empty` --- lib/quiz/cubit/quiz_state.dart | 2 +- packages/quizzes_repository/lib/src/failures.dart | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/quiz/cubit/quiz_state.dart b/lib/quiz/cubit/quiz_state.dart index 5d300f1..8c580be 100644 --- a/lib/quiz/cubit/quiz_state.dart +++ b/lib/quiz/cubit/quiz_state.dart @@ -8,7 +8,7 @@ final class QuizState extends Equatable { this.quiz = Quiz.none, this.selectedOption = Option.none, this.step = 0, - this.failure = QuizzesFailure.none, + this.failure = QuizzesFailure.empty, }); const QuizState.initial() : this._(); diff --git a/packages/quizzes_repository/lib/src/failures.dart b/packages/quizzes_repository/lib/src/failures.dart index 955e73c..a792557 100644 --- a/packages/quizzes_repository/lib/src/failures.dart +++ b/packages/quizzes_repository/lib/src/failures.dart @@ -5,11 +5,11 @@ class QuizzesFailure extends Failure { factory QuizzesFailure.fromGetQuiz() => const GetQuizFailure(); - static const none = QuizzesNoFailure(); + static const empty = EmptyQuizzesFailure(); } -class QuizzesNoFailure extends QuizzesFailure { - const QuizzesNoFailure() : super._(); +class EmptyQuizzesFailure extends QuizzesFailure { + const EmptyQuizzesFailure() : super._(); } class GetQuizFailure extends QuizzesFailure { From b4d380f768405117ca3dd735274659a7144f5a62 Mon Sep 17 00:00:00 2001 From: Rolly Date: Tue, 2 Apr 2024 04:25:07 +0300 Subject: [PATCH 11/18] refactor: rename `User.none` to `User.empty` --- lib/app/cubit/app_cubit.dart | 4 ++-- lib/app/cubit/app_state.dart | 2 +- lib/profile/cubit/profile_cubit.dart | 2 +- lib/topics/cubit/topics_state.dart | 2 +- packages/user_repository/lib/src/models/models.dart | 4 ++-- packages/user_repository/lib/src/user_repository.dart | 8 ++++---- 6 files changed, 11 insertions(+), 11 deletions(-) diff --git a/lib/app/cubit/app_cubit.dart b/lib/app/cubit/app_cubit.dart index 4a85e16..a9825b3 100644 --- a/lib/app/cubit/app_cubit.dart +++ b/lib/app/cubit/app_cubit.dart @@ -8,7 +8,7 @@ class AppCubit extends Cubit { required UserRepository userRepository, }) : _userRepository = userRepository, super( - userRepository.user.isNone + userRepository.user.isEmpty ? const AppState.unauthenticated() : AppState.newlyAuthenticated(userRepository.user), ) { @@ -32,7 +32,7 @@ class AppCubit extends Cubit { } void _onUserChanged(User user) { - if (user.isNone) { + if (user.isEmpty) { emit(const AppState.unauthenticated()); } else if (state.isUnauthenticated) { emit(AppState.newlyAuthenticated(user)); diff --git a/lib/app/cubit/app_state.dart b/lib/app/cubit/app_state.dart index 2642a6a..621c1fb 100644 --- a/lib/app/cubit/app_state.dart +++ b/lib/app/cubit/app_state.dart @@ -17,7 +17,7 @@ extension AppStatusExtensions on AppStatus { final class AppState extends Equatable { const AppState._({ required this.status, - this.user = User.none, + this.user = User.empty, this.failure = UserFailure.empty, }); diff --git a/lib/profile/cubit/profile_cubit.dart b/lib/profile/cubit/profile_cubit.dart index b15bc34..a85fe59 100644 --- a/lib/profile/cubit/profile_cubit.dart +++ b/lib/profile/cubit/profile_cubit.dart @@ -4,7 +4,7 @@ import 'package:user_repository/user_repository.dart'; class ProfileCubit extends Cubit { ProfileCubit({required UserRepository userRepository}) : _userRepository = userRepository, - super(User.none) { + super(User.empty) { _watchUser(); } diff --git a/lib/topics/cubit/topics_state.dart b/lib/topics/cubit/topics_state.dart index a645d43..5c93f27 100644 --- a/lib/topics/cubit/topics_state.dart +++ b/lib/topics/cubit/topics_state.dart @@ -4,7 +4,7 @@ enum TopicsStatus { initial, loading, empty, loaded, failure } final class TopicsState extends Equatable { const TopicsState._({ - this.user = User.none, + this.user = User.empty, this.status = TopicsStatus.initial, this.topics = const [], this.failure = TopicsFailure.empty, diff --git a/packages/user_repository/lib/src/models/models.dart b/packages/user_repository/lib/src/models/models.dart index 130acea..593d6ad 100644 --- a/packages/user_repository/lib/src/models/models.dart +++ b/packages/user_repository/lib/src/models/models.dart @@ -40,7 +40,7 @@ class User extends Equatable { @timestamp final DateTime? lastSignInAt; - static const none = User(uid: ''); + static const empty = User(uid: ''); @override List get props => [ @@ -59,7 +59,7 @@ class User extends Equatable { } extension UserExtensions on User { - bool get isNone => this == User.none; + bool get isEmpty => this == User.empty; int totalCompletedQuizzesByTopic(String topicId) => completedQuizzes[topicId]?.length ?? 0; diff --git a/packages/user_repository/lib/src/user_repository.dart b/packages/user_repository/lib/src/user_repository.dart index a8ee9fd..6305974 100644 --- a/packages/user_repository/lib/src/user_repository.dart +++ b/packages/user_repository/lib/src/user_repository.dart @@ -25,13 +25,13 @@ class UserRepository { Stream get watchUser => _user.asBroadcastStream(); /// Gets the current user synchronously. - User get user => _user.valueOrNull ?? User.none; + User get user => _user.valueOrNull ?? User.empty; /// Gets the initial `watchUser` emission. /// /// Returns `User.none` when an error occurs. Future getOpeningUser() { - return watchUser.first.catchError((Object _) => User.none); + return watchUser.first.catchError((Object _) => User.empty); } /// Signs the user in anonymously. @@ -166,14 +166,14 @@ extension _FirebaseAuthExtensions on FirebaseAuth { .switchMap( (firebaseUser) async* { if (firebaseUser == null) { - yield User.none; + yield User.empty; return; } yield* firestore.userDoc(firebaseUser.uid).snapshots().map( (snapshot) => snapshot.exists ? User.fromJson(snapshot.data()!) - : User.none, + : User.empty, ); }, ) From 81c6ac4f1ace970dcab42e00a6cc37474c60e62d Mon Sep 17 00:00:00 2001 From: Rolly Date: Tue, 2 Apr 2024 04:27:03 +0300 Subject: [PATCH 12/18] refactor: rename `Option.none` to `Option.empty` --- lib/quiz/cubit/quiz_cubit.dart | 2 +- lib/quiz/cubit/quiz_state.dart | 2 +- lib/quiz/view/quiz_page.dart | 2 +- packages/quizzes_repository/lib/src/models/models.dart | 4 ++-- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/quiz/cubit/quiz_cubit.dart b/lib/quiz/cubit/quiz_cubit.dart index f6ba647..25e0a3e 100644 --- a/lib/quiz/cubit/quiz_cubit.dart +++ b/lib/quiz/cubit/quiz_cubit.dart @@ -38,7 +38,7 @@ class QuizCubit extends Cubit { } void unselectOption() { - emit(state.copyWith(selectedOption: Option.none)); + emit(state.copyWith(selectedOption: Option.empty)); } void validateAnswer() { diff --git a/lib/quiz/cubit/quiz_state.dart b/lib/quiz/cubit/quiz_state.dart index 8c580be..7fb0779 100644 --- a/lib/quiz/cubit/quiz_state.dart +++ b/lib/quiz/cubit/quiz_state.dart @@ -6,7 +6,7 @@ final class QuizState extends Equatable { const QuizState._({ this.status = QuizStatus.initial, this.quiz = Quiz.none, - this.selectedOption = Option.none, + this.selectedOption = Option.empty, this.step = 0, this.failure = QuizzesFailure.empty, }); diff --git a/lib/quiz/view/quiz_page.dart b/lib/quiz/view/quiz_page.dart index e0f865b..44c2af6 100644 --- a/lib/quiz/view/quiz_page.dart +++ b/lib/quiz/view/quiz_page.dart @@ -110,7 +110,7 @@ class _QuizBodyState extends State { listenWhen: (previous, current) => previous.selectedOption != current.selectedOption, listener: (_, state) { - if (state.selectedOption.isNotNone) { + if (state.selectedOption.isNotEmpty) { context.showScrollControlledBottomSheet( builder: (_) { return BlocProvider.value( diff --git a/packages/quizzes_repository/lib/src/models/models.dart b/packages/quizzes_repository/lib/src/models/models.dart index db99326..9ea574d 100644 --- a/packages/quizzes_repository/lib/src/models/models.dart +++ b/packages/quizzes_repository/lib/src/models/models.dart @@ -17,7 +17,7 @@ class Option extends Equatable { final String detail; final bool? correct; - static const none = Option(value: '', detail: '', correct: null); + static const empty = Option(value: '', detail: '', correct: null); @override List get props => [value, detail, correct]; @@ -26,7 +26,7 @@ class Option extends Equatable { } extension OptionExtensions on Option { - bool get isNotNone => this != Option.none; + bool get isNotEmpty => this != Option.empty; } @JsonSerializable(createToJson: false) From 12fb2a7e70415f982ed144dcde6a15d1cf6c3a56 Mon Sep 17 00:00:00 2001 From: Rolly Date: Tue, 2 Apr 2024 04:27:30 +0300 Subject: [PATCH 13/18] refactor: rename `Question.none` to `Question.empty` --- lib/quiz/cubit/quiz_state.dart | 2 +- packages/quizzes_repository/lib/src/models/models.dart | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/quiz/cubit/quiz_state.dart b/lib/quiz/cubit/quiz_state.dart index 7fb0779..eee29db 100644 --- a/lib/quiz/cubit/quiz_state.dart +++ b/lib/quiz/cubit/quiz_state.dart @@ -57,5 +57,5 @@ extension QuizStateExtensions on QuizState { double get progress => step / steps; Question operator [](int step) => - quiz.questions.isEmpty ? Question.none : quiz.questions[step - 1]; + quiz.questions.isEmpty ? Question.empty : quiz.questions[step - 1]; } diff --git a/packages/quizzes_repository/lib/src/models/models.dart b/packages/quizzes_repository/lib/src/models/models.dart index 9ea574d..45d4506 100644 --- a/packages/quizzes_repository/lib/src/models/models.dart +++ b/packages/quizzes_repository/lib/src/models/models.dart @@ -40,7 +40,7 @@ class Question extends Equatable { @JsonKey(defaultValue: