-
Notifications
You must be signed in to change notification settings - Fork 98
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
11 changed files
with
174 additions
and
306 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
26 changes: 3 additions & 23 deletions
26
packages/espressocash_app/lib/features/outgoing_direct_payments/module.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 |
---|---|---|
@@ -1,37 +1,17 @@ | ||
import 'package:flutter/material.dart'; | ||
import 'package:nested/nested.dart'; | ||
import 'package:provider/provider.dart'; | ||
|
||
import '../../di.dart'; | ||
import '../accounts/module.dart'; | ||
import '../balances/widgets/context_ext.dart'; | ||
import 'data/repository.dart'; | ||
import 'services/tx_created_watcher.dart'; | ||
import 'services/tx_sent_watcher.dart'; | ||
import 'widgets/link_listener.dart'; | ||
|
||
class ODPModule extends SingleChildStatelessWidget { | ||
const ODPModule({super.key, super.child}); | ||
|
||
@override | ||
Widget buildWithChild(BuildContext context, Widget? child) => MultiProvider( | ||
providers: [ | ||
Provider<TxCreatedWatcher>( | ||
lazy: false, | ||
create: (context) => sl<TxCreatedWatcher>() | ||
..call(onBalanceAffected: () => context.notifyBalanceAffected()), | ||
dispose: (_, value) => value.dispose(), | ||
), | ||
Provider<TxSentWatcher>( | ||
lazy: false, | ||
create: (context) => sl<TxSentWatcher>() | ||
..call(onBalanceAffected: () => context.notifyBalanceAffected()), | ||
dispose: (_, value) => value.dispose(), | ||
), | ||
], | ||
child: LogoutListener( | ||
onLogout: (_) => sl<ODPRepository>().clear(), | ||
child: ODPLinkListener(child: child ?? const SizedBox.shrink()), | ||
), | ||
Widget buildWithChild(BuildContext context, Widget? child) => LogoutListener( | ||
onLogout: (_) => sl<ODPRepository>().clear(), | ||
child: ODPLinkListener(child: child ?? const SizedBox.shrink()), | ||
); | ||
} |
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
74 changes: 0 additions & 74 deletions
74
...ages/espressocash_app/lib/features/outgoing_direct_payments/services/payment_watcher.dart
This file was deleted.
Oops, something went wrong.
64 changes: 0 additions & 64 deletions
64
...s/espressocash_app/lib/features/outgoing_direct_payments/services/tx_created_watcher.dart
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.