Keep system bar content usable under edge-to-edge
- Lift the QR scanner's torch and camera controls above the navigation bar instead of 16 px from the screen edge - Use light system bar icons on the black QR camera and received-image viewer, and keep Android's contrast scrim behind three-button navigation for any other dark route - Note that Flutter only applies edge-to-edge from Android 10
This commit is contained in:
1 parent
551bf128c6
commit
1d64399d42
3 files changed
+68
-54
No files matched your search
@@ -29,9 +29,8 @@
|
||||
/// with whoever implements export, not here.
|
||||
library;
|
||||
|
||||
import 'dart:typed_data';
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
|
||||
import '../services/received_image_store.dart';
|
||||
@@ -618,36 +617,41 @@ class _ReceivedImageViewer extends StatelessWidget {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
backgroundColor: Colors.black,
|
||||
appBar: AppBar(
|
||||
// Light system bar icons over the black viewer, whatever the app theme.
|
||||
return AnnotatedRegion<SystemUiOverlayStyle>(
|
||||
value: SystemUiOverlayStyle.light,
|
||||
child: Scaffold(
|
||||
backgroundColor: Colors.black,
|
||||
foregroundColor: Colors.white,
|
||||
),
|
||||
body: Center(
|
||||
child: Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
Flexible(
|
||||
child: Stack(
|
||||
children: [
|
||||
InteractiveViewer(child: Image.memory(png)),
|
||||
if (synthesized)
|
||||
const Positioned(
|
||||
left: 0,
|
||||
right: 0,
|
||||
bottom: 0,
|
||||
child: _SyntheticBanner(),
|
||||
),
|
||||
],
|
||||
appBar: AppBar(
|
||||
backgroundColor: Colors.black,
|
||||
foregroundColor: Colors.white,
|
||||
systemOverlayStyle: SystemUiOverlayStyle.light,
|
||||
),
|
||||
body: Center(
|
||||
child: Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
Flexible(
|
||||
child: Stack(
|
||||
children: [
|
||||
InteractiveViewer(child: Image.memory(png)),
|
||||
if (synthesized)
|
||||
const Positioned(
|
||||
left: 0,
|
||||
right: 0,
|
||||
bottom: 0,
|
||||
child: _SyntheticBanner(),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
if (synthesized)
|
||||
Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 16),
|
||||
child: _SyntheticCaption(bytes: bytes, onDark: true),
|
||||
),
|
||||
],
|
||||
if (synthesized)
|
||||
Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 16),
|
||||
child: _SyntheticCaption(bytes: bytes, onDark: true),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
|
||||
Reference in new issue
Block a user