Git Product home page Git Product logo

flutter_template's Introduction

Flutter Template

Flutter Template 是一个高质量、易于使用的 Flutter 项目模板,旨在帮助开发者快速构建出色的跨平台应用程序。该模板采用了 Get 框架优秀的设计模式合理的文件结构,以确保开发者能够编写出易于维护的代码。此外,该模板还使用了 Isar 数据库,以提供卓越的性能全平台支持

清晰架构实现的 TODO LIST 效果

不要怕,非常简单,但是应有尽有,数据库持久化,全局状态管理,因为优秀的代码组织结构,促成了非常简洁的代码就实现了一个 todo-list

特点

  • 使用 Get 框架进行状态管理、依赖注入和路由管理,简化了应用程序的开发和维护。
  • 采用模块化的设计模式,使代码结构清晰、组织良好,便于扩展和维护。
  • 使用 Isar 数据库,提供高性能、跨平台的数据存储和查询功能。
  • 优化的文件结构,使开发者能够轻松找到和管理项目中的各个部分。
  • dio 网络请求框架,轻松处理网络请求,支持拦截器,支持便捷的错误处理,请求重试,请求缓存等功能。
  • oauth2 flutter_web_auth_2 登录框架,轻松实现 github 登录,支持多平台。
  • 图片加载框架extended_image,支持加载网络图片,支持缓存图片,支持图片加载进度条,支持图片加载失败的占位图。
  • 轻松替换 app 的 icon。
  • 包含一些预构建的组件和页面,以帮助开发者快速开始构建应用程序。
  • 开箱即用,开发者只需要关注业务即可。
  • 多语言的支持。
  • 主题设置的支持。
  • 灵活扩展的设置页

项目结构

项目中,TodoList 应用程序的结构如下所示:

➜  lib git:(main) ✗ tree -L 2
.
├── components
│   ├── add_todo_dialog.dart
│   ├── code_wrapper.dart
│   ├── latex.dart
│   ├── markdown.dart
│   ├── todo_item.dart
│   └── user
├── controller
│   ├── settings.dart
│   ├── todo.dart
│   └── user.dart
├── i18n
│   └── translations.dart
├── main.dart
├── models
│   ├── github_user.dart
│   ├── todo.dart
│   └── todo.g.dart
├── pages
│   ├── home.dart
│   ├── settings.dart
│   ├── todo_list.dart
│   └── unknown.dart
├── repository
│   ├── todo_repository.dart
│   └── user_repository.dart
├── routes.dart
└── service
    └── http_service.dart
  • components\ 放置了一些预构建的组件,以帮助开发者快速开始构建应用程序。
  • service\ 放置应用程序的服务,如网络请求服务等等。
  • controller\ 放置了一些控制器,可以参考 Get。 如何写 controller,来实现全局数据管理
  • repository\ 放置了一些数据仓库,如数据库存操作,网络操作等等,主要是处理数据的逻辑。
  • pages\ 放置了一些页面,如首页、设置页面等,其他页面放置在此。
  • i18n 放置了一些国际化资源,以帮助开发者快速构建支持国际化的语言包。
  • models\ 放置了一些数据模型,如 Todo 模型等。
  • routes.dart 定义了应用程序的路由。
  • main.dart 是应用程序的入口文件,包括主题配置,多语言配置,基本不需要修改这里。

快速开始

要开始使用 Flutter Template,请按照以下步骤操作:

  1. 克隆此仓库:

git clone https://github.com/bravekingzhang/flutter_template.git

or 直接点我的项目的 Use this template button,直接通过这个模板创建一个自己的项目。

  1. 进入项目目录:

cd flutter_template

  1. 获取依赖项:

flutter pub get

  1. 运行项目:

flutter run

现在,你已经成功运行了 Flutter Template,并可以开始构建你的应用程序。

项目配置

修改项目名字,请到项目的根目录下执行,请注意 flutter 项目命名规范,因为会体现在包名中,所以尽量取类似这样的名字 flutter_app,todo_list,leetcode

./rename_project.sh your_project_name

贡献

我们欢迎任何形式的贡献!如果你有任何建议、问题或需求,请随时提交 IssuePull Request

许可证

本项目采用 MIT 许可证


flutter_template's People

Contributors

brzhang666 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

flutter_template's Issues

dio

那不得加上dio网络请求框架,loading status,以及异常处理,最好缓存,拦截器也考虑进去,谢谢

无法在web端运行,isar换成低版本2.5.0估计可行

如果在chrome运行会有以下错误:

: Error: The integer literal 505491818817781703 can't be represented exactly in JavaScript.
todo.g.dart:18
Try changing the literal to something that can be represented in JavaScript. In JavaScript 505491818817781696 is the nearest value that can be represented exactly.
  id: -505491818817781703,
       ^^^^^^^^^^^^^^^^^^

是因为isar目前版本不支持web,作者是否考虑降版来支持web运行?

TodoController定位不明确

用TodoController来维护Page,侧重页面
用TodoService来维护todo相关业务逻辑,包含对Repository的存取。
这样你在TodoItem中需要的是TodoService,而不是去获取TodoController

unbuntu 系统下无法新建工程 一直卡着,不知是少了什么配置?

Loading options from /etc/masonrc...Check vars...ipchains was not found in your path or in /sbin. You may need to copy it
or add an explicit path to it in the following commands.
ipfwadm was not found in your path or in /sbin. You may need to copy it
or add an explicit path to it in the following commands.
Editor default of /usr/bin/vi taken.
Load IPs, networks and nameservers...Done.
---- Mason firewall builder for Linux ----
---- see http://www.pobox.com/~wstearns/mason/ for more info. ----
---- William Stearns [email protected] ----
(This is release 1.0.0-11 - 2008-06-27 )

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.