Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release 0.10.1 #265

Merged
merged 6 commits into from
Jan 7, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Changelog

## Next
## Beta 0.10.1

### New features

Expand Down
46 changes: 38 additions & 8 deletions lib/routes/setup/setup_profile_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ import "package:flow/form_validators.dart";
import "package:flow/l10n/extensions.dart";
import "package:flow/objectbox.dart";
import "package:flow/objectbox/objectbox.g.dart";
import "package:flow/prefs.dart";
import "package:flow/utils/utils.dart";
import "package:flow/widgets/general/button.dart";
import "package:flutter/material.dart";
import "package:go_router/go_router.dart";
Expand All @@ -24,6 +26,8 @@ class _SetupProfilePageState extends State<SetupProfilePage> {

final GlobalKey<FormState> formKey = GlobalKey();

bool testMode = false;

bool busy = false;

@override
Expand All @@ -48,13 +52,31 @@ class _SetupProfilePageState extends State<SetupProfilePage> {
child: Form(
key: formKey,
child: SingleChildScrollView(
padding: const EdgeInsets.all(16.0),
child: TextFormField(
controller: _textEditingController,
autofocus: true,
validator: validateRequiredField,
textInputAction: TextInputAction.send,
onFieldSubmitted: (value) => save(),
padding: const EdgeInsets.symmetric(vertical: 16.0),
child: Column(
children: [
Padding(
padding: const EdgeInsets.symmetric(horizontal: 16.0),
child: TextFormField(
controller: _textEditingController,
autofocus: true,
validator: validateRequiredField,
textInputAction: TextInputAction.send,
onFieldSubmitted: (value) => save(),
),
),
const SizedBox(height: 16.0),
if (_textEditingController.text.trim().toLowerCase() == "test")
CheckboxListTile.adaptive(
title: Text("Enable demo mode"),
value: testMode,
onChanged: (value) {
setState(() {
testMode = value ?? testMode;
});
},
),
],
),
),
),
Expand Down Expand Up @@ -99,7 +121,15 @@ class _SetupProfilePageState extends State<SetupProfilePage> {
final updatedProfile =
await ObjectBox().box<Profile>().putAndGetAsync(_currentlyEditing!);

if (mounted) {
if (testMode) {
unawaited(LocalPreferences().primaryCurrency.set("USD"));
unawaited(ObjectBox().createAndPutDebugData());
if (mounted) {
GoRouter.of(context).popUntil((route) => route.path == "/setup");

context.pushReplacement("/");
}
} else if (mounted) {
await context.push(
"/setup/profile/photo",
extra: updatedProfile.imagePath,
Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ description: A personal finance managing app

publish_to: "none" # Remove this line if you wish to publish to pub.dev

version: "0.10.1+100"
version: "0.10.1+101"

environment:
sdk: ">=3.5.0 <4.0.0"
Expand Down
Loading