mirror of
https://github.com/twonlyapp/twonly-app.git
synced 2026-01-15 13:08:42 +00:00
fix #350
Some checks are pending
Flutter analyze & test / flutter_analyze_and_test (push) Waiting to run
Some checks are pending
Flutter analyze & test / flutter_analyze_and_test (push) Waiting to run
This commit is contained in:
parent
11aa4c4202
commit
6dc9aa10bc
8 changed files with 41 additions and 5 deletions
|
|
@ -94,6 +94,7 @@ class _AppState extends State<App> with WidgetsBindingObserver {
|
||||||
listenable: context.watch<SettingsChangeProvider>(),
|
listenable: context.watch<SettingsChangeProvider>(),
|
||||||
builder: (BuildContext context, Widget? child) {
|
builder: (BuildContext context, Widget? child) {
|
||||||
return MaterialApp(
|
return MaterialApp(
|
||||||
|
scaffoldMessengerKey: globalRootScaffoldMessengerKey,
|
||||||
restorationScopeId: 'app',
|
restorationScopeId: 'app',
|
||||||
localizationsDelegates: const [
|
localizationsDelegates: const [
|
||||||
AppLocalizations.delegate,
|
AppLocalizations.delegate,
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,5 @@
|
||||||
import 'dart:ui';
|
|
||||||
|
|
||||||
import 'package:camera/camera.dart';
|
import 'package:camera/camera.dart';
|
||||||
|
import 'package:flutter/material.dart';
|
||||||
import 'package:twonly/src/database/twonly.db.dart';
|
import 'package:twonly/src/database/twonly.db.dart';
|
||||||
import 'package:twonly/src/model/json/userdata.dart';
|
import 'package:twonly/src/model/json/userdata.dart';
|
||||||
import 'package:twonly/src/services/api.service.dart';
|
import 'package:twonly/src/services/api.service.dart';
|
||||||
|
|
@ -37,3 +36,6 @@ bool globalAllowErrorTrackingViaSentry = false;
|
||||||
|
|
||||||
late String globalApplicationCacheDirectory;
|
late String globalApplicationCacheDirectory;
|
||||||
late String globalApplicationSupportDirectory;
|
late String globalApplicationSupportDirectory;
|
||||||
|
|
||||||
|
final GlobalKey<ScaffoldMessengerState> globalRootScaffoldMessengerKey =
|
||||||
|
GlobalKey<ScaffoldMessengerState>();
|
||||||
|
|
|
||||||
|
|
@ -458,5 +458,6 @@
|
||||||
"couldNotVerifyUsername": "{username} konnte nicht verifiziert werden",
|
"couldNotVerifyUsername": "{username} konnte nicht verifiziert werden",
|
||||||
"linkPubkeyDoesNotMatch": "Der öffentliche Schlüssel im Link stimmt nicht mit dem für diesen Kontakt gespeicherten öffentlichen Schlüssel überein. Triff die Person persönlich und scanne den QR-Code direkt!",
|
"linkPubkeyDoesNotMatch": "Der öffentliche Schlüssel im Link stimmt nicht mit dem für diesen Kontakt gespeicherten öffentlichen Schlüssel überein. Triff die Person persönlich und scanne den QR-Code direkt!",
|
||||||
"startWithCameraOpen": "Mit geöffneter Kamera starten",
|
"startWithCameraOpen": "Mit geöffneter Kamera starten",
|
||||||
"showImagePreviewWhenSending": "Bildvorschau bei der Auswahl von Empfängern anzeigen"
|
"showImagePreviewWhenSending": "Bildvorschau bei der Auswahl von Empfängern anzeigen",
|
||||||
|
"verifiedPublicKey": "Der öffentliche Schlüssel von {username} wurde überprüft und ist gültig."
|
||||||
}
|
}
|
||||||
|
|
@ -488,5 +488,6 @@
|
||||||
"couldNotVerifyUsername": "Could not verify {username}",
|
"couldNotVerifyUsername": "Could not verify {username}",
|
||||||
"linkPubkeyDoesNotMatch": "The public key in the link does not match the public key stored for this contact. Try to meet your friend in person and scan the QR code directly!",
|
"linkPubkeyDoesNotMatch": "The public key in the link does not match the public key stored for this contact. Try to meet your friend in person and scan the QR code directly!",
|
||||||
"startWithCameraOpen": "Start with camera open",
|
"startWithCameraOpen": "Start with camera open",
|
||||||
"showImagePreviewWhenSending": "Display image preview when selecting recipients"
|
"showImagePreviewWhenSending": "Display image preview when selecting recipients",
|
||||||
|
"verifiedPublicKey": "The public key of {username} has been verified and is valid."
|
||||||
}
|
}
|
||||||
|
|
@ -2851,6 +2851,12 @@ abstract class AppLocalizations {
|
||||||
/// In en, this message translates to:
|
/// In en, this message translates to:
|
||||||
/// **'Display image preview when selecting recipients'**
|
/// **'Display image preview when selecting recipients'**
|
||||||
String get showImagePreviewWhenSending;
|
String get showImagePreviewWhenSending;
|
||||||
|
|
||||||
|
/// No description provided for @verifiedPublicKey.
|
||||||
|
///
|
||||||
|
/// In en, this message translates to:
|
||||||
|
/// **'The public key of {username} has been verified and is valid.'**
|
||||||
|
String verifiedPublicKey(Object username);
|
||||||
}
|
}
|
||||||
|
|
||||||
class _AppLocalizationsDelegate
|
class _AppLocalizationsDelegate
|
||||||
|
|
|
||||||
|
|
@ -1577,4 +1577,9 @@ class AppLocalizationsDe extends AppLocalizations {
|
||||||
@override
|
@override
|
||||||
String get showImagePreviewWhenSending =>
|
String get showImagePreviewWhenSending =>
|
||||||
'Bildvorschau bei der Auswahl von Empfängern anzeigen';
|
'Bildvorschau bei der Auswahl von Empfängern anzeigen';
|
||||||
|
|
||||||
|
@override
|
||||||
|
String verifiedPublicKey(Object username) {
|
||||||
|
return 'Der öffentliche Schlüssel von $username wurde überprüft und ist gültig.';
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1567,4 +1567,9 @@ class AppLocalizationsEn extends AppLocalizations {
|
||||||
@override
|
@override
|
||||||
String get showImagePreviewWhenSending =>
|
String get showImagePreviewWhenSending =>
|
||||||
'Display image preview when selecting recipients';
|
'Display image preview when selecting recipients';
|
||||||
|
|
||||||
|
@override
|
||||||
|
String verifiedPublicKey(Object username) {
|
||||||
|
return 'The public key of $username has been verified and is valid.';
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -2,14 +2,16 @@ import 'dart:io';
|
||||||
import 'package:camera/camera.dart';
|
import 'package:camera/camera.dart';
|
||||||
import 'package:collection/collection.dart';
|
import 'package:collection/collection.dart';
|
||||||
import 'package:drift/drift.dart' show Value;
|
import 'package:drift/drift.dart' show Value;
|
||||||
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter/services.dart';
|
import 'package:flutter/services.dart';
|
||||||
import 'package:flutter/widgets.dart';
|
|
||||||
import 'package:google_mlkit_barcode_scanning/google_mlkit_barcode_scanning.dart';
|
import 'package:google_mlkit_barcode_scanning/google_mlkit_barcode_scanning.dart';
|
||||||
import 'package:twonly/globals.dart';
|
import 'package:twonly/globals.dart';
|
||||||
|
import 'package:twonly/src/database/daos/contacts.dao.dart';
|
||||||
import 'package:twonly/src/database/twonly.db.dart';
|
import 'package:twonly/src/database/twonly.db.dart';
|
||||||
import 'package:twonly/src/model/protobuf/client/generated/qr.pb.dart';
|
import 'package:twonly/src/model/protobuf/client/generated/qr.pb.dart';
|
||||||
import 'package:twonly/src/services/signal/session.signal.dart';
|
import 'package:twonly/src/services/signal/session.signal.dart';
|
||||||
import 'package:twonly/src/utils/log.dart';
|
import 'package:twonly/src/utils/log.dart';
|
||||||
|
import 'package:twonly/src/utils/misc.dart';
|
||||||
import 'package:twonly/src/utils/qr.dart';
|
import 'package:twonly/src/utils/qr.dart';
|
||||||
import 'package:twonly/src/utils/screenshot.dart';
|
import 'package:twonly/src/utils/screenshot.dart';
|
||||||
import 'package:twonly/src/views/camera/camera_preview_components/camera_preview_controller_view.dart';
|
import 'package:twonly/src/views/camera/camera_preview_components/camera_preview_controller_view.dart';
|
||||||
|
|
@ -219,6 +221,19 @@ class MainCameraController {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
await HapticFeedback.heavyImpact();
|
await HapticFeedback.heavyImpact();
|
||||||
|
if (verificationOk) {
|
||||||
|
globalRootScaffoldMessengerKey.currentState?.showSnackBar(
|
||||||
|
SnackBar(
|
||||||
|
content: Text(
|
||||||
|
globalRootScaffoldMessengerKey.currentContext?.lang
|
||||||
|
.verifiedPublicKey(
|
||||||
|
getContactDisplayName(contact)) ??
|
||||||
|
'',
|
||||||
|
),
|
||||||
|
duration: const Duration(seconds: 6),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue