-
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.
Outlined basic architecture for WizardNode
- Loading branch information
Showing
4 changed files
with
43 additions
and
36 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,3 +1,41 @@ | ||
import 'package:flutter/material.dart'; | ||
import 'wizard_scope.dart'; | ||
|
||
//! Instead of implementing all the Focus classes + widgets, maybe we should | ||
//! create widgets that manage their construction / lifecycle. The API is really | ||
//! difficult to abstract. | ||
//! difficult to abstract. | ||
|
||
//? We don't actually need to add anything to the Focus classes themselves; | ||
// objects like FocusTraversalPolicy should be working out-of-the-box, so it's | ||
// probably a better idea to avoid this approach altogether. | ||
|
||
/// Represents an indiviudal node in the Feature Discovery. | ||
/// | ||
/// [WizardNode] manages a [FocusNode], which, when instantiated; should be a | ||
/// descendant of a [WizardScope]. | ||
class WizardNode extends StatelessWidget { | ||
const WizardNode({ | ||
required this.child, | ||
this.focusNode, | ||
this.background, | ||
this.overlay, | ||
Key? key, | ||
}) : super(key: key); | ||
|
||
final Widget child; | ||
final Widget? background; | ||
final Widget? overlay; | ||
|
||
/// Parameters passed down to [Focus]. The lifecycle of a [focusNode] should | ||
/// be managed inside the [Widget] it's instantiated in. If a [FocusNode] is | ||
/// not provided, [Focus] will implicitly create and manage one. | ||
final FocusNode? focusNode; | ||
|
||
@override | ||
Widget build(BuildContext context) { | ||
return Focus( | ||
focusNode: focusNode, | ||
child: child, | ||
); | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
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,15 +1,11 @@ | ||
import 'package:flutter/cupertino.dart'; | ||
import 'package:wizardview/src/wizard.dart'; | ||
|
||
import 'wizard_scope_node.dart'; | ||
|
||
class WizardScope extends FocusScope { | ||
class WizardScope { | ||
const WizardScope({ | ||
required Widget child, | ||
required this.node, | ||
}) : super( | ||
child: child, | ||
node: node, | ||
); | ||
}); | ||
|
||
final WizardScopeNode node; | ||
final WizardNode node; | ||
} |
This file was deleted.
Oops, something went wrong.