-
Notifications
You must be signed in to change notification settings - Fork 134
/
main.dart
71 lines (67 loc) · 2.09 KB
/
main.dart
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
import 'package:reactive_exploration/src/bloc/main.dart' as bloc;
import 'package:reactive_exploration/src/bloc_complex/main.dart'
as bloc_complex;
import 'package:reactive_exploration/src/bloc_start/main.dart' as bloc_start;
import 'package:reactive_exploration/src/redux/main.dart' as redux;
import 'package:reactive_exploration/src/scoped/complete.dart' as scoped;
import 'package:reactive_exploration/src/singleton/main.dart' as singleton;
import 'package:reactive_exploration/src/start/main.dart' as start;
import 'package:reactive_exploration/src/start/main_blob.dart' as start_blob;
import 'package:reactive_exploration/src/value_notifier/main.dart'
as value_notifier;
import 'package:reactive_exploration/src/vanilla/main.dart' as vanilla;
/// This rather unconventional main method allows us to switch to vastly
/// different implementations of the same app without confusing Flutter
/// and the IDE with many `main.dart` files in `lib/`.
///
/// All this main function does is run _another_ main function in one of
/// the imported files. When you're exploring a particular architecture,
/// just change the `flavor = ...` line below and (hot-)restart the app.
void main() {
final flavor = Architecture.vanilla;
print("\n\n===== Running: $flavor =====\n\n");
switch (flavor) {
case Architecture.start:
start.main();
return;
case Architecture.startBlob:
start_blob.main();
return;
case Architecture.singleton:
singleton.main();
return;
case Architecture.vanilla:
vanilla.main();
return;
case Architecture.valueNotifier:
value_notifier.main();
return;
case Architecture.bloc:
bloc.main();
return;
case Architecture.blocComplex:
bloc_complex.main();
return;
case Architecture.blocStart:
bloc_start.main();
return;
case Architecture.scoped:
scoped.main();
return;
case Architecture.redux:
redux.main();
return;
}
}
enum Architecture {
bloc,
blocComplex,
blocStart,
scoped,
singleton,
start,
startBlob,
vanilla,
valueNotifier,
redux,
}