Source Code added
This commit is contained in:
parent
800376eafd
commit
9efa9bc6dd
3912 changed files with 754770 additions and 2 deletions
12
mobile/lib/providers/infrastructure/cancel.provider.dart
Normal file
12
mobile/lib/providers/infrastructure/cancel.provider.dart
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
import 'package:hooks_riverpod/hooks_riverpod.dart';
|
||||
|
||||
/// Provider holding a boolean function that returns true when cancellation is requested.
|
||||
/// A computation running in the isolate uses the function to implement cooperative cancellation.
|
||||
final cancellationProvider = Provider<bool Function()>(
|
||||
// This will be overridden in the isolate's container.
|
||||
// Throwing ensures it's not used without an override.
|
||||
(ref) => throw UnimplementedError(
|
||||
"cancellationProvider must be overridden in the isolate's ProviderContainer and not to be used in the root isolate",
|
||||
),
|
||||
name: 'cancellationProvider',
|
||||
);
|
||||
Loading…
Add table
Add a link
Reference in a new issue