GetX相关
1.快速创建GetX页面(包含Page | Controller | Binding)
import 'package:flutter/material.dart';
import 'package:get/get.dart';
class $NAME$Page
extends $NAME$GetView<$NAME$Controller> {
@override
Widget build(BuildContext context) {
return Scaffold();
}
}
class $NAME$Controller extends GetxController {
//Example
// var num = 0.obs;
// void increment() => num++;
// void decrement() => num--;
}
class $NAME$Binding extends Bindings {
@override
void dependencies() {
// TODO: implement dependencies
Get.lazyPut<$NAME$Controller>(
() => $NAME$Controller());
}
}
网友评论