Force dark theme in scanner and keep chrome.

This commit is contained in:
Dain Nilsson 2022-09-15 15:06:56 +02:00
parent 4584a48621
commit 15198466b5
No known key found for this signature in database
GPG Key ID: F04367096FBA95E8
2 changed files with 3 additions and 10 deletions

View File

@ -2,6 +2,7 @@ import 'package:flutter/material.dart';
import 'package:flutter_riverpod/flutter_riverpod.dart';
import 'package:yubico_authenticator/app/state.dart';
import 'package:yubico_authenticator/cancellation_exception.dart';
import 'package:yubico_authenticator/theme.dart';
import 'qr_scanner_view.dart';
@ -13,7 +14,8 @@ class AndroidQrScanner implements QrScanner {
Future<String?> scanQr([String? _]) async {
var scannedCode = await _withContext(
(context) async => await Navigator.of(context).push(PageRouteBuilder(
pageBuilder: (_, __, ___) => const QrScannerView(),
pageBuilder: (_, __, ___) =>
Theme(data: AppTheme.darkTheme, child: const QrScannerView()),
transitionDuration: const Duration(seconds: 0),
reverseTransitionDuration: const Duration(seconds: 0),
)));

View File

@ -1,5 +1,4 @@
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:qrscanner_zxing/qrscanner_zxing_view.dart';
import '../../oath/models.dart';
@ -82,14 +81,6 @@ class _QrScannerViewState extends State<QrScannerView> {
void initState() {
super.initState();
_status = ScanStatus.scanning;
SystemChrome.setEnabledSystemUIMode(SystemUiMode.manual, overlays: []);
}
@override
void dispose() {
SystemChrome.setEnabledSystemUIMode(SystemUiMode.edgeToEdge,
overlays: SystemUiOverlay.values);
super.dispose();
}
@override