modules.dart
2.98 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
// import 'package:flutter/material.dart';
// import 'package:get/get_navigation/src/router_report.dart';
// import 'package:get/instance_manager.dart';
// class Dependencies {
// void lazyPut<S>(InstanceBuilderCallback<S> builder,
// {String? tag, bool fenix = false}) {
// GetInstance().lazyPut<S>(builder, tag: tag, fenix: fenix);
// }
// S call<S>() {
// return find<S>();
// }
// Future<S> putAsync<S>(AsyncInstanceBuilderCallback<S> builder,
// {String? tag, bool permanent = false}) async =>
// GetInstance().putAsync<S>(builder, tag: tag, permanent: permanent);
// void create<S>(InstanceBuilderCallback<S> builder,
// {String? tag, bool permanent = true}) =>
// GetInstance().create<S>(builder, tag: tag, permanent: permanent);
// S find<S>({String? tag}) => GetInstance().find<S>(tag: tag);
// S put<S>(S dependency,
// {String? tag,
// bool permanent = false,
// InstanceBuilderCallback<S>? builder}) =>
// GetInstance().put<S>(dependency, tag: tag, permanent: permanent);
// Future<bool> delete<S>({String? tag, bool force = false}) async =>
// GetInstance().delete<S>(tag: tag, force: force);
// Future<void> deleteAll({bool force = false}) async =>
// GetInstance().deleteAll(force: force);
// void reloadAll({bool force = false}) => GetInstance().reloadAll(force: force);
// void reload<S>({String? tag, String? key, bool force = false}) =>
// GetInstance().reload<S>(tag: tag, key: key, force: force);
// bool isRegistered<S>({String? tag}) =>
// GetInstance().isRegistered<S>(tag: tag);
// bool isPrepared<S>({String? tag}) => GetInstance().isPrepared<S>(tag: tag);
// void replace<P>(P child, {String? tag}) {
// final info = GetInstance().getInstanceInfo<P>(tag: tag);
// final permanent = (info.isPermanent ?? false);
// delete<P>(tag: tag, force: permanent);
// put(child, tag: tag, permanent: permanent);
// }
// void lazyReplace<P>(InstanceBuilderCallback<P> builder,
// {String? tag, bool? fenix}) {
// final info = GetInstance().getInstanceInfo<P>(tag: tag);
// final permanent = (info.isPermanent ?? false);
// delete<P>(tag: tag, force: permanent);
// lazyPut(builder, tag: tag, fenix: fenix ?? permanent);
// }
// }
// abstract class Module extends StatefulWidget {
// Module({Key? key}) : super(key: key);
// Widget view(BuildContext context);
// void dependencies(Dependencies i);
// @override
// _ModuleState createState() => _ModuleState();
// }
// class _ModuleState extends State<Module> {
// @override
// void initState() {
// RouterReportManager.instance.reportCurrentRoute(this);
// widget.dependencies(Dependencies());
// super.initState();
// }
// @override
// void dispose() {
// RouterReportManager.instance.reportRouteDispose(this);
// super.dispose();
// }
// @override
// Widget build(BuildContext context) {
// return widget.view(context);
// }
// }