Skip to content

Add Android CI, rename package to red.dark.mpv_remote, update to Flutter 3/Dart 3#9

Draft
Copilot wants to merge 10 commits intomasterfrom
copilot/add-ci-for-android-app
Draft

Add Android CI, rename package to red.dark.mpv_remote, update to Flutter 3/Dart 3#9
Copilot wants to merge 10 commits intomasterfrom
copilot/add-ci-for-android-app

Conversation

Copy link
Copy Markdown

Copilot AI commented Apr 5, 2026

(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)

  • Update flutter build apk --debugflutter build apk --release in the workflow
  • Update the upload artifact step to reference app-release.apk and rename artifact to release-apk

Copilot AI and others added 2 commits April 5, 2026 17:18
Copilot AI changed the title [WIP] Add CI to build Android app and update package name Add Android CI, rename package to red.dark.mpv_remote, update to Flutter 3/Dart 3 Apr 5, 2026
Copilot AI requested a review from darkwater April 5, 2026 17:27
@darkwater darkwater requested a review from Copilot April 5, 2026 17:34
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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_preferences with an internal prefs.dart shim.
  • 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.

Comment thread pubspec.yaml
Comment on lines 29 to +37
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
Copy link

Copilot AI Apr 5, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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).

Copilot uses AI. Check for mistakes.
Comment thread lib/prefs.dart
} else if (value is double) {
await _prefs.setDouble(_key, value);
} else if (value is String) {
await _prefs.setString(_key, value);
Copy link

Copilot AI Apr 5, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Suggested change
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.',
);

Copilot uses AI. Check for mistakes.
Comment thread lib/preferences.dart
Comment on lines 11 to 21
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);
}
Copy link

Copilot AI Apr 5, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copilot uses AI. Check for mistakes.
…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>
Copilot AI and others added 3 commits April 5, 2026 18:02
… 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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants