Compare commits
9 commits
405698d325
...
96135f0bf5
Author | SHA1 | Date | |
---|---|---|---|
|
96135f0bf5 | ||
|
6a25c8289c | ||
|
d7a8233f6b | ||
|
771f7a3555 | ||
|
131ebfb8ce | ||
|
ba3b4e556b | ||
|
43adaaf648 | ||
|
b4cbfe8f08 | ||
|
d3b0b1bee3 |
9 changed files with 253 additions and 235 deletions
|
@ -27,6 +27,13 @@ the three dots > 'About' or in app info in your device's setting
|
||||||
### What actually happened
|
### What actually happened
|
||||||
<!-- Here describe what ACTUALLY happened -->
|
<!-- Here describe what ACTUALLY happened -->
|
||||||
|
|
||||||
|
### Relevant logs
|
||||||
|
```
|
||||||
|
Paste your logs here
|
||||||
|
|
||||||
|
Make sure it is a codebloc
|
||||||
|
```
|
||||||
|
|
||||||
### Steps to reproduce
|
### Steps to reproduce
|
||||||
<!--
|
<!--
|
||||||
Enter the exact steps that you made when you encountered the bug,
|
Enter the exact steps that you made when you encountered the bug,
|
||||||
|
|
|
@ -16,6 +16,9 @@
|
||||||
- Graphs now display correct tooltips when displaying only income or only expenses
|
- Graphs now display correct tooltips when displaying only income or only expenses
|
||||||
- Change graph container style when using light mode
|
- Change graph container style when using light mode
|
||||||
- Make pie chart values more visible by adding the category's corresponding color as background
|
- Make pie chart values more visible by adding the category's corresponding color as background
|
||||||
|
- Welcome text on Setup view is now centered
|
||||||
|
- Editing entries is now done by tapping the entry, instead of a dedicated button
|
||||||
|
|
||||||
# 1.0.0-alpha+5
|
# 1.0.0-alpha+5
|
||||||
- Add tests
|
- Add tests
|
||||||
- Add searching through entries to homepage
|
- Add searching through entries to homepage
|
||||||
|
|
|
@ -1,3 +1,15 @@
|
||||||
|
buildscript {
|
||||||
|
ext.kotlin_version = '1.9.22'
|
||||||
|
repositories {
|
||||||
|
google()
|
||||||
|
mavenCentral()
|
||||||
|
}
|
||||||
|
|
||||||
|
dependencies {
|
||||||
|
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
allprojects {
|
allprojects {
|
||||||
repositories {
|
repositories {
|
||||||
google()
|
google()
|
||||||
|
|
|
@ -1,5 +1,3 @@
|
||||||
// ignore_for_file: inference_failure_on_function_invocation
|
|
||||||
|
|
||||||
import 'dart:async';
|
import 'dart:async';
|
||||||
|
|
||||||
import 'package:dynamic_color/dynamic_color.dart';
|
import 'package:dynamic_color/dynamic_color.dart';
|
||||||
|
@ -50,6 +48,7 @@ class _HomeViewState extends State<HomeView> {
|
||||||
var _filter = ""; // search filter
|
var _filter = ""; // search filter
|
||||||
final searchFocus = FocusNode();
|
final searchFocus = FocusNode();
|
||||||
var sort = SortType.newest;
|
var sort = SortType.newest;
|
||||||
|
OverlayEntry? overlayEntry;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
void didChangeDependencies() {
|
void didChangeDependencies() {
|
||||||
|
@ -87,11 +86,15 @@ class _HomeViewState extends State<HomeView> {
|
||||||
if (b) return;
|
if (b) return;
|
||||||
_searchActive = false;
|
_searchActive = false;
|
||||||
_filter = "";
|
_filter = "";
|
||||||
|
overlayEntry?.remove();
|
||||||
setState(() {});
|
setState(() {});
|
||||||
},
|
},
|
||||||
child: Scaffold(
|
child: Scaffold(
|
||||||
drawer: makeDrawer(context, 1),
|
drawer: makeDrawer(context, 1),
|
||||||
floatingActionButton: SpeedDial(
|
floatingActionButton: SpeedDial(
|
||||||
|
shape: const RoundedRectangleBorder(
|
||||||
|
borderRadius: BorderRadius.all(Radius.circular(16)),
|
||||||
|
),
|
||||||
icon: Icons.add,
|
icon: Icons.add,
|
||||||
activeIcon: Icons.close,
|
activeIcon: Icons.close,
|
||||||
children: [
|
children: [
|
||||||
|
@ -252,6 +255,32 @@ class _HomeViewState extends State<HomeView> {
|
||||||
_searchActive = !_searchActive;
|
_searchActive = !_searchActive;
|
||||||
if (!_searchActive) {
|
if (!_searchActive) {
|
||||||
_filter = "";
|
_filter = "";
|
||||||
|
} else {
|
||||||
|
overlayEntry = OverlayEntry(
|
||||||
|
builder: (context) => Align(
|
||||||
|
alignment: Alignment.bottomCenter,
|
||||||
|
child: SizedBox(
|
||||||
|
width: MediaQuery.of(context).size.width,
|
||||||
|
height:
|
||||||
|
MediaQuery.of(context).size.height - 100,
|
||||||
|
child: GestureDetector(
|
||||||
|
onTap: () {
|
||||||
|
if (!searchFocus.hasFocus) {
|
||||||
|
_searchActive = false;
|
||||||
|
_filter = "";
|
||||||
|
overlayEntry?.remove();
|
||||||
|
setState(() {});
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
searchFocus.unfocus();
|
||||||
|
},
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
Overlay.of(context).insert(
|
||||||
|
overlayEntry!,
|
||||||
|
);
|
||||||
}
|
}
|
||||||
setState(() {});
|
setState(() {});
|
||||||
}
|
}
|
||||||
|
@ -413,45 +442,9 @@ class _HomeViewState extends State<HomeView> {
|
||||||
: groupSortOldest(a, b, locale),
|
: groupSortOldest(a, b, locale),
|
||||||
itemBuilder: (context, element) => Slidable(
|
itemBuilder: (context, element) => Slidable(
|
||||||
endActionPane: ActionPane(
|
endActionPane: ActionPane(
|
||||||
|
extentRatio: 0.3,
|
||||||
motion: const ScrollMotion(),
|
motion: const ScrollMotion(),
|
||||||
children: [
|
children: [
|
||||||
SlidableAction(
|
|
||||||
onPressed: (c) {
|
|
||||||
Navigator.of(context)
|
|
||||||
.push<WalletSingleEntry>(
|
|
||||||
MaterialPageRoute(
|
|
||||||
builder: (c) =>
|
|
||||||
CreateSingleEntryView(
|
|
||||||
locale: locale,
|
|
||||||
w: selectedWallet!,
|
|
||||||
editEntry: element,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
)
|
|
||||||
.then(
|
|
||||||
(editedEntry) {
|
|
||||||
if (editedEntry == null) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
selectedWallet!.entries
|
|
||||||
.remove(element);
|
|
||||||
selectedWallet!.entries
|
|
||||||
.add(editedEntry);
|
|
||||||
WalletManager.saveWallet(
|
|
||||||
selectedWallet!,
|
|
||||||
);
|
|
||||||
setState(() {});
|
|
||||||
},
|
|
||||||
);
|
|
||||||
},
|
|
||||||
backgroundColor: Theme.of(context)
|
|
||||||
.colorScheme
|
|
||||||
.secondary,
|
|
||||||
foregroundColor: Theme.of(context)
|
|
||||||
.colorScheme
|
|
||||||
.onSecondary,
|
|
||||||
icon: Icons.edit,
|
|
||||||
),
|
|
||||||
SlidableAction(
|
SlidableAction(
|
||||||
backgroundColor: Theme.of(context)
|
backgroundColor: Theme.of(context)
|
||||||
.colorScheme
|
.colorScheme
|
||||||
|
@ -461,7 +454,7 @@ class _HomeViewState extends State<HomeView> {
|
||||||
.onError,
|
.onError,
|
||||||
icon: Icons.delete,
|
icon: Icons.delete,
|
||||||
onPressed: (c) {
|
onPressed: (c) {
|
||||||
showAdaptiveDialog(
|
showAdaptiveDialog<void>(
|
||||||
context: context,
|
context: context,
|
||||||
builder: (cx) =>
|
builder: (cx) =>
|
||||||
AlertDialog.adaptive(
|
AlertDialog.adaptive(
|
||||||
|
@ -511,6 +504,34 @@ class _HomeViewState extends State<HomeView> {
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
child: ListTile(
|
child: ListTile(
|
||||||
|
onTap: () {
|
||||||
|
Navigator.of(context)
|
||||||
|
.push<WalletSingleEntry>(
|
||||||
|
MaterialPageRoute(
|
||||||
|
builder: (c) =>
|
||||||
|
CreateSingleEntryView(
|
||||||
|
locale: locale,
|
||||||
|
w: selectedWallet!,
|
||||||
|
editEntry: element,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
)
|
||||||
|
.then(
|
||||||
|
(editedEntry) {
|
||||||
|
if (editedEntry == null) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
selectedWallet!.entries
|
||||||
|
.remove(element);
|
||||||
|
selectedWallet!.entries
|
||||||
|
.add(editedEntry);
|
||||||
|
WalletManager.saveWallet(
|
||||||
|
selectedWallet!,
|
||||||
|
);
|
||||||
|
setState(() {});
|
||||||
|
},
|
||||||
|
);
|
||||||
|
},
|
||||||
leading: Container(
|
leading: Container(
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
borderRadius:
|
borderRadius:
|
||||||
|
@ -581,25 +602,6 @@ class _HomeViewState extends State<HomeView> {
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
if (_searchActive)
|
|
||||||
OverlayEntry(
|
|
||||||
builder: (context) => SizedBox(
|
|
||||||
width: MediaQuery.of(context).size.width,
|
|
||||||
height: MediaQuery.of(context).size.height,
|
|
||||||
child: GestureDetector(
|
|
||||||
onTap: () {
|
|
||||||
if (!_searchActive) return;
|
|
||||||
if (!searchFocus.hasFocus) {
|
|
||||||
_searchActive = false;
|
|
||||||
_filter = "";
|
|
||||||
setState(() {});
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
searchFocus.unfocus();
|
|
||||||
},
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
@ -612,7 +614,7 @@ class _HomeViewState extends State<HomeView> {
|
||||||
final availableLanguages = await TessdataApi.getDownloadedData();
|
final availableLanguages = await TessdataApi.getDownloadedData();
|
||||||
if (availableLanguages.isEmpty) {
|
if (availableLanguages.isEmpty) {
|
||||||
if (!mounted) return;
|
if (!mounted) return;
|
||||||
await showAdaptiveDialog(
|
await showAdaptiveDialog<void>(
|
||||||
context: context,
|
context: context,
|
||||||
builder: (c) => AlertDialog.adaptive(
|
builder: (c) => AlertDialog.adaptive(
|
||||||
title: Text(AppLocalizations.of(context).missingOcr),
|
title: Text(AppLocalizations.of(context).missingOcr),
|
||||||
|
@ -645,7 +647,7 @@ class _HomeViewState extends State<HomeView> {
|
||||||
List<bool>.filled(availableLanguages.length, false);
|
List<bool>.filled(availableLanguages.length, false);
|
||||||
selectedLanguages[0] = true;
|
selectedLanguages[0] = true;
|
||||||
|
|
||||||
await showAdaptiveDialog(
|
await showAdaptiveDialog<void>(
|
||||||
context: context,
|
context: context,
|
||||||
builder: (c) => StatefulBuilder(
|
builder: (c) => StatefulBuilder(
|
||||||
builder: (ctx, setState) => AlertDialog.adaptive(
|
builder: (ctx, setState) => AlertDialog.adaptive(
|
||||||
|
|
|
@ -1,5 +1,3 @@
|
||||||
// ignore_for_file: inference_failure_on_function_invocation
|
|
||||||
|
|
||||||
import 'dart:async';
|
import 'dart:async';
|
||||||
|
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
@ -125,7 +123,6 @@ class _RecurringEntriesViewState extends State<RecurringEntriesView> {
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
floatingActionButton: FloatingActionButton(
|
floatingActionButton: FloatingActionButton(
|
||||||
shape: const CircleBorder(),
|
|
||||||
child: const Icon(Icons.add),
|
child: const Icon(Icons.add),
|
||||||
onPressed: () {
|
onPressed: () {
|
||||||
Navigator.of(context).push(
|
Navigator.of(context).push(
|
||||||
|
@ -170,38 +167,8 @@ class _RecurringEntriesViewState extends State<RecurringEntriesView> {
|
||||||
itemBuilder: (c, i) => Slidable(
|
itemBuilder: (c, i) => Slidable(
|
||||||
endActionPane: ActionPane(
|
endActionPane: ActionPane(
|
||||||
motion: const ScrollMotion(),
|
motion: const ScrollMotion(),
|
||||||
|
extentRatio: 0.3,
|
||||||
children: [
|
children: [
|
||||||
SlidableAction(
|
|
||||||
onPressed: (c) {
|
|
||||||
Navigator.of(context)
|
|
||||||
.push<RecurringWalletEntry>(
|
|
||||||
MaterialPageRoute(
|
|
||||||
builder: (c) => CreateRecurringEntryView(
|
|
||||||
w: selectedWallet!,
|
|
||||||
locale: locale,
|
|
||||||
editEntry:
|
|
||||||
selectedWallet!.recurringEntries[i],
|
|
||||||
),
|
|
||||||
),
|
|
||||||
)
|
|
||||||
.then(
|
|
||||||
(editedEntry) {
|
|
||||||
if (editedEntry == null) return;
|
|
||||||
selectedWallet!.entries.remove(
|
|
||||||
selectedWallet!.recurringEntries[i],
|
|
||||||
);
|
|
||||||
selectedWallet!.entries.add(editedEntry);
|
|
||||||
WalletManager.saveWallet(selectedWallet!);
|
|
||||||
setState(() {});
|
|
||||||
},
|
|
||||||
);
|
|
||||||
},
|
|
||||||
backgroundColor:
|
|
||||||
Theme.of(context).colorScheme.secondary,
|
|
||||||
foregroundColor:
|
|
||||||
Theme.of(context).colorScheme.onSecondary,
|
|
||||||
icon: Icons.edit,
|
|
||||||
),
|
|
||||||
SlidableAction(
|
SlidableAction(
|
||||||
backgroundColor:
|
backgroundColor:
|
||||||
Theme.of(context).colorScheme.error,
|
Theme.of(context).colorScheme.error,
|
||||||
|
@ -209,7 +176,7 @@ class _RecurringEntriesViewState extends State<RecurringEntriesView> {
|
||||||
Theme.of(context).colorScheme.onError,
|
Theme.of(context).colorScheme.onError,
|
||||||
icon: Icons.delete,
|
icon: Icons.delete,
|
||||||
onPressed: (c) {
|
onPressed: (c) {
|
||||||
showDialog(
|
showDialog<void>(
|
||||||
context: context,
|
context: context,
|
||||||
builder: (cx) => AlertDialog.adaptive(
|
builder: (cx) => AlertDialog.adaptive(
|
||||||
title: Text(
|
title: Text(
|
||||||
|
@ -247,6 +214,30 @@ class _RecurringEntriesViewState extends State<RecurringEntriesView> {
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
child: ListTile(
|
child: ListTile(
|
||||||
|
onTap: () {
|
||||||
|
Navigator.of(context)
|
||||||
|
.push<RecurringWalletEntry>(
|
||||||
|
MaterialPageRoute(
|
||||||
|
builder: (c) => CreateRecurringEntryView(
|
||||||
|
w: selectedWallet!,
|
||||||
|
locale: locale,
|
||||||
|
editEntry:
|
||||||
|
selectedWallet!.recurringEntries[i],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
)
|
||||||
|
.then(
|
||||||
|
(editedEntry) {
|
||||||
|
if (editedEntry == null) return;
|
||||||
|
selectedWallet!.entries.remove(
|
||||||
|
selectedWallet!.recurringEntries[i],
|
||||||
|
);
|
||||||
|
selectedWallet!.entries.add(editedEntry);
|
||||||
|
WalletManager.saveWallet(selectedWallet!);
|
||||||
|
setState(() {});
|
||||||
|
},
|
||||||
|
);
|
||||||
|
},
|
||||||
leading: Container(
|
leading: Container(
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
borderRadius: BorderRadius.circular(16),
|
borderRadius: BorderRadius.circular(16),
|
||||||
|
|
|
@ -1,5 +1,3 @@
|
||||||
// ignore_for_file: inference_failure_on_function_invocation
|
|
||||||
|
|
||||||
import 'dart:async';
|
import 'dart:async';
|
||||||
|
|
||||||
import 'package:dynamic_color/dynamic_color.dart';
|
import 'package:dynamic_color/dynamic_color.dart';
|
||||||
|
@ -122,6 +120,27 @@ class _EditCategoriesViewState extends State<EditCategoriesView> {
|
||||||
AppLocalizations.of(context).setupCategoriesEditHint,
|
AppLocalizations.of(context).setupCategoriesEditHint,
|
||||||
textAlign: TextAlign.center,
|
textAlign: TextAlign.center,
|
||||||
),
|
),
|
||||||
|
IconButton(
|
||||||
|
onPressed: () async {
|
||||||
|
selectedWallet!.categories.add(
|
||||||
|
WalletCategory(
|
||||||
|
name: AppLocalizations.of(context)
|
||||||
|
.setupWalletNamePlaceholder,
|
||||||
|
id: selectedWallet!.nextCategoryId,
|
||||||
|
icon: IconData(
|
||||||
|
Icons.question_mark.codePoint,
|
||||||
|
fontFamily: 'MaterialIcons',
|
||||||
|
),
|
||||||
|
color: Colors.blueGrey.harmonizeWith(
|
||||||
|
Theme.of(context).colorScheme.primary,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
await WalletManager.saveWallet(selectedWallet!);
|
||||||
|
setState(() {});
|
||||||
|
},
|
||||||
|
icon: const Icon(Icons.add),
|
||||||
|
),
|
||||||
SizedBox(
|
SizedBox(
|
||||||
height: MediaQuery.of(context).size.height * 0.64,
|
height: MediaQuery.of(context).size.height * 0.64,
|
||||||
child: ListView.builder(
|
child: ListView.builder(
|
||||||
|
@ -142,7 +161,7 @@ class _EditCategoriesViewState extends State<EditCategoriesView> {
|
||||||
.getBool("useMaterialYou") ??
|
.getBool("useMaterialYou") ??
|
||||||
false;
|
false;
|
||||||
if (!context.mounted) return;
|
if (!context.mounted) return;
|
||||||
await showAdaptiveDialog(
|
await showAdaptiveDialog<void>(
|
||||||
context: context,
|
context: context,
|
||||||
builder: (c) => AlertDialog.adaptive(
|
builder: (c) => AlertDialog.adaptive(
|
||||||
actions: [
|
actions: [
|
||||||
|
@ -211,7 +230,7 @@ class _EditCategoriesViewState extends State<EditCategoriesView> {
|
||||||
final controller = TextEditingController(
|
final controller = TextEditingController(
|
||||||
text: selectedWallet!.categories[i].name,
|
text: selectedWallet!.categories[i].name,
|
||||||
);
|
);
|
||||||
showAdaptiveDialog(
|
showAdaptiveDialog<void>(
|
||||||
context: context,
|
context: context,
|
||||||
builder: (c) => AlertDialog.adaptive(
|
builder: (c) => AlertDialog.adaptive(
|
||||||
actions: [
|
actions: [
|
||||||
|
@ -262,27 +281,6 @@ class _EditCategoriesViewState extends State<EditCategoriesView> {
|
||||||
itemCount: selectedWallet!.categories.length,
|
itemCount: selectedWallet!.categories.length,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
IconButton(
|
|
||||||
onPressed: () async {
|
|
||||||
selectedWallet!.categories.add(
|
|
||||||
WalletCategory(
|
|
||||||
name: AppLocalizations.of(context)
|
|
||||||
.setupWalletNamePlaceholder,
|
|
||||||
id: selectedWallet!.nextCategoryId,
|
|
||||||
icon: IconData(
|
|
||||||
Icons.question_mark.codePoint,
|
|
||||||
fontFamily: 'MaterialIcons',
|
|
||||||
),
|
|
||||||
color: Colors.blueGrey.harmonizeWith(
|
|
||||||
Theme.of(context).colorScheme.primary,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
);
|
|
||||||
await WalletManager.saveWallet(selectedWallet!);
|
|
||||||
setState(() {});
|
|
||||||
},
|
|
||||||
icon: const Icon(Icons.add),
|
|
||||||
),
|
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
|
|
@ -1,5 +1,3 @@
|
||||||
// ignore_for_file: inference_failure_on_function_invocation
|
|
||||||
|
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter_gen/gen_l10n/app_localizations.dart';
|
import 'package:flutter_gen/gen_l10n/app_localizations.dart';
|
||||||
import 'package:settings_ui/settings_ui.dart';
|
import 'package:settings_ui/settings_ui.dart';
|
||||||
|
@ -49,11 +47,13 @@ class _GraphTypeSettingsViewState extends State<GraphTypeSettingsView> {
|
||||||
? AppLocalizations.of(context).barChart
|
? AppLocalizations.of(context).barChart
|
||||||
: AppLocalizations.of(context).lineChart,
|
: AppLocalizations.of(context).lineChart,
|
||||||
),
|
),
|
||||||
onPressed: (c) => showAdaptiveDialog(
|
onPressed: (c) => showAdaptiveDialog<void>(
|
||||||
context: c,
|
context: c,
|
||||||
builder: (ctx) => AlertDialog.adaptive(
|
builder: (ctx) => AlertDialog.adaptive(
|
||||||
title: Text(AppLocalizations.of(context).selectType),
|
title: Text(AppLocalizations.of(context).selectType),
|
||||||
content: Column(
|
content: SizedBox(
|
||||||
|
height: 80,
|
||||||
|
child: Column(
|
||||||
children: [
|
children: [
|
||||||
SizedBox(
|
SizedBox(
|
||||||
width: MediaQuery.of(ctx).size.width,
|
width: MediaQuery.of(ctx).size.width,
|
||||||
|
@ -100,6 +100,7 @@ class _GraphTypeSettingsViewState extends State<GraphTypeSettingsView> {
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
),
|
||||||
SettingsTile.navigation(
|
SettingsTile.navigation(
|
||||||
title: Text(AppLocalizations.of(context).monthly),
|
title: Text(AppLocalizations.of(context).monthly),
|
||||||
value: Text(
|
value: Text(
|
||||||
|
@ -107,11 +108,13 @@ class _GraphTypeSettingsViewState extends State<GraphTypeSettingsView> {
|
||||||
? AppLocalizations.of(context).barChart
|
? AppLocalizations.of(context).barChart
|
||||||
: AppLocalizations.of(context).lineChart,
|
: AppLocalizations.of(context).lineChart,
|
||||||
),
|
),
|
||||||
onPressed: (c) => showDialog(
|
onPressed: (c) => showAdaptiveDialog<void>(
|
||||||
context: c,
|
context: c,
|
||||||
builder: (ctx) => AlertDialog.adaptive(
|
builder: (ctx) => AlertDialog.adaptive(
|
||||||
title: Text(AppLocalizations.of(context).selectType),
|
title: Text(AppLocalizations.of(context).selectType),
|
||||||
content: Column(
|
content: SizedBox(
|
||||||
|
height: 80,
|
||||||
|
child: Column(
|
||||||
children: [
|
children: [
|
||||||
SizedBox(
|
SizedBox(
|
||||||
width: MediaQuery.of(ctx).size.width,
|
width: MediaQuery.of(ctx).size.width,
|
||||||
|
@ -158,6 +161,7 @@ class _GraphTypeSettingsViewState extends State<GraphTypeSettingsView> {
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
|
|
|
@ -1,5 +1,3 @@
|
||||||
// ignore_for_file: inference_failure_on_function_invocation
|
|
||||||
|
|
||||||
import 'dart:async';
|
import 'dart:async';
|
||||||
import 'dart:io';
|
import 'dart:io';
|
||||||
|
|
||||||
|
@ -61,7 +59,7 @@ class _TessdataListViewState extends State<TessdataListView> {
|
||||||
final lang = _tessdata[i].keys.first;
|
final lang = _tessdata[i].keys.first;
|
||||||
if (_tessdata[i][lang]!) {
|
if (_tessdata[i][lang]!) {
|
||||||
// deleting data
|
// deleting data
|
||||||
await showAdaptiveDialog(
|
await showAdaptiveDialog<void>(
|
||||||
context: context,
|
context: context,
|
||||||
builder: (context) => AlertDialog.adaptive(
|
builder: (context) => AlertDialog.adaptive(
|
||||||
title:
|
title:
|
||||||
|
@ -101,8 +99,10 @@ class _TessdataListViewState extends State<TessdataListView> {
|
||||||
showAdaptiveDialog(
|
showAdaptiveDialog(
|
||||||
context: context,
|
context: context,
|
||||||
builder: (c) => AlertDialog.adaptive(
|
builder: (c) => AlertDialog.adaptive(
|
||||||
title: Text(AppLocalizations.of(context)
|
title: Text(
|
||||||
.langDownloadDialog(lang),),
|
AppLocalizations.of(context)
|
||||||
|
.langDownloadDialog(lang),
|
||||||
|
),
|
||||||
content: StreamBuilder(
|
content: StreamBuilder(
|
||||||
builder: (context, snapshot) {
|
builder: (context, snapshot) {
|
||||||
if (snapshot.connectionState ==
|
if (snapshot.connectionState ==
|
||||||
|
@ -152,6 +152,7 @@ class _TessdataListViewState extends State<TessdataListView> {
|
||||||
/// so we can show it to the user
|
/// so we can show it to the user
|
||||||
Future<void> loadAllTessdata() async {
|
Future<void> loadAllTessdata() async {
|
||||||
final tessDir = Directory(await FlutterTesseractOcr.getTessdataPath());
|
final tessDir = Directory(await FlutterTesseractOcr.getTessdataPath());
|
||||||
|
if (!tessDir.existsSync()) tessDir.createSync(recursive: true);
|
||||||
final d = await TessdataApi.getAvailableData();
|
final d = await TessdataApi.getAvailableData();
|
||||||
final dataStatus = <Map<String, bool>>[];
|
final dataStatus = <Map<String, bool>>[];
|
||||||
for (final data in d) {
|
for (final data in d) {
|
||||||
|
|
|
@ -1,5 +1,3 @@
|
||||||
// ignore_for_file: inference_failure_on_function_invocation
|
|
||||||
|
|
||||||
import 'dart:async';
|
import 'dart:async';
|
||||||
|
|
||||||
import 'package:currency_picker/currency_picker.dart';
|
import 'package:currency_picker/currency_picker.dart';
|
||||||
|
@ -197,15 +195,17 @@ class _SetupViewState extends State<SetupView> {
|
||||||
Flexible(
|
Flexible(
|
||||||
child: Text(
|
child: Text(
|
||||||
AppLocalizations.of(context).welcomeAboutPrasule,
|
AppLocalizations.of(context).welcomeAboutPrasule,
|
||||||
|
textAlign: TextAlign.center,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
if (!widget.newWallet)
|
if (!widget.newWallet)
|
||||||
const SizedBox(
|
const SizedBox(
|
||||||
height: 5,
|
height: 8,
|
||||||
),
|
),
|
||||||
Flexible(
|
Flexible(
|
||||||
child: Text(
|
child: Text(
|
||||||
AppLocalizations.of(context).welcomeInstruction,
|
AppLocalizations.of(context).welcomeInstruction,
|
||||||
|
textAlign: TextAlign.center,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
|
@ -303,6 +303,32 @@ class _SetupViewState extends State<SetupView> {
|
||||||
AppLocalizations.of(context).setupCategoriesEditHint,
|
AppLocalizations.of(context).setupCategoriesEditHint,
|
||||||
textAlign: TextAlign.center,
|
textAlign: TextAlign.center,
|
||||||
),
|
),
|
||||||
|
IconButton(
|
||||||
|
onPressed: () {
|
||||||
|
var id = 0;
|
||||||
|
while (categories
|
||||||
|
.where((element) => element.id == id)
|
||||||
|
.isNotEmpty) {
|
||||||
|
id++; // create unique ID
|
||||||
|
}
|
||||||
|
categories.add(
|
||||||
|
WalletCategory(
|
||||||
|
name: AppLocalizations.of(context)
|
||||||
|
.setupWalletNamePlaceholder,
|
||||||
|
id: id,
|
||||||
|
icon: IconData(
|
||||||
|
Icons.question_mark.codePoint,
|
||||||
|
fontFamily: 'MaterialIcons',
|
||||||
|
),
|
||||||
|
color: Colors.blueGrey.harmonizeWith(
|
||||||
|
Theme.of(context).colorScheme.primary,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
setState(() {});
|
||||||
|
},
|
||||||
|
icon: const Icon(Icons.add),
|
||||||
|
),
|
||||||
SizedBox(
|
SizedBox(
|
||||||
height: MediaQuery.of(context).size.height * 0.64,
|
height: MediaQuery.of(context).size.height * 0.64,
|
||||||
child: ListView.builder(
|
child: ListView.builder(
|
||||||
|
@ -321,7 +347,7 @@ class _SetupViewState extends State<SetupView> {
|
||||||
.getBool("useMaterialYou") ??
|
.getBool("useMaterialYou") ??
|
||||||
false;
|
false;
|
||||||
if (!context.mounted) return;
|
if (!context.mounted) return;
|
||||||
await showAdaptiveDialog(
|
await showAdaptiveDialog<void>(
|
||||||
context: context,
|
context: context,
|
||||||
builder: (c) => AlertDialog.adaptive(
|
builder: (c) => AlertDialog.adaptive(
|
||||||
actions: [
|
actions: [
|
||||||
|
@ -388,7 +414,7 @@ class _SetupViewState extends State<SetupView> {
|
||||||
final controller = TextEditingController(
|
final controller = TextEditingController(
|
||||||
text: categories[i].name,
|
text: categories[i].name,
|
||||||
);
|
);
|
||||||
showAdaptiveDialog(
|
showAdaptiveDialog<void>(
|
||||||
context: context,
|
context: context,
|
||||||
builder: (c) => AlertDialog.adaptive(
|
builder: (c) => AlertDialog.adaptive(
|
||||||
actions: [
|
actions: [
|
||||||
|
@ -439,32 +465,6 @@ class _SetupViewState extends State<SetupView> {
|
||||||
itemCount: categories.length,
|
itemCount: categories.length,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
IconButton(
|
|
||||||
onPressed: () {
|
|
||||||
var id = 0;
|
|
||||||
while (categories
|
|
||||||
.where((element) => element.id == id)
|
|
||||||
.isNotEmpty) {
|
|
||||||
id++; // create unique ID
|
|
||||||
}
|
|
||||||
categories.add(
|
|
||||||
WalletCategory(
|
|
||||||
name: AppLocalizations.of(context)
|
|
||||||
.setupWalletNamePlaceholder,
|
|
||||||
id: id,
|
|
||||||
icon: IconData(
|
|
||||||
Icons.question_mark.codePoint,
|
|
||||||
fontFamily: 'MaterialIcons',
|
|
||||||
),
|
|
||||||
color: Colors.blueGrey.harmonizeWith(
|
|
||||||
Theme.of(context).colorScheme.primary,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
);
|
|
||||||
setState(() {});
|
|
||||||
},
|
|
||||||
icon: const Icon(Icons.add),
|
|
||||||
),
|
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|
Loading…
Reference in a new issue