├── .gitignore
├── .idea
├── FlutterApp.iml
├── libraries
│ ├── Dart_Packages.xml
│ └── Dart_SDK.xml
└── vcs.xml
├── .metadata
├── README.md
├── android
├── .gitignore
├── .idea
│ ├── compiler.xml
│ ├── gradle.xml
│ ├── jarRepositories.xml
│ ├── misc.xml
│ ├── modules.xml
│ └── vcs.xml
├── app
│ ├── build.gradle
│ └── src
│ │ └── main
│ │ ├── AndroidManifest.xml
│ │ ├── java
│ │ └── com
│ │ │ └── yourcompany
│ │ │ └── flutterapp
│ │ │ └── MainActivity.java
│ │ └── res
│ │ ├── drawable
│ │ └── launch_background.xml
│ │ ├── mipmap-hdpi
│ │ └── ic_launcher.png
│ │ ├── mipmap-mdpi
│ │ └── ic_launcher.png
│ │ ├── mipmap-xhdpi
│ │ └── ic_launcher.png
│ │ ├── mipmap-xxhdpi
│ │ ├── ic_launcher.png
│ │ └── start.jpg
│ │ ├── mipmap-xxxhdpi
│ │ └── ic_launcher.png
│ │ └── values
│ │ └── styles.xml
├── build.gradle
├── gradle.properties
├── gradle
│ └── wrapper
│ │ ├── gradle-wrapper.jar
│ │ └── gradle-wrapper.properties
├── gradlew
├── gradlew.bat
├── key.properties
└── settings.gradle
├── flutter_app.iml
├── flutter_app_android.iml
├── ios
├── .gitignore
├── Flutter
│ ├── AppFrameworkInfo.plist
│ ├── Debug.xcconfig
│ └── Release.xcconfig
├── Runner.xcodeproj
│ ├── project.pbxproj
│ ├── project.xcworkspace
│ │ └── contents.xcworkspacedata
│ └── xcshareddata
│ │ └── xcschemes
│ │ └── Runner.xcscheme
├── Runner.xcworkspace
│ └── contents.xcworkspacedata
└── Runner
│ ├── AppDelegate.h
│ ├── AppDelegate.m
│ ├── Assets.xcassets
│ ├── AppIcon.appiconset
│ │ ├── Contents.json
│ │ ├── Icon-App-1024x1024@1x.png
│ │ ├── Icon-App-20x20@1x.png
│ │ ├── Icon-App-20x20@2x.png
│ │ ├── Icon-App-20x20@3x.png
│ │ ├── Icon-App-29x29@1x.png
│ │ ├── Icon-App-29x29@2x.png
│ │ ├── Icon-App-29x29@3x.png
│ │ ├── Icon-App-40x40@1x.png
│ │ ├── Icon-App-40x40@2x.png
│ │ ├── Icon-App-40x40@3x.png
│ │ ├── Icon-App-60x60@2x.png
│ │ ├── Icon-App-60x60@3x.png
│ │ ├── Icon-App-76x76@1x.png
│ │ ├── Icon-App-76x76@2x.png
│ │ └── Icon-App-83.5x83.5@2x.png
│ └── LaunchImage.imageset
│ │ ├── Contents.json
│ │ ├── LaunchImage.png
│ │ ├── LaunchImage@2x.png
│ │ ├── LaunchImage@3x.png
│ │ └── README.md
│ ├── Base.lproj
│ ├── LaunchScreen.storyboard
│ └── Main.storyboard
│ ├── Info.plist
│ └── main.m
├── lib
├── MainPage.dart
├── TabIconView.dart
├── bean
│ ├── DataBean.dart
│ └── MovieBean.dart
├── home
│ ├── GestureDetectorPage.dart
│ ├── HomePage.dart
│ ├── OtherPage.dart
│ ├── TabFroth.dart
│ ├── TabOne.dart
│ ├── TabThree.dart
│ ├── TabTwo.dart
│ └── question.dart
├── main.dart
├── my
│ └── MyPage.dart
├── official
│ └── OfficialNetWorkPage.dart
├── similarWords
│ └── SimilarWordsPage.dart
├── utils
│ └── ToastUtil.dart
└── widget
│ └── CustomButton.dart
├── pubspec.lock
├── pubspec.yaml
└── test
└── widget_test.dart
/.gitignore:
--------------------------------------------------------------------------------
1 | .DS_Store
2 | .dart_tool/
3 |
4 | .packages
5 | .pub/
6 |
7 | build/
8 |
9 | .flutter-plugins
10 |
--------------------------------------------------------------------------------
/.idea/FlutterApp.iml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
--------------------------------------------------------------------------------
/.idea/libraries/Dart_Packages.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
489 |
490 |
491 |
492 |
493 |
494 |
495 |
496 |
497 |
498 |
499 |
500 |
501 |
502 |
503 |
504 |
505 |
506 |
507 |
508 |
509 |
510 |
511 |
512 |
513 |
514 |
515 |
516 |
517 |
518 |
519 |
520 |
521 |
522 |
523 |
524 |
525 |
526 |
527 |
528 |
529 |
530 |
531 |
532 |
533 |
534 |
535 |
536 |
537 |
538 |
539 |
540 |
541 |
542 |
543 |
544 |
545 |
546 |
547 |
548 |
549 |
550 |
551 |
552 |
553 |
554 |
555 |
556 |
557 |
558 |
559 |
560 |
561 |
562 |
563 |
564 |
--------------------------------------------------------------------------------
/.idea/libraries/Dart_SDK.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
--------------------------------------------------------------------------------
/.idea/vcs.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/.metadata:
--------------------------------------------------------------------------------
1 | # This file tracks properties of this Flutter project.
2 | # Used by Flutter tool to assess capabilities and perform upgrades etc.
3 | #
4 | # This file should be version controlled and should not be manually edited.
5 |
6 | version:
7 | revision: 44b7e7d3f42f050a79712daab253af06e9daf530
8 | channel: beta
9 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | * 首先推荐两篇文章,写的非常的详细,从中可以了解到原理,写的非常的详细!
2 | * [美团技术团队Flutter见解](https://mp.weixin.qq.com/s/cJjKZCqc8UuzvEtxK1BJCw)
3 | * [下一代移动端跨平台框架-Flutter大解密](https://mp.weixin.qq.com/s/ZMp2fSOTlYkZ_aNIOrUZdw)
4 | * Demo 的下载地址(正式包,使用Flutter命令打的正式包)
5 | 
6 | * App详情
7 |
8 | 
9 | 
10 |
11 |
12 |
13 | ### App的页面详情
14 | #### `HomePage`;里面嵌套了四个页面,使用的是` TabBar`和 `TabBarView`的组合,比如安卓中的`Fragment` `Viewpager`
15 | * 1、首页的第一页使用豆瓣电影的接口,请求数据,并且展示出来了,工程中如何代码中如何使用依赖?如下代码所示
16 | ```
17 | flutter:
18 | sdk: flutter
19 | # The following adds the Cupertino Icons font to your application.
20 | # Use with the CupertinoIcons class for iOS style icons.
21 | cupertino_icons: ^0.1.0
22 | fluttertoast: ^2.0.7 #"Packages get" 要去主动的 get 一次依赖
23 | dio: ^v1.0.3
24 | # 添加网络依赖
25 | ```
26 | * 2、演示了图片控件摆放
27 | * 3、综合列表的展示
28 | * 4、其他控件的使用Demo
29 |
30 | 
31 |
32 | 
33 |
34 | * 首页的关键代码
35 | ```
36 | //为给定的[子]控件创建默认选项卡控制器。
37 | return new DefaultTabController(
38 | length: 5,
39 | child: new Scaffold(
40 | appBar: new AppBar(
41 | backgroundColor: Colors.black45,
42 | // title: titleWidget(),
43 | title: new Text("首页",style: new TextStyle(color: Colors.white,fontSize: 22.00),),
44 | actions: [
45 | new IconButton(
46 | icon: new Icon(Icons.add_a_photo), onPressed: () {
47 | Navigator
48 | .of(context)
49 | .push(new MaterialPageRoute(builder: (context) {
50 | return new OtherPage();
51 | }));
52 | })
53 | ],
54 | bottom: new TabBar(
55 | isScrollable: true,
56 | labelStyle: new TextStyle(fontSize: 22.00,color: Colors.red),
57 | indicatorPadding:EdgeInsets.zero,
58 | labelColor: Colors.white,
59 | indicatorWeight:4.0,
60 | unselectedLabelColor: Colors.blueAccent,
61 | tabs: [
62 | new Tab(
63 | text: "豆瓣电影",
64 | ),
65 | new Tab(
66 | text: "控件摆放",
67 | ),
68 | new Tab(
69 | text: "列表展示",
70 | ),
71 | new Tab(
72 | text: "其他控件展示",
73 | ),
74 | ]),
75 | ),
76 | body: new TabBarView(children: [new TabOne(), new TabTwo(),new TabThree(),new TabFroth()]),
77 | ));
78 | ```
79 | #### SimilarWordsPage寻找近义词Demo,就是一个点击按钮,然后请求网络,刷新页面的流程。
80 | * 1、使用了`TextField`相当于安卓中的`Edittext`,只不过获取值的时候有些变化
81 | ```
82 | new Expanded(
83 | child: new TextField(
84 | //不要主动弹起来
85 | autofocus: false,
86 | controller: _textController,
87 | decoration: new InputDecoration.collapsed(
88 | hintText: "请输入要查找的词",
89 | hintStyle: new TextStyle(color: Colors.red)),
90 | ),
91 | ```
92 | * 2、如何退出页面` Navigator.of(context).pop();`
93 | * 3、如何使用`Toast`,这里我是使用了三方的依赖!底层原理是使用了反射,具体实现的方法,有兴趣的同学可以看看` String res = await _channel.invokeMethod('showToast', params);`
94 | ```
95 | Fluttertoast.showToast(
96 | msg: "输入为空,请重新输入",
97 | timeInSecForIos: 1,
98 | bgcolor: "#e74c3c",
99 | textcolor: '#ffffff');
100 | ```
101 | * 4、带框的Button的使用,具体请看实现的代码。
102 | * 5、具体页面如下
103 |
104 | 
105 | * 6、代码如下
106 | ```
107 | import 'dart:convert';
108 | import 'dart:io';
109 | import 'package:flutter/material.dart';
110 | import 'package:flutter_app/bean/DataBean.dart';
111 | import 'package:fluttertoast/fluttertoast.dart';
112 |
113 | class SimilarWordsPage extends StatefulWidget {
114 | @override
115 | State createState() {
116 | return new SimilarWordsPageState();
117 | }
118 | }
119 |
120 | class SimilarWordsPageState extends State {
121 | List datas = [];
122 | static int i=0;
123 | final TextEditingController _textController = new TextEditingController();
124 |
125 | @override
126 | Widget build(BuildContext context) {
127 | return new Scaffold(
128 | appBar: findAppBar(),
129 | backgroundColor: Colors.black12,
130 | body: findBody(),
131 | );
132 | }
133 |
134 | findBody() {
135 | return new Container(
136 | child: new Scaffold(
137 | body: new ListView.builder(
138 | itemCount: datas.length,
139 | itemBuilder: (BuildContext context, int position) {
140 | i=position;
141 | return getRow(position);
142 | },
143 | ),
144 | ));
145 | }
146 |
147 | Widget findAppBar() {
148 | return new AppBar(
149 | title: new Container(
150 | child: new Row(
151 | children: [
152 | new Container(
153 | child: new FlatButton.icon(
154 | onPressed: () {
155 | // 本来就在栈顶,退出会有显示的问题
156 | Navigator.of(context).pop();
157 | },
158 | icon: new Icon(Icons.close, color: Colors.white30),
159 | label: new Text(""),
160 | ),
161 | width: 60.0,
162 | ),
163 | new Expanded(
164 | child: new TextField(
165 | //不要主动弹起来
166 | autofocus: false,
167 | controller: _textController,
168 | decoration: new InputDecoration.collapsed(
169 | hintText: "请输入要查找的词",
170 | hintStyle: new TextStyle(color: Colors.red)),
171 | ),
172 | ),
173 | //点击事件的第一种实现的方式 我觉得不太好
174 | // new GestureDetector(child: new Icon(Icons.find_in_page),onTap: (){print("dd");})
175 | // 这种点击时间有点效果
176 | new IconButton(
177 | icon: new Icon(Icons.find_in_page),
178 | onPressed: () {
179 | print(_textController.text);
180 | if (_textController.text.isEmpty) {
181 | Fluttertoast.showToast(
182 | msg: "输入为空,请重新输入",
183 | timeInSecForIos: 1,
184 | bgcolor: "#e74c3c",
185 | textcolor: '#ffffff');
186 | } else {
187 | FocusNode focusNode = new FocusNode();
188 | FocusScope.of(context).requestFocus(new FocusNode());
189 | Fluttertoast.showToast(
190 | msg: "查找值为:" + _textController.text,
191 | timeInSecForIos: 1,
192 | bgcolor: "#e74c3c",
193 | textcolor: '#ffffff');
194 | getApiData(_textController.text);
195 | focusNode.unfocus();
196 | }
197 | })
198 | ],
199 | ),
200 | decoration: new BoxDecoration(
201 | borderRadius: const BorderRadius.all(const Radius.circular(4.0)),
202 | color: Colors.white10),
203 | ));
204 | }
205 |
206 | Widget getRow(int i) {
207 | return new Padding(
208 | padding: new EdgeInsets.all(10.0),
209 | // child: new Text("Row ${datas[i].key}",style: new TextStyle(color: Colors.orange,fontSize: 18.00),)
210 | // Column 相当于 相对布局 Row 线性布局
211 | child: new Column(
212 | children: [
213 | new Padding(
214 | padding: new EdgeInsets.fromLTRB(0.0, 5.0, 0.0, 5.0),
215 | child: new Row(
216 | children: [
217 | new Expanded(
218 | child: new OutlineButton(
219 | borderSide:new BorderSide(color: Theme.of(context).primaryColor),
220 | child: new Text('条目 = '+i.toString(),style: new TextStyle(color: Theme.of(context).primaryColor),),
221 | onPressed: (){},
222 | )
223 | ),
224 | ],
225 | ),
226 | ),
227 |
228 | new Container(
229 | child: new Text(
230 | "联想到的词:" + datas[i].key,
231 | style: new TextStyle(color: Colors.purple, fontSize: 12.00),
232 | ),
233 | padding: new EdgeInsets.all(10.0),
234 | ),
235 | new Container(
236 | child: new Text("联想到词的翻译信息:" + datas[i].message,
237 | style: new TextStyle(color: Colors.cyan, fontSize: 15.00)),
238 | padding: new EdgeInsets.all(10.0),
239 | )
240 | ],
241 | ),
242 | );
243 | }
244 |
245 | @override
246 | void initState() {
247 | super.initState();
248 | // 网络请求
249 | //http://dict-mobile.iciba.com/interface/index.php?c=word&m=getsuggest&nums=10&client=6&is_need_mean=1&word=sm
250 | //我的 Api的地址
251 | getApiData("sm");
252 | }
253 |
254 | // 网络请求
255 | void getApiData(String tag) async {
256 | // 注意导入的包的地方是 import 'dart:io';
257 | var httpClient = new HttpClient();
258 | var url =
259 | "http://dict-mobile.iciba.com/interface/index.php?c=word&m=getsuggest&nums=20&client=6&is_need_mean=1&word=" +
260 | tag;
261 | var request = await httpClient.getUrl(Uri.parse(url));
262 | var response = await request.close();
263 | if (response.statusCode == HttpStatus.OK) {
264 | var jsonData = await response.transform(utf8.decoder).join();
265 | setState(() {
266 | datas = DataBean.decodeData(jsonData);
267 | });
268 | for (int i = 0; i < datas.length; i++) {
269 | print(datas[i].key);
270 | print(datas[i].message);
271 | }
272 | }
273 | }
274 | }
275 | ```
276 |
277 | #### 官方Demo
278 |
279 | 
280 |
281 | #### 关于我
282 |
283 | 
284 |
285 |
286 | #### 一些总结
287 | * `widget `相当于` View`,`Widget`的实例仅仅存在每一帧之间,并且每一帧之间 `Flutter`都会主动的创建一颗`Widget`树用于下一帧的渲染。
288 | * `Android` 中 `View` 是可变的,在 `Flutter` 中的 `Widget` 是不可变的。这种特性使得 `Flutter` 中的 `Widget` 变得十分轻量级
289 | * 一个 `Widget `会变化,那么它就是有状态的。但是如果一个子` Widget `是有状态的,但是其父` Widget `是不可变的话父` Widget `也可以是 `StatelessWidget `。
290 | * `TatelessWidget `和`StatefulWidget` 的核心内容是一致的,它们都会在每一帧中被重构,不同之处在于` StatefulWidget` 有一个 `State` 对象,它可以为 `StatefulWidget` 在不同帧之间存储数据。
291 | * `Flutter` 中` UI `的布局是通过在` dart` 文件中构建 `Widget` 树来实现的。
292 | * 在 `Android `中,使用 `LinearLayout` 使你的部件垂直或水平放置。在 `Flutter `中,你可以使用` Row` 或者 `Column` 来实现相同的效果。
293 | * 在 `Flutter` 中,最简单的方法是使用` ListView` 。在` Flutter` 中,`ListView` 既是` ScrollView` 又是`Android`中的` ListView`。
294 | * 通过使用` Column`,`Row` 和` Stack`等 `Widget` 的组合来实现 `RelativeLayout` 的效果
295 | * `Flutter` 中,添加触摸监听器有两种方法
296 | * 如果` Widget `支持事件检测,则可以将一个函数传递给它并进行处理。例如,`RaisedButton` 有一个` onPressed` 参数
297 | * 如果 `Widget `不支持事件检测,则可以将该 `Widget` 包装到 `GestureDetector `中,并将函数传递给`onTap` 参数。
298 | * `GestureDetector` 我们可以监听广泛的手势
299 | * 要充分利用应用程序中的 `Material `风格的组件的话,可以把顶级部件 `MaterialApp `作为应用程序的入口。`MaterialApp `作为一个比较方便的部件,包装了许多实现了 `Material` 风格所需要的部件(如 `Scaffold `)。`MaterialApp `是在 `WidgetsApp` 的基础上进行实现的
300 | * `Flutter `不会自动导入包
301 | * `Column `相当于 相对布局` Row `线性布局
302 | * 首页的数据结构展示
303 | * `HttpClient`导入的包是 `io`里面的
304 | * `DEBUG` 包要不正式包大很多 `Built build\app\outputs\apk\debug\app-debug.apk (31.9MB).`而正式包才`8.4M`.
305 | * 解决的`Bug`的时候太痛苦了,`Flutter `使用 `ide` ,太痛苦了
306 | * 在脑袋要构思出 这个布局的整体的结构
307 | * 关闭系统自带的防火墙,重启OK 由于需要出差,就是用的是笔记本开发,导致自己笔记本的防火墙没有被关闭,真的是日了狗了,[解决防火墙](https://www.cnblogs.com/dreamyu/p/8032588.html)。
308 | * MediaQuery.of(context).size.width / 4分之一的屏幕
309 | * ` MaterialApp` 带有 `Debug`的标记
310 |
311 | #### 感谢以下资料给与我的帮助
312 | * [Android 开发者参考](http://doc.flutter-dev.cn/flutter-for-android/)
313 | * Api的接口 [查询近义词](https://github.com/jokermonn/-Api/blob/master/KingsoftDic.md)
314 | * Api的接口 [豆瓣电影](https://api.douban.com/v2/movie/in_theaters?apikey=0b2bdeda43b5688921839c8ecb20399b&city=%E6%B7%B1%E5%9C%B3&start=0&count=100&client=somemessage&udid=dddddddddddddddddddddd)
315 | * [打包的流程](https://www.jianshu.com/p/f91b4e84cec8)
316 |
317 |
318 | # 求赞或者求星星 **[FlutterApp](https://github.com/Shimingli/FlutterApp)**
319 |
320 | ## Getting Started
321 | * For help getting started with Flutter, view our online
322 | [documentation](https://flutter.io/).
323 |
--------------------------------------------------------------------------------
/android/.gitignore:
--------------------------------------------------------------------------------
1 | *.iml
2 | *.class
3 | .gradle
4 | /local.properties
5 | /.idea/workspace.xml
6 | /.idea/libraries
7 | .DS_Store
8 | /build
9 | /captures
10 | GeneratedPluginRegistrant.java
11 |
--------------------------------------------------------------------------------
/android/.idea/compiler.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/android/.idea/gradle.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
--------------------------------------------------------------------------------
/android/.idea/jarRepositories.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
--------------------------------------------------------------------------------
/android/.idea/misc.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/android/.idea/modules.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/android/.idea/vcs.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/android/app/build.gradle:
--------------------------------------------------------------------------------
1 | def localProperties = new Properties()
2 | def localPropertiesFile = rootProject.file('local.properties')
3 | if (localPropertiesFile.exists()) {
4 | localPropertiesFile.withReader('UTF-8') { reader ->
5 | localProperties.load(reader)
6 | }
7 | }
8 |
9 | def flutterRoot = localProperties.getProperty('flutter.sdk')
10 | if (flutterRoot == null) {
11 | throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.")
12 | }
13 |
14 | def flutterVersionCode = localProperties.getProperty('flutter.versionCode')
15 | if (flutterVersionCode == null) {
16 | flutterVersionCode = '1'
17 | }
18 |
19 | def flutterVersionName = localProperties.getProperty('flutter.versionName')
20 | if (flutterVersionName == null) {
21 | flutterVersionName = '1.0'
22 | }
23 |
24 | apply plugin: 'com.android.application'
25 | //apply plugin: 'kotlin-android'
26 | apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
27 |
28 | android {
29 | compileSdkVersion flutter.compileSdkVersion
30 |
31 | compileOptions {
32 | sourceCompatibility JavaVersion.VERSION_1_8
33 | targetCompatibility JavaVersion.VERSION_1_8
34 | }
35 |
36 | defaultConfig {
37 | // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
38 | applicationId "com.example.shimingdemo"
39 | minSdkVersion flutter.minSdkVersion
40 | targetSdkVersion flutter.targetSdkVersion
41 | versionCode flutterVersionCode.toInteger()
42 | versionName flutterVersionName
43 | }
44 |
45 | buildTypes {
46 | release {
47 | // TODO: Add your own signing config for the release build.
48 | // Signing with the debug keys for now, so `flutter run --release` works.
49 | signingConfig signingConfigs.debug
50 | }
51 | }
52 | }
53 |
54 | flutter {
55 | source '../..'
56 | }
57 |
--------------------------------------------------------------------------------
/android/app/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
3 |
4 |
8 |
9 |
10 |
15 |
18 |
25 |
29 |
32 |
33 |
34 |
35 |
36 |
37 |
40 |
41 |
42 |
--------------------------------------------------------------------------------
/android/app/src/main/java/com/yourcompany/flutterapp/MainActivity.java:
--------------------------------------------------------------------------------
1 | package com.yourcompany.flutterapp;
2 |
3 | import android.os.Bundle;
4 |
5 | import io.flutter.app.FlutterActivity;
6 | import io.flutter.plugins.GeneratedPluginRegistrant;
7 |
8 | public class MainActivity extends FlutterActivity {
9 | @Override
10 | protected void onCreate(Bundle savedInstanceState) {
11 | super.onCreate(savedInstanceState);
12 | // GeneratedPluginRegistrant.registerWith(this);
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/android/app/src/main/res/drawable/launch_background.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
12 |
13 |
--------------------------------------------------------------------------------
/android/app/src/main/res/mipmap-hdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Shimingli/FlutterApp/35095aa4a52277fd62dca273eb1f8b3f36ed5a01/android/app/src/main/res/mipmap-hdpi/ic_launcher.png
--------------------------------------------------------------------------------
/android/app/src/main/res/mipmap-mdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Shimingli/FlutterApp/35095aa4a52277fd62dca273eb1f8b3f36ed5a01/android/app/src/main/res/mipmap-mdpi/ic_launcher.png
--------------------------------------------------------------------------------
/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Shimingli/FlutterApp/35095aa4a52277fd62dca273eb1f8b3f36ed5a01/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Shimingli/FlutterApp/35095aa4a52277fd62dca273eb1f8b3f36ed5a01/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/android/app/src/main/res/mipmap-xxhdpi/start.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Shimingli/FlutterApp/35095aa4a52277fd62dca273eb1f8b3f36ed5a01/android/app/src/main/res/mipmap-xxhdpi/start.jpg
--------------------------------------------------------------------------------
/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Shimingli/FlutterApp/35095aa4a52277fd62dca273eb1f8b3f36ed5a01/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/android/app/src/main/res/values/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
8 |
9 |
--------------------------------------------------------------------------------
/android/build.gradle:
--------------------------------------------------------------------------------
1 | buildscript {
2 | repositories {
3 | google()
4 | mavenCentral()
5 | }
6 |
7 | dependencies {
8 | classpath 'com.android.tools.build:gradle:4.1.0'
9 | }
10 | }
11 |
12 | allprojects {
13 | repositories {
14 | google()
15 | mavenCentral()
16 | }
17 | }
18 |
19 | rootProject.buildDir = '../build'
20 | subprojects {
21 | project.buildDir = "${rootProject.buildDir}/${project.name}"
22 | }
23 | subprojects {
24 | project.evaluationDependsOn(':app')
25 | }
26 |
27 | task clean(type: Delete) {
28 | delete rootProject.buildDir
29 | }
30 |
31 |
--------------------------------------------------------------------------------
/android/gradle.properties:
--------------------------------------------------------------------------------
1 | org.gradle.jvmargs=-Xmx1536M
2 | android.useAndroidX=true
3 | android.enableJetifier=true
4 |
--------------------------------------------------------------------------------
/android/gradle/wrapper/gradle-wrapper.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Shimingli/FlutterApp/35095aa4a52277fd62dca273eb1f8b3f36ed5a01/android/gradle/wrapper/gradle-wrapper.jar
--------------------------------------------------------------------------------
/android/gradle/wrapper/gradle-wrapper.properties:
--------------------------------------------------------------------------------
1 | #Wed Feb 23 17:15:06 CST 2022
2 | distributionBase=GRADLE_USER_HOME
3 | distributionUrl=https\://services.gradle.org/distributions/gradle-6.5-bin.zip
4 | distributionPath=wrapper/dists
5 | zipStorePath=wrapper/dists
6 | zipStoreBase=GRADLE_USER_HOME
7 |
--------------------------------------------------------------------------------
/android/gradlew:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 |
3 | ##############################################################################
4 | ##
5 | ## Gradle start up script for UN*X
6 | ##
7 | ##############################################################################
8 |
9 | # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
10 | DEFAULT_JVM_OPTS=""
11 |
12 | APP_NAME="Gradle"
13 | APP_BASE_NAME=`basename "$0"`
14 |
15 | # Use the maximum available, or set MAX_FD != -1 to use that value.
16 | MAX_FD="maximum"
17 |
18 | warn ( ) {
19 | echo "$*"
20 | }
21 |
22 | die ( ) {
23 | echo
24 | echo "$*"
25 | echo
26 | exit 1
27 | }
28 |
29 | # OS specific support (must be 'true' or 'false').
30 | cygwin=false
31 | msys=false
32 | darwin=false
33 | case "`uname`" in
34 | CYGWIN* )
35 | cygwin=true
36 | ;;
37 | Darwin* )
38 | darwin=true
39 | ;;
40 | MINGW* )
41 | msys=true
42 | ;;
43 | esac
44 |
45 | # Attempt to set APP_HOME
46 | # Resolve links: $0 may be a link
47 | PRG="$0"
48 | # Need this for relative symlinks.
49 | while [ -h "$PRG" ] ; do
50 | ls=`ls -ld "$PRG"`
51 | link=`expr "$ls" : '.*-> \(.*\)$'`
52 | if expr "$link" : '/.*' > /dev/null; then
53 | PRG="$link"
54 | else
55 | PRG=`dirname "$PRG"`"/$link"
56 | fi
57 | done
58 | SAVED="`pwd`"
59 | cd "`dirname \"$PRG\"`/" >/dev/null
60 | APP_HOME="`pwd -P`"
61 | cd "$SAVED" >/dev/null
62 |
63 | CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
64 |
65 | # Determine the Java command to use to start the JVM.
66 | if [ -n "$JAVA_HOME" ] ; then
67 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
68 | # IBM's JDK on AIX uses strange locations for the executables
69 | JAVACMD="$JAVA_HOME/jre/sh/java"
70 | else
71 | JAVACMD="$JAVA_HOME/bin/java"
72 | fi
73 | if [ ! -x "$JAVACMD" ] ; then
74 | die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
75 |
76 | Please set the JAVA_HOME variable in your environment to match the
77 | location of your Java installation."
78 | fi
79 | else
80 | JAVACMD="java"
81 | which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
82 |
83 | Please set the JAVA_HOME variable in your environment to match the
84 | location of your Java installation."
85 | fi
86 |
87 | # Increase the maximum file descriptors if we can.
88 | if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then
89 | MAX_FD_LIMIT=`ulimit -H -n`
90 | if [ $? -eq 0 ] ; then
91 | if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
92 | MAX_FD="$MAX_FD_LIMIT"
93 | fi
94 | ulimit -n $MAX_FD
95 | if [ $? -ne 0 ] ; then
96 | warn "Could not set maximum file descriptor limit: $MAX_FD"
97 | fi
98 | else
99 | warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
100 | fi
101 | fi
102 |
103 | # For Darwin, add options to specify how the application appears in the dock
104 | if $darwin; then
105 | GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
106 | fi
107 |
108 | # For Cygwin, switch paths to Windows format before running java
109 | if $cygwin ; then
110 | APP_HOME=`cygpath --path --mixed "$APP_HOME"`
111 | CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
112 | JAVACMD=`cygpath --unix "$JAVACMD"`
113 |
114 | # We build the pattern for arguments to be converted via cygpath
115 | ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
116 | SEP=""
117 | for dir in $ROOTDIRSRAW ; do
118 | ROOTDIRS="$ROOTDIRS$SEP$dir"
119 | SEP="|"
120 | done
121 | OURCYGPATTERN="(^($ROOTDIRS))"
122 | # Add a user-defined pattern to the cygpath arguments
123 | if [ "$GRADLE_CYGPATTERN" != "" ] ; then
124 | OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
125 | fi
126 | # Now convert the arguments - kludge to limit ourselves to /bin/sh
127 | i=0
128 | for arg in "$@" ; do
129 | CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
130 | CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
131 |
132 | if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
133 | eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
134 | else
135 | eval `echo args$i`="\"$arg\""
136 | fi
137 | i=$((i+1))
138 | done
139 | case $i in
140 | (0) set -- ;;
141 | (1) set -- "$args0" ;;
142 | (2) set -- "$args0" "$args1" ;;
143 | (3) set -- "$args0" "$args1" "$args2" ;;
144 | (4) set -- "$args0" "$args1" "$args2" "$args3" ;;
145 | (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
146 | (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
147 | (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
148 | (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
149 | (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
150 | esac
151 | fi
152 |
153 | # Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules
154 | function splitJvmOpts() {
155 | JVM_OPTS=("$@")
156 | }
157 | eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS
158 | JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME"
159 |
160 | exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@"
161 |
--------------------------------------------------------------------------------
/android/gradlew.bat:
--------------------------------------------------------------------------------
1 | @if "%DEBUG%" == "" @echo off
2 | @rem ##########################################################################
3 | @rem
4 | @rem Gradle startup script for Windows
5 | @rem
6 | @rem ##########################################################################
7 |
8 | @rem Set local scope for the variables with windows NT shell
9 | if "%OS%"=="Windows_NT" setlocal
10 |
11 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
12 | set DEFAULT_JVM_OPTS=
13 |
14 | set DIRNAME=%~dp0
15 | if "%DIRNAME%" == "" set DIRNAME=.
16 | set APP_BASE_NAME=%~n0
17 | set APP_HOME=%DIRNAME%
18 |
19 | @rem Find java.exe
20 | if defined JAVA_HOME goto findJavaFromJavaHome
21 |
22 | set JAVA_EXE=java.exe
23 | %JAVA_EXE% -version >NUL 2>&1
24 | if "%ERRORLEVEL%" == "0" goto init
25 |
26 | echo.
27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
28 | echo.
29 | echo Please set the JAVA_HOME variable in your environment to match the
30 | echo location of your Java installation.
31 |
32 | goto fail
33 |
34 | :findJavaFromJavaHome
35 | set JAVA_HOME=%JAVA_HOME:"=%
36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe
37 |
38 | if exist "%JAVA_EXE%" goto init
39 |
40 | echo.
41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
42 | echo.
43 | echo Please set the JAVA_HOME variable in your environment to match the
44 | echo location of your Java installation.
45 |
46 | goto fail
47 |
48 | :init
49 | @rem Get command-line arguments, handling Windowz variants
50 |
51 | if not "%OS%" == "Windows_NT" goto win9xME_args
52 | if "%@eval[2+2]" == "4" goto 4NT_args
53 |
54 | :win9xME_args
55 | @rem Slurp the command line arguments.
56 | set CMD_LINE_ARGS=
57 | set _SKIP=2
58 |
59 | :win9xME_args_slurp
60 | if "x%~1" == "x" goto execute
61 |
62 | set CMD_LINE_ARGS=%*
63 | goto execute
64 |
65 | :4NT_args
66 | @rem Get arguments from the 4NT Shell from JP Software
67 | set CMD_LINE_ARGS=%$
68 |
69 | :execute
70 | @rem Setup the command line
71 |
72 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
73 |
74 | @rem Execute Gradle
75 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
76 |
77 | :end
78 | @rem End local scope for the variables with windows NT shell
79 | if "%ERRORLEVEL%"=="0" goto mainEnd
80 |
81 | :fail
82 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
83 | rem the _cmd.exe /c_ return code!
84 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
85 | exit /b 1
86 |
87 | :mainEnd
88 | if "%OS%"=="Windows_NT" endlocal
89 |
90 | :omega
91 |
--------------------------------------------------------------------------------
/android/key.properties:
--------------------------------------------------------------------------------
1 | storePassword=123456
2 | keyPassword=123456
3 | keyAlias=li
4 | storeFile=E:/Android/key.jks
5 |
6 |
--------------------------------------------------------------------------------
/android/settings.gradle:
--------------------------------------------------------------------------------
1 | include ':app'
2 |
3 | def flutterProjectRoot = rootProject.projectDir.parentFile.toPath()
4 |
5 | def plugins = new Properties()
6 | def pluginsFile = new File(flutterProjectRoot.toFile(), '.flutter-plugins')
7 | if (pluginsFile.exists()) {
8 | pluginsFile.withReader('UTF-8') { reader -> plugins.load(reader) }
9 | }
10 |
11 | plugins.each { name, path ->
12 | def pluginDirectory = flutterProjectRoot.resolve(path).resolve('android').toFile()
13 | include ":$name"
14 | project(":$name").projectDir = pluginDirectory
15 | }
16 |
--------------------------------------------------------------------------------
/flutter_app.iml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
--------------------------------------------------------------------------------
/flutter_app_android.iml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
--------------------------------------------------------------------------------
/ios/.gitignore:
--------------------------------------------------------------------------------
1 | .idea/
2 | .vagrant/
3 | .sconsign.dblite
4 | .svn/
5 |
6 | .DS_Store
7 | *.swp
8 | profile
9 |
10 | DerivedData/
11 | build/
12 | GeneratedPluginRegistrant.h
13 | GeneratedPluginRegistrant.m
14 |
15 | .generated/
16 |
17 | *.pbxuser
18 | *.mode1v3
19 | *.mode2v3
20 | *.perspectivev3
21 |
22 | !default.pbxuser
23 | !default.mode1v3
24 | !default.mode2v3
25 | !default.perspectivev3
26 |
27 | xcuserdata
28 |
29 | *.moved-aside
30 |
31 | *.pyc
32 | *sync/
33 | Icon?
34 | .tags*
35 |
36 | /Flutter/app.flx
37 | /Flutter/app.zip
38 | /Flutter/flutter_assets/
39 | /Flutter/App.framework
40 | /Flutter/Flutter.framework
41 | /Flutter/Generated.xcconfig
42 | /ServiceDefinitions.json
43 |
44 | Pods/
45 |
--------------------------------------------------------------------------------
/ios/Flutter/AppFrameworkInfo.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | en
7 | CFBundleExecutable
8 | App
9 | CFBundleIdentifier
10 | io.flutter.flutter.app
11 | CFBundleInfoDictionaryVersion
12 | 6.0
13 | CFBundleName
14 | App
15 | CFBundlePackageType
16 | FMWK
17 | CFBundleShortVersionString
18 | 1.0
19 | CFBundleSignature
20 | ????
21 | CFBundleVersion
22 | 1.0
23 | UIRequiredDeviceCapabilities
24 |
25 | arm64
26 |
27 | MinimumOSVersion
28 | 8.0
29 |
30 |
31 |
--------------------------------------------------------------------------------
/ios/Flutter/Debug.xcconfig:
--------------------------------------------------------------------------------
1 | #include "Generated.xcconfig"
2 |
--------------------------------------------------------------------------------
/ios/Flutter/Release.xcconfig:
--------------------------------------------------------------------------------
1 | #include "Generated.xcconfig"
2 |
--------------------------------------------------------------------------------
/ios/Runner.xcodeproj/project.pbxproj:
--------------------------------------------------------------------------------
1 | // !$*UTF8*$!
2 | {
3 | archiveVersion = 1;
4 | classes = {
5 | };
6 | objectVersion = 46;
7 | objects = {
8 |
9 | /* Begin PBXBuildFile section */
10 | 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */ = {isa = PBXBuildFile; fileRef = 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */; };
11 | 2D5378261FAA1A9400D5DBA9 /* flutter_assets in Resources */ = {isa = PBXBuildFile; fileRef = 2D5378251FAA1A9400D5DBA9 /* flutter_assets */; };
12 | 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */ = {isa = PBXBuildFile; fileRef = 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */; };
13 | 3B80C3941E831B6300D905FE /* App.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3B80C3931E831B6300D905FE /* App.framework */; };
14 | 3B80C3951E831B6300D905FE /* App.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 3B80C3931E831B6300D905FE /* App.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
15 | 9705A1C61CF904A100538489 /* Flutter.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9740EEBA1CF902C7004384FC /* Flutter.framework */; };
16 | 9705A1C71CF904A300538489 /* Flutter.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 9740EEBA1CF902C7004384FC /* Flutter.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
17 | 9740EEB41CF90195004384FC /* Debug.xcconfig in Resources */ = {isa = PBXBuildFile; fileRef = 9740EEB21CF90195004384FC /* Debug.xcconfig */; };
18 | 9740EEB51CF90195004384FC /* Generated.xcconfig in Resources */ = {isa = PBXBuildFile; fileRef = 9740EEB31CF90195004384FC /* Generated.xcconfig */; };
19 | 978B8F6F1D3862AE00F588F7 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 7AFFD8EE1D35381100E5BB4D /* AppDelegate.m */; };
20 | 97C146F31CF9000F007C117D /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 97C146F21CF9000F007C117D /* main.m */; };
21 | 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FA1CF9000F007C117D /* Main.storyboard */; };
22 | 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FD1CF9000F007C117D /* Assets.xcassets */; };
23 | 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */; };
24 | /* End PBXBuildFile section */
25 |
26 | /* Begin PBXCopyFilesBuildPhase section */
27 | 9705A1C41CF9048500538489 /* Embed Frameworks */ = {
28 | isa = PBXCopyFilesBuildPhase;
29 | buildActionMask = 2147483647;
30 | dstPath = "";
31 | dstSubfolderSpec = 10;
32 | files = (
33 | 3B80C3951E831B6300D905FE /* App.framework in Embed Frameworks */,
34 | 9705A1C71CF904A300538489 /* Flutter.framework in Embed Frameworks */,
35 | );
36 | name = "Embed Frameworks";
37 | runOnlyForDeploymentPostprocessing = 0;
38 | };
39 | /* End PBXCopyFilesBuildPhase section */
40 |
41 | /* Begin PBXFileReference section */
42 | 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GeneratedPluginRegistrant.h; sourceTree = ""; };
43 | 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GeneratedPluginRegistrant.m; sourceTree = ""; };
44 | 2D5378251FAA1A9400D5DBA9 /* flutter_assets */ = {isa = PBXFileReference; lastKnownFileType = folder; name = flutter_assets; path = Flutter/flutter_assets; sourceTree = SOURCE_ROOT; };
45 | 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = ""; };
46 | 3B80C3931E831B6300D905FE /* App.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = App.framework; path = Flutter/App.framework; sourceTree = ""; };
47 | 7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = Flutter/Release.xcconfig; sourceTree = ""; };
48 | 7AFFD8ED1D35381100E5BB4D /* AppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; };
49 | 7AFFD8EE1D35381100E5BB4D /* AppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; };
50 | 9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Debug.xcconfig; path = Flutter/Debug.xcconfig; sourceTree = ""; };
51 | 9740EEB31CF90195004384FC /* Generated.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Generated.xcconfig; path = Flutter/Generated.xcconfig; sourceTree = ""; };
52 | 9740EEBA1CF902C7004384FC /* Flutter.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Flutter.framework; path = Flutter/Flutter.framework; sourceTree = ""; };
53 | 97C146EE1CF9000F007C117D /* Runner.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Runner.app; sourceTree = BUILT_PRODUCTS_DIR; };
54 | 97C146F21CF9000F007C117D /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; };
55 | 97C146FB1CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; };
56 | 97C146FD1CF9000F007C117D /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; };
57 | 97C147001CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; };
58 | 97C147021CF9000F007C117D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; };
59 | /* End PBXFileReference section */
60 |
61 | /* Begin PBXFrameworksBuildPhase section */
62 | 97C146EB1CF9000F007C117D /* Frameworks */ = {
63 | isa = PBXFrameworksBuildPhase;
64 | buildActionMask = 2147483647;
65 | files = (
66 | 9705A1C61CF904A100538489 /* Flutter.framework in Frameworks */,
67 | 3B80C3941E831B6300D905FE /* App.framework in Frameworks */,
68 | );
69 | runOnlyForDeploymentPostprocessing = 0;
70 | };
71 | /* End PBXFrameworksBuildPhase section */
72 |
73 | /* Begin PBXGroup section */
74 | 9740EEB11CF90186004384FC /* Flutter */ = {
75 | isa = PBXGroup;
76 | children = (
77 | 2D5378251FAA1A9400D5DBA9 /* flutter_assets */,
78 | 3B80C3931E831B6300D905FE /* App.framework */,
79 | 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */,
80 | 9740EEBA1CF902C7004384FC /* Flutter.framework */,
81 | 9740EEB21CF90195004384FC /* Debug.xcconfig */,
82 | 7AFA3C8E1D35360C0083082E /* Release.xcconfig */,
83 | 9740EEB31CF90195004384FC /* Generated.xcconfig */,
84 | );
85 | name = Flutter;
86 | sourceTree = "";
87 | };
88 | 97C146E51CF9000F007C117D = {
89 | isa = PBXGroup;
90 | children = (
91 | 9740EEB11CF90186004384FC /* Flutter */,
92 | 97C146F01CF9000F007C117D /* Runner */,
93 | 97C146EF1CF9000F007C117D /* Products */,
94 | CF3B75C9A7D2FA2A4C99F110 /* Frameworks */,
95 | );
96 | sourceTree = "";
97 | };
98 | 97C146EF1CF9000F007C117D /* Products */ = {
99 | isa = PBXGroup;
100 | children = (
101 | 97C146EE1CF9000F007C117D /* Runner.app */,
102 | );
103 | name = Products;
104 | sourceTree = "";
105 | };
106 | 97C146F01CF9000F007C117D /* Runner */ = {
107 | isa = PBXGroup;
108 | children = (
109 | 7AFFD8ED1D35381100E5BB4D /* AppDelegate.h */,
110 | 7AFFD8EE1D35381100E5BB4D /* AppDelegate.m */,
111 | 97C146FA1CF9000F007C117D /* Main.storyboard */,
112 | 97C146FD1CF9000F007C117D /* Assets.xcassets */,
113 | 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */,
114 | 97C147021CF9000F007C117D /* Info.plist */,
115 | 97C146F11CF9000F007C117D /* Supporting Files */,
116 | 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */,
117 | 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */,
118 | );
119 | path = Runner;
120 | sourceTree = "";
121 | };
122 | 97C146F11CF9000F007C117D /* Supporting Files */ = {
123 | isa = PBXGroup;
124 | children = (
125 | 97C146F21CF9000F007C117D /* main.m */,
126 | );
127 | name = "Supporting Files";
128 | sourceTree = "";
129 | };
130 | /* End PBXGroup section */
131 |
132 | /* Begin PBXNativeTarget section */
133 | 97C146ED1CF9000F007C117D /* Runner */ = {
134 | isa = PBXNativeTarget;
135 | buildConfigurationList = 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */;
136 | buildPhases = (
137 | 9740EEB61CF901F6004384FC /* Run Script */,
138 | 97C146EA1CF9000F007C117D /* Sources */,
139 | 97C146EB1CF9000F007C117D /* Frameworks */,
140 | 97C146EC1CF9000F007C117D /* Resources */,
141 | 9705A1C41CF9048500538489 /* Embed Frameworks */,
142 | 3B06AD1E1E4923F5004D2608 /* Thin Binary */,
143 | );
144 | buildRules = (
145 | );
146 | dependencies = (
147 | );
148 | name = Runner;
149 | productName = Runner;
150 | productReference = 97C146EE1CF9000F007C117D /* Runner.app */;
151 | productType = "com.apple.product-type.application";
152 | };
153 | /* End PBXNativeTarget section */
154 |
155 | /* Begin PBXProject section */
156 | 97C146E61CF9000F007C117D /* Project object */ = {
157 | isa = PBXProject;
158 | attributes = {
159 | LastUpgradeCheck = 0910;
160 | ORGANIZATIONNAME = "The Chromium Authors";
161 | TargetAttributes = {
162 | 97C146ED1CF9000F007C117D = {
163 | CreatedOnToolsVersion = 7.3.1;
164 | };
165 | };
166 | };
167 | buildConfigurationList = 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */;
168 | compatibilityVersion = "Xcode 3.2";
169 | developmentRegion = English;
170 | hasScannedForEncodings = 0;
171 | knownRegions = (
172 | en,
173 | Base,
174 | );
175 | mainGroup = 97C146E51CF9000F007C117D;
176 | productRefGroup = 97C146EF1CF9000F007C117D /* Products */;
177 | projectDirPath = "";
178 | projectRoot = "";
179 | targets = (
180 | 97C146ED1CF9000F007C117D /* Runner */,
181 | );
182 | };
183 | /* End PBXProject section */
184 |
185 | /* Begin PBXResourcesBuildPhase section */
186 | 97C146EC1CF9000F007C117D /* Resources */ = {
187 | isa = PBXResourcesBuildPhase;
188 | buildActionMask = 2147483647;
189 | files = (
190 | 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */,
191 | 9740EEB51CF90195004384FC /* Generated.xcconfig in Resources */,
192 | 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */,
193 | 9740EEB41CF90195004384FC /* Debug.xcconfig in Resources */,
194 | 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */,
195 | 2D5378261FAA1A9400D5DBA9 /* flutter_assets in Resources */,
196 | 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */,
197 | );
198 | runOnlyForDeploymentPostprocessing = 0;
199 | };
200 | /* End PBXResourcesBuildPhase section */
201 |
202 | /* Begin PBXShellScriptBuildPhase section */
203 | 3B06AD1E1E4923F5004D2608 /* Thin Binary */ = {
204 | isa = PBXShellScriptBuildPhase;
205 | buildActionMask = 2147483647;
206 | files = (
207 | );
208 | inputPaths = (
209 | );
210 | name = "Thin Binary";
211 | outputPaths = (
212 | );
213 | runOnlyForDeploymentPostprocessing = 0;
214 | shellPath = /bin/sh;
215 | shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" thin";
216 | };
217 | 9740EEB61CF901F6004384FC /* Run Script */ = {
218 | isa = PBXShellScriptBuildPhase;
219 | buildActionMask = 2147483647;
220 | files = (
221 | );
222 | inputPaths = (
223 | );
224 | name = "Run Script";
225 | outputPaths = (
226 | );
227 | runOnlyForDeploymentPostprocessing = 0;
228 | shellPath = /bin/sh;
229 | shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" build";
230 | };
231 | /* End PBXShellScriptBuildPhase section */
232 |
233 | /* Begin PBXSourcesBuildPhase section */
234 | 97C146EA1CF9000F007C117D /* Sources */ = {
235 | isa = PBXSourcesBuildPhase;
236 | buildActionMask = 2147483647;
237 | files = (
238 | 978B8F6F1D3862AE00F588F7 /* AppDelegate.m in Sources */,
239 | 97C146F31CF9000F007C117D /* main.m in Sources */,
240 | 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */,
241 | );
242 | runOnlyForDeploymentPostprocessing = 0;
243 | };
244 | /* End PBXSourcesBuildPhase section */
245 |
246 | /* Begin PBXVariantGroup section */
247 | 97C146FA1CF9000F007C117D /* Main.storyboard */ = {
248 | isa = PBXVariantGroup;
249 | children = (
250 | 97C146FB1CF9000F007C117D /* Base */,
251 | );
252 | name = Main.storyboard;
253 | sourceTree = "";
254 | };
255 | 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */ = {
256 | isa = PBXVariantGroup;
257 | children = (
258 | 97C147001CF9000F007C117D /* Base */,
259 | );
260 | name = LaunchScreen.storyboard;
261 | sourceTree = "";
262 | };
263 | /* End PBXVariantGroup section */
264 |
265 | /* Begin XCBuildConfiguration section */
266 | 97C147031CF9000F007C117D /* Debug */ = {
267 | isa = XCBuildConfiguration;
268 | baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */;
269 | buildSettings = {
270 | ALWAYS_SEARCH_USER_PATHS = NO;
271 | CLANG_ANALYZER_NONNULL = YES;
272 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
273 | CLANG_CXX_LIBRARY = "libc++";
274 | CLANG_ENABLE_MODULES = YES;
275 | CLANG_ENABLE_OBJC_ARC = YES;
276 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
277 | CLANG_WARN_BOOL_CONVERSION = YES;
278 | CLANG_WARN_COMMA = YES;
279 | CLANG_WARN_CONSTANT_CONVERSION = YES;
280 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
281 | CLANG_WARN_EMPTY_BODY = YES;
282 | CLANG_WARN_ENUM_CONVERSION = YES;
283 | CLANG_WARN_INFINITE_RECURSION = YES;
284 | CLANG_WARN_INT_CONVERSION = YES;
285 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
286 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
287 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
288 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
289 | CLANG_WARN_STRICT_PROTOTYPES = YES;
290 | CLANG_WARN_SUSPICIOUS_MOVE = YES;
291 | CLANG_WARN_UNREACHABLE_CODE = YES;
292 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
293 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
294 | COPY_PHASE_STRIP = NO;
295 | DEBUG_INFORMATION_FORMAT = dwarf;
296 | ENABLE_STRICT_OBJC_MSGSEND = YES;
297 | ENABLE_TESTABILITY = YES;
298 | GCC_C_LANGUAGE_STANDARD = gnu99;
299 | GCC_DYNAMIC_NO_PIC = NO;
300 | GCC_NO_COMMON_BLOCKS = YES;
301 | GCC_OPTIMIZATION_LEVEL = 0;
302 | GCC_PREPROCESSOR_DEFINITIONS = (
303 | "DEBUG=1",
304 | "$(inherited)",
305 | );
306 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
307 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
308 | GCC_WARN_UNDECLARED_SELECTOR = YES;
309 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
310 | GCC_WARN_UNUSED_FUNCTION = YES;
311 | GCC_WARN_UNUSED_VARIABLE = YES;
312 | IPHONEOS_DEPLOYMENT_TARGET = 8.0;
313 | MTL_ENABLE_DEBUG_INFO = YES;
314 | ONLY_ACTIVE_ARCH = YES;
315 | SDKROOT = iphoneos;
316 | TARGETED_DEVICE_FAMILY = "1,2";
317 | };
318 | name = Debug;
319 | };
320 | 97C147041CF9000F007C117D /* Release */ = {
321 | isa = XCBuildConfiguration;
322 | baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */;
323 | buildSettings = {
324 | ALWAYS_SEARCH_USER_PATHS = NO;
325 | CLANG_ANALYZER_NONNULL = YES;
326 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
327 | CLANG_CXX_LIBRARY = "libc++";
328 | CLANG_ENABLE_MODULES = YES;
329 | CLANG_ENABLE_OBJC_ARC = YES;
330 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
331 | CLANG_WARN_BOOL_CONVERSION = YES;
332 | CLANG_WARN_COMMA = YES;
333 | CLANG_WARN_CONSTANT_CONVERSION = YES;
334 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
335 | CLANG_WARN_EMPTY_BODY = YES;
336 | CLANG_WARN_ENUM_CONVERSION = YES;
337 | CLANG_WARN_INFINITE_RECURSION = YES;
338 | CLANG_WARN_INT_CONVERSION = YES;
339 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
340 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
341 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
342 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
343 | CLANG_WARN_STRICT_PROTOTYPES = YES;
344 | CLANG_WARN_SUSPICIOUS_MOVE = YES;
345 | CLANG_WARN_UNREACHABLE_CODE = YES;
346 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
347 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
348 | COPY_PHASE_STRIP = NO;
349 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
350 | ENABLE_NS_ASSERTIONS = NO;
351 | ENABLE_STRICT_OBJC_MSGSEND = YES;
352 | GCC_C_LANGUAGE_STANDARD = gnu99;
353 | GCC_NO_COMMON_BLOCKS = YES;
354 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
355 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
356 | GCC_WARN_UNDECLARED_SELECTOR = YES;
357 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
358 | GCC_WARN_UNUSED_FUNCTION = YES;
359 | GCC_WARN_UNUSED_VARIABLE = YES;
360 | IPHONEOS_DEPLOYMENT_TARGET = 8.0;
361 | MTL_ENABLE_DEBUG_INFO = NO;
362 | SDKROOT = iphoneos;
363 | TARGETED_DEVICE_FAMILY = "1,2";
364 | VALIDATE_PRODUCT = YES;
365 | };
366 | name = Release;
367 | };
368 | 97C147061CF9000F007C117D /* Debug */ = {
369 | isa = XCBuildConfiguration;
370 | baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */;
371 | buildSettings = {
372 | ARCHS = arm64;
373 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
374 | CURRENT_PROJECT_VERSION = 1;
375 | ENABLE_BITCODE = NO;
376 | FRAMEWORK_SEARCH_PATHS = (
377 | "$(inherited)",
378 | "$(PROJECT_DIR)/Flutter",
379 | );
380 | INFOPLIST_FILE = Runner/Info.plist;
381 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
382 | LIBRARY_SEARCH_PATHS = (
383 | "$(inherited)",
384 | "$(PROJECT_DIR)/Flutter",
385 | );
386 | PRODUCT_BUNDLE_IDENTIFIER = com.yourcompany.flutterApp;
387 | PRODUCT_NAME = "$(TARGET_NAME)";
388 | VERSIONING_SYSTEM = "apple-generic";
389 | };
390 | name = Debug;
391 | };
392 | 97C147071CF9000F007C117D /* Release */ = {
393 | isa = XCBuildConfiguration;
394 | baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */;
395 | buildSettings = {
396 | ARCHS = arm64;
397 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
398 | CURRENT_PROJECT_VERSION = 1;
399 | ENABLE_BITCODE = NO;
400 | FRAMEWORK_SEARCH_PATHS = (
401 | "$(inherited)",
402 | "$(PROJECT_DIR)/Flutter",
403 | );
404 | INFOPLIST_FILE = Runner/Info.plist;
405 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
406 | LIBRARY_SEARCH_PATHS = (
407 | "$(inherited)",
408 | "$(PROJECT_DIR)/Flutter",
409 | );
410 | PRODUCT_BUNDLE_IDENTIFIER = com.yourcompany.flutterApp;
411 | PRODUCT_NAME = "$(TARGET_NAME)";
412 | VERSIONING_SYSTEM = "apple-generic";
413 | };
414 | name = Release;
415 | };
416 | /* End XCBuildConfiguration section */
417 |
418 | /* Begin XCConfigurationList section */
419 | 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */ = {
420 | isa = XCConfigurationList;
421 | buildConfigurations = (
422 | 97C147031CF9000F007C117D /* Debug */,
423 | 97C147041CF9000F007C117D /* Release */,
424 | );
425 | defaultConfigurationIsVisible = 0;
426 | defaultConfigurationName = Release;
427 | };
428 | 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */ = {
429 | isa = XCConfigurationList;
430 | buildConfigurations = (
431 | 97C147061CF9000F007C117D /* Debug */,
432 | 97C147071CF9000F007C117D /* Release */,
433 | );
434 | defaultConfigurationIsVisible = 0;
435 | defaultConfigurationName = Release;
436 | };
437 | /* End XCConfigurationList section */
438 | };
439 | rootObject = 97C146E61CF9000F007C117D /* Project object */;
440 | }
441 |
--------------------------------------------------------------------------------
/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme:
--------------------------------------------------------------------------------
1 |
2 |
5 |
8 |
9 |
15 |
21 |
22 |
23 |
24 |
25 |
31 |
32 |
33 |
34 |
40 |
41 |
42 |
43 |
44 |
45 |
56 |
58 |
64 |
65 |
66 |
67 |
68 |
69 |
75 |
77 |
83 |
84 |
85 |
86 |
88 |
89 |
92 |
93 |
94 |
--------------------------------------------------------------------------------
/ios/Runner.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/ios/Runner/AppDelegate.h:
--------------------------------------------------------------------------------
1 | #import
2 | #import
3 |
4 | @interface AppDelegate : FlutterAppDelegate
5 |
6 | @end
7 |
--------------------------------------------------------------------------------
/ios/Runner/AppDelegate.m:
--------------------------------------------------------------------------------
1 | #include "AppDelegate.h"
2 | #include "GeneratedPluginRegistrant.h"
3 |
4 | @implementation AppDelegate
5 |
6 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
7 | [GeneratedPluginRegistrant registerWithRegistry:self];
8 | // Override point for customization after application launch.
9 | return [super application:application didFinishLaunchingWithOptions:launchOptions];
10 | }
11 |
12 | @end
13 |
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "size" : "20x20",
5 | "idiom" : "iphone",
6 | "filename" : "Icon-App-20x20@2x.png",
7 | "scale" : "2x"
8 | },
9 | {
10 | "size" : "20x20",
11 | "idiom" : "iphone",
12 | "filename" : "Icon-App-20x20@3x.png",
13 | "scale" : "3x"
14 | },
15 | {
16 | "size" : "29x29",
17 | "idiom" : "iphone",
18 | "filename" : "Icon-App-29x29@1x.png",
19 | "scale" : "1x"
20 | },
21 | {
22 | "size" : "29x29",
23 | "idiom" : "iphone",
24 | "filename" : "Icon-App-29x29@2x.png",
25 | "scale" : "2x"
26 | },
27 | {
28 | "size" : "29x29",
29 | "idiom" : "iphone",
30 | "filename" : "Icon-App-29x29@3x.png",
31 | "scale" : "3x"
32 | },
33 | {
34 | "size" : "40x40",
35 | "idiom" : "iphone",
36 | "filename" : "Icon-App-40x40@2x.png",
37 | "scale" : "2x"
38 | },
39 | {
40 | "size" : "40x40",
41 | "idiom" : "iphone",
42 | "filename" : "Icon-App-40x40@3x.png",
43 | "scale" : "3x"
44 | },
45 | {
46 | "size" : "60x60",
47 | "idiom" : "iphone",
48 | "filename" : "Icon-App-60x60@2x.png",
49 | "scale" : "2x"
50 | },
51 | {
52 | "size" : "60x60",
53 | "idiom" : "iphone",
54 | "filename" : "Icon-App-60x60@3x.png",
55 | "scale" : "3x"
56 | },
57 | {
58 | "size" : "20x20",
59 | "idiom" : "ipad",
60 | "filename" : "Icon-App-20x20@1x.png",
61 | "scale" : "1x"
62 | },
63 | {
64 | "size" : "20x20",
65 | "idiom" : "ipad",
66 | "filename" : "Icon-App-20x20@2x.png",
67 | "scale" : "2x"
68 | },
69 | {
70 | "size" : "29x29",
71 | "idiom" : "ipad",
72 | "filename" : "Icon-App-29x29@1x.png",
73 | "scale" : "1x"
74 | },
75 | {
76 | "size" : "29x29",
77 | "idiom" : "ipad",
78 | "filename" : "Icon-App-29x29@2x.png",
79 | "scale" : "2x"
80 | },
81 | {
82 | "size" : "40x40",
83 | "idiom" : "ipad",
84 | "filename" : "Icon-App-40x40@1x.png",
85 | "scale" : "1x"
86 | },
87 | {
88 | "size" : "40x40",
89 | "idiom" : "ipad",
90 | "filename" : "Icon-App-40x40@2x.png",
91 | "scale" : "2x"
92 | },
93 | {
94 | "size" : "76x76",
95 | "idiom" : "ipad",
96 | "filename" : "Icon-App-76x76@1x.png",
97 | "scale" : "1x"
98 | },
99 | {
100 | "size" : "76x76",
101 | "idiom" : "ipad",
102 | "filename" : "Icon-App-76x76@2x.png",
103 | "scale" : "2x"
104 | },
105 | {
106 | "size" : "83.5x83.5",
107 | "idiom" : "ipad",
108 | "filename" : "Icon-App-83.5x83.5@2x.png",
109 | "scale" : "2x"
110 | },
111 | {
112 | "size" : "1024x1024",
113 | "idiom" : "ios-marketing",
114 | "filename" : "Icon-App-1024x1024@1x.png",
115 | "scale" : "1x"
116 | }
117 | ],
118 | "info" : {
119 | "version" : 1,
120 | "author" : "xcode"
121 | }
122 | }
123 |
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Shimingli/FlutterApp/35095aa4a52277fd62dca273eb1f8b3f36ed5a01/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Shimingli/FlutterApp/35095aa4a52277fd62dca273eb1f8b3f36ed5a01/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Shimingli/FlutterApp/35095aa4a52277fd62dca273eb1f8b3f36ed5a01/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Shimingli/FlutterApp/35095aa4a52277fd62dca273eb1f8b3f36ed5a01/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Shimingli/FlutterApp/35095aa4a52277fd62dca273eb1f8b3f36ed5a01/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Shimingli/FlutterApp/35095aa4a52277fd62dca273eb1f8b3f36ed5a01/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Shimingli/FlutterApp/35095aa4a52277fd62dca273eb1f8b3f36ed5a01/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Shimingli/FlutterApp/35095aa4a52277fd62dca273eb1f8b3f36ed5a01/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Shimingli/FlutterApp/35095aa4a52277fd62dca273eb1f8b3f36ed5a01/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Shimingli/FlutterApp/35095aa4a52277fd62dca273eb1f8b3f36ed5a01/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Shimingli/FlutterApp/35095aa4a52277fd62dca273eb1f8b3f36ed5a01/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Shimingli/FlutterApp/35095aa4a52277fd62dca273eb1f8b3f36ed5a01/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Shimingli/FlutterApp/35095aa4a52277fd62dca273eb1f8b3f36ed5a01/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Shimingli/FlutterApp/35095aa4a52277fd62dca273eb1f8b3f36ed5a01/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Shimingli/FlutterApp/35095aa4a52277fd62dca273eb1f8b3f36ed5a01/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "filename" : "LaunchImage.png",
6 | "scale" : "1x"
7 | },
8 | {
9 | "idiom" : "universal",
10 | "filename" : "LaunchImage@2x.png",
11 | "scale" : "2x"
12 | },
13 | {
14 | "idiom" : "universal",
15 | "filename" : "LaunchImage@3x.png",
16 | "scale" : "3x"
17 | }
18 | ],
19 | "info" : {
20 | "version" : 1,
21 | "author" : "xcode"
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Shimingli/FlutterApp/35095aa4a52277fd62dca273eb1f8b3f36ed5a01/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Shimingli/FlutterApp/35095aa4a52277fd62dca273eb1f8b3f36ed5a01/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Shimingli/FlutterApp/35095aa4a52277fd62dca273eb1f8b3f36ed5a01/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md:
--------------------------------------------------------------------------------
1 | # Launch Screen Assets
2 |
3 | You can customize the launch screen with your own desired assets by replacing the image files in this directory.
4 |
5 | You can also do it by opening your Flutter project's Xcode project with `open ios/Runner.xcworkspace`, selecting `Runner/Assets.xcassets` in the Project Navigator and dropping in the desired images.
--------------------------------------------------------------------------------
/ios/Runner/Base.lproj/LaunchScreen.storyboard:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
--------------------------------------------------------------------------------
/ios/Runner/Base.lproj/Main.storyboard:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
--------------------------------------------------------------------------------
/ios/Runner/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | en
7 | CFBundleExecutable
8 | $(EXECUTABLE_NAME)
9 | CFBundleIdentifier
10 | $(PRODUCT_BUNDLE_IDENTIFIER)
11 | CFBundleInfoDictionaryVersion
12 | 6.0
13 | CFBundleName
14 | flutter_app
15 | CFBundlePackageType
16 | APPL
17 | CFBundleShortVersionString
18 | 1.0
19 | CFBundleSignature
20 | ????
21 | CFBundleVersion
22 | 1
23 | LSRequiresIPhoneOS
24 |
25 | UILaunchStoryboardName
26 | LaunchScreen
27 | UIMainStoryboardFile
28 | Main
29 | UIRequiredDeviceCapabilities
30 |
31 | arm64
32 |
33 | UISupportedInterfaceOrientations
34 |
35 | UIInterfaceOrientationPortrait
36 | UIInterfaceOrientationLandscapeLeft
37 | UIInterfaceOrientationLandscapeRight
38 |
39 | UISupportedInterfaceOrientations~ipad
40 |
41 | UIInterfaceOrientationPortrait
42 | UIInterfaceOrientationPortraitUpsideDown
43 | UIInterfaceOrientationLandscapeLeft
44 | UIInterfaceOrientationLandscapeRight
45 |
46 | UIViewControllerBasedStatusBarAppearance
47 |
48 |
49 |
50 |
--------------------------------------------------------------------------------
/ios/Runner/main.m:
--------------------------------------------------------------------------------
1 | #import
2 | #import
3 | #import "AppDelegate.h"
4 |
5 | int main(int argc, char * argv[]) {
6 | @autoreleasepool {
7 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class]));
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/lib/MainPage.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 | import 'package:flutter_app/TabIconView.dart';
3 | import 'package:flutter_app/home/HomePage.dart';
4 | import 'package:flutter_app/my/MyPage.dart';
5 | import 'package:flutter_app/official/OfficialNetWorkPage.dart';
6 | import 'package:flutter_app/similarWords/SimilarWordsPage.dart';
7 |
8 | /*
9 | * 从字面理解,StatelessWidget 是没有内部状态的即不可变。而 StatefulWidget 具有状态,即是可刷新的。
10 | * 当你构建的 UI 元素中有些部分是不变的,那么使用 StatelessWidget 是一个不错的选择(App log)
11 | */
12 | class MainPage extends StatefulWidget {
13 | /*
14 | tatelessWidget 和 StatefulWidget 的核心内容是一致的,它们都会在每一帧中被重构,
15 | 不同之处在于 StatefulWidget 有一个 State 对象,它可以为 StatefulWidget 在不同帧之间存储数据。
16 | */
17 | // @override
18 | // State createState() {
19 | // return new MainPageState();
20 | // }
21 | @override
22 | State createState() => new MainPageState();
23 | }
24 |
25 | /**
26 | * HTTP 请求后获得的数据或用户交互来刷新 UI ,此时就需要使用
27 | * StatefulWidget 然后主动告诉 Flutter 底层 Widget 的状态发生了变化,只有如此 Flutter 才会刷新对应的 Widget
28 | */
29 | class MainPageState extends State with TickerProviderStateMixin {
30 | late List tabIconViewArray;
31 | late StatefulWidget currentPage;
32 | late List pageArray;
33 | int cuttentIndex = 0;
34 |
35 | //初始化State 有时候网络请求 也必须在这里面
36 | @override
37 | void initState() {
38 | super.initState();
39 | tabIconViewArray = [
40 | new TabIconView(
41 | icon: new Icon(Icons.assignment),
42 | title: new Text("首页"),
43 | // ignore: argument_type_not_assignable
44 | vsync: this,
45 | ),
46 | new TabIconView(
47 | icon: new Icon(Icons.all_inclusive),
48 | title: new Text("寻找近义词"),
49 | vsync: this, //一定必须的要传入,要不然直接报错 todo 2018.9.4
50 | ),
51 | new TabIconView(
52 | icon: new Icon(Icons.open_with),
53 | title: new Text("官方Demo"),
54 | vsync: this),
55 | new TabIconView(
56 | icon: new Icon(Icons.people),
57 | title: new Text("关于我"),
58 | // ignore: argument_type_not_assignable
59 | vsync: this,
60 | )
61 | ];
62 | // 相当于 fore 的循环
63 | for (TabIconView view in tabIconViewArray) {
64 | view.controller.addListener(rebuild);
65 | }
66 | // 两个页面
67 | pageArray = [
68 | new HomePage(),
69 | new SimilarWordsPage(),
70 | new OfficialNetWorkPage(),
71 | new MyPage()
72 | ];
73 | currentPage = pageArray[cuttentIndex];
74 | }
75 |
76 | void rebuild() {
77 | setState(() {});
78 | }
79 |
80 | //当该对象从树中永久移除时调用。
81 | @override
82 | void dispose() {
83 | super.dispose();
84 | // 相当于 垃圾的释放
85 | for (TabIconView view in tabIconViewArray) {
86 | view.controller.dispose();
87 | }
88 | }
89 |
90 | // Flutter 中 UI 的布局是通过在 dart 文件中构建 Widget 树来实现的。
91 | // widget 相当于 View,Widget的实例仅仅存在每一帧之间,并且每一帧之间 Flutter都会主动的创建一颗Widget树用于下一帧的渲染。
92 | //Android 中 View 是可变的,在 Flutter 中的 Widget 是不可变的。这种特性使得 Flutter 中的 Widget 变得十分轻量级
93 | @override
94 | Widget build(BuildContext context) {
95 | return new MaterialApp(
96 | home: new Scaffold(
97 | body: new Center(
98 | child: currentPage,
99 | ),
100 | bottomNavigationBar: buildBar(),
101 | ),
102 | theme: new ThemeData.light(),
103 | );
104 | }
105 |
106 | buildBar() {
107 | return new BottomNavigationBar(
108 | items: tabIconViewArray.map((TabIconView view) => view.item).toList(),
109 | currentIndex: cuttentIndex,
110 | fixedColor: Colors.pink,
111 | type: BottomNavigationBarType.fixed,
112 | onTap: (int index) {
113 | setState(() {
114 | tabIconViewArray[cuttentIndex].controller.reverse();
115 | cuttentIndex = index;
116 | tabIconViewArray[cuttentIndex].controller.forward();
117 | currentPage = pageArray[cuttentIndex];
118 | });
119 | },
120 | );
121 | }
122 | }
123 |
--------------------------------------------------------------------------------
/lib/TabIconView.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/cupertino.dart';
2 | import 'package:flutter/material.dart';
3 |
4 | class TabIconView {
5 | TabIconView({
6 | //在 Flutter 中对应 View 的是 Widget
7 | required Widget icon,
8 | required Widget title,
9 | //任何想要在帧触发时得到通知的对象都可以使用Ticker,但是最常用的是通过[AnimationController]间接使用的
10 | required TickerProvider vsync})
11 | :
12 | // 底部导航栏
13 | item = new BottomNavigationBarItem(
14 | icon: icon, label: title.toString()),
15 | //kThemeAnimationDuration 默认情况下主题改变动画的持续时间。
16 | //创建动画控制器。
17 | controller = new AnimationController(
18 | duration: kThemeAnimationDuration, vsync: vsync);
19 |
20 | final BottomNavigationBarItem item;
21 | final AnimationController controller;
22 | }
23 |
--------------------------------------------------------------------------------
/lib/bean/DataBean.dart:
--------------------------------------------------------------------------------
1 | import 'dart:convert';
2 |
3 | import 'package:flutter/material.dart';
4 | import 'package:fluttertoast/fluttertoast.dart';
5 |
6 | class DataBean {
7 | final String key;
8 | final String message;
9 |
10 | DataBean(this.message, this.key);
11 |
12 | static List datas = [];
13 |
14 | //转化data
15 | static List decodeData(String data) {
16 | datas.clear();
17 | var newData = json.decode(data);
18 | var results = newData['message'];
19 | if (results.length == 0) {
20 | Fluttertoast.showToast(
21 | msg: "没有查找到相似词,请重新输入",
22 | toastLength: Toast.LENGTH_SHORT,
23 | gravity: ToastGravity.CENTER,
24 | timeInSecForIosWeb: 1,
25 | backgroundColor: Colors.red,
26 | textColor: Colors.white,
27 | fontSize: 16.0
28 | );
29 | }
30 | for (int i = 0; i < results.length; i++) {
31 | datas.add(forMap(results[i]));
32 | }
33 | return datas;
34 | }
35 |
36 | //{key: smooth, value: 1131, means: [{part: adj., means: [光滑的, 流畅的, 柔软的, 温和的,安详的]}, {part: vt., means: [使平滑, 排除,消除, 安抚,平息, 使优雅]}, {part: vi., means: [变平和,变缓和]}, {part: n., means: [平地,平面]}]}
37 | static DataBean forMap(result) {
38 | //print(result);
39 | //这是Json的数据
40 | var key = result["key"];
41 | var value = result["value"];
42 | var c = "";
43 | List means = result["means"];
44 | if (means.length == 0) {
45 | // Fluttertoast.showToast(
46 | // msg: "没有查找到相似词,请重新输入",
47 | // timeInSecForIos: 1,
48 | // bgcolor: "#e74c3c",
49 | // textcolor: '#ffffff'
50 | // );
51 | }
52 | for (int i = 0; i < means.length; i++) {
53 | var mean = means[i];
54 | // print("-------");
55 | // print(mean);
56 | //{part: vi., means: [被弄脏,变脏]}
57 | List meanO = mean['means'];
58 | // if(meanO.isEmpty){
59 | // Fluttertoast.showToast(
60 | // msg: "没有查找到相似词,请重新输入",
61 | // timeInSecForIos: 1,
62 | // bgcolor: "#e74c3c",
63 | // textcolor: '#ffffff'
64 | // );
65 | // }
66 | // print(meanO);
67 | for (int i = 0; i < meanO.length; i++) {
68 | c = c + meanO[i] + " ";
69 | }
70 | }
71 | //var mean = means["means"];
72 | return new DataBean(c, key);
73 | }
74 | }
75 |
--------------------------------------------------------------------------------
/lib/bean/MovieBean.dart:
--------------------------------------------------------------------------------
1 | import 'dart:convert';
2 |
3 | /**
4 | * 这个类改动的太多了 啊啊
5 | */
6 | class MovieBean {
7 | final String title; //查询的title
8 | final String total; //服务器回来的数据
9 | final String movieImages;
10 | final String movieName;
11 | final String castsAcatars; //所有主演的头像的集合
12 | final String castsName; //所有主演的姓名
13 | final String ratingAverage; //电影的评分
14 | final String collect_count; //多少人看过
15 |
16 | MovieBean(
17 | this.title,
18 | this.total,
19 | this.movieImages,
20 | this.movieName,
21 | this.castsAcatars,
22 | this.castsName,
23 | this.ratingAverage,
24 | this.collect_count);
25 |
26 | static List datas = [];
27 |
28 | static List decodeData(String data) {
29 | datas.clear();
30 | var newData = json.decode(data);
31 | var title = newData['title'];
32 | var total = newData['total'];
33 | var d = newData["subjects"];
34 | //肯定首先是知道他是一个数组,或者是集合
35 | for (int i = 0; i < d.length; i++) {
36 | datas.add(map(d[i], title, total));
37 | }
38 | return datas;
39 | }
40 |
41 | static MovieBean map(subject, title, total) {
42 | title = title;
43 | total = "查询到的数据共有:" + total.toString() + "条";
44 | var castsAcatars = "";
45 | var castsName = "";
46 | for (int i = 0; i < subject["casts"].length; i++) {
47 | if (subject["casts"][i]["avatars"] != null) {
48 | castsName = castsName + " " + subject["casts"][i]["name"];
49 | var c = subject["casts"][i]["avatars"]["medium"];
50 | if (i != subject["casts"].length - 1) {
51 | if (c == null) {
52 | print("shiming1=" + c);
53 | } else {
54 | castsAcatars = castsAcatars + c.toString() + "****";
55 | }
56 | } else {
57 | if (c == null) {
58 | print("shiming2=" + c);
59 | } else {
60 | castsAcatars = castsAcatars + c.toString();
61 | }
62 | }
63 | } else {
64 | print("为空了哦");
65 | }
66 | }
67 | var ratingAverage = "评分:" + subject['rating']['average'].toString();
68 | //一路改过来
69 | var collect_count = "一共有:" + subject['collect_count'].toString() + "人看过";
70 |
71 | return new MovieBean(
72 | title,
73 | total,
74 | subject["images"]["medium"],
75 | subject['title'],
76 | castsAcatars,
77 | castsName,
78 | ratingAverage,
79 | collect_count);
80 | }
81 | }
82 |
--------------------------------------------------------------------------------
/lib/home/GestureDetectorPage.dart:
--------------------------------------------------------------------------------
1 | //import 'package:flutter/material.dart';
2 | //
3 | //
4 | ///*
5 | //使用 GestureDetector 我们可以监听广泛的手势,例如
6 | //
7 | //点击
8 | //
9 | //onTapDown 屏幕某一位置的手势按下事件。
10 | //onTapUp 屏幕某一位置的手势抬起事件。
11 | //onTap 屏幕某一位置的手势点击事件
12 | //onTapCancel 只产生 onTapDown 却没有产生 onTapUp 的事件。
13 | //双击
14 | //
15 | //onDoubleTap 用户在同一位置进行两次快速点击。
16 | //长按
17 | //
18 | //onLongPress 长时间点按屏幕某一点时产生的事件。
19 | //垂直拖动
20 | //
21 | //onVerticalDragStart 屏幕上某一点开始垂直移动的事件。
22 | //onVerticalDragUpdate 屏幕上某一点垂直移动过程中的更新事件。
23 | //onVerticalDragEnd 屏幕上某一点停止垂直移动后的事件。
24 | //水平拖动
25 | //
26 | //onHorizontalDragStart 屏幕上某一点开始水平移动的事件。
27 | //onHorizontalDragUpdate 屏幕上某一点水平移动过程中的更新事件。
28 | //onHorizontalDragEnd 屏幕上某一点停止水平移动后的事件。
29 | // */
30 | //AnimationController controller;
31 | //CurvedAnimation curve;
32 | //@override
33 | //void initState() {
34 | // // ignore: invalid_reference_to_this
35 | // controller = new AnimationController(duration: const Duration(milliseconds: 2000), vsync: this);
36 | // curve = new CurvedAnimation(parent: controller, curve: Curves.easeIn);
37 | //}
38 | //
39 | //class GestureDetectorPage extends StatelessWidget {
40 | // @override
41 | // Widget build(BuildContext context) {
42 | // return new Scaffold(
43 | // body: new Center(
44 | // child: new GestureDetector(
45 | // child: new RotationTransition(
46 | // turns: curve,
47 | // child: new FlutterLogo(
48 | // size: 200.0,
49 | // )),
50 | // onDoubleTap: () {
51 | // if (controller.isCompleted) {
52 | // controller.reverse();
53 | // } else {
54 | // controller.forward();
55 | // }
56 | // },
57 | // ),
58 | // ));
59 | // }
60 | //
61 | //}
62 |
--------------------------------------------------------------------------------
/lib/home/HomePage.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 | import 'package:flutter_app/home/GestureDetectorPage.dart';
3 | import 'package:flutter_app/home/OtherPage.dart';
4 | import 'package:flutter_app/home/TabFroth.dart';
5 | import 'package:flutter_app/home/TabOne.dart';
6 | import 'package:flutter_app/home/TabThree.dart';
7 | import 'package:flutter_app/home/TabTwo.dart';
8 | import 'package:flutter_app/utils/ToastUtil.dart';
9 |
10 | // 麻痹这一行代码 还是我主动添加的 真的日了狗了
11 | import 'package:fluttertoast/fluttertoast.dart';
12 | import 'dart:convert';
13 |
14 | import 'package:flutter/material.dart';
15 |
16 | /**
17 | * 主页
18 | */
19 | class HomePage extends StatefulWidget {
20 | @override
21 | State createState() {
22 | return HomePageState();
23 | }
24 | }
25 |
26 | class HomePageState extends State {
27 | @override
28 | Widget build(BuildContext context) {
29 | //为给定的[子]控件创建默认选项卡控制器。
30 | return new DefaultTabController(
31 | length: 5,
32 | child: new Scaffold(
33 | appBar: new AppBar(
34 | backgroundColor: Colors.black45,
35 | // title: titleWidget(),
36 | title: new Text(
37 | "首页",
38 | style: new TextStyle(color: Colors.white, fontSize: 22.00),
39 | ),
40 | actions: [
41 | new IconButton(
42 | icon: new Icon(Icons.add_a_photo),
43 | onPressed: () {
44 | Navigator.of(context)
45 | .push(new MaterialPageRoute(builder: (context) {
46 | return new OtherPage();
47 | }));
48 | })
49 | ],
50 | bottom: new TabBar(
51 | isScrollable: true,
52 | labelStyle: new TextStyle(fontSize: 22.00, color: Colors.red),
53 | indicatorPadding: EdgeInsets.zero,
54 | labelColor: Colors.white,
55 | indicatorWeight: 4.0,
56 | unselectedLabelColor: Colors.blueAccent,
57 | tabs: [
58 | new Tab(
59 | text: "豆瓣电影",
60 | ),
61 | new Tab(
62 | text: "控件摆放",
63 | ),
64 | new Tab(
65 | text: "列表展示",
66 | ),
67 | new Tab(
68 | text: "其他控件展示",
69 | ),
70 | ]),
71 | ),
72 | body: new TabBarView(children: [
73 | new TabOne(),
74 | new TabTwo(),
75 | new TabThree(),
76 | new TabFroth()
77 | ]),
78 | ));
79 | }
80 |
81 | Widget titleWidget() {
82 | return new Container(
83 | child: new Row(
84 | children: [
85 | new Text(
86 | "首页",
87 | style: new TextStyle(color: Colors.blueGrey, letterSpacing: 1.00),
88 | ),
89 | new Expanded(
90 | child: new FlatButton.icon(
91 | // 点击事件
92 | onPressed: () {
93 | print("发生了点击事件");
94 | Fluttertoast.showToast(
95 | msg: "你点我干什么?",
96 | // toastLength: Toast.LENGTH_SHORT,
97 | // gravity: ToastGravity.CENTER,
98 | timeInSecForIosWeb: 1,
99 | backgroundColor: Colors.red,
100 | textColor: Colors.white,
101 | fontSize: 16.0
102 | );
103 | Navigator.of(context)
104 | .push(new MaterialPageRoute(builder: (context) {
105 | return new OtherPage();
106 | }));
107 | },
108 | icon: new Icon(
109 | Icons.pets,
110 | //color: Colors.amber,
111 | size: 22.0,
112 | ),
113 | label: new Text(
114 | "点我",
115 | style: new TextStyle(color: Colors.red),
116 | ))),
117 | ],
118 | ),
119 | decoration: new BoxDecoration(
120 | borderRadius: const BorderRadius.all(const Radius.circular(4.0)),
121 | color: Colors.lightGreenAccent,
122 | ));
123 | }
124 | }
125 |
--------------------------------------------------------------------------------
/lib/home/OtherPage.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 | import 'package:fluttertoast/fluttertoast.dart';
3 |
4 | /*
5 | 一个小小的Demo
6 | */
7 | class OtherPage extends StatefulWidget {
8 | @override
9 | State createState() {
10 | return new OtherPageState();
11 | }
12 | }
13 |
14 | class OtherPageState extends State {
15 | @override
16 | Widget build(BuildContext context) {
17 | //要充分利用应用程序中的 Material 风格的组件的话,可以把顶级部件 MaterialApp 作为应用程序的入口。MaterialApp 作为一个比较方便的部件,包装了许多实现了 Material 风格所需要的部件(如 Scaffold )。MaterialApp 是在 WidgetsApp 的基础上进行实现的
18 | return new MaterialApp(
19 | theme: new ThemeData.light(),
20 | home: new Scaffold(
21 | appBar: findAppBar(),
22 | body: findBody(),
23 | ),
24 | );
25 | }
26 |
27 | findAppBar() {
28 | return new AppBar(
29 | title: new Container(
30 | child: new Row(
31 | children: [
32 | new Container(
33 | child: new FlatButton.icon(
34 | onPressed: () {
35 | Navigator.of(context).pop();
36 | },
37 | icon: new Icon(
38 | Icons.cancel,
39 | color: Colors.red,
40 | ),
41 | label: new Text("退出")),
42 | width: 120.0,
43 | ),
44 | new Expanded(
45 | child: new TextField(
46 | autofocus: true, //自动获取键盘,键盘弹起来
47 | decoration: new InputDecoration.collapsed(
48 | hintText: "我是edittext",
49 | hintStyle: new TextStyle(color: Colors.black)),
50 | ))
51 | ],
52 | ),
53 | decoration: new BoxDecoration(
54 | color: Colors.white10,
55 | borderRadius: const BorderRadius.all(const Radius.circular(3.0))),
56 | ),
57 | );
58 | }
59 |
60 | findBody() {
61 | return new SingleChildScrollView(
62 | child: new Column(
63 | children: [
64 | new Container(
65 | child: new Text("文本",
66 | style:
67 | new TextStyle(fontWeight: FontWeight.bold, fontSize: 16.0)),
68 | margin: const EdgeInsets.only(top: 16.0, left: 16.0, bottom: 16.0),
69 | alignment: Alignment.topLeft,
70 | ),
71 | new Row(
72 | children: [
73 | new Container(
74 | child: new Chip(
75 | label: new FlatButton(
76 | onPressed: () {},
77 | child: new Text(
78 | "你好Flutter",
79 | style: new TextStyle(color: Colors.red),
80 | )),
81 | backgroundColor: Colors.yellow,
82 | ),
83 | margin: const EdgeInsets.only(left: 16.0, bottom: 16.0),
84 | alignment: Alignment.topLeft,
85 | ),
86 | new Container(
87 | child: new Chip(
88 | label: new FlatButton(
89 | onPressed: () {},
90 | child: new Text("你好Flutter",
91 | style: new TextStyle(color: Colors.red))),
92 | backgroundColor: Colors.blue,
93 | ),
94 | margin: const EdgeInsets.only(left: 16.0, bottom: 16.0),
95 | alignment: Alignment.topLeft,
96 | ),
97 | ],
98 | ),
99 | new Row(
100 | children: [
101 | new Container(
102 | child: new Chip(
103 | label: new FlatButton(
104 | onPressed: () {},
105 | child: new Text("你好Flutter",
106 | style: new TextStyle(color: Colors.red))),
107 | backgroundColor: Colors.black,
108 | ),
109 | margin: const EdgeInsets.only(left: 16.0, bottom: 16.0),
110 | alignment: Alignment.topLeft,
111 | ),
112 | ],
113 | ),
114 | new Container(
115 | child: new Text("文本T",
116 | style:
117 | new TextStyle(fontWeight: FontWeight.bold, fontSize: 16.0)),
118 | margin: const EdgeInsets.only(left: 16.0, bottom: 16.0),
119 | alignment: Alignment.topLeft,
120 | ),
121 | new Container(
122 | child: new Row(
123 | children: [
124 | new Container(
125 | child: new Icon(Icons.accessibility,
126 | color: Colors.pink, size: 16.0),
127 | margin: const EdgeInsets.only(right: 12.0),
128 | ),
129 | new Expanded(
130 | child: new Container(
131 | child: new Text(
132 | "test",
133 | style:
134 | new TextStyle(color: Colors.purple, fontSize: 14.0),
135 | ),
136 | ),
137 | ),
138 | new Container(
139 | child: new GestureDetector(
140 | child: new Icon(Icons.clear, color: Colors.red, size: 32.0),
141 | onTap: () {
142 | Fluttertoast.showToast(
143 | msg: "删除不掉的,我是点击事件的第二种实现的方式",
144 | toastLength: Toast.LENGTH_SHORT,
145 | gravity: ToastGravity.CENTER,
146 | timeInSecForIosWeb: 1,
147 | backgroundColor: Colors.red,
148 | textColor: Colors.white,
149 | fontSize: 16.0);
150 | },
151 | ),
152 | )
153 | ],
154 | ),
155 | margin:
156 | const EdgeInsets.only(left: 16.0, right: 16.0, bottom: 10.0),
157 | padding: const EdgeInsets.only(bottom: 10.0),
158 | decoration: new BoxDecoration(
159 | border: new BorderDirectional(
160 | bottom: new BorderSide(color: Colors.black12))),
161 | ),
162 | new Container(
163 | child: new Column(
164 | children: [
165 | new Container(
166 | child: new TextField(
167 | decoration: new InputDecoration(
168 | hintText: "问题1",
169 | hintStyle: new TextStyle(color: Colors.black)),
170 | ),
171 | margin: const EdgeInsets.all(16.0),
172 | ),
173 | new Container(
174 | child: new TextField(
175 | decoration: new InputDecoration(
176 | hintText: "问题1",
177 | hintStyle: new TextStyle(color: Colors.black)),
178 | ),
179 | margin: const EdgeInsets.all(16.0),
180 | ),
181 | new Container(
182 | child: new TextField(
183 | decoration: new InputDecoration(
184 | hintText: "问题1",
185 | hintStyle: new TextStyle(color: Colors.black)),
186 | ),
187 | margin: const EdgeInsets.all(16.0),
188 | ),
189 | new Container(
190 | child: new TextField(
191 | decoration: new InputDecoration(
192 | hintText: "问题1",
193 | hintStyle: new TextStyle(color: Colors.black)),
194 | ),
195 | margin: const EdgeInsets.all(16.0),
196 | ),
197 | new Container(
198 | child: new TextField(
199 | decoration: new InputDecoration(
200 | hintText: "问题1",
201 | hintStyle: new TextStyle(color: Colors.black)),
202 | ),
203 | margin: const EdgeInsets.all(16.0),
204 | ),
205 | new Container(
206 | child: new TextField(
207 | decoration: new InputDecoration(
208 | hintText: "问题1",
209 | hintStyle: new TextStyle(color: Colors.black)),
210 | ),
211 | margin: const EdgeInsets.all(16.0),
212 | ),
213 | ],
214 | ),
215 | )
216 | ],
217 | ),
218 | );
219 | }
220 | }
221 |
--------------------------------------------------------------------------------
/lib/home/TabFroth.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 |
3 | class TabFroth extends StatefulWidget {
4 | @override
5 | State createState() {
6 | return new TabFrothState();
7 | }
8 | }
9 |
10 | class TabFrothState extends State {
11 | Widget myInfoCard() {
12 | return new Container(
13 | //color: GlobalConfig.cardBackgroundColor,
14 | margin: const EdgeInsets.only(top: 10.0, bottom: 6.0),
15 | padding: const EdgeInsets.only(top: 12.0, bottom: 8.0),
16 | child: new Column(
17 | children: [
18 | new Container(
19 | margin:
20 | const EdgeInsets.only(left: 16.0, right: 16.0, bottom: 16.0),
21 | decoration: new BoxDecoration(
22 | color: new Color(0xFFF5F5F5),
23 | borderRadius: new BorderRadius.all(new Radius.circular(6.0))),
24 | child: new FlatButton(
25 | onPressed: () {},
26 | child: new Container(
27 | child: new ListTile(
28 | leading: new Container(
29 | child: new CircleAvatar(
30 | backgroundImage: new NetworkImage(
31 | "https://avatars1.githubusercontent.com/u/20720544?s=400&u=c4a1232f66b78874f5f8d1d50479fecdf4458e2c&v=4"),
32 | radius: 20.0),
33 | ),
34 | title: new Container(
35 | margin: const EdgeInsets.only(bottom: 2.0),
36 | child: new Text("shiming"),
37 | ),
38 | subtitle: new Container(
39 | margin: const EdgeInsets.only(top: 2.0),
40 | child: new Text("一句话介绍自己"),
41 | ),
42 | ),
43 | )),
44 | ),
45 | new Container(
46 | child: new Row(
47 | mainAxisAlignment: MainAxisAlignment.center,
48 | children: [
49 | new Container(
50 | width: (MediaQuery.of(context).size.width - 6.0) / 4,
51 | child: new FlatButton(
52 | onPressed: () {},
53 | child: new Container(
54 | height: 50.0,
55 | child: new Column(
56 | children: [
57 | new Container(
58 | child: new Text(
59 | "43",
60 | style: new TextStyle(
61 | fontSize: 16.0, color: Colors.brown),
62 | ),
63 | ),
64 | new Container(
65 | child: new Text(
66 | "创作",
67 | style: new TextStyle(
68 | fontSize: 12.0, color: Colors.brown),
69 | ),
70 | ),
71 | ],
72 | ),
73 | )),
74 | ),
75 | new Container(
76 | height: 14.0,
77 | width: 1.0,
78 | decoration: new BoxDecoration(
79 | border: new BorderDirectional(
80 | start: new BorderSide(
81 | color: Colors.black12, width: 1.0))),
82 | ),
83 | new Container(
84 | width: (MediaQuery.of(context).size.width - 6.0) / 4,
85 | child: new FlatButton(
86 | onPressed: () {},
87 | child: new Container(
88 | height: 50.0,
89 | child: new Column(
90 | children: [
91 | new Container(
92 | child: new Text(
93 | "0",
94 | style: new TextStyle(
95 | fontSize: 16.0, color: Colors.brown),
96 | ),
97 | ),
98 | new Container(
99 | child: new Text(
100 | "关注",
101 | style: new TextStyle(
102 | fontSize: 12.0, color: Colors.brown),
103 | ),
104 | )
105 | ],
106 | ),
107 | )),
108 | ),
109 | new Container(
110 | height: 14.0,
111 | width: 1.0,
112 | decoration: new BoxDecoration(
113 | border: new BorderDirectional(
114 | start:
115 | new BorderSide(color: Colors.brown, width: 1.0))),
116 | ),
117 | new Container(
118 | width: (MediaQuery.of(context).size.width - 6.0) / 4,
119 | child: new FlatButton(
120 | onPressed: () {},
121 | child: new Container(
122 | height: 50.0,
123 | child: new Column(
124 | children: [
125 | new Container(
126 | child: new Text(
127 | "0",
128 | style: new TextStyle(
129 | fontSize: 16.0, color: Colors.brown),
130 | ),
131 | ),
132 | new Container(
133 | child: new Text(
134 | "收藏",
135 | style: new TextStyle(
136 | fontSize: 12.0, color: Colors.brown),
137 | ),
138 | )
139 | ],
140 | ),
141 | )),
142 | ),
143 | new Container(
144 | height: 14.0,
145 | width: 1.0,
146 | decoration: new BoxDecoration(
147 | border: new BorderDirectional(
148 | start:
149 | new BorderSide(color: Colors.brown, width: 1.0))),
150 | ),
151 | new Container(
152 | width: (MediaQuery.of(context).size.width - 6.0) / 4,
153 | child: new FlatButton(
154 | onPressed: () {},
155 | child: new Container(
156 | height: 50.0,
157 | child: new Column(
158 | children: [
159 | new Container(
160 | child: new Text(
161 | "3300",
162 | style: new TextStyle(
163 | fontSize: 16.0, color: Colors.brown),
164 | ),
165 | ),
166 | new Container(
167 | child: new Text(
168 | "浏览",
169 | style: new TextStyle(
170 | fontSize: 12.0, color: Colors.brown),
171 | ),
172 | )
173 | ],
174 | ),
175 | )))
176 | ],
177 | ),
178 | )
179 | ],
180 | ),
181 | );
182 | }
183 |
184 | Widget myServiceCard() {
185 | return new Container(
186 | color: Colors.grey,
187 | margin: const EdgeInsets.only(top: 6.0, bottom: 6.0),
188 | padding: const EdgeInsets.only(top: 12.0, bottom: 8.0),
189 | child: new Column(
190 | children: [
191 | new Container(
192 | child: new Row(
193 | mainAxisAlignment: MainAxisAlignment.center,
194 | children: [
195 | new Container(
196 | width: MediaQuery.of(context).size.width / 4,
197 | child: new FlatButton(
198 | onPressed: () {},
199 | child: new Container(
200 | child: new Column(
201 | children: [
202 | new Container(
203 | margin: const EdgeInsets.only(bottom: 6.0),
204 | child: new CircleAvatar(
205 | radius: 20.0,
206 | child:
207 | new Icon(Icons.book, color: Colors.white),
208 | backgroundColor: Colors.green,
209 | ),
210 | ),
211 | new Container(
212 | child: new Text(
213 | "书架",
214 | style: new TextStyle(
215 | color: Colors.orange, fontSize: 14.0),
216 | ),
217 | )
218 | ],
219 | ),
220 | )),
221 | ),
222 | new Container(
223 | width: MediaQuery.of(context).size.width / 4,
224 | child: new FlatButton(
225 | onPressed: () {},
226 | child: new Container(
227 | child: new Column(
228 | children: [
229 | new Container(
230 | margin: const EdgeInsets.only(bottom: 6.0),
231 | child: new CircleAvatar(
232 | radius: 20.0,
233 | child: new Icon(Icons.flash_on,
234 | color: Colors.white),
235 | backgroundColor: Colors.blue,
236 | ),
237 | ),
238 | new Container(
239 | child: new Text("Live",
240 | style: new TextStyle(
241 | color: Colors.orange, fontSize: 14.0)),
242 | )
243 | ],
244 | ),
245 | )),
246 | ),
247 | new Container(
248 | width: MediaQuery.of(context).size.width / 4,
249 | child: new FlatButton(
250 | onPressed: () {},
251 | child: new Container(
252 | child: new Column(
253 | children: [
254 | new Container(
255 | margin: const EdgeInsets.only(bottom: 6.0),
256 | child: new CircleAvatar(
257 | radius: 20.0,
258 | child: new Icon(Icons.wifi_tethering,
259 | color: Colors.white),
260 | backgroundColor: new Color(0xFF029A3F),
261 | ),
262 | ),
263 | new Container(
264 | child: new Text("服务",
265 | style: new TextStyle(
266 | color: Colors.orange, fontSize: 14.0)),
267 | )
268 | ],
269 | ),
270 | )),
271 | ),
272 | ],
273 | ),
274 | )
275 | ],
276 | ),
277 | );
278 | }
279 |
280 | Widget settingCard() {
281 | return new Container(
282 | // color: GlobalConfig.cardBackgroundColor,
283 | margin: const EdgeInsets.only(top: 6.0, bottom: 6.0),
284 | padding: const EdgeInsets.only(top: 12.0, bottom: 8.0),
285 | child: new Row(
286 | mainAxisAlignment: MainAxisAlignment.start,
287 | children: [
288 | new Container(
289 | width: MediaQuery.of(context).size.width / 4,
290 | child: new FlatButton(
291 | onPressed: () {},
292 | child: new Container(
293 | child: new Column(
294 | children: [
295 | new Container(
296 | margin: const EdgeInsets.only(bottom: 6.0),
297 | child: new CircleAvatar(
298 | radius: 20.0,
299 | child: new Icon(Icons.invert_colors,
300 | color: Colors.white),
301 | backgroundColor: new Color(0xFFB88800),
302 | ),
303 | ),
304 | new Container(
305 | child: new Text("社区建设",
306 | style: new TextStyle(
307 | color: Colors.orange, fontSize: 14.0)),
308 | )
309 | ],
310 | ),
311 | )),
312 | ),
313 | new Container(
314 | width: MediaQuery.of(context).size.width / 4,
315 | child: new FlatButton(
316 | onPressed: () {},
317 | child: new Container(
318 | child: new Column(
319 | children: [
320 | new Container(
321 | margin: const EdgeInsets.only(bottom: 6.0),
322 | child: new CircleAvatar(
323 | radius: 20.0,
324 | child:
325 | new Icon(Icons.golf_course, color: Colors.white),
326 | backgroundColor: new Color(0xFF63616D),
327 | ),
328 | ),
329 | new Container(
330 | child: new Text("反馈",
331 | style: new TextStyle(
332 | color: Colors.orange, fontSize: 14.0)),
333 | )
334 | ],
335 | ),
336 | )),
337 | ),
338 | new Container(
339 | width: MediaQuery.of(context).size.width / 4,
340 | child: new FlatButton(
341 | onPressed: () {
342 | // setState((){
343 | // });
344 | },
345 | child: new Container(
346 | child: new Column(
347 | children: [
348 | new Container(
349 | margin: const EdgeInsets.only(bottom: 6.0),
350 | child: new CircleAvatar(
351 | radius: 20.0,
352 | child: new Icon(Icons.wb_sunny, color: Colors.white),
353 | backgroundColor: new Color(0xFFB86A0D),
354 | ),
355 | ),
356 | new Container(
357 | child: new Text("日间模式",
358 | style: new TextStyle(
359 | color: Colors.purple, fontSize: 14.0)),
360 | )
361 | ],
362 | ),
363 | )),
364 | ),
365 | new Container(
366 | width: MediaQuery.of(context).size.width / 4,
367 | child: new FlatButton(
368 | onPressed: () {},
369 | child: new Container(
370 | child: new Column(
371 | children: [
372 | new Container(
373 | margin: const EdgeInsets.only(bottom: 6.0),
374 | child: new CircleAvatar(
375 | radius: 20.0,
376 | child: new Icon(Icons.perm_data_setting,
377 | color: Colors.white),
378 | backgroundColor: new Color(0xFF636269),
379 | ),
380 | ),
381 | new Container(
382 | child: new Text("设置",
383 | style: new TextStyle(
384 | color: Colors.orange, fontSize: 14.0)),
385 | )
386 | ],
387 | ),
388 | )),
389 | ),
390 | ],
391 | ),
392 | );
393 | }
394 |
395 | Widget videoCard() {
396 | return new Container(
397 | // color: GlobalConfig.cardBackgroundColor,
398 | margin: const EdgeInsets.only(top: 6.0, bottom: 6.0),
399 | padding: const EdgeInsets.only(top: 12.0, bottom: 8.0),
400 | child: new Column(
401 | children: [
402 | new Container(
403 | margin: const EdgeInsets.only(left: 16.0, bottom: 20.0),
404 | child: new Row(
405 | children: [
406 | new Container(
407 | child: new CircleAvatar(
408 | radius: 20.0,
409 | child: new Icon(Icons.videocam, color: Colors.white),
410 | backgroundColor: new Color(0xFFB36905),
411 | ),
412 | ),
413 | new Expanded(
414 | child: new Container(
415 | margin: const EdgeInsets.only(left: 8.0),
416 | child: new Text(
417 | "视频创作",
418 | style: new TextStyle(fontSize: 18.0),
419 | ),
420 | ),
421 | ),
422 | new Container(
423 | child: new FlatButton(
424 | onPressed: () {},
425 | child: new Text(
426 | "拍一个",
427 | style: new TextStyle(color: Colors.blue),
428 | )),
429 | )
430 | ],
431 | )),
432 | new Container(
433 | margin: const EdgeInsets.only(left: 16.0),
434 | child: new SingleChildScrollView(
435 | scrollDirection: Axis.horizontal,
436 | child: new Row(
437 | children: [
438 | new Container(
439 | width: MediaQuery.of(context).size.width / 2.5,
440 | margin: const EdgeInsets.only(right: 6.0),
441 | child: new AspectRatio(
442 | aspectRatio: 4.0 / 2.0,
443 | child: new Container(
444 | foregroundDecoration: new BoxDecoration(
445 | image: new DecorationImage(
446 | image: new NetworkImage(
447 | "https://pic2.zhimg.com/50/v2-5942a51e6b834f10074f8d50be5bbd4d_400x224.jpg"),
448 | centerSlice: new Rect.fromLTRB(
449 | 270.0, 180.0, 1360.0, 730.0),
450 | ),
451 | borderRadius: const BorderRadius.all(
452 | const Radius.circular(6.0))),
453 | ))),
454 | new Container(
455 | margin: const EdgeInsets.only(right: 6.0),
456 | width: MediaQuery.of(context).size.width / 2.5,
457 | child: new AspectRatio(
458 | aspectRatio: 4.0 / 2.0,
459 | child: new Container(
460 | foregroundDecoration: new BoxDecoration(
461 | image: new DecorationImage(
462 | image: new NetworkImage(
463 | "https://pic3.zhimg.com/50/v2-7fc9a1572c6fc72a3dea0b73a9be36e7_400x224.jpg"),
464 | centerSlice: new Rect.fromLTRB(
465 | 270.0, 180.0, 1360.0, 730.0),
466 | ),
467 | borderRadius: const BorderRadius.all(
468 | const Radius.circular(6.0))),
469 | ))),
470 | new Container(
471 | margin: const EdgeInsets.only(right: 6.0),
472 | width: MediaQuery.of(context).size.width / 2.5,
473 | child: new AspectRatio(
474 | aspectRatio: 4.0 / 2.0,
475 | child: new Container(
476 | foregroundDecoration: new BoxDecoration(
477 | image: new DecorationImage(
478 | image: new NetworkImage(
479 | "https://pic4.zhimg.com/50/v2-898f43a488b606061c877ac2a471e221_400x224.jpg"),
480 | centerSlice: new Rect.fromLTRB(
481 | 270.0, 180.0, 1360.0, 730.0),
482 | ),
483 | borderRadius: const BorderRadius.all(
484 | const Radius.circular(6.0))),
485 | ))),
486 | new Container(
487 | width: MediaQuery.of(context).size.width / 2.5,
488 | child: new AspectRatio(
489 | aspectRatio: 4.0 / 2.0,
490 | child: new Container(
491 | foregroundDecoration: new BoxDecoration(
492 | image: new DecorationImage(
493 | image: new NetworkImage(
494 | "https://pic1.zhimg.com/50/v2-0008057d1ad2bd813aea4fc247959e63_400x224.jpg"),
495 | centerSlice: new Rect.fromLTRB(
496 | 270.0, 180.0, 1360.0, 730.0),
497 | ),
498 | borderRadius: const BorderRadius.all(
499 | const Radius.circular(6.0))),
500 | )))
501 | ],
502 | ),
503 | ),
504 | )
505 | ],
506 | ));
507 | }
508 |
509 | Widget ideaCard() {
510 | return new Container(
511 | color: Colors.amber,
512 | margin: const EdgeInsets.only(top: 6.0, bottom: 6.0),
513 | padding: const EdgeInsets.only(top: 12.0, bottom: 8.0),
514 | child: new Column(
515 | children: [
516 | new Container(
517 | margin: const EdgeInsets.only(left: 16.0, bottom: 20.0),
518 | child: new Row(
519 | children: [
520 | new Container(
521 | child: new CircleAvatar(
522 | radius: 20.0,
523 | child:
524 | new Icon(Icons.all_inclusive, color: Colors.white),
525 | backgroundColor: Colors.blue,
526 | ),
527 | ),
528 | new Expanded(
529 | child: new Container(
530 | margin: const EdgeInsets.only(left: 8.0),
531 | child: new Text(
532 | "想法",
533 | style: new TextStyle(fontSize: 18.0),
534 | ),
535 | ),
536 | ),
537 | new Container(
538 | child: new FlatButton(
539 | onPressed: () {},
540 | child: new Text(
541 | "去往想法首页",
542 | style: new TextStyle(color: Colors.blue),
543 | )),
544 | )
545 | ],
546 | )),
547 | new Container(
548 | margin: const EdgeInsets.only(left: 16.0),
549 | child: new SingleChildScrollView(
550 | scrollDirection: Axis.horizontal,
551 | child: new Row(
552 | children: [
553 | new Container(
554 | margin: const EdgeInsets.only(right: 6.0),
555 | decoration: new BoxDecoration(
556 | //color: GlobalConfig.searchBackgroundColor,
557 | borderRadius:
558 | new BorderRadius.all(new Radius.circular(6.0))),
559 | child: new Row(
560 | children: [
561 | new Container(
562 | padding: const EdgeInsets.only(left: 10.0),
563 | child: new Column(
564 | children: [
565 | new Align(
566 | alignment: Alignment.centerLeft,
567 | child: new Container(
568 | child: new Text(
569 | "苹果 WWDC 2018 正在举行",
570 | style: new TextStyle(
571 | color: Colors.black,
572 | fontSize: 16.0),
573 | ),
574 | ),
575 | ),
576 | new Align(
577 | alignment: Alignment.centerLeft,
578 | child: new Container(
579 | margin: const EdgeInsets.only(top: 6.0),
580 | child: new Text(
581 | "软件更新意料之中,硬件之谜...",
582 | style: new TextStyle(
583 | color: Colors.purple),
584 | ),
585 | ))
586 | ],
587 | ),
588 | ),
589 | new Container(
590 | margin: const EdgeInsets.all(10.0),
591 | width: MediaQuery.of(context).size.width / 5,
592 | child: new AspectRatio(
593 | aspectRatio: 1.0 / 1.0,
594 | child: new Container(
595 | foregroundDecoration: new BoxDecoration(
596 | image: new DecorationImage(
597 | image: new NetworkImage(
598 | "https://pic2.zhimg.com/50/v2-55039fa535f3fe06365c0fcdaa9e3847_400x224.jpg"),
599 | centerSlice: new Rect.fromLTRB(
600 | 270.0, 180.0, 1360.0, 730.0),
601 | ),
602 | borderRadius: const BorderRadius.all(
603 | const Radius.circular(6.0))),
604 | )))
605 | ],
606 | )),
607 | new Container(
608 | margin: const EdgeInsets.only(right: 6.0),
609 | decoration: new BoxDecoration(
610 | // color: GlobalConfig.searchBackgroundColor,
611 | borderRadius:
612 | new BorderRadius.all(new Radius.circular(6.0))),
613 | child: new Row(
614 | children: [
615 | new Container(
616 | padding: const EdgeInsets.only(left: 10.0),
617 | child: new Column(
618 | children: [
619 | new Align(
620 | alignment: Alignment.centerLeft,
621 | child: new Container(
622 | child: new Text(
623 | "此刻你的桌子是什么样子?",
624 | style: new TextStyle(
625 | color: Colors.black,
626 | fontSize: 16.0),
627 | ),
628 | ),
629 | ),
630 | new Align(
631 | alignment: Alignment.centerLeft,
632 | child: new Container(
633 | margin: const EdgeInsets.only(top: 6.0),
634 | child: new Text(
635 | "晒一晒你的书桌/办公桌",
636 | style: new TextStyle(
637 | color: Colors.purple),
638 | ),
639 | ))
640 | ],
641 | ),
642 | ),
643 | new Container(
644 | margin: const EdgeInsets.all(10.0),
645 | width: MediaQuery.of(context).size.width / 5,
646 | child: new AspectRatio(
647 | aspectRatio: 1.0 / 1.0,
648 | child: new Container(
649 | foregroundDecoration: new BoxDecoration(
650 | image: new DecorationImage(
651 | image: new NetworkImage(
652 | "https://pic3.zhimg.com/v2-b4551f702970ff37709cdd7fd884de5e_294x245|adx4.png"),
653 | centerSlice: new Rect.fromLTRB(
654 | 270.0, 180.0, 1360.0, 730.0),
655 | ),
656 | borderRadius: const BorderRadius.all(
657 | const Radius.circular(6.0))),
658 | )))
659 | ],
660 | )),
661 | new Container(
662 | margin: const EdgeInsets.only(right: 6.0),
663 | decoration: new BoxDecoration(
664 | // color: GlobalConfig.searchBackgroundColor,
665 | borderRadius:
666 | new BorderRadius.all(new Radius.circular(6.0))),
667 | child: new Row(
668 | children: [
669 | new Container(
670 | padding: const EdgeInsets.only(left: 10.0),
671 | child: new Column(
672 | children: [
673 | new Align(
674 | alignment: Alignment.centerLeft,
675 | child: new Container(
676 | child: new Text(
677 | "关于高考你印象最深的是...",
678 | style: new TextStyle(
679 | color: Colors.black,
680 | fontSize: 16.0),
681 | ),
682 | ),
683 | ),
684 | new Align(
685 | alignment: Alignment.centerLeft,
686 | child: new Container(
687 | margin: const EdgeInsets.only(top: 6.0),
688 | child: new Text(
689 | "聊聊你的高三生活",
690 | style: new TextStyle(
691 | color: Colors.purple),
692 | ),
693 | ))
694 | ],
695 | ),
696 | ),
697 | new Container(
698 | margin: const EdgeInsets.all(10.0),
699 | width: MediaQuery.of(context).size.width / 5,
700 | child: new AspectRatio(
701 | aspectRatio: 1.0 / 1.0,
702 | child: new Container(
703 | foregroundDecoration: new BoxDecoration(
704 | image: new DecorationImage(
705 | image: new NetworkImage(
706 | "https://pic2.zhimg.com/50/v2-ce2e01a047e4aba9bfabf8469cfd3e75_400x224.jpg"),
707 | centerSlice: new Rect.fromLTRB(
708 | 270.0, 180.0, 1360.0, 730.0),
709 | ),
710 | borderRadius: const BorderRadius.all(
711 | const Radius.circular(6.0))),
712 | )))
713 | ],
714 | )),
715 | new Container(
716 | margin: const EdgeInsets.only(right: 6.0),
717 | decoration: new BoxDecoration(
718 | // color: GlobalConfig.searchBackgroundColor,
719 | borderRadius:
720 | new BorderRadius.all(new Radius.circular(6.0))),
721 | child: new Row(
722 | children: [
723 | new Container(
724 | padding: const EdgeInsets.only(left: 10.0),
725 | child: new Column(
726 | children: [
727 | new Align(
728 | alignment: Alignment.centerLeft,
729 | child: new Container(
730 | child: new Text(
731 | "夏天一定要吃的食物有哪些",
732 | style: new TextStyle(
733 | color: Colors.black,
734 | fontSize: 16.0),
735 | ),
736 | ),
737 | ),
738 | new Align(
739 | alignment: Alignment.centerLeft,
740 | child: new Container(
741 | margin: const EdgeInsets.only(top: 6.0),
742 | child: new Text(
743 | "最适合夏天吃的那种",
744 | style: new TextStyle(
745 | color: Colors.purple),
746 | ),
747 | ))
748 | ],
749 | ),
750 | ),
751 | new Container(
752 | margin: const EdgeInsets.all(10.0),
753 | width: MediaQuery.of(context).size.width / 5,
754 | child: new AspectRatio(
755 | aspectRatio: 1.0 / 1.0,
756 | child: new Container(
757 | foregroundDecoration: new BoxDecoration(
758 | image: new DecorationImage(
759 | image: new NetworkImage(
760 | "https://pic1.zhimg.com/50/v2-bb3806c2ced60e5b7f38a0aa06b89511_400x224.jpg"),
761 | centerSlice: new Rect.fromLTRB(
762 | 270.0, 180.0, 1360.0, 730.0),
763 | ),
764 | borderRadius: const BorderRadius.all(
765 | const Radius.circular(6.0))),
766 | )))
767 | ],
768 | )),
769 | ],
770 | ),
771 | ),
772 | )
773 | ],
774 | ));
775 | }
776 |
777 | @override
778 | Widget build(BuildContext context) {
779 | return new Container(
780 | child: new Scaffold(
781 | body: new SingleChildScrollView(
782 | child: new Container(
783 | child: new Column(
784 | children: [
785 | myInfoCard(),
786 | myServiceCard(),
787 | settingCard(),
788 | videoCard(),
789 | ideaCard()
790 | ],
791 | ),
792 | ),
793 | )),
794 | );
795 | }
796 | }
797 |
--------------------------------------------------------------------------------
/lib/home/TabOne.dart:
--------------------------------------------------------------------------------
1 | import 'dart:async';
2 | import 'dart:convert';
3 | import 'dart:io';
4 | import 'package:flutter/material.dart';
5 | import 'package:flutter_app/bean/DataBean.dart';
6 | import 'package:flutter_app/bean/MovieBean.dart';
7 |
8 | class TabOne extends StatefulWidget {
9 | @override
10 | State createState() {
11 | return new TabOneState();
12 | }
13 | }
14 |
15 | class TabOneState extends State {
16 | List datas = [];
17 |
18 | @override
19 | void initState() {
20 | super.initState();
21 | getApiData();
22 | }
23 |
24 | @override
25 | Widget build(BuildContext context) {
26 | var content;
27 | if (datas.isEmpty) {
28 | content = new Center(
29 | child: new CircularProgressIndicator(),
30 | );
31 | } else {
32 | content = new ListView(children: buildMovieItems());
33 | }
34 | return new Scaffold(
35 | body: content,
36 | );
37 | }
38 |
39 | Future getApiData() async {
40 | //豆瓣电影最近的正在播放的电影
41 | var url =
42 | "https://api.douban.com/v2/movie/in_theaters?apikey=0b2bdeda43b5688921839c8ecb20399b&city=%E6%B7%B1%E5%9C%B3&start=0&count=100&client=somemessage&udid=dddddddddddddddddddddd";
43 |
44 | // Dio dio = new Dio();
45 | // Response response=await dio.get(url);
46 | // print(response.data);
47 | //// setState(() {
48 | //// });
49 | var httpClient = new HttpClient();
50 | var request = await httpClient.getUrl(Uri.parse(url));
51 | var response = await request.close();
52 | if (response.statusCode == HttpStatus.OK) {
53 | var jsonData = await response.transform(utf8.decoder).join();
54 | setState(() {
55 | datas = MovieBean.decodeData(jsonData);
56 | });
57 | }
58 | var castsAcatars = datas[0].castsAcatars;
59 | print("castsAcatars");
60 | print("第一个条目的数据:" + castsAcatars);
61 | }
62 |
63 | // 每个条目的信息
64 | buildMovieItems() {
65 | List widgets = [];
66 | for (int i = 0; i < datas.length; i++) {
67 | MovieBean data = datas[i];
68 | var gd = new GestureDetector(
69 | onTap: () {
70 | // BindTab();
71 | },
72 | child: new Column(
73 | children: [
74 | //todo 在脑袋要构思出 这个布局的整体的结构
75 | new Row(
76 | children: [
77 | buildImage(data),
78 | new Expanded(child: buildMsg(data)),
79 | const Icon(Icons.arrow_forward)
80 | ],
81 | ),
82 | ],
83 | ),
84 | );
85 | widgets.add(gd);
86 | }
87 |
88 | return widgets;
89 | }
90 |
91 | buildImage(MovieBean data) {
92 | return new Padding(
93 | padding: const EdgeInsets.only(
94 | top: 10.0,
95 | left: 10.0,
96 | right: 10.0,
97 | bottom: 10.0,
98 | ),
99 | child: new Image.network(
100 | data.movieImages,
101 | width: 140.0,
102 | height: 160.0,
103 | ),
104 | );
105 | }
106 |
107 | buildMsg(MovieBean data) {
108 | return new Column(
109 | //每个孩子的边缘对其
110 | crossAxisAlignment: CrossAxisAlignment.start,
111 | //最大限度地减少自由空间沿主轴,受传入的布局限制。
112 | mainAxisSize: MainAxisSize.min,
113 | children: [
114 | new Text(
115 | data.movieName,
116 | textAlign: TextAlign.left,
117 | style: new TextStyle(fontWeight: FontWeight.bold, fontSize: 14.0),
118 | ),
119 | new Text("主演:" + data.castsName),
120 | new Text(data.title),
121 | new Text(data.total),
122 | new Text(data.ratingAverage),
123 | new Text(
124 | data.collect_count,
125 | style: new TextStyle(fontSize: 13.0, color: Colors.green),
126 | ),
127 | ],
128 | );
129 | }
130 | }
131 |
--------------------------------------------------------------------------------
/lib/home/TabThree.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 | import 'package:flutter_app/home/question.dart';
3 | import 'package:fluttertoast/fluttertoast.dart';
4 |
5 | class TabThree extends StatefulWidget {
6 | @override
7 | State createState() {
8 | return new TabThreeState();
9 | }
10 | }
11 |
12 | class TabThreeState extends State {
13 | Widget hotCard(Question question) {
14 | return new Container(
15 | //color: Colors.orange,
16 | decoration: new BoxDecoration(
17 | color: Colors.white12,
18 | border: new BorderDirectional(
19 | bottom: new BorderSide(color: Colors.white12, width: 1.0))),
20 | child: new FlatButton(
21 | onPressed: () {
22 | Fluttertoast.showToast(
23 | msg: "点不动我哈哈!",
24 | toastLength: Toast.LENGTH_SHORT,
25 | gravity: ToastGravity.CENTER,
26 | timeInSecForIosWeb: 1,
27 | backgroundColor: Colors.red,
28 | textColor: Colors.white,
29 | fontSize: 16.0);
30 | },
31 | child: new Container(
32 | padding: const EdgeInsets.only(top: 8.0, bottom: 8.0),
33 | child: new Row(
34 | children: [
35 | new Expanded(
36 | flex: 1,
37 | child: new Column(
38 | children: [
39 | new Container(
40 | child: new Text(question.order,
41 | style: new TextStyle(
42 | color: question.order.compareTo("03") <= 0
43 | ? Colors.red
44 | : Colors.yellow,
45 | fontSize: 18.0)),
46 | alignment: Alignment.topLeft,
47 | ),
48 | question.rise != null
49 | ? new Row(
50 | children: [
51 | new Icon(
52 | Icons.arrow_upward,
53 | color: Colors.red,
54 | size: 10.0,
55 | ),
56 | new Text(
57 | question.rise,
58 | style: new TextStyle(
59 | color: Colors.red, fontSize: 10.0),
60 | )
61 | ],
62 | )
63 | : new Container()
64 | ],
65 | )),
66 | new Expanded(
67 | flex: 6,
68 | child: new Column(
69 | children: [
70 | new Container(
71 | child: new Text(
72 | question.title,
73 | style: new TextStyle(
74 | fontWeight: FontWeight.bold,
75 | fontSize: 16.0,
76 | height: 1.1,
77 | color: Colors.brown),
78 | ),
79 | padding:
80 | const EdgeInsets.only(bottom: 10.0, right: 4.0),
81 | alignment: Alignment.topLeft,
82 | ),
83 | question.mark != null
84 | ? new Container(
85 | child: new Text(question.mark,
86 | style:
87 | new TextStyle(color: Colors.white12)),
88 | alignment: Alignment.topLeft,
89 | padding: const EdgeInsets.only(
90 | bottom: 8.0, right: 4.0))
91 | : new Container(),
92 | new Container(
93 | child: new Text(question.hotNum,
94 | style: new TextStyle(color: Colors.white12)),
95 | alignment: Alignment.topLeft,
96 | )
97 | ],
98 | )),
99 | new Expanded(
100 | flex: 3,
101 | child: new AspectRatio(
102 | aspectRatio: 3.0 / 2.0,
103 | child: new Container(
104 | foregroundDecoration: new BoxDecoration(
105 | image: new DecorationImage(
106 | //todo 我喜欢
107 | image: new NetworkImage(question.imgUrl),
108 | centerSlice: new Rect.fromLTRB(
109 | 270.0, 180.0, 1360.0, 730.0),
110 | ),
111 | borderRadius: const BorderRadius.all(
112 | const Radius.circular(6.0))),
113 | ))),
114 | ],
115 | ),
116 | )),
117 | );
118 | }
119 |
120 | @override
121 | Widget build(BuildContext context) {
122 | return new SingleChildScrollView(
123 | child: new Container(
124 | margin: const EdgeInsets.only(top: 5.0),
125 | child: new Column(
126 | children: [
127 | new Container(
128 | margin: const EdgeInsets.only(top: 5.0),
129 | ),
130 | hotCard(questionList[0]),
131 | hotCard(questionList[1]),
132 | hotCard(questionList[2]),
133 | hotCard(questionList[3]),
134 | hotCard(questionList[4]),
135 | ],
136 | ),
137 | ));
138 | }
139 | }
140 |
--------------------------------------------------------------------------------
/lib/home/TabTwo.dart:
--------------------------------------------------------------------------------
1 | import 'dart:async';
2 | import 'dart:convert';
3 | import 'dart:io';
4 |
5 | import 'package:flutter/material.dart';
6 | import 'package:flutter_app/bean/MovieBean.dart';
7 |
8 | class TabTwo extends StatefulWidget {
9 | @override
10 | State createState() {
11 | return new TabTwoState();
12 | }
13 | }
14 |
15 | class TabTwoState extends State {
16 | List datas = [];
17 |
18 | @override
19 | void initState() {
20 | super.initState();
21 | getApiData();
22 | }
23 |
24 | @override
25 | Widget build(BuildContext context) {
26 | var content;
27 | if (datas.isEmpty) {
28 | content = new Center(
29 | child: new CircularProgressIndicator(),
30 | );
31 | } else {
32 | content = new ListView(children: buildMovieItems());
33 | }
34 | return new Scaffold(
35 | body: content,
36 | );
37 | }
38 |
39 | Future getApiData() async {
40 | //豆瓣电影最近的正在播放的电影
41 | var url =
42 | "https://api.douban.com/v2/movie/in_theaters?apikey=0b2bdeda43b5688921839c8ecb20399b&city=%E6%B7%B1%E5%9C%B3&start=0&count=100&client=somemessage&udid=dddddddddddddddddddddd";
43 | var httpClient = new HttpClient();
44 | var request = await httpClient.getUrl(Uri.parse(url));
45 | var response = await request.close();
46 | if (response.statusCode == HttpStatus.OK) {
47 | var jsonData = await response.transform(utf8.decoder).join();
48 | setState(() {
49 | datas = MovieBean.decodeData(jsonData);
50 | });
51 | }
52 | // ignore: argument_type_not_assignable
53 | print("第二页:" + datas[0].castsAcatars);
54 | List split = datas[0].castsAcatars.split("****");
55 | for (int i = 0; i < split.length; i++) {
56 | print("第二页:" + split[i]);
57 | }
58 | }
59 |
60 | // 每个条目的信息
61 | buildMovieItems() {
62 | List widgets = [];
63 | for (int i = 0; i < datas.length; i++) {
64 | MovieBean data = datas[i];
65 | List split = data.castsAcatars.split("****");
66 | var gd = new GestureDetector(
67 | onTap: () {
68 | // BindTab();
69 | },
70 | child: new Column(
71 | children: [
72 | buildImage(split),
73 | // new
74 | ],
75 | ),
76 | );
77 | widgets.add(gd);
78 | }
79 | return widgets;
80 | }
81 |
82 | buildImage(List data) {
83 | return new Padding(
84 | padding: const EdgeInsets.only(
85 | top: 10.0,
86 | left: 5.0,
87 | right: 5.0,
88 | bottom: 10.0,
89 | ),
90 | child: new Row(
91 | mainAxisAlignment: MainAxisAlignment.center,
92 | children: [
93 | new Image.network(
94 | data[0],
95 | width: MediaQuery.of(context).size.width / 3,
96 | height: 120.0,
97 | ),
98 | new Image.network(
99 | data[0],
100 | width: MediaQuery.of(context).size.width / 3,
101 | height: 120.0,
102 | ),
103 | //if(data.length>1){
104 | new Image.network(
105 | data[0],
106 | width: MediaQuery.of(context).size.width / 3,
107 | height: 120.0,
108 | ),
109 | ],
110 | ),
111 | );
112 | }
113 | }
114 |
--------------------------------------------------------------------------------
/lib/home/question.dart:
--------------------------------------------------------------------------------
1 | class Question {
2 | String order;
3 | String rise;
4 | String title;
5 | String mark;
6 | String hotNum;
7 | String imgUrl;
8 |
9 | Question(this.order, this.title, this.hotNum, this.imgUrl,
10 | {required this.mark, required this.rise});
11 | }
12 |
13 | List questionList = [
14 | new Question("01", "了不起的新时代,世界竞争中的中国制造", "4427 万热度",
15 | "https://pic2.zhimg.com/50/v2-710b7a6fea12a7203945b666790b7181_hd.jpg", rise: '', mark: ''),
16 | new Question("02", "一个女生怎样才算见过世面?", "4157 万热度",
17 | "https://pic3.zhimg.com/50/v2-56dca99cd8718f9303d43b3015342ba7_hd.jpg",
18 | rise: "3", mark: "所谓世面,就是世界的每一面"),
19 | new Question("03", "如果朱标没死,削藩的话,朱棣会造反吗?", "4009 万热度",
20 | "https://pic4.zhimg.com/v2-095d2b48970889b108247e6d2dd0fa6b_b.jpg", rise: '', mark: ''),
21 | new Question("04", "如何编译 Linux 内核?", "3110 万热度",
22 | "https://pic3.zhimg.com/80/v2-1ea1b0cf80c85b88893b2b97a94d7e71_hd.jpg",
23 | mark: "内核?呵呵", rise: ''),
24 | new Question(
25 | "05",
26 | "如何看待将神话故事拍成电影这件事?",
27 | "2119 万热度",
28 | "https://pic4.zhimg.com/50/v2-267b1dda62f770bd2bd13cb545117b78_hd.jpg",
29 | rise: "3", mark: '',
30 | )
31 | ];
32 |
--------------------------------------------------------------------------------
/lib/main.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 | import 'package:flutter_app/MainPage.dart';
3 |
4 | void main() => runApp(new MyApp());
5 |
6 | class MyApp extends StatelessWidget {
7 | @override
8 | Widget build(BuildContext context) {
9 | return new MaterialApp(
10 | title: 'Flutter Demo ',
11 | theme: new ThemeData(
12 | primarySwatch: Colors.pink,
13 | ),
14 | home: new MainPage(),
15 | //原来的Demo
16 | // home: new MyHomePage(title: 'Flutter Demo 牛逼Home Page'),
17 | );
18 | }
19 | }
20 |
21 | //class MyHomePage extends StatefulWidget {
22 | // MyHomePage({Key key, this.title}) : super(key: key);
23 | //
24 | //
25 | // final String title;
26 | //
27 | // @override
28 | // MyHomePageState createState() => new MyHomePageState();
29 | //}
30 | //
31 | //class MyHomePageState extends State {
32 | // int _counter = 0;
33 | //
34 | // void _incrementCounter() {
35 | // setState(() {
36 | // _counter++;
37 | // print('你好');
38 | // print(_counter);
39 | // });
40 | // }
41 | //
42 | // @override
43 | // Widget build(BuildContext context) {
44 | // return new Scaffold(
45 | // appBar: new AppBar(
46 | // title: new Text(widget.title),
47 | // ),
48 | // body: new Center(
49 | // child: new Column(
50 | // mainAxisAlignment: MainAxisAlignment.center,
51 | // children: [
52 | // new Text(
53 | // 'You have pushed the button this many times:',
54 | // ),
55 | // new Text(
56 | // '$_counter',
57 | // style: Theme.of(context).textTheme.display1,
58 | // ),
59 | // ],
60 | // ),
61 | // ),
62 | // floatingActionButton: new FloatingActionButton(
63 | // onPressed: _incrementCounter,
64 | // tooltip: 'Increment',
65 | // child: new Icon(Icons.add),
66 | // ),
67 | // );
68 | // }
69 | //}
70 |
--------------------------------------------------------------------------------
/lib/my/MyPage.dart:
--------------------------------------------------------------------------------
1 | import 'dart:convert';
2 |
3 | import 'package:flutter/material.dart';
4 | import 'package:http/http.dart' as http;
5 |
6 | class MyPage extends StatefulWidget {
7 | @override
8 | State createState() {
9 | return new MyPageState();
10 | }
11 | }
12 |
13 | class MyPageState extends State {
14 | List widgets = [];
15 |
16 | @override
17 | void initState() {
18 | super.initState();
19 | }
20 |
21 | @override
22 | Widget build(BuildContext context) {
23 | return new Scaffold(
24 | appBar: new AppBar(
25 | title: new Text(
26 | "关于我",
27 | style: new TextStyle(color: Colors.purple),
28 | ),
29 | ),
30 | body: findBody(),
31 | );
32 | }
33 |
34 | findBody() {
35 | return new ListView(
36 | children: [
37 | new Text(
38 | "GitHub:https://github.com/Shimingli",
39 | style: new TextStyle(color: Colors.lightBlue, fontSize: 18.0),
40 | ),
41 | new AspectRatio(
42 | child: new Container(
43 | foregroundDecoration: new BoxDecoration(
44 | image: new DecorationImage(
45 | image: new NetworkImage(
46 | "https://upload-images.jianshu.io/upload_images/5363507-ff86aa4df080c21f.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240"),
47 | centerSlice: new Rect.fromLTRB(400.0, 400.0, 1360.0, 1500.0),
48 | ),
49 | borderRadius:
50 | const BorderRadius.all(const Radius.circular(6.0))),
51 | ),
52 | aspectRatio: 3.0 / 2.0,
53 | ),
54 | new Text(
55 | "简书:https://www.jianshu.com/",
56 | style: new TextStyle(color: Colors.lightBlue, fontSize: 18.0),
57 | ),
58 | new AspectRatio(
59 | child: new Container(
60 | foregroundDecoration: new BoxDecoration(
61 | image: new DecorationImage(
62 | image: new NetworkImage(
63 | "https://upload-images.jianshu.io/upload_images/5363507-b3550172157c83d2.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240"),
64 | centerSlice: new Rect.fromLTRB(400.0, 400.0, 1360.0, 1500.0),
65 | ),
66 | borderRadius:
67 | const BorderRadius.all(const Radius.circular(6.0))),
68 | ),
69 | aspectRatio: 3.0 / 2.0,
70 | ),
71 | ],
72 | );
73 | }
74 | }
75 |
--------------------------------------------------------------------------------
/lib/official/OfficialNetWorkPage.dart:
--------------------------------------------------------------------------------
1 | import 'dart:convert';
2 |
3 | import 'package:flutter/material.dart';
4 | import 'package:http/http.dart' as http;
5 |
6 |
7 | class OfficialNetWorkPage extends StatefulWidget {
8 | @override
9 | State createState() {
10 | return new OfficialNetWorkPageState();
11 | }
12 | }
13 |
14 | class OfficialNetWorkPageState extends State {
15 | List widgets = [];
16 |
17 | @override
18 | void initState() {
19 | super.initState();
20 |
21 | loadData();
22 | }
23 |
24 | @override
25 | Widget build(BuildContext context) {
26 | return new Scaffold(
27 | appBar: new AppBar(
28 | title: new Text(
29 | "官方NetWorkDemo",
30 | style: new TextStyle(color: Colors.purpleAccent),
31 | ),
32 | ),
33 | body: new ListView.builder(
34 | itemCount: widgets.length,
35 | itemBuilder: (BuildContext context, int position) {
36 | return getRow(position);
37 | }));
38 | }
39 |
40 | Widget getRow(int i) {
41 | return new Padding(
42 | padding: new EdgeInsets.all(10.0),
43 | child: new Text(
44 | "Row ${widgets[i]["title"]}",
45 | style: new TextStyle(color: Colors.orange, fontSize: 18.00),
46 | ));
47 | }
48 |
49 | loadData() async {
50 | String dataURL = "https://jsonplaceholder.typicode.com/posts";
51 | http.Response response = await http.get(dataURL);
52 | setState(() {
53 | widgets = json.decode(response.body);
54 | });
55 | }
56 | }
57 |
--------------------------------------------------------------------------------
/lib/similarWords/SimilarWordsPage.dart:
--------------------------------------------------------------------------------
1 | import 'dart:convert';
2 | import 'dart:io';
3 | import 'package:flutter/material.dart';
4 | import 'package:flutter_app/bean/DataBean.dart';
5 | import 'package:fluttertoast/fluttertoast.dart';
6 |
7 | class SimilarWordsPage extends StatefulWidget {
8 | @override
9 | State createState() {
10 | return new SimilarWordsPageState();
11 | }
12 | }
13 |
14 | class SimilarWordsPageState extends State {
15 | List datas = [];
16 | static int i = 0;
17 | final TextEditingController _textController = new TextEditingController();
18 |
19 | @override
20 | Widget build(BuildContext context) {
21 | return new Scaffold(
22 | // appBar: findAppBar(),
23 | backgroundColor: Colors.black12,
24 | body: findBody(),
25 | );
26 | }
27 |
28 | findBody() {
29 | return new Container(
30 | child: new Scaffold(
31 | body: new ListView.builder(
32 | itemCount: datas.length,
33 | itemBuilder: (BuildContext context, int position) {
34 | i = position;
35 | return getRow(position);
36 | },
37 | ),
38 | ));
39 | }
40 |
41 | Widget findAppBar() {
42 | return new AppBar(
43 | title: new Container(
44 | child: new Row(
45 | children: [
46 | new Container(
47 | child: new FlatButton.icon(
48 | onPressed: () {
49 | // 本来就在栈顶,退出会有显示的问题
50 | Navigator.of(context).pop();
51 | },
52 | icon: new Icon(Icons.close, color: Colors.white30),
53 | label: new Text(""),
54 | ),
55 | width: 60.0,
56 | ),
57 | new Expanded(
58 | child: new TextField(
59 | //不要主动弹起来
60 | autofocus: false,
61 | controller: _textController,
62 | decoration: new InputDecoration.collapsed(
63 | hintText: "请输入要查找的词",
64 | hintStyle: new TextStyle(color: Colors.red)),
65 | ),
66 | ),
67 | //点击事件的第一种实现的方式 我觉得不太好
68 | // new GestureDetector(child: new Icon(Icons.find_in_page),onTap: (){print("dd");})
69 | // 这种点击时间有点效果
70 | new IconButton(
71 | icon: new Icon(Icons.find_in_page),
72 | onPressed: () {
73 | print(_textController.text);
74 | if (_textController.text.isEmpty) {
75 | Fluttertoast.showToast(
76 | msg: "输入为空,请重新输入",
77 | toastLength: Toast.LENGTH_SHORT,
78 | gravity: ToastGravity.CENTER,
79 | timeInSecForIosWeb: 1,
80 | backgroundColor: Colors.red,
81 | textColor: Colors.white,
82 | fontSize: 16.0);
83 | } else {
84 | FocusNode focusNode = new FocusNode();
85 | FocusScope.of(context).requestFocus(new FocusNode());
86 | Fluttertoast.showToast(
87 | msg: "查找值为:" + _textController.text,
88 | toastLength: Toast.LENGTH_SHORT,
89 | gravity: ToastGravity.CENTER,
90 | timeInSecForIosWeb: 1,
91 | backgroundColor: Colors.red,
92 | textColor: Colors.white,
93 | fontSize: 16.0);
94 | getApiData(_textController.text);
95 | focusNode.unfocus();
96 | }
97 | })
98 | ],
99 | ),
100 | decoration: new BoxDecoration(
101 | borderRadius: const BorderRadius.all(const Radius.circular(4.0)),
102 | color: Colors.white10),
103 | ));
104 | }
105 |
106 | Widget getRow(int i) {
107 | return new Padding(
108 | padding: new EdgeInsets.all(10.0),
109 | // child: new Text("Row ${datas[i].key}",style: new TextStyle(color: Colors.orange,fontSize: 18.00),)
110 | // Column 相当于 相对布局 Row 线性布局
111 | child: new Column(
112 | children: [
113 | new Padding(
114 | padding: new EdgeInsets.fromLTRB(0.0, 5.0, 0.0, 5.0),
115 | child: new Row(
116 | children: [
117 | new Expanded(
118 | child: new OutlineButton(
119 | borderSide:
120 | new BorderSide(color: Theme.of(context).primaryColor),
121 | child: new Text(
122 | '条目 = ' + i.toString(),
123 | style: new TextStyle(color: Theme.of(context).primaryColor),
124 | ),
125 | onPressed: () {},
126 | )),
127 | ],
128 | ),
129 | ),
130 | new Container(
131 | child: new Text(
132 | "联想到的词:" + datas[i].key,
133 | style: new TextStyle(color: Colors.purple, fontSize: 12.00),
134 | ),
135 | padding: new EdgeInsets.all(10.0),
136 | ),
137 | new Container(
138 | child: new Text("联想到词的翻译信息:" + datas[i].message,
139 | style: new TextStyle(color: Colors.cyan, fontSize: 15.00)),
140 | padding: new EdgeInsets.all(10.0),
141 | )
142 | ],
143 | ),
144 | );
145 | }
146 |
147 | @override
148 | void initState() {
149 | super.initState();
150 | // 网络请求
151 | //http://dict-mobile.iciba.com/interface/index.php?c=word&m=getsuggest&nums=10&client=6&is_need_mean=1&word=sm
152 | //我的 Api的地址
153 | getApiData("sm");
154 | }
155 |
156 | // 网络请求
157 | void getApiData(String tag) async {
158 | // 注意导入的包的地方是 import 'dart:io';
159 | var httpClient = new HttpClient();
160 | var url =
161 | "http://dict-mobile.iciba.com/interface/index.php?c=word&m=getsuggest&nums=20&client=6&is_need_mean=1&word=" +
162 | tag;
163 | var request = await httpClient.getUrl(Uri.parse(url));
164 | var response = await request.close();
165 | if (response.statusCode == HttpStatus.OK) {
166 | var jsonData = await response.transform(utf8.decoder).join();
167 | setState(() {
168 | datas = DataBean.decodeData(jsonData);
169 | });
170 | for (int i = 0; i < datas.length; i++) {
171 | print(datas[i].key);
172 | print(datas[i].message);
173 | }
174 | }
175 | }
176 | }
177 |
--------------------------------------------------------------------------------
/lib/utils/ToastUtil.dart:
--------------------------------------------------------------------------------
1 | import 'dart:async';
2 |
3 | import 'package:flutter/services.dart';
4 | import 'package:meta/meta.dart';
5 |
6 | enum Toast { LENGTH_SHORT, LENGTH_LONG }
7 |
8 | enum ToastGravity { TOP, BOTTOM, CENTER }
9 |
10 | class ToastUtils {
11 | static const MethodChannel _channel =
12 | const MethodChannel('PonnamKarthik/fluttertoast');
13 |
14 | static Future showToast(
15 | {required String msg,
16 | required Toast toastLength,
17 | int timeInSecForIos = 1,
18 | required ToastGravity gravity,
19 | String bgcolor = "null",
20 | String textcolor = "null"}) async {
21 | String toast = "short";
22 | if (toastLength == Toast.LENGTH_LONG) {
23 | toast = "long";
24 | }
25 |
26 | String gravityToast = "bottom";
27 | if (gravity == ToastGravity.TOP) {
28 | gravityToast = "top";
29 | } else if (gravity == ToastGravity.CENTER) {
30 | gravityToast = "center";
31 | } else {
32 | gravityToast = "bottom";
33 | }
34 |
35 | final Map params = {
36 | 'msg': msg,
37 | 'length': toast,
38 | 'time': timeInSecForIos,
39 | 'gravity': gravityToast,
40 | 'bgcolor': bgcolor,
41 | 'textcolor': textcolor
42 | };
43 | String res = await _channel.invokeMethod('showToast', params);
44 | return res;
45 | }
46 | }
47 |
--------------------------------------------------------------------------------
/lib/widget/CustomButton.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/cupertino.dart';
2 | import 'package:flutter/material.dart';
3 |
4 | //在 Flutter 中构建自定义的 Widget 通常采用的是组合其他 Widget 的方式而非传统的继承。
5 | class CustomButton extends StatelessWidget {
6 | final String label;
7 |
8 | CustomButton(this.label);
9 |
10 | @override
11 | Widget build(BuildContext context) {
12 | return new RaisedButton(onPressed: () {}, child: new Text(label));
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/pubspec.lock:
--------------------------------------------------------------------------------
1 | # Generated by pub
2 | # See https://dart.dev/tools/pub/glossary#lockfile
3 | packages:
4 | _fe_analyzer_shared:
5 | dependency: transitive
6 | description:
7 | name: _fe_analyzer_shared
8 | url: "https://pub.dartlang.org"
9 | source: hosted
10 | version: "22.0.0"
11 | analyzer:
12 | dependency: transitive
13 | description:
14 | name: analyzer
15 | url: "https://pub.dartlang.org"
16 | source: hosted
17 | version: "1.7.2"
18 | args:
19 | dependency: transitive
20 | description:
21 | name: args
22 | url: "https://pub.dartlang.org"
23 | source: hosted
24 | version: "2.3.0"
25 | async:
26 | dependency: transitive
27 | description:
28 | name: async
29 | url: "https://pub.dartlang.org"
30 | source: hosted
31 | version: "2.8.2"
32 | boolean_selector:
33 | dependency: transitive
34 | description:
35 | name: boolean_selector
36 | url: "https://pub.dartlang.org"
37 | source: hosted
38 | version: "2.1.0"
39 | build:
40 | dependency: transitive
41 | description:
42 | name: build
43 | url: "https://pub.dartlang.org"
44 | source: hosted
45 | version: "1.6.3"
46 | build_config:
47 | dependency: transitive
48 | description:
49 | name: build_config
50 | url: "https://pub.dartlang.org"
51 | source: hosted
52 | version: "0.4.6"
53 | build_daemon:
54 | dependency: transitive
55 | description:
56 | name: build_daemon
57 | url: "https://pub.dartlang.org"
58 | source: hosted
59 | version: "2.1.10"
60 | build_resolvers:
61 | dependency: transitive
62 | description:
63 | name: build_resolvers
64 | url: "https://pub.dartlang.org"
65 | source: hosted
66 | version: "1.5.4"
67 | build_runner:
68 | dependency: "direct main"
69 | description:
70 | name: build_runner
71 | url: "https://pub.dartlang.org"
72 | source: hosted
73 | version: "1.11.5"
74 | build_runner_core:
75 | dependency: transitive
76 | description:
77 | name: build_runner_core
78 | url: "https://pub.dartlang.org"
79 | source: hosted
80 | version: "6.1.10"
81 | built_collection:
82 | dependency: transitive
83 | description:
84 | name: built_collection
85 | url: "https://pub.dartlang.org"
86 | source: hosted
87 | version: "5.1.1"
88 | built_value:
89 | dependency: transitive
90 | description:
91 | name: built_value
92 | url: "https://pub.dartlang.org"
93 | source: hosted
94 | version: "8.1.4"
95 | characters:
96 | dependency: transitive
97 | description:
98 | name: characters
99 | url: "https://pub.dartlang.org"
100 | source: hosted
101 | version: "1.2.0"
102 | charcode:
103 | dependency: transitive
104 | description:
105 | name: charcode
106 | url: "https://pub.dartlang.org"
107 | source: hosted
108 | version: "1.3.1"
109 | checked_yaml:
110 | dependency: transitive
111 | description:
112 | name: checked_yaml
113 | url: "https://pub.dartlang.org"
114 | source: hosted
115 | version: "1.0.4"
116 | cli_util:
117 | dependency: transitive
118 | description:
119 | name: cli_util
120 | url: "https://pub.dartlang.org"
121 | source: hosted
122 | version: "0.3.5"
123 | clock:
124 | dependency: transitive
125 | description:
126 | name: clock
127 | url: "https://pub.dartlang.org"
128 | source: hosted
129 | version: "1.1.0"
130 | code_builder:
131 | dependency: transitive
132 | description:
133 | name: code_builder
134 | url: "https://pub.dartlang.org"
135 | source: hosted
136 | version: "3.7.0"
137 | collection:
138 | dependency: transitive
139 | description:
140 | name: collection
141 | url: "https://pub.dartlang.org"
142 | source: hosted
143 | version: "1.15.0"
144 | convert:
145 | dependency: transitive
146 | description:
147 | name: convert
148 | url: "https://pub.dartlang.org"
149 | source: hosted
150 | version: "3.0.1"
151 | crypto:
152 | dependency: transitive
153 | description:
154 | name: crypto
155 | url: "https://pub.dartlang.org"
156 | source: hosted
157 | version: "3.0.1"
158 | cupertino_icons:
159 | dependency: "direct main"
160 | description:
161 | name: cupertino_icons
162 | url: "https://pub.dartlang.org"
163 | source: hosted
164 | version: "1.0.4"
165 | dart_style:
166 | dependency: transitive
167 | description:
168 | name: dart_style
169 | url: "https://pub.dartlang.org"
170 | source: hosted
171 | version: "1.3.14"
172 | fake_async:
173 | dependency: transitive
174 | description:
175 | name: fake_async
176 | url: "https://pub.dartlang.org"
177 | source: hosted
178 | version: "1.2.0"
179 | file:
180 | dependency: transitive
181 | description:
182 | name: file
183 | url: "https://pub.dartlang.org"
184 | source: hosted
185 | version: "6.1.2"
186 | fixnum:
187 | dependency: transitive
188 | description:
189 | name: fixnum
190 | url: "https://pub.dartlang.org"
191 | source: hosted
192 | version: "1.0.0"
193 | flutter:
194 | dependency: "direct main"
195 | description: flutter
196 | source: sdk
197 | version: "0.0.0"
198 | flutter_lints:
199 | dependency: "direct dev"
200 | description:
201 | name: flutter_lints
202 | url: "https://pub.dartlang.org"
203 | source: hosted
204 | version: "1.0.4"
205 | flutter_test:
206 | dependency: "direct dev"
207 | description: flutter
208 | source: sdk
209 | version: "0.0.0"
210 | flutter_web_plugins:
211 | dependency: transitive
212 | description: flutter
213 | source: sdk
214 | version: "0.0.0"
215 | flutter_webview_plugin:
216 | dependency: "direct main"
217 | description:
218 | path: "."
219 | ref: HEAD
220 | resolved-ref: f85db45aedefeab4c1df75cfc4c35f62d3c1c629
221 | url: "https://github.com/nuc134r/flutter_webview_plugin.git"
222 | source: git
223 | version: "0.3.11"
224 | fluttertoast:
225 | dependency: "direct main"
226 | description:
227 | name: fluttertoast
228 | url: "https://pub.dartlang.org"
229 | source: hosted
230 | version: "8.0.8"
231 | glob:
232 | dependency: transitive
233 | description:
234 | name: glob
235 | url: "https://pub.dartlang.org"
236 | source: hosted
237 | version: "2.0.2"
238 | graphs:
239 | dependency: transitive
240 | description:
241 | name: graphs
242 | url: "https://pub.dartlang.org"
243 | source: hosted
244 | version: "0.2.0"
245 | http:
246 | dependency: "direct main"
247 | description:
248 | name: http
249 | url: "https://pub.dartlang.org"
250 | source: hosted
251 | version: "0.12.2"
252 | http_multi_server:
253 | dependency: transitive
254 | description:
255 | name: http_multi_server
256 | url: "https://pub.dartlang.org"
257 | source: hosted
258 | version: "2.2.0"
259 | http_parser:
260 | dependency: transitive
261 | description:
262 | name: http_parser
263 | url: "https://pub.dartlang.org"
264 | source: hosted
265 | version: "3.1.4"
266 | io:
267 | dependency: transitive
268 | description:
269 | name: io
270 | url: "https://pub.dartlang.org"
271 | source: hosted
272 | version: "0.3.5"
273 | js:
274 | dependency: transitive
275 | description:
276 | name: js
277 | url: "https://pub.dartlang.org"
278 | source: hosted
279 | version: "0.6.3"
280 | json_annotation:
281 | dependency: "direct main"
282 | description:
283 | name: json_annotation
284 | url: "https://pub.dartlang.org"
285 | source: hosted
286 | version: "3.1.1"
287 | lints:
288 | dependency: transitive
289 | description:
290 | name: lints
291 | url: "https://pub.dartlang.org"
292 | source: hosted
293 | version: "1.0.1"
294 | logging:
295 | dependency: transitive
296 | description:
297 | name: logging
298 | url: "https://pub.dartlang.org"
299 | source: hosted
300 | version: "1.0.2"
301 | matcher:
302 | dependency: transitive
303 | description:
304 | name: matcher
305 | url: "https://pub.dartlang.org"
306 | source: hosted
307 | version: "0.12.11"
308 | material_color_utilities:
309 | dependency: transitive
310 | description:
311 | name: material_color_utilities
312 | url: "https://pub.dartlang.org"
313 | source: hosted
314 | version: "0.1.3"
315 | meta:
316 | dependency: transitive
317 | description:
318 | name: meta
319 | url: "https://pub.dartlang.org"
320 | source: hosted
321 | version: "1.7.0"
322 | mime:
323 | dependency: transitive
324 | description:
325 | name: mime
326 | url: "https://pub.dartlang.org"
327 | source: hosted
328 | version: "1.0.1"
329 | package_config:
330 | dependency: transitive
331 | description:
332 | name: package_config
333 | url: "https://pub.dartlang.org"
334 | source: hosted
335 | version: "2.0.2"
336 | path:
337 | dependency: transitive
338 | description:
339 | name: path
340 | url: "https://pub.dartlang.org"
341 | source: hosted
342 | version: "1.8.0"
343 | pedantic:
344 | dependency: transitive
345 | description:
346 | name: pedantic
347 | url: "https://pub.dartlang.org"
348 | source: hosted
349 | version: "1.11.1"
350 | pool:
351 | dependency: transitive
352 | description:
353 | name: pool
354 | url: "https://pub.dartlang.org"
355 | source: hosted
356 | version: "1.5.0"
357 | pub_semver:
358 | dependency: transitive
359 | description:
360 | name: pub_semver
361 | url: "https://pub.dartlang.org"
362 | source: hosted
363 | version: "2.1.0"
364 | pubspec_parse:
365 | dependency: transitive
366 | description:
367 | name: pubspec_parse
368 | url: "https://pub.dartlang.org"
369 | source: hosted
370 | version: "0.1.8"
371 | shelf:
372 | dependency: transitive
373 | description:
374 | name: shelf
375 | url: "https://pub.dartlang.org"
376 | source: hosted
377 | version: "0.7.9"
378 | shelf_web_socket:
379 | dependency: transitive
380 | description:
381 | name: shelf_web_socket
382 | url: "https://pub.dartlang.org"
383 | source: hosted
384 | version: "0.2.4+1"
385 | sky_engine:
386 | dependency: transitive
387 | description: flutter
388 | source: sdk
389 | version: "0.0.99"
390 | source_span:
391 | dependency: transitive
392 | description:
393 | name: source_span
394 | url: "https://pub.dartlang.org"
395 | source: hosted
396 | version: "1.8.1"
397 | stack_trace:
398 | dependency: transitive
399 | description:
400 | name: stack_trace
401 | url: "https://pub.dartlang.org"
402 | source: hosted
403 | version: "1.10.0"
404 | stream_channel:
405 | dependency: transitive
406 | description:
407 | name: stream_channel
408 | url: "https://pub.dartlang.org"
409 | source: hosted
410 | version: "2.1.0"
411 | stream_transform:
412 | dependency: transitive
413 | description:
414 | name: stream_transform
415 | url: "https://pub.dartlang.org"
416 | source: hosted
417 | version: "2.0.0"
418 | string_scanner:
419 | dependency: transitive
420 | description:
421 | name: string_scanner
422 | url: "https://pub.dartlang.org"
423 | source: hosted
424 | version: "1.1.0"
425 | term_glyph:
426 | dependency: transitive
427 | description:
428 | name: term_glyph
429 | url: "https://pub.dartlang.org"
430 | source: hosted
431 | version: "1.2.0"
432 | test_api:
433 | dependency: transitive
434 | description:
435 | name: test_api
436 | url: "https://pub.dartlang.org"
437 | source: hosted
438 | version: "0.4.8"
439 | timing:
440 | dependency: transitive
441 | description:
442 | name: timing
443 | url: "https://pub.dartlang.org"
444 | source: hosted
445 | version: "0.1.1+3"
446 | typed_data:
447 | dependency: transitive
448 | description:
449 | name: typed_data
450 | url: "https://pub.dartlang.org"
451 | source: hosted
452 | version: "1.3.0"
453 | vector_math:
454 | dependency: transitive
455 | description:
456 | name: vector_math
457 | url: "https://pub.dartlang.org"
458 | source: hosted
459 | version: "2.1.1"
460 | watcher:
461 | dependency: transitive
462 | description:
463 | name: watcher
464 | url: "https://pub.dartlang.org"
465 | source: hosted
466 | version: "1.0.1"
467 | web_socket_channel:
468 | dependency: transitive
469 | description:
470 | name: web_socket_channel
471 | url: "https://pub.dartlang.org"
472 | source: hosted
473 | version: "1.2.0"
474 | yaml:
475 | dependency: transitive
476 | description:
477 | name: yaml
478 | url: "https://pub.dartlang.org"
479 | source: hosted
480 | version: "3.1.0"
481 | sdks:
482 | dart: ">=2.14.0 <3.0.0"
483 | flutter: ">=1.10.0"
484 |
--------------------------------------------------------------------------------
/pubspec.yaml:
--------------------------------------------------------------------------------
1 | name: flutter_app
2 | description: A new Flutter application.
3 |
4 | # The following line prevents the package from being accidentally published to
5 | # pub.dev using `flutter pub publish`. This is preferred for private packages.
6 | publish_to: 'none' # Remove this line if you wish to publish to pub.dev
7 |
8 | # The following defines the version and build number for your application.
9 | # A version number is three numbers separated by dots, like 1.2.43
10 | # followed by an optional build number separated by a +.
11 | # Both the version and the builder number may be overridden in flutter
12 | # build by specifying --build-name and --build-number, respectively.
13 | # In Android, build-name is used as versionName while build-number used as versionCode.
14 | # Read more about Android versioning at https://developer.android.com/studio/publish/versioning
15 | # In iOS, build-name is used as CFBundleShortVersionString while build-number used as CFBundleVersion.
16 | # Read more about iOS versioning at
17 | # https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
18 | version: 1.0.0+1
19 |
20 | environment:
21 | sdk: ">=2.12.0 <3.0.0"
22 |
23 | # Dependencies specify other packages that your package needs in order to work.
24 | # To automatically upgrade your package dependencies to the latest versions
25 | # consider running `flutter pub upgrade --major-versions`. Alternatively,
26 | # dependencies can be manually updated by changing the version numbers below to
27 | # the latest version available on pub.dev. To see which dependencies have newer
28 | # versions available, run `flutter pub outdated`.
29 | dependencies:
30 | flutter:
31 | sdk: flutter
32 |
33 | fluttertoast: ^8.0.8 #"Packages get" 要去主动的 get 一次依赖
34 | http: ^0.12.0+4
35 |
36 | # The following adds the Cupertino Icons font to your application.
37 | # Use with the CupertinoIcons class for iOS style icons.
38 | cupertino_icons: ^1.0.2
39 |
40 | json_annotation: ^3.1.1
41 | build_runner: ^1.0.0
42 |
43 | flutter_webview_plugin:
44 | git: https://github.com/nuc134r/flutter_webview_plugin.git
45 |
46 |
47 |
48 | dev_dependencies:
49 | flutter_test:
50 | sdk: flutter
51 |
52 | # The "flutter_lints" package below contains a set of recommended lints to
53 | # encourage good coding practices. The lint set provided by the package is
54 | # activated in the `analysis_options.yaml` file located at the root of your
55 | # package. See that file for information about deactivating specific lint
56 | # rules and activating additional ones.
57 | flutter_lints: ^1.0.0
58 |
59 | # For information on the generic Dart part of this file, see the
60 | # following page: https://dart.dev/tools/pub/pubspec
61 |
62 | # The following section is specific to Flutter.
63 | flutter:
64 |
65 | # The following line ensures that the Material Icons font is
66 | # included with your application, so that you can use the icons in
67 | # the material Icons class.
68 | uses-material-design: true
69 |
70 | # To add assets to your application, add an assets section, like this:
71 | # assets:
72 | # - images/a_dot_burr.jpeg
73 | # - images/a_dot_ham.jpeg
74 |
75 | # An image asset can refer to one or more resolution-specific "variants", see
76 | # https://flutter.dev/assets-and-images/#resolution-aware.
77 |
78 | # For details regarding adding assets from package dependencies, see
79 | # https://flutter.dev/assets-and-images/#from-packages
80 |
81 | # To add custom fonts to your application, add a fonts section here,
82 | # in this "flutter" section. Each entry in this list should have a
83 | # "family" key with the font family name, and a "fonts" key with a
84 | # list giving the asset and other descriptors for the font. For
85 | # example:
86 | # fonts:
87 | # - family: Schyler
88 | # fonts:
89 | # - asset: fonts/Schyler-Regular.ttf
90 | # - asset: fonts/Schyler-Italic.ttf
91 | # style: italic
92 | # - family: Trajan Pro
93 | # fonts:
94 | # - asset: fonts/TrajanPro.ttf
95 | # - asset: fonts/TrajanPro_Bold.ttf
96 | # weight: 700
97 | #
98 | # For details regarding fonts from package dependencies,
99 | # see https://flutter.dev/custom-fonts/#from-packages
100 |
--------------------------------------------------------------------------------
/test/widget_test.dart:
--------------------------------------------------------------------------------
1 | // This is a basic Flutter widget test.
2 | // To perform an interaction with a widget in your test, use the WidgetTester utility that Flutter
3 | // provides. For example, you can send tap and scroll gestures. You can also use WidgetTester to
4 | // find child widgets in the widget tree, read text, and verify that the values of widget properties
5 | // are correct.
6 |
7 | import 'package:flutter/material.dart';
8 | import 'package:flutter_test/flutter_test.dart';
9 |
10 | import 'package:flutter_app/main.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(new 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 |
--------------------------------------------------------------------------------