Add Android CI, rename package to red.dark.mpv_remote, update to Flutter 3/Dart 3#9
Add Android CI, rename package to red.dark.mpv_remote, update to Flutter 3/Dart 3#9
Conversation
…g_shared_preferences Agent-Logs-Url: https://github.com/darkwater/mpv_remote/sessions/a822ad09-83db-4a58-8fd8-c7aef4098ac6 Co-authored-by: darkwater <1228306+darkwater@users.noreply.github.com>
Agent-Logs-Url: https://github.com/darkwater/mpv_remote/sessions/a822ad09-83db-4a58-8fd8-c7aef4098ac6 Co-authored-by: darkwater <1228306+darkwater@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
Modernizes the Flutter app for Dart 3 / current dependencies, fixes practical Android support (including package rename + INTERNET permission), and adds an Android CI workflow that builds an APK artifact.
Changes:
- Bumped SDK constraint to Dart 3 and upgraded dependencies; replaced
streaming_shared_preferenceswith an internalprefs.dartshim. - Updated Android project tooling/config (Gradle/AGP/Kotlin, SDK levels, package/namespace rename, INTERNET permission).
- Added GitHub Actions workflow to analyze and build a debug Android APK.
Reviewed changes
Copilot reviewed 14 out of 15 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| pubspec.yaml | Updates SDK constraint and dependency set for Dart 3/Flutter 3 compatibility. |
| pubspec.lock | Removed lockfile (impacts reproducibility). |
| lib/widgets/remote_status_indicator.dart | Migrates deprecated errorColor usage to colorScheme.error. |
| lib/prefs.dart | Adds internal preferences implementation (BehaviorSubject + SharedPreferences) replacing streaming_shared_preferences. |
| lib/preferences.dart | Switches preferences to single shared instances initialized in init(). |
| lib/pages/remotes/remotes.dart | Updates prefs import and migrates deprecated errorColor usage. |
| lib/pages/home/controls/second_half.dart | Updates prefs import to new internal implementation. |
| android/gradle/wrapper/gradle-wrapper.properties | Upgrades Gradle wrapper. |
| android/build.gradle | Upgrades Kotlin and Android Gradle Plugin versions. |
| android/app/build.gradle | Sets namespace/applicationId, updates SDK levels for modern Android toolchain. |
| android/app/src/profile/AndroidManifest.xml | Renames Android package. |
| android/app/src/main/AndroidManifest.xml | Renames Android package and adds INTERNET permission. |
| android/app/src/debug/AndroidManifest.xml | Renames Android package. |
| android/app/src/main/kotlin/red/dark/mpv_remote/MainActivity.kt | Moves MainActivity to renamed package. |
| .github/workflows/android.yml | Adds Android CI workflow to analyze and build/upload a debug APK. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| dependencies: | ||
| flutter: | ||
| sdk: flutter | ||
|
|
||
| dartssh2: ^2.4.4 | ||
| flutter_secure_storage: ^5.0.2 | ||
| provider: ^6.0.2 | ||
| rxdart: ^0.27.3 | ||
| streaming_shared_preferences: ^2.0.0 | ||
| dartssh2: ^2.9.0 | ||
| flutter_secure_storage: ^9.2.2 | ||
| provider: ^6.1.2 | ||
| rxdart: ^0.28.0 | ||
| shared_preferences: ^2.3.0 |
There was a problem hiding this comment.
pubspec.lock is no longer present in the repo. For a Flutter application (as opposed to a library), committing pubspec.lock is generally expected to keep CI/builds reproducible. Please regenerate and commit the updated lockfile (or, if you intentionally want it untracked, add it to .gitignore and document that decision).
| } else if (value is double) { | ||
| await _prefs.setDouble(_key, value); | ||
| } else if (value is String) { | ||
| await _prefs.setString(_key, value); |
There was a problem hiding this comment.
setValue silently does nothing for unsupported non-adapter types (neither persists to SharedPreferences nor reports an error), but still publishes the value to the stream. This can leave the app thinking a preference was saved when it wasn’t. Consider throwing an UnsupportedError (or asserting) when the value type isn’t one of the supported primitives and no JsonAdapter is provided.
| await _prefs.setString(_key, value); | |
| await _prefs.setString(_key, value); | |
| } else { | |
| throw UnsupportedError( | |
| 'Unsupported preference value type ${value.runtimeType} for key "$_key". ' | |
| 'Use bool, int, double, or String, or provide a JsonAdapter.', | |
| ); |
| static Future<void> init() async { | ||
| _prefs = await StreamingSharedPreferences.instance; | ||
| } | ||
|
|
||
| static Preference<List<RemoteConnection>> get remoteConnections { | ||
| return _prefs.getCustomValue( | ||
| remoteConnections = _prefs.getCustomValue( | ||
| "remoteConnections", | ||
| defaultValue: [], | ||
| adapter: _remoteConnectionAdapter, | ||
| ); | ||
| } | ||
|
|
||
| static Preference<bool> get showPercentPos { | ||
| return _prefs.getBool("showPercentPos", defaultValue: true); | ||
| } | ||
|
|
||
| static Preference<bool> get showRemainingTime { | ||
| return _prefs.getBool("showRemainingTime", defaultValue: true); | ||
| showPercentPos = _prefs.getBool("showPercentPos", defaultValue: true); | ||
| showRemainingTime = | ||
| _prefs.getBool("showRemainingTime", defaultValue: true); | ||
| } |
There was a problem hiding this comment.
Preferences.init() now assigns late final fields (remoteConnections, showPercentPos, showRemainingTime). If init() is ever called more than once (e.g., in tests, app reinitialization flows, or hot-restart-like scenarios), it will throw on the second call due to reinitializing late finals. Consider making init() idempotent (early-return if already initialized) or documenting/enforcing single-invocation explicitly.
…en pubspec.lock, fix removed TextTheme getters Agent-Logs-Url: https://github.com/darkwater/mpv_remote/sessions/0393412b-593f-409b-9073-9e3f37e8cd76 Co-authored-by: darkwater <1228306+darkwater@users.noreply.github.com>
Agent-Logs-Url: https://github.com/darkwater/mpv_remote/sessions/881b380d-6272-4d9d-8961-da1639e573b5 Co-authored-by: darkwater <1228306+darkwater@users.noreply.github.com>
… 8.2.2/Gradle 8.4/compileSdk 35 Agent-Logs-Url: https://github.com/darkwater/mpv_remote/sessions/881b380d-6272-4d9d-8961-da1639e573b5 Co-authored-by: darkwater <1228306+darkwater@users.noreply.github.com>
Agent-Logs-Url: https://github.com/darkwater/mpv_remote/sessions/881b380d-6272-4d9d-8961-da1639e573b5 Co-authored-by: darkwater <1228306+darkwater@users.noreply.github.com>
…Sdk 35→36 Agent-Logs-Url: https://github.com/darkwater/mpv_remote/sessions/d01ce465-abec-40a2-bb7e-4affda56ede1 Co-authored-by: darkwater <1228306+darkwater@users.noreply.github.com>
… version, restore INTERNET permission Agent-Logs-Url: https://github.com/darkwater/mpv_remote/sessions/7bdc2632-4899-46ce-ba36-bde6a20337a2 Co-authored-by: darkwater <1228306+darkwater@users.noreply.github.com>
Agent-Logs-Url: https://github.com/darkwater/mpv_remote/sessions/751d8d9a-efe9-4917-9660-0f9fabd653b2 Co-authored-by: darkwater <1228306+darkwater@users.noreply.github.com>
(author's note: i just quickly wanted an apk and only had access to my phone, if i'm merging anything it's more likely gonna be the other PRs + copying and modifying the github actions workflow from here)
flutter build apk --debug→flutter build apk --releasein the workflowapp-release.apkand rename artifact torelease-apk