forked from firka/student-legacy
added beta chip, changed things
This commit is contained in:
parent
1ea0f95863
commit
f7d263570d
41
filcnaplo_mobile_ui/lib/common/beta_chip.dart
Normal file
41
filcnaplo_mobile_ui/lib/common/beta_chip.dart
Normal file
@ -0,0 +1,41 @@
|
|||||||
|
import 'package:filcnaplo/theme/colors/colors.dart';
|
||||||
|
import 'package:flutter/material.dart';
|
||||||
|
|
||||||
|
class BetaChip extends StatelessWidget {
|
||||||
|
const BetaChip({Key? key, this.disabled = false}) : super(key: key);
|
||||||
|
|
||||||
|
final bool disabled;
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
return SizedBox(
|
||||||
|
height: 25,
|
||||||
|
child: AnimatedContainer(
|
||||||
|
duration: const Duration(milliseconds: 200),
|
||||||
|
child: Padding(
|
||||||
|
padding: const EdgeInsets.only(left: 8, right: 8),
|
||||||
|
child: Center(
|
||||||
|
child: Text(
|
||||||
|
"BETA",
|
||||||
|
softWrap: true,
|
||||||
|
style: TextStyle(
|
||||||
|
fontSize: 10,
|
||||||
|
color: disabled
|
||||||
|
? AppColors.of(context).text.withOpacity(.5)
|
||||||
|
: Colors.white,
|
||||||
|
fontWeight: FontWeight.w600,
|
||||||
|
overflow: TextOverflow.ellipsis,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
color: !disabled
|
||||||
|
? Theme.of(context).colorScheme.secondary
|
||||||
|
: AppColors.of(context).text.withOpacity(.25),
|
||||||
|
borderRadius: BorderRadius.circular(40),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
@ -15,6 +15,7 @@ import 'package:filcnaplo/models/user.dart';
|
|||||||
import 'package:filcnaplo/theme/colors/colors.dart';
|
import 'package:filcnaplo/theme/colors/colors.dart';
|
||||||
import 'package:filcnaplo_kreta_api/client/client.dart';
|
import 'package:filcnaplo_kreta_api/client/client.dart';
|
||||||
import 'package:filcnaplo_mobile_ui/common/action_button.dart';
|
import 'package:filcnaplo_mobile_ui/common/action_button.dart';
|
||||||
|
import 'package:filcnaplo_mobile_ui/common/beta_chip.dart';
|
||||||
import 'package:filcnaplo_mobile_ui/common/bottom_sheet_menu/bottom_sheet_menu.dart';
|
import 'package:filcnaplo_mobile_ui/common/bottom_sheet_menu/bottom_sheet_menu.dart';
|
||||||
import 'package:filcnaplo_mobile_ui/common/bottom_sheet_menu/bottom_sheet_menu_item.dart';
|
import 'package:filcnaplo_mobile_ui/common/bottom_sheet_menu/bottom_sheet_menu_item.dart';
|
||||||
import 'package:filcnaplo_mobile_ui/common/panel/panel.dart';
|
import 'package:filcnaplo_mobile_ui/common/panel/panel.dart';
|
||||||
@ -157,7 +158,8 @@ class _SettingsScreenState extends State<SettingsScreen>
|
|||||||
void initState() {
|
void initState() {
|
||||||
super.initState();
|
super.initState();
|
||||||
Future.delayed(Duration.zero, () {
|
Future.delayed(Duration.zero, () {
|
||||||
futureRelease = Provider.of<UpdateProvider>(context, listen: false).installedVersion();
|
futureRelease = Provider.of<UpdateProvider>(context, listen: false)
|
||||||
|
.installedVersion();
|
||||||
});
|
});
|
||||||
_hideContainersController = AnimationController(
|
_hideContainersController = AnimationController(
|
||||||
vsync: this, duration: const Duration(milliseconds: 200));
|
vsync: this, duration: const Duration(milliseconds: 200));
|
||||||
@ -446,9 +448,14 @@ class _SettingsScreenState extends State<SettingsScreen>
|
|||||||
contentPadding: const EdgeInsets.only(left: 12.0),
|
contentPadding: const EdgeInsets.only(left: 12.0),
|
||||||
shape: RoundedRectangleBorder(
|
shape: RoundedRectangleBorder(
|
||||||
borderRadius: BorderRadius.circular(12.0)),
|
borderRadius: BorderRadius.circular(12.0)),
|
||||||
title: Row(children: [
|
title: Row(
|
||||||
|
children: [
|
||||||
Icon(FeatherIcons.messageSquare,
|
Icon(FeatherIcons.messageSquare,
|
||||||
color: settings.notificationsEnabled ? Theme.of(context).colorScheme.secondary : AppColors.of(context).text.withOpacity(.25)),
|
color: settings.notificationsEnabled
|
||||||
|
? Theme.of(context).colorScheme.secondary
|
||||||
|
: AppColors.of(context)
|
||||||
|
.text
|
||||||
|
.withOpacity(.25)),
|
||||||
const SizedBox(width: 14.0),
|
const SizedBox(width: 14.0),
|
||||||
Text(
|
Text(
|
||||||
"notifications".i18n,
|
"notifications".i18n,
|
||||||
@ -462,34 +469,11 @@ class _SettingsScreenState extends State<SettingsScreen>
|
|||||||
const SizedBox(
|
const SizedBox(
|
||||||
width: 5,
|
width: 5,
|
||||||
),
|
),
|
||||||
SizedBox(
|
BetaChip(
|
||||||
height: 30,
|
disabled: !settings.notificationsEnabled,
|
||||||
child: AnimatedContainer(
|
|
||||||
duration: const Duration(milliseconds: 200),
|
|
||||||
child: Padding(
|
|
||||||
padding:
|
|
||||||
const EdgeInsets.only(left: 10, right: 10),
|
|
||||||
child: Center(
|
|
||||||
child: Text("BETA",
|
|
||||||
style: TextStyle(
|
|
||||||
fontSize: 9.1,
|
|
||||||
color: AppColors.of(context)
|
|
||||||
.text
|
|
||||||
.withOpacity(
|
|
||||||
settings.notificationsEnabled
|
|
||||||
? 1.0
|
|
||||||
: .5),
|
|
||||||
fontWeight: FontWeight.w600,
|
|
||||||
overflow: TextOverflow.ellipsis))),
|
|
||||||
),
|
),
|
||||||
decoration: BoxDecoration(
|
],
|
||||||
color: settings.notificationsEnabled
|
|
||||||
? Theme.of(context).colorScheme.secondary
|
|
||||||
: AppColors.of(context).text.withOpacity(.25),
|
|
||||||
borderRadius: BorderRadius.circular(40)),
|
|
||||||
),
|
),
|
||||||
)
|
|
||||||
]),
|
|
||||||
onChanged: (value) =>
|
onChanged: (value) =>
|
||||||
settings.update(notificationsEnabled: value),
|
settings.update(notificationsEnabled: value),
|
||||||
),
|
),
|
||||||
@ -927,7 +911,8 @@ class _SettingsScreenState extends State<SettingsScreen>
|
|||||||
shape: RoundedRectangleBorder(
|
shape: RoundedRectangleBorder(
|
||||||
borderRadius: BorderRadius.circular(12.0)),
|
borderRadius: BorderRadius.circular(12.0)),
|
||||||
title: Text("devmode".i18n,
|
title: Text("devmode".i18n,
|
||||||
style: const TextStyle(fontWeight: FontWeight.w500)),
|
style:
|
||||||
|
const TextStyle(fontWeight: FontWeight.w500)),
|
||||||
onChanged: (v) =>
|
onChanged: (v) =>
|
||||||
settings.update(developerMode: false),
|
settings.update(developerMode: false),
|
||||||
value: settings.developerMode,
|
value: settings.developerMode,
|
||||||
@ -1002,8 +987,8 @@ class _SettingsScreenState extends State<SettingsScreen>
|
|||||||
if (devmodeCountdown > 0) {
|
if (devmodeCountdown > 0) {
|
||||||
ScaffoldMessenger.of(context).showSnackBar(SnackBar(
|
ScaffoldMessenger.of(context).showSnackBar(SnackBar(
|
||||||
duration: const Duration(milliseconds: 200),
|
duration: const Duration(milliseconds: 200),
|
||||||
content: Text(
|
content:
|
||||||
"devmoretaps".i18n.fill([devmodeCountdown])),
|
Text("devmoretaps".i18n.fill([devmodeCountdown])),
|
||||||
));
|
));
|
||||||
|
|
||||||
setState(() => devmodeCountdown--);
|
setState(() => devmodeCountdown--);
|
||||||
|
@ -163,7 +163,7 @@ extension SettingsLocalization on String {
|
|||||||
"theme": "Thema",
|
"theme": "Thema",
|
||||||
"color": "Farbe",
|
"color": "Farbe",
|
||||||
"grade_colors": "Grad Farben",
|
"grade_colors": "Grad Farben",
|
||||||
"notifications": "Benachrichtigungen",
|
"notifications": "Mitteilung",
|
||||||
"news": "Nachrichten",
|
"news": "Nachrichten",
|
||||||
"extras": "Extras",
|
"extras": "Extras",
|
||||||
"about": "Informationen",
|
"about": "Informationen",
|
||||||
|
@ -10,6 +10,7 @@ import 'package:filcnaplo_premium/ui/mobile/goal_planner/goal_planner_screen.i18
|
|||||||
import 'package:filcnaplo_premium/ui/mobile/goal_planner/route_option.dart';
|
import 'package:filcnaplo_premium/ui/mobile/goal_planner/route_option.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:provider/provider.dart';
|
import 'package:provider/provider.dart';
|
||||||
|
import 'package:filcnaplo_mobile_ui/common/beta_chip.dart';
|
||||||
|
|
||||||
enum PlanResult {
|
enum PlanResult {
|
||||||
available, // There are possible solutions
|
available, // There are possible solutions
|
||||||
@ -128,11 +129,19 @@ class _GoalPlannerTestState extends State<GoalPlannerTest> {
|
|||||||
const BackButton(),
|
const BackButton(),
|
||||||
Padding(
|
Padding(
|
||||||
padding: const EdgeInsets.only(right: 15.0),
|
padding: const EdgeInsets.only(right: 15.0),
|
||||||
child: Text(
|
child: Row(
|
||||||
|
children: [
|
||||||
|
Text(
|
||||||
'goal_planner_title'.i18n,
|
'goal_planner_title'.i18n,
|
||||||
style: const TextStyle(
|
style: const TextStyle(
|
||||||
fontWeight: FontWeight.w500, fontSize: 18.0),
|
fontWeight: FontWeight.w500, fontSize: 18.0),
|
||||||
),
|
),
|
||||||
|
const SizedBox(
|
||||||
|
width: 5,
|
||||||
|
),
|
||||||
|
const BetaChip(),
|
||||||
|
],
|
||||||
|
),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
|
Loading…
x
Reference in New Issue
Block a user