fixed theme share warn dialog

This commit is contained in:
Kima 2023-09-18 19:42:36 +02:00
parent 9406efee8d
commit 6d7a21dc02
2 changed files with 30 additions and 4 deletions

View File

@ -8,6 +8,7 @@ import 'package:filcnaplo/ui/widgets/message/message_tile.dart';
import 'package:filcnaplo_kreta_api/models/grade.dart'; import 'package:filcnaplo_kreta_api/models/grade.dart';
import 'package:filcnaplo_kreta_api/models/homework.dart'; import 'package:filcnaplo_kreta_api/models/homework.dart';
import 'package:filcnaplo_kreta_api/models/message.dart'; import 'package:filcnaplo_kreta_api/models/message.dart';
import 'package:filcnaplo_mobile_ui/common/action_button.dart';
import 'package:filcnaplo_mobile_ui/common/filter_bar.dart'; import 'package:filcnaplo_mobile_ui/common/filter_bar.dart';
import 'package:filcnaplo_mobile_ui/common/panel/panel.dart'; import 'package:filcnaplo_mobile_ui/common/panel/panel.dart';
import 'package:filcnaplo_mobile_ui/common/widgets/grade/new_grades.dart'; import 'package:filcnaplo_mobile_ui/common/widgets/grade/new_grades.dart';
@ -268,10 +269,32 @@ class _PremiumCustomAccentColorSettingState
// ), // ),
// ), // ),
// ); // );
SharedTheme theme = showDialog(
await shareProvider.shareCurrentTheme(context); context: context,
Share.share(theme.id, builder: (context) => WillPopScope(
subject: 'reFilc Téma / reFilc Theme'); onWillPop: () async => false,
child: AlertDialog(
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(12.0)),
title: Text("attention".i18n),
content: Text("share_disclaimer".i18n),
actions: [
ActionButton(
label: "understand".i18n,
onTap: () async {
Navigator.of(context).pop();
SharedTheme theme = await shareProvider
.shareCurrentTheme(context);
Share.share(
theme.id,
subject: 'share_subj_theme'.i18n,
);
},
),
],
),
),
);
}, },
icon: const Icon( icon: const Icon(
FeatherIcons.share2, FeatherIcons.share2,

View File

@ -14,6 +14,7 @@ extension SettingsLocalization on String {
"enter_id": "Enter ID", "enter_id": "Enter ID",
"theme_id": "Theme ID...", "theme_id": "Theme ID...",
"theme_not_found": "Theme not found!", "theme_not_found": "Theme not found!",
"share_subj_theme": "reFilc Theme",
}, },
"hu_hu": { "hu_hu": {
"theme_prev": "Előnézet", "theme_prev": "Előnézet",
@ -26,6 +27,7 @@ extension SettingsLocalization on String {
"enter_id": "ID megadása", "enter_id": "ID megadása",
"theme_id": "Téma azonosító...", "theme_id": "Téma azonosító...",
"theme_not_found": "A téma nem található!", "theme_not_found": "A téma nem található!",
"share_subj_theme": "reFilc Téma",
}, },
"de_de": { "de_de": {
"theme_prev": "Vorschau", "theme_prev": "Vorschau",
@ -39,6 +41,7 @@ extension SettingsLocalization on String {
"enter_id": "Geben Sie die ID ein", "enter_id": "Geben Sie die ID ein",
"theme_id": "Themen-ID...", "theme_id": "Themen-ID...",
"theme_not_found": "Thema nicht gefunden!", "theme_not_found": "Thema nicht gefunden!",
"share_subj_theme": "reFilc Thema",
}, },
}; };