Replace native Android AlertDialog with Flutter showDialog - #2
Replace native Android AlertDialog with Flutter showDialog#2MeowTechOpenSource with Copilot wants to merge 4 commits into
Conversation
Co-authored-by: MeowTechOpenSource <57005629+MeowTechOpenSource@users.noreply.github.com>
|
@copilot Add back the localozations from upstream. |
Co-authored-by: MeowTechOpenSource <57005629+MeowTechOpenSource@users.noreply.github.com>
Done in commit |
|
Add back zh different localozations by pulling from the upstream repo. @copilot |
Co-authored-by: MeowTechOpenSource <57005629+MeowTechOpenSource@users.noreply.github.com> Agent-Logs-Url: https://github.com/NovaMeowTech/FreeDroidWarn_Flutter/sessions/58bc5060-62f6-45da-804d-0e177b56e2e0
Done in commit |
The warning dialog was implemented in Java via a
MethodChannel, coupling the UI to the Android native layer. This moves all dialog logic to Dart using Flutter's built-inshowDialog, and ports all upstream localizations into a Flutter-native localization class.Changes
lib/free_droid_warn.dart: RemovedMethodChannel.showWarningOnUpgradenow accepts aBuildContextand renders a FlutterAlertDialogdirectly. Version tracking usesshared_preferences; URL launching usesurl_launcherwithcanLaunchUrlguard. Dialog strings are resolved from the device locale viaFreeDroidWarnLocalizations.of(context).lib/src/free_droid_warn_localizations.dart: New file containing all translations ported from the upstream Android XML string resources. Supports Arabic, Czech, German, Greek, English, Spanish, French, Hindi, Hungarian, Indonesian, Italian, Japanese, Korean, Dutch, Polish, Portuguese, Russian, Slovak, Swedish, Turkish, Chinese Simplified, and Chinese Traditional. Falls back to English for unsupported languages. Chinese variants are resolved byscriptCodefirst (Hans/Hant), then by country code (TW,HK,MO→ Traditional; all others → Simplified).pubspec.yaml: Addedshared_preferences: ^2.2.2andurl_launcher: ^6.2.0.android/.../FreeDroidWarnPlugin.java: Reduced to a no-opFlutterPluginstub — all dialog,SharedPreferences, andActivitylogic removed.example/lib/main.dart: Updated call sites to passBuildContextas the new first parameter.API change
🔒 GitHub Advanced Security automatically protects Copilot coding agent pull requests. You can protect all pull requests by enabling Advanced Security for your repositories. Learn more about Advanced Security.