@@ -681,7 +681,7 @@ class Actions extends StatefulWidget {
681
681
// getElementForInheritedWidgetOfExactType. Returns true if the visitor found
682
682
// what it was looking for.
683
683
static bool _visitActionsAncestors (BuildContext context, bool Function (InheritedElement element) visitor) {
684
- InheritedElement ? actionsElement = context.getElementForInheritedWidgetOfExactType <_ActionsMarker >();
684
+ InheritedElement ? actionsElement = context.getElementForInheritedWidgetOfExactType <_ActionsScope >();
685
685
while (actionsElement != null ) {
686
686
if (visitor (actionsElement) == true ) {
687
687
break ;
@@ -690,7 +690,7 @@ class Actions extends StatefulWidget {
690
690
// context.getElementForInheritedWidgetOfExactType will return itself if it
691
691
// happens to be of the correct type.
692
692
final BuildContext parent = _getParent (actionsElement);
693
- actionsElement = parent.getElementForInheritedWidgetOfExactType <_ActionsMarker >();
693
+ actionsElement = parent.getElementForInheritedWidgetOfExactType <_ActionsScope >();
694
694
}
695
695
return actionsElement != null ;
696
696
}
@@ -700,7 +700,7 @@ class Actions extends StatefulWidget {
700
700
static ActionDispatcher _findDispatcher (BuildContext context) {
701
701
ActionDispatcher ? dispatcher;
702
702
_visitActionsAncestors (context, (InheritedElement element) {
703
- final ActionDispatcher ? found = (element.widget as _ActionsMarker ).dispatcher;
703
+ final ActionDispatcher ? found = (element.widget as _ActionsScope ).dispatcher;
704
704
if (found != null ) {
705
705
dispatcher = found;
706
706
return true ;
@@ -807,7 +807,7 @@ class Actions extends StatefulWidget {
807
807
);
808
808
809
809
_visitActionsAncestors (context, (InheritedElement element) {
810
- final _ActionsMarker actions = element.widget as _ActionsMarker ;
810
+ final _ActionsScope actions = element.widget as _ActionsScope ;
811
811
final Action <T >? result = _castAction (actions, intent: intent);
812
812
if (result != null ) {
813
813
context.dependOnInheritedElement (element);
@@ -836,7 +836,7 @@ class Actions extends StatefulWidget {
836
836
);
837
837
838
838
_visitActionsAncestors (context, (InheritedElement element) {
839
- final _ActionsMarker actions = element.widget as _ActionsMarker ;
839
+ final _ActionsScope actions = element.widget as _ActionsScope ;
840
840
final Action <T >? result = _castAction (actions, intent: intent);
841
841
if (result != null ) {
842
842
action = result;
@@ -849,8 +849,8 @@ class Actions extends StatefulWidget {
849
849
}
850
850
851
851
// Find the [Action] that handles the given `intent` in the given
852
- // `_ActionsMarker `, and verify it has the right type parameter.
853
- static Action <T >? _castAction <T extends Intent >(_ActionsMarker actionsMarker, { T ? intent }) {
852
+ // `_ActionsScope `, and verify it has the right type parameter.
853
+ static Action <T >? _castAction <T extends Intent >(_ActionsScope actionsMarker, { T ? intent }) {
854
854
final Action <Intent >? mappedAction = actionsMarker.actions[intent? .runtimeType ?? T ];
855
855
if (mappedAction is Action <T >? ) {
856
856
return mappedAction;
@@ -870,7 +870,7 @@ class Actions extends StatefulWidget {
870
870
/// widget is found.
871
871
static ActionDispatcher of (BuildContext context) {
872
872
assert (context != null );
873
- final _ActionsMarker ? marker = context.dependOnInheritedWidgetOfExactType <_ActionsMarker >();
873
+ final _ActionsScope ? marker = context.dependOnInheritedWidgetOfExactType <_ActionsScope >();
874
874
return marker? .dispatcher ?? _findDispatcher (context);
875
875
}
876
876
@@ -897,7 +897,7 @@ class Actions extends StatefulWidget {
897
897
Object ? returnValue;
898
898
899
899
final bool actionFound = _visitActionsAncestors (context, (InheritedElement element) {
900
- final _ActionsMarker actions = element.widget as _ActionsMarker ;
900
+ final _ActionsScope actions = element.widget as _ActionsScope ;
901
901
final Action <T >? result = _castAction (actions, intent: intent);
902
902
if (result != null && result.isEnabled (intent)) {
903
903
// Invoke the action we found using the relevant dispatcher from the Actions
@@ -950,7 +950,7 @@ class Actions extends StatefulWidget {
950
950
Object ? returnValue;
951
951
952
952
_visitActionsAncestors (context, (InheritedElement element) {
953
- final _ActionsMarker actions = element.widget as _ActionsMarker ;
953
+ final _ActionsScope actions = element.widget as _ActionsScope ;
954
954
final Action <T >? result = _castAction (actions, intent: intent);
955
955
if (result != null && result.isEnabled (intent)) {
956
956
// Invoke the action we found using the relevant dispatcher from the Actions
@@ -1024,7 +1024,7 @@ class _ActionsState extends State<Actions> {
1024
1024
1025
1025
@override
1026
1026
Widget build (BuildContext context) {
1027
- return _ActionsMarker (
1027
+ return _ActionsScope (
1028
1028
actions: widget.actions,
1029
1029
dispatcher: widget.dispatcher,
1030
1030
rebuildKey: rebuildKey,
@@ -1035,8 +1035,8 @@ class _ActionsState extends State<Actions> {
1035
1035
1036
1036
// An inherited widget used by Actions widget for fast lookup of the Actions
1037
1037
// widget information.
1038
- class _ActionsMarker extends InheritedWidget {
1039
- const _ActionsMarker ({
1038
+ class _ActionsScope extends InheritedWidget {
1039
+ const _ActionsScope ({
1040
1040
required this .dispatcher,
1041
1041
required this .actions,
1042
1042
required this .rebuildKey,
@@ -1049,7 +1049,7 @@ class _ActionsMarker extends InheritedWidget {
1049
1049
final Object rebuildKey;
1050
1050
1051
1051
@override
1052
- bool updateShouldNotify (_ActionsMarker oldWidget) {
1052
+ bool updateShouldNotify (_ActionsScope oldWidget) {
1053
1053
return rebuildKey != oldWidget.rebuildKey
1054
1054
|| oldWidget.dispatcher != dispatcher
1055
1055
|| ! mapEquals <Type , Action <Intent >>(oldWidget.actions, actions);
0 commit comments