Merge pull request #587 from zjs81/fix/play-console-android-warnings
Enable edge-to-edge on all Android versions and upgrade packages
This commit is contained in:
4 files changed
+83
-63
No files matched your search
+15
-5
@@ -49,6 +49,13 @@ void main() async {
|
|||||||
debugPrint = (String? message, {int? wrapWidth}) {};
|
debugPrint = (String? message, {int? wrapWidth}) {};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Android 15+ forces edge-to-edge for apps targeting SDK 35; opt Android
|
||||||
|
// 10-14 in too so they lay out the same way under the bars. Flutter ignores
|
||||||
|
// this mode before Android 10, where the old layout remains.
|
||||||
|
if (PlatformInfo.isAndroid) {
|
||||||
|
await SystemChrome.setEnabledSystemUIMode(SystemUiMode.edgeToEdge);
|
||||||
|
}
|
||||||
|
|
||||||
// Initialize SharedPreferences cache
|
// Initialize SharedPreferences cache
|
||||||
await PrefsManager.initialize();
|
await PrefsManager.initialize();
|
||||||
|
|
||||||
@@ -461,19 +468,22 @@ class _MeshCoreAppState extends State<MeshCoreApp> with WidgetsBindingObserver {
|
|||||||
|
|
||||||
SystemUiOverlayStyle _systemUiOverlayStyle(BuildContext context) {
|
SystemUiOverlayStyle _systemUiOverlayStyle(BuildContext context) {
|
||||||
final theme = Theme.of(context);
|
final theme = Theme.of(context);
|
||||||
final colorScheme = theme.colorScheme;
|
|
||||||
final isDark = theme.brightness == Brightness.dark;
|
final isDark = theme.brightness == Brightness.dark;
|
||||||
final iconBrightness = isDark ? Brightness.light : Brightness.dark;
|
final iconBrightness = isDark ? Brightness.light : Brightness.dark;
|
||||||
|
|
||||||
// Keep Android system bars aligned with the resolved Flutter theme.
|
// The app draws edge-to-edge, so both system bars stay transparent and
|
||||||
|
// their icon brightness follows the resolved Flutter theme. Contrast
|
||||||
|
// enforcement keeps a scrim behind three-button navigation in case a
|
||||||
|
// route paints a dark surface under light-theme icons; dark full-screen
|
||||||
|
// routes also set light icons themselves.
|
||||||
return SystemUiOverlayStyle(
|
return SystemUiOverlayStyle(
|
||||||
statusBarColor: Colors.transparent,
|
statusBarColor: Colors.transparent,
|
||||||
statusBarIconBrightness: iconBrightness,
|
statusBarIconBrightness: iconBrightness,
|
||||||
statusBarBrightness: isDark ? Brightness.dark : Brightness.light,
|
statusBarBrightness: isDark ? Brightness.dark : Brightness.light,
|
||||||
systemNavigationBarColor: colorScheme.surface,
|
systemNavigationBarColor: Colors.transparent,
|
||||||
systemNavigationBarIconBrightness: iconBrightness,
|
systemNavigationBarIconBrightness: iconBrightness,
|
||||||
systemNavigationBarDividerColor: colorScheme.surface,
|
systemNavigationBarDividerColor: Colors.transparent,
|
||||||
systemNavigationBarContrastEnforced: false,
|
systemNavigationBarContrastEnforced: true,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:flutter/services.dart';
|
||||||
import 'package:mobile_scanner/mobile_scanner.dart';
|
import 'package:mobile_scanner/mobile_scanner.dart';
|
||||||
|
|
||||||
/// A reusable QR code scanner widget that can be embedded anywhere.
|
/// A reusable QR code scanner widget that can be embedded anywhere.
|
||||||
@@ -150,28 +151,33 @@ class _QrScannerWidgetState extends State<QrScannerWidget>
|
|||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return Stack(
|
// The camera preview is dark, so keep the system bar icons light, and lift
|
||||||
children: [
|
// the controls above the navigation bar the app draws behind.
|
||||||
// Scanner view
|
return AnnotatedRegion<SystemUiOverlayStyle>(
|
||||||
MobileScanner(
|
value: SystemUiOverlayStyle.light,
|
||||||
controller: _controller,
|
child: Stack(
|
||||||
onDetect: _handleDetection,
|
children: [
|
||||||
errorBuilder: (context, error) {
|
// Scanner view
|
||||||
return _buildErrorWidget(context, error);
|
MobileScanner(
|
||||||
},
|
controller: _controller,
|
||||||
),
|
onDetect: _handleDetection,
|
||||||
|
errorBuilder: (context, error) {
|
||||||
|
return _buildErrorWidget(context, error);
|
||||||
|
},
|
||||||
|
),
|
||||||
|
|
||||||
// Overlay
|
// Overlay
|
||||||
widget.overlay ?? _buildDefaultOverlay(context),
|
widget.overlay ?? _buildDefaultOverlay(context),
|
||||||
|
|
||||||
// Control buttons
|
// Control buttons
|
||||||
Positioned(
|
Positioned(
|
||||||
bottom: 16,
|
bottom: 16 + MediaQuery.viewPaddingOf(context).bottom,
|
||||||
left: 0,
|
left: 0,
|
||||||
right: 0,
|
right: 0,
|
||||||
child: _buildControls(context),
|
child: _buildControls(context),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -29,9 +29,8 @@
|
|||||||
/// with whoever implements export, not here.
|
/// with whoever implements export, not here.
|
||||||
library;
|
library;
|
||||||
|
|
||||||
import 'dart:typed_data';
|
|
||||||
|
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:flutter/services.dart';
|
||||||
import 'package:provider/provider.dart';
|
import 'package:provider/provider.dart';
|
||||||
|
|
||||||
import '../services/received_image_store.dart';
|
import '../services/received_image_store.dart';
|
||||||
@@ -618,36 +617,41 @@ class _ReceivedImageViewer extends StatelessWidget {
|
|||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return Scaffold(
|
// Light system bar icons over the black viewer, whatever the app theme.
|
||||||
backgroundColor: Colors.black,
|
return AnnotatedRegion<SystemUiOverlayStyle>(
|
||||||
appBar: AppBar(
|
value: SystemUiOverlayStyle.light,
|
||||||
|
child: Scaffold(
|
||||||
backgroundColor: Colors.black,
|
backgroundColor: Colors.black,
|
||||||
foregroundColor: Colors.white,
|
appBar: AppBar(
|
||||||
),
|
backgroundColor: Colors.black,
|
||||||
body: Center(
|
foregroundColor: Colors.white,
|
||||||
child: Column(
|
systemOverlayStyle: SystemUiOverlayStyle.light,
|
||||||
mainAxisSize: MainAxisSize.min,
|
),
|
||||||
children: [
|
body: Center(
|
||||||
Flexible(
|
child: Column(
|
||||||
child: Stack(
|
mainAxisSize: MainAxisSize.min,
|
||||||
children: [
|
children: [
|
||||||
InteractiveViewer(child: Image.memory(png)),
|
Flexible(
|
||||||
if (synthesized)
|
child: Stack(
|
||||||
const Positioned(
|
children: [
|
||||||
left: 0,
|
InteractiveViewer(child: Image.memory(png)),
|
||||||
right: 0,
|
if (synthesized)
|
||||||
bottom: 0,
|
const Positioned(
|
||||||
child: _SyntheticBanner(),
|
left: 0,
|
||||||
),
|
right: 0,
|
||||||
],
|
bottom: 0,
|
||||||
|
child: _SyntheticBanner(),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
),
|
),
|
||||||
),
|
if (synthesized)
|
||||||
if (synthesized)
|
Padding(
|
||||||
Padding(
|
padding: const EdgeInsets.symmetric(horizontal: 16),
|
||||||
padding: const EdgeInsets.symmetric(horizontal: 16),
|
child: _SyntheticCaption(bytes: bytes, onDark: true),
|
||||||
child: _SyntheticCaption(bytes: bytes, onDark: true),
|
),
|
||||||
),
|
],
|
||||||
],
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
|||||||
+8
-8
@@ -37,7 +37,7 @@ dependencies:
|
|||||||
# The following adds the Cupertino Icons font to your application.
|
# The following adds the Cupertino Icons font to your application.
|
||||||
# Use with the CupertinoIcons class for iOS style icons.
|
# Use with the CupertinoIcons class for iOS style icons.
|
||||||
cupertino_icons: ^1.0.8
|
cupertino_icons: ^1.0.8
|
||||||
flutter_blue_plus: ^2.1.0
|
flutter_blue_plus: ^2.3.14
|
||||||
# TODO: Switch to official flserial repo once changes are upstreamed
|
# TODO: Switch to official flserial repo once changes are upstreamed
|
||||||
flserial:
|
flserial:
|
||||||
git:
|
git:
|
||||||
@@ -47,18 +47,18 @@ dependencies:
|
|||||||
provider: ^6.1.5+1
|
provider: ^6.1.5+1
|
||||||
shared_preferences: ^2.2.2
|
shared_preferences: ^2.2.2
|
||||||
uuid: ^4.3.3
|
uuid: ^4.3.3
|
||||||
flutter_map: ^8.2.2
|
flutter_map: ^8.3.2
|
||||||
latlong2: ^0.9.1
|
latlong2: ^0.9.1
|
||||||
flutter_local_notifications: ^22.0.0
|
flutter_local_notifications: ^22.3.1
|
||||||
crypto: ^3.0.3
|
crypto: ^3.0.3
|
||||||
pointycastle: ^4.0.0
|
pointycastle: ^4.0.0
|
||||||
http: ^1.2.0
|
http: ^1.2.0
|
||||||
cached_network_image: ^3.4.1
|
cached_network_image: ^3.4.1
|
||||||
flutter_cache_manager: ^3.4.1
|
flutter_cache_manager: ^3.4.5
|
||||||
flutter_foreground_task: ^9.2.0
|
flutter_foreground_task: ^9.2.0
|
||||||
characters: ^1.4.0
|
characters: ^1.4.0
|
||||||
package_info_plus: ^10.1.0
|
package_info_plus: ^10.2.2
|
||||||
mobile_scanner: ^7.1.4 # QR/barcode scanning
|
mobile_scanner: ^7.4.2 # QR/barcode scanning
|
||||||
image_picker: ^1.1.2 # Pick photos to send as compressed mesh images
|
image_picker: ^1.1.2 # Pick photos to send as compressed mesh images
|
||||||
qr_flutter: ^4.1.0 # QR code generation
|
qr_flutter: ^4.1.0 # QR code generation
|
||||||
url_launcher: ^6.3.0 # Launch URLs in system browser
|
url_launcher: ^6.3.0 # Launch URLs in system browser
|
||||||
@@ -66,7 +66,7 @@ dependencies:
|
|||||||
gpx: ^2.3.0
|
gpx: ^2.3.0
|
||||||
path_provider: ^2.1.5
|
path_provider: ^2.1.5
|
||||||
file_selector: ^1.0.3 # desktop save dialog for GPX export
|
file_selector: ^1.0.3 # desktop save dialog for GPX export
|
||||||
share_plus: ^13.1.0
|
share_plus: ^13.3.1
|
||||||
build_pipe: ^0.3.1
|
build_pipe: ^0.3.1
|
||||||
material_symbols_icons: ^4.2928.1
|
material_symbols_icons: ^4.2928.1
|
||||||
web: ^1.1.1
|
web: ^1.1.1
|
||||||
@@ -83,7 +83,7 @@ dependencies:
|
|||||||
# decoder (lib/services/image_codec_backend.dart). arm64-only on Android — see
|
# decoder (lib/services/image_codec_backend.dart). arm64-only on Android — see
|
||||||
# the abiFilters note in android/app/build.gradle.kts; a universal APK pays
|
# the abiFilters note in android/app/build.gradle.kts; a universal APK pays
|
||||||
# ~56 MB for ORT instead of ~18 MB.
|
# ~56 MB for ORT instead of ~18 MB.
|
||||||
flutter_onnxruntime: ^1.8.3
|
flutter_onnxruntime: ^1.9.0
|
||||||
base32: ^2.2.0
|
base32: ^2.2.0
|
||||||
|
|
||||||
hooks:
|
hooks:
|
||||||
|
|||||||
Reference in new issue
Block a user