dynamic theme, basic category settings

This commit is contained in:
2024-02-25 13:22:45 +01:00
parent 2006ebf5cb
commit 2b53d1ab74
20 changed files with 372 additions and 146 deletions

View File

@@ -112,28 +112,22 @@ class StatsPage extends StatelessWidget {
Widget build(BuildContext context) {
MediaQueryData mediaQuery = MediaQuery.of(context);
bool smallVerticalScreen = MediaQuery.sizeOf(context).width < 800;
return BlocProvider(
create: (context) => ChartBloc(
metadataRepository: RepositoryProvider.of<MetadataRepository>(context),
transactionsRepository: RepositoryProvider.of<TransactionsRepository>(context),
),
child: BlocBuilder<ChartBloc, ChartState>(
builder: (context, state) => ListView(
padding: mediaQuery.padding.copyWith(bottom: 100.0),
children: [
smallVerticalScreen ? _smallScreenHeader(state) : _largeScreenHeader(state),
SizedBox(
height: smallVerticalScreen ? 100 : 200,
child: GlobalTotalChart(monthlyTotals: state.scopedMonthlyTotals)
),
SizedBox(
height: smallVerticalScreen ? 200 : 500,
child: MonthlyCategoriesTotalChart(categoriesMonthlyTotals: state.scopedCategoriesMonthlyTotals)
),
smallVerticalScreen ? _smallScreenTotalsCharts(state) : _largeScreenTotalsCharts(state),
],
)
),
return BlocBuilder<ChartBloc, ChartState>(
builder: (context, state) => ListView(
padding: mediaQuery.padding.copyWith(bottom: 100.0),
children: [
smallVerticalScreen ? _smallScreenHeader(state) : _largeScreenHeader(state),
SizedBox(
height: smallVerticalScreen ? 100 : 200,
child: GlobalTotalChart(monthlyTotals: state.scopedMonthlyTotals)
),
SizedBox(
height: smallVerticalScreen ? 200 : 500,
child: MonthlyCategoriesTotalChart(categoriesMonthlyTotals: state.scopedCategoriesMonthlyTotals)
),
smallVerticalScreen ? _smallScreenTotalsCharts(state) : _largeScreenTotalsCharts(state),
],
)
);
}
}

View File

@@ -35,15 +35,6 @@ class AccountCounter extends StatelessWidget {
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(15),
color: Theme.of(context).colorScheme.primaryContainer,
boxShadow: [
BoxShadow(
color: Theme.of(context).colorScheme.shadow,
blurRadius: 10,
offset: const Offset(2, 2),
spreadRadius: 0.1,
blurStyle: BlurStyle.normal,
)
]
),
alignment: Alignment.centerRight,
child: Column(

View File

@@ -71,15 +71,6 @@ class CategoriesTotalsChart extends StatelessWidget {
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(15),
color: Theme.of(context).colorScheme.primaryContainer,
boxShadow: [
BoxShadow(
color: Theme.of(context).colorScheme.shadow,
blurRadius: 10,
offset: const Offset(2, 2),
spreadRadius: 0.1,
blurStyle: BlurStyle.normal,
)
]
),
child: Row(
children: [

View File

@@ -14,15 +14,6 @@ class GlobalCounter extends StatelessWidget {
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(15),
color: Theme.of(context).colorScheme.primaryContainer,
boxShadow: [
BoxShadow(
color: Theme.of(context).colorScheme.shadow,
blurRadius: 10,
offset: const Offset(2, 2),
spreadRadius: 0.1,
blurStyle: BlurStyle.normal,
)
]
),
alignment: Alignment.centerRight,
child: Text(