forked from firka/student-legacy
devmode and secret v5-ify
This commit is contained in:
parent
773a8f61e9
commit
8b91e0e1d3
@ -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),
|
children: [
|
||||||
child: Column(
|
SplittedPanel(
|
||||||
|
title: Text("secret".i18n),
|
||||||
|
cardPadding: const EdgeInsets.all(4.0),
|
||||||
|
padding: EdgeInsets.zero,
|
||||||
children: [
|
children: [
|
||||||
// Good student mode
|
// 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,54 +1233,68 @@ class SettingsScreenState extends State<SettingsScreen>
|
|||||||
|
|
||||||
// developer options
|
// developer options
|
||||||
if (settings.developerMode)
|
if (settings.developerMode)
|
||||||
Padding(
|
SplittedPanel(
|
||||||
padding: const EdgeInsets.symmetric(
|
title: Text("devsettings".i18n),
|
||||||
vertical: 12.0, horizontal: 24.0),
|
cardPadding: const EdgeInsets.all(4.0),
|
||||||
child: Panel(
|
children: [
|
||||||
title: Text("devsettings".i18n),
|
Material(
|
||||||
child: Column(
|
type: MaterialType.transparency,
|
||||||
children: [
|
child: SwitchListTile(
|
||||||
Material(
|
contentPadding:
|
||||||
type: MaterialType.transparency,
|
const EdgeInsets.only(left: 12.0, right: 4.0),
|
||||||
child: SwitchListTile(
|
shape: const RoundedRectangleBorder(
|
||||||
contentPadding: const EdgeInsets.only(left: 12.0),
|
borderRadius: BorderRadius.vertical(
|
||||||
shape: RoundedRectangleBorder(
|
top: Radius.circular(12.0),
|
||||||
borderRadius: BorderRadius.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) =>
|
value: settings.developerMode,
|
||||||
settings.update(developerMode: false),
|
activeColor: Theme.of(context).colorScheme.secondary,
|
||||||
value: settings.developerMode,
|
),
|
||||||
activeColor: Theme.of(context).colorScheme.secondary,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
PanelButton(
|
|
||||||
leading: const Icon(FeatherIcons.copy),
|
|
||||||
title: Text("copy_jwt".i18n),
|
|
||||||
onPressed: () => Clipboard.setData(ClipboardData(
|
|
||||||
text:
|
|
||||||
Provider.of<KretaClient>(context, listen: false)
|
|
||||||
.accessToken!)),
|
|
||||||
),
|
|
||||||
if (Provider.of<PremiumProvider>(context, listen: false)
|
|
||||||
.hasPremium)
|
|
||||||
PanelButton(
|
|
||||||
leading: const Icon(FeatherIcons.key),
|
|
||||||
title: const Text("Remove Premium"),
|
|
||||||
onPressed: () {
|
|
||||||
Provider.of<PremiumProvider>(context, listen: false)
|
|
||||||
.activate(removePremium: true);
|
|
||||||
settings.update(
|
|
||||||
accentColor: AccentColor.filc, store: true);
|
|
||||||
Provider.of<ThemeModeObserver>(context,
|
|
||||||
listen: false)
|
|
||||||
.changeTheme(settings.theme);
|
|
||||||
},
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
),
|
||||||
),
|
PanelButton(
|
||||||
|
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),
|
||||||
|
onPressed: () => Clipboard.setData(ClipboardData(
|
||||||
|
text: Provider.of<KretaClient>(context, listen: false)
|
||||||
|
.accessToken!)),
|
||||||
|
),
|
||||||
|
if (Provider.of<PremiumProvider>(context, listen: false)
|
||||||
|
.hasPremium)
|
||||||
|
PanelButton(
|
||||||
|
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"),
|
||||||
|
onPressed: () {
|
||||||
|
Provider.of<PremiumProvider>(context, listen: false)
|
||||||
|
.activate(removePremium: true);
|
||||||
|
settings.update(
|
||||||
|
accentColor: AccentColor.filc, store: true);
|
||||||
|
Provider.of<ThemeModeObserver>(context, listen: false)
|
||||||
|
.changeTheme(settings.theme);
|
||||||
|
},
|
||||||
|
),
|
||||||
|
],
|
||||||
),
|
),
|
||||||
|
|
||||||
// version info
|
// version info
|
||||||
|
Loading…
x
Reference in New Issue
Block a user