forked from firka/student-legacy
create trans(lation), and finish url opening
This commit is contained in:
parent
3211279a53
commit
a215bd7313
@ -2,7 +2,6 @@
|
|||||||
import 'package:refilc/api/providers/user_provider.dart';
|
import 'package:refilc/api/providers/user_provider.dart';
|
||||||
import 'package:refilc/models/settings.dart';
|
import 'package:refilc/models/settings.dart';
|
||||||
import 'package:refilc/theme/colors/colors.dart';
|
import 'package:refilc/theme/colors/colors.dart';
|
||||||
import 'package:refilc_mobile_ui/common/chips/new_chip.dart';
|
|
||||||
import 'package:refilc_mobile_ui/common/panel/panel_button.dart';
|
import 'package:refilc_mobile_ui/common/panel/panel_button.dart';
|
||||||
import 'package:refilc_mobile_ui/common/splitted_panel/splitted_panel.dart';
|
import 'package:refilc_mobile_ui/common/splitted_panel/splitted_panel.dart';
|
||||||
import 'package:refilc_mobile_ui/screens/settings/settings_helper.dart';
|
import 'package:refilc_mobile_ui/screens/settings/settings_helper.dart';
|
||||||
@ -18,6 +17,9 @@ import 'package:refilc_plus/ui/mobile/plus/upsell.dart';
|
|||||||
import 'package:refilc_plus/ui/mobile/settings/welcome_message.dart';
|
import 'package:refilc_plus/ui/mobile/settings/welcome_message.dart';
|
||||||
// import 'package:provider/provider.dart';
|
// import 'package:provider/provider.dart';
|
||||||
import 'submenu_screen.i18n.dart';
|
import 'submenu_screen.i18n.dart';
|
||||||
|
import 'package:url_launcher/url_launcher.dart';
|
||||||
|
|
||||||
|
final Uri _url = Uri.parse('https://stickermap.refilc.hu');
|
||||||
|
|
||||||
class MenuOtherSettings extends StatelessWidget {
|
class MenuOtherSettings extends StatelessWidget {
|
||||||
const MenuOtherSettings({
|
const MenuOtherSettings({
|
||||||
@ -43,11 +45,6 @@ class MenuOtherSettings extends StatelessWidget {
|
|||||||
trailing: Row(
|
trailing: Row(
|
||||||
mainAxisSize: MainAxisSize.min,
|
mainAxisSize: MainAxisSize.min,
|
||||||
children: [
|
children: [
|
||||||
if (Provider.of<SettingsProvider>(context)
|
|
||||||
.unseenNewFeatures
|
|
||||||
.toSet()
|
|
||||||
.intersection({'grade_exporting'}).isNotEmpty)
|
|
||||||
const NewChip(),
|
|
||||||
Icon(
|
Icon(
|
||||||
FeatherIcons.chevronRight,
|
FeatherIcons.chevronRight,
|
||||||
size: 22.0,
|
size: 22.0,
|
||||||
@ -81,7 +78,7 @@ class ExtrasSettingsScreenState extends State<ExtrasSettingsScreen> {
|
|||||||
surfaceTintColor: Theme.of(context).scaffoldBackgroundColor,
|
surfaceTintColor: Theme.of(context).scaffoldBackgroundColor,
|
||||||
leading: BackButton(color: AppColors.of(context).text),
|
leading: BackButton(color: AppColors.of(context).text),
|
||||||
title: Text(
|
title: Text(
|
||||||
"extras".i18n,
|
"other".i18n,
|
||||||
style: TextStyle(color: AppColors.of(context).text),
|
style: TextStyle(color: AppColors.of(context).text),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
@ -91,92 +88,31 @@ class ExtrasSettingsScreenState extends State<ExtrasSettingsScreen> {
|
|||||||
child: Column(
|
child: Column(
|
||||||
children: [
|
children: [
|
||||||
SplittedPanel(
|
SplittedPanel(
|
||||||
padding: const EdgeInsets.only(top: 8.0),
|
padding: const EdgeInsets.only(top: 9.0),
|
||||||
cardPadding: const EdgeInsets.all(4.0),
|
cardPadding: const EdgeInsets.all(4.0),
|
||||||
isSeparated: true,
|
isSeparated: true,
|
||||||
children: [
|
children: [
|
||||||
PanelButton(
|
PanelButton(
|
||||||
padding: const EdgeInsets.only(left: 14.0, right: 6.0),
|
onPressed: _launchUrl,
|
||||||
onPressed: () async {
|
|
||||||
if (!Provider.of<PlusProvider>(context, listen: false)
|
|
||||||
.hasScope(PremiumScopes.customGradeRarities)) {
|
|
||||||
return PlusLockedFeaturePopup.show(
|
|
||||||
context: context,
|
|
||||||
feature: PremiumFeature.gradeRarities);
|
|
||||||
}
|
|
||||||
|
|
||||||
// settingsProvider.update(
|
|
||||||
// gradeOpeningFun: !settingsProvider.gradeOpeningFun);
|
|
||||||
SettingsHelper.surpriseGradeRarityText(
|
|
||||||
context,
|
|
||||||
title: 'rarity_title'.i18n,
|
|
||||||
cancel: 'cancel'.i18n,
|
|
||||||
done: 'done'.i18n,
|
|
||||||
rarities: [
|
|
||||||
"common".i18n,
|
|
||||||
"uncommon".i18n,
|
|
||||||
"rare".i18n,
|
|
||||||
"epic".i18n,
|
|
||||||
"legendary".i18n,
|
|
||||||
],
|
|
||||||
);
|
|
||||||
setState(() {});
|
|
||||||
},
|
|
||||||
trailingDivider: true,
|
|
||||||
title: Text(
|
title: Text(
|
||||||
"surprise_grades".i18n,
|
"stickermap".i18n,
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
color: AppColors.of(context).text.withOpacity(
|
color: AppColors.of(context).text.withOpacity(.95),
|
||||||
settingsProvider.gradeOpeningFun ? .95 : .25),
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
leading: Icon(
|
leading: Icon(
|
||||||
FeatherIcons.gift,
|
FeatherIcons.calendar,
|
||||||
size: 22.0,
|
size: 22.0,
|
||||||
color: AppColors.of(context).text.withOpacity(
|
color: AppColors.of(context).text.withOpacity(.95),
|
||||||
settingsProvider.gradeOpeningFun ? .95 : .25),
|
|
||||||
),
|
),
|
||||||
trailing: Switch(
|
trailing: Icon(
|
||||||
onChanged: (v) async {
|
FeatherIcons.chevronRight,
|
||||||
settingsProvider.update(gradeOpeningFun: v);
|
size: 22.0,
|
||||||
|
color: AppColors.of(context).text.withOpacity(0.95),
|
||||||
setState(() {});
|
|
||||||
},
|
|
||||||
value: settingsProvider.gradeOpeningFun,
|
|
||||||
activeColor: Theme.of(context).colorScheme.secondary,
|
|
||||||
),
|
),
|
||||||
borderRadius: const BorderRadius.vertical(
|
borderRadius: const BorderRadius.vertical(
|
||||||
top: Radius.circular(12.0),
|
top: Radius.circular(4.0),
|
||||||
bottom: Radius.circular(12.0),
|
bottom: Radius.circular(4.0)),
|
||||||
),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
SplittedPanel(
|
|
||||||
padding: const EdgeInsets.only(top: 9.0),
|
|
||||||
cardPadding: const EdgeInsets.all(4.0),
|
|
||||||
isSeparated: true,
|
|
||||||
children: [
|
|
||||||
WelcomeMessagePanelButton(settingsProvider, user),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
SplittedPanel(
|
|
||||||
padding: const EdgeInsets.only(top: 9.0),
|
|
||||||
cardPadding: const EdgeInsets.all(4.0),
|
|
||||||
isSeparated: true,
|
|
||||||
children: [
|
|
||||||
MenuCalendarSync(
|
|
||||||
borderRadius: BorderRadius.circular(12.0),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
SplittedPanel(
|
|
||||||
padding: const EdgeInsets.only(top: 9.0),
|
|
||||||
cardPadding: const EdgeInsets.all(4.0),
|
|
||||||
isSeparated: true,
|
|
||||||
children: [
|
|
||||||
MenuGradeExporting(
|
|
||||||
borderRadius: BorderRadius.circular(12.0),
|
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
@ -186,4 +122,10 @@ class ExtrasSettingsScreenState extends State<ExtrasSettingsScreen> {
|
|||||||
),
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Future<void> _launchUrl() async {
|
||||||
|
if (!await launchUrl(_url)) {
|
||||||
|
throw Exception('Could not launch $_url');
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -8,6 +8,7 @@ extension SettingsLocalization on String {
|
|||||||
"personalization": "Personalization",
|
"personalization": "Personalization",
|
||||||
"extras": "Extras",
|
"extras": "Extras",
|
||||||
"other": "Other",
|
"other": "Other",
|
||||||
|
"stickermap": "reFilc Stickermap",
|
||||||
"surprise_grades": "Surprise Grades",
|
"surprise_grades": "Surprise Grades",
|
||||||
"cancel": "Cancel",
|
"cancel": "Cancel",
|
||||||
"done": "Done",
|
"done": "Done",
|
||||||
@ -35,6 +36,7 @@ extension SettingsLocalization on String {
|
|||||||
"personalization": "Személyre szabás",
|
"personalization": "Személyre szabás",
|
||||||
"extras": "Extrák",
|
"extras": "Extrák",
|
||||||
"other": "Egyéb",
|
"other": "Egyéb",
|
||||||
|
"stickermap": "reFilc Matricatérkép",
|
||||||
"surprise_grades": "Meglepetés jegyek",
|
"surprise_grades": "Meglepetés jegyek",
|
||||||
"cancel": "Mégse",
|
"cancel": "Mégse",
|
||||||
"done": "Kész",
|
"done": "Kész",
|
||||||
@ -62,6 +64,7 @@ extension SettingsLocalization on String {
|
|||||||
"personalization": "Personalisierung",
|
"personalization": "Personalisierung",
|
||||||
"extras": "Extras",
|
"extras": "Extras",
|
||||||
"other": "Andere",
|
"other": "Andere",
|
||||||
|
"stickermap": "reFilc Aufkleberkarte",
|
||||||
"surprise_grades": "Überraschende Noten",
|
"surprise_grades": "Überraschende Noten",
|
||||||
"cancel": "Abbrechen",
|
"cancel": "Abbrechen",
|
||||||
"done": "Bereit",
|
"done": "Bereit",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user