devmode and secret v5-ify

This commit is contained in:
Kima 2024-02-02 21:06:15 +01:00
parent 773a8f61e9
commit 8b91e0e1d3

View File

@ -535,18 +535,22 @@ class SettingsScreenState extends State<SettingsScreen>
// secret settings // secret settings
if (__ss) if (__ss)
Padding( SplittedPanel(
padding: const EdgeInsets.symmetric( isSeparated: true,
vertical: 12.0, horizontal: 24.0), isTransparent: true,
child: Panel( hasShadow: false,
title: Text("secret".i18n),
child: Column(
children: [ children: [
// Good student mode SplittedPanel(
title: Text("secret".i18n),
cardPadding: const EdgeInsets.all(4.0),
padding: EdgeInsets.zero,
children: [
// good student mode
Material( Material(
type: MaterialType.transparency, type: MaterialType.transparency,
child: SwitchListTile( child: SwitchListTile(
contentPadding: const EdgeInsets.only(left: 12.0), contentPadding:
const EdgeInsets.only(left: 12.0, right: 6.0),
shape: RoundedRectangleBorder( shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(12.0)), borderRadius: BorderRadius.circular(12.0)),
title: Text("goodstudent".i18n, title: Text("goodstudent".i18n,
@ -589,12 +593,18 @@ class SettingsScreenState extends State<SettingsScreen>
activeColor: Theme.of(context).colorScheme.secondary, activeColor: Theme.of(context).colorScheme.secondary,
), ),
), ),
],
// Presentation mode ),
SplittedPanel(
cardPadding: const EdgeInsets.all(4.0),
padding: EdgeInsets.zero,
children: [
// presentation mode
Material( Material(
type: MaterialType.transparency, type: MaterialType.transparency,
child: SwitchListTile( child: SwitchListTile(
contentPadding: const EdgeInsets.only(left: 12.0), contentPadding:
const EdgeInsets.only(left: 12.0, right: 6.0),
shape: RoundedRectangleBorder( shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(12.0)), borderRadius: BorderRadius.circular(12.0)),
title: Text("presentation".i18n, title: Text("presentation".i18n,
@ -627,7 +637,7 @@ class SettingsScreenState extends State<SettingsScreen>
// ), // ),
], ],
), ),
), ],
), ),
// settings submenus // settings submenus
@ -1223,55 +1233,69 @@ class SettingsScreenState extends State<SettingsScreen>
// developer options // developer options
if (settings.developerMode) if (settings.developerMode)
Padding( SplittedPanel(
padding: const EdgeInsets.symmetric(
vertical: 12.0, horizontal: 24.0),
child: Panel(
title: Text("devsettings".i18n), title: Text("devsettings".i18n),
child: Column( cardPadding: const EdgeInsets.all(4.0),
children: [ children: [
Material( Material(
type: MaterialType.transparency, type: MaterialType.transparency,
child: SwitchListTile( child: SwitchListTile(
contentPadding: const EdgeInsets.only(left: 12.0), contentPadding:
shape: RoundedRectangleBorder( const EdgeInsets.only(left: 12.0, right: 4.0),
borderRadius: BorderRadius.circular(12.0)), shape: const RoundedRectangleBorder(
borderRadius: BorderRadius.vertical(
top: Radius.circular(12.0),
bottom: Radius.circular(4.0))),
title: Text("devmode".i18n, title: Text("devmode".i18n,
style: style: const TextStyle(fontWeight: FontWeight.w500)),
const TextStyle(fontWeight: FontWeight.w500)), onChanged: (v) => settings.update(developerMode: false),
onChanged: (v) =>
settings.update(developerMode: false),
value: settings.developerMode, value: settings.developerMode,
activeColor: Theme.of(context).colorScheme.secondary, activeColor: Theme.of(context).colorScheme.secondary,
), ),
), ),
PanelButton( PanelButton(
leading: const Icon(FeatherIcons.copy), borderRadius: BorderRadius.vertical(
top: const Radius.circular(4.0),
bottom:
Provider.of<PremiumProvider>(context, listen: false)
.hasPremium
? const Radius.circular(4.0)
: const Radius.circular(12.0),
),
leading: Icon(
FeatherIcons.copy,
size: 22.0,
color: AppColors.of(context).text.withOpacity(.95),
),
title: Text("copy_jwt".i18n), title: Text("copy_jwt".i18n),
onPressed: () => Clipboard.setData(ClipboardData( onPressed: () => Clipboard.setData(ClipboardData(
text: text: Provider.of<KretaClient>(context, listen: false)
Provider.of<KretaClient>(context, listen: false)
.accessToken!)), .accessToken!)),
), ),
if (Provider.of<PremiumProvider>(context, listen: false) if (Provider.of<PremiumProvider>(context, listen: false)
.hasPremium) .hasPremium)
PanelButton( PanelButton(
leading: const Icon(FeatherIcons.key), borderRadius: const BorderRadius.vertical(
top: Radius.circular(4.0),
bottom: Radius.circular(12.0),
),
leading: Icon(
FeatherIcons.key,
size: 22.0,
color: AppColors.of(context).text.withOpacity(.95),
),
title: const Text("Remove Premium"), title: const Text("Remove Premium"),
onPressed: () { onPressed: () {
Provider.of<PremiumProvider>(context, listen: false) Provider.of<PremiumProvider>(context, listen: false)
.activate(removePremium: true); .activate(removePremium: true);
settings.update( settings.update(
accentColor: AccentColor.filc, store: true); accentColor: AccentColor.filc, store: true);
Provider.of<ThemeModeObserver>(context, Provider.of<ThemeModeObserver>(context, listen: false)
listen: false)
.changeTheme(settings.theme); .changeTheme(settings.theme);
}, },
), ),
], ],
), ),
),
),
// version info // version info
SafeArea( SafeArea(