Skip to content

Commit 33373f4

Browse files
committedJan 24, 2024
GetX<T extends GetXController>的简单例子
1 parent 1979f8a commit 33373f4

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed
 

‎lib/example_app/get_x_app.dart

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,15 @@ class GetxRxExamplePage extends GetView<GetxRxExampleController> {
103103
style: Theme.of(context).textTheme.headlineMedium,
104104
);
105105
}),
106+
/// 使用GetX<T>时,GetxRxExampleController必须继承GetxController
107+
// GetX<GetxRxExampleController>(
108+
// builder: (s) {
109+
// return Text(
110+
// s.count.value.toString(),
111+
// style: Theme.of(context).textTheme.headlineMedium,
112+
// );
113+
// },
114+
// ),
106115
Text(message),
107116
ElevatedButton(
108117
onPressed: controller.pushToCoinRankPage,
@@ -132,6 +141,7 @@ class GetxRxExamplePage extends GetView<GetxRxExampleController> {
132141
floatingActionButton: FloatingActionButton(
133142
onPressed: (() {
134143
controller.increment();
144+
/// 上一个页面的值也在进行添加
135145
_easyController.increment();
136146
}),
137147
tooltip: 'Increment',

0 commit comments

Comments
 (0)
Please sign in to comment.