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_kreta_api/client/client.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_item.dart';
|
||||
import 'package:filcnaplo_mobile_ui/common/panel/panel.dart';
|
||||
@ -157,7 +158,8 @@ class _SettingsScreenState extends State<SettingsScreen>
|
||||
void initState() {
|
||||
super.initState();
|
||||
Future.delayed(Duration.zero, () {
|
||||
futureRelease = Provider.of<UpdateProvider>(context, listen: false).installedVersion();
|
||||
futureRelease = Provider.of<UpdateProvider>(context, listen: false)
|
||||
.installedVersion();
|
||||
});
|
||||
_hideContainersController = AnimationController(
|
||||
vsync: this, duration: const Duration(milliseconds: 200));
|
||||
@ -446,9 +448,14 @@ class _SettingsScreenState extends State<SettingsScreen>
|
||||
contentPadding: const EdgeInsets.only(left: 12.0),
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(12.0)),
|
||||
title: Row(children: [
|
||||
title: Row(
|
||||
children: [
|
||||
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),
|
||||
Text(
|
||||
"notifications".i18n,
|
||||
@ -462,34 +469,11 @@ class _SettingsScreenState extends State<SettingsScreen>
|
||||
const SizedBox(
|
||||
width: 5,
|
||||
),
|
||||
SizedBox(
|
||||
height: 30,
|
||||
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))),
|
||||
BetaChip(
|
||||
disabled: !settings.notificationsEnabled,
|
||||
),
|
||||
decoration: BoxDecoration(
|
||||
color: settings.notificationsEnabled
|
||||
? Theme.of(context).colorScheme.secondary
|
||||
: AppColors.of(context).text.withOpacity(.25),
|
||||
borderRadius: BorderRadius.circular(40)),
|
||||
],
|
||||
),
|
||||
)
|
||||
]),
|
||||
onChanged: (value) =>
|
||||
settings.update(notificationsEnabled: value),
|
||||
),
|
||||
@ -927,7 +911,8 @@ class _SettingsScreenState extends State<SettingsScreen>
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(12.0)),
|
||||
title: Text("devmode".i18n,
|
||||
style: const TextStyle(fontWeight: FontWeight.w500)),
|
||||
style:
|
||||
const TextStyle(fontWeight: FontWeight.w500)),
|
||||
onChanged: (v) =>
|
||||
settings.update(developerMode: false),
|
||||
value: settings.developerMode,
|
||||
@ -1002,8 +987,8 @@ class _SettingsScreenState extends State<SettingsScreen>
|
||||
if (devmodeCountdown > 0) {
|
||||
ScaffoldMessenger.of(context).showSnackBar(SnackBar(
|
||||
duration: const Duration(milliseconds: 200),
|
||||
content: Text(
|
||||
"devmoretaps".i18n.fill([devmodeCountdown])),
|
||||
content:
|
||||
Text("devmoretaps".i18n.fill([devmodeCountdown])),
|
||||
));
|
||||
|
||||
setState(() => devmodeCountdown--);
|
||||
|
@ -163,7 +163,7 @@ extension SettingsLocalization on String {
|
||||
"theme": "Thema",
|
||||
"color": "Farbe",
|
||||
"grade_colors": "Grad Farben",
|
||||
"notifications": "Benachrichtigungen",
|
||||
"notifications": "Mitteilung",
|
||||
"news": "Nachrichten",
|
||||
"extras": "Extras",
|
||||
"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:flutter/material.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
import 'package:filcnaplo_mobile_ui/common/beta_chip.dart';
|
||||
|
||||
enum PlanResult {
|
||||
available, // There are possible solutions
|
||||
@ -128,11 +129,19 @@ class _GoalPlannerTestState extends State<GoalPlannerTest> {
|
||||
const BackButton(),
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(right: 15.0),
|
||||
child: Text(
|
||||
child: Row(
|
||||
children: [
|
||||
Text(
|
||||
'goal_planner_title'.i18n,
|
||||
style: const TextStyle(
|
||||
fontWeight: FontWeight.w500, fontSize: 18.0),
|
||||
),
|
||||
const SizedBox(
|
||||
width: 5,
|
||||
),
|
||||
const BetaChip(),
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
|
Loading…
x
Reference in New Issue
Block a user