Skip to content
| Marketplace
Sign in
Visual Studio Code>Other>Flutter Getx 生成器New to Visual Studio Code? Get it now.
Flutter Getx 生成器

Flutter Getx 生成器

0x2c79a

|
2,383 installs
| (0) | Free
flutter getx 生成view,state,logic文件
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

Flutter 项目使用Getx插件时,使用vscode便利生成文件。

使用方法:

在vscode用户设置,用户-扩展-GetX Creater,输入author

在文件夹右键,选择[getx] creater,使用大驼峰法输入类名,如ThisIsTest,回车。

结果文件目录例如:

demo
>this_is_test
>>this_is_test_logic.dart
>>this_is_test_state.dart
>>this_is_test_view.dart

this_is_test_logic.dart的内容为:


import 'package:get/get.dart';

import this_is_test_state.dart';

/// @description:
/// @author ${author}
/// @date: 2021/05/18 11:30:50

class ThisIsTestLogic extends GetxController {

  final state = ThisIsTestState();
}

this_is_test_state.dart的内容为:


/// @description:
/// @author
/// @date: 2021/05/18 11:30:50

class ThisIsTestState {

  ThisIsTestState() {
    ///Initialize variables
  }
}

this_is_test_view.dart的内容为:


import this_is_test_logic.dart';
import this_is_test_state.dart';

/// @description:
/// @author
/// @date: 2021/05/18 11:30:50

class ThisIsTestPage extends StatelessWidget {
  final ThisIsTestLogic logic = Get.put(ThisIsTestLogic());
  final ThisIsTestState state = Get.find<ThisIsTestLogic>().state;

  ThisIsTestPage({Key? key}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return Scaffold();
  }

}

  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
© 2025 Microsoft