19 Star 71 Fork 36

lixu / flutter_baselib_plugin

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
贡献代码
同步代码
取消
提示: 由于 Git 不支持空文件夾,创建文件夹后会生成空的 .keep 文件
Loading...
README
MIT

一、flutter_baselib 简介

技术文档参考

基于MVVM架构封装Flutter基础库,包含:
1、xlog日志库(Android);
2、bugly异常上报、应用更新(Android);
3、基于dio封装网络请求基类;
4、封装http通用加载错误页,空白页以及正常显示页UI和相关逻辑,UI可自定义;
5、封装http通用加载dialog控件和dialog显示隐藏逻辑,dialog UI可自定义;
6、基于provider封装ViewModel基类和BaseView(MVVM);
7、ViewModel监听页面生命周期,页面关闭时销毁资源;
8、常用工具类;


二、基础库说明

集成了下面三方库,进行二次封装使用:
1、dio:网络请求;
2、fluttertoast:toast工具;
3、provider:状态管理库,使用Provider来实现MVVM模式;
4、shared_preferences:sp工具类
5、permission_handler:动态权限申请
6、connectivity:网络连接状态工具
7、device_info:设备信息获取工具
8、package_info:包信息获取工具
9、path_provider:存储路径获取


native 库:
1、bugly:异常上报,应用升级(仅支持Android平台);
2、mars xlog:日志打印存储(仅Android会保存为日志文件,其它平台使用Flutter print()方法打印log到控制台);

三、使用方式

dependencies:
    flutter_baselib:
        git:
            url: https://gitee.com/rishli/flutter_baselib_plugin.git
            ref: (tag标签)

四、总结

1、这些功能都比较简单,但却很常见,又是很容易忽略的一些细节,通过封装能让这些功能复用,不用关注这些细节,专注业务开发;
2、基础库包含的功能模块只是根据自身业务封装,不可能满足所有的场景,但是可以根据具体业务场景进行扩展,也可以借鉴这些封装思路,实现适合自身业务的基础库;
3、后面会完善基础库功能,扩展通用性;

MIT License Copyright (c) 2019 lixu Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

简介

基于MVVM封装的Flutter公共库,包括:http组件、mvvm组件、bugly、log、toast、和常用工具类,开箱即用,可以减少很多模板代码; 展开 收起
MIT
取消

发行版

暂无发行版

贡献者

全部

近期动态

加载更多
不能加载更多了
Dart
1
https://gitee.com/rishli/flutter_baselib_plugin.git
git@gitee.com:rishli/flutter_baselib_plugin.git
rishli
flutter_baselib_plugin
flutter_baselib_plugin
dev-1.3.0

搜索帮助