-
-
Notifications
You must be signed in to change notification settings - Fork 3
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
9 changed files
with
120 additions
and
11 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,8 @@ | ||
library control; | ||
library; | ||
|
||
export 'package:control/src/concurrent_controller_handler.dart'; | ||
export 'package:control/src/concurrency/concurrency.dart'; | ||
export 'package:control/src/controller.dart' hide IController; | ||
export 'package:control/src/controller_scope.dart' hide ControllerScope$Element; | ||
export 'package:control/src/droppable_controller_handler.dart'; | ||
export 'package:control/src/sequential_controller_handler.dart'; | ||
export 'package:control/src/handler_context.dart' show HandlerContext; | ||
export 'package:control/src/state_consumer.dart'; | ||
export 'package:control/src/state_controller.dart' hide IStateController; |
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,3 @@ | ||
export 'package:control/src/concurrency/concurrent_controller_handler.dart'; | ||
export 'package:control/src/concurrency/droppable_controller_handler.dart'; | ||
export 'package:control/src/concurrency/sequential_controller_handler.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
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
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,43 @@ | ||
import 'dart:async'; | ||
|
||
import 'package:control/src/controller.dart'; | ||
import 'package:meta/meta.dart'; | ||
|
||
/// Handler's context. | ||
abstract interface class HandlerContext { | ||
/// Key to access the handler's context. | ||
static const Object key = #handler; | ||
|
||
/// Get the handler's context from the current zone. | ||
static HandlerContext? zoned() => switch (Zone.current[HandlerContext.key]) { | ||
HandlerContext context => context, | ||
_ => null, | ||
}; | ||
|
||
/// Controller that the handler is attached to. | ||
abstract final Controller controller; | ||
|
||
/// Name of the handler. | ||
abstract final String name; | ||
|
||
/// Extra meta information about the handler. | ||
abstract final Map<String, Object?> context; | ||
} | ||
|
||
@internal | ||
final class HandlerContextImpl implements HandlerContext { | ||
HandlerContextImpl({ | ||
required this.controller, | ||
required this.name, | ||
required this.context, | ||
}); | ||
|
||
@override | ||
final Controller controller; | ||
|
||
@override | ||
final String name; | ||
|
||
@override | ||
final Map<String, Object?> context; | ||
} |
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