itemTitles = [
25 | FuncModel(name: 'provider状态管理', routePath: Routes.providerPage),
26 | ];
27 |
28 | @override
29 | Widget build(BuildContext context) {
30 | return Scaffold(
31 | appBar: AppBar(
32 | centerTitle: true,
33 | title: Text("状态管理"),
34 | ),
35 | body: ListView.builder(
36 | itemCount: itemTitles.length,
37 | itemBuilder: (BuildContext context, int index) {
38 | return _listItem(itemTitles[index].name, () {
39 | Application.router.navigateTo(
40 | context, itemTitles[index].routePath,
41 | transition: TransitionType.inFromRight);
42 | });
43 | }),
44 | );
45 | }
46 |
47 | ///demo Item入口View
48 | Widget _listItem(String itemTitle, Function onTap) {
49 | return Container(
50 | decoration: BoxDecoration(
51 | color: Colors.white,
52 | border: BorderDirectional(bottom: BorderSide(color: Colors.grey))),
53 | child: ListTile(
54 | title: Text(itemTitle),
55 | trailing: Icon(Icons.keyboard_arrow_right),
56 | onTap: onTap,
57 | ),
58 | );
59 | }
60 | }
61 |
--------------------------------------------------------------------------------
/lib/pages/transition_page.dart:
--------------------------------------------------------------------------------
1 | import 'dart:async';
2 |
3 | import 'package:fluro/fluro.dart';
4 | import 'package:flutter/material.dart';
5 | import 'package:flutter_study_app/routers/application.dart';
6 | import 'package:flutter_study_app/routers/routers.dart';
7 | /**
8 | *
9 | * author: ChessLuo
10 | * email superluo666@gmail.com
11 | * desc : 启动页动画
12 | *
13 | */
14 | ///
15 | class TransitionPage extends StatefulWidget {
16 | @override
17 | State createState() {
18 | // TODO: implement createState
19 | return TransitionPageState();
20 | }
21 | }
22 |
23 | class TransitionPageState extends State
24 | with SingleTickerProviderStateMixin {
25 | var _visible = true;
26 |
27 | AnimationController animationController;
28 | Animation animation;
29 |
30 | startTime() async {
31 | var _duration = new Duration(seconds: 3);
32 | return new Timer(_duration, toHome);
33 | }
34 |
35 | void toHome() {
36 | // Navigator.of(context).pushReplacementNamed(Constant.HOME_PAGE);
37 | Application.router.navigateTo(context, Routes.mainPage,
38 | replace: true, transition: TransitionType.inFromRight);
39 | }
40 |
41 | @override
42 | void initState() {
43 | super.initState();
44 | animationController = new AnimationController(
45 | vsync: this, duration: new Duration(seconds: 2));
46 | animation =
47 | new CurvedAnimation(parent: animationController, curve: Curves.easeOut);
48 |
49 | animation.addListener(() => this.setState(() {}));
50 | animationController.forward();
51 |
52 | setState(() {
53 | _visible = !_visible;
54 | });
55 | startTime();
56 | }
57 |
58 | @override
59 | Widget build(BuildContext context) {
60 | return Scaffold(
61 | backgroundColor: Colors.white,
62 | body: Stack(
63 | fit: StackFit.expand,
64 | children: [
65 | new Column(
66 | mainAxisAlignment: MainAxisAlignment.end,
67 | mainAxisSize: MainAxisSize.min,
68 | children: [
69 | Padding(
70 | padding: EdgeInsets.only(bottom: 50.0),
71 | child: Text(
72 | "程序猿在广东",
73 | style: TextStyle(color: Colors.black, fontSize: 20),
74 | ),
75 | )
76 | ],
77 | ),
78 | new Column(
79 | mainAxisAlignment: MainAxisAlignment.center,
80 | children: [
81 | new Image.asset(
82 | 'assets/images/logo.jpg',
83 | width: animation.value<=0?15:animation.value * 150,
84 | height: animation.value<=0?15:animation.value * 150,
85 | ),
86 | ],
87 | ),
88 | ],
89 | ),
90 | );
91 | }
92 | }
93 |
--------------------------------------------------------------------------------
/lib/pages/widgets/widgets_page.dart:
--------------------------------------------------------------------------------
1 | /**
2 | * @描述 flutter widgets
3 | * @author chessluo
4 | * @email superluo666@gmail.com
5 | * @date 2020-04-04
6 | *
7 | */
8 | import 'package:flutter/material.dart';
9 | import 'package:flutter_study_app/common/model/func_model.dart';
10 |
11 | class WidgetsPage extends StatefulWidget {
12 | const WidgetsPage({Key key}) : super(key: key);
13 |
14 | @override
15 | _WidgetsPageState createState() => _WidgetsPageState();
16 | }
17 |
18 | class _WidgetsPageState extends State {
19 |
20 | List itemTitles = [
21 | // FuncModel(name: 'sqflite数据库', routePath: Routes.sqflitePage),
22 | ];
23 |
24 | @override
25 | Widget build(BuildContext context) {
26 | return Scaffold(
27 | appBar: AppBar(
28 | centerTitle: true,
29 | title: Text("常用Widgets"),
30 | ),
31 | body: Container(
32 | child: Text("I am Flutter Widgets"),
33 | ),
34 | );
35 | }
36 | }
37 |
--------------------------------------------------------------------------------
/lib/provider/color_filtered_model.dart:
--------------------------------------------------------------------------------
1 |
2 | /**
3 | * @描述 创建provider 数据模型,颜色过滤,变灰
4 | *
5 | * 这里的 Model 实际上就是我们的状态,
6 | * 它不仅储存了我们的数据模型,而且还包含了更改数据的方法,并暴露出它想要暴露出的数据
7 | *
8 | * @author chessluo
9 | * @email superluo666@gmail.com
10 | * @date 2019/4/4
11 | *
12 | */
13 |
14 | import 'package:flutter/material.dart';
15 |
16 |
17 | class ColorFilteredProvider with ChangeNotifier {
18 |
19 | Color _colorFiltered = Colors.transparent;//默认透明
20 |
21 | get currentColor => _colorFiltered; //获取当前过滤后颜色
22 |
23 | ///设置过滤后的颜色
24 | void currColorFiltered(Color color) {
25 | _colorFiltered = color;
26 | notifyListeners();
27 | }
28 | }
--------------------------------------------------------------------------------
/lib/res/colors.dart:
--------------------------------------------------------------------------------
1 |
2 | import 'package:flutter/material.dart';
3 | import 'package:fluttertoast/fluttertoast.dart';
4 | import 'package:shared_preferences/shared_preferences.dart';
5 |
6 | class AppColors {
7 | static const Color primaryColor = Color(0xff7C46B3);
8 | static const Color toastBlackBgColor = Color(0xA6000000);//可设置透明度 A6
9 | static const Color transparent = Color(0x00000000);
10 |
11 | static const Color appBlueColor = Color(0xff46B6FF);
12 | static const Color appBlue1Color = Color(0xff1048FF);
13 |
14 | static const Color grayf5f5f5 = Color(0xffd9d9d9);
15 |
16 |
17 |
18 |
19 | ///输入#000000颜色字符串,获取颜色对象Color
20 | static Color getColor(String colorStr){
21 | if(colorStr!=null){
22 | if(colorStr.substring(0,1)!="#"){
23 | return primaryColor;
24 | }
25 | String substring = colorStr.substring(1,colorStr.length);
26 | return Color(int.parse('0xff'+substring));
27 | }
28 | return primaryColor;
29 | }
30 |
31 |
32 |
33 | }
--------------------------------------------------------------------------------
/lib/res/string_zh.dart:
--------------------------------------------------------------------------------
1 | class StringZh {
2 | static const String dart = "Dart基础";
3 | static const String otherDemo = "Other Demo";
4 | static const String appDesc = " Flutter 是 Google 开源的 UI 工具包,能够帮助开发者通过一套代码库高效构建多平台精美应用,"
5 | "并且还支持移动、Web、桌面和嵌入式平台。\n\n"
6 | " 随着Flutter被越来越多的知名公司应用在自己的商业APP中,"
7 | "Flutter这门新技术也逐渐进入了移动开发者的视野,"
8 | "🔥勤能补拙,我希望能利用业余时间去学习及总结一些有关flutter的知识并运用到项目中去,"
9 | "Come on!!!";
10 | static const appAddress = "https://github.com/ChessLuo/flutter_study_app";
11 |
12 | }
--------------------------------------------------------------------------------
/lib/routers/application.dart:
--------------------------------------------------------------------------------
1 | import 'package:fluro/fluro.dart';
2 |
3 |
4 | class Application {
5 | static FluroRouter router;
6 |
7 | }
8 |
--------------------------------------------------------------------------------
/lib/routers/router_handler.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 | import 'package:fluro/fluro.dart';
3 | import 'package:flutter_study_app/pages/anim/anim_page.dart';
4 | import 'package:flutter_study_app/pages/anim/basis_canvas_page.dart';
5 | import 'package:flutter_study_app/pages/cache/local_cache_page.dart';
6 | import 'package:flutter_study_app/pages/dart/dart_page.dart';
7 | import 'package:flutter_study_app/pages/main/about_page.dart';
8 | import 'package:flutter_study_app/pages/main/main_page.dart';
9 | import 'package:flutter_study_app/pages/other/demo/event_bus_demo.dart';
10 | import 'package:flutter_study_app/pages/other/demo/file_zip_demo.dart';
11 | import 'package:flutter_study_app/pages/channel/flutter_channel_demo.dart';
12 | import 'package:flutter_study_app/pages/other/demo/flutter_webview_demo.dart';
13 | import 'package:flutter_study_app/pages/cache/demo/preferences_demo.dart';
14 | import 'package:flutter_study_app/pages/cache/demo/sqflite_demo.dart';
15 | import 'package:flutter_study_app/pages/other/demo/url_launcher_demo.dart';
16 | import 'package:flutter_study_app/pages/other/demo/webview_plugin_demo.dart';
17 | import 'package:flutter_study_app/pages/other/other_page.dart';
18 | import 'package:flutter_study_app/pages/state/provider_demo/provider_demo.dart';
19 | import 'package:flutter_study_app/pages/state/state_page.dart';
20 | import 'package:flutter_study_app/pages/transition_page.dart';
21 | import 'package:flutter_study_app/pages/widgets/widgets_page.dart';
22 |
23 | ///欢迎页面
24 | var transitionHandler = Handler(
25 | handlerFunc: (BuildContext context, Map> params) {
26 | return TransitionPage();
27 | },
28 | );
29 |
30 | /// app的主页
31 | var mainHandler = Handler(
32 | handlerFunc: (BuildContext context, Map> params) {
33 | return MainPage();
34 | },
35 | );
36 |
37 | /// flutter dart
38 | var dartHandler = Handler(
39 | handlerFunc: (BuildContext context, Map> params) {
40 | return DartPage();
41 | },
42 | );
43 |
44 | /// flutter widgets
45 | var widgetsHandler = Handler(
46 | handlerFunc: (BuildContext context, Map> params) {
47 | return WidgetsPage();
48 | },
49 | );
50 |
51 | /// flutter 动画
52 | var animHandler = Handler(
53 | handlerFunc: (BuildContext context, Map> params) {
54 | return AnimDemoList();
55 | },
56 | );
57 |
58 | var customPaintHandler = Handler(
59 | handlerFunc: (BuildContext context, Map> params) {
60 | return CustomPaintPage();
61 | },
62 | );
63 |
64 |
65 | ///provider状态管理
66 | var stateHandler = Handler(
67 | handlerFunc: (BuildContext context, Map> params) {
68 | return StateDemoList();
69 | });
70 | var providerHandler = Handler(
71 | handlerFunc: (BuildContext context, Map> params) {
72 | return ProviderDemoPage();
73 | });
74 |
75 | /// flutter数据存储
76 | var localCacheHandler = Handler(
77 | handlerFunc: (BuildContext context, Map> params) {
78 | return LocalCachePage();
79 | },
80 | );
81 |
82 | var sqfliteHandler = Handler(
83 | handlerFunc: (BuildContext context, Map> params) {
84 | return SqflitePage();
85 | },
86 | );
87 |
88 | var spHandler = Handler(
89 | handlerFunc: (BuildContext context, Map> params) {
90 | return PreferencesDemo();
91 | });
92 |
93 | /// 其他demo列表页
94 | var otherListHandler = Handler(
95 | handlerFunc: (BuildContext context, Map> params) {
96 | return OtherDemoList();
97 | },
98 | );
99 |
100 | /// eventbus事件总线
101 | var eventBusHandler = Handler(
102 | handlerFunc: (BuildContext context, Map> params) {
103 | return EventBusPage();
104 | },
105 | );
106 |
107 | /// 文件解压缩
108 | var fileZipHandler = Handler(
109 | handlerFunc: (BuildContext context, Map> params) {
110 | return FileZipDemo();
111 | },
112 | );
113 |
114 | ///WebView(flutter_webview_plugin)
115 | var webViewPlginHandler = Handler(
116 | handlerFunc: (BuildContext context, Map> params) {
117 | String url = params['url']?.first;
118 | String title = params['title']?.first;
119 | return WebViewPlgin(
120 | url: url,
121 | title: title,
122 | );
123 | });
124 |
125 | ///WebView(flutter官方插件)
126 | var flutterWebViewHandler = Handler(
127 | handlerFunc: (BuildContext context, Map> params) {
128 | String url = params['url']?.first;
129 | String title = params['title']?.first;
130 | return FlutterWebView(
131 | url: url,
132 | barTitle: title,
133 | );
134 | });
135 |
136 | ///flutter channel
137 | var channelHandler = Handler(
138 | handlerFunc: (BuildContext context, Map> params) {
139 | return ChannelDemo();
140 | });
141 |
142 | ///urlLauncher
143 | var urlLauncherHandler = Handler(
144 | handlerFunc: (BuildContext context, Map> params) {
145 | return UrlLauncherDemo();
146 | });
147 |
148 | ///关于
149 | var aboutHandler = Handler(
150 | handlerFunc: (BuildContext context, Map> params) {
151 | return AboutPage();
152 | });
153 |
--------------------------------------------------------------------------------
/lib/routers/routers.dart:
--------------------------------------------------------------------------------
1 | import 'package:fluro/fluro.dart';
2 | import 'package:flutter/material.dart';
3 |
4 | import './router_handler.dart';
5 |
6 | class Routes {
7 | static String root = "/";
8 | static String transitionPage = "/transition";
9 | static String mainPage = "/main";
10 | static String aboutPage = "/about";
11 |
12 | static String dartPage = "/dart";
13 | static String widgetsPage = "/widgets";
14 |
15 | ///canvas与动画
16 | static String animPage = "/anim";
17 | static String customPaintPage = "/customPaint";
18 |
19 | ///状态管理
20 | static String statePage = "/state";
21 | static String providerPage = "/provider";
22 |
23 | ///数据库存储
24 | static String localCachePage = "/localCache";
25 | static String sqflitePage = "/sqflite";
26 | static String sharedPreferences = "/sharedPreferences";
27 |
28 | ///其他
29 | static String otherListPage = "/other";
30 | static String eventBusPage = "/eventBus";
31 | static String fileZipPage = "/fileZip";
32 | static String webViewPlginPage = "/webViewPlgin";
33 | static String flutterWebViewPage = "/flutterWebView";
34 | static String flutterChannel = "/flutterChannel";
35 | static String urlLauncher = "/urlLauncher";
36 |
37 | static void configureRoutes(FluroRouter router) {
38 | router.notFoundHandler = Handler(
39 | handlerFunc:
40 | (BuildContext context, Map> params) {});
41 |
42 | router.define(transitionPage, handler: transitionHandler);
43 | router.define(mainPage, handler: mainHandler);
44 | router.define(aboutPage, handler: aboutHandler);
45 |
46 | router.define(dartPage, handler: dartHandler);
47 | router.define(widgetsPage, handler: widgetsHandler);
48 |
49 | router.define(animPage, handler: animHandler);
50 | router.define(customPaintPage, handler: customPaintHandler);
51 |
52 | router.define(statePage, handler: stateHandler);
53 | router.define(providerPage, handler: providerHandler);
54 |
55 | router.define(localCachePage, handler: localCacheHandler);
56 | router.define(sqflitePage, handler: sqfliteHandler);
57 | router.define(sharedPreferences, handler: spHandler);
58 |
59 | router.define(otherListPage, handler: otherListHandler);
60 | router.define(eventBusPage, handler: eventBusHandler);
61 | router.define(fileZipPage, handler: fileZipHandler);
62 | router.define(webViewPlginPage, handler: webViewPlginHandler);
63 | router.define(flutterWebViewPage, handler: flutterWebViewHandler);
64 | router.define(flutterChannel, handler: channelHandler);
65 | router.define(urlLauncher, handler: urlLauncherHandler);
66 | }
67 | }
68 |
--------------------------------------------------------------------------------
/lib/utils/object_util.dart:
--------------------------------------------------------------------------------
1 | ///比较、判空
2 | class ObjectUtil {
3 | /// Returns true if the string is null or 0-length.
4 | static bool isEmptyString(String str) {
5 | return str == null || str.isEmpty;
6 | }
7 |
8 | /// Returns true if the list is null or 0-length.
9 | static bool isEmptyList(List list) {
10 | return list == null || list.isEmpty;
11 | }
12 |
13 | /// Returns true if there is no key/value pair in the map.
14 | static bool isEmptyMap(Map map) {
15 | return map == null || map.isEmpty;
16 | }
17 |
18 | /// Returns true String or List or Map is empty.
19 | static bool isEmpty(Object object) {
20 | if (object == null) return true;
21 | if (object is String && object.isEmpty) {
22 | return true;
23 | } else if (object is List && object.isEmpty) {
24 | return true;
25 | } else if (object is Map && object.isEmpty) {
26 | return true;
27 | }
28 | return false;
29 | }
30 |
31 | /// Returns true String or List or Map is not empty.
32 | static bool isNotEmpty(Object object) {
33 | return !isEmpty(object);
34 | }
35 |
36 | /// Returns true Two List Is Equal.
37 | static bool twoListIsEqual(List listA, List listB) {
38 | if (listA == listB) return true;
39 | if (listA == null || listB == null) return false;
40 | int length = listA.length;
41 | if (length != listB.length) return false;
42 | for (int i = 0; i < length; i++) {
43 | if (!listA.contains(listB[i])) {
44 | return false;
45 | }
46 | }
47 | return true;
48 | }
49 |
50 | /// get length.
51 | static int getLength(Object value) {
52 | if (value == null) return 0;
53 | if (value is String) {
54 | return value.length;
55 | } else if (value is List) {
56 | return value.length;
57 | } else if (value is Map) {
58 | return value.length;
59 | } else {
60 | return 0;
61 | }
62 | }
63 | }
64 |
--------------------------------------------------------------------------------
/lib/utils/toast_util.dart:
--------------------------------------------------------------------------------
1 | /**
2 | * @描述 toast工具类
3 | * @author chessluo
4 | * @email superluo666@gmail.com
5 | * @date 2020-04-04
6 | *
7 | */
8 | import 'package:flutter/material.dart';
9 | import 'package:flutter_study_app/res/colors.dart';
10 | import 'package:fluttertoast/fluttertoast.dart';
11 |
12 | class ToastUtil {
13 | ///toast可设置背景颜色默认背景黑色半透明,其他默认
14 | static void showToast(String msg,
15 | {Color color = AppColors.toastBlackBgColor,
16 | int timeInSecForIos = 1,
17 | Toast toastLength = Toast.LENGTH_SHORT}) {
18 | Fluttertoast.showToast(
19 | msg: "$msg",
20 | toastLength: toastLength,
21 | timeInSecForIosWeb: timeInSecForIos,
22 | backgroundColor: color);
23 | }
24 | }
25 |
--------------------------------------------------------------------------------
/pubspec.lock:
--------------------------------------------------------------------------------
1 | # Generated by pub
2 | # See https://dart.dev/tools/pub/glossary#lockfile
3 | packages:
4 | archive:
5 | dependency: "direct main"
6 | description:
7 | name: archive
8 | url: "https://pub.dartlang.org"
9 | source: hosted
10 | version: "3.1.2"
11 | async:
12 | dependency: transitive
13 | description:
14 | name: async
15 | url: "https://pub.dartlang.org"
16 | source: hosted
17 | version: "2.6.1"
18 | boolean_selector:
19 | dependency: transitive
20 | description:
21 | name: boolean_selector
22 | url: "https://pub.dartlang.org"
23 | source: hosted
24 | version: "2.1.0"
25 | characters:
26 | dependency: transitive
27 | description:
28 | name: characters
29 | url: "https://pub.dartlang.org"
30 | source: hosted
31 | version: "1.1.0"
32 | charcode:
33 | dependency: transitive
34 | description:
35 | name: charcode
36 | url: "https://pub.dartlang.org"
37 | source: hosted
38 | version: "1.2.0"
39 | clock:
40 | dependency: transitive
41 | description:
42 | name: clock
43 | url: "https://pub.dartlang.org"
44 | source: hosted
45 | version: "1.1.0"
46 | collection:
47 | dependency: transitive
48 | description:
49 | name: collection
50 | url: "https://pub.dartlang.org"
51 | source: hosted
52 | version: "1.15.0"
53 | crypto:
54 | dependency: transitive
55 | description:
56 | name: crypto
57 | url: "https://pub.dartlang.org"
58 | source: hosted
59 | version: "3.0.1"
60 | cupertino_icons:
61 | dependency: "direct main"
62 | description:
63 | name: cupertino_icons
64 | url: "https://pub.dartlang.org"
65 | source: hosted
66 | version: "1.0.3"
67 | event_bus:
68 | dependency: "direct main"
69 | description:
70 | name: event_bus
71 | url: "https://pub.dartlang.org"
72 | source: hosted
73 | version: "2.0.0"
74 | fake_async:
75 | dependency: transitive
76 | description:
77 | name: fake_async
78 | url: "https://pub.dartlang.org"
79 | source: hosted
80 | version: "1.2.0"
81 | ffi:
82 | dependency: transitive
83 | description:
84 | name: ffi
85 | url: "https://pub.dartlang.org"
86 | source: hosted
87 | version: "1.1.2"
88 | file:
89 | dependency: transitive
90 | description:
91 | name: file
92 | url: "https://pub.dartlang.org"
93 | source: hosted
94 | version: "6.1.2"
95 | fluro:
96 | dependency: "direct main"
97 | description:
98 | name: fluro
99 | url: "https://pub.dartlang.org"
100 | source: hosted
101 | version: "2.0.3"
102 | flutter:
103 | dependency: "direct main"
104 | description: flutter
105 | source: sdk
106 | version: "0.0.0"
107 | flutter_test:
108 | dependency: "direct dev"
109 | description: flutter
110 | source: sdk
111 | version: "0.0.0"
112 | flutter_web_plugins:
113 | dependency: transitive
114 | description: flutter
115 | source: sdk
116 | version: "0.0.0"
117 | flutter_webview_plugin:
118 | dependency: "direct main"
119 | description:
120 | name: flutter_webview_plugin
121 | url: "https://pub.dartlang.org"
122 | source: hosted
123 | version: "0.4.0"
124 | fluttertoast:
125 | dependency: "direct main"
126 | description:
127 | name: fluttertoast
128 | url: "https://pub.dartlang.org"
129 | source: hosted
130 | version: "8.0.7"
131 | js:
132 | dependency: transitive
133 | description:
134 | name: js
135 | url: "https://pub.dartlang.org"
136 | source: hosted
137 | version: "0.6.3"
138 | matcher:
139 | dependency: transitive
140 | description:
141 | name: matcher
142 | url: "https://pub.dartlang.org"
143 | source: hosted
144 | version: "0.12.10"
145 | meta:
146 | dependency: transitive
147 | description:
148 | name: meta
149 | url: "https://pub.dartlang.org"
150 | source: hosted
151 | version: "1.3.0"
152 | mime:
153 | dependency: transitive
154 | description:
155 | name: mime
156 | url: "https://pub.dartlang.org"
157 | source: hosted
158 | version: "1.0.0"
159 | nested:
160 | dependency: transitive
161 | description:
162 | name: nested
163 | url: "https://pub.dartlang.org"
164 | source: hosted
165 | version: "1.0.0"
166 | path:
167 | dependency: transitive
168 | description:
169 | name: path
170 | url: "https://pub.dartlang.org"
171 | source: hosted
172 | version: "1.8.0"
173 | path_provider:
174 | dependency: "direct main"
175 | description:
176 | name: path_provider
177 | url: "https://pub.dartlang.org"
178 | source: hosted
179 | version: "2.0.2"
180 | path_provider_linux:
181 | dependency: transitive
182 | description:
183 | name: path_provider_linux
184 | url: "https://pub.dartlang.org"
185 | source: hosted
186 | version: "2.0.0"
187 | path_provider_macos:
188 | dependency: transitive
189 | description:
190 | name: path_provider_macos
191 | url: "https://pub.dartlang.org"
192 | source: hosted
193 | version: "2.0.0"
194 | path_provider_platform_interface:
195 | dependency: transitive
196 | description:
197 | name: path_provider_platform_interface
198 | url: "https://pub.dartlang.org"
199 | source: hosted
200 | version: "2.0.1"
201 | path_provider_windows:
202 | dependency: transitive
203 | description:
204 | name: path_provider_windows
205 | url: "https://pub.dartlang.org"
206 | source: hosted
207 | version: "2.0.1"
208 | permission_handler:
209 | dependency: "direct main"
210 | description:
211 | name: permission_handler
212 | url: "https://pub.dartlang.org"
213 | source: hosted
214 | version: "8.1.2"
215 | permission_handler_platform_interface:
216 | dependency: transitive
217 | description:
218 | name: permission_handler_platform_interface
219 | url: "https://pub.dartlang.org"
220 | source: hosted
221 | version: "3.6.0"
222 | platform:
223 | dependency: transitive
224 | description:
225 | name: platform
226 | url: "https://pub.dartlang.org"
227 | source: hosted
228 | version: "3.0.0"
229 | plugin_platform_interface:
230 | dependency: transitive
231 | description:
232 | name: plugin_platform_interface
233 | url: "https://pub.dartlang.org"
234 | source: hosted
235 | version: "2.0.1"
236 | process:
237 | dependency: transitive
238 | description:
239 | name: process
240 | url: "https://pub.dartlang.org"
241 | source: hosted
242 | version: "4.2.1"
243 | provider:
244 | dependency: "direct main"
245 | description:
246 | name: provider
247 | url: "https://pub.dartlang.org"
248 | source: hosted
249 | version: "5.0.0"
250 | share:
251 | dependency: "direct main"
252 | description:
253 | name: share
254 | url: "https://pub.dartlang.org"
255 | source: hosted
256 | version: "2.0.4"
257 | shared_preferences:
258 | dependency: "direct main"
259 | description:
260 | name: shared_preferences
261 | url: "https://pub.dartlang.org"
262 | source: hosted
263 | version: "2.0.6"
264 | shared_preferences_linux:
265 | dependency: transitive
266 | description:
267 | name: shared_preferences_linux
268 | url: "https://pub.dartlang.org"
269 | source: hosted
270 | version: "2.0.0"
271 | shared_preferences_macos:
272 | dependency: transitive
273 | description:
274 | name: shared_preferences_macos
275 | url: "https://pub.dartlang.org"
276 | source: hosted
277 | version: "2.0.0"
278 | shared_preferences_platform_interface:
279 | dependency: transitive
280 | description:
281 | name: shared_preferences_platform_interface
282 | url: "https://pub.dartlang.org"
283 | source: hosted
284 | version: "2.0.0"
285 | shared_preferences_web:
286 | dependency: transitive
287 | description:
288 | name: shared_preferences_web
289 | url: "https://pub.dartlang.org"
290 | source: hosted
291 | version: "2.0.0"
292 | shared_preferences_windows:
293 | dependency: transitive
294 | description:
295 | name: shared_preferences_windows
296 | url: "https://pub.dartlang.org"
297 | source: hosted
298 | version: "2.0.0"
299 | sky_engine:
300 | dependency: transitive
301 | description: flutter
302 | source: sdk
303 | version: "0.0.99"
304 | source_span:
305 | dependency: transitive
306 | description:
307 | name: source_span
308 | url: "https://pub.dartlang.org"
309 | source: hosted
310 | version: "1.8.1"
311 | sqflite:
312 | dependency: "direct main"
313 | description:
314 | name: sqflite
315 | url: "https://pub.dartlang.org"
316 | source: hosted
317 | version: "2.0.0+3"
318 | sqflite_common:
319 | dependency: transitive
320 | description:
321 | name: sqflite_common
322 | url: "https://pub.dartlang.org"
323 | source: hosted
324 | version: "2.0.0+2"
325 | stack_trace:
326 | dependency: transitive
327 | description:
328 | name: stack_trace
329 | url: "https://pub.dartlang.org"
330 | source: hosted
331 | version: "1.10.0"
332 | stream_channel:
333 | dependency: transitive
334 | description:
335 | name: stream_channel
336 | url: "https://pub.dartlang.org"
337 | source: hosted
338 | version: "2.1.0"
339 | string_scanner:
340 | dependency: transitive
341 | description:
342 | name: string_scanner
343 | url: "https://pub.dartlang.org"
344 | source: hosted
345 | version: "1.1.0"
346 | synchronized:
347 | dependency: transitive
348 | description:
349 | name: synchronized
350 | url: "https://pub.dartlang.org"
351 | source: hosted
352 | version: "3.0.0"
353 | term_glyph:
354 | dependency: transitive
355 | description:
356 | name: term_glyph
357 | url: "https://pub.dartlang.org"
358 | source: hosted
359 | version: "1.2.0"
360 | test_api:
361 | dependency: transitive
362 | description:
363 | name: test_api
364 | url: "https://pub.dartlang.org"
365 | source: hosted
366 | version: "0.3.0"
367 | typed_data:
368 | dependency: transitive
369 | description:
370 | name: typed_data
371 | url: "https://pub.dartlang.org"
372 | source: hosted
373 | version: "1.3.0"
374 | url_launcher:
375 | dependency: "direct main"
376 | description:
377 | name: url_launcher
378 | url: "https://pub.dartlang.org"
379 | source: hosted
380 | version: "6.0.9"
381 | url_launcher_linux:
382 | dependency: transitive
383 | description:
384 | name: url_launcher_linux
385 | url: "https://pub.dartlang.org"
386 | source: hosted
387 | version: "2.0.0"
388 | url_launcher_macos:
389 | dependency: transitive
390 | description:
391 | name: url_launcher_macos
392 | url: "https://pub.dartlang.org"
393 | source: hosted
394 | version: "2.0.0"
395 | url_launcher_platform_interface:
396 | dependency: transitive
397 | description:
398 | name: url_launcher_platform_interface
399 | url: "https://pub.dartlang.org"
400 | source: hosted
401 | version: "2.0.4"
402 | url_launcher_web:
403 | dependency: transitive
404 | description:
405 | name: url_launcher_web
406 | url: "https://pub.dartlang.org"
407 | source: hosted
408 | version: "2.0.1"
409 | url_launcher_windows:
410 | dependency: transitive
411 | description:
412 | name: url_launcher_windows
413 | url: "https://pub.dartlang.org"
414 | source: hosted
415 | version: "2.0.0"
416 | vector_math:
417 | dependency: transitive
418 | description:
419 | name: vector_math
420 | url: "https://pub.dartlang.org"
421 | source: hosted
422 | version: "2.1.0"
423 | webview_flutter:
424 | dependency: "direct main"
425 | description:
426 | name: webview_flutter
427 | url: "https://pub.dartlang.org"
428 | source: hosted
429 | version: "2.0.9"
430 | win32:
431 | dependency: transitive
432 | description:
433 | name: win32
434 | url: "https://pub.dartlang.org"
435 | source: hosted
436 | version: "2.2.5"
437 | xdg_directories:
438 | dependency: transitive
439 | description:
440 | name: xdg_directories
441 | url: "https://pub.dartlang.org"
442 | source: hosted
443 | version: "0.2.0"
444 | sdks:
445 | dart: ">=2.13.0 <3.0.0"
446 | flutter: ">=2.0.0"
447 |
--------------------------------------------------------------------------------
/pubspec.yaml:
--------------------------------------------------------------------------------
1 | name: flutter_study_app
2 | description: A new Flutter application.
3 |
4 | # The following defines the version and build number for your application.
5 | # A version number is three numbers separated by dots, like 1.2.43
6 | # followed by an optional build number separated by a +.
7 | # Both the version and the builder number may be overridden in flutter
8 | # build by specifying --build-name and --build-number, respectively.
9 | # In Android, build-name is used as versionName while build-number used as versionCode.
10 | # Read more about Android versioning at https://developer.android.com/studio/publish/versioning
11 | # In iOS, build-name is used as CFBundleShortVersionString while build-number used as CFBundleVersion.
12 | # Read more about iOS versioning at
13 | # https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
14 | version: 1.0.0+1
15 |
16 | environment:
17 | sdk: ">=2.10.0 <3.0.0"
18 |
19 | dependencies:
20 | flutter:
21 | sdk: flutter
22 |
23 | # The following adds the Cupertino Icons font to your application.
24 | # Use with the CupertinoIcons class for iOS style icons.
25 | cupertino_icons: ^1.0.3
26 |
27 | sqflite: ^2.0.0+3 #数据库
28 | fluttertoast: ^8.0.7 #toast提示
29 | event_bus: ^2.0.0 #eventbus
30 | shared_preferences: ^2.0.6 #sp
31 | path_provider: ^2.0.2 #文件路径管理
32 | archive: ^3.1.2 #解/压缩
33 | permission_handler: ^8.1.2 #permission
34 | flutter_webview_plugin: ^0.4.0
35 | webview_flutter: ^2.0.9 #flutter官方webview
36 | provider: ^5.0.0 #状态管理
37 | fluro: ^2.0.3 #路由管理
38 | url_launcher: ^6.0.9 #url 跳转
39 | share: ^2.0.4 #分享
40 |
41 | dev_dependencies:
42 | flutter_test:
43 | sdk: flutter
44 |
45 |
46 | # For information on the generic Dart part of this file, see the
47 | # following page: https://www.dartlang.org/tools/pub/pubspec
48 |
49 | # The following section is specific to Flutter.
50 | flutter:
51 |
52 | # The following line ensures that the Material Icons font is
53 | # included with your application, so that you can use the icons in
54 | # the material Icons class.
55 | uses-material-design: true
56 |
57 | # To add assets to your application, add an assets section, like this:
58 | # assets:
59 | # - images/a_dot_burr.jpeg
60 | # - images/a_dot_ham.jpeg
61 | assets:
62 | - assets/images/
63 |
64 | # An image asset can refer to one or more resolution-specific "variants", see
65 | # https://flutter.io/assets-and-images/#resolution-aware.
66 |
67 | # For details regarding adding assets from package dependencies, see
68 | # https://flutter.io/assets-and-images/#from-packages
69 |
70 | # To add custom fonts to your application, add a fonts section here,
71 | # in this "flutter" section. Each entry in this list should have a
72 | # "family" key with the font family name, and a "fonts" key with a
73 | # list giving the asset and other descriptors for the font. For
74 | # example:
75 | # fonts:
76 | # - family: Schyler
77 | # fonts:
78 | # - asset: fonts/Schyler-Regular.ttf
79 | # - asset: fonts/Schyler-Italic.ttf
80 | # style: italic
81 | # - family: Trajan Pro
82 | # fonts:
83 | # - asset: fonts/TrajanPro.ttf
84 | # - asset: fonts/TrajanPro_Bold.ttf
85 | # weight: 700
86 | #
87 | # For details regarding fonts from package dependencies,
88 | # see https://flutter.io/custom-fonts/#from-packages
89 |
--------------------------------------------------------------------------------
/screenshots/about.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ChessLuo/flutter_study_app/db74f8c082b9597a0b74cf4135807201eeebe18a/screenshots/about.png
--------------------------------------------------------------------------------
/screenshots/channel.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ChessLuo/flutter_study_app/db74f8c082b9597a0b74cf4135807201eeebe18a/screenshots/channel.gif
--------------------------------------------------------------------------------
/screenshots/drawer.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ChessLuo/flutter_study_app/db74f8c082b9597a0b74cf4135807201eeebe18a/screenshots/drawer.png
--------------------------------------------------------------------------------
/screenshots/gfone.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ChessLuo/flutter_study_app/db74f8c082b9597a0b74cf4135807201eeebe18a/screenshots/gfone.gif
--------------------------------------------------------------------------------
/screenshots/gray.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ChessLuo/flutter_study_app/db74f8c082b9597a0b74cf4135807201eeebe18a/screenshots/gray.gif
--------------------------------------------------------------------------------
/screenshots/main.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ChessLuo/flutter_study_app/db74f8c082b9597a0b74cf4135807201eeebe18a/screenshots/main.png
--------------------------------------------------------------------------------
/screenshots/myQrcode.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ChessLuo/flutter_study_app/db74f8c082b9597a0b74cf4135807201eeebe18a/screenshots/myQrcode.jpg
--------------------------------------------------------------------------------
/screenshots/other.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ChessLuo/flutter_study_app/db74f8c082b9597a0b74cf4135807201eeebe18a/screenshots/other.png
--------------------------------------------------------------------------------
/screenshots/router.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ChessLuo/flutter_study_app/db74f8c082b9597a0b74cf4135807201eeebe18a/screenshots/router.gif
--------------------------------------------------------------------------------
/screenshots/shared_preferences.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ChessLuo/flutter_study_app/db74f8c082b9597a0b74cf4135807201eeebe18a/screenshots/shared_preferences.gif
--------------------------------------------------------------------------------
/screenshots/sqflite.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ChessLuo/flutter_study_app/db74f8c082b9597a0b74cf4135807201eeebe18a/screenshots/sqflite.png
--------------------------------------------------------------------------------
/screenshots/url_launcher.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ChessLuo/flutter_study_app/db74f8c082b9597a0b74cf4135807201eeebe18a/screenshots/url_launcher.gif
--------------------------------------------------------------------------------
/screenshots/webview.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ChessLuo/flutter_study_app/db74f8c082b9597a0b74cf4135807201eeebe18a/screenshots/webview.gif
--------------------------------------------------------------------------------
/screenshots/zip.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ChessLuo/flutter_study_app/db74f8c082b9597a0b74cf4135807201eeebe18a/screenshots/zip.png
--------------------------------------------------------------------------------
/test/widget_test.dart:
--------------------------------------------------------------------------------
1 | // This is a basic Flutter widget test.
2 | //
3 | // To perform an interaction with a widget in your test, use the WidgetTester
4 | // utility that Flutter provides. For example, you can send tap and scroll
5 | // gestures. You can also use WidgetTester to find child widgets in the widget
6 | // tree, read text, and verify that the values of widget properties are correct.
7 |
8 | import 'package:flutter/material.dart';
9 | import 'package:flutter_study_app/fl_app.dart';
10 | import 'package:flutter_test/flutter_test.dart';
11 |
12 | void main() {
13 | testWidgets('Counter increments smoke test', (WidgetTester tester) async {
14 | // Build our app and trigger a frame.
15 | await tester.pumpWidget(MyApp());
16 |
17 | // Verify that our counter starts at 0.
18 | expect(find.text('0'), findsOneWidget);
19 | expect(find.text('1'), findsNothing);
20 |
21 | // Tap the '+' icon and trigger a frame.
22 | await tester.tap(find.byIcon(Icons.add));
23 | await tester.pump();
24 |
25 | // Verify that our counter has incremented.
26 | expect(find.text('0'), findsNothing);
27 | expect(find.text('1'), findsOneWidget);
28 | });
29 | }
30 |
--------------------------------------------------------------------------------