-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
68 changed files
with
1,246 additions
and
2,743 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
22 changes: 22 additions & 0 deletions
22
mobile/lib/src/features/schedules/presentations/expense/expense_schedule_detail_screen.dart
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import 'package:flutter/material.dart'; | ||
import 'package:flutter_riverpod/flutter_riverpod.dart'; | ||
import 'package:suito/i18n/translations.g.dart'; | ||
|
||
import 'expense_schedule_detail_view.dart'; | ||
|
||
class ExpenseScheduleDetailScreen extends ConsumerWidget { | ||
const ExpenseScheduleDetailScreen({super.key}); | ||
|
||
@override | ||
Widget build(BuildContext context, WidgetRef ref) { | ||
return Scaffold( | ||
appBar: AppBar( | ||
title: Text(t.transactions.detail.title), | ||
), | ||
body: const Padding( | ||
padding: EdgeInsets.symmetric(horizontal: 12), | ||
child: ExpenseScheduleDetailView(), | ||
), | ||
); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
22 changes: 22 additions & 0 deletions
22
mobile/lib/src/features/schedules/presentations/income/income_schedule_detail_screen.dart
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import 'package:flutter/material.dart'; | ||
import 'package:flutter_riverpod/flutter_riverpod.dart'; | ||
import 'package:suito/i18n/translations.g.dart'; | ||
|
||
import 'income_schedule_detail_view.dart'; | ||
|
||
class IncomeScheduleDetailScreen extends ConsumerWidget { | ||
const IncomeScheduleDetailScreen({super.key}); | ||
|
||
@override | ||
Widget build(BuildContext context, WidgetRef ref) { | ||
return Scaffold( | ||
appBar: AppBar( | ||
title: Text(t.transactions.detail.title), | ||
), | ||
body: const Padding( | ||
padding: EdgeInsets.symmetric(horizontal: 12), | ||
child: IncomeScheduleDetailView(), | ||
), | ||
); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
42 changes: 42 additions & 0 deletions
42
mobile/lib/src/features/schedules/presentations/schedule/schedules_expense_list_header.dart
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
import 'package:flutter/material.dart'; | ||
import 'package:flutter_riverpod/flutter_riverpod.dart'; | ||
import 'package:suito/i18n/translations.g.dart'; | ||
import 'package:suito/src/constants/app_sizes.dart'; | ||
import 'package:suito/src/features/transactions/services/transaction/transaction_detail_navigator.dart'; | ||
|
||
class SchedulesExpenseListHeader extends ConsumerWidget { | ||
const SchedulesExpenseListHeader({super.key}); | ||
|
||
@override | ||
Widget build(BuildContext context, WidgetRef ref) { | ||
final navigator = ref.watch(transactionDetailNavigatorProvider.notifier); | ||
|
||
return Padding( | ||
padding: const EdgeInsets.only(top: 8.0), | ||
child: Container( | ||
color: Colors.white, | ||
child: Column( | ||
children: [ | ||
Row( | ||
children: [ | ||
gapW12, | ||
Text( | ||
t.schedules.expansionTile.expenseHeader, | ||
), | ||
IconButton( | ||
icon: const Icon( | ||
Icons.add_circle, | ||
color: Colors.red, | ||
), | ||
onPressed: navigator.goNewExpenseSchedule), | ||
], | ||
), | ||
const Divider( | ||
height: 0, | ||
), | ||
], | ||
), | ||
), | ||
); | ||
} | ||
} |
59 changes: 59 additions & 0 deletions
59
mobile/lib/src/features/schedules/presentations/schedule/schedules_expense_list_item.dart
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
import 'package:flutter/material.dart'; | ||
import 'package:flutter_riverpod/flutter_riverpod.dart'; | ||
import 'package:openapi/openapi.dart'; | ||
import 'package:suito/i18n/translations.g.dart'; | ||
import 'package:suito/src/common_widgets/custom_dismissible.dart'; | ||
import 'package:suito/src/constants/app_sizes.dart'; | ||
import 'package:suito/src/features/schedules/services/expense/delete_expense_schedule_controller.dart'; | ||
import 'package:suito/src/features/transactions/services/transaction/transaction_detail_navigator.dart'; | ||
import 'package:suito/src/utils/currency_formatter.dart'; | ||
|
||
class SchedulesExpenseListItem extends ConsumerWidget { | ||
final TransactionSchedule item; | ||
|
||
const SchedulesExpenseListItem({super.key, required this.item}); | ||
|
||
@override | ||
Widget build(BuildContext context, WidgetRef ref) { | ||
final currencyFormatter = ref.watch(currencyFormatterProvider); | ||
final navigator = ref.watch(transactionDetailNavigatorProvider.notifier); | ||
|
||
return CustomDismissible( | ||
key: Key(item.id), | ||
onDismissed: (direction) async { | ||
final ScaffoldMessengerState state = ScaffoldMessenger.of(context); | ||
|
||
await ref | ||
.read(deleteExpenseScheduleControllerProvider.notifier) | ||
.deleteExpenseSchedule(item.id); | ||
|
||
// Show a snackbar. | ||
state.showSnackBar( | ||
SnackBar(content: Text(t.general.dismissible.snackBar))); | ||
}, | ||
child: GestureDetector( | ||
onTap: () => navigator.goFetchExpenseSchedule(item.id), | ||
child: Container( | ||
color: Colors.white, | ||
child: SizedBox( | ||
height: 50, | ||
child: Row(mainAxisAlignment: MainAxisAlignment.end, children: [ | ||
Text(item.title), | ||
gapW64, | ||
gapW64, | ||
SizedBox( | ||
width: 64, | ||
child: Align( | ||
alignment: Alignment.centerRight, | ||
child: Text(currencyFormatter.format(item.amount), | ||
style: const TextStyle( | ||
color: Colors.green, | ||
)))), | ||
gapW32 | ||
]), | ||
), | ||
), | ||
), | ||
); | ||
} | ||
} |
42 changes: 42 additions & 0 deletions
42
mobile/lib/src/features/schedules/presentations/schedule/schedules_income_list_header.dart
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
import 'package:flutter/material.dart'; | ||
import 'package:flutter_riverpod/flutter_riverpod.dart'; | ||
import 'package:suito/i18n/translations.g.dart'; | ||
import 'package:suito/src/constants/app_sizes.dart'; | ||
import 'package:suito/src/features/transactions/services/transaction/transaction_detail_navigator.dart'; | ||
|
||
class SchedulesIncomeListHeader extends ConsumerWidget { | ||
const SchedulesIncomeListHeader({super.key}); | ||
|
||
@override | ||
Widget build(BuildContext context, WidgetRef ref) { | ||
final navigator = ref.watch(transactionDetailNavigatorProvider.notifier); | ||
|
||
return Padding( | ||
padding: const EdgeInsets.only(top: 8.0), | ||
child: Container( | ||
color: Colors.white, | ||
child: Column( | ||
children: [ | ||
Row( | ||
children: [ | ||
gapW12, | ||
Text( | ||
t.schedules.expansionTile.incomeHeader, | ||
), | ||
IconButton( | ||
icon: const Icon( | ||
Icons.add_circle, | ||
color: Colors.green, | ||
), | ||
onPressed: navigator.goNewIncomeSchedule), | ||
], | ||
), | ||
const Divider( | ||
height: 0, | ||
), | ||
], | ||
), | ||
), | ||
); | ||
} | ||
} |
Oops, something went wrong.