Committed by
GitHub
Merge pull request #2740 from jonataslaw/fix-theme-and-rxlist
Release candidate 4
Showing
7 changed files
with
69 additions
and
49 deletions
1 | +## [5.0.0-release-candidate-4] | ||
2 | +-Fix changeThemeMode and RxList | ||
3 | + | ||
4 | +## [5.0.0-release-candidate-3] | ||
5 | +-Fix changeTheme | ||
6 | + | ||
1 | ## [5.0.0-release-candidate-2] | 7 | ## [5.0.0-release-candidate-2] |
2 | This version adds built-in support for animation in Flutter in an easy, clear way, and without having to create a StatefulWidget with controllers and animations. All you need to do is call the name of the animation. | 8 | This version adds built-in support for animation in Flutter in an easy, clear way, and without having to create a StatefulWidget with controllers and animations. All you need to do is call the name of the animation. |
3 | 9 |
@@ -4,7 +4,7 @@ | @@ -4,7 +4,7 @@ | ||
4 | # This file should be version controlled. | 4 | # This file should be version controlled. |
5 | 5 | ||
6 | version: | 6 | version: |
7 | - revision: 9944297138845a94256f1cf37beb88ff9a8e811a | 7 | + revision: c07f7888888435fd9df505aa2efc38d3cf65681b |
8 | channel: stable | 8 | channel: stable |
9 | 9 | ||
10 | project_type: app | 10 | project_type: app |
@@ -13,26 +13,26 @@ project_type: app | @@ -13,26 +13,26 @@ project_type: app | ||
13 | migration: | 13 | migration: |
14 | platforms: | 14 | platforms: |
15 | - platform: root | 15 | - platform: root |
16 | - create_revision: 9944297138845a94256f1cf37beb88ff9a8e811a | ||
17 | - base_revision: 9944297138845a94256f1cf37beb88ff9a8e811a | 16 | + create_revision: c07f7888888435fd9df505aa2efc38d3cf65681b |
17 | + base_revision: c07f7888888435fd9df505aa2efc38d3cf65681b | ||
18 | - platform: android | 18 | - platform: android |
19 | - create_revision: 9944297138845a94256f1cf37beb88ff9a8e811a | ||
20 | - base_revision: 9944297138845a94256f1cf37beb88ff9a8e811a | 19 | + create_revision: c07f7888888435fd9df505aa2efc38d3cf65681b |
20 | + base_revision: c07f7888888435fd9df505aa2efc38d3cf65681b | ||
21 | - platform: ios | 21 | - platform: ios |
22 | - create_revision: 9944297138845a94256f1cf37beb88ff9a8e811a | ||
23 | - base_revision: 9944297138845a94256f1cf37beb88ff9a8e811a | 22 | + create_revision: c07f7888888435fd9df505aa2efc38d3cf65681b |
23 | + base_revision: c07f7888888435fd9df505aa2efc38d3cf65681b | ||
24 | - platform: linux | 24 | - platform: linux |
25 | - create_revision: 9944297138845a94256f1cf37beb88ff9a8e811a | ||
26 | - base_revision: 9944297138845a94256f1cf37beb88ff9a8e811a | 25 | + create_revision: c07f7888888435fd9df505aa2efc38d3cf65681b |
26 | + base_revision: c07f7888888435fd9df505aa2efc38d3cf65681b | ||
27 | - platform: macos | 27 | - platform: macos |
28 | - create_revision: 9944297138845a94256f1cf37beb88ff9a8e811a | ||
29 | - base_revision: 9944297138845a94256f1cf37beb88ff9a8e811a | 28 | + create_revision: c07f7888888435fd9df505aa2efc38d3cf65681b |
29 | + base_revision: c07f7888888435fd9df505aa2efc38d3cf65681b | ||
30 | - platform: web | 30 | - platform: web |
31 | - create_revision: 9944297138845a94256f1cf37beb88ff9a8e811a | ||
32 | - base_revision: 9944297138845a94256f1cf37beb88ff9a8e811a | 31 | + create_revision: c07f7888888435fd9df505aa2efc38d3cf65681b |
32 | + base_revision: c07f7888888435fd9df505aa2efc38d3cf65681b | ||
33 | - platform: windows | 33 | - platform: windows |
34 | - create_revision: 9944297138845a94256f1cf37beb88ff9a8e811a | ||
35 | - base_revision: 9944297138845a94256f1cf37beb88ff9a8e811a | 34 | + create_revision: c07f7888888435fd9df505aa2efc38d3cf65681b |
35 | + base_revision: c07f7888888435fd9df505aa2efc38d3cf65681b | ||
36 | 36 | ||
37 | # User provided section | 37 | # User provided section |
38 | 38 |
@@ -29,27 +29,27 @@ class MyApp extends StatelessWidget { | @@ -29,27 +29,27 @@ class MyApp extends StatelessWidget { | ||
29 | 29 | ||
30 | /// Nav 2 snippet | 30 | /// Nav 2 snippet |
31 | // void main() { | 31 | // void main() { |
32 | -// runApp(MyApp()); | 32 | +// runApp(const MyApp()); |
33 | // } | 33 | // } |
34 | 34 | ||
35 | // class MyApp extends StatelessWidget { | 35 | // class MyApp extends StatelessWidget { |
36 | -// MyApp({Key? key}) : super(key: key); | 36 | +// const MyApp({Key? key}) : super(key: key); |
37 | 37 | ||
38 | // @override | 38 | // @override |
39 | // Widget build(BuildContext context) { | 39 | // Widget build(BuildContext context) { |
40 | -// return GetMaterialApp.router( | 40 | +// return GetMaterialApp( |
41 | // getPages: [ | 41 | // getPages: [ |
42 | // GetPage( | 42 | // GetPage( |
43 | // participatesInRootNavigator: true, | 43 | // participatesInRootNavigator: true, |
44 | // name: '/first', | 44 | // name: '/first', |
45 | -// page: () => First()), | 45 | +// page: () => const First()), |
46 | // GetPage( | 46 | // GetPage( |
47 | // name: '/second', | 47 | // name: '/second', |
48 | -// page: () => Second(), | 48 | +// page: () => const Second(), |
49 | // ), | 49 | // ), |
50 | // GetPage( | 50 | // GetPage( |
51 | // name: '/third', | 51 | // name: '/third', |
52 | -// page: () => Third(), | 52 | +// page: () => const Third(), |
53 | // ), | 53 | // ), |
54 | // ], | 54 | // ], |
55 | // debugShowCheckedModeBanner: false, | 55 | // debugShowCheckedModeBanner: false, |
@@ -58,26 +58,32 @@ class MyApp extends StatelessWidget { | @@ -58,26 +58,32 @@ class MyApp extends StatelessWidget { | ||
58 | // } | 58 | // } |
59 | 59 | ||
60 | // class First extends StatelessWidget { | 60 | // class First extends StatelessWidget { |
61 | +// const First({Key? key}) : super(key: key); | ||
62 | + | ||
61 | // @override | 63 | // @override |
62 | // Widget build(BuildContext context) { | 64 | // Widget build(BuildContext context) { |
65 | +// print('First rebuild'); | ||
63 | // return Scaffold( | 66 | // return Scaffold( |
64 | // appBar: AppBar( | 67 | // appBar: AppBar( |
65 | -// title: Text('page one'), | 68 | +// title: const Text('page one'), |
66 | // leading: IconButton( | 69 | // leading: IconButton( |
67 | -// icon: Icon(Icons.more), | 70 | +// icon: const Icon(Icons.more), |
68 | // onPressed: () { | 71 | // onPressed: () { |
72 | +// print('THEME CHANGED'); | ||
69 | // Get.changeTheme( | 73 | // Get.changeTheme( |
70 | -// context.isDarkMode ? ThemeData.light() : ThemeData.dark()); | 74 | +// Get.isDarkMode ? ThemeData.light() : ThemeData.dark()); |
71 | // }, | 75 | // }, |
72 | // ), | 76 | // ), |
73 | // ), | 77 | // ), |
74 | // body: Center( | 78 | // body: Center( |
75 | -// child: Container( | 79 | +// child: SizedBox( |
76 | // height: 300, | 80 | // height: 300, |
77 | // width: 300, | 81 | // width: 300, |
78 | // child: ElevatedButton( | 82 | // child: ElevatedButton( |
79 | -// onPressed: () {}, | ||
80 | -// child: Text('next screen'), | 83 | +// onPressed: () { |
84 | +// Get.toNamed('/second?id=123'); | ||
85 | +// }, | ||
86 | +// child: const Text('next screen'), | ||
81 | // ), | 87 | // ), |
82 | // ), | 88 | // ), |
83 | // ), | 89 | // ), |
@@ -86,19 +92,22 @@ class MyApp extends StatelessWidget { | @@ -86,19 +92,22 @@ class MyApp extends StatelessWidget { | ||
86 | // } | 92 | // } |
87 | 93 | ||
88 | // class Second extends StatelessWidget { | 94 | // class Second extends StatelessWidget { |
95 | +// const Second({Key? key}) : super(key: key); | ||
96 | + | ||
89 | // @override | 97 | // @override |
90 | // Widget build(BuildContext context) { | 98 | // Widget build(BuildContext context) { |
99 | +// print('second rebuild'); | ||
91 | // return Scaffold( | 100 | // return Scaffold( |
92 | // appBar: AppBar( | 101 | // appBar: AppBar( |
93 | // title: Text('page two ${Get.parameters["id"]}'), | 102 | // title: Text('page two ${Get.parameters["id"]}'), |
94 | // ), | 103 | // ), |
95 | // body: Center( | 104 | // body: Center( |
96 | -// child: Container( | 105 | +// child: SizedBox( |
97 | // height: 300, | 106 | // height: 300, |
98 | // width: 300, | 107 | // width: 300, |
99 | // child: ElevatedButton( | 108 | // child: ElevatedButton( |
100 | // onPressed: () {}, | 109 | // onPressed: () {}, |
101 | -// child: Text('next screen'), | 110 | +// child: const Text('next screen'), |
102 | // ), | 111 | // ), |
103 | // ), | 112 | // ), |
104 | // ), | 113 | // ), |
@@ -107,20 +116,22 @@ class MyApp extends StatelessWidget { | @@ -107,20 +116,22 @@ class MyApp extends StatelessWidget { | ||
107 | // } | 116 | // } |
108 | 117 | ||
109 | // class Third extends StatelessWidget { | 118 | // class Third extends StatelessWidget { |
119 | +// const Third({Key? key}) : super(key: key); | ||
120 | + | ||
110 | // @override | 121 | // @override |
111 | // Widget build(BuildContext context) { | 122 | // Widget build(BuildContext context) { |
112 | // return Scaffold( | 123 | // return Scaffold( |
113 | // backgroundColor: Colors.red, | 124 | // backgroundColor: Colors.red, |
114 | // appBar: AppBar( | 125 | // appBar: AppBar( |
115 | -// title: Text('page three'), | 126 | +// title: const Text('page three'), |
116 | // ), | 127 | // ), |
117 | // body: Center( | 128 | // body: Center( |
118 | -// child: Container( | 129 | +// child: SizedBox( |
119 | // height: 300, | 130 | // height: 300, |
120 | // width: 300, | 131 | // width: 300, |
121 | // child: ElevatedButton( | 132 | // child: ElevatedButton( |
122 | // onPressed: () {}, | 133 | // onPressed: () {}, |
123 | -// child: Text('go to first screen'), | 134 | +// child: const Text('go to first screen'), |
124 | // ), | 135 | // ), |
125 | // ), | 136 | // ), |
126 | // ), | 137 | // ), |
@@ -438,7 +438,7 @@ class GetRootState extends State<GetRoot> with WidgetsBindingObserver { | @@ -438,7 +438,7 @@ class GetRootState extends State<GetRoot> with WidgetsBindingObserver { | ||
438 | } | 438 | } |
439 | 439 | ||
440 | Transition? getThemeTransition() { | 440 | Transition? getThemeTransition() { |
441 | - final platform = Get.theme.platform; | 441 | + final platform = context.theme.platform; |
442 | final matchingTransition = | 442 | final matchingTransition = |
443 | Get.theme.pageTransitionsTheme.builders[platform]; | 443 | Get.theme.pageTransitionsTheme.builders[platform]; |
444 | switch (matchingTransition) { | 444 | switch (matchingTransition) { |
@@ -489,7 +489,10 @@ class GetRootState extends State<GetRoot> with WidgetsBindingObserver { | @@ -489,7 +489,10 @@ class GetRootState extends State<GetRoot> with WidgetsBindingObserver { | ||
489 | } | 489 | } |
490 | 490 | ||
491 | void update() { | 491 | void update() { |
492 | - setState(() {}); | 492 | + context.visitAncestorElements((element) { |
493 | + element.markNeedsBuild(); | ||
494 | + return false; | ||
495 | + }); | ||
493 | } | 496 | } |
494 | 497 | ||
495 | GlobalKey<NavigatorState> get key => rootDelegate.navigatorKey; | 498 | GlobalKey<NavigatorState> get key => rootDelegate.navigatorKey; |
@@ -48,7 +48,7 @@ class RxList<E> extends GetListenable<List<E>> | @@ -48,7 +48,7 @@ class RxList<E> extends GetListenable<List<E>> | ||
48 | @override | 48 | @override |
49 | RxList<E> operator +(Iterable<E> val) { | 49 | RxList<E> operator +(Iterable<E> val) { |
50 | addAll(val); | 50 | addAll(val); |
51 | - refresh(); | 51 | + // refresh(); |
52 | return this; | 52 | return this; |
53 | } | 53 | } |
54 | 54 | ||
@@ -113,11 +113,11 @@ class RxList<E> extends GetListenable<List<E>> | @@ -113,11 +113,11 @@ class RxList<E> extends GetListenable<List<E>> | ||
113 | @override | 113 | @override |
114 | Iterable<E> get reversed => value.reversed; | 114 | Iterable<E> get reversed => value.reversed; |
115 | 115 | ||
116 | - @override | ||
117 | - set value(List<E> val) { | ||
118 | - value = val; | ||
119 | - refresh(); | ||
120 | - } | 116 | + // @override |
117 | + // set value(List<E> val) { | ||
118 | + // value = val; | ||
119 | + // refresh(); | ||
120 | + // } | ||
121 | 121 | ||
122 | @override | 122 | @override |
123 | Iterable<E> where(bool Function(E) test) { | 123 | Iterable<E> where(bool Function(E) test) { |
@@ -8,7 +8,7 @@ class RxSet<E> extends GetListenable<Set<E>> | @@ -8,7 +8,7 @@ class RxSet<E> extends GetListenable<Set<E>> | ||
8 | /// inside the List, | 8 | /// inside the List, |
9 | RxSet<E> operator +(Set<E> val) { | 9 | RxSet<E> operator +(Set<E> val) { |
10 | addAll(val); | 10 | addAll(val); |
11 | - refresh(); | 11 | + //refresh(); |
12 | return this; | 12 | return this; |
13 | } | 13 | } |
14 | 14 | ||
@@ -25,13 +25,13 @@ class RxSet<E> extends GetListenable<Set<E>> | @@ -25,13 +25,13 @@ class RxSet<E> extends GetListenable<Set<E>> | ||
25 | // // return _value; | 25 | // // return _value; |
26 | // } | 26 | // } |
27 | 27 | ||
28 | - @override | ||
29 | - @protected | ||
30 | - set value(Set<E> val) { | ||
31 | - if (value == val) return; | ||
32 | - value = val; | ||
33 | - refresh(); | ||
34 | - } | 28 | + // @override |
29 | + // @protected | ||
30 | + // set value(Set<E> val) { | ||
31 | + // if (value == val) return; | ||
32 | + // value = val; | ||
33 | + // refresh(); | ||
34 | + // } | ||
35 | 35 | ||
36 | @override | 36 | @override |
37 | bool add(E value) { | 37 | bool add(E value) { |
1 | name: get | 1 | name: get |
2 | description: Open screens/snackbars/dialogs without context, manage states and inject dependencies easily with GetX. | 2 | description: Open screens/snackbars/dialogs without context, manage states and inject dependencies easily with GetX. |
3 | -version: 5.0.0-release-candidate-2 | 3 | +version: 5.0.0-release-candidate-4 |
4 | homepage: https://github.com/jonataslaw/getx | 4 | homepage: https://github.com/jonataslaw/getx |
5 | 5 | ||
6 | environment: | 6 | environment: |
-
Please register or login to post a comment