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
void main() { | |
} | |
// Do not have to define separate depController fields | |
class TableWidget extends ConsumerWidget { | |
TableWidget(String arg) : super(depMap: { | |
'textController': Dep(() {return TextController(arg); }), | |
'scrollController': Dep(() {return ScrollController(); }), | |
'tableController': Dep(() {return TableController(); }) |
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
void main() { | |
final w = ConsumerWidget(); | |
print(w.controller); | |
} | |
class ConsumerWidget { | |
TableController get controller { | |
try { | |
print(controller.check); | |
} finally { |
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
void main() async { | |
final tableWidget = TableWidget(); | |
print(tableWidget.build()); | |
} | |
// Con Con DepController | |
class DepController<T> { | |
T instance; | |
DepController(T Function() builder) : instance = builder(); |