From d453a6fb714abf62b89034ba366fd688ad7113b4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cu=CC=9Bo=CC=9Bng=20Nguye=CC=82=CC=83n?= Date: Fri, 1 Oct 2021 12:12:24 +0700 Subject: [PATCH] Update lib --- .github/workflows/build.yml | 2 +- .github/workflows/release.yml | 2 +- .pre-commit-config.yaml | 6 +- .run/{Dev.run.xml => Debug.run.xml} | 3 +- .run/Release.run.xml | 7 + android/app/build.gradle | 7 - ios/Podfile.lock | 144 +++++++++--------- .../authentication_state.freezed.dart | 10 +- lib/game/game_controller.dart | 2 +- lib/game/game_reward.freezed.dart | 20 +-- lib/game/game_state.freezed.dart | 35 ++--- lib/game/my_game.dart | 1 + lib/game/note/note.freezed.dart | 18 +-- lib/game/tile/tile_chunk.freezed.dart | 28 ++-- lib/game/util.dart | 2 +- .../game_config_state.freezed.dart | 18 +-- lib/home/home_page.dart | 4 +- lib/instrument/instrument.freezed.dart | 48 +++--- lib/instrument/instruments_controller.dart | 4 +- lib/instrument/instruments_page.dart | 4 +- lib/main-dev.dart | 4 - lib/router/router.gr.dart | 123 ++++++++------- lib/song_checker.dart | 4 +- lib/songs/song.freezed.dart | 75 ++++----- lib/songs/songs_controller.dart | 8 +- lib/songs/songs_widget.dart | 4 +- lib/user/user.freezed.dart | 63 +++----- lib/user/user_controller.dart | 2 +- lib/user/user_page.dart | 4 +- pubspec.lock | 110 ++++++------- pubspec.yaml | 63 ++++---- 31 files changed, 397 insertions(+), 428 deletions(-) rename .run/{Dev.run.xml => Debug.run.xml} (60%) create mode 100644 .run/Release.run.xml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index ceaecab4..49aeb463 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -4,7 +4,7 @@ name: Build branches: - master env: - flutter_version: 2.5.1 + flutter_version: 2.5.2 jobs: build: name: Build diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 451fcb77..69f4818a 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -4,7 +4,7 @@ name: Release tags: - '*' env: - flutter_version: 2.5.1 + flutter_version: 2.5.2 jobs: build: name: Build diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 044d268a..b23e2eb9 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -7,7 +7,11 @@ repos: language: system - id: format_flutter name: Run flutter format - entry: bash -c "flutter format --set-exit-if-changed ." + entry: bash -c "flutter format ." + language: system + - id: flutter_pub_upgrade + name: Run flutter pub upgrade + entry: bash -c "flutter pub upgrade" language: system - id: format_flutter name: Run flutter analyze diff --git a/.run/Dev.run.xml b/.run/Debug.run.xml similarity index 60% rename from .run/Dev.run.xml rename to .run/Debug.run.xml index c5182407..e4aa3c3c 100644 --- a/.run/Dev.run.xml +++ b/.run/Debug.run.xml @@ -1,7 +1,6 @@ - + diff --git a/.run/Release.run.xml b/.run/Release.run.xml new file mode 100644 index 00000000..b97c320e --- /dev/null +++ b/.run/Release.run.xml @@ -0,0 +1,7 @@ + + + + \ No newline at end of file diff --git a/android/app/build.gradle b/android/app/build.gradle index 35638b39..1448007e 100644 --- a/android/app/build.gradle +++ b/android/app/build.gradle @@ -95,13 +95,6 @@ android { signingConfig signingConfigs.release } } - - variantFilter { variant -> - def names = variant.flavors*.name - if (variant.buildType.name == 'release' && names.contains("dev")) { - setIgnore(true) - } - } } flutter { diff --git a/ios/Podfile.lock b/ios/Podfile.lock index 3b843376..d9463391 100644 --- a/ios/Podfile.lock +++ b/ios/Podfile.lock @@ -350,86 +350,86 @@ PODS: - BoringSSL-GRPC/Interface (= 0.0.7) - BoringSSL-GRPC/Interface (0.0.7) - cloud_firestore (2.5.3): - - Firebase/Firestore (= 8.6.0) + - Firebase/Firestore (= 8.7.0) - firebase_core - Flutter - - cloud_functions (3.0.3): - - Firebase/Functions (= 8.6.0) + - cloud_functions (3.0.4): + - Firebase/Functions (= 8.7.0) - firebase_core - Flutter - device_info (0.0.1): - Flutter - - FBAEMKit (11.1.0): - - FBAEMKit/AEM (= 11.1.0) - - FBAEMKit/AEM (11.1.0): - - FBSDKCoreKit_Basics (~> 11.1.0) - - FBSDKCoreKit (11.1.0): - - FBSDKCoreKit/Core (= 11.1.0) - - FBSDKCoreKit/Core (11.1.0): - - FBAEMKit (~> 11.1.0) - - FBSDKCoreKit_Basics (~> 11.1.0) - - FBSDKCoreKit_Basics (11.1.0): - - FBSDKCoreKit_Basics/Basics (= 11.1.0) - - FBSDKCoreKit_Basics/Basics (11.1.0) - - FBSDKLoginKit (11.1.0): - - FBSDKLoginKit/Login (= 11.1.0) - - FBSDKLoginKit/Login (11.1.0): - - FBSDKCoreKit (~> 11.1.0) - - FBSDKCoreKit_Basics (~> 11.1.0) - - Firebase/Auth (8.6.0): + - FBAEMKit (11.2.1): + - FBAEMKit/AEM (= 11.2.1) + - FBAEMKit/AEM (11.2.1): + - FBSDKCoreKit_Basics (~> 11.2.1) + - FBSDKCoreKit (11.2.1): + - FBSDKCoreKit/Core (= 11.2.1) + - FBSDKCoreKit/Core (11.2.1): + - FBAEMKit (~> 11.2.1) + - FBSDKCoreKit_Basics (~> 11.2.1) + - FBSDKCoreKit_Basics (11.2.1): + - FBSDKCoreKit_Basics/Basics (= 11.2.1) + - FBSDKCoreKit_Basics/Basics (11.2.1) + - FBSDKLoginKit (11.2.1): + - FBSDKLoginKit/Login (= 11.2.1) + - FBSDKLoginKit/Login (11.2.1): + - FBSDKCoreKit (~> 11.2.1) + - FBSDKCoreKit_Basics (~> 11.2.1) + - Firebase/Auth (8.7.0): - Firebase/CoreOnly - - FirebaseAuth (~> 8.6.0) - - Firebase/CoreOnly (8.6.0): - - FirebaseCore (= 8.6.0) - - Firebase/Crashlytics (8.6.0): + - FirebaseAuth (~> 8.7.0) + - Firebase/CoreOnly (8.7.0): + - FirebaseCore (= 8.7.0) + - Firebase/Crashlytics (8.7.0): - Firebase/CoreOnly - - FirebaseCrashlytics (~> 8.6.0) - - Firebase/Firestore (8.6.0): + - FirebaseCrashlytics (~> 8.7.0) + - Firebase/Firestore (8.7.0): - Firebase/CoreOnly - - FirebaseFirestore (~> 8.6.0) - - Firebase/Functions (8.6.0): + - FirebaseFirestore (~> 8.7.0) + - Firebase/Functions (8.7.0): - Firebase/CoreOnly - - FirebaseFunctions (~> 8.6.0) - - Firebase/Storage (8.6.0): + - FirebaseFunctions (~> 8.7.0) + - Firebase/Storage (8.7.0): - Firebase/CoreOnly - - FirebaseStorage (~> 8.6.0) - - firebase_auth (3.1.1): - - Firebase/Auth (= 8.6.0) + - FirebaseStorage (~> 8.7.0) + - firebase_auth (3.1.3): + - Firebase/Auth (= 8.7.0) - firebase_core - Flutter - - firebase_core (1.6.0): - - Firebase/CoreOnly (= 8.6.0) + - firebase_core (1.7.0): + - Firebase/CoreOnly (= 8.7.0) - Flutter - - firebase_crashlytics (2.2.1): - - Firebase/Crashlytics (= 8.6.0) + - firebase_crashlytics (2.2.3): + - Firebase/Crashlytics (= 8.7.0) - firebase_core - Flutter - - firebase_storage (10.0.3): - - Firebase/Storage (= 8.6.0) + - firebase_storage (10.0.5): + - Firebase/Storage (= 8.7.0) - firebase_core - Flutter - - FirebaseAuth (8.6.0): + - FirebaseAuth (8.7.0): - FirebaseCore (~> 8.0) - GoogleUtilities/AppDelegateSwizzler (~> 7.4) - GoogleUtilities/Environment (~> 7.4) - GTMSessionFetcher/Core (~> 1.5) - - FirebaseCore (8.6.0): + - FirebaseCore (8.7.0): - FirebaseCoreDiagnostics (~> 8.0) - GoogleUtilities/Environment (~> 7.4) - GoogleUtilities/Logger (~> 7.4) - - FirebaseCoreDiagnostics (8.7.0): + - FirebaseCoreDiagnostics (8.8.0): - GoogleDataTransport (~> 9.0) - GoogleUtilities/Environment (~> 7.4) - GoogleUtilities/Logger (~> 7.4) - nanopb (~> 2.30908.0) - - FirebaseCrashlytics (8.6.0): + - FirebaseCrashlytics (8.7.0): - FirebaseCore (~> 8.0) - FirebaseInstallations (~> 8.0) - GoogleDataTransport (~> 9.0) - GoogleUtilities/Environment (~> 7.4) - nanopb (~> 2.30908.0) - PromisesObjC (< 3.0, >= 1.2) - - FirebaseFirestore (8.6.0): + - FirebaseFirestore (8.7.0): - abseil/algorithm (= 0.20200225.0) - abseil/base (= 0.20200225.0) - abseil/container/flat_hash_map (= 0.20200225.0) @@ -442,23 +442,23 @@ PODS: - "gRPC-C++ (~> 1.28.0)" - leveldb-library (~> 1.22) - nanopb (~> 2.30908.0) - - FirebaseFunctions (8.6.0): + - FirebaseFunctions (8.7.0): - FirebaseCore (~> 8.0) - GTMSessionFetcher/Core (~> 1.5) - - FirebaseInstallations (8.7.0): + - FirebaseInstallations (8.8.0): - FirebaseCore (~> 8.0) - GoogleUtilities/Environment (~> 7.4) - GoogleUtilities/UserDefaults (~> 7.4) - PromisesObjC (< 3.0, >= 1.2) - - FirebaseStorage (8.6.0): + - FirebaseStorage (8.7.0): - FirebaseCore (~> 8.0) - GTMSessionFetcher/Core (~> 1.5) - Flutter (1.0.0) - flutter_email_sender (0.0.1): - Flutter - - flutter_facebook_auth (2.0.0): - - FBSDKCoreKit (~> 11.1.0) - - FBSDKLoginKit (~> 11.1.0) + - flutter_facebook_auth (3.5.1): + - FBSDKCoreKit (~> 11.2.0) + - FBSDKLoginKit (~> 11.2.0) - Flutter - FMDB (2.7.5): - FMDB/standard (= 2.7.5) @@ -629,31 +629,31 @@ SPEC CHECKSUMS: abseil: 6c8eb7892aefa08d929b39f9bb108e5367e3228f AppAuth: 31bcec809a638d7bd2f86ea8a52bd45f6e81e7c7 BoringSSL-GRPC: 8edf627ee524575e2f8d19d56f068b448eea3879 - cloud_firestore: bb4fcf1d62a2bf48586fad7a7e9612f20a719cda - cloud_functions: eb40a5d5eed6baa51d163b7d0b06d2679ba4aac6 + cloud_firestore: a09fdd53707eadea99f93ca5ad8e95e4c1ab1108 + cloud_functions: 63c8f00dc59eb3c6defe188a29e08a0520133a8c device_info: d7d233b645a32c40dfdc212de5cf646ca482f175 - FBAEMKit: 5c8a8d08e5b2c79628490784883e0fcc75b12615 - FBSDKCoreKit: 7ccb8b4bb2b5ee2ad94327b774dc23f03509675d - FBSDKCoreKit_Basics: 8f978bce195845f609b0ec6b425949d0d24f525b - FBSDKLoginKit: d65eb587a9eaa89295338fb0bb3b358bde0b7ae4 - Firebase: 21ac9f28b09a8bdfc005f34c984fca84e7e8786d - firebase_auth: a5da789c2876fda3ad7407bd2828e502dfeebc42 - firebase_core: c21ac09a8d23afd3594b56ed786bad12e5266bba - firebase_crashlytics: b0581024be6112af8821de61e5a37fdb292373f0 - firebase_storage: 75fc62b16cfbb268ea4e90729be5729e3dc38b1e - FirebaseAuth: 223adeeb2262b417532e89bf06a960e3a0a1e9e4 - FirebaseCore: 620b677f70f5470a8e59cb77f3ddc666f6f09785 - FirebaseCoreDiagnostics: b63732f581a1c6a453ec7241f9ab60b3a5bd3450 - FirebaseCrashlytics: 58f8ecea7c799c61c50e8111d2e438424a8a1d2e - FirebaseFirestore: 7b8bd72aff4d3ad91498343e81fdbaa994ce8abe - FirebaseFunctions: 7639390ac39a914ab7a137fd162956b99cba59a7 - FirebaseInstallations: ede6fb72bb6337914e5888b399271259d0c4910c - FirebaseStorage: 2765944230981e63f8bd2938d9d5819158b7c34c + FBAEMKit: 5de0a7aaa854eec69bb5be20795952a63d38a5f6 + FBSDKCoreKit: bf655f808b040ed66a72b9922911b39d703e64f4 + FBSDKCoreKit_Basics: 73ebe3a27eb688ac5b5aa7e99f68992993042115 + FBSDKLoginKit: 2e76831ef08d356b8f9150ea51cce865074ea304 + Firebase: bc9325d5ee2041524bac78a5213d0e530c651309 + firebase_auth: 25f34550b0023cbc3824731240608cd0aa515ca2 + firebase_core: f5ac1f2726a2bd0468cea0161eddeea3d83d7e3e + firebase_crashlytics: 16f2d46200fab0b7085912fd473f77c06b3c69f7 + firebase_storage: d4ced699e5106374a16961d8f2028a0ed34b748d + FirebaseAuth: 2e7d029977648c67a5d51a263d4cbab76d34cf12 + FirebaseCore: f4804c1d3f4bbbefc88904d15653038f2c99ddf7 + FirebaseCoreDiagnostics: fe77f42da6329d6d83d21fd9d621a6b704413bfc + FirebaseCrashlytics: 6fac03d1eef054833b71c929c93ab95c12989728 + FirebaseFirestore: e722ba956610c45d368d9787689e2aa41b809e68 + FirebaseFunctions: 9b78e79a3de4ee00ca1af7fd8c5fd7ed76fbf702 + FirebaseInstallations: 2563cb18a723ef9c6ef18318a49519b75dce613c + FirebaseStorage: 2e6e58fe31fb0061fdce3f156d0ebc964e9de6ba Flutter: 50d75fe2f02b26cc09d224853bb45737f8b3214a flutter_email_sender: 02d7443217d8c41483223627972bfdc09f74276b - flutter_facebook_auth: 528d51ea1324741b366fa87fa5dfd41016422364 + flutter_facebook_auth: 870a465b1afff3ace7a592bd44665d921991726c FMDB: 2ce00b547f966261cd18927a3ddb07cb6f3db82a - google_sign_in: de494e5e993986afae63e22a32441e30c35c9823 + google_sign_in: c5cecea71f3be43282263550556e311c4cc03582 GoogleDataTransport: 85fd18ff3019bb85d3f2c551d04c481dedf71fc9 GoogleSignIn: 7137d297ddc022a7e0aa4619c86d72c909fa7213 GoogleUtilities: 8de2a97a17e15b6b98e38e8770e2d129a57c0040 diff --git a/lib/authentication/authentication_state.freezed.dart b/lib/authentication/authentication_state.freezed.dart index 1b34c971..94351c4a 100644 --- a/lib/authentication/authentication_state.freezed.dart +++ b/lib/authentication/authentication_state.freezed.dart @@ -132,7 +132,9 @@ class _$AuthenticationStateLoading implements AuthenticationStateLoading { @override bool operator ==(dynamic other) { - return identical(this, other) || (other is AuthenticationStateLoading); + return identical(this, other) || + (other.runtimeType == runtimeType && + other is AuthenticationStateLoading); } @override @@ -249,7 +251,8 @@ class _$AuthenticationStateAuthenticated @override bool operator ==(dynamic other) { return identical(this, other) || - (other is AuthenticationStateAuthenticated); + (other.runtimeType == runtimeType && + other is AuthenticationStateAuthenticated); } @override @@ -367,7 +370,8 @@ class _$AuthenticationStateUnauthenticated @override bool operator ==(dynamic other) { return identical(this, other) || - (other is AuthenticationStateUnauthenticated); + (other.runtimeType == runtimeType && + other is AuthenticationStateUnauthenticated); } @override diff --git a/lib/game/game_controller.dart b/lib/game/game_controller.dart index 72cfb408..0d3ad07e 100644 --- a/lib/game/game_controller.dart +++ b/lib/game/game_controller.dart @@ -77,7 +77,7 @@ class GameController extends StateNotifier { bpm = song.bpm; } final tiles = createTiles(_tileChunks, _unitDuration, _numberTileColumn); - final tick2Second = tickToSecond(midiFile.header.ticksPerBeat, bpm); + final tick2Second = tickToSecond(midiFile.header.ticksPerBeat!, bpm); final speedDpsPerTick = unitDurationHeight / _unitDuration; _speedDpsPerSecond = speedDpsPerTick / tick2Second; final duration = diff --git a/lib/game/game_reward.freezed.dart b/lib/game/game_reward.freezed.dart index ad103e43..81485895 100644 --- a/lib/game/game_reward.freezed.dart +++ b/lib/game/game_reward.freezed.dart @@ -28,7 +28,7 @@ class _$GameRewardTearOff { ); } - GameReward fromJson(Map json) { + GameReward fromJson(Map json) { return GameReward.fromJson(json); } } @@ -139,19 +139,15 @@ class _$_GameReward implements _GameReward { @override bool operator ==(dynamic other) { return identical(this, other) || - (other is _GameReward && - (identical(other.stars, stars) || - const DeepCollectionEquality().equals(other.stars, stars)) && + (other.runtimeType == runtimeType && + other is _GameReward && + (identical(other.stars, stars) || other.stars == stars) && (identical(other.playedNotes, playedNotes) || - const DeepCollectionEquality() - .equals(other.playedNotes, playedNotes))); + other.playedNotes == playedNotes)); } @override - int get hashCode => - runtimeType.hashCode ^ - const DeepCollectionEquality().hash(stars) ^ - const DeepCollectionEquality().hash(playedNotes); + int get hashCode => Object.hash(runtimeType, stars, playedNotes); @JsonKey(ignore: true) @override @@ -172,9 +168,9 @@ abstract class _GameReward implements GameReward { _$_GameReward.fromJson; @override - int get stars => throw _privateConstructorUsedError; + int get stars; @override - int get playedNotes => throw _privateConstructorUsedError; + int get playedNotes; @override @JsonKey(ignore: true) _$GameRewardCopyWith<_GameReward> get copyWith => diff --git a/lib/game/game_state.freezed.dart b/lib/game/game_state.freezed.dart index 8aa61345..577c4766 100644 --- a/lib/game/game_state.freezed.dart +++ b/lib/game/game_state.freezed.dart @@ -141,7 +141,8 @@ class _$GameStateLoading implements GameStateLoading { @override bool operator ==(dynamic other) { - return identical(this, other) || (other is GameStateLoading); + return identical(this, other) || + (other.runtimeType == runtimeType && other is GameStateLoading); } @override @@ -280,20 +281,16 @@ class _$GameStatePlaying implements GameStatePlaying { @override bool operator ==(dynamic other) { return identical(this, other) || - (other is GameStatePlaying && + (other.runtimeType == runtimeType && + other is GameStatePlaying && (identical(other.duration, duration) || - const DeepCollectionEquality() - .equals(other.duration, duration)) && + other.duration == duration) && (identical(other.songName, songName) || - const DeepCollectionEquality() - .equals(other.songName, songName))); + other.songName == songName)); } @override - int get hashCode => - runtimeType.hashCode ^ - const DeepCollectionEquality().hash(duration) ^ - const DeepCollectionEquality().hash(songName); + int get hashCode => Object.hash(runtimeType, duration, songName); @JsonKey(ignore: true) @override @@ -378,8 +375,8 @@ class _$GameStatePlaying implements GameStatePlaying { abstract class GameStatePlaying implements GameState { factory GameStatePlaying(int duration, String songName) = _$GameStatePlaying; - int get duration => throw _privateConstructorUsedError; - String get songName => throw _privateConstructorUsedError; + int get duration; + String get songName; @JsonKey(ignore: true) $GameStatePlayingCopyWith get copyWith => throw _privateConstructorUsedError; @@ -416,7 +413,8 @@ class _$GameStateGettingGift implements GameStateGettingGift { @override bool operator ==(dynamic other) { - return identical(this, other) || (other is GameStateGettingGift); + return identical(this, other) || + (other.runtimeType == runtimeType && other is GameStateGettingGift); } @override @@ -558,15 +556,14 @@ class _$GameStateCompleted implements GameStateCompleted { @override bool operator ==(dynamic other) { return identical(this, other) || - (other is GameStateCompleted && + (other.runtimeType == runtimeType && + other is GameStateCompleted && (identical(other.gameReward, gameReward) || - const DeepCollectionEquality() - .equals(other.gameReward, gameReward))); + other.gameReward == gameReward)); } @override - int get hashCode => - runtimeType.hashCode ^ const DeepCollectionEquality().hash(gameReward); + int get hashCode => Object.hash(runtimeType, gameReward); @JsonKey(ignore: true) @override @@ -651,7 +648,7 @@ class _$GameStateCompleted implements GameStateCompleted { abstract class GameStateCompleted implements GameState { factory GameStateCompleted(GameReward gameReward) = _$GameStateCompleted; - GameReward get gameReward => throw _privateConstructorUsedError; + GameReward get gameReward; @JsonKey(ignore: true) $GameStateCompletedCopyWith get copyWith => throw _privateConstructorUsedError; diff --git a/lib/game/my_game.dart b/lib/game/my_game.dart index d1a2d6b0..7570c248 100644 --- a/lib/game/my_game.dart +++ b/lib/game/my_game.dart @@ -39,6 +39,7 @@ class MyGame extends FlameGame with MultiTouchTapDetector { @override Future onLoad() async { + await super.onLoad(); _staffSprite = Sprite( await images.load('${nearestDevicePixelRatioFolder}img_staff.png')); _clefSprite = Sprite( diff --git a/lib/game/note/note.freezed.dart b/lib/game/note/note.freezed.dart index a4b2a535..0e91958e 100644 --- a/lib/game/note/note.freezed.dart +++ b/lib/game/note/note.freezed.dart @@ -123,19 +123,15 @@ class _$_Note implements _Note { @override bool operator ==(dynamic other) { return identical(this, other) || - (other is _Note && - (identical(other.note, note) || - const DeepCollectionEquality().equals(other.note, note)) && + (other.runtimeType == runtimeType && + other is _Note && + (identical(other.note, note) || other.note == note) && (identical(other.startTick, startTick) || - const DeepCollectionEquality() - .equals(other.startTick, startTick))); + other.startTick == startTick)); } @override - int get hashCode => - runtimeType.hashCode ^ - const DeepCollectionEquality().hash(note) ^ - const DeepCollectionEquality().hash(startTick); + int get hashCode => Object.hash(runtimeType, note, startTick); @JsonKey(ignore: true) @override @@ -147,9 +143,9 @@ abstract class _Note implements Note { factory _Note({required int note, required int startTick}) = _$_Note; @override - int get note => throw _privateConstructorUsedError; + int get note; @override - int get startTick => throw _privateConstructorUsedError; + int get startTick; @override @JsonKey(ignore: true) _$NoteCopyWith<_Note> get copyWith => throw _privateConstructorUsedError; diff --git a/lib/game/tile/tile_chunk.freezed.dart b/lib/game/tile/tile_chunk.freezed.dart index 6b5b5f1b..a180d112 100644 --- a/lib/game/tile/tile_chunk.freezed.dart +++ b/lib/game/tile/tile_chunk.freezed.dart @@ -145,23 +145,21 @@ class _$_TileChunk implements _TileChunk { @override bool operator ==(dynamic other) { return identical(this, other) || - (other is _TileChunk && - (identical(other.notes, notes) || - const DeepCollectionEquality().equals(other.notes, notes)) && + (other.runtimeType == runtimeType && + other is _TileChunk && + const DeepCollectionEquality().equals(other.notes, notes) && (identical(other.durationToPrevious, durationToPrevious) || - const DeepCollectionEquality() - .equals(other.durationToPrevious, durationToPrevious)) && + other.durationToPrevious == durationToPrevious) && (identical(other.startTick, startTick) || - const DeepCollectionEquality() - .equals(other.startTick, startTick))); + other.startTick == startTick)); } @override - int get hashCode => - runtimeType.hashCode ^ - const DeepCollectionEquality().hash(notes) ^ - const DeepCollectionEquality().hash(durationToPrevious) ^ - const DeepCollectionEquality().hash(startTick); + int get hashCode => Object.hash( + runtimeType, + const DeepCollectionEquality().hash(notes), + durationToPrevious, + startTick); @JsonKey(ignore: true) @override @@ -176,11 +174,11 @@ abstract class _TileChunk implements TileChunk { required int startTick}) = _$_TileChunk; @override - List get notes => throw _privateConstructorUsedError; + List get notes; @override - int get durationToPrevious => throw _privateConstructorUsedError; + int get durationToPrevious; @override - int get startTick => throw _privateConstructorUsedError; + int get startTick; @override @JsonKey(ignore: true) _$TileChunkCopyWith<_TileChunk> get copyWith => diff --git a/lib/game/util.dart b/lib/game/util.dart index b150cef3..a45a5379 100644 --- a/lib/game/util.dart +++ b/lib/game/util.dart @@ -35,7 +35,7 @@ String nearestDevicePixelRatioFolder = () { final positionsX = () { final positionXs = []; const tilePad = 24; - final paddedTileWidth = tileWidth + 2 * tilePad; + const paddedTileWidth = tileWidth + 2 * tilePad; final padLeftRight = (screenWidth - numberTileColumn * paddedTileWidth) / 2; for (var column = 0; column < numberTileColumn; column++) { positionXs.add(padLeftRight + column * paddedTileWidth + tilePad); diff --git a/lib/game_config/game_config_state.freezed.dart b/lib/game_config/game_config_state.freezed.dart index cde941c5..bcc67d6f 100644 --- a/lib/game_config/game_config_state.freezed.dart +++ b/lib/game_config/game_config_state.freezed.dart @@ -130,19 +130,15 @@ class _$_GameConfigState implements _GameConfigState { @override bool operator ==(dynamic other) { return identical(this, other) || - (other is _GameConfigState && + (other.runtimeType == runtimeType && + other is _GameConfigState && (identical(other.difficulty, difficulty) || - const DeepCollectionEquality() - .equals(other.difficulty, difficulty)) && - (identical(other.speed, speed) || - const DeepCollectionEquality().equals(other.speed, speed))); + other.difficulty == difficulty) && + (identical(other.speed, speed) || other.speed == speed)); } @override - int get hashCode => - runtimeType.hashCode ^ - const DeepCollectionEquality().hash(difficulty) ^ - const DeepCollectionEquality().hash(speed); + int get hashCode => Object.hash(runtimeType, difficulty, speed); @JsonKey(ignore: true) @override @@ -155,9 +151,9 @@ abstract class _GameConfigState implements GameConfigState { _$_GameConfigState; @override - int get difficulty => throw _privateConstructorUsedError; + int get difficulty; @override - int get speed => throw _privateConstructorUsedError; + int get speed; @override @JsonKey(ignore: true) _$GameConfigStateCopyWith<_GameConfigState> get copyWith => diff --git a/lib/home/home_page.dart b/lib/home/home_page.dart index 2fb0a2af..91c48a5a 100644 --- a/lib/home/home_page.dart +++ b/lib/home/home_page.dart @@ -60,9 +60,9 @@ class HomePage extends StatelessWidget { Icons.account_circle_rounded); }, ), - loading: () => + loading: (_) => const Icon(Icons.account_circle_rounded), - error: (_, __) => + error: (_, __, ___) => const Icon(Icons.account_circle_rounded)); }, )), diff --git a/lib/instrument/instrument.freezed.dart b/lib/instrument/instrument.freezed.dart index 91c98520..aaa01437 100644 --- a/lib/instrument/instrument.freezed.dart +++ b/lib/instrument/instrument.freezed.dart @@ -36,7 +36,7 @@ class _$InstrumentTearOff { ); } - Instrument fromJson(Map json) { + Instrument fromJson(Map json) { return Instrument.fromJson(json); } } @@ -201,30 +201,24 @@ class _$_Instrument implements _Instrument { @override bool operator ==(dynamic other) { return identical(this, other) || - (other is _Instrument && - (identical(other.id, id) || - const DeepCollectionEquality().equals(other.id, id)) && - (identical(other.soundPaths, soundPaths) || - const DeepCollectionEquality() - .equals(other.soundPaths, soundPaths)) && - (identical(other.baseNotes, baseNotes) || - const DeepCollectionEquality() - .equals(other.baseNotes, baseNotes)) && - (identical(other.minNote, minNote) || - const DeepCollectionEquality() - .equals(other.minNote, minNote)) && - (identical(other.maxNote, maxNote) || - const DeepCollectionEquality().equals(other.maxNote, maxNote))); + (other.runtimeType == runtimeType && + other is _Instrument && + (identical(other.id, id) || other.id == id) && + const DeepCollectionEquality() + .equals(other.soundPaths, soundPaths) && + const DeepCollectionEquality().equals(other.baseNotes, baseNotes) && + (identical(other.minNote, minNote) || other.minNote == minNote) && + (identical(other.maxNote, maxNote) || other.maxNote == maxNote)); } @override - int get hashCode => - runtimeType.hashCode ^ - const DeepCollectionEquality().hash(id) ^ - const DeepCollectionEquality().hash(soundPaths) ^ - const DeepCollectionEquality().hash(baseNotes) ^ - const DeepCollectionEquality().hash(minNote) ^ - const DeepCollectionEquality().hash(maxNote); + int get hashCode => Object.hash( + runtimeType, + id, + const DeepCollectionEquality().hash(soundPaths), + const DeepCollectionEquality().hash(baseNotes), + minNote, + maxNote); @JsonKey(ignore: true) @override @@ -249,15 +243,15 @@ abstract class _Instrument implements Instrument { _$_Instrument.fromJson; @override - String get id => throw _privateConstructorUsedError; + String get id; @override - Map get soundPaths => throw _privateConstructorUsedError; + Map get soundPaths; @override - Map get baseNotes => throw _privateConstructorUsedError; + Map get baseNotes; @override - int get minNote => throw _privateConstructorUsedError; + int get minNote; @override - int get maxNote => throw _privateConstructorUsedError; + int get maxNote; @override @JsonKey(ignore: true) _$InstrumentCopyWith<_Instrument> get copyWith => diff --git a/lib/instrument/instruments_controller.dart b/lib/instrument/instruments_controller.dart index 05c910d8..bd49ac78 100644 --- a/lib/instrument/instruments_controller.dart +++ b/lib/instrument/instruments_controller.dart @@ -13,8 +13,8 @@ final selectedInstrumentProvider = Provider(((ref) { return instruments.when( data: (instruments) => instruments.firstWhereOrNull((e) => e.id == selectedInstrumentId), - loading: () => null, - error: (_, __) => null); + loading: (_) => null, + error: (_, __, ___) => null); })); final instrumentsProvider = diff --git a/lib/instrument/instruments_page.dart b/lib/instrument/instruments_page.dart index de860180..c9713bbb 100644 --- a/lib/instrument/instruments_page.dart +++ b/lib/instrument/instruments_page.dart @@ -36,8 +36,8 @@ class InstrumentsPage extends ConsumerWidget { ); }, ), - loading: () => const LoadingWidget(), - error: (_, __) => const LoadingWidget()), + loading: (_) => const LoadingWidget(), + error: (_, __, ___) => const LoadingWidget()), ); } } diff --git a/lib/main-dev.dart b/lib/main-dev.dart index d892ebab..2fc3ab75 100644 --- a/lib/main-dev.dart +++ b/lib/main-dev.dart @@ -1,6 +1,5 @@ // ignore_for_file: file_names import 'package:firebase_core/firebase_core.dart'; -import 'package:flutter/foundation.dart'; import 'package:flutter/material.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'package:logging/logging.dart'; @@ -45,9 +44,6 @@ Future main() async { WidgetsFlutterBinding.ensureInitialized(); final sharedPreferences = await SharedPreferences.getInstance(); await Firebase.initializeApp(); - if (kReleaseMode) { - Logger.root.level = Level.OFF; - } Logger.root.onRecord.listen((record) { // ignore: avoid_print print('${record.level.name}: ${record.time}: ${record.message}'); diff --git a/lib/router/router.gr.dart b/lib/router/router.gr.dart index dd4d2dcd..ba5efba1 100644 --- a/lib/router/router.gr.dart +++ b/lib/router/router.gr.dart @@ -1,99 +1,106 @@ +// ************************************************************************** +// AutoRouteGenerator +// ************************************************************************** + // GENERATED CODE - DO NOT MODIFY BY HAND // ************************************************************************** // AutoRouteGenerator // ************************************************************************** -import 'package:auto_route/auto_route.dart' as _i1; -import 'package:flutter/material.dart' as _i2; +import 'package:auto_route/auto_route.dart' as _i10; +import 'package:flutter/material.dart' as _i11; -import '../game/game_page.dart' as _i6; -import '../game_config/game_config_page.dart' as _i5; -import '../home/home_page.dart' as _i4; -import '../instrument/instruments_page.dart' as _i10; -import '../locale/locale_page.dart' as _i8; -import '../setting/settings_page.dart' as _i11; +import '../game/game_page.dart' as _i4; +import '../game_config/game_config_page.dart' as _i3; +import '../home/home_page.dart' as _i2; +import '../instrument/instruments_page.dart' as _i8; +import '../locale/locale_page.dart' as _i6; +import '../setting/settings_page.dart' as _i9; import '../songs/song.dart' as _i12; -import '../splash_page.dart' as _i3; -import '../theme/theme_page.dart' as _i9; -import '../user/user_page.dart' as _i7; +import '../splash_page.dart' as _i1; +import '../theme/theme_page.dart' as _i7; +import '../user/user_page.dart' as _i5; -class RootRouter extends _i1.RootStackRouter { - RootRouter([_i2.GlobalKey<_i2.NavigatorState>? navigatorKey]) +class RootRouter extends _i10.RootStackRouter { + RootRouter([_i11.GlobalKey<_i11.NavigatorState>? navigatorKey]) : super(navigatorKey); @override - final Map pagesMap = { + final Map pagesMap = { SplashRoute.name: (routeData) { - return _i1.MaterialPageX( - routeData: routeData, child: const _i3.SplashPage()); + return _i10.MaterialPageX( + routeData: routeData, child: const _i1.SplashPage()); }, HomeRoute.name: (routeData) { - return _i1.MaterialPageX( - routeData: routeData, child: const _i4.HomePage()); + return _i10.MaterialPageX( + routeData: routeData, child: const _i2.HomePage()); }, GameConfigRoute.name: (routeData) { final args = routeData.argsAs(); - return _i1.MaterialPageX( + return _i10.MaterialPageX( routeData: routeData, - child: _i5.GameConfigPage(key: args.key, song: args.song)); + child: _i3.GameConfigPage(key: args.key, song: args.song)); }, GameRoute.name: (routeData) { final args = routeData.argsAs(); - return _i1.MaterialPageX( + return _i10.MaterialPageX( routeData: routeData, - child: _i6.GamePage(key: args.key, arguments: args.arguments)); + child: _i4.GamePage(key: args.key, arguments: args.arguments)); }, UserRoute.name: (routeData) { - return _i1.MaterialPageX( - routeData: routeData, child: const _i7.UserPage()); + return _i10.MaterialPageX( + routeData: routeData, child: const _i5.UserPage()); }, LocaleRoute.name: (routeData) { - return _i1.MaterialPageX( - routeData: routeData, child: const _i8.LocalePage()); + return _i10.MaterialPageX( + routeData: routeData, child: const _i6.LocalePage()); }, ThemeRoute.name: (routeData) { - return _i1.MaterialPageX( - routeData: routeData, child: const _i9.ThemePage()); + return _i10.MaterialPageX( + routeData: routeData, child: const _i7.ThemePage()); }, InstrumentsRoute.name: (routeData) { - return _i1.MaterialPageX( - routeData: routeData, child: const _i10.InstrumentsPage()); + return _i10.MaterialPageX( + routeData: routeData, child: const _i8.InstrumentsPage()); }, SettingsRoute.name: (routeData) { - return _i1.MaterialPageX( - routeData: routeData, child: const _i11.SettingsPage()); + return _i10.MaterialPageX( + routeData: routeData, child: const _i9.SettingsPage()); } }; @override - List<_i1.RouteConfig> get routes => [ - _i1.RouteConfig(SplashRoute.name, path: '/'), - _i1.RouteConfig(HomeRoute.name, path: '/home-page'), - _i1.RouteConfig(GameConfigRoute.name, path: '/game-config-page'), - _i1.RouteConfig(GameRoute.name, path: '/game-page'), - _i1.RouteConfig(UserRoute.name, path: '/user-page'), - _i1.RouteConfig(LocaleRoute.name, path: '/locale-page'), - _i1.RouteConfig(ThemeRoute.name, path: '/theme-page'), - _i1.RouteConfig(InstrumentsRoute.name, path: '/instruments-page'), - _i1.RouteConfig(SettingsRoute.name, path: '/settings-page') + List<_i10.RouteConfig> get routes => [ + _i10.RouteConfig(SplashRoute.name, path: '/'), + _i10.RouteConfig(HomeRoute.name, path: '/home-page'), + _i10.RouteConfig(GameConfigRoute.name, path: '/game-config-page'), + _i10.RouteConfig(GameRoute.name, path: '/game-page'), + _i10.RouteConfig(UserRoute.name, path: '/user-page'), + _i10.RouteConfig(LocaleRoute.name, path: '/locale-page'), + _i10.RouteConfig(ThemeRoute.name, path: '/theme-page'), + _i10.RouteConfig(InstrumentsRoute.name, path: '/instruments-page'), + _i10.RouteConfig(SettingsRoute.name, path: '/settings-page') ]; } -class SplashRoute extends _i1.PageRouteInfo { +/// generated route for [_i1.SplashPage] +class SplashRoute extends _i10.PageRouteInfo { const SplashRoute() : super(name, path: '/'); static const String name = 'SplashRoute'; } -class HomeRoute extends _i1.PageRouteInfo { +/// generated route for [_i2.HomePage] +class HomeRoute extends _i10.PageRouteInfo { const HomeRoute() : super(name, path: '/home-page'); static const String name = 'HomeRoute'; } -class GameConfigRoute extends _i1.PageRouteInfo { - GameConfigRoute({_i2.Key? key, required _i12.Song song}) +/// generated route for [_i3.GameConfigPage] +class GameConfigRoute extends _i10.PageRouteInfo { + GameConfigRoute({_i11.Key? key, required _i12.Song song}) : super(name, path: '/game-config-page', args: GameConfigRouteArgs(key: key, song: song)); @@ -104,13 +111,14 @@ class GameConfigRoute extends _i1.PageRouteInfo { class GameConfigRouteArgs { const GameConfigRouteArgs({this.key, required this.song}); - final _i2.Key? key; + final _i11.Key? key; final _i12.Song song; } -class GameRoute extends _i1.PageRouteInfo { - GameRoute({_i2.Key? key, required Map arguments}) +/// generated route for [_i4.GamePage] +class GameRoute extends _i10.PageRouteInfo { + GameRoute({_i11.Key? key, required Map arguments}) : super(name, path: '/game-page', args: GameRouteArgs(key: key, arguments: arguments)); @@ -121,36 +129,41 @@ class GameRoute extends _i1.PageRouteInfo { class GameRouteArgs { const GameRouteArgs({this.key, required this.arguments}); - final _i2.Key? key; + final _i11.Key? key; final Map arguments; } -class UserRoute extends _i1.PageRouteInfo { +/// generated route for [_i5.UserPage] +class UserRoute extends _i10.PageRouteInfo { const UserRoute() : super(name, path: '/user-page'); static const String name = 'UserRoute'; } -class LocaleRoute extends _i1.PageRouteInfo { +/// generated route for [_i6.LocalePage] +class LocaleRoute extends _i10.PageRouteInfo { const LocaleRoute() : super(name, path: '/locale-page'); static const String name = 'LocaleRoute'; } -class ThemeRoute extends _i1.PageRouteInfo { +/// generated route for [_i7.ThemePage] +class ThemeRoute extends _i10.PageRouteInfo { const ThemeRoute() : super(name, path: '/theme-page'); static const String name = 'ThemeRoute'; } -class InstrumentsRoute extends _i1.PageRouteInfo { +/// generated route for [_i8.InstrumentsPage] +class InstrumentsRoute extends _i10.PageRouteInfo { const InstrumentsRoute() : super(name, path: '/instruments-page'); static const String name = 'InstrumentsRoute'; } -class SettingsRoute extends _i1.PageRouteInfo { +/// generated route for [_i9.SettingsPage] +class SettingsRoute extends _i10.PageRouteInfo { const SettingsRoute() : super(name, path: '/settings-page'); static const String name = 'SettingsRoute'; diff --git a/lib/song_checker.dart b/lib/song_checker.dart index e2e10690..586923b1 100644 --- a/lib/song_checker.dart +++ b/lib/song_checker.dart @@ -69,7 +69,7 @@ void main() { var unitDuration = 0; final durations = groupByDurationToPrevious.keys.iterator; var tick2Second = - tickToSecond(midiFile.header.ticksPerBeat, song['bpm'] as int); + tickToSecond(midiFile.header.ticksPerBeat!, song['bpm'] as int); const minimumSingleTileSeconds = 0.25; // 4 touches per second, slow enough to click continuously while (singleTileSeconds < minimumSingleTileSeconds && @@ -89,7 +89,7 @@ void main() { Logger.root.info('Reduce bpm to $newBpm'); song['bpm'] = newBpm; tick2Second = - tickToSecond(midiFile.header.ticksPerBeat, song['bpm'] as int); + tickToSecond(midiFile.header.ticksPerBeat!, song['bpm'] as int); } final speedDpsPerTick = unitDurationHeight / unitDuration; final speedDpsPerSecond = speedDpsPerTick / tick2Second; diff --git a/lib/songs/song.freezed.dart b/lib/songs/song.freezed.dart index 8347a9b6..7a417ff9 100644 --- a/lib/songs/song.freezed.dart +++ b/lib/songs/song.freezed.dart @@ -44,7 +44,7 @@ class _$SongTearOff { ); } - Song fromJson(Map json) { + Song fromJson(Map json) { return Song.fromJson(json); } } @@ -268,42 +268,33 @@ class _$_Song implements _Song { @override bool operator ==(dynamic other) { return identical(this, other) || - (other is _Song && - (identical(other.id, id) || - const DeepCollectionEquality().equals(other.id, id)) && - (identical(other.title, title) || - const DeepCollectionEquality().equals(other.title, title)) && - (identical(other.artist, artist) || - const DeepCollectionEquality().equals(other.artist, artist)) && - (identical(other.url, url) || - const DeepCollectionEquality().equals(other.url, url)) && - (identical(other.bpm, bpm) || - const DeepCollectionEquality().equals(other.bpm, bpm)) && + (other.runtimeType == runtimeType && + other is _Song && + (identical(other.id, id) || other.id == id) && + (identical(other.title, title) || other.title == title) && + (identical(other.artist, artist) || other.artist == artist) && + (identical(other.url, url) || other.url == url) && + (identical(other.bpm, bpm) || other.bpm == bpm) && (identical(other.unitDuration, unitDuration) || - const DeepCollectionEquality() - .equals(other.unitDuration, unitDuration)) && - (identical(other.tilesCount, tilesCount) || - const DeepCollectionEquality() - .equals(other.tilesCount, tilesCount)) && - (identical(other.duration, duration) || - const DeepCollectionEquality() - .equals(other.duration, duration)) && - (identical(other.tags, tags) || - const DeepCollectionEquality().equals(other.tags, tags))); + other.unitDuration == unitDuration) && + const DeepCollectionEquality() + .equals(other.tilesCount, tilesCount) && + const DeepCollectionEquality().equals(other.duration, duration) && + const DeepCollectionEquality().equals(other.tags, tags)); } @override - int get hashCode => - runtimeType.hashCode ^ - const DeepCollectionEquality().hash(id) ^ - const DeepCollectionEquality().hash(title) ^ - const DeepCollectionEquality().hash(artist) ^ - const DeepCollectionEquality().hash(url) ^ - const DeepCollectionEquality().hash(bpm) ^ - const DeepCollectionEquality().hash(unitDuration) ^ - const DeepCollectionEquality().hash(tilesCount) ^ - const DeepCollectionEquality().hash(duration) ^ - const DeepCollectionEquality().hash(tags); + int get hashCode => Object.hash( + runtimeType, + id, + title, + artist, + url, + bpm, + unitDuration, + const DeepCollectionEquality().hash(tilesCount), + const DeepCollectionEquality().hash(duration), + const DeepCollectionEquality().hash(tags)); @JsonKey(ignore: true) @override @@ -331,23 +322,23 @@ abstract class _Song implements Song { factory _Song.fromJson(Map json) = _$_Song.fromJson; @override - String get id => throw _privateConstructorUsedError; + String get id; @override - String get title => throw _privateConstructorUsedError; + String get title; @override - String get artist => throw _privateConstructorUsedError; + String get artist; @override - String get url => throw _privateConstructorUsedError; + String get url; @override - int get bpm => throw _privateConstructorUsedError; + int get bpm; @override - int get unitDuration => throw _privateConstructorUsedError; + int get unitDuration; @override - List get tilesCount => throw _privateConstructorUsedError; + List get tilesCount; @override - List get duration => throw _privateConstructorUsedError; + List get duration; @override - List get tags => throw _privateConstructorUsedError; + List get tags; @override @JsonKey(ignore: true) _$SongCopyWith<_Song> get copyWith => throw _privateConstructorUsedError; diff --git a/lib/songs/songs_controller.dart b/lib/songs/songs_controller.dart index 07fbb40d..8991bfee 100644 --- a/lib/songs/songs_controller.dart +++ b/lib/songs/songs_controller.dart @@ -39,12 +39,12 @@ class SongsController extends StateNotifier>> { _read(isLoadingNextPageByTagProvider(_tag)).state = true; final titleStart = state.when( data: (songs) => songs.isEmpty ? '' : songs.last.title, - loading: () => '', - error: (_, __) => ''); + loading: (_) => '', + error: (_, __, ___) => ''); final loadedSongs = state.when( data: (songs) => songs, - loading: () => [], - error: (_, __) => []); + loading: (_) => [], + error: (_, __, ___) => []); final songs = await _read(songRepositoryProvider) .getSongsByTag(_tag, titleStart, 20); _read(isLoadingNextPageByTagProvider(_tag)).state = false; diff --git a/lib/songs/songs_widget.dart b/lib/songs/songs_widget.dart index 389f3ed7..f3834615 100644 --- a/lib/songs/songs_widget.dart +++ b/lib/songs/songs_widget.dart @@ -71,7 +71,7 @@ class SongsWidget extends ConsumerWidget { ) ], ), - loading: () => const LoadingWidget(), - error: (_, __) => const LoadingWidget()); + loading: (_) => const LoadingWidget(), + error: (_, __, ___) => const LoadingWidget()); } } diff --git a/lib/user/user.freezed.dart b/lib/user/user.freezed.dart index e33d12d9..932e1d40 100644 --- a/lib/user/user.freezed.dart +++ b/lib/user/user.freezed.dart @@ -44,7 +44,7 @@ class _$UserTearOff { ); } - User fromJson(Map json) { + User fromJson(Map json) { return User.fromJson(json); } } @@ -270,45 +270,28 @@ class _$_User implements _User { @override bool operator ==(dynamic other) { return identical(this, other) || - (other is _User && - (identical(other.id, id) || - const DeepCollectionEquality().equals(other.id, id)) && + (other.runtimeType == runtimeType && + other is _User && + (identical(other.id, id) || other.id == id) && (identical(other.playedNotes, playedNotes) || - const DeepCollectionEquality() - .equals(other.playedNotes, playedNotes)) && - (identical(other.stars, stars) || - const DeepCollectionEquality().equals(other.stars, stars)) && + other.playedNotes == playedNotes) && + (identical(other.stars, stars) || other.stars == stars) && (identical(other.playedTime, playedTime) || - const DeepCollectionEquality() - .equals(other.playedTime, playedTime)) && + other.playedTime == playedTime) && (identical(other.instrumentId, instrumentId) || - const DeepCollectionEquality() - .equals(other.instrumentId, instrumentId)) && - (identical(other.name, name) || - const DeepCollectionEquality().equals(other.name, name)) && + other.instrumentId == instrumentId) && + (identical(other.name, name) || other.name == name) && (identical(other.photoUrl, photoUrl) || - const DeepCollectionEquality() - .equals(other.photoUrl, photoUrl)) && + other.photoUrl == photoUrl) && (identical(other.anonymous, anonymous) || - const DeepCollectionEquality() - .equals(other.anonymous, anonymous)) && + other.anonymous == anonymous) && (identical(other.creationTime, creationTime) || - const DeepCollectionEquality() - .equals(other.creationTime, creationTime))); + other.creationTime == creationTime)); } @override - int get hashCode => - runtimeType.hashCode ^ - const DeepCollectionEquality().hash(id) ^ - const DeepCollectionEquality().hash(playedNotes) ^ - const DeepCollectionEquality().hash(stars) ^ - const DeepCollectionEquality().hash(playedTime) ^ - const DeepCollectionEquality().hash(instrumentId) ^ - const DeepCollectionEquality().hash(name) ^ - const DeepCollectionEquality().hash(photoUrl) ^ - const DeepCollectionEquality().hash(anonymous) ^ - const DeepCollectionEquality().hash(creationTime); + int get hashCode => Object.hash(runtimeType, id, playedNotes, stars, + playedTime, instrumentId, name, photoUrl, anonymous, creationTime); @JsonKey(ignore: true) @override @@ -336,24 +319,24 @@ abstract class _User implements User { factory _User.fromJson(Map json) = _$_User.fromJson; @override - String get id => throw _privateConstructorUsedError; + String get id; @override - int get playedNotes => throw _privateConstructorUsedError; + int get playedNotes; @override - int get stars => throw _privateConstructorUsedError; + int get stars; @override - Duration get playedTime => throw _privateConstructorUsedError; + Duration get playedTime; @override - String get instrumentId => throw _privateConstructorUsedError; + String get instrumentId; @override - String get name => throw _privateConstructorUsedError; + String get name; @override - String get photoUrl => throw _privateConstructorUsedError; + String get photoUrl; @override - bool get anonymous => throw _privateConstructorUsedError; + bool get anonymous; @override @TimestampConverter() - DateTime get creationTime => throw _privateConstructorUsedError; + DateTime get creationTime; @override @JsonKey(ignore: true) _$UserCopyWith<_User> get copyWith => throw _privateConstructorUsedError; diff --git a/lib/user/user_controller.dart b/lib/user/user_controller.dart index 6ded4021..790a0e59 100644 --- a/lib/user/user_controller.dart +++ b/lib/user/user_controller.dart @@ -27,7 +27,7 @@ class UserController extends StateNotifier> { state = AsyncValue.data(user); }); } else { - state = AsyncValue.error('Unauthenticated'); + state = const AsyncValue.error('Unauthenticated'); } } } diff --git a/lib/user/user_page.dart b/lib/user/user_page.dart index 3722145f..5cd1a33a 100644 --- a/lib/user/user_page.dart +++ b/lib/user/user_page.dart @@ -30,8 +30,8 @@ class UserPage extends StatelessWidget { child: SingleChildScrollView( child: _buildUI(user, context)))); }, - loading: () => const LoadingWidget(), - error: (_, __) => const LoadingWidget()); + loading: (_) => const LoadingWidget(), + error: (_, __, ___) => const LoadingWidget()); })); } diff --git a/pubspec.lock b/pubspec.lock index 7ae3cc2b..e495719d 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -7,21 +7,21 @@ packages: name: _fe_analyzer_shared url: "https://pub.dartlang.org" source: hosted - version: "26.0.0" + version: "29.0.0" analyzer: dependency: transitive description: name: analyzer url: "https://pub.dartlang.org" source: hosted - version: "2.3.0" + version: "2.6.0" archive: dependency: transitive description: name: archive url: "https://pub.dartlang.org" source: hosted - version: "3.1.2" + version: "3.1.6" args: dependency: transitive description: @@ -42,21 +42,21 @@ packages: name: auto_route url: "https://pub.dartlang.org" source: hosted - version: "2.4.0" + version: "3.0.1" auto_route_generator: dependency: "direct dev" description: name: auto_route_generator url: "https://pub.dartlang.org" source: hosted - version: "2.4.0" + version: "3.0.1" build: dependency: transitive description: name: build url: "https://pub.dartlang.org" source: hosted - version: "2.1.0" + version: "2.1.1" build_config: dependency: transitive description: @@ -70,7 +70,7 @@ packages: name: build_daemon url: "https://pub.dartlang.org" source: hosted - version: "3.0.0" + version: "3.0.1" build_resolvers: dependency: transitive description: @@ -84,14 +84,14 @@ packages: name: build_runner url: "https://pub.dartlang.org" source: hosted - version: "2.1.2" + version: "2.1.4" build_runner_core: dependency: transitive description: name: build_runner_core url: "https://pub.dartlang.org" source: hosted - version: "7.1.0" + version: "7.2.2" built_collection: dependency: transitive description: @@ -133,7 +133,7 @@ packages: name: cli_util url: "https://pub.dartlang.org" source: hosted - version: "0.3.3" + version: "0.3.5" clock: dependency: transitive description: @@ -154,35 +154,35 @@ packages: name: cloud_firestore_platform_interface url: "https://pub.dartlang.org" source: hosted - version: "5.4.1" + version: "5.4.2" cloud_firestore_web: dependency: transitive description: name: cloud_firestore_web url: "https://pub.dartlang.org" source: hosted - version: "2.4.2" + version: "2.4.3" cloud_functions: dependency: "direct main" description: name: cloud_functions url: "https://pub.dartlang.org" source: hosted - version: "3.0.3" + version: "3.0.4" cloud_functions_platform_interface: dependency: transitive description: name: cloud_functions_platform_interface url: "https://pub.dartlang.org" source: hosted - version: "5.0.10" + version: "5.0.11" cloud_functions_web: dependency: transitive description: name: cloud_functions_web url: "https://pub.dartlang.org" source: hosted - version: "4.0.12" + version: "4.0.13" code_builder: dependency: transitive description: @@ -216,8 +216,8 @@ packages: description: path: "." ref: HEAD - resolved-ref: "3d2b4094e8d0630a9d051bc9f270d3a812d0d50e" - url: "https://github.com/cuong0993/dart_midi" + resolved-ref: d1c0233ff4fc27e21c3ada8cad6d4933322df00e + url: "https://github.com/feelfreelinux/dart_midi" source: git version: "1.0.1" dart_style: @@ -226,7 +226,7 @@ packages: name: dart_style url: "https://pub.dartlang.org" source: hosted - version: "2.1.0" + version: "2.2.0" device_info: dependency: "direct main" description: @@ -261,28 +261,28 @@ packages: name: firebase_auth url: "https://pub.dartlang.org" source: hosted - version: "3.1.1" + version: "3.1.3" firebase_auth_platform_interface: dependency: transitive description: name: firebase_auth_platform_interface url: "https://pub.dartlang.org" source: hosted - version: "6.1.0" + version: "6.1.1" firebase_auth_web: dependency: transitive description: name: firebase_auth_web url: "https://pub.dartlang.org" source: hosted - version: "3.1.0" + version: "3.1.2" firebase_core: dependency: "direct main" description: name: firebase_core url: "https://pub.dartlang.org" source: hosted - version: "1.6.0" + version: "1.7.0" firebase_core_platform_interface: dependency: transitive description: @@ -303,35 +303,35 @@ packages: name: firebase_crashlytics url: "https://pub.dartlang.org" source: hosted - version: "2.2.1" + version: "2.2.3" firebase_crashlytics_platform_interface: dependency: transitive description: name: firebase_crashlytics_platform_interface url: "https://pub.dartlang.org" source: hosted - version: "3.1.2" + version: "3.1.3" firebase_storage: dependency: "direct main" description: name: firebase_storage url: "https://pub.dartlang.org" source: hosted - version: "10.0.3" + version: "10.0.5" firebase_storage_platform_interface: dependency: transitive description: name: firebase_storage_platform_interface url: "https://pub.dartlang.org" source: hosted - version: "4.0.2" + version: "4.0.3" firebase_storage_web: dependency: transitive description: name: firebase_storage_web url: "https://pub.dartlang.org" source: hosted - version: "3.0.2" + version: "3.0.3" fixnum: dependency: transitive description: @@ -345,7 +345,7 @@ packages: name: flame url: "https://pub.dartlang.org" source: hosted - version: "1.0.0-releasecandidate.14" + version: "1.0.0-releasecandidate.15" flutter: dependency: "direct main" description: flutter @@ -371,7 +371,7 @@ packages: name: flutter_facebook_auth url: "https://pub.dartlang.org" source: hosted - version: "3.5.1" + version: "3.5.2" flutter_facebook_auth_platform_interface: dependency: transitive description: @@ -425,14 +425,14 @@ packages: name: flutter_native_splash url: "https://pub.dartlang.org" source: hosted - version: "1.2.3" + version: "1.2.4" flutter_riverpod: dependency: "direct main" description: name: flutter_riverpod url: "https://pub.dartlang.org" source: hosted - version: "1.0.0-dev.7" + version: "1.0.0-dev.11" flutter_web_plugins: dependency: transitive description: flutter @@ -444,14 +444,14 @@ packages: name: freezed url: "https://pub.dartlang.org" source: hosted - version: "0.14.5" + version: "0.15.0+1" freezed_annotation: dependency: "direct main" description: name: freezed_annotation url: "https://pub.dartlang.org" source: hosted - version: "0.14.3" + version: "0.15.0" frontend_server_client: dependency: transitive description: @@ -465,21 +465,21 @@ packages: name: glob url: "https://pub.dartlang.org" source: hosted - version: "2.0.1" + version: "2.0.2" google_sign_in: dependency: "direct main" description: name: google_sign_in url: "https://pub.dartlang.org" source: hosted - version: "5.1.0" + version: "5.1.1" google_sign_in_platform_interface: dependency: transitive description: name: google_sign_in_platform_interface url: "https://pub.dartlang.org" source: hosted - version: "2.0.1" + version: "2.1.0" google_sign_in_web: dependency: transitive description: @@ -500,14 +500,14 @@ packages: name: hooks_riverpod url: "https://pub.dartlang.org" source: hosted - version: "1.0.0-dev.7" + version: "1.0.0-dev.11" http: dependency: transitive description: name: http url: "https://pub.dartlang.org" source: hosted - version: "0.13.3" + version: "0.13.4" http_multi_server: dependency: transitive description: @@ -528,7 +528,7 @@ packages: name: image url: "https://pub.dartlang.org" source: hosted - version: "3.0.4" + version: "3.0.8" in_app_review: dependency: "direct main" description: @@ -565,19 +565,19 @@ packages: source: hosted version: "0.6.3" json_annotation: - dependency: transitive + dependency: "direct main" description: name: json_annotation url: "https://pub.dartlang.org" source: hosted - version: "4.1.0" + version: "4.3.0" json_serializable: dependency: "direct dev" description: name: json_serializable url: "https://pub.dartlang.org" source: hosted - version: "5.0.1" + version: "6.0.0" lints: dependency: transitive description: @@ -612,14 +612,14 @@ packages: name: mime url: "https://pub.dartlang.org" source: hosted - version: "1.0.0" + version: "1.0.1" ordered_set: dependency: transitive description: name: ordered_set url: "https://pub.dartlang.org" source: hosted - version: "3.2.0" + version: "4.0.0" package_config: dependency: transitive description: @@ -689,7 +689,7 @@ packages: name: petitparser url: "https://pub.dartlang.org" source: hosted - version: "4.3.0" + version: "4.4.0" platform: dependency: transitive description: @@ -703,7 +703,7 @@ packages: name: plugin_platform_interface url: "https://pub.dartlang.org" source: hosted - version: "2.0.1" + version: "2.0.2" pool: dependency: transitive description: @@ -717,7 +717,7 @@ packages: name: process url: "https://pub.dartlang.org" source: hosted - version: "4.2.3" + version: "4.2.4" pub_semver: dependency: transitive description: @@ -738,14 +738,14 @@ packages: name: quiver url: "https://pub.dartlang.org" source: hosted - version: "3.0.1" + version: "3.0.1+1" riverpod: dependency: transitive description: name: riverpod url: "https://pub.dartlang.org" source: hosted - version: "1.0.0-dev.7" + version: "1.0.0-dev.10" rxdart: dependency: transitive description: @@ -820,14 +820,14 @@ packages: name: source_gen url: "https://pub.dartlang.org" source: hosted - version: "1.1.0" + version: "1.1.1" source_helper: dependency: transitive description: name: source_helper url: "https://pub.dartlang.org" source: hosted - version: "1.2.1" + version: "1.3.0" source_span: dependency: transitive description: @@ -932,7 +932,7 @@ packages: name: url_launcher url: "https://pub.dartlang.org" source: hosted - version: "6.0.11" + version: "6.0.12" url_launcher_linux: dependency: transitive description: @@ -974,7 +974,7 @@ packages: name: uuid url: "https://pub.dartlang.org" source: hosted - version: "3.0.4" + version: "3.0.5" vector_math: dependency: transitive description: @@ -988,7 +988,7 @@ packages: name: watcher url: "https://pub.dartlang.org" source: hosted - version: "1.0.0" + version: "1.0.1" web_socket_channel: dependency: transitive description: @@ -1016,7 +1016,7 @@ packages: name: xml url: "https://pub.dartlang.org" source: hosted - version: "5.3.0" + version: "5.3.1" yaml: dependency: transitive description: diff --git a/pubspec.yaml b/pubspec.yaml index f68a6faa..5d75bb56 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -8,43 +8,44 @@ dependencies: sdk: flutter flutter_localizations: sdk: flutter - auto_route: null - cloud_firestore: null - cloud_functions: null - collection: null + auto_route: any + cloud_firestore: any + cloud_functions: any + collection: any dart_midi: git: - url: 'https://github.com/cuong0993/dart_midi' - device_info: null - firebase_auth: null - firebase_core: null - firebase_crashlytics: null - firebase_storage: null - flame: null - flutter_cache_manager: null - flutter_email_sender: null - flutter_facebook_auth: null - flutter_hooks: null + url: 'https://github.com/feelfreelinux/dart_midi' + device_info: any + firebase_auth: any + firebase_core: any + firebase_crashlytics: any + firebase_storage: any + flame: any + flutter_cache_manager: any + flutter_email_sender: any + flutter_facebook_auth: any + flutter_hooks: any flutter_riverpod: ^1.0.0-dev.6 - freezed_annotation: null - google_sign_in: null + freezed_annotation: any + google_sign_in: any hooks_riverpod: ^1.0.0-dev.6 - in_app_review: null - intl: null - logging: null - package_info: null - shared_preferences: null - sprintf: null + in_app_review: any + intl: any + json_annotation: any + logging: any + package_info: any + shared_preferences: any + sprintf: any dev_dependencies: - auto_route_generator: null - build_runner: null - flutter_launcher_icons: null - flutter_flavorizr: null - flutter_lints: null - flutter_native_splash: null - freezed: null - json_serializable: null + auto_route_generator: any + build_runner: any + flutter_launcher_icons: any + flutter_flavorizr: any + flutter_lints: any + flutter_native_splash: any + freezed: any + json_serializable: any flutter_icons: image_path_android: assets/blank.png