Improved json auto save & budget mobile UI
This commit is contained in:
@@ -12,25 +12,36 @@ class ImportSettings extends StatelessWidget {
|
||||
builder: (context, state) => TitledContainer(
|
||||
title: "Import",
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
FilledButton(
|
||||
FilledButton.icon(
|
||||
onPressed: () => context.read<AccountBloc>().add(const ClearData()),
|
||||
label: const Text('ClearData'),
|
||||
icon: const Icon(Icons.delete_forever),
|
||||
),
|
||||
const SizedBox(height: 5),
|
||||
FilledButton.tonalIcon(
|
||||
onPressed: () => context.read<AccountBloc>().add(const AccountImportCSV()),
|
||||
child: const Text('Import CSV')
|
||||
label: const Text('Import CSV'),
|
||||
icon: const Icon(Icons.upload_file),
|
||||
),
|
||||
const SizedBox(height: 5),
|
||||
FilledButton(
|
||||
FilledButton.tonalIcon(
|
||||
onPressed: () => context.read<AccountBloc>().add(const AccountImportJSON()),
|
||||
child: const Text('Import JSON')
|
||||
label: const Text('Import JSON'),
|
||||
icon: const Icon(Icons.upload_file),
|
||||
),
|
||||
const SizedBox(height: 5),
|
||||
FilledButton(
|
||||
FilledButton.tonalIcon(
|
||||
onPressed: () => context.read<AccountBloc>().add(const AccountExportCSV()),
|
||||
child: const Text('Export CSV')
|
||||
label: const Text('Export CSV'),
|
||||
icon: const Icon(Icons.download),
|
||||
),
|
||||
const SizedBox(height: 5),
|
||||
FilledButton(
|
||||
FilledButton.tonalIcon(
|
||||
onPressed: () => context.read<AccountBloc>().add(const AccountExportJSON()),
|
||||
child: const Text('Export JSON')
|
||||
label: const Text('Export JSON'),
|
||||
icon: const Icon(Icons.download),
|
||||
),
|
||||
],
|
||||
),
|
||||
|
||||
39
lib/pages/data/widgets/settings_settings.dart
Normal file
39
lib/pages/data/widgets/settings_settings.dart
Normal file
@@ -0,0 +1,39 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_bloc/flutter_bloc.dart';
|
||||
import 'package:tunas/domains/settings/settings_bloc.dart';
|
||||
import 'package:tunas/pages/common/titled_container.dart';
|
||||
|
||||
class SettingsSettings extends StatelessWidget {
|
||||
const SettingsSettings({super.key});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return BlocBuilder<SettingsBloc, SettingsState>(
|
||||
builder: (context, state) => TitledContainer(
|
||||
title: "Theme",
|
||||
child: Column(
|
||||
children: [
|
||||
SegmentedButton<ThemeMode>(
|
||||
segments: const [
|
||||
ButtonSegment(
|
||||
value: ThemeMode.system,
|
||||
icon: Icon(Icons.settings)
|
||||
),
|
||||
ButtonSegment(
|
||||
value: ThemeMode.light,
|
||||
icon: Icon(Icons.light_mode)
|
||||
),
|
||||
ButtonSegment(
|
||||
value: ThemeMode.dark,
|
||||
icon: Icon(Icons.dark_mode)
|
||||
),
|
||||
],
|
||||
selected: {state.themeMode},
|
||||
onSelectionChanged: (themeMode) => context.read<SettingsBloc>().add(SetThemeMode(themeMode.first)),
|
||||
)
|
||||
],
|
||||
),
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user