├── .gitignore
├── .metadata
├── README.md
├── android
├── app
│ ├── build.gradle
│ └── src
│ │ ├── debug
│ │ └── AndroidManifest.xml
│ │ ├── main
│ │ ├── AndroidManifest.xml
│ │ ├── java
│ │ │ └── com
│ │ │ │ └── wyz
│ │ │ │ └── flutter_wyz
│ │ │ │ └── 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
│ │ │ ├── mipmap-xxxhdpi
│ │ │ └── ic_launcher.png
│ │ │ └── values
│ │ │ └── styles.xml
│ │ └── profile
│ │ └── AndroidManifest.xml
├── build.gradle
├── gradle.properties
├── gradle
│ └── wrapper
│ │ └── gradle-wrapper.properties
├── key.properties
└── settings.gradle
├── img
├── add.png
├── back.png
├── chat.png
├── ic_mic.png
├── ic_pause.png
├── ic_play.png
├── ic_stop.png
├── ic_volume_down.png
├── ic_volume_up.png
├── ld.gif
├── loading.gif
├── love.png
├── luyin.gif
├── luyin.png
├── lx.png
├── off.png
├── on.png
├── p.jpg
├── p.png
├── pp.png
├── sd.png
├── start.jpg
├── wd.png
├── yyl.png
└── yyr.png
├── ios
├── Flutter
│ ├── AppFrameworkInfo.plist
│ ├── Debug.xcconfig
│ └── Release.xcconfig
├── Podfile
├── Podfile.lock
├── Runner.xcodeproj
│ ├── project.pbxproj
│ ├── project.xcworkspace
│ │ └── contents.xcworkspacedata
│ └── xcshareddata
│ │ └── xcschemes
│ │ └── Runner.xcscheme
├── Runner.xcworkspace
│ ├── contents.xcworkspacedata
│ └── xcshareddata
│ │ ├── IDEWorkspaceChecks.plist
│ │ └── WorkspaceSettings.xcsettings
└── 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.zip
├── lib
├── config
│ ├── all_data.dart
│ └── config.dart
├── main.dart
├── page
│ ├── component
│ │ ├── chat
│ │ │ ├── chat_home.dart
│ │ │ └── chat_list.dart
│ │ ├── friend
│ │ │ ├── friend_all.dart
│ │ │ ├── friend_info.dart
│ │ │ ├── friend_my.dart
│ │ │ └── my_friend.dart
│ │ ├── list
│ │ │ └── user_list.dart
│ │ ├── msg
│ │ │ ├── comment_back.dart
│ │ │ ├── msg_add.dart
│ │ │ ├── msg_home.dart
│ │ │ ├── msg_info.dart
│ │ │ ├── msg_list.dart
│ │ │ ├── msg_my.dart
│ │ │ └── msg_my_care.dart
│ │ ├── person
│ │ │ ├── add_device.dart
│ │ │ ├── change_autograph
│ │ │ │ └── change_autograph.dart
│ │ │ ├── change_back_img
│ │ │ │ └── change_back_img.dart
│ │ │ ├── change_head
│ │ │ │ └── change_head.dart
│ │ │ ├── device_hj.dart
│ │ │ ├── device_info.dart
│ │ │ ├── device_list.dart
│ │ │ ├── head_img.dart
│ │ │ ├── menu.dart
│ │ │ ├── name
│ │ │ │ └── change_name.dart
│ │ │ └── psd
│ │ │ │ └── change_password.dart
│ │ └── user
│ │ │ ├── add_user.dart
│ │ │ ├── qrcode.dart
│ │ │ └── user_info.dart
│ ├── content
│ │ ├── airplay_screen.dart
│ │ ├── email_screen.dart
│ │ ├── home_screen.dart
│ │ └── pages_screen.dart
│ ├── index
│ │ └── index.dart
│ ├── login
│ │ ├── forget_password.dart
│ │ ├── login.dart
│ │ └── register.dart
│ ├── pojo
│ │ ├── chat.dart
│ │ ├── comment.dart
│ │ ├── device.dart
│ │ ├── msg.dart
│ │ └── user.dart
│ ├── readme.txt
│ └── version
│ │ └── version.dart
└── util
│ ├── Toast.dart
│ └── local_storage.dart
├── pubspec.lock
├── pubspec.yaml
└── test
└── widget_test.dart
/.gitignore:
--------------------------------------------------------------------------------
1 | # my ignore
2 | key.jks
3 | uploadServer.txt
4 |
5 | # Miscellaneous
6 | *.class
7 | *.log
8 | *.pyc
9 | *.swp
10 | .DS_Store
11 | .atom/
12 | .buildlog/
13 | .history
14 | .svn/
15 |
16 | # IntelliJ related
17 | *.iml
18 | *.ipr
19 | *.iws
20 | .idea/
21 |
22 | # Visual Studio Code related
23 | .vscode/
24 |
25 | # Flutter/Dart/Pub related
26 | **/doc/api/
27 | .dart_tool/
28 | .flutter-plugins
29 | .packages
30 | .pub-cache/
31 | .pub/
32 | /build/
33 |
34 | # Android related
35 | **/android/**/gradle-wrapper.jar
36 | **/android/.gradle
37 | **/android/captures/
38 | **/android/gradlew
39 | **/android/gradlew.bat
40 | **/android/local.properties
41 | **/android/**/GeneratedPluginRegistrant.java
42 |
43 | # iOS/XCode related
44 | **/ios/**/*.mode1v3
45 | **/ios/**/*.mode2v3
46 | **/ios/**/*.moved-aside
47 | **/ios/**/*.pbxuser
48 | **/ios/**/*.perspectivev3
49 | **/ios/**/*sync/
50 | **/ios/**/.sconsign.dblite
51 | **/ios/**/.tags*
52 | **/ios/**/.vagrant/
53 | **/ios/**/DerivedData/
54 | **/ios/**/Icon?
55 | **/ios/**/Pods/
56 | **/ios/**/.symlinks/
57 | **/ios/**/profile
58 | **/ios/**/xcuserdata
59 | **/ios/.generated/
60 | **/ios/Flutter/App.framework
61 | **/ios/Flutter/Flutter.framework
62 | **/ios/Flutter/Generated.xcconfig
63 | **/ios/Flutter/app.flx
64 | **/ios/Flutter/app.zip
65 | **/ios/Flutter/flutter_assets/
66 | **/ios/ServiceDefinitions.json
67 | **/ios/Runner/GeneratedPluginRegistrant.*
68 |
69 | # Exceptions to above rules.
70 | !**/ios/**/default.mode1v3
71 | !**/ios/**/default.mode2v3
72 | !**/ios/**/default.pbxuser
73 | !**/ios/**/default.perspectivev3
74 | !/packages/flutter_tools/test/data/dart_dependencies_test/**/.packages
75 |
--------------------------------------------------------------------------------
/.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: 8661d8aecd626f7f57ccbcb735553edc05a2e713
8 | channel: stable
9 |
10 | project_type: app
11 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # 遥不可及
2 |
3 | flutter 社交app Updated 3 minutes ago 主要用于研究flutter常用packages,涉及到,app版本升级,权限获取,扫码,图片选择,图片上传,图片压缩,图片裁剪,图片缓存,数据缓存,http通讯。本人纯后端出身,ui别吐槽
4 |
5 | ## Getting Started
6 |
7 | 如果出现服务器数据返回慢,不要慌,毕竟后面是个1核1G1M带宽的服务器,体谅下~~
8 |
9 | 因为项目中引用了一些外部package,有些package版本上有冲突,我对这些package做了手动修改。clone下去后,跑不起来的。
10 | 项目根目录下有个lib.zip,解压后可以得到这些package,复制到自己电脑,如:D:\soft\flutter\\.pub-cache\hosted\pub.flutter-io.cn\路径下就可以了。D:\soft\flutter\为你电脑对应的flutter sdk位置。
11 | 项目版本为flutter1.2.1,如果你的flutter版本为1.5.4,chat_home中有两个方法(onLongPressDragUp,onLongPressDragStart)需要稍微修改一下。如果不想改,可以先注释掉报错代码,然后运行
12 |
13 | 语音存储用的OSS,项目中没有提供OSS的密钥。若要使用语音功能,请修改相关OSS配置为自己的OSS配置。
14 |
15 | 项目中的api都可以随便调用,如果觉得我ui不好看的,可以利用这些api自己重新写一个app。如果有什么更多的功能需求,需要新api,简单,好实现那种,可以qq联系我,815769472。加好友时说明来意。
16 |
17 | 用户系统和我另外一个app《智能管家》用的一个,那个app注册了,这里可以直接登录。
18 | - [智能管家项目地址](https://www.github.com/zocoo/znjjwyz)
19 |
20 | 安卓下载尝试请扫码
21 | 
22 |
23 | 登录
24 | 
25 |
26 | 主页
27 | 
28 |
29 | 动态详情及评论
30 | 
31 |
32 | 好友列表
33 | 
34 |
35 | 用户主页
36 | 
37 |
38 | 消息列表
39 | 
40 |
41 | 聊天界面
42 | 
43 |
44 | 个人中心
45 | 
46 |
--------------------------------------------------------------------------------
/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 from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
26 | apply plugin: 'kotlin-android'
27 | def keystorePropertiesFile = rootProject.file("key.properties")
28 | def keystoreProperties = new Properties()
29 | keystoreProperties.load(new FileInputStream(keystorePropertiesFile))
30 | android {
31 | compileSdkVersion 28
32 |
33 | lintOptions {
34 | disable 'InvalidPackage'
35 | }
36 |
37 | defaultConfig {
38 | // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
39 | applicationId "com.wyz.flutter_wyz"
40 | minSdkVersion 16
41 | targetSdkVersion 28
42 | versionCode flutterVersionCode.toInteger()
43 | versionName flutterVersionName
44 | testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
45 | manifestPlaceholders = [
46 | JPUSH_PKGNAME : "com.wyz.flutter_wyz",
47 | JPUSH_APPKEY : "ce53da8fe966805f893421bb", // NOTE: JPush 上注册的包名对应的 Appkey.
48 | JPUSH_CHANNEL : "developer-default", //暂时填写默认值即可.
49 | ]
50 | }
51 | signingConfigs {
52 | release {
53 | keyAlias keystoreProperties['keyAlias']
54 | keyPassword keystoreProperties['keyPassword']
55 | storeFile file(keystoreProperties['storeFile'])
56 | storePassword keystoreProperties['storePassword']
57 | }
58 | }
59 | buildTypes {
60 | release {
61 | // TODO: Add your own signing config for the release build.
62 | // Signing with the debug keys for now, so `flutter run --release` works.
63 | signingConfig signingConfigs.debug
64 | }
65 | }
66 |
67 |
68 | }
69 |
70 | flutter {
71 | source '../..'
72 | }
73 |
74 | dependencies {
75 | testImplementation 'junit:junit:4.12'
76 | androidTestImplementation 'com.android.support.test:runner:1.0.2'
77 | androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
78 | implementation "org.jetbrains.kotlin:kotlin-stdlib-jre7:$kotlin_version"
79 | }
80 |
--------------------------------------------------------------------------------
/android/app/src/debug/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
3 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
18 |
21 |
22 |
26 |
27 |
30 |
31 |
32 |
--------------------------------------------------------------------------------
/android/app/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
3 |
4 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
19 |
26 |
30 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
44 |
47 |
48 |
51 |
52 |
53 |
--------------------------------------------------------------------------------
/android/app/src/main/java/com/wyz/flutter_wyz/MainActivity.java:
--------------------------------------------------------------------------------
1 | package com.wyz.flutter_wyz;
2 |
3 | import android.os.Bundle;
4 | import io.flutter.app.FlutterActivity;
5 | import io.flutter.plugins.GeneratedPluginRegistrant;
6 |
7 |
8 | import android.view.KeyEvent;
9 | import io.flutter.plugin.common.MethodCall;
10 | import io.flutter.plugin.common.MethodChannel;
11 | public class MainActivity extends FlutterActivity {
12 | private final String CHANNEL = "android/back/desktop";
13 |
14 | @Override
15 | protected void onCreate(Bundle savedInstanceState) {
16 | super.onCreate(savedInstanceState);
17 | GeneratedPluginRegistrant.registerWith(this);
18 | new MethodChannel(getFlutterView(), CHANNEL).setMethodCallHandler(
19 | new MethodChannel.MethodCallHandler() {
20 | @Override
21 | public void onMethodCall(MethodCall methodCall, MethodChannel.Result result) {
22 | if (methodCall.method.equals("backDesktop")) {
23 | result.success(true);
24 | moveTaskToBack(false);
25 | }
26 | }
27 | }
28 | );
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/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/Zocoo/flutter-app/978fa83cdbf0cd7d210085ca3d94ae0258903c44/android/app/src/main/res/mipmap-hdpi/ic_launcher.png
--------------------------------------------------------------------------------
/android/app/src/main/res/mipmap-mdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Zocoo/flutter-app/978fa83cdbf0cd7d210085ca3d94ae0258903c44/android/app/src/main/res/mipmap-mdpi/ic_launcher.png
--------------------------------------------------------------------------------
/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Zocoo/flutter-app/978fa83cdbf0cd7d210085ca3d94ae0258903c44/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Zocoo/flutter-app/978fa83cdbf0cd7d210085ca3d94ae0258903c44/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Zocoo/flutter-app/978fa83cdbf0cd7d210085ca3d94ae0258903c44/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/android/app/src/main/res/values/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
8 |
9 |
--------------------------------------------------------------------------------
/android/app/src/profile/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
3 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
17 |
22 |
25 |
26 |
27 |
30 |
31 |
32 |
--------------------------------------------------------------------------------
/android/build.gradle:
--------------------------------------------------------------------------------
1 | buildscript {
2 | repositories {
3 | google()
4 | jcenter()
5 | }
6 | ext.kotlin_version = '1.2.51'
7 | dependencies {
8 | classpath 'com.android.tools.build:gradle:3.2.1'
9 | classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
10 | }
11 | }
12 |
13 | allprojects {
14 | repositories {
15 | google()
16 | jcenter()
17 | }
18 | }
19 |
20 | rootProject.buildDir = '../build'
21 | subprojects {
22 | project.buildDir = "${rootProject.buildDir}/${project.name}"
23 | }
24 | subprojects {
25 | project.evaluationDependsOn(':app')
26 | }
27 |
28 | task clean(type: Delete) {
29 | delete rootProject.buildDir
30 | }
31 |
--------------------------------------------------------------------------------
/android/gradle.properties:
--------------------------------------------------------------------------------
1 | org.gradle.jvmargs=-Xmx1536M
2 |
--------------------------------------------------------------------------------
/android/gradle/wrapper/gradle-wrapper.properties:
--------------------------------------------------------------------------------
1 | #Fri Jun 23 08:50:38 CEST 2017
2 | distributionBase=GRADLE_USER_HOME
3 | distributionPath=wrapper/dists
4 | zipStoreBase=GRADLE_USER_HOME
5 | zipStorePath=wrapper/dists
6 | distributionUrl=https\://services.gradle.org/distributions/gradle-4.10.2-all.zip
7 |
--------------------------------------------------------------------------------
/android/key.properties:
--------------------------------------------------------------------------------
1 | storePassword=psoxsk4855
2 | keyPassword=psoxsk4855
3 | keyAlias=key
4 | storeFile=E:/flutterWorkSpace/flutter-app/key.jks
--------------------------------------------------------------------------------
/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 |
--------------------------------------------------------------------------------
/img/add.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Zocoo/flutter-app/978fa83cdbf0cd7d210085ca3d94ae0258903c44/img/add.png
--------------------------------------------------------------------------------
/img/back.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Zocoo/flutter-app/978fa83cdbf0cd7d210085ca3d94ae0258903c44/img/back.png
--------------------------------------------------------------------------------
/img/chat.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Zocoo/flutter-app/978fa83cdbf0cd7d210085ca3d94ae0258903c44/img/chat.png
--------------------------------------------------------------------------------
/img/ic_mic.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Zocoo/flutter-app/978fa83cdbf0cd7d210085ca3d94ae0258903c44/img/ic_mic.png
--------------------------------------------------------------------------------
/img/ic_pause.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Zocoo/flutter-app/978fa83cdbf0cd7d210085ca3d94ae0258903c44/img/ic_pause.png
--------------------------------------------------------------------------------
/img/ic_play.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Zocoo/flutter-app/978fa83cdbf0cd7d210085ca3d94ae0258903c44/img/ic_play.png
--------------------------------------------------------------------------------
/img/ic_stop.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Zocoo/flutter-app/978fa83cdbf0cd7d210085ca3d94ae0258903c44/img/ic_stop.png
--------------------------------------------------------------------------------
/img/ic_volume_down.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Zocoo/flutter-app/978fa83cdbf0cd7d210085ca3d94ae0258903c44/img/ic_volume_down.png
--------------------------------------------------------------------------------
/img/ic_volume_up.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Zocoo/flutter-app/978fa83cdbf0cd7d210085ca3d94ae0258903c44/img/ic_volume_up.png
--------------------------------------------------------------------------------
/img/ld.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Zocoo/flutter-app/978fa83cdbf0cd7d210085ca3d94ae0258903c44/img/ld.gif
--------------------------------------------------------------------------------
/img/loading.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Zocoo/flutter-app/978fa83cdbf0cd7d210085ca3d94ae0258903c44/img/loading.gif
--------------------------------------------------------------------------------
/img/love.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Zocoo/flutter-app/978fa83cdbf0cd7d210085ca3d94ae0258903c44/img/love.png
--------------------------------------------------------------------------------
/img/luyin.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Zocoo/flutter-app/978fa83cdbf0cd7d210085ca3d94ae0258903c44/img/luyin.gif
--------------------------------------------------------------------------------
/img/luyin.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Zocoo/flutter-app/978fa83cdbf0cd7d210085ca3d94ae0258903c44/img/luyin.png
--------------------------------------------------------------------------------
/img/lx.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Zocoo/flutter-app/978fa83cdbf0cd7d210085ca3d94ae0258903c44/img/lx.png
--------------------------------------------------------------------------------
/img/off.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Zocoo/flutter-app/978fa83cdbf0cd7d210085ca3d94ae0258903c44/img/off.png
--------------------------------------------------------------------------------
/img/on.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Zocoo/flutter-app/978fa83cdbf0cd7d210085ca3d94ae0258903c44/img/on.png
--------------------------------------------------------------------------------
/img/p.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Zocoo/flutter-app/978fa83cdbf0cd7d210085ca3d94ae0258903c44/img/p.jpg
--------------------------------------------------------------------------------
/img/p.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Zocoo/flutter-app/978fa83cdbf0cd7d210085ca3d94ae0258903c44/img/p.png
--------------------------------------------------------------------------------
/img/pp.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Zocoo/flutter-app/978fa83cdbf0cd7d210085ca3d94ae0258903c44/img/pp.png
--------------------------------------------------------------------------------
/img/sd.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Zocoo/flutter-app/978fa83cdbf0cd7d210085ca3d94ae0258903c44/img/sd.png
--------------------------------------------------------------------------------
/img/start.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Zocoo/flutter-app/978fa83cdbf0cd7d210085ca3d94ae0258903c44/img/start.jpg
--------------------------------------------------------------------------------
/img/wd.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Zocoo/flutter-app/978fa83cdbf0cd7d210085ca3d94ae0258903c44/img/wd.png
--------------------------------------------------------------------------------
/img/yyl.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Zocoo/flutter-app/978fa83cdbf0cd7d210085ca3d94ae0258903c44/img/yyl.png
--------------------------------------------------------------------------------
/img/yyr.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Zocoo/flutter-app/978fa83cdbf0cd7d210085ca3d94ae0258903c44/img/yyr.png
--------------------------------------------------------------------------------
/ios/Flutter/AppFrameworkInfo.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | NSCameraUsageDescription
6 | Camera permission is required for barcode scanning.
7 | CFBundleGetInfoString
8 |
9 | CFBundleDisplayName
10 |
11 | CFBundleDevelopmentRegion
12 | en
13 | CFBundleExecutable
14 | App
15 | CFBundleIdentifier
16 | io.flutter.flutter.app
17 | CFBundleInfoDictionaryVersion
18 | 6.0
19 | CFBundleName
20 | App
21 | CFBundlePackageType
22 | FMWK
23 | CFBundleShortVersionString
24 | 1.0
25 | CFBundleSignature
26 | ????
27 | CFBundleVersion
28 | 1.0
29 | MinimumOSVersion
30 | 8.0
31 |
32 |
33 |
--------------------------------------------------------------------------------
/ios/Flutter/Debug.xcconfig:
--------------------------------------------------------------------------------
1 | #include "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"
2 | #include "Generated.xcconfig"
3 |
--------------------------------------------------------------------------------
/ios/Flutter/Release.xcconfig:
--------------------------------------------------------------------------------
1 | #include "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"
2 | #include "Generated.xcconfig"
3 |
--------------------------------------------------------------------------------
/ios/Podfile:
--------------------------------------------------------------------------------
1 | # Uncomment this line to define a global platform for your project
2 | platform :ios, '10.3'
3 | use_frameworks!
4 |
5 | # CocoaPods analytics sends network stats synchronously affecting flutter build latency.
6 | ENV['COCOAPODS_DISABLE_STATS'] = 'true'
7 |
8 | project 'Runner', {
9 | 'Debug' => :debug,
10 | 'Profile' => :release,
11 | 'Release' => :release,
12 | }
13 |
14 | def parse_KV_file(file, separator='=')
15 | file_abs_path = File.expand_path(file)
16 | if !File.exists? file_abs_path
17 | return [];
18 | end
19 | pods_ary = []
20 | skip_line_start_symbols = ["#", "/"]
21 | File.foreach(file_abs_path) { |line|
22 | next if skip_line_start_symbols.any? { |symbol| line =~ /^\s*#{symbol}/ }
23 | plugin = line.split(pattern=separator)
24 | if plugin.length == 2
25 | podname = plugin[0].strip()
26 | path = plugin[1].strip()
27 | podpath = File.expand_path("#{path}", file_abs_path)
28 | pods_ary.push({:name => podname, :path => podpath});
29 | else
30 | puts "Invalid plugin specification: #{line}"
31 | end
32 | }
33 | return pods_ary
34 | end
35 |
36 | target 'Runner' do
37 | # Prepare symlinks folder. We use symlinks to avoid having Podfile.lock
38 | # referring to absolute paths on developers' machines.
39 | system('rm -rf .symlinks')
40 | system('mkdir -p .symlinks/plugins')
41 |
42 | # Flutter Pods
43 | generated_xcode_build_settings = parse_KV_file('./Flutter/Generated.xcconfig')
44 | if generated_xcode_build_settings.empty?
45 | puts "Generated.xcconfig must exist. If you're running pod install manually, make sure flutter packages get is executed first."
46 | end
47 | generated_xcode_build_settings.map { |p|
48 | if p[:name] == 'FLUTTER_FRAMEWORK_DIR'
49 | symlink = File.join('.symlinks', 'flutter')
50 | File.symlink(File.dirname(p[:path]), symlink)
51 | pod 'Flutter', :path => File.join(symlink, File.basename(p[:path]))
52 | end
53 | }
54 |
55 | # Plugin Pods
56 | plugin_pods = parse_KV_file('../.flutter-plugins')
57 | plugin_pods.map { |p|
58 | symlink = File.join('.symlinks', 'plugins', p[:name])
59 | File.symlink(p[:path], symlink)
60 | pod p[:name], :path => File.join(symlink, 'ios')
61 | }
62 | end
63 |
64 | post_install do |installer|
65 | installer.pods_project.targets.each do |target|
66 | target.build_configurations.each do |config|
67 | config.build_settings['ENABLE_BITCODE'] = 'NO'
68 | end
69 | end
70 | end
71 |
--------------------------------------------------------------------------------
/ios/Podfile.lock:
--------------------------------------------------------------------------------
1 | PODS:
2 | - barcode_scan (0.0.1):
3 | - Flutter
4 | - MTBBarcodeScanner
5 | - Flutter (1.0.0)
6 | - flutter_downloader (0.0.1):
7 | - Flutter
8 | - flutter_drag_scale (0.0.1):
9 | - Flutter
10 | - flutter_image_compress (0.0.1):
11 | - Flutter
12 | - flutter_sound (0.0.1):
13 | - Flutter
14 | - image_crop (0.0.1):
15 | - Flutter
16 | - image_picker (0.0.1):
17 | - Flutter
18 | - MTBBarcodeScanner (5.0.8)
19 | - open_file (0.0.1):
20 | - Flutter
21 | - package_info (0.0.1):
22 | - Flutter
23 | - path_provider (0.0.1):
24 | - Flutter
25 | - shared_preferences (0.0.1):
26 | - Flutter
27 | - simple_permissions (0.0.1):
28 | - Flutter
29 | - wifi (0.0.1):
30 | - Flutter
31 |
32 | DEPENDENCIES:
33 | - barcode_scan (from `.symlinks/plugins/barcode_scan/ios`)
34 | - Flutter (from `.symlinks/flutter/ios`)
35 | - flutter_downloader (from `.symlinks/plugins/flutter_downloader/ios`)
36 | - flutter_drag_scale (from `.symlinks/plugins/flutter_drag_scale/ios`)
37 | - flutter_image_compress (from `.symlinks/plugins/flutter_image_compress/ios`)
38 | - flutter_sound (from `.symlinks/plugins/flutter_sound/ios`)
39 | - image_crop (from `.symlinks/plugins/image_crop/ios`)
40 | - image_picker (from `.symlinks/plugins/image_picker/ios`)
41 | - open_file (from `.symlinks/plugins/open_file/ios`)
42 | - package_info (from `.symlinks/plugins/package_info/ios`)
43 | - path_provider (from `.symlinks/plugins/path_provider/ios`)
44 | - shared_preferences (from `.symlinks/plugins/shared_preferences/ios`)
45 | - simple_permissions (from `.symlinks/plugins/simple_permissions/ios`)
46 | - wifi (from `.symlinks/plugins/wifi/ios`)
47 |
48 | SPEC REPOS:
49 | https://github.com/cocoapods/specs.git:
50 | - MTBBarcodeScanner
51 |
52 | EXTERNAL SOURCES:
53 | barcode_scan:
54 | :path: ".symlinks/plugins/barcode_scan/ios"
55 | Flutter:
56 | :path: ".symlinks/flutter/ios"
57 | flutter_downloader:
58 | :path: ".symlinks/plugins/flutter_downloader/ios"
59 | flutter_drag_scale:
60 | :path: ".symlinks/plugins/flutter_drag_scale/ios"
61 | flutter_image_compress:
62 | :path: ".symlinks/plugins/flutter_image_compress/ios"
63 | flutter_sound:
64 | :path: ".symlinks/plugins/flutter_sound/ios"
65 | image_crop:
66 | :path: ".symlinks/plugins/image_crop/ios"
67 | image_picker:
68 | :path: ".symlinks/plugins/image_picker/ios"
69 | open_file:
70 | :path: ".symlinks/plugins/open_file/ios"
71 | package_info:
72 | :path: ".symlinks/plugins/package_info/ios"
73 | path_provider:
74 | :path: ".symlinks/plugins/path_provider/ios"
75 | shared_preferences:
76 | :path: ".symlinks/plugins/shared_preferences/ios"
77 | simple_permissions:
78 | :path: ".symlinks/plugins/simple_permissions/ios"
79 | wifi:
80 | :path: ".symlinks/plugins/wifi/ios"
81 |
82 | SPEC CHECKSUMS:
83 | barcode_scan: 33f586d02270046fc6559135038b34b5754eaa4f
84 | Flutter: 58dd7d1b27887414a370fcccb9e645c08ffd7a6a
85 | flutter_downloader: 058b9c41564a90500f67f3e432e3524613a7fd83
86 | flutter_drag_scale: 545fd546a1e968bd965883f0511b1c47f049f37d
87 | flutter_image_compress: c29e818cdf6e4276875601a245b6bb18eb444157
88 | flutter_sound: 0e8163ceac1e00eb6d894e2ae4641ba726a2c479
89 | image_crop: e0a67085d3ebf3cf46ca46d61c53a082507b0bc3
90 | image_picker: a211f28b95a560433c00f5cd3773f4710a20404d
91 | MTBBarcodeScanner: 5b97f10a037e2560ff104da413343c5ce9413911
92 | open_file: 02eb5cb6b21264bd3a696876f5afbfb7ca4f4b7d
93 | package_info: 78cabb3c322943c55d39676f4a5bfc748c01d055
94 | path_provider: f96fff6166a8867510d2c25fdcc346327cc4b259
95 | shared_preferences: 1feebfa37bb57264736e16865e7ffae7fc99b523
96 | simple_permissions: a6834dbad830eee541e62be161f96c75121dc4ab
97 | wifi: d7d77c94109e36c4175d845f0a5964eadba71060
98 |
99 | PODFILE CHECKSUM: 2764be9daecd122206af69db42c21f522b736806
100 |
101 | COCOAPODS: 1.6.1
102 |
--------------------------------------------------------------------------------
/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 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | IDEDidComputeMac32BitWarning
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | BuildSystemType
6 | Original
7 |
8 |
9 |
--------------------------------------------------------------------------------
/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
7 | didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
8 | [GeneratedPluginRegistrant registerWithRegistry:self];
9 | // Override point for customization after application launch.
10 | return [super application:application didFinishLaunchingWithOptions:launchOptions];
11 | }
12 |
13 | @end
14 |
--------------------------------------------------------------------------------
/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/Zocoo/flutter-app/978fa83cdbf0cd7d210085ca3d94ae0258903c44/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/Zocoo/flutter-app/978fa83cdbf0cd7d210085ca3d94ae0258903c44/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/Zocoo/flutter-app/978fa83cdbf0cd7d210085ca3d94ae0258903c44/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/Zocoo/flutter-app/978fa83cdbf0cd7d210085ca3d94ae0258903c44/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/Zocoo/flutter-app/978fa83cdbf0cd7d210085ca3d94ae0258903c44/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/Zocoo/flutter-app/978fa83cdbf0cd7d210085ca3d94ae0258903c44/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/Zocoo/flutter-app/978fa83cdbf0cd7d210085ca3d94ae0258903c44/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/Zocoo/flutter-app/978fa83cdbf0cd7d210085ca3d94ae0258903c44/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/Zocoo/flutter-app/978fa83cdbf0cd7d210085ca3d94ae0258903c44/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/Zocoo/flutter-app/978fa83cdbf0cd7d210085ca3d94ae0258903c44/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/Zocoo/flutter-app/978fa83cdbf0cd7d210085ca3d94ae0258903c44/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/Zocoo/flutter-app/978fa83cdbf0cd7d210085ca3d94ae0258903c44/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/Zocoo/flutter-app/978fa83cdbf0cd7d210085ca3d94ae0258903c44/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/Zocoo/flutter-app/978fa83cdbf0cd7d210085ca3d94ae0258903c44/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/Zocoo/flutter-app/978fa83cdbf0cd7d210085ca3d94ae0258903c44/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/Zocoo/flutter-app/978fa83cdbf0cd7d210085ca3d94ae0258903c44/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Zocoo/flutter-app/978fa83cdbf0cd7d210085ca3d94ae0258903c44/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Zocoo/flutter-app/978fa83cdbf0cd7d210085ca3d94ae0258903c44/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 | NSMicrophoneUsageDescription
6 | This sample uses the microphone to record your speech and convert it to text.
7 | UIBackgroundModes
8 |
9 | audio
10 |
11 | NSCameraUsageDescription
12 | Camera permission is required for barcode scanning.
13 | CFBundleDevelopmentRegion
14 | en
15 | CFBundleExecutable
16 | $(EXECUTABLE_NAME)
17 | CFBundleIdentifier
18 | $(PRODUCT_BUNDLE_IDENTIFIER)
19 | CFBundleInfoDictionaryVersion
20 | 6.0
21 | CFBundleName
22 | 遥不可及
23 | CFBundlePackageType
24 | APPL
25 | CFBundleShortVersionString
26 | $(FLUTTER_BUILD_NAME)
27 | CFBundleSignature
28 | ????
29 | CFBundleVersion
30 | $(FLUTTER_BUILD_NUMBER)
31 | LSRequiresIPhoneOS
32 |
33 | UILaunchStoryboardName
34 | LaunchScreen
35 | UIMainStoryboardFile
36 | Main
37 | UISupportedInterfaceOrientations
38 |
39 | UIInterfaceOrientationPortrait
40 | UIInterfaceOrientationLandscapeLeft
41 | UIInterfaceOrientationLandscapeRight
42 |
43 | UISupportedInterfaceOrientations~ipad
44 |
45 | UIInterfaceOrientationPortrait
46 | UIInterfaceOrientationPortraitUpsideDown
47 | UIInterfaceOrientationLandscapeLeft
48 | UIInterfaceOrientationLandscapeRight
49 |
50 | UIViewControllerBasedStatusBarAppearance
51 |
52 |
53 |
54 |
--------------------------------------------------------------------------------
/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.zip:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Zocoo/flutter-app/978fa83cdbf0cd7d210085ca3d94ae0258903c44/lib.zip
--------------------------------------------------------------------------------
/lib/config/all_data.dart:
--------------------------------------------------------------------------------
1 | class AllData{
2 | bool haveNewMessage = false;
3 | }
--------------------------------------------------------------------------------
/lib/config/config.dart:
--------------------------------------------------------------------------------
1 | class Config {
2 | String host = "http://ddz.so-what.cc";
3 | int version = 11;
4 | String ossKey = '6f9UuyAgFQfsfnJaffT3C3aYoJ';
5 | // String host = "http://so-what.nat123.cc";
6 | }
7 |
--------------------------------------------------------------------------------
/lib/main.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 | import 'package:flutter_wyz/page/version/version.dart';
3 |
4 | void main() => runApp(MyApp());
5 |
6 | class MyApp extends StatelessWidget {
7 | @override
8 | Widget build(BuildContext context) {
9 | return MaterialApp(
10 | title: 'Flutter Demo',
11 | theme: ThemeData(
12 | primarySwatch: Colors.blue,
13 | ),
14 | home: Version(),
15 | );
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/lib/page/component/chat/chat_list.dart:
--------------------------------------------------------------------------------
1 | import 'dart:async';
2 | import 'dart:convert';
3 |
4 | import 'package:flutter/material.dart';
5 | import 'package:flutter_wyz/config/config.dart';
6 | import 'package:flutter_wyz/page/component/chat/chat_home.dart';
7 | import 'package:flutter_wyz/page/pojo/chat.dart';
8 | import 'package:flutter_wyz/util/Toast.dart';
9 | import 'package:flutter_wyz/util/local_storage.dart';
10 | import 'package:http/http.dart' as http;
11 |
12 | class ChatList extends StatefulWidget {
13 | @override
14 | _ChatListState createState() => _ChatListState();
15 | }
16 |
17 | class _ChatListState extends State {
18 | Timer _ctXl;
19 |
20 | _ctXlGx() async {
21 | _ctXl = Timer.periodic(new Duration(milliseconds: 5000), (timer) {
22 | checkNew();
23 | });
24 | }
25 |
26 | String _id = null;
27 | List _list = [];
28 |
29 | _ChatListState() {
30 | _initData();
31 | _ctXlGx();
32 | }
33 |
34 | checkNew() async {
35 | String result = await LocalStorage().get("havaNewMsg");
36 | if (result == "1") {
37 | await LocalStorage().set("havaNewMsg", "0");
38 | _initData();
39 | }
40 | }
41 |
42 | _initData() async {
43 | String token = await LocalStorage().get("token");
44 | if (_id == null) {
45 | _id = await LocalStorage().get("userId");
46 | }
47 | String url =
48 | Config().host + "/chat/chatTo?token=" + token + "&userId=" + _id;
49 | print(url);
50 | final http.Response response = await http.get(url);
51 | Utf8Decoder utf8decoder = new Utf8Decoder();
52 | Map data = json.decode(utf8decoder.convert(response.bodyBytes));
53 | // print(data);
54 | var result = data['code'];
55 | if (result == 0) {
56 | List list = [];
57 | List datas = data['data'];
58 | if (data['data'] != null) {
59 | for (int i = 0; i < datas.length; i++) {
60 | list.add(Chat.fromJson(datas[i]));
61 | }
62 | setState(() {
63 | _list = list;
64 | });
65 | }
66 | } else {
67 | Toast.toast(context, data['msg']);
68 | }
69 | }
70 |
71 | Widget _displayOne(index) {
72 | String content = _list[index].content;
73 | if (_list[index].type == 2) {
74 | content = '图片';
75 | }
76 | if (_list[index].type == 3) {
77 | content = '语音';
78 | }
79 | String url = _list[index].userHeadUrl;
80 | if (_id == _list[index].friendId) {
81 | url = _list[index].myHeadUrl;
82 | }
83 | // if (content.length >17) {
84 | // content = content.substring(0, 16);
85 | // }
86 | // if (content.length > 10) {
87 | // content = content.substring(0, 9);
88 | // }
89 | return GestureDetector(
90 | onTap: () {
91 | Navigator.push(context,
92 | new MaterialPageRoute(builder: (BuildContext context) {
93 | print(_id);
94 | return ChatHome(
95 | id: _list[index].friendId == _id
96 | ? _list[index].userId
97 | : _list[index].friendId,
98 | name: _id == _list[index].friendId
99 | ? _list[index].myName
100 | : _list[index].userName);
101 | })).then((result) {
102 | _initData();
103 | });
104 | },
105 | child: Container(
106 | height: 90,
107 | child: Card(
108 | child: Row(
109 | crossAxisAlignment: CrossAxisAlignment.center,
110 | mainAxisAlignment: MainAxisAlignment.start,
111 | children: [
112 | Container(
113 | padding: EdgeInsets.only(left: 20),
114 | child: Container(
115 | width: 66,
116 | child: ClipOval(
117 | child: Image.network(url == null
118 | ? 'https://assets-store-cdn.48lu.cn/assets-store/5002cfc3bf41f67f51b1d979ca2bd637.png'
119 | : url +
120 | "?x-oss-process=image/resize,m_lfit,h_100,w_100"),
121 | ),
122 | ),
123 | ),
124 | Expanded(
125 | child: Container(
126 | padding: EdgeInsets.only(left: 15),
127 | child: Column(
128 | crossAxisAlignment: CrossAxisAlignment.start,
129 | mainAxisAlignment: MainAxisAlignment.spaceEvenly,
130 | children: [
131 | Container(
132 | child: Text(
133 | _id == _list[index].friendId
134 | ? _list[index].myName
135 | : _list[index].userName,
136 | style: TextStyle(fontSize: 22, color: Colors.black),
137 | ),
138 | ),
139 | Container(
140 | child: Text(
141 | content,
142 | overflow: TextOverflow.ellipsis,
143 | style: TextStyle(
144 | fontSize: 16,
145 | color: (_list[index].type == 2 ||
146 | _list[index].type == 3)
147 | ? Colors.blue
148 | : Color.fromARGB(255, 100, 100, 100)),
149 | ),
150 | ),
151 | ],
152 | ),
153 | ),
154 | ),
155 | // Expanded(
156 | // child:
157 | Container(
158 | height: 60,
159 | width: 70,
160 | alignment: Alignment(0.8, -0.8),
161 | child: Text(
162 | DateTime.fromMicrosecondsSinceEpoch(
163 | _list[index].createAt * 1000 * 1000)
164 | .toString()
165 | .substring(0, 19),
166 | maxLines: 3,
167 | overflow: TextOverflow.ellipsis,
168 | style: TextStyle(color: Color.fromARGB(255, 120, 120, 120)),
169 | ),
170 | ),
171 | // ),
172 | ],
173 | ),
174 | ),
175 | ),
176 | );
177 | }
178 |
179 | Future _flush() async {
180 | _list = [];
181 | _initData();
182 | return;
183 | }
184 |
185 | @override
186 | Widget build(BuildContext context) {
187 | return (_list == null || _list.length < 1)
188 | ? Container(
189 | child: Center(
190 | child: Text("暂无数据"),
191 | ),
192 | )
193 | : Container(
194 | child: RefreshIndicator(
195 | child: ListView.builder(
196 | itemCount: _list.length,
197 | itemBuilder: (context, index) {
198 | return _displayOne(index);
199 | },
200 | ),
201 | onRefresh: _flush,
202 | ),
203 | );
204 | }
205 |
206 | @override
207 | void dispose() {
208 | // TODO: implement dispose
209 | print("---------------------------------------------1111");
210 | if (null != _ctXl) {
211 | _ctXl.cancel();
212 | }
213 | super.dispose();
214 | }
215 | }
216 |
--------------------------------------------------------------------------------
/lib/page/component/friend/friend_all.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 |
3 | import 'package:flutter_wyz/page/component/friend/friend_my.dart';
4 | import 'package:flutter_wyz/page/component/friend/my_friend.dart';
5 |
6 | class FriendAll extends StatefulWidget {
7 | FriendAll({Key key, this.id}) : super(key: key);
8 |
9 | final String id;
10 |
11 | @override
12 | _FriendAll createState() => _FriendAll(id);
13 | }
14 |
15 | class _FriendAll extends State {
16 | final List _m = [0, 1];
17 | final List _ms = ['他关注的', '关注他的'];
18 | int _c = 0;
19 | String _id = "";
20 |
21 | _FriendAll(id) {
22 | // setState(() {
23 | _id = id;
24 | // });
25 | }
26 |
27 | @override
28 | Widget build(BuildContext context) {
29 | return Scaffold(
30 | appBar: AppBar(
31 | title: Text('他的好友'),
32 | ),
33 | body: Column(
34 | children: [
35 | Row(
36 | children: [
37 | Expanded(
38 | child: GestureDetector(
39 | onTap: () {
40 | setState(() {
41 | _c = 0;
42 | });
43 | },
44 | child: Container(
45 | color: Color.fromARGB(255, 255, 255, 255),
46 | height: 50,
47 | width: double.infinity,
48 | child: Center(
49 | child: Text(
50 | _ms[0],
51 | style: TextStyle(
52 | fontSize: _c == 0 ? 20 : 18,
53 | color: _c == 0
54 | ? Color.fromARGB(255, 1, 1, 1)
55 | : Color.fromARGB(255, 100, 100, 100),
56 | ),
57 | ),
58 | ),
59 | ),
60 | ),
61 | ),
62 | Expanded(
63 | child: GestureDetector(
64 | onTap: () {
65 | setState(() {
66 | _c = 1;
67 | });
68 | },
69 | child: Container(
70 | color: Color.fromARGB(255, 255, 255, 255),
71 | height: 50,
72 | width: double.infinity,
73 | child: Center(
74 | child: Text(
75 | _ms[1],
76 | style: TextStyle(
77 | fontSize: _c == 1 ? 20 : 18,
78 | color: _c == 1
79 | ? Color.fromARGB(255, 1, 1, 1)
80 | : Color.fromARGB(255, 100, 100, 100),
81 | ),
82 | ),
83 | ),
84 | ),
85 | ),
86 | ),
87 | ],
88 | ),
89 | Row(
90 | children: [
91 | Expanded(
92 | child: Container(
93 | height: 2,
94 | color: _c == 0 ? Colors.blue : Colors.black26,
95 | width: double.infinity,
96 | ),
97 | ),
98 | Expanded(
99 | child: Container(
100 | height: 2,
101 | color: _c == 1 ? Colors.blue : Colors.black26,
102 | width: double.infinity,
103 | ),
104 | ),
105 | ],
106 | ),
107 | Expanded(
108 | child: Container(
109 | color: Color.fromARGB(255, 250, 250, 250),
110 | width: double.infinity,
111 | child: _c == 0 ? MyFriend(id: _id) : FriendMy(id: _id),
112 | ),
113 | )
114 | ],
115 | ),
116 | );
117 | }
118 | }
119 |
--------------------------------------------------------------------------------
/lib/page/component/friend/friend_my.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 | import 'package:flutter_wyz/config/config.dart';
3 | import 'package:flutter_wyz/page/component/friend/friend_info.dart';
4 | import 'package:flutter_wyz/page/pojo/user.dart';
5 | import 'package:flutter_wyz/util/Toast.dart';
6 | import 'package:flutter_wyz/util/local_storage.dart';
7 | import 'package:http/http.dart' as http;
8 | import 'dart:convert';
9 |
10 | class FriendMy extends StatefulWidget {
11 | FriendMy({Key key, this.id}) : super(key: key);
12 |
13 | final String id;
14 |
15 | @override
16 | _FriendMyState createState() => _FriendMyState(id);
17 | }
18 |
19 | class _FriendMyState extends State {
20 | List _list = [];
21 |
22 | String _id = "";
23 |
24 | _FriendMyState(id) {
25 | print(id);
26 | _init(id);
27 | }
28 |
29 | _init(id) async {
30 | if (id == "0" || id == null) {
31 | id = await LocalStorage().get("userId");
32 | }
33 | _id = id;
34 | _initData();
35 | }
36 |
37 | _initData() async {
38 | String token = await LocalStorage().get("token");
39 | String url =
40 | Config().host + "/user/queryFriendMy?id=" + _id + "&token=" + token;
41 | final http.Response response = await http.get(url);
42 | Utf8Decoder utf8decoder = new Utf8Decoder();
43 | Map data = json.decode(utf8decoder.convert(response.bodyBytes));
44 | // print(data);
45 | var result = data['code'];
46 | if (result == 0) {
47 | List list = new List();
48 | List datas = data['data'];
49 | for (int i = 0; i < datas.length; i++) {
50 | list.add(User.fromJson(datas[i]));
51 | }
52 | setState(() {
53 | _list = list;
54 | });
55 | } else {
56 | Toast.toast(context, data['msg']);
57 | }
58 | }
59 |
60 | @override
61 | Widget build(BuildContext context) {
62 | return Container(
63 | child: ListView.builder(
64 | itemCount: _list.length,
65 | itemBuilder: (context, index) {
66 | return _displayOneUser(index);
67 | },
68 | ),
69 | );
70 | }
71 |
72 | Widget _displayOneUser(int index) {
73 | return GestureDetector(
74 | onTap: () {
75 | Navigator.push(context,
76 | new MaterialPageRoute(builder: (BuildContext context) {
77 | return FriendInfo(id: _list[index].id);
78 | })).then((result) {
79 | if (result != null) {
80 | _initData();
81 | }
82 | });
83 | },
84 | child: Container(
85 | padding: EdgeInsets.only(top: 2),
86 | child: Card(
87 | child: Container(
88 | height: 80,
89 | padding: EdgeInsets.only(left: 15),
90 | child: Row(
91 | children: [
92 | Padding(
93 | padding: EdgeInsets.only(left: 1),
94 | child: Container(
95 | child: Container(
96 | height: 60,
97 | width: 60,
98 | child: ClipOval(
99 | child: Image.network(_list[index].headUrl == null
100 | ? 'https://assets-store-cdn.48lu.cn/assets-store/5002cfc3bf41f67f51b1d979ca2bd637.png'
101 | : _list[index].headUrl +
102 | "?x-oss-process=image/resize,m_lfit,h_100,w_100"),
103 | ),
104 | ),
105 | ),
106 | ),
107 | Padding(
108 | padding: EdgeInsets.only(left: 20),
109 | child: Container(
110 | child: Text(_list[index].name),
111 | ),
112 | )
113 | ],
114 | ),
115 | ),
116 | ),
117 | ),
118 | );
119 | }
120 | }
121 |
--------------------------------------------------------------------------------
/lib/page/component/friend/my_friend.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 | import 'package:flutter_wyz/config/config.dart';
3 | import 'package:flutter_wyz/page/component/friend/friend_info.dart';
4 | import 'package:flutter_wyz/page/pojo/user.dart';
5 | import 'package:flutter_wyz/util/Toast.dart';
6 | import 'package:flutter_wyz/util/local_storage.dart';
7 | import 'package:http/http.dart' as http;
8 | import 'dart:convert';
9 |
10 | class MyFriend extends StatefulWidget {
11 | MyFriend({Key key, this.id}) : super(key: key);
12 |
13 | final String id;
14 |
15 | @override
16 | _MyFriendState createState() => _MyFriendState(id);
17 | }
18 |
19 | class _MyFriendState extends State {
20 | List _list = [];
21 |
22 | String _id = "";
23 |
24 | _MyFriendState(id) {
25 | _init(id);
26 | }
27 |
28 | _init(id) async {
29 | if (id == "0" || id == null)
30 | _id = await LocalStorage().get("userId");
31 | else
32 | _id = id;
33 | _initData();
34 | }
35 |
36 | _initData() async {
37 | String token = await LocalStorage().get("token");
38 | String url =
39 | Config().host + "/user/queryMyFriend?id=" + _id + "&token=" + token;
40 | final http.Response response = await http.get(url);
41 | Utf8Decoder utf8decoder = new Utf8Decoder();
42 | Map data = json.decode(utf8decoder.convert(response.bodyBytes));
43 | // print(data);
44 | var result = data['code'];
45 | if (result == 0) {
46 | List list = new List();
47 | List datas = data['data'];
48 | for (int i = 0; i < datas.length; i++) {
49 | list.add(User.fromJson(datas[i]));
50 | }
51 | setState(() {
52 | _list = list;
53 | });
54 | } else {
55 | Toast.toast(context, data['msg']);
56 | }
57 | }
58 |
59 | @override
60 | Widget build(BuildContext context) {
61 | return Container(
62 | child: ListView.builder(
63 | itemCount: _list.length,
64 | itemBuilder: (context, index) {
65 | return _displayOneUser(index);
66 | },
67 | ),
68 | );
69 | }
70 |
71 | Widget _displayOneUser(int index) {
72 | return GestureDetector(
73 | onTap: () {
74 | Navigator.push(context,
75 | new MaterialPageRoute(builder: (BuildContext context) {
76 | return FriendInfo(id: _list[index].id);
77 | })).then((result) {
78 | _initData();
79 | });
80 | },
81 | child: Container(
82 | padding: EdgeInsets.only(top: 2),
83 | child: Card(
84 | child: Container(
85 | height: 80,
86 | padding: EdgeInsets.only(left: 15),
87 | child: Row(
88 | children: [
89 | Padding(
90 | padding: EdgeInsets.only(left: 1),
91 | child: Container(
92 | child: Container(
93 | height: 60,
94 | width: 60,
95 | child: ClipOval(
96 | child: Image.network(_list[index].headUrl == null
97 | ? 'https://assets-store-cdn.48lu.cn/assets-store/5002cfc3bf41f67f51b1d979ca2bd637.png'
98 | : _list[index].headUrl +
99 | "?x-oss-process=image/resize,m_lfit,h_100,w_100"),
100 | ),
101 | ),
102 | ),
103 | ),
104 | Padding(
105 | padding: EdgeInsets.only(left: 20),
106 | child: Container(
107 | child: Text(_list[index].name),
108 | ),
109 | )
110 | ],
111 | ),
112 | ),
113 | ),
114 | ),
115 | );
116 | }
117 | }
118 |
--------------------------------------------------------------------------------
/lib/page/component/list/user_list.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 | import 'package:flutter_wyz/page/pojo/user.dart';
3 |
4 | class UserList extends StatefulWidget {
5 | @override
6 | _UserListState createState() => _UserListState();
7 | }
8 |
9 | class _UserListState extends State {
10 | List _users = [
11 | User('吴易泽1', '10', '杭州'),
12 | User('吴易泽2', '10', '杭州'),
13 | User('吴易泽3', '10', '杭州'),
14 | User('吴易泽4', '10', '杭州'),
15 | User('吴易泽5', '10', '杭州'),
16 | User('吴易泽6', '10', '杭州'),
17 | User('吴易泽7', '10', '杭州'),
18 | User('吴易泽8', '10', '杭州'),
19 | User('吴易泽9', '10', '杭州'),
20 | User('吴易泽10', '10', '杭州')
21 | ];
22 |
23 | @override
24 | Widget build(BuildContext context) {
25 | return Container(
26 | child: Expanded(
27 | child: ListView.builder(
28 | itemCount: _users.length,
29 | itemBuilder: (context, index) {
30 | return _displayUser(index);
31 | },
32 | ),
33 | ),
34 | );
35 | }
36 |
37 | Widget _displayUser(int index) {
38 | return Container(
39 | padding: EdgeInsets.all(2),
40 | child: Card(
41 | child: Container(
42 | height: 80,
43 | padding: EdgeInsets.only(
44 | left: 15,
45 | right: 15,
46 | top: 15,
47 | bottom: 15.0,
48 | ),
49 | child: Row(
50 | mainAxisAlignment: MainAxisAlignment.spaceAround,
51 | children: [
52 | Text(_users[index].name),
53 | Text(_users[index].age),
54 | Text(_users[index].address),
55 | ],
56 | ),
57 | ),
58 | margin: EdgeInsets.only(
59 | top: 0,
60 | left: 8,
61 | right: 8,
62 | bottom: 0,
63 | ),
64 | shape: RoundedRectangleBorder(
65 | borderRadius: BorderRadius.all(
66 | Radius.circular(0),
67 | ),
68 | ),
69 | ),
70 | );
71 | }
72 | }
73 |
--------------------------------------------------------------------------------
/lib/page/component/msg/msg_home.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 | import 'package:flutter_wyz/page/component/msg/msg_list.dart';
3 | import 'package:flutter_wyz/page/component/msg/msg_my.dart';
4 | import 'package:flutter_wyz/page/component/msg/msg_my_care.dart';
5 |
6 | class MsgHome extends StatefulWidget {
7 | @override
8 | _MsgHomeState createState() => _MsgHomeState();
9 | }
10 |
11 | class _MsgHomeState extends State {
12 | final List _m = [0, 1, 2];
13 | final List _ms = ['关注', '所有', '我的'];
14 | int _c = 1;
15 |
16 | getContent(int c) {
17 | if (c == 0) {
18 | return MsgMyCare();
19 | } else if (c == 1) {
20 | return MsgList();
21 | } else if (c == 2) {
22 | return MsgMy();
23 | }
24 | }
25 |
26 | @override
27 | Widget build(BuildContext context) {
28 | return Column(
29 | children: [
30 | Row(
31 | children: [
32 | Expanded(
33 | child: GestureDetector(
34 | onTap: () {
35 | setState(() {
36 | _c = 0;
37 | });
38 | },
39 | child: Container(
40 | color: Color.fromARGB(255, 255, 255, 255),
41 | height: 50,
42 | width: double.infinity,
43 | child: Center(
44 | child: Text(
45 | _ms[0],
46 | style: TextStyle(
47 | fontSize: _c == 0 ? 20 : 18,
48 | color: _c == 0
49 | ? Color.fromARGB(255, 1, 1, 1)
50 | : Color.fromARGB(255, 100, 100, 100),
51 | ),
52 | ),
53 | ),
54 | ),
55 | ),
56 | ),
57 | Expanded(
58 | child: GestureDetector(
59 | onTap: () {
60 | setState(() {
61 | _c = 1;
62 | });
63 | },
64 | child: Container(color: Color.fromARGB(255, 255, 255, 255),
65 | height: 50,
66 | width: double.infinity,
67 | child: Center(
68 | child: Text(
69 | _ms[1],
70 | style: TextStyle(
71 | fontSize: _c == 1 ? 20 : 18,
72 | color: _c == 1
73 | ? Color.fromARGB(255, 1, 1, 1)
74 | : Color.fromARGB(255, 100, 100, 100),
75 | ),
76 | ),
77 | ),
78 | ),
79 | ),
80 | ),
81 | Expanded(
82 | child: GestureDetector(
83 | onTap: () {
84 | setState(() {
85 | _c = 2;
86 | });
87 | },
88 | child: Container(color: Color.fromARGB(255, 255, 255, 255),
89 | height: 50,
90 | width: double.infinity,
91 | child: Center(
92 | child: Text(
93 | _ms[2],
94 | style: TextStyle(
95 | fontSize: _c == 2 ? 20 : 18,
96 | color: _c == 2
97 | ? Color.fromARGB(255, 1, 1, 1)
98 | : Color.fromARGB(255, 100, 100, 100),
99 | ),
100 | ),
101 | ),
102 | ),
103 | ),
104 | ),
105 | ],
106 | ),
107 | Row(
108 | children: [
109 | Expanded(
110 | child: Container(
111 | height: 2,
112 | color: _c == 0 ? Colors.blue : Colors.black26,
113 | width: double.infinity,
114 | ),
115 | ),
116 | Expanded(
117 | child: Container(
118 | height: 2,
119 | color: _c == 1 ? Colors.blue : Colors.black26,
120 | width: double.infinity,
121 | ),
122 | ),
123 | Expanded(
124 | child: Container(
125 | height: 2,
126 | color: _c == 2 ? Colors.blue : Colors.black26,
127 | width: double.infinity,
128 | ),
129 | ),
130 | ],
131 | ),
132 | Expanded(
133 | child: Container(
134 | padding: EdgeInsets.only(top: 3),
135 | color: Color.fromARGB(255, 250, 250, 250),
136 | width: double.infinity,
137 | child: getContent(_c),
138 | ),
139 | )
140 | ],
141 | );
142 | }
143 | }
144 |
--------------------------------------------------------------------------------
/lib/page/component/person/change_autograph/change_autograph.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 | import 'package:flutter_wyz/config/config.dart';
3 | import 'package:flutter_wyz/page/index/index.dart';
4 | import 'package:flutter_wyz/page/pojo/user.dart';
5 | import 'package:flutter_wyz/util/Toast.dart';
6 | import 'package:flutter_wyz/util/local_storage.dart';
7 | import 'package:http/http.dart' as http;
8 | import 'dart:convert';
9 |
10 | class ChangeAutograph extends StatefulWidget {
11 | @override
12 | _ChangeAutographState createState() => _ChangeAutographState();
13 | }
14 |
15 | class _ChangeAutographState extends State {
16 | bool _pwdState = false;
17 | TextEditingController _pwdcontroller1 = new TextEditingController();
18 | String _checkStr;
19 | User user = new User(null, null, null);
20 |
21 | _ChangeAutographState() {
22 | _initData();
23 | }
24 |
25 | void _checkPwd() {
26 | if (_pwdcontroller1.text.isNotEmpty &&
27 | _pwdcontroller1.text.trim().length >= 1) {
28 | _pwdState = true;
29 | } else {
30 | _pwdState = false;
31 | }
32 | }
33 |
34 | _initData() async {
35 | String id = await LocalStorage().get("userId");
36 | String token = await LocalStorage().get("token");
37 | String url = Config().host + "/user?id=" + id + "&token=" + token;
38 | final http.Response response = await http.get(url);
39 | Map data = json.decode(response.body);
40 | print(data);
41 | var result = data['code'];
42 | if (result == 0) {
43 | setState(() {
44 | user = new User.fromJson(data['data']);
45 | _pwdcontroller1.text = user.autograph;
46 | });
47 | } else {
48 | Toast.toast(context, data['msg']);
49 | }
50 | }
51 |
52 | _changeName() async {
53 | String token = await LocalStorage().get("token");
54 | String id = await LocalStorage().get("userId");
55 | String url = Config().host + "/user?token=" + token;
56 | String datax = json.encode({'autograph': _pwdcontroller1.text, 'id': id});
57 | print(datax);
58 | final http.Response response = await http.put(url, body: datax);
59 | Utf8Decoder utf8decoder = new Utf8Decoder();
60 | Map data = json.decode(utf8decoder.convert(response.bodyBytes));
61 | print(data);
62 | var result = data['code'];
63 | if (result == 0) {
64 | await LocalStorage().set("labelId", '3');
65 | Navigator.of(context).pushAndRemoveUntil(
66 | MaterialPageRoute(builder: (context) => Index()),
67 | (route) => route == null);
68 | } else {
69 | Toast.toast(context, data['msg']);
70 | }
71 | }
72 |
73 | @override
74 | Widget build(BuildContext context) {
75 | return Scaffold(
76 | appBar: new AppBar(
77 | title: new Text('修改签名'),
78 | ),
79 | body: new ListView(
80 | children: [
81 | new Column(
82 | mainAxisSize: MainAxisSize.max,
83 | mainAxisAlignment: MainAxisAlignment.start,
84 | children: [
85 | new Padding(
86 | padding: new EdgeInsets.fromLTRB(20.0, 55.0, 20.0, 40.0),
87 | child: new Row(
88 | mainAxisAlignment: MainAxisAlignment.spaceEvenly,
89 | children: [
90 | new Padding(
91 | padding: new EdgeInsets.fromLTRB(0.0, 0.0, 5.0, 0.0),
92 | child: Icon(Icons.calendar_view_day)),
93 | new Expanded(
94 | child: new TextField(
95 | controller: _pwdcontroller1,
96 | decoration: new InputDecoration(
97 | hintText: '请输入签名',
98 | suffixIcon: new IconButton(
99 | icon:
100 | new Icon(Icons.clear, color: Colors.black45),
101 | onPressed: () {
102 | _pwdcontroller1.clear();
103 | },
104 | ),
105 | ),
106 | obscureText: false,
107 | ),
108 | ),
109 | ]),
110 | ),
111 | new Container(
112 | width: 340.0,
113 | child: new Card(
114 | color: Colors.blue,
115 | elevation: 16.0,
116 | child: new FlatButton(
117 | child: new Padding(
118 | padding: new EdgeInsets.all(10.0),
119 | child: new Text(
120 | '修改',
121 | style:
122 | new TextStyle(color: Colors.white, fontSize: 16.0),
123 | ),
124 | ),
125 | onPressed: () {
126 | _checkStr = null;
127 | ;
128 | _checkPwd();
129 | if (!_pwdState) {
130 | _checkStr = '不能为空!';
131 | }
132 |
133 | print(_checkStr);
134 | if (_checkStr == null || _checkStr == "") {
135 | _changeName();
136 | Toast.toast(context, '提交中');
137 | } else {
138 | Toast.toast(context, _checkStr);
139 | }
140 | },
141 | ),
142 | ),
143 | ),
144 | ],
145 | ),
146 | ],
147 | ),
148 | );
149 | }
150 | }
151 |
--------------------------------------------------------------------------------
/lib/page/component/person/change_back_img/change_back_img.dart:
--------------------------------------------------------------------------------
1 | import 'dart:io';
2 | import 'package:flutter_wyz/config/config.dart';
3 | import 'package:flutter_wyz/page/index/index.dart';
4 | import 'package:flutter_wyz/util/Toast.dart';
5 | import 'package:flutter_wyz/util/local_storage.dart';
6 | import 'package:image_crop/image_crop.dart';
7 | import 'package:flutter/material.dart';
8 | import 'package:image_picker/image_picker.dart';
9 | import 'dart:convert';
10 | import 'package:http/http.dart' as http;
11 | class ChangeBackImg extends StatefulWidget {
12 | @override
13 | _ChangeBackImgState createState() => _ChangeBackImgState();
14 | }
15 |
16 | class _ChangeBackImgState extends State {
17 | String _imageUrl = null;
18 | File _image;
19 | final cropKey = GlobalKey();
20 |
21 | Future getImage() async {
22 | var image = await ImagePicker.pickImage(source: ImageSource.gallery);
23 |
24 | setState(() {
25 | _image = image;
26 | });
27 | }
28 |
29 | uploadPic(data1) async {
30 | var url = Config().host + '/file/uploadBase64';
31 | try {
32 | final http.Response response = await http.post(url, body: data1);
33 | var data = json.decode(response.body);
34 | setState(() {
35 | _imageUrl = data['data'];
36 | print(_imageUrl);
37 | _updateHead();
38 | });
39 | } catch (e) {
40 | print("上传文件失败");
41 | }
42 | }
43 |
44 | _updateHead() async {
45 | String token = await LocalStorage().get("token");
46 | String id = await LocalStorage().get("userId");
47 | String url = Config().host + "/user?token=" + token;
48 | String datax = json.encode({'backImg': _imageUrl, 'id': id});
49 | print(datax);
50 | final http.Response response = await http.put(url, body: datax);
51 | Utf8Decoder utf8decoder = new Utf8Decoder();
52 | Map data = json.decode(utf8decoder.convert(response.bodyBytes));
53 | print(data);
54 | var result = data['code'];
55 | if (result == 0) {
56 | await LocalStorage().set("labelId", '3');
57 | Navigator.of(context).pushAndRemoveUntil(
58 | MaterialPageRoute(builder: (context) => Index()),
59 | (route) => route == null);
60 | } else {
61 | Toast.toast(context, data['msg']);
62 | }
63 | }
64 |
65 | pic() async {
66 | final crop = cropKey.currentState;
67 | final scale = crop.scale;
68 | print(scale);
69 | final area = crop.area;
70 | print(area);
71 | if (area == null) {
72 | print("error");
73 | } else {
74 | final sampledFile = await ImageCrop.sampleImage(
75 | file: _image,
76 | preferredWidth: (512 / scale).round(),
77 | preferredHeight: (512 / scale).round(),
78 | );
79 | final croppedFile = await ImageCrop.cropImage(
80 | file: sampledFile,
81 | area: crop.area,
82 | );
83 | setState(() {
84 | _image = croppedFile;
85 | var image_base64 = base64.encode(_image.readAsBytesSync());
86 | uploadPic(image_base64);
87 | });
88 | }
89 | }
90 |
91 | @override
92 | Widget build(BuildContext context) {
93 | return Scaffold(
94 | appBar: AppBar(
95 | title: Text('修改背景'),
96 | ),
97 | body: Column(
98 | children: [
99 | Offstage(
100 | offstage: _imageUrl == null,
101 | child: Column(
102 | children: [
103 | Padding(
104 | padding: EdgeInsets.all(30),
105 | child: Center(
106 | child: Text('头像上传成功!!'),
107 | ),
108 | ),
109 | Padding(
110 | padding: EdgeInsets.all(20),
111 | child:
112 | _imageUrl == null ? Text("") : Image.network(_imageUrl),
113 | ),
114 | ],
115 | ),
116 | ),
117 | Offstage(
118 | offstage: _imageUrl != null,
119 | child: _image == null
120 | ? Center(
121 | child: Padding(
122 | padding: EdgeInsets.only(
123 | right: 0,
124 | left: 0,
125 | bottom: 0,
126 | top: 100,
127 | ),
128 | child: Text('未选择图片'),
129 | ),
130 | )
131 | : Container(
132 | padding: EdgeInsets.all(40),
133 | height: 300,
134 | width: 400,
135 | child: Crop(
136 | key: cropKey,
137 | image: FileImage(_image),
138 | aspectRatio: 4.0 / 2.0,
139 | ),
140 | ),
141 | ),
142 | Offstage(
143 | offstage: !(_imageUrl == null && _image != null),
144 | child: Row(
145 | mainAxisAlignment: MainAxisAlignment.center,
146 | children: [
147 | MaterialButton(
148 | color: Colors.blue,
149 | onPressed: pic,
150 | child: Text(
151 | '裁剪',
152 | style: TextStyle(color: Colors.white),
153 | ),
154 | ),
155 | ],
156 | ),
157 | ),
158 | ],
159 | ),
160 | floatingActionButton: Offstage(
161 | offstage: _image != null,
162 | child: FloatingActionButton(
163 | isExtended: true,
164 | onPressed: getImage,
165 | tooltip: 'Pick Image',
166 | child: Icon(Icons.add_a_photo),
167 | ),
168 | // ),
169 | ),
170 | );
171 | }
172 | }
173 |
--------------------------------------------------------------------------------
/lib/page/component/person/change_head/change_head.dart:
--------------------------------------------------------------------------------
1 | import 'dart:io';
2 | import 'package:exifdart/exifdart.dart';
3 | import 'package:flutter_image_compress/flutter_image_compress.dart';
4 | import 'package:flutter_wyz/config/config.dart';
5 | import 'package:flutter_wyz/page/index/index.dart';
6 | import 'package:flutter_wyz/util/Toast.dart';
7 | import 'package:flutter_wyz/util/local_storage.dart';
8 | import 'package:image_crop/image_crop.dart';
9 | import 'package:flutter/material.dart';
10 | import 'package:image_picker/image_picker.dart';
11 | import 'dart:convert';
12 | import 'package:http/http.dart' as http;
13 | import 'package:path_provider/path_provider.dart';
14 | import 'package:simple_permissions/simple_permissions.dart';
15 |
16 | class ChangeHead extends StatefulWidget {
17 | @override
18 | _ChangeHeadState createState() => _ChangeHeadState();
19 | }
20 |
21 | class _ChangeHeadState extends State {
22 | bool _tjz = false;
23 | String _imageUrl = null;
24 | File _image;
25 | final cropKey = GlobalKey();
26 |
27 | Future getImage() async {
28 | File image = await ImagePicker.pickImage(source: ImageSource.gallery);
29 | int r = await getImageRotateAngular(image.readAsBytesSync());
30 | print(r);
31 | if (r == 0) {
32 | setState(() {
33 | _image = image;
34 | });
35 | } else {
36 | var directory = await getExternalStorageDirectory();
37 | bool res = await SimplePermissions.checkPermission(
38 | Permission.WriteExternalStorage);
39 | if (!res)
40 | await SimplePermissions.requestPermission(
41 | Permission.WriteExternalStorage);
42 | print(res);
43 | print(directory.path + "/tmp.jpg");
44 | image =
45 | await testCompressAndGetFile(image, directory.path + "/tmp.jpg", r);
46 | setState(() {
47 | _image = image;
48 | });
49 | }
50 | }
51 |
52 | Future getImageRotateAngular(List bytes) async {
53 | Map tags = await readExif(MemoryBlobReader(bytes));
54 | if (tags == null || tags['Orientation'] == null) return 0;
55 | var orientation = tags['Orientation']; //获取该照片的拍摄方向
56 | switch (orientation) {
57 | case 3:
58 | return 180;
59 | case 6:
60 | return 90;
61 | case 8:
62 | return -90;
63 | default:
64 | return 0;
65 | }
66 | }
67 |
68 | Future testCompressAndGetFile(
69 | File file, String targetPath, int r) async {
70 | File result = await FlutterImageCompress.compressAndGetFile(
71 | file.absolute.path,
72 | targetPath,
73 | quality: 94,
74 | rotate: r,
75 | );
76 | print(file.lengthSync());
77 | print(result.lengthSync());
78 | return result;
79 | }
80 |
81 | uploadPic(data1) async {
82 | var url = Config().host + '/file/uploadBase64';
83 | try {
84 | final http.Response response = await http.post(url, body: data1);
85 | var data = json.decode(response.body);
86 | setState(() {
87 | _imageUrl = data['data'];
88 | print(_imageUrl);
89 | _updateHead();
90 | });
91 | } catch (e) {
92 | print("上传文件失败");
93 | }
94 | }
95 |
96 | _updateHead() async {
97 | String token = await LocalStorage().get("token");
98 | String id = await LocalStorage().get("userId");
99 | String url = Config().host + "/user?token=" + token;
100 | String datax = json.encode({'headUrl': _imageUrl, 'id': id});
101 | print(datax);
102 | final http.Response response = await http.put(url, body: datax);
103 | Utf8Decoder utf8decoder = new Utf8Decoder();
104 | Map data = json.decode(utf8decoder.convert(response.bodyBytes));
105 | print(data);
106 | var result = data['code'];
107 | if (result == 0) {
108 | await LocalStorage().set("labelId", '3');
109 | Navigator.of(context).pushAndRemoveUntil(
110 | MaterialPageRoute(builder: (context) => Index()),
111 | (route) => route == null);
112 | } else {
113 | Toast.toast(context, data['msg']);
114 | }
115 | }
116 |
117 | pic() async {
118 | if (!_tjz) {
119 | _tjz = true;
120 | final crop = cropKey.currentState;
121 | final scale = crop.scale;
122 | final area = crop.area;
123 | if (area == null) {
124 | print("error");
125 | } else {
126 | final sampledFile = await ImageCrop.sampleImage(
127 | file: _image,
128 | preferredWidth: (512 / crop.scale).round(),
129 | preferredHeight: (512 / crop.scale).round(),
130 | );
131 | final croppedFile = await ImageCrop.cropImage(
132 | file: sampledFile,
133 | area: crop.area,
134 | );
135 | setState(() {
136 | _image = croppedFile;
137 | var image_base64 = base64.encode(_image.readAsBytesSync());
138 | uploadPic(image_base64);
139 | });
140 | }
141 | }
142 | }
143 |
144 | @override
145 | Widget build(BuildContext context) {
146 | return Scaffold(
147 | appBar: AppBar(
148 | title: Text('修改头像'),
149 | ),
150 | body: Column(
151 | children: [
152 | Offstage(
153 | offstage: _imageUrl == null,
154 | child: Column(
155 | children: [
156 | Padding(
157 | padding: EdgeInsets.all(30),
158 | child: Center(
159 | child: Text('头像上传成功!!'),
160 | ),
161 | ),
162 | Padding(
163 | padding: EdgeInsets.all(20),
164 | child:
165 | _imageUrl == null ? Text("") : Image.network(_imageUrl),
166 | ),
167 | ],
168 | ),
169 | ),
170 | Offstage(
171 | offstage: _imageUrl != null,
172 | child: _image == null
173 | ? Center(
174 | child: Padding(
175 | padding: EdgeInsets.only(
176 | right: 0,
177 | left: 0,
178 | bottom: 0,
179 | top: 100,
180 | ),
181 | child: Text('未选择图片'),
182 | ),
183 | )
184 | : Container(
185 | padding: EdgeInsets.all(50),
186 | height: 400,
187 | width: 400,
188 | child: Crop(
189 | key: cropKey,
190 | image: FileImage(_image),
191 | aspectRatio: 1.0 / 1.0,
192 | ),
193 | ),
194 | ),
195 | Offstage(
196 | offstage: !(_imageUrl == null && _image != null),
197 | child: Row(
198 | mainAxisAlignment: MainAxisAlignment.center,
199 | children: [
200 | MaterialButton(
201 | color: Colors.blue,
202 | onPressed: pic,
203 | child: Text(
204 | '裁剪',
205 | style: TextStyle(color: Colors.white),
206 | ),
207 | ),
208 | ],
209 | ),
210 | ),
211 | ],
212 | ),
213 | floatingActionButton: Offstage(
214 | offstage: _image != null,
215 | child: FloatingActionButton(
216 | isExtended: true,
217 | onPressed: getImage,
218 | tooltip: 'Pick Image',
219 | child: Icon(Icons.add_a_photo),
220 | ),
221 | // ),
222 | ),
223 | );
224 | }
225 | }
226 |
--------------------------------------------------------------------------------
/lib/page/component/person/device_hj.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 | import 'dart:async';
3 | import 'dart:convert';
4 | import 'package:http/http.dart' as http;
5 | import 'package:flutter_wyz/config/config.dart';
6 | import 'package:flutter_wyz/util/Toast.dart';
7 | import 'package:flutter_wyz/util/local_storage.dart';
8 |
9 | class DeviceHJ extends StatefulWidget {
10 | DeviceHJ({Key key, this.id, this.name, this.cid}) : super(key: key);
11 | final String id;
12 | final String name;
13 | final String cid;
14 |
15 | @override
16 | _DeviceHJState createState() => _DeviceHJState(id, name, cid);
17 | }
18 |
19 | class _DeviceHJState extends State {
20 | @override
21 | void dispose() {
22 | if (null != _ctXl) _ctXl.cancel();
23 | super.dispose();
24 | }
25 |
26 | _DeviceHJState(id, name, cid) {
27 | _id = id;
28 | _name = name;
29 | _cid = cid;
30 | _readTH();
31 | _initData();
32 | }
33 |
34 | List