forked from firka/student-legacy
general settings updated
This commit is contained in:
parent
648fac6904
commit
5b9187d545
@ -1,5 +1,6 @@
|
|||||||
import 'package:filcnaplo/models/settings.dart';
|
import 'package:filcnaplo/models/settings.dart';
|
||||||
import 'package:filcnaplo/theme/colors/colors.dart';
|
import 'package:filcnaplo/theme/colors/colors.dart';
|
||||||
|
import 'package:filcnaplo/utils/format.dart';
|
||||||
import 'package:filcnaplo_mobile_ui/common/panel/panel_button.dart';
|
import 'package:filcnaplo_mobile_ui/common/panel/panel_button.dart';
|
||||||
import 'package:filcnaplo_mobile_ui/common/splitted_panel/splitted_panel.dart';
|
import 'package:filcnaplo_mobile_ui/common/splitted_panel/splitted_panel.dart';
|
||||||
import 'package:filcnaplo_mobile_ui/screens/settings/settings_helper.dart';
|
import 'package:filcnaplo_mobile_ui/screens/settings/settings_helper.dart';
|
||||||
@ -7,7 +8,7 @@ import 'package:flutter/cupertino.dart';
|
|||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter_feather_icons/flutter_feather_icons.dart';
|
import 'package:flutter_feather_icons/flutter_feather_icons.dart';
|
||||||
import 'package:provider/provider.dart';
|
import 'package:provider/provider.dart';
|
||||||
import 'submenu_screen.i18n.dart';
|
import 'package:filcnaplo_mobile_ui/screens/settings/settings_screen.i18n.dart';
|
||||||
|
|
||||||
class MenuGeneralSettings extends StatelessWidget {
|
class MenuGeneralSettings extends StatelessWidget {
|
||||||
const MenuGeneralSettings({
|
const MenuGeneralSettings({
|
||||||
@ -52,6 +53,18 @@ class GeneralSettingsScreenState extends State<GeneralSettingsScreen> {
|
|||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
SettingsProvider settingsProvider = Provider.of<SettingsProvider>(context);
|
SettingsProvider settingsProvider = Provider.of<SettingsProvider>(context);
|
||||||
|
|
||||||
|
String startPageTitle =
|
||||||
|
SettingsHelper.localizedPageTitles()[settingsProvider.startPage] ?? "?";
|
||||||
|
String languageText =
|
||||||
|
SettingsHelper.langMap[settingsProvider.language] ?? "?";
|
||||||
|
String vibrateTitle = {
|
||||||
|
VibrationStrength.off: "voff".i18n,
|
||||||
|
VibrationStrength.light: "vlight".i18n,
|
||||||
|
VibrationStrength.medium: "vmedium".i18n,
|
||||||
|
VibrationStrength.strong: "vstrong".i18n,
|
||||||
|
}[settingsProvider.vibrate] ??
|
||||||
|
"?";
|
||||||
|
|
||||||
return Scaffold(
|
return Scaffold(
|
||||||
appBar: AppBar(
|
appBar: AppBar(
|
||||||
surfaceTintColor: Theme.of(context).scaffoldBackgroundColor,
|
surfaceTintColor: Theme.of(context).scaffoldBackgroundColor,
|
||||||
@ -176,6 +189,105 @@ class GeneralSettingsScreenState extends State<GeneralSettingsScreen> {
|
|||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
|
SplittedPanel(
|
||||||
|
padding: const EdgeInsets.only(top: 9.0),
|
||||||
|
cardPadding: const EdgeInsets.all(4.0),
|
||||||
|
isSeparated: true,
|
||||||
|
children: [
|
||||||
|
PanelButton(
|
||||||
|
padding: const EdgeInsets.only(left: 14.0, right: 6.0),
|
||||||
|
onPressed: () {
|
||||||
|
SettingsHelper.startPage(context);
|
||||||
|
setState(() {});
|
||||||
|
},
|
||||||
|
title: Text(
|
||||||
|
"startpage".i18n,
|
||||||
|
style: TextStyle(
|
||||||
|
color: AppColors.of(context).text.withOpacity(.95),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
leading: Icon(
|
||||||
|
FeatherIcons.play,
|
||||||
|
size: 22.0,
|
||||||
|
color: AppColors.of(context).text.withOpacity(.95),
|
||||||
|
),
|
||||||
|
trailing: Text(
|
||||||
|
startPageTitle.capital(),
|
||||||
|
style: const TextStyle(fontSize: 14.0),
|
||||||
|
),
|
||||||
|
borderRadius: const BorderRadius.vertical(
|
||||||
|
top: Radius.circular(12.0),
|
||||||
|
bottom: Radius.circular(12.0),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
SplittedPanel(
|
||||||
|
padding: const EdgeInsets.only(top: 9.0),
|
||||||
|
cardPadding: const EdgeInsets.all(4.0),
|
||||||
|
isSeparated: true,
|
||||||
|
children: [
|
||||||
|
PanelButton(
|
||||||
|
padding: const EdgeInsets.only(left: 14.0, right: 6.0),
|
||||||
|
onPressed: () {
|
||||||
|
SettingsHelper.language(context);
|
||||||
|
setState(() {});
|
||||||
|
},
|
||||||
|
title: Text(
|
||||||
|
"language".i18n,
|
||||||
|
style: TextStyle(
|
||||||
|
color: AppColors.of(context).text.withOpacity(.95),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
leading: Icon(
|
||||||
|
FeatherIcons.globe,
|
||||||
|
size: 22.0,
|
||||||
|
color: AppColors.of(context).text.withOpacity(.95),
|
||||||
|
),
|
||||||
|
trailing: Text(
|
||||||
|
languageText,
|
||||||
|
style: const TextStyle(fontSize: 14.0),
|
||||||
|
),
|
||||||
|
borderRadius: const BorderRadius.vertical(
|
||||||
|
top: Radius.circular(12.0),
|
||||||
|
bottom: Radius.circular(12.0),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
SplittedPanel(
|
||||||
|
padding: const EdgeInsets.only(top: 9.0),
|
||||||
|
cardPadding: const EdgeInsets.all(4.0),
|
||||||
|
isSeparated: true,
|
||||||
|
children: [
|
||||||
|
PanelButton(
|
||||||
|
padding: const EdgeInsets.only(left: 14.0, right: 6.0),
|
||||||
|
onPressed: () {
|
||||||
|
SettingsHelper.vibrate(context);
|
||||||
|
setState(() {});
|
||||||
|
},
|
||||||
|
title: Text(
|
||||||
|
"vibrate".i18n,
|
||||||
|
style: TextStyle(
|
||||||
|
color: AppColors.of(context).text.withOpacity(.95),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
leading: Icon(
|
||||||
|
FeatherIcons.radio,
|
||||||
|
size: 22.0,
|
||||||
|
color: AppColors.of(context).text.withOpacity(.95),
|
||||||
|
),
|
||||||
|
trailing: Text(
|
||||||
|
vibrateTitle,
|
||||||
|
style: const TextStyle(fontSize: 14.0),
|
||||||
|
),
|
||||||
|
borderRadius: const BorderRadius.vertical(
|
||||||
|
top: Radius.circular(12.0),
|
||||||
|
bottom: Radius.circular(12.0),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
Loading…
x
Reference in New Issue
Block a user