搜索插件、代码仓与 APP 分类

GitHub 代码仓KevinZhang19870314/flutter_getx_boilerplate

flutter_getx_boilerplate

一个使用 GetX 状态管理的 Flutter 项目模板。

flutter_getx_boilerplate 项目封面
星标
347
复刻
127
最近推送(UTC)
2024年9月27日
项目状态
未归档

原始 README

以下为英文项目原文快照,最新内容请访问 GitHub。

flutter_getx_boilerplate

master branch: Fluter 3.24 version

Fluter-3.0.5 branch: Fluter 3.0.5 version

Flutter-2.x branch: Flutter 2.x version

Languages: English (this file), 中文. , KR

Introduction

During my study of Flutter, I have been using the flutter_bloc state management framework. I accidentally saw the GetX state management framework. Through ReadMe, I found that the GetX framework is very easy to get started. So I want to write a GetX Starter project while learning, which can not only help myself Learning can also help others quickly build a boilerplate. Before building this boilerplate, I searched many similar projects, and found that they were relatively simple, and none of them covered the common things that the project should have, so I sprouted the idea of ​​writing one by myself. Let me introduce them one by one below.

Technology & Project Introduction

Use Flutter 2.x to build a set of features containing predefined folder structure, style themes, API access, state management, routing & dependencies, etc. The project structure is clear and can be easily used as a Flutter template project. Technologies used include but are not limited to Flutter, Dart, GetX, etc.

Installation & Use

Step 1:

Fork this project to your own warehouse:

git clone https://github.com/KevinZhang19870314/flutter_getx_boilerplate.git

Step 2:

Open the project folder with VS Code and execute the following command to install the dependency package:

flutter pub get

Step 3:

Open the main.dart file in the lib folder, F5 or Ctrl + F5 to run the project, and then you can start developing and debugging.

Folder structure

The following is the project folder structure (only the folders under lib are introduced)

lib/
|- api - Global Restful api requests, including interceptors, etc.
   |- interceptors - Interceptors, including auth, request, and response interceptors.
   |- api.dart - Restful api export file.
|- lang - Internationalization, including translation files, translation service files, etc.
   |- lang.dart - Language export file.
|- models - Various structured entity classes, divided into request and response entities.
   |- models.dart - Entity class export file.
|- modules - Business module folder.
   |- auth - Login & Registration Module.
   |- home - Home module.
   |- splash - Splash module.
   |- modules.dart - Module export file.
|- routes - Routing module.
   |- app_pages.dart - Routing page configuration.
   |- app_routes.dart - Route names.
   |- routes.dart - Route export file.
|- Shared - Global shared folders, including static variables, global services, utils, global Widgets, etc.
   |- shared.dart - Global shared export file.
|- theme - Theme folder.
|- app_bindings.dart - Services started before the app runs, such as Restful api.
|- di.dart - Global dependency injection objects, such as SharedPreferences, etc.
|- main.dart - Main entry.

Other

In the writing process, because it involves the call of Restful api, here I used the free test api provided by REQ|RES.

Test User as below:

email: "eve.holt@reqres.in",
password: "pistol"
Kevin Zhang GitHub avatar
GitHub 作者

Kevin Zhang ↗

Full Stack develper, focus on AI & Python & Angular & Vue & nodejs & Flutter development.

语言DartC++CMakeRubySwiftCHTMLKotlinObjective-C

分类

使用的依赖

依赖清单 12 项

所在榜单

如何选择适合项目的代码仓?

先按使用场景筛选,再比较项目活跃情况,最后到原始仓库核对使用要求。

  1. 通过仓库名、作者或描述搜索,再按技术分类缩小范围。
  2. 结合星标、复刻与最近推送比较项目;星标反映社区关注,不代表质量保证。
  3. 使用前在 GitHub 核对 README、许可证与 Issues。

来源与维护

“A repository is the most basic element of GitHub.”

GitHub Docs — About repositories ↗