Skip to content

Commit

Permalink
fix bug with setting the personal substitute on app start to false
Browse files Browse the repository at this point in the history
  • Loading branch information
Vinzent03 committed Nov 19, 2020
1 parent 6cfcfb8 commit 1d70394
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 9 deletions.
10 changes: 2 additions & 8 deletions lib/main/introScreen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,6 @@ class _IntroScreenState extends State<IntroScreen> {
color: Colors.blue[800], fontSize: 35, fontWeight: FontWeight.w600);
EdgeInsets titlePadding = EdgeInsets.symmetric(vertical: 100);

@override
void initState() {
//Default value for personal substitute is false, prevent if the user doesn't change the switch
SharedPref().setBool(Names.personalSubstitute, false);
super.initState();
}

@override
Widget build(BuildContext context) {
Expand Down Expand Up @@ -130,7 +124,6 @@ class _IntroScreenState extends State<IntroScreen> {
title: Text("Personalisierte Vertretung"),
onChanged: (bool value) {
setState(() => personalSubstitute = value);
SharedPref().setBool(Names.personalSubstitute, value);
},
value: personalSubstitute,
),
Expand Down Expand Up @@ -213,7 +206,8 @@ class _IntroScreenState extends State<IntroScreen> {
alreadyPressed = true;
ProgressDialog pr =
ProgressDialog(context, isDismissible: false, showLogs: false);

await SharedPref()
.setBool(Names.personalSubstitute, personalSubstitute);
String name = nameController.text;
if (name == "") name = "Nicht festgelegt";
if (kIsWeb) {
Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ description: LUL
# In iOS, build-name is used as CFBundleShortVersionString while build-number used as CFBundleVersion.
# Read more about iOS versioning at
# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
version: 1.3.6+30
version: 1.3.7+31

environment:
sdk: ">=2.2.2 <3.0.0"
Expand Down

0 comments on commit 1d70394

Please sign in to comment.