Skip to content
Proyectos

xdd666t/getx_template

Ver en GitHub

Acerca de

Used to generate the template code of GetX framework | Flutter GetX模板代码生成(一个有用的IDEA插件)

Herramientas de desarrollo

Cómo se miden estas cifras

What you can do

  • Default: Default mode, three files are generated: state, logic, view
  • Easy: Simple mode, two files are generated: logic, view
  • useFolder: Use a file, a folder will be generated after selection, and the big hump name will be automatically converted to: lowercase + underscore
  • usePrefix: Use the prefix, add the prefix before the generated file, the prefix is: Big Camel Name is automatically converted to: lowercase + underscore

Crecimiento de estrellas medido

in 24h
0
in 7 days
0
in 15 days
-1
in 1 month
Recopilando historial

Cambios netos en períodos que se solapan, no totales diarios. Los datos no disponibles se dejan en blanco. Las estrellas indican interés, no calidad.

README.md

Original

plugin stars issues commit release

Language: English | 中文(详细讲解)

Statement

Description

  • install

install

  • Plugin effect

    • Take a look at the effect diagram used by the plugin. The style refers to the fish_redux plugin style.
    • There are some optional functions, so make it into a multi-button style, you can operate according to your own needs

useFolder

  • Support to modify suffix

image-20210926111944785

  • Alt + Enter : GetBuilder、GetBuilder(Auto Dispose)、Obx、GetX

GetBuilder

image-20210802160603092

image-20210802160631405

  • Enter the getx prefix

getxroutepagemap

image-20210922111700625

Features

  • Model: Generate the GetX model

    • Default: Default mode, three files are generated: state, logic, view
    • Easy: Simple mode, two files are generated: logic, view
  • Function: Function selection

    • useFolder: Use a file, a folder will be generated after selection, and the big hump name will be automatically converted to: lowercase + underscore
  • usePrefix: Use the prefix, add the prefix before the generated file, the prefix is: Big Camel Name is automatically converted to: lowercase + underscore

  • autoDispose: If you find that a page cannot automatically recycle GetxController, you can turn on this function, refer to How to automatically recycle GetXController; under normal circumstances, there is no need to turn on this function

  • addLifecycle: Automatically add the life cycle callback method in GetXController, and enable it on demand

  • addBinding: automatically add binding files

    • If you know what binding is, it is recommended to enable this function
    • If you don't understand the concept and function of binding, it is not recommended to turn it on; not using binding will not affect development
  • Module Name: The name of the module, please use the big camel case as much as possible; capitalize the first letter

自动注册 GetX 命名路由

创建 Page 时可勾选 Register named route,让插件同时更新项目已有的路由表。默认路由表为 lib/app/routes/app_pages.dart,路径相对于最近的 pubspec.yaml。首次使用时添加以下三个标记。

import 'package:get/get.dart';
// getx_template:imports

class Routes {
  // getx_template:constants
}

class AppPages {
  static final routes = <GetPage>[
    // getx_template:pages
  ];
}
  • imports 放在主 Dart 文件的指令区域,位于 library 之后、首个 part 或声明之前。
  • constants 放在文件顶层或命名类的两个声明之间。类内生成 static const。
  • pages 放在顶层变量或类字段的 GetPage 列表初始化器内。已有项在标记前需要尾逗号。 支持显式 GetPage 列表类型和已有 GetPage(...) 元素的推断类型,保留 GetX 导入已有的前缀。

在同一 Flutter 包的 lib/ 下创建 Page。Route path 留空时由模块名生成,例如 OrderDetail 生成 /order-detail,也可手填 /orders/:orderId。按项目版本选择 Use GetX5, 需要随路由创建控制器时勾选 Add Binding。新增页面和 Binding 使用各自的导入前缀,可与已有同名 Dart 类型共存。 将该列表传给 GetMaterialApp(getPages: AppPages.routes) 后,可用 Get.toNamed('/orders/A123') 打开动态路由。

重复检查覆盖目标列表直接声明的 GetPage 项,可识别字符串字面量与主路由表、相对 part 文件中的简单路径常量。 通过列表展开、子路由以及运行时表达式注册的路径由项目本身检查。

Development

  • Build JDK: JDK 25
  • Gradle: use the checked-in Gradle Wrapper (9.5.0)
  • The plugin targets IntelliJ IDEA 2023.3 and produces Java 17-compatible bytecode.

Run the verification suite with:

./gradlew test buildPlugin verifyPlugin

Explorar proyectos relacionados

Cargando…