├── .gitignore
├── .metadata
├── .vscode
└── settings.json
├── README.md
├── android
├── .gitignore
├── app
│ ├── build.gradle
│ └── src
│ │ ├── debug
│ │ └── AndroidManifest.xml
│ │ ├── main
│ │ ├── AndroidManifest.xml
│ │ ├── kotlin
│ │ │ └── com
│ │ │ │ └── example
│ │ │ │ └── a_red_book
│ │ │ │ └── MainActivity.kt
│ │ └── res
│ │ │ ├── drawable-v21
│ │ │ └── launch_background.xml
│ │ │ ├── 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-night
│ │ │ └── styles.xml
│ │ │ └── values
│ │ │ └── styles.xml
│ │ └── profile
│ │ └── AndroidManifest.xml
├── build.gradle
├── gradle.properties
├── gradle
│ └── wrapper
│ │ └── gradle-wrapper.properties
└── settings.gradle
├── images
├── b2.mp4
├── common_logo.png
├── hey_detail_msg_send.png
├── hey_guide_card_clockin.png
├── hey_guide_card_daily_emotion.png
├── hey_guide_card_shoot.png
├── hey_guide_card_text.png
├── hey_guide_card_voice.png
├── hey_ic_camera_mode.png
├── hey_ic_clockin_mode.png
├── hey_ic_daily_mode.png
├── hey_ic_home_menu.png
├── hey_ic_text_mode.png
├── hey_ic_voice_mode.png
├── im_chat_comment_at_ic_v2.png
├── im_chat_fans_ic_v2.png
├── im_chat_like_collect_ic_v2.png
├── im_chat_push_notification_ic_v2.png
├── im_chat_sys_notification_ic_v2.png
├── login_icon_welcome_phone_v3.png
├── login_icon_welcome_qq_v3.png
├── login_icon_welcome_weibo_v3.png
├── login_icon_welcome_weixin_v3.png
├── matrix_profile_head_bg_default.webp
├── red_heart.webp
├── sharesdk_icon_cover_shot.png
├── sharesdk_icon_download_video.png
├── sharesdk_icon_friend.png
├── sharesdk_icon_not_like.png
├── sharesdk_icon_qq.png
├── sharesdk_icon_qzone.png
├── sharesdk_icon_report.png
├── sharesdk_icon_settings.png
├── sharesdk_icon_video_speed_setting_c.png
├── sharesdk_icon_wechat.png
├── sharesdk_icon_wechat_moment.png
├── xhs_1623045190083.mp4
└── xhs_1623045207024.mp4
├── ios
├── .gitignore
├── Flutter
│ ├── AppFrameworkInfo.plist
│ ├── Debug.xcconfig
│ └── Release.xcconfig
├── Runner.xcodeproj
│ ├── project.pbxproj
│ ├── project.xcworkspace
│ │ ├── contents.xcworkspacedata
│ │ └── xcshareddata
│ │ │ ├── IDEWorkspaceChecks.plist
│ │ │ └── WorkspaceSettings.xcsettings
│ └── xcshareddata
│ │ └── xcschemes
│ │ └── Runner.xcscheme
├── Runner.xcworkspace
│ ├── contents.xcworkspacedata
│ └── xcshareddata
│ │ ├── IDEWorkspaceChecks.plist
│ │ └── WorkspaceSettings.xcsettings
└── Runner
│ ├── AppDelegate.swift
│ ├── 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
│ └── Runner-Bridging-Header.h
├── lib
├── config
│ ├── components
│ │ └── note_item.dart
│ ├── data
│ │ └── recommendList.dart
│ └── requestApi
│ │ ├── request.dart
│ │ ├── requestPost.dart
│ │ └── url.dart
├── main.dart
├── page
│ ├── add_note
│ │ ├── add_note_logic.dart
│ │ ├── add_note_state.dart
│ │ └── add_note_view.dart
│ ├── find
│ │ ├── components
│ │ │ └── drop_down_menu.dart
│ │ ├── find_logic.dart
│ │ ├── find_state.dart
│ │ ├── find_view.dart
│ │ └── recommend
│ │ │ ├── recommend_logic.dart
│ │ │ ├── recommend_state.dart
│ │ │ └── recommend_view.dart
│ ├── follow
│ │ ├── follow_logic.dart
│ │ ├── follow_state.dart
│ │ └── follow_view.dart
│ ├── home
│ │ ├── home_logic.dart
│ │ ├── home_state.dart
│ │ └── home_view.dart
│ ├── index
│ │ ├── index_logic.dart
│ │ ├── index_state.dart
│ │ └── index_view.dart
│ ├── login
│ │ ├── login_logic.dart
│ │ ├── login_state.dart
│ │ └── login_view.dart
│ ├── mycenter
│ │ ├── components
│ │ │ ├── collection.dart
│ │ │ ├── drawerMenu.dart
│ │ │ └── headInfo.dart
│ │ ├── mycenter_logic.dart
│ │ ├── mycenter_state.dart
│ │ └── mycenter_view.dart
│ ├── news
│ │ ├── news_logic.dart
│ │ ├── news_state.dart
│ │ └── news_view.dart
│ ├── record
│ │ ├── components
│ │ │ ├── mianContent.dart
│ │ │ ├── slivContent.dart
│ │ │ └── sliverbar.dart
│ │ ├── record_logic.dart
│ │ ├── record_state.dart
│ │ └── record_view.dart
│ ├── shop
│ │ ├── components
│ │ │ ├── goods.dart
│ │ │ ├── shopHead.dart
│ │ │ ├── shopItem.dart
│ │ │ ├── shopItem1.dart
│ │ │ └── shopSearch.dart
│ │ ├── shop_logic.dart
│ │ ├── shop_state.dart
│ │ └── shop_view.dart
│ ├── splash_page
│ │ ├── splash_page_logic.dart
│ │ ├── splash_page_state.dart
│ │ └── splash_page_view.dart
│ ├── swiper_content
│ │ ├── swiper_content_logic.dart
│ │ ├── swiper_content_state.dart
│ │ └── swiper_content_view.dart
│ └── video
│ │ ├── components
│ │ ├── bottom_comment_widget.dart
│ │ ├── bottom_share_widget.dart
│ │ ├── like_gesture_widget.dart
│ │ └── videoitem.dart
│ │ ├── video_logic.dart
│ │ ├── video_state.dart
│ │ └── video_view.dart
└── routes
│ ├── app_pages.dart
│ └── app_routes.dart
├── pubspec.lock
├── pubspec.yaml
├── test
└── widget_test.dart
└── web
├── favicon.png
├── icons
├── Icon-192.png
└── Icon-512.png
├── index.html
└── manifest.json
/.gitignore:
--------------------------------------------------------------------------------
1 | # Miscellaneous
2 | *.class
3 | *.log
4 | *.pyc
5 | *.swp
6 | .DS_Store
7 | .atom/
8 | .buildlog/
9 | .history
10 | .svn/
11 |
12 | # IntelliJ related
13 | *.iml
14 | *.ipr
15 | *.iws
16 | .idea/
17 |
18 | # The .vscode folder contains launch configuration and tasks you configure in
19 | # VS Code which you may wish to be included in version control, so this line
20 | # is commented out by default.
21 | #.vscode/
22 |
23 | # Flutter/Dart/Pub related
24 | **/doc/api/
25 | **/ios/Flutter/.last_build_id
26 | .dart_tool/
27 | .flutter-plugins
28 | .flutter-plugins-dependencies
29 | .packages
30 | .pub-cache/
31 | .pub/
32 | /build/
33 |
34 | # Web related
35 | lib/generated_plugin_registrant.dart
36 |
37 | # Symbolication related
38 | app.*.symbols
39 |
40 | # Obfuscation related
41 | app.*.map.json
42 |
43 | # Android Studio will place build artifacts here
44 | /android/app/debug
45 | /android/app/profile
46 | /android/app/release
47 |
--------------------------------------------------------------------------------
/.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: 8962f6dc68ec8e2206ac2fa874da4a453856c7d3
8 | channel: stable
9 |
10 | project_type: app
11 |
--------------------------------------------------------------------------------
/.vscode/settings.json:
--------------------------------------------------------------------------------
1 | {
2 | }
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # a_red_book
2 |
3 | Flutter 实战小红书APP
4 | 实现了部分UI,数据是模拟的
5 | 有问题随时咨询我
6 | QQ:824522911
7 | wx:zxj824522911
8 | ## 代码简单,非常适合新手学习
9 |
10 |
11 |
--------------------------------------------------------------------------------
/android/.gitignore:
--------------------------------------------------------------------------------
1 | gradle-wrapper.jar
2 | /.gradle
3 | /captures/
4 | /gradlew
5 | /gradlew.bat
6 | /local.properties
7 | GeneratedPluginRegistrant.java
8 |
9 | # Remember to never publicly share your keystore.
10 | # See https://flutter.dev/docs/deployment/android#reference-the-keystore-from-the-app
11 | key.properties
12 |
--------------------------------------------------------------------------------
/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 30
30 |
31 | sourceSets {
32 | main.java.srcDirs += 'src/main/kotlin'
33 | }
34 |
35 | defaultConfig {
36 | // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
37 | applicationId "com.example.a_red_book"
38 | minSdkVersion 23
39 | targetSdkVersion 30
40 | versionCode flutterVersionCode.toInteger()
41 | versionName flutterVersionName
42 | }
43 |
44 | buildTypes {
45 | release {
46 | // TODO: Add your own signing config for the release build.
47 | // Signing with the debug keys for now, so `flutter run --release` works.
48 | signingConfig signingConfigs.debug
49 | }
50 | }
51 | }
52 |
53 | flutter {
54 | source '../..'
55 | }
56 |
57 | dependencies {
58 | implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
59 | }
60 |
--------------------------------------------------------------------------------
/android/app/src/debug/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
3 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/android/app/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
12 |
19 |
23 |
27 |
32 |
36 |
37 |
38 |
39 |
40 |
41 |
43 |
46 |
47 |
48 |
--------------------------------------------------------------------------------
/android/app/src/main/kotlin/com/example/a_red_book/MainActivity.kt:
--------------------------------------------------------------------------------
1 | package com.example.a_red_book
2 |
3 | import io.flutter.embedding.android.FlutterActivity
4 |
5 | class MainActivity: FlutterActivity() {
6 | }
7 |
--------------------------------------------------------------------------------
/android/app/src/main/res/drawable-v21/launch_background.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
12 |
13 |
--------------------------------------------------------------------------------
/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/zhou-Flutter/flutter_dome/f507a4464f0cc6865e534e0b28c66dc8ec162dcd/android/app/src/main/res/mipmap-hdpi/ic_launcher.png
--------------------------------------------------------------------------------
/android/app/src/main/res/mipmap-mdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zhou-Flutter/flutter_dome/f507a4464f0cc6865e534e0b28c66dc8ec162dcd/android/app/src/main/res/mipmap-mdpi/ic_launcher.png
--------------------------------------------------------------------------------
/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zhou-Flutter/flutter_dome/f507a4464f0cc6865e534e0b28c66dc8ec162dcd/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zhou-Flutter/flutter_dome/f507a4464f0cc6865e534e0b28c66dc8ec162dcd/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zhou-Flutter/flutter_dome/f507a4464f0cc6865e534e0b28c66dc8ec162dcd/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/android/app/src/main/res/values-night/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
9 |
15 |
18 |
19 |
--------------------------------------------------------------------------------
/android/app/src/main/res/values/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
9 |
15 |
18 |
19 |
--------------------------------------------------------------------------------
/android/app/src/profile/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
3 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/android/build.gradle:
--------------------------------------------------------------------------------
1 | buildscript {
2 | ext.kotlin_version = '1.3.50'
3 | repositories {
4 | google()
5 | jcenter()
6 | }
7 |
8 | dependencies {
9 | classpath 'com.android.tools.build:gradle:4.1.0'
10 | classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
11 | }
12 | }
13 |
14 | allprojects {
15 | repositories {
16 | google()
17 | jcenter()
18 | }
19 | }
20 |
21 | rootProject.buildDir = '../build'
22 | subprojects {
23 | project.buildDir = "${rootProject.buildDir}/${project.name}"
24 | }
25 | subprojects {
26 | project.evaluationDependsOn(':app')
27 | }
28 |
29 | task clean(type: Delete) {
30 | delete rootProject.buildDir
31 | }
32 |
--------------------------------------------------------------------------------
/android/gradle.properties:
--------------------------------------------------------------------------------
1 | org.gradle.jvmargs=-Xmx1536M
2 | android.useAndroidX=true
3 | android.enableJetifier=true
4 |
--------------------------------------------------------------------------------
/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-6.7-all.zip
7 |
--------------------------------------------------------------------------------
/android/settings.gradle:
--------------------------------------------------------------------------------
1 | include ':app'
2 |
3 | def localPropertiesFile = new File(rootProject.projectDir, "local.properties")
4 | def properties = new Properties()
5 |
6 | assert localPropertiesFile.exists()
7 | localPropertiesFile.withReader("UTF-8") { reader -> properties.load(reader) }
8 |
9 | def flutterSdkPath = properties.getProperty("flutter.sdk")
10 | assert flutterSdkPath != null, "flutter.sdk not set in local.properties"
11 | apply from: "$flutterSdkPath/packages/flutter_tools/gradle/app_plugin_loader.gradle"
12 |
--------------------------------------------------------------------------------
/images/b2.mp4:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zhou-Flutter/flutter_dome/f507a4464f0cc6865e534e0b28c66dc8ec162dcd/images/b2.mp4
--------------------------------------------------------------------------------
/images/common_logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zhou-Flutter/flutter_dome/f507a4464f0cc6865e534e0b28c66dc8ec162dcd/images/common_logo.png
--------------------------------------------------------------------------------
/images/hey_detail_msg_send.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zhou-Flutter/flutter_dome/f507a4464f0cc6865e534e0b28c66dc8ec162dcd/images/hey_detail_msg_send.png
--------------------------------------------------------------------------------
/images/hey_guide_card_clockin.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zhou-Flutter/flutter_dome/f507a4464f0cc6865e534e0b28c66dc8ec162dcd/images/hey_guide_card_clockin.png
--------------------------------------------------------------------------------
/images/hey_guide_card_daily_emotion.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zhou-Flutter/flutter_dome/f507a4464f0cc6865e534e0b28c66dc8ec162dcd/images/hey_guide_card_daily_emotion.png
--------------------------------------------------------------------------------
/images/hey_guide_card_shoot.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zhou-Flutter/flutter_dome/f507a4464f0cc6865e534e0b28c66dc8ec162dcd/images/hey_guide_card_shoot.png
--------------------------------------------------------------------------------
/images/hey_guide_card_text.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zhou-Flutter/flutter_dome/f507a4464f0cc6865e534e0b28c66dc8ec162dcd/images/hey_guide_card_text.png
--------------------------------------------------------------------------------
/images/hey_guide_card_voice.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zhou-Flutter/flutter_dome/f507a4464f0cc6865e534e0b28c66dc8ec162dcd/images/hey_guide_card_voice.png
--------------------------------------------------------------------------------
/images/hey_ic_camera_mode.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zhou-Flutter/flutter_dome/f507a4464f0cc6865e534e0b28c66dc8ec162dcd/images/hey_ic_camera_mode.png
--------------------------------------------------------------------------------
/images/hey_ic_clockin_mode.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zhou-Flutter/flutter_dome/f507a4464f0cc6865e534e0b28c66dc8ec162dcd/images/hey_ic_clockin_mode.png
--------------------------------------------------------------------------------
/images/hey_ic_daily_mode.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zhou-Flutter/flutter_dome/f507a4464f0cc6865e534e0b28c66dc8ec162dcd/images/hey_ic_daily_mode.png
--------------------------------------------------------------------------------
/images/hey_ic_home_menu.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zhou-Flutter/flutter_dome/f507a4464f0cc6865e534e0b28c66dc8ec162dcd/images/hey_ic_home_menu.png
--------------------------------------------------------------------------------
/images/hey_ic_text_mode.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zhou-Flutter/flutter_dome/f507a4464f0cc6865e534e0b28c66dc8ec162dcd/images/hey_ic_text_mode.png
--------------------------------------------------------------------------------
/images/hey_ic_voice_mode.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zhou-Flutter/flutter_dome/f507a4464f0cc6865e534e0b28c66dc8ec162dcd/images/hey_ic_voice_mode.png
--------------------------------------------------------------------------------
/images/im_chat_comment_at_ic_v2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zhou-Flutter/flutter_dome/f507a4464f0cc6865e534e0b28c66dc8ec162dcd/images/im_chat_comment_at_ic_v2.png
--------------------------------------------------------------------------------
/images/im_chat_fans_ic_v2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zhou-Flutter/flutter_dome/f507a4464f0cc6865e534e0b28c66dc8ec162dcd/images/im_chat_fans_ic_v2.png
--------------------------------------------------------------------------------
/images/im_chat_like_collect_ic_v2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zhou-Flutter/flutter_dome/f507a4464f0cc6865e534e0b28c66dc8ec162dcd/images/im_chat_like_collect_ic_v2.png
--------------------------------------------------------------------------------
/images/im_chat_push_notification_ic_v2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zhou-Flutter/flutter_dome/f507a4464f0cc6865e534e0b28c66dc8ec162dcd/images/im_chat_push_notification_ic_v2.png
--------------------------------------------------------------------------------
/images/im_chat_sys_notification_ic_v2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zhou-Flutter/flutter_dome/f507a4464f0cc6865e534e0b28c66dc8ec162dcd/images/im_chat_sys_notification_ic_v2.png
--------------------------------------------------------------------------------
/images/login_icon_welcome_phone_v3.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zhou-Flutter/flutter_dome/f507a4464f0cc6865e534e0b28c66dc8ec162dcd/images/login_icon_welcome_phone_v3.png
--------------------------------------------------------------------------------
/images/login_icon_welcome_qq_v3.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zhou-Flutter/flutter_dome/f507a4464f0cc6865e534e0b28c66dc8ec162dcd/images/login_icon_welcome_qq_v3.png
--------------------------------------------------------------------------------
/images/login_icon_welcome_weibo_v3.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zhou-Flutter/flutter_dome/f507a4464f0cc6865e534e0b28c66dc8ec162dcd/images/login_icon_welcome_weibo_v3.png
--------------------------------------------------------------------------------
/images/login_icon_welcome_weixin_v3.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zhou-Flutter/flutter_dome/f507a4464f0cc6865e534e0b28c66dc8ec162dcd/images/login_icon_welcome_weixin_v3.png
--------------------------------------------------------------------------------
/images/matrix_profile_head_bg_default.webp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zhou-Flutter/flutter_dome/f507a4464f0cc6865e534e0b28c66dc8ec162dcd/images/matrix_profile_head_bg_default.webp
--------------------------------------------------------------------------------
/images/red_heart.webp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zhou-Flutter/flutter_dome/f507a4464f0cc6865e534e0b28c66dc8ec162dcd/images/red_heart.webp
--------------------------------------------------------------------------------
/images/sharesdk_icon_cover_shot.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zhou-Flutter/flutter_dome/f507a4464f0cc6865e534e0b28c66dc8ec162dcd/images/sharesdk_icon_cover_shot.png
--------------------------------------------------------------------------------
/images/sharesdk_icon_download_video.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zhou-Flutter/flutter_dome/f507a4464f0cc6865e534e0b28c66dc8ec162dcd/images/sharesdk_icon_download_video.png
--------------------------------------------------------------------------------
/images/sharesdk_icon_friend.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zhou-Flutter/flutter_dome/f507a4464f0cc6865e534e0b28c66dc8ec162dcd/images/sharesdk_icon_friend.png
--------------------------------------------------------------------------------
/images/sharesdk_icon_not_like.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zhou-Flutter/flutter_dome/f507a4464f0cc6865e534e0b28c66dc8ec162dcd/images/sharesdk_icon_not_like.png
--------------------------------------------------------------------------------
/images/sharesdk_icon_qq.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zhou-Flutter/flutter_dome/f507a4464f0cc6865e534e0b28c66dc8ec162dcd/images/sharesdk_icon_qq.png
--------------------------------------------------------------------------------
/images/sharesdk_icon_qzone.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zhou-Flutter/flutter_dome/f507a4464f0cc6865e534e0b28c66dc8ec162dcd/images/sharesdk_icon_qzone.png
--------------------------------------------------------------------------------
/images/sharesdk_icon_report.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zhou-Flutter/flutter_dome/f507a4464f0cc6865e534e0b28c66dc8ec162dcd/images/sharesdk_icon_report.png
--------------------------------------------------------------------------------
/images/sharesdk_icon_settings.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zhou-Flutter/flutter_dome/f507a4464f0cc6865e534e0b28c66dc8ec162dcd/images/sharesdk_icon_settings.png
--------------------------------------------------------------------------------
/images/sharesdk_icon_video_speed_setting_c.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zhou-Flutter/flutter_dome/f507a4464f0cc6865e534e0b28c66dc8ec162dcd/images/sharesdk_icon_video_speed_setting_c.png
--------------------------------------------------------------------------------
/images/sharesdk_icon_wechat.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zhou-Flutter/flutter_dome/f507a4464f0cc6865e534e0b28c66dc8ec162dcd/images/sharesdk_icon_wechat.png
--------------------------------------------------------------------------------
/images/sharesdk_icon_wechat_moment.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zhou-Flutter/flutter_dome/f507a4464f0cc6865e534e0b28c66dc8ec162dcd/images/sharesdk_icon_wechat_moment.png
--------------------------------------------------------------------------------
/images/xhs_1623045190083.mp4:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zhou-Flutter/flutter_dome/f507a4464f0cc6865e534e0b28c66dc8ec162dcd/images/xhs_1623045190083.mp4
--------------------------------------------------------------------------------
/images/xhs_1623045207024.mp4:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zhou-Flutter/flutter_dome/f507a4464f0cc6865e534e0b28c66dc8ec162dcd/images/xhs_1623045207024.mp4
--------------------------------------------------------------------------------
/ios/.gitignore:
--------------------------------------------------------------------------------
1 | *.mode1v3
2 | *.mode2v3
3 | *.moved-aside
4 | *.pbxuser
5 | *.perspectivev3
6 | **/*sync/
7 | .sconsign.dblite
8 | .tags*
9 | **/.vagrant/
10 | **/DerivedData/
11 | Icon?
12 | **/Pods/
13 | **/.symlinks/
14 | profile
15 | xcuserdata
16 | **/.generated/
17 | Flutter/App.framework
18 | Flutter/Flutter.framework
19 | Flutter/Flutter.podspec
20 | Flutter/Generated.xcconfig
21 | Flutter/app.flx
22 | Flutter/app.zip
23 | Flutter/flutter_assets/
24 | Flutter/flutter_export_environment.sh
25 | ServiceDefinitions.json
26 | Runner/GeneratedPluginRegistrant.*
27 |
28 | # Exceptions to above rules.
29 | !default.mode1v3
30 | !default.mode2v3
31 | !default.pbxuser
32 | !default.perspectivev3
33 |
--------------------------------------------------------------------------------
/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 | MinimumOSVersion
24 | 8.0
25 |
26 |
27 |
--------------------------------------------------------------------------------
/ios/Flutter/Debug.xcconfig:
--------------------------------------------------------------------------------
1 | #include "Generated.xcconfig"
2 |
--------------------------------------------------------------------------------
/ios/Flutter/Release.xcconfig:
--------------------------------------------------------------------------------
1 | #include "Generated.xcconfig"
2 |
--------------------------------------------------------------------------------
/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | IDEDidComputeMac32BitWarning
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | PreviewsEnabled
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme:
--------------------------------------------------------------------------------
1 |
2 |
5 |
8 |
9 |
15 |
21 |
22 |
23 |
24 |
25 |
30 |
31 |
32 |
33 |
39 |
40 |
41 |
42 |
43 |
44 |
54 |
56 |
62 |
63 |
64 |
65 |
66 |
67 |
73 |
75 |
81 |
82 |
83 |
84 |
86 |
87 |
90 |
91 |
92 |
--------------------------------------------------------------------------------
/ios/Runner.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/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 | PreviewsEnabled
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/ios/Runner/AppDelegate.swift:
--------------------------------------------------------------------------------
1 | import UIKit
2 | import Flutter
3 |
4 | @UIApplicationMain
5 | @objc class AppDelegate: FlutterAppDelegate {
6 | override func application(
7 | _ application: UIApplication,
8 | didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?
9 | ) -> Bool {
10 | GeneratedPluginRegistrant.register(with: self)
11 | return super.application(application, didFinishLaunchingWithOptions: launchOptions)
12 | }
13 | }
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/zhou-Flutter/flutter_dome/f507a4464f0cc6865e534e0b28c66dc8ec162dcd/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/zhou-Flutter/flutter_dome/f507a4464f0cc6865e534e0b28c66dc8ec162dcd/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/zhou-Flutter/flutter_dome/f507a4464f0cc6865e534e0b28c66dc8ec162dcd/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/zhou-Flutter/flutter_dome/f507a4464f0cc6865e534e0b28c66dc8ec162dcd/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/zhou-Flutter/flutter_dome/f507a4464f0cc6865e534e0b28c66dc8ec162dcd/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/zhou-Flutter/flutter_dome/f507a4464f0cc6865e534e0b28c66dc8ec162dcd/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/zhou-Flutter/flutter_dome/f507a4464f0cc6865e534e0b28c66dc8ec162dcd/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/zhou-Flutter/flutter_dome/f507a4464f0cc6865e534e0b28c66dc8ec162dcd/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/zhou-Flutter/flutter_dome/f507a4464f0cc6865e534e0b28c66dc8ec162dcd/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/zhou-Flutter/flutter_dome/f507a4464f0cc6865e534e0b28c66dc8ec162dcd/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/zhou-Flutter/flutter_dome/f507a4464f0cc6865e534e0b28c66dc8ec162dcd/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/zhou-Flutter/flutter_dome/f507a4464f0cc6865e534e0b28c66dc8ec162dcd/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/zhou-Flutter/flutter_dome/f507a4464f0cc6865e534e0b28c66dc8ec162dcd/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/zhou-Flutter/flutter_dome/f507a4464f0cc6865e534e0b28c66dc8ec162dcd/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/zhou-Flutter/flutter_dome/f507a4464f0cc6865e534e0b28c66dc8ec162dcd/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/zhou-Flutter/flutter_dome/f507a4464f0cc6865e534e0b28c66dc8ec162dcd/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zhou-Flutter/flutter_dome/f507a4464f0cc6865e534e0b28c66dc8ec162dcd/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zhou-Flutter/flutter_dome/f507a4464f0cc6865e534e0b28c66dc8ec162dcd/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 | $(DEVELOPMENT_LANGUAGE)
7 | CFBundleExecutable
8 | $(EXECUTABLE_NAME)
9 | CFBundleIdentifier
10 | $(PRODUCT_BUNDLE_IDENTIFIER)
11 | CFBundleInfoDictionaryVersion
12 | 6.0
13 | CFBundleName
14 | a_red_book
15 | CFBundlePackageType
16 | APPL
17 | CFBundleShortVersionString
18 | $(FLUTTER_BUILD_NAME)
19 | CFBundleSignature
20 | ????
21 | CFBundleVersion
22 | $(FLUTTER_BUILD_NUMBER)
23 | LSRequiresIPhoneOS
24 |
25 | UILaunchStoryboardName
26 | LaunchScreen
27 | UIMainStoryboardFile
28 | Main
29 | UISupportedInterfaceOrientations
30 |
31 | UIInterfaceOrientationPortrait
32 | UIInterfaceOrientationLandscapeLeft
33 | UIInterfaceOrientationLandscapeRight
34 |
35 | UISupportedInterfaceOrientations~ipad
36 |
37 | UIInterfaceOrientationPortrait
38 | UIInterfaceOrientationPortraitUpsideDown
39 | UIInterfaceOrientationLandscapeLeft
40 | UIInterfaceOrientationLandscapeRight
41 |
42 | UIViewControllerBasedStatusBarAppearance
43 |
44 |
45 |
46 |
--------------------------------------------------------------------------------
/ios/Runner/Runner-Bridging-Header.h:
--------------------------------------------------------------------------------
1 | #import "GeneratedPluginRegistrant.h"
2 |
--------------------------------------------------------------------------------
/lib/config/components/note_item.dart:
--------------------------------------------------------------------------------
1 | /*
2 | * @Author: zxj
3 | * @Date: 2021-06-27 18:14:24
4 | * @LastEditTime: 2021-06-27 18:22:26
5 | * @Description:
6 | */
7 |
8 | import 'package:flutter/material.dart';
9 | import 'package:flutter_screenutil/flutter_screenutil.dart';
10 | import 'package:like_button/like_button.dart';
11 | import 'package:transparent_image/transparent_image.dart';
12 |
13 | class NoteItem extends StatelessWidget {
14 | Map item;
15 | Function onTap;
16 | NoteItem({this.item, this.onTap});
17 |
18 | @override
19 | Widget build(BuildContext context) {
20 | return InkWell(
21 | onTap: onTap,
22 | child: Container(
23 | width: ScreenUtil().setWidth(367),
24 | margin: EdgeInsets.all(2),
25 | decoration: BoxDecoration(
26 | color: Colors.white,
27 | borderRadius: BorderRadius.all(Radius.circular(5))),
28 | child: Column(
29 | children: [
30 | Container(
31 | child: Stack(
32 | children: [
33 | Container(
34 | height: ScreenUtil().setHeight(item["imgHight"]),
35 | width: ScreenUtil().setWidth(item["imgWidth"]),
36 | child: ClipRRect(
37 | borderRadius: BorderRadius.only(
38 | topLeft: Radius.circular(6),
39 | topRight: Radius.circular(6)),
40 | child: FadeInImage.memoryNetwork(
41 | placeholder: kTransparentImage,
42 | fit: BoxFit.cover,
43 | image: item["coverImg"],
44 | ),
45 | ),
46 | ),
47 | item["ismp4"] != true
48 | ? Text("")
49 | : Positioned(
50 | top: 0,
51 | right: 0,
52 | child: Container(
53 | margin: EdgeInsets.all(10),
54 | decoration: BoxDecoration(
55 | borderRadius: BorderRadius.circular(15),
56 | color: Colors.black26,
57 | ),
58 | child: Icon(
59 | Icons.play_arrow,
60 | color: Colors.white,
61 | size: 20,
62 | ),
63 | ),
64 | ),
65 | ],
66 | ),
67 | ),
68 | Container(
69 | padding: EdgeInsets.all(5),
70 | child: Text(
71 | item["name"],
72 | style: TextStyle(
73 | fontSize: ScreenUtil().setSp(28),
74 | fontWeight: FontWeight.bold),
75 | ),
76 | ),
77 | Container(
78 | padding: EdgeInsets.all(5),
79 | child: Row(
80 | children: [
81 | Container(
82 | margin: EdgeInsets.only(right: 5),
83 | height: ScreenUtil().setHeight(40),
84 | width: ScreenUtil().setWidth(40),
85 | child: CircleAvatar(
86 | backgroundImage: NetworkImage(
87 | "https://pic4.zhimg.com/v2-1fb998118e443cf3539def7aaee7da71_is.jpg"),
88 | ),
89 | ),
90 | Text(
91 | "${item["write"]}",
92 | style: TextStyle(
93 | color: Colors.black54,
94 | fontSize: ScreenUtil().setSp(20),
95 | ),
96 | ),
97 | Spacer(),
98 | LikeButton(
99 | likeCount: int.parse(item["like"]),
100 | likeCountPadding: EdgeInsets.only(left: 0),
101 | likeBuilder: (bool) {
102 | if (bool) {
103 | return Icon(
104 | Icons.favorite,
105 | color: Colors.red,
106 | size: 22,
107 | );
108 | } else {
109 | return Icon(
110 | Icons.favorite_border,
111 | color: Colors.black26,
112 | size: 22,
113 | );
114 | }
115 | },
116 | ),
117 | ],
118 | ),
119 | )
120 | ],
121 | ),
122 | ),
123 | );
124 | }
125 | }
126 |
--------------------------------------------------------------------------------
/lib/config/data/recommendList.dart:
--------------------------------------------------------------------------------
1 | /*
2 | * @Author: zxj
3 | * @Date: 2021-06-03 14:53:12
4 | * @LastEditTime: 2021-06-28 20:14:37
5 | * @Description: 推荐页数据
6 | */
7 | List listitem = [
8 | {
9 | "id": "1",
10 | "name": "吉他弹奏的集中方法兼续的日后的",
11 | "write": "CG轻熟穿搭",
12 | "writeImg": "",
13 | "coverImg": "https://img01.jituwang.com/170722/256853-1FH210243772.jpg",
14 | "imgHight": 528,
15 | "imgWidth": 367,
16 | "ismp4": true,
17 | "like": "123"
18 | },
19 | {
20 | "id": "2",
21 | "name": "夏季皮肤偏黑的男生怎么穿?",
22 | "write": "CG轻熟穿搭",
23 | "writeImg": "",
24 | "coverImg": "https://img01.jituwang.com/170722/256853-1FH2102K755.jpg",
25 | "imgHight": 367,
26 | "imgWidth": 367,
27 | "ismp4": true,
28 | "like": "236"
29 | },
30 | {
31 | "id": "3",
32 | "name": "夏季皮肤偏黑的男生怎么穿?",
33 | "write": "CG轻熟穿搭",
34 | "writeImg": "",
35 | "coverImg": "https://img01.jituwang.com/180918/256599-1P91PSG789.jpg",
36 | "imgHight": 528,
37 | "imgWidth": 367,
38 | "ismp4": true,
39 | "like": "236"
40 | },
41 | {
42 | "id": "4",
43 | "name": "夏季皮肤偏黑的男生怎么穿?",
44 | "write": "CG轻熟穿搭",
45 | "writeImg": "",
46 | "coverImg": "https://img01.jituwang.com/170722/256853-1FH210243772.jpg",
47 | "imgHight": 528,
48 | "imgWidth": 367,
49 | "ismp4": false,
50 | "like": "236"
51 | },
52 | {
53 | "id": "5",
54 | "name": "夏季皮肤偏黑的男生怎么穿?",
55 | "write": "CG轻熟穿搭",
56 | "writeImg": "",
57 | "coverImg": "https://img01.jituwang.com/170722/256853-1FH210243772.jpg",
58 | "imgHight": 528,
59 | "imgWidth": 367,
60 | "ismp4": true,
61 | "like": "236"
62 | },
63 | {
64 | "id": "6",
65 | "name": "夏季皮肤偏黑的男生怎么穿?",
66 | "write": "CG轻熟穿搭",
67 | "writeImg": "",
68 | "coverImg": "https://img01.jituwang.com/170722/256853-1FH210243772.jpg",
69 | "imgHight": 528,
70 | "imgWidth": 367,
71 | "ismp4": true,
72 | "like": "236"
73 | },
74 | {
75 | "id": "7",
76 | "name": "夏季皮肤偏黑的男生怎么穿?",
77 | "write": "CG轻熟穿搭",
78 | "writeImg": "",
79 | "coverImg": "https://img01.jituwang.com/170722/256853-1FH210243772.jpg",
80 | "imgHight": 528,
81 | "imgWidth": 367,
82 | "ismp4": true,
83 | "like": "236"
84 | },
85 | {
86 | "id": "8",
87 | "name": "夏季皮肤偏黑的男生怎么穿?",
88 | "write": "CG轻熟穿搭",
89 | "writeImg": "",
90 | "coverImg": "https://img01.jituwang.com/170722/256853-1FH210243772.jpg",
91 | "imgHight": 528,
92 | "imgWidth": 367,
93 | "ismp4": true,
94 | "like": "236"
95 | },
96 | {
97 | "id": "9",
98 | "name": "夏季皮肤偏黑的男生怎么穿?",
99 | "write": "CG轻熟穿搭",
100 | "writeImg": "",
101 | "coverImg": "https://img01.jituwang.com/170722/256853-1FH210243772.jpg",
102 | "imgHight": 528,
103 | "imgWidth": 367,
104 | "ismp4": true,
105 | "like": "236"
106 | },
107 | {
108 | "id": "10",
109 | "name": "夏季皮肤偏黑的男生怎么穿?",
110 | "write": "CG轻熟穿搭",
111 | "writeImg": "",
112 | "coverImg": "https://img01.jituwang.com/170722/256853-1FH210243772.jpg",
113 | "imgHight": 528,
114 | "imgWidth": 367,
115 | "ismp4": true,
116 | "like": "236"
117 | },
118 | ];
119 |
120 | List listitem2 = [
121 | {
122 | "id": "1",
123 | "name": "夏季皮肤偏黑的男生怎么穿?",
124 | "write": "CG轻熟穿搭",
125 | "writeImg": "",
126 | "coverImg": "https://img01.jituwang.com/170722/256853-1FH210243772.jpg",
127 | "imgHight": 528,
128 | "imgWidth": 367,
129 | "ismp4": true,
130 | "like": "123"
131 | },
132 | {
133 | "id": "2",
134 | "name": "夏季皮肤偏黑的男生怎么穿?",
135 | "write": "CG轻熟穿搭",
136 | "writeImg": "",
137 | "coverImg": "https://img01.jituwang.com/170722/256853-1FH2102K755.jpg",
138 | "imgHight": 367,
139 | "imgWidth": 367,
140 | "ismp4": true,
141 | "like": "236"
142 | },
143 | {
144 | "id": "3",
145 | "name": "夏季皮肤偏黑的男生怎么穿?",
146 | "write": "CG轻熟穿搭",
147 | "writeImg": "",
148 | "coverImg": "https://img01.jituwang.com/180918/256599-1P91PSG789.jpg",
149 | "imgHight": 528,
150 | "imgWidth": 367,
151 | "ismp4": true,
152 | "like": "236"
153 | },
154 | {
155 | "id": "4",
156 | "name": "夏季皮肤偏黑的男生怎么穿?",
157 | "write": "CG轻熟穿搭",
158 | "writeImg": "",
159 | "coverImg": "https://img01.jituwang.com/170722/256853-1FH210243772.jpg",
160 | "imgHight": 528,
161 | "imgWidth": 367,
162 | "ismp4": false,
163 | "like": "236"
164 | },
165 | {
166 | "id": "5",
167 | "name": "夏季皮肤偏黑的男生怎么穿?",
168 | "write": "CG轻熟穿搭",
169 | "writeImg": "",
170 | "coverImg": "https://img01.jituwang.com/170722/256853-1FH210243772.jpg",
171 | "imgHight": 528,
172 | "imgWidth": 367,
173 | "ismp4": true,
174 | "like": "236"
175 | },
176 | {
177 | "id": "6",
178 | "name": "夏季皮肤偏黑的男生怎么穿?",
179 | "write": "CG轻熟穿搭",
180 | "writeImg": "",
181 | "coverImg": "https://img01.jituwang.com/170722/256853-1FH210243772.jpg",
182 | "imgHight": 528,
183 | "imgWidth": 367,
184 | "ismp4": true,
185 | "like": "236"
186 | },
187 | {
188 | "id": "7",
189 | "name": "夏季皮肤偏黑的男生怎么穿?",
190 | "write": "CG轻熟穿搭",
191 | "writeImg": "",
192 | "coverImg": "https://img01.jituwang.com/170722/256853-1FH210243772.jpg",
193 | "imgHight": 528,
194 | "imgWidth": 367,
195 | "ismp4": true,
196 | "like": "236"
197 | },
198 | {
199 | "id": "8",
200 | "name": "夏季皮肤偏黑的男生怎么穿?",
201 | "write": "CG轻熟穿搭",
202 | "writeImg": "",
203 | "coverImg": "https://img01.jituwang.com/170722/256853-1FH210243772.jpg",
204 | "imgHight": 528,
205 | "imgWidth": 367,
206 | "ismp4": true,
207 | "like": "236"
208 | },
209 | ];
210 |
--------------------------------------------------------------------------------
/lib/config/requestApi/request.dart:
--------------------------------------------------------------------------------
1 | /*
2 | * @Author: zxj
3 | * @Date: 2021-04-23 16:15:32
4 | * @LastEditTime: 2021-05-28 16:45:51
5 | * @Description:
6 | */
7 | import 'dart:convert';
8 |
9 | import 'package:dio/dio.dart';
10 | import 'package:flutter_easyloading/flutter_easyloading.dart';
11 | import 'package:fluttertoast/fluttertoast.dart';
12 | import 'url.dart';
13 |
14 | Future request(ur, {formData}) async {
15 | try {
16 | EasyLoading.show(maskType: EasyLoadingMaskType.clear);
17 | print("开始获取数据。。。");
18 | Response response;
19 | Dio dio = new Dio();
20 | Options options =
21 | Options(headers: {'content-type': 'application/x-www-form-urlencoded'});
22 | if (formData == null) {
23 | response = await dio.get(apiPath[ur]);
24 | } else {
25 | response = await dio.get(
26 | apiPath[ur],
27 | queryParameters: formData,
28 | options: options,
29 | );
30 | }
31 | if (response.statusCode == 200) {
32 | EasyLoading.dismiss();
33 | var list = json.decode(response.toString());
34 | return list;
35 | } else {
36 | EasyLoading.dismiss();
37 | Fluttertoast.showToast(
38 | msg: "网络链接异常",
39 | );
40 | }
41 | } catch (e) {
42 | EasyLoading.dismiss();
43 | Fluttertoast.showToast(
44 | msg: "网络链接异常",
45 | );
46 | }
47 | }
48 |
--------------------------------------------------------------------------------
/lib/config/requestApi/requestPost.dart:
--------------------------------------------------------------------------------
1 | /*
2 | * @Author: zxj
3 | * @Date: 2021-05-27 09:13:25
4 | * @LastEditTime: 2021-05-27 09:15:13
5 | * @Description: 适配服务端的POst请求
6 | */
7 | import 'dart:convert';
8 |
9 | import 'package:dio/dio.dart';
10 | import 'package:flutter_easyloading/flutter_easyloading.dart';
11 | import 'package:fluttertoast/fluttertoast.dart';
12 | import 'url.dart';
13 |
14 | Future requestPost(ur, {formData}) async {
15 | try {
16 | EasyLoading.show(maskType: EasyLoadingMaskType.clear);
17 | print("开始获取数据。。。");
18 | Response response;
19 | Dio dio = new Dio();
20 | Options options =
21 | Options(headers: {'content-type': 'application/x-www-form-urlencoded'});
22 |
23 | response = await dio.post(
24 | apiPath[ur],
25 | data: formData,
26 | options: options,
27 | );
28 |
29 | if (response.statusCode == 200) {
30 | var list = json.decode(response.toString());
31 | EasyLoading.dismiss();
32 | return list;
33 | } else {
34 | EasyLoading.dismiss();
35 | Fluttertoast.showToast(
36 | msg: "网络链接异常",
37 | );
38 | }
39 | } catch (e) {
40 | EasyLoading.dismiss();
41 | Fluttertoast.showToast(
42 | msg: "网络链接异常",
43 | );
44 | }
45 | }
46 |
--------------------------------------------------------------------------------
/lib/config/requestApi/url.dart:
--------------------------------------------------------------------------------
1 | /*
2 | * @Author: zxj
3 | * @Date: 2021-04-23 16:15:32
4 | * @LastEditTime: 2021-05-31 15:34:39
5 | * @Description:
6 | */
7 | const serviceurl = "http://192.168.1.107:8080/yjsy/f/api/"; //测试地址
8 |
9 | // const serviceurl = "http://192.168.43.133:8080/yjsy/f/api/"; //测试手机地址
10 |
11 | // const serviceurl = "http://192.168.0.147:8080/yjsy/f/api/"; //测试教室地址
12 |
13 | const apiPath = {
14 | "login": serviceurl + "app/login", //登录
15 | };
16 |
--------------------------------------------------------------------------------
/lib/main.dart:
--------------------------------------------------------------------------------
1 | /*
2 | * @Author: zxj
3 | * @Date: 2021-05-31 13:41:44
4 | * @LastEditTime: 2021-06-24 10:59:52
5 | * @Description:
6 | */
7 | /*
8 | * _oo0oo_
9 | * o8888888o
10 | * 88" . "88
11 | * (| -_- |)
12 | * 0\ = /0
13 | * ___/`---'\___
14 | * .' \\| |// '.
15 | * / \\||| : |||// \
16 | * / _||||| -:- |||||- \
17 | * | | \\\ - /// | |
18 | * | \_| ''\---/'' |_/ |
19 | * \ .-\__ '-' ___/-. /
20 | * ___'. .' /--.--\ `. .'___
21 | * ."" '< `.___\_<|>_/___.' >' "".
22 | * | | : `- \`.;`\ _ /`;.`/ - ` : | |
23 | * \ \ `_. \_ __\ /__ _/ .-` / /
24 | * =====`-.____`.___ \_____/___.-`___.-'=====
25 | * `=---='
26 | *
27 | *
28 | * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
29 | *
30 | * 佛祖保佑 永无BUG
31 | */
32 |
33 | import 'dart:async';
34 |
35 | import 'package:a_red_book/page/splash_page/splash_page_state.dart';
36 | import 'package:a_red_book/page/splash_page/splash_page_view.dart';
37 | import 'package:a_red_book/routes/app_pages.dart';
38 | import 'package:flutter/material.dart';
39 | import 'package:flutter_screenutil/flutter_screenutil.dart';
40 | import 'package:get/get.dart';
41 |
42 | import 'package:flutter_easyloading/flutter_easyloading.dart';
43 |
44 | void main() {
45 | //测试提交
46 | WidgetsFlutterBinding.ensureInitialized();
47 |
48 | //捕捉flutter异常
49 | FlutterError.onError = flutterErrorDeetail;
50 |
51 | // 处理dart异常
52 | runZonedGuarded(() async {
53 | runApp(ARedBook());
54 | }, (error, stackTrace) async {
55 | await _reportError(error, stackTrace);
56 | });
57 | }
58 |
59 | flutterErrorDeetail(FlutterErrorDetails details) async {
60 | Zone.current.handleUncaughtError(details.exception, details.stack);
61 | }
62 |
63 | Future _reportError(dynamic error, dynamic stackTrace) async {
64 | print("Flutter端捕获端异常:$error, 异常内容: $stackTrace");
65 | }
66 |
67 | class ARedBook extends StatefulWidget {
68 | @override
69 | _ARedBookState createState() => _ARedBookState();
70 | }
71 |
72 | class _ARedBookState extends State {
73 | @override
74 | Widget build(BuildContext context) {
75 | return ScreenUtilInit(
76 | designSize: Size(750, 1334),
77 | builder: () => Container(
78 | child: GetMaterialApp(
79 | debugShowCheckedModeBanner: false,
80 | initialRoute: '/',
81 | builder: EasyLoading.init(),
82 | defaultTransition: Transition.rightToLeft,
83 | initialBinding: SphpPageState(),
84 | getPages: AppPages.pages,
85 | home: SplashPagePage(),
86 | ),
87 | ),
88 | );
89 | }
90 | }
91 |
--------------------------------------------------------------------------------
/lib/page/add_note/add_note_logic.dart:
--------------------------------------------------------------------------------
1 | /*
2 | * @Author: zxj
3 | * @Date: 2021-06-11 09:31:31
4 | * @LastEditTime: 2021-06-11 09:32:02
5 | * @Description:
6 | */
7 | import 'package:get/get.dart';
8 |
9 | import 'add_note_state.dart';
10 |
11 | class AddNoteLogic extends GetxController {
12 | @override
13 | void onReady() async {
14 | super.onReady();
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/lib/page/add_note/add_note_state.dart:
--------------------------------------------------------------------------------
1 | /*
2 | * @Author: zxj
3 | * @Date: 2021-06-11 09:31:31
4 | * @LastEditTime: 2021-06-11 09:32:53
5 | * @Description:
6 | */
7 |
8 | import 'package:a_red_book/page/add_note/add_note_logic.dart';
9 | import 'package:get/get.dart';
10 |
11 | class AddNoteState implements Bindings {
12 | @override
13 | void dependencies() {
14 | Get.lazyPut(() => AddNoteLogic());
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/lib/page/add_note/add_note_view.dart:
--------------------------------------------------------------------------------
1 | /*
2 | * @Author: zxj
3 | * @Date: 2021-06-11 09:31:31
4 | * @LastEditTime: 2021-06-11 14:43:02
5 | * @Description:
6 | */
7 | import 'package:flutter/material.dart';
8 | import 'package:flutter_screenutil/flutter_screenutil.dart';
9 | import 'package:get/get.dart';
10 | import 'package:persistent_bottom_nav_bar/persistent-tab-view.dart';
11 |
12 | import 'add_note_logic.dart';
13 | import 'package:images_picker/images_picker.dart';
14 |
15 | class AddNotePage extends StatefulWidget {
16 | @override
17 | _AddNotePageState createState() => _AddNotePageState();
18 | }
19 |
20 | class _AddNotePageState extends State {
21 | final AddNoteLogic logic = Get.put(AddNoteLogic());
22 |
23 | //控制器
24 | PersistentTabController _controller;
25 |
26 | @override
27 | void initState() {
28 | super.initState();
29 | _controller = PersistentTabController(initialIndex: 2);
30 | }
31 |
32 | @override
33 | Widget build(BuildContext context) {
34 | return Scaffold(
35 | body: PersistentTabView(
36 | context,
37 | controller: _controller,
38 | screens: _buildScreens(),
39 | items: _navBarsItems(),
40 | confineInSafeArea: true,
41 | backgroundColor: Colors.black,
42 |
43 | popAllScreensOnTapOfSelectedTab: true,
44 | popActionScreens: PopActionScreensType.all,
45 | itemAnimationProperties: ItemAnimationProperties(
46 | // Navigation Bar's items animation properties.
47 | duration: Duration(milliseconds: 1),
48 | curve: Curves.ease,
49 | ),
50 | screenTransitionAnimation: ScreenTransitionAnimation(
51 | // Screen transition animation on change of selected tab.
52 | animateTabTransition: true,
53 | curve: Curves.ease,
54 | duration: Duration(milliseconds: 200),
55 | ),
56 | navBarStyle:
57 | NavBarStyle.style6, // Choose the nav bar style with this property.
58 | ),
59 | );
60 | }
61 |
62 | List _buildScreens() {
63 | return [
64 | ceshi(),
65 | ceshi(),
66 | ceshi(),
67 | ceshi(),
68 | ceshi(),
69 | ];
70 | }
71 |
72 | List _navBarsItems() {
73 | return [
74 | PersistentBottomNavBarItem(
75 | inactiveColorSecondary: Colors.white10,
76 | icon: Center(
77 | child: Text(
78 | "直播",
79 | style: TextStyle(
80 | color: Colors.white,
81 | fontWeight: FontWeight.w400,
82 | fontSize: ScreenUtil().setSp(27)),
83 | ),
84 | ),
85 | ),
86 | PersistentBottomNavBarItem(
87 | icon: Center(
88 | child: Text(
89 | "影集",
90 | style: TextStyle(
91 | color: Colors.white,
92 | fontWeight: FontWeight.w400,
93 | fontSize: ScreenUtil().setSp(27)),
94 | ),
95 | ),
96 | ),
97 | PersistentBottomNavBarItem(
98 | icon: Center(
99 | child: Text(
100 | "相册",
101 | style: TextStyle(
102 | color: Colors.white,
103 | fontWeight: FontWeight.w400,
104 | fontSize: ScreenUtil().setSp(27)),
105 | ),
106 | ),
107 | ),
108 | PersistentBottomNavBarItem(
109 | icon: Center(
110 | child: Text(
111 | "短视频",
112 | style: TextStyle(
113 | color: Colors.white,
114 | fontWeight: FontWeight.w400,
115 | fontSize: ScreenUtil().setSp(27)),
116 | ),
117 | ),
118 | ),
119 | PersistentBottomNavBarItem(
120 | icon: Center(
121 | child: Text(
122 | "拍照",
123 | style: TextStyle(
124 | color: Colors.white,
125 | fontWeight: FontWeight.w400,
126 | fontSize: ScreenUtil().setSp(27)),
127 | ),
128 | ),
129 | ),
130 | ];
131 | }
132 | }
133 |
134 | class ceshi extends StatelessWidget {
135 | @override
136 | Widget build(BuildContext context) {
137 | return Center(
138 | child: InkWell(
139 | onTap: () {
140 | getImage();
141 | },
142 | child: Text("data"),
143 | ),
144 | );
145 | }
146 |
147 | Future getImage() async {
148 | List res = await ImagesPicker.pick(
149 | count: 3,
150 | pickType: PickType.image,
151 | );
152 | }
153 | }
154 |
--------------------------------------------------------------------------------
/lib/page/find/components/drop_down_menu.dart:
--------------------------------------------------------------------------------
1 | /*
2 | * @Author: zxj
3 | * @Date: 2021-06-04 16:12:46
4 | * @LastEditTime: 2021-06-04 20:35:44
5 | * @Description:
6 | */
7 | import 'package:easy_popup/easy_popup.dart';
8 | import 'package:flutter/material.dart';
9 | import 'package:flutter_screenutil/flutter_screenutil.dart';
10 | import 'package:fluttertoast/fluttertoast.dart';
11 |
12 | class DropDownMenu extends StatefulWidget with EasyPopupChild {
13 | final _PopController controller = _PopController();
14 |
15 | @override
16 | _DropDownMenuState createState() => _DropDownMenuState();
17 |
18 | @override
19 | dismiss() {
20 | controller.dismiss();
21 | }
22 | }
23 |
24 | class _DropDownMenuState extends State
25 | with SingleTickerProviderStateMixin {
26 | Animation _animation;
27 | AnimationController _controller;
28 |
29 | @override
30 | void initState() {
31 | super.initState();
32 | widget.controller._bindState(this);
33 | _controller = AnimationController(
34 | vsync: this,
35 | duration: Duration(milliseconds: 300),
36 | );
37 | _animation = Tween(begin: Offset(0, -1), end: Offset.zero)
38 | .animate(_controller);
39 | _controller.forward();
40 | }
41 |
42 | dismiss() {
43 | _controller?.reverse();
44 | }
45 |
46 | @override
47 | void dispose() {
48 | super.dispose();
49 | _controller?.dispose();
50 | }
51 |
52 | List menu = [
53 | {"id": "1", "name": "推荐", "gd": "true"},
54 | {"id": "2", "name": "视频", "gd": "true"},
55 | {"id": "3", "name": "直播", "gd": "true"},
56 | {"id": "4", "name": "汽车", "gd": "false"},
57 | {"id": "5", "name": "Vlog", "gd": "false"},
58 | {"id": "6", "name": "绘画", "gd": "false"},
59 | {"id": "7", "name": "旅行", "gd": "false"},
60 | {"id": "8", "name": "搞笑", "gd": "false"},
61 | {"id": "9", "name": "穿搭", "gd": "false"},
62 | ];
63 | List menu2 = [
64 | {"id": "1", "name": "音乐"},
65 | {"id": "2", "name": "母婴"},
66 | {"id": "3", "name": "萌娃"},
67 | {"id": "4", "name": "美甲"},
68 | {"id": "5", "name": "彩妆"},
69 | {"id": "6", "name": "情感"},
70 | {"id": "7", "name": "运动健身"},
71 | {"id": "8", "name": "手工"},
72 | {"id": "9", "name": "文具手账"},
73 | {"id": "9", "name": "萌宠"},
74 | {"id": "9", "name": "科技数码"},
75 | {"id": "9", "name": "发型"},
76 | {"id": "9", "name": "明星"},
77 | {"id": "9", "name": "家具家装"},
78 | ];
79 | // EasyPopup.pop(context);
80 | @override
81 | Widget build(BuildContext context) {
82 | return Scaffold(
83 | backgroundColor: Colors.transparent,
84 | body: Container(
85 | padding: EdgeInsets.only(top: MediaQuery.of(context).padding.top + 50),
86 | child: ClipRect(
87 | child: SlideTransition(
88 | position: _animation,
89 | child: Container(
90 | color: Colors.white,
91 | height: ScreenUtil().setHeight(800),
92 | padding: EdgeInsets.only(top: 20, left: 10, right: 10),
93 | child: Column(
94 | children: [
95 | _downMenuHead(),
96 | Wrap(
97 | spacing: 15.0,
98 | runSpacing: 15.0,
99 | children: menu.map((e) {
100 | return menuItem(e);
101 | }).toList(),
102 | ),
103 | _downMenuHead2(),
104 | Wrap(
105 | spacing: 15.0,
106 | runSpacing: 15.0,
107 | children: menu2.map((e) {
108 | return menuItem2(e);
109 | }).toList(),
110 | ),
111 | ],
112 | ),
113 | ),
114 | ),
115 | ),
116 | ),
117 | );
118 | }
119 |
120 | //菜单1的孩子
121 | Widget menuItem(item) {
122 | return InkWell(
123 | onTap: () {},
124 | child: Container(
125 | width: ScreenUtil().setWidth(150),
126 | alignment: Alignment.center,
127 | padding: EdgeInsets.only(top: 8, bottom: 8),
128 | // margin: EdgeInsets.all(10),
129 | decoration: BoxDecoration(
130 | color: item["gd"] == "true" ? Colors.black12 : Colors.white,
131 | borderRadius: BorderRadius.all(Radius.circular(5)),
132 | border: Border.all(
133 | color: item["gd"] == "true" ? Colors.white : Colors.black12,
134 | width: 1,
135 | ),
136 | ),
137 | child: Text(
138 | "${item["name"]}",
139 | style: TextStyle(
140 | fontSize: ScreenUtil().setSp(20),
141 | ),
142 | ),
143 | ),
144 | );
145 | }
146 |
147 | //菜单2的孩子
148 | Widget menuItem2(item) {
149 | return InkWell(
150 | onTap: () {},
151 | child: Container(
152 | width: ScreenUtil().setWidth(150),
153 | alignment: Alignment.center,
154 | padding: EdgeInsets.only(top: 8, bottom: 8),
155 | // margin: EdgeInsets.all(10),
156 | decoration: BoxDecoration(
157 | borderRadius: BorderRadius.all(Radius.circular(5)),
158 | border: Border.all(
159 | color: Colors.black12,
160 | width: 1,
161 | ),
162 | ),
163 | child: Text(
164 | "+${item["name"]}",
165 | style: TextStyle(
166 | fontSize: ScreenUtil().setSp(20),
167 | ),
168 | ),
169 | ),
170 | );
171 | }
172 |
173 | //下拉菜单
174 | Widget _downMenuHead() {
175 | return Container(
176 | padding: EdgeInsets.only(right: 5, left: 5, bottom: 15),
177 | child: Row(
178 | children: [
179 | Text(
180 | "我的频道",
181 | style: TextStyle(
182 | fontSize: ScreenUtil().setSp(25), fontWeight: FontWeight.w600),
183 | ),
184 | Container(
185 | padding: EdgeInsets.only(left: 10),
186 | child: Text(
187 | "点击进入频道",
188 | style: TextStyle(
189 | color: Colors.black45, fontSize: ScreenUtil().setSp(20)),
190 | ),
191 | ),
192 | Spacer(),
193 | InkWell(
194 | onTap: () {},
195 | child: Container(
196 | padding: EdgeInsets.all(5),
197 | decoration: BoxDecoration(
198 | color: Colors.black12,
199 | borderRadius: BorderRadius.all(Radius.circular(10)),
200 | ),
201 | child: Text(
202 | "进入编辑",
203 | style: TextStyle(
204 | color: Colors.blue,
205 | fontSize: ScreenUtil().setSp(20),
206 | ),
207 | ),
208 | ),
209 | ),
210 | Container(
211 | padding: EdgeInsets.only(left: 10),
212 | child: InkWell(
213 | onTap: () {
214 | EasyPopup.pop(context);
215 | },
216 | child: Icon(Icons.expand_less),
217 | ),
218 | )
219 | ],
220 | ),
221 | );
222 | }
223 |
224 | Widget _downMenuHead2() {
225 | return Container(
226 | padding: EdgeInsets.only(right: 5, left: 5, bottom: 15, top: 15),
227 | child: Row(
228 | children: [
229 | Text(
230 | "推荐频道",
231 | style: TextStyle(
232 | fontSize: ScreenUtil().setSp(25), fontWeight: FontWeight.w600),
233 | ),
234 | Container(
235 | padding: EdgeInsets.only(left: 10),
236 | child: Text(
237 | "点击添加频道",
238 | style: TextStyle(
239 | color: Colors.black45, fontSize: ScreenUtil().setSp(20)),
240 | ),
241 | ),
242 | ],
243 | ),
244 | );
245 | }
246 |
247 | //底部
248 | }
249 |
250 | class _PopController {
251 | _DropDownMenuState state;
252 |
253 | _bindState(_DropDownMenuState state) {
254 | this.state = state;
255 | }
256 |
257 | dismiss() {
258 | state?.dismiss();
259 | }
260 | }
261 |
--------------------------------------------------------------------------------
/lib/page/find/find_logic.dart:
--------------------------------------------------------------------------------
1 | /*
2 | * @Author: zxj
3 | * @Date: 2021-06-02 10:54:07
4 | * @LastEditTime: 2021-06-02 10:54:28
5 | * @Description:
6 | */
7 | import 'package:get/get.dart';
8 |
9 | import 'find_state.dart';
10 |
11 | class FindLogic extends GetxController {
12 | @override
13 | void onReady() async {
14 | super.onReady();
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/lib/page/find/find_state.dart:
--------------------------------------------------------------------------------
1 | /*
2 | * @Author: zxj
3 | * @Date: 2021-06-02 10:54:07
4 | * @LastEditTime: 2021-06-02 10:55:26
5 | * @Description:
6 | */
7 | import 'package:get/get.dart';
8 |
9 | import 'find_logic.dart';
10 |
11 | class FindState implements Bindings {
12 | @override
13 | void dependencies() {
14 | Get.lazyPut(() => FindLogic());
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/lib/page/find/recommend/recommend_logic.dart:
--------------------------------------------------------------------------------
1 | /*
2 | * @Author: zxj
3 | * @Date: 2021-06-02 13:56:48
4 | * @LastEditTime: 2021-06-28 20:40:16
5 | * @Description:
6 | */
7 | import 'package:a_red_book/config/data/recommendList.dart';
8 | import 'package:flutter/material.dart';
9 | import 'package:get/get.dart';
10 |
11 | import 'recommend_state.dart';
12 |
13 | class RecommendLogic extends GetxController {
14 | List recommendList = [];
15 | @override
16 | void onReady() async {
17 | super.onReady();
18 | //获取推荐页的数据
19 | getRecommendList();
20 | print("推荐页");
21 | }
22 |
23 | //模拟网络获取数据
24 | getRecommendList() async {
25 | await Future.delayed(Duration(seconds: 1));
26 | recommendList = listitem;
27 | print("加载");
28 | update();
29 | }
30 |
31 | //模拟网络获取数据
32 | getaddRecommendList() async {
33 | recommendList.addAll(listitem2);
34 | print("加载");
35 | update();
36 | }
37 |
38 | //跳转到视频页面
39 | tocontentPage(value) {
40 | if (value == true) {
41 | Get.toNamed("/videoPage");
42 | } else {
43 | Get.toNamed("/swiperContentPage");
44 | }
45 | }
46 | }
47 |
--------------------------------------------------------------------------------
/lib/page/find/recommend/recommend_state.dart:
--------------------------------------------------------------------------------
1 | /*
2 | * @Author: zxj
3 | * @Date: 2021-06-02 13:56:48
4 | * @LastEditTime: 2021-06-02 13:57:36
5 | * @Description:
6 | */
7 | import 'package:a_red_book/page/find/recommend/recommend_logic.dart';
8 | import 'package:get/get.dart';
9 |
10 | class RecommendState {
11 | @override
12 | void dependencies() {
13 | Get.lazyPut(() => RecommendLogic());
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/lib/page/find/recommend/recommend_view.dart:
--------------------------------------------------------------------------------
1 | /*
2 | * @Author: zxj
3 | * @Date: 2021-06-02 13:56:48
4 | * @LastEditTime: 2021-06-28 20:49:24
5 | * @Description: 推荐
6 | *
7 | */
8 | import 'dart:ui';
9 |
10 | import 'package:a_red_book/config/components/note_item.dart';
11 | import 'package:a_red_book/config/data/recommendList.dart';
12 | import 'package:a_red_book/page/mycenter/components/drawerMenu.dart';
13 | import 'package:a_red_book/page/video/video_logic.dart';
14 | import 'package:a_red_book/page/video/video_view.dart';
15 | import 'package:flutter/material.dart';
16 | import 'package:flutter_screenutil/flutter_screenutil.dart';
17 | import 'package:get/get.dart';
18 | import 'recommend_logic.dart';
19 | import 'package:like_button/like_button.dart';
20 |
21 | import 'package:transparent_image/transparent_image.dart';
22 | import 'package:waterfall_flow/waterfall_flow.dart';
23 | import 'package:flutter_easyrefresh/easy_refresh.dart';
24 |
25 | class RecommendPage extends StatelessWidget {
26 | final RecommendLogic logic = Get.put(RecommendLogic());
27 | final VideoLogic logicv = Get.put(VideoLogic());
28 | var globalKey;
29 | RecommendPage({this.globalKey});
30 |
31 | @override
32 | Widget build(BuildContext context) {
33 | return Scaffold(
34 | body: EasyRefresh.custom(
35 | header: MaterialHeader(),
36 | footer: ClassicalFooter(
37 | extent: 30,
38 | showInfo: false,
39 | safeArea: false,
40 | textColor: Colors.white,
41 | ),
42 | onRefresh: () async {
43 | await Future.delayed(Duration(seconds: 2), () {
44 | logic.getRecommendList();
45 | });
46 | },
47 | onLoad: () async {
48 | logic.getaddRecommendList();
49 | },
50 | slivers: [
51 | SliverList(
52 | delegate: SliverChildBuilderDelegate(
53 | (context, index) {
54 | return Container(
55 | child: GetBuilder(
56 | builder: (logic) => Container(
57 | child: WaterfallFlow.builder(
58 | shrinkWrap: true,
59 | physics: NeverScrollableScrollPhysics(),
60 | padding: EdgeInsets.only(top: 0),
61 | itemCount: logic.recommendList.length,
62 | gridDelegate:
63 | SliverWaterfallFlowDelegateWithFixedCrossAxisCount(
64 | crossAxisCount: 2,
65 | ),
66 | itemBuilder: (context, index) {
67 | return videoLayout(logic.recommendList[index]);
68 | },
69 | ),
70 | ),
71 | ),
72 | );
73 | },
74 | childCount: 1,
75 | ),
76 | ),
77 | ],
78 | ),
79 | );
80 | }
81 |
82 | Widget videoLayout(item) {
83 | return NoteItem(
84 | item: item,
85 | onTap: () {
86 | // Scaffold.of(context).openEndDrawer();
87 | logicv.getdt("1234");
88 | globalKey.currentState.openEndDrawer();
89 | // logic.tocontentPage(item["ismp4"]);
90 | },
91 | );
92 | }
93 | }
94 |
--------------------------------------------------------------------------------
/lib/page/follow/follow_logic.dart:
--------------------------------------------------------------------------------
1 | /*
2 | * @Author: zxj
3 | * @Date: 2021-06-10 15:04:48
4 | * @LastEditTime: 2021-06-10 15:05:05
5 | * @Description:
6 | */
7 | import 'package:get/get.dart';
8 |
9 | import 'follow_state.dart';
10 |
11 | class FollowLogic extends GetxController {
12 | List recommendAuthor = [];
13 | List recommend = [
14 | {
15 | "id": 0,
16 | "author": "华仔测评",
17 | "avatar":
18 | "https://pic4.zhimg.com/v2-1fb998118e443cf3539def7aaee7da71_is.jpg",
19 | "describe": "笔记·158 |推荐自数码科技",
20 | "works": [
21 | {
22 | "describe": "手机照片定位测试机",
23 | "covers": "https://img01.jituwang.com/170722/256853-1FH2102K755.jpg",
24 | },
25 | {
26 | "describe": "手机照片定位测试机",
27 | "covers": "https://img01.jituwang.com/170722/256853-1FH2102K755.jpg",
28 | },
29 | {
30 | "describe": "手机照片定位测试机",
31 | "covers": "https://img01.jituwang.com/170722/256853-1FH2102K755.jpg",
32 | },
33 | ]
34 | },
35 | {
36 | "id": 1,
37 | "author": "华仔测评",
38 | "avatar":
39 | "https://pic4.zhimg.com/v2-1fb998118e443cf3539def7aaee7da71_is.jpg",
40 | "describe": "笔记·158 |推荐自数码科技",
41 | "works": [
42 | {
43 | "describe": "手机照片定位测试机",
44 | "covers": "https://img01.jituwang.com/170722/256853-1FH2102K755.jpg",
45 | },
46 | {
47 | "describe": "手机照片定位测试机",
48 | "covers": "https://img01.jituwang.com/170722/256853-1FH2102K755.jpg",
49 | },
50 | {
51 | "describe": "手机照片定位测试机",
52 | "covers": "https://img01.jituwang.com/170722/256853-1FH2102K755.jpg",
53 | },
54 | ]
55 | },
56 | ];
57 | int page = 1;
58 | @override
59 | void onReady() async {
60 | super.onReady();
61 | getRecommend();
62 | }
63 |
64 | //获取推荐数据
65 | getRecommend() async {
66 | await Future.delayed(Duration(seconds: 1));
67 | page = 1;
68 | recommendAuthor = [];
69 | recommendAuthor = recommend;
70 | update();
71 | }
72 |
73 | //分页获取数据
74 | getMore() async {
75 | print("获取更多");
76 | await Future.delayed(Duration(seconds: 1));
77 | page++;
78 | List recommend1 = [
79 | {
80 | "id": page,
81 | "author": "华仔测评",
82 | "avatar":
83 | "https://pic4.zhimg.com/v2-1fb998118e443cf3539def7aaee7da71_is.jpg",
84 | "describe": "笔记·158 |推荐自数码科技",
85 | "works": [
86 | {
87 | "describe": "手机照片定位测试机",
88 | "covers":
89 | "https://img01.jituwang.com/170722/256853-1FH2102K755.jpg",
90 | },
91 | {
92 | "describe": "手机照片定位测试机",
93 | "covers":
94 | "https://img01.jituwang.com/170722/256853-1FH2102K755.jpg",
95 | },
96 | {
97 | "describe": "手机照片定位测试机",
98 | "covers":
99 | "https://img01.jituwang.com/170722/256853-1FH2102K755.jpg",
100 | },
101 | ]
102 | },
103 | ];
104 |
105 | recommendAuthor.addAll(recommend1);
106 | update();
107 | }
108 | }
109 |
--------------------------------------------------------------------------------
/lib/page/follow/follow_state.dart:
--------------------------------------------------------------------------------
1 | /*
2 | * @Author: zxj
3 | * @Date: 2021-06-10 15:04:48
4 | * @LastEditTime: 2021-06-10 15:05:48
5 | * @Description:
6 | */
7 |
8 | import 'package:a_red_book/page/follow/follow_logic.dart';
9 | import 'package:get/get.dart';
10 |
11 | class FollowState implements Bindings {
12 | @override
13 | void dependencies() {
14 | Get.lazyPut(() => FollowLogic());
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/lib/page/home/home_logic.dart:
--------------------------------------------------------------------------------
1 | import 'package:get/get.dart';
2 |
3 | import 'home_state.dart';
4 |
5 | /// @description:
6 | /// @author
7 | /// @date: 2021/06/01 15:53:02
8 | class HomeLogic extends GetxController {
9 | @override
10 | void onReady() async {
11 | super.onReady();
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/lib/page/home/home_state.dart:
--------------------------------------------------------------------------------
1 | /*
2 | * @Author: zxj
3 | * @Date: 2021-06-01 15:53:02
4 | * @LastEditTime: 2021-06-01 15:57:31
5 | * @Description:
6 | */
7 |
8 | import 'package:a_red_book/page/home/home_logic.dart';
9 | import 'package:get/get.dart';
10 |
11 | class HomeState {
12 | @override
13 | void dependencies() {
14 | Get.lazyPut(() => HomeLogic());
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/lib/page/home/home_view.dart:
--------------------------------------------------------------------------------
1 | /*
2 | * @Author: zxj
3 | * @Date: 2021-06-01 15:53:02
4 | * @LastEditTime: 2021-06-27 18:25:22
5 | * @Description:
6 | */
7 |
8 | import 'package:a_red_book/page/find/find_view.dart';
9 | import 'package:a_red_book/page/find/recommend/recommend_view.dart';
10 | import 'package:a_red_book/page/follow/follow_view.dart';
11 | import 'package:flutter/foundation.dart';
12 | import 'package:flutter/material.dart';
13 | import 'package:flutter_screenutil/flutter_screenutil.dart';
14 | import 'package:extended_tabs/extended_tabs.dart';
15 | import 'package:get/get.dart';
16 |
17 | import 'home_logic.dart';
18 | import 'home_state.dart';
19 |
20 | class HomePage extends StatefulWidget {
21 | Key globalKey;
22 | HomePage({this.globalKey});
23 |
24 | @override
25 | _HomePageState createState() => _HomePageState(this.globalKey);
26 | }
27 |
28 | class _HomePageState extends State with TickerProviderStateMixin {
29 | TabController mTabController;
30 | TabController tabController1;
31 | Key globalKey;
32 | _HomePageState(this.globalKey);
33 |
34 | List mTabList = [
35 | {"id": 1, "cname": "关注"},
36 | {"id": 2, "cname": "发现"},
37 | {"id": 3, "cname": "绵阳"},
38 | ];
39 |
40 | @override
41 | void initState() {
42 | // TODO: implement initState
43 | super.initState();
44 |
45 | mTabController = TabController(length: mTabList.length, vsync: this);
46 | tabController1 = TabController(length: 3, vsync: this);
47 | mTabController.index = 1;
48 | // setState(() {
49 | // // mTabList = mList;
50 | // mTabController = TabController(length: mTabList.length, vsync: this);
51 | // });
52 | // mTabController.addListener(() {
53 | // _currentTopTabIndex = _tabController.index;
54 | // });
55 | }
56 |
57 | @override
58 | void dispose() {
59 | mTabController.dispose();
60 | tabController1.dispose();
61 | super.dispose();
62 | }
63 |
64 | @override
65 | Widget build(BuildContext context) {
66 | return Scaffold(
67 | body: Container(
68 | //color: MyColorRes.bgTagColor,
69 | padding: EdgeInsets.only(top: 25),
70 | child: Column(
71 | children: [
72 | Row(
73 | children: [
74 | InkWell(
75 | onTap: () {
76 | // Scaffold.of(context).openEndDrawer();
77 | Get.toNamed("/recordPage");
78 | },
79 | child: Container(
80 | height: ScreenUtil().setHeight(45),
81 | width: ScreenUtil().setWidth(45),
82 | margin: EdgeInsets.only(left: 15),
83 | child: Image.asset("images/hey_ic_home_menu.png"),
84 | ),
85 | ),
86 | Spacer(),
87 | Container(
88 | alignment: Alignment.center,
89 | height: 50,
90 | child: ExtendedTabBar(
91 | isScrollable: true,
92 | indicatorColor: Colors.red,
93 | labelColor: Colors.black,
94 | unselectedLabelColor: Color(0xff666666),
95 | labelStyle:
96 | TextStyle(fontSize: 15.0, fontWeight: FontWeight.w500),
97 | unselectedLabelStyle: TextStyle(fontSize: 15.0),
98 | indicatorSize: TabBarIndicatorSize.label,
99 | controller: mTabController,
100 | tabs: mTabList.map((value) {
101 | return Container(
102 | child: Text(value["cname"]),
103 | );
104 | }).toList(),
105 | ),
106 | ),
107 | Spacer(),
108 | Container(
109 | padding: EdgeInsets.only(right: 10),
110 | child: Icon(
111 | Icons.search,
112 | size: 30,
113 | ),
114 | ),
115 | ],
116 | ),
117 | Divider(
118 | height: 1,
119 | ),
120 | Expanded(
121 | flex: 1,
122 | child: ExtendedTabBarView(
123 | children: [
124 | FollowPage(),
125 | FindPage(globalKey: globalKey),
126 | RecommendPage(globalKey: globalKey),
127 | ],
128 | controller: mTabController,
129 | ),
130 | ),
131 | ],
132 | ),
133 | ),
134 | );
135 | }
136 |
137 | @override
138 | void debugFillProperties(DiagnosticPropertiesBuilder properties) {
139 | super.debugFillProperties(properties);
140 | properties.add(
141 | DiagnosticsProperty('mTabController', mTabController));
142 | }
143 | }
144 |
145 | class VideoRecommendPage extends StatelessWidget {
146 | @override
147 | Widget build(BuildContext context) {
148 | return Container(
149 | child: Text("data"),
150 | );
151 | }
152 | }
153 |
--------------------------------------------------------------------------------
/lib/page/index/index_logic.dart:
--------------------------------------------------------------------------------
1 | /*
2 | * @Author: zxj
3 | * @Date: 2021-06-01 11:32:32
4 | * @LastEditTime: 2021-06-01 11:35:56
5 | * @Description:
6 | */
7 | import 'package:get/get.dart';
8 |
9 | class IndexLogic extends GetxController {
10 | @override
11 | void onReady() async {
12 | super.onReady();
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/lib/page/index/index_state.dart:
--------------------------------------------------------------------------------
1 | import 'package:a_red_book/page/index/index_logic.dart';
2 | import 'package:get/get.dart';
3 |
4 | /// @description:
5 | /// @author
6 | /// @date: 2021/06/01 11:32:32
7 | class IndexState implements Bindings {
8 | @override
9 | void dependencies() {
10 | Get.lazyPut(() => IndexLogic());
11 | }
12 | }
13 |
--------------------------------------------------------------------------------
/lib/page/index/index_view.dart:
--------------------------------------------------------------------------------
1 | /*
2 | * @Author: zxj
3 | * @Date: 2021-06-01 11:32:32
4 | * @LastEditTime: 2021-06-26 11:18:21
5 | * @Description:
6 | */
7 | import 'package:a_red_book/page/home/home_view.dart';
8 | import 'package:a_red_book/page/mycenter/components/drawerMenu.dart';
9 | import 'package:a_red_book/page/mycenter/mycenter_view.dart';
10 | import 'package:a_red_book/page/news/news_view.dart';
11 | import 'package:a_red_book/page/shop/shop_view.dart';
12 | import 'package:a_red_book/page/video/video_view.dart';
13 | import 'package:flutter/material.dart';
14 | import 'package:flutter_screenutil/flutter_screenutil.dart';
15 | import 'package:persistent_bottom_nav_bar/persistent-tab-view.dart';
16 |
17 | import 'package:get/get.dart';
18 |
19 | import 'index_logic.dart';
20 | import 'index_state.dart';
21 |
22 | class IndexPage extends StatefulWidget {
23 | @override
24 | _IndexPageState createState() => _IndexPageState();
25 | }
26 |
27 | class _IndexPageState extends State {
28 | //控制器
29 | PersistentTabController _controller;
30 | GlobalKey globalKey = GlobalKey();
31 |
32 | @override
33 | void initState() {
34 | super.initState();
35 | _controller = PersistentTabController(initialIndex: 0);
36 | }
37 |
38 | @override
39 | Widget build(BuildContext context) {
40 | // 适配屏幕
41 | ScreenUtil.init(
42 | BoxConstraints(
43 | maxWidth: MediaQuery.of(context).size.width,
44 | maxHeight: MediaQuery.of(context).size.height,
45 | ),
46 | designSize: Size(750, 1334),
47 | orientation: Orientation.portrait,
48 | );
49 | return Scaffold(
50 | key: globalKey,
51 | drawer: DrawerMenu(),
52 | endDrawer: VideoPage(),
53 | body: PersistentTabView(
54 | context,
55 | controller: _controller,
56 | screens: _buildScreens(),
57 | items: _navBarsItems(),
58 | confineInSafeArea: true,
59 |
60 | resizeToAvoidBottomInset:
61 | true, // This needs to be true if you want to move up the screen when keyboard appears. Default is true.
62 | stateManagement: true, // Default is true.
63 | hideNavigationBarWhenKeyboardShows:
64 | true, // Recommended to set 'resizeToAvoidBottomInset' as true while using this argument. Default is true.
65 | decoration: NavBarDecoration(
66 | borderRadius: BorderRadius.circular(5.0),
67 | colorBehindNavBar: Colors.black,
68 | ),
69 | popAllScreensOnTapOfSelectedTab: true,
70 | popActionScreens: PopActionScreensType.all,
71 | itemAnimationProperties: ItemAnimationProperties(
72 | // Navigation Bar's items animation properties.
73 | duration: Duration(milliseconds: 1),
74 | curve: Curves.ease,
75 | ),
76 | screenTransitionAnimation: ScreenTransitionAnimation(
77 | // Screen transition animation on change of selected tab.
78 | animateTabTransition: true,
79 | curve: Curves.ease,
80 | duration: Duration(milliseconds: 200),
81 | ),
82 | navBarStyle:
83 | NavBarStyle.style6, // Choose the nav bar style with this property.
84 | ),
85 | );
86 | }
87 |
88 | List _buildScreens() {
89 | return [
90 | HomePage(globalKey: globalKey),
91 | ShopPage(),
92 | HomePage(),
93 | NewsPage(),
94 | MycenterPage(globalKey: globalKey),
95 | ];
96 | }
97 |
98 | List _navBarsItems() {
99 | return [
100 | PersistentBottomNavBarItem(
101 | icon: Center(
102 | child: Text(
103 | "首页",
104 | style: TextStyle(
105 | color: Colors.black,
106 | fontWeight: FontWeight.w500,
107 | fontSize: ScreenUtil().setSp(27)),
108 | ),
109 | ),
110 | ),
111 | PersistentBottomNavBarItem(
112 | icon: Center(
113 | child: Text(
114 | "商城",
115 | style: TextStyle(
116 | color: Colors.black,
117 | fontWeight: FontWeight.w400,
118 | fontSize: ScreenUtil().setSp(27)),
119 | ),
120 | ),
121 | ),
122 | PersistentBottomNavBarItem(
123 | icon: Container(
124 | child: ElevatedButton(
125 | style: ButtonStyle(
126 | backgroundColor: MaterialStateProperty.all(Colors.red),
127 | ),
128 | child: Icon(Icons.add),
129 | onPressed: () {
130 | Get.toNamed("/addNotePage");
131 | },
132 | ),
133 | ),
134 | ),
135 | PersistentBottomNavBarItem(
136 | icon: Center(
137 | child: Text(
138 | "消息",
139 | style: TextStyle(
140 | color: Colors.black,
141 | fontWeight: FontWeight.w400,
142 | fontSize: ScreenUtil().setSp(27),
143 | ),
144 | ),
145 | ),
146 | ),
147 | PersistentBottomNavBarItem(
148 | icon: Center(
149 | child: Text(
150 | "我",
151 | style: TextStyle(
152 | color: Colors.black,
153 | fontWeight: FontWeight.w400,
154 | fontSize: ScreenUtil().setSp(27)),
155 | ),
156 | ),
157 | ),
158 | ];
159 | }
160 | }
161 |
--------------------------------------------------------------------------------
/lib/page/login/login_logic.dart:
--------------------------------------------------------------------------------
1 | /*
2 | * @Author: zxj
3 | * @Date: 2021-05-31 15:45:17
4 | * @LastEditTime: 2021-05-31 15:48:01
5 | * @Description:
6 | */
7 | import 'package:flutter/material.dart';
8 | import 'package:get/get.dart';
9 |
10 | import 'login_state.dart';
11 |
12 | class LoginLogic extends GetxController {
13 | //第三方登录
14 | List loginlist = [
15 | {
16 | "id": 1,
17 | "type": "qq",
18 | "image": "images/login_icon_welcome_qq_v3.png",
19 | },
20 | {
21 | "id": 2,
22 | "type": "weixin",
23 | "image": "images/login_icon_welcome_weixin_v3.png",
24 | },
25 | {
26 | "id": 3,
27 | "type": "phone",
28 | "image": "images/login_icon_welcome_phone_v3.png",
29 | },
30 | {
31 | "id": 4,
32 | "type": "weibo",
33 | "image": "images/login_icon_welcome_weibo_v3.png",
34 | },
35 | ];
36 |
37 | @override
38 | void onReady() async {
39 | super.onReady();
40 | }
41 |
42 | //点击一键登录
43 | toLogin() {
44 | // 一键登录的逻辑
45 |
46 | //。。。
47 |
48 | //登录成功跳转
49 | Get.offNamed("/indexPage");
50 | }
51 |
52 | //第三方登录
53 | toLoginOther(type) {
54 | print(type);
55 | switch (type) {
56 | case "qq":
57 | print("qq登录");
58 | break;
59 | case "weixin":
60 | print("weixin登录");
61 | break;
62 | case "phone":
63 | print("phone登录");
64 | break;
65 | case "weibo":
66 | print("weibo登录");
67 | break;
68 | default:
69 | }
70 | }
71 | }
72 |
--------------------------------------------------------------------------------
/lib/page/login/login_state.dart:
--------------------------------------------------------------------------------
1 | /*
2 | * @Author: zxj
3 | * @Date: 2021-05-31 15:45:17
4 | * @LastEditTime: 2021-06-01 11:35:35
5 | * @Description:
6 | */
7 |
8 | import 'package:get/get.dart';
9 |
10 | import 'login_logic.dart';
11 |
12 | class LoginState implements Bindings {
13 | @override
14 | void dependencies() {
15 | Get.lazyPut(() => LoginLogic());
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/lib/page/login/login_view.dart:
--------------------------------------------------------------------------------
1 | /*
2 | * @Author: zxj
3 | * @Date: 2021-05-31 15:45:17
4 | * @LastEditTime: 2021-06-05 10:56:22
5 | * @Description: 登录页UI
6 | */
7 | import 'dart:ui';
8 |
9 | import 'package:flutter/material.dart';
10 | import 'package:flutter/services.dart';
11 | import 'package:flutter_screenutil/flutter_screenutil.dart';
12 | import 'package:get/get.dart';
13 |
14 | import 'login_logic.dart';
15 | import 'package:video_player/video_player.dart';
16 |
17 | class LoginPage extends StatefulWidget {
18 | @override
19 | _LoginPageState createState() => _LoginPageState();
20 | }
21 |
22 | final LoginLogic logic = Get.put(LoginLogic());
23 | VideoPlayerController _controller;
24 |
25 | class _LoginPageState extends State {
26 | @override
27 | void initState() {
28 | super.initState();
29 |
30 | _controller = VideoPlayerController.asset('images/b2.mp4')
31 | ..initialize().then((_) {
32 | setState(() {});
33 | });
34 | _controller.play();
35 | _controller.setLooping(true);
36 | }
37 |
38 | @override
39 | Widget build(BuildContext context) {
40 | return Scaffold(
41 | body: GetBuilder(
42 | builder: (logic) => Stack(
43 | alignment: Alignment.center,
44 | children: [
45 | Container(
46 | height: ScreenUtil().setHeight(1335),
47 | child: AspectRatio(
48 | aspectRatio: _controller.value.aspectRatio,
49 | child: VideoPlayer(_controller),
50 | ),
51 | ),
52 | Positioned(
53 | bottom: 0.0,
54 | child: Column(
55 | children: [
56 | login(),
57 | loginOther(logic.loginlist),
58 | xieyi(),
59 | ],
60 | ),
61 | ),
62 | ],
63 | ),
64 | ),
65 | );
66 | }
67 |
68 | //一键登录
69 | Widget login() {
70 | return Column(
71 | children: [
72 | //电话号码
73 | Text(
74 | "+86 15346983027",
75 | style: TextStyle(
76 | fontSize: ScreenUtil().setSp(35),
77 | color: Colors.white,
78 | ),
79 | ),
80 | //登录按钮
81 | Container(
82 | margin: EdgeInsets.only(top: 10),
83 | width: ScreenUtil().setHeight(500),
84 | child: ElevatedButton(
85 | style: ButtonStyle(
86 | backgroundColor: MaterialStateProperty.all(Colors.red),
87 | shape: MaterialStateProperty.all(
88 | StadiumBorder(side: BorderSide(color: Colors.black12))),
89 | ),
90 | child: Text(
91 | "同意协议并一点登录",
92 | style: TextStyle(color: Colors.white),
93 | ),
94 | onPressed: () {
95 | logic.toLogin();
96 | },
97 | ),
98 | ),
99 | ],
100 | );
101 | }
102 |
103 | Widget loginOther(item) {
104 | return Container(
105 | margin: EdgeInsets.only(top: 50),
106 | width: ScreenUtil().setHeight(550),
107 | child: Row(
108 | children: item.map(
109 | (e) {
110 | return Expanded(
111 | child: InkWell(
112 | onTap: () {
113 | logic.toLoginOther(e["type"]);
114 | },
115 | child: Container(
116 | height: 60.h,
117 | width: 60.w,
118 | child: Image.asset(e["image"]),
119 | ),
120 | ),
121 | );
122 | },
123 | ).toList(),
124 | ),
125 | );
126 | }
127 |
128 | Widget xieyi() {
129 | return Container(
130 | width: ScreenUtil().setHeight(500),
131 | margin: EdgeInsets.only(top: 30),
132 | child: Center(
133 | child: Column(
134 | children: [
135 | Text(
136 | "登录注册代表同意《用户协议》《隐私政策》《儿童/青少年个人信息保护规程》《中国电信服务条款》",
137 | textAlign: TextAlign.center,
138 | style: TextStyle(
139 | color: Colors.white70, fontSize: ScreenUtil().setSp(18)),
140 | ),
141 | ],
142 | ),
143 | ),
144 | );
145 | }
146 |
147 | @override
148 | void dispose() {
149 | super.dispose();
150 | _controller.dispose();
151 | }
152 | }
153 |
--------------------------------------------------------------------------------
/lib/page/mycenter/components/collection.dart:
--------------------------------------------------------------------------------
1 | /*
2 | * @Author: zxj
3 | * @Date: 2021-06-06 10:47:00
4 | * @LastEditTime: 2021-06-28 18:58:25
5 | * @Description:
6 | */
7 |
8 | import 'package:a_red_book/page/find/recommend/recommend_view.dart';
9 | import 'package:flutter/foundation.dart';
10 | import 'package:flutter/material.dart';
11 |
12 | class Collection extends StatefulWidget {
13 | Key globalKey;
14 | Collection({this.globalKey});
15 |
16 | @override
17 | _CollectionState createState() => _CollectionState(this.globalKey);
18 | }
19 |
20 | class _CollectionState extends State with TickerProviderStateMixin {
21 | TabController mTabController;
22 | Key globalKey;
23 | _CollectionState(this.globalKey);
24 | List mTabList = [
25 | {"id": 1, "cname": "笔记"},
26 | {"id": 2, "cname": "收藏"},
27 | {"id": 3, "cname": "赞过"},
28 | ];
29 | @override
30 | void initState() {
31 | // TODO: implement initState
32 | super.initState();
33 |
34 | mTabController = TabController(length: mTabList.length, vsync: this);
35 | mTabController.index = 1;
36 | // setState(() {
37 | // // mTabList = mList;
38 | // mTabController = TabController(length: mTabList.length, vsync: this);
39 | // });
40 | // mTabController.addListener(() {
41 | // _currentTopTabIndex = _tabController.index;
42 | // });
43 | }
44 |
45 | @override
46 | Widget build(BuildContext context) {
47 | return Container(
48 | padding: EdgeInsets.all(10),
49 | decoration: BoxDecoration(
50 | color: Colors.white,
51 | borderRadius: BorderRadius.only(
52 | topLeft: Radius.circular(10),
53 | topRight: Radius.circular(10),
54 | ),
55 | ),
56 | child: Column(
57 | children: [
58 | Container(
59 | padding: EdgeInsets.only(bottom: 5),
60 | child: TabBar(
61 | isScrollable: true,
62 | indicatorColor: Colors.red,
63 | labelColor: Colors.black,
64 | unselectedLabelColor: Color(0xff666666),
65 | labelStyle:
66 | TextStyle(fontSize: 15.0, fontWeight: FontWeight.w500),
67 | unselectedLabelStyle: TextStyle(fontSize: 15.0),
68 | indicatorSize: TabBarIndicatorSize.label,
69 | controller: mTabController,
70 | tabs: mTabList.map((value) {
71 | return Container(
72 | child: Text(value["cname"]),
73 | );
74 | }).toList(),
75 | ),
76 | ),
77 | Divider(
78 | height: 1,
79 | color: Colors.black12,
80 | ),
81 | Expanded(
82 | child: TabBarView(
83 | children: [
84 | VideoRecommendPage(),
85 | VideoRecommendPage(),
86 | VideoRecommendPage()
87 | ],
88 | controller: mTabController,
89 | ),
90 | )
91 | ],
92 | ),
93 | );
94 | }
95 | }
96 |
97 | class VideoRecommendPage extends StatelessWidget {
98 | @override
99 | Widget build(BuildContext context) {
100 | return Container(
101 | child: Text(""),
102 | );
103 | }
104 | }
105 |
--------------------------------------------------------------------------------
/lib/page/mycenter/components/drawerMenu.dart:
--------------------------------------------------------------------------------
1 | /*
2 | * @Author: zxj
3 | * @Date: 2021-06-10 15:56:22
4 | * @LastEditTime: 2021-06-25 10:07:36
5 | * @Description:
6 | */
7 |
8 | import 'package:flutter/material.dart';
9 |
10 | class DrawerMenu extends StatelessWidget {
11 | @override
12 | Widget build(BuildContext context) {
13 | List item = [
14 | {"id": "1", "name": "发现好友", "icon": Icons.person_add_alt, "toPage": ""}
15 | ];
16 | List item1 = [
17 | {"id": "1", "name": "我的草稿", "icon": Icons.credit_card, "toPage": ""},
18 | {"id": "1", "name": "创作中心", "icon": Icons.person_add_alt, "toPage": ""},
19 | {"id": "1", "name": "钱包", "icon": Icons.local_atm, "toPage": ""},
20 | {"id": "1", "name": "免流量", "icon": Icons.sim_card, "toPage": ""},
21 | {"id": "1", "name": "好物体验", "icon": Icons.redeem, "toPage": ""}
22 | ];
23 | List item2 = [
24 | {"id": "1", "name": "订单", "icon": Icons.list_alt, "toPage": ""},
25 | {"id": "1", "name": "购物车", "icon": Icons.shopping_cart, "toPage": ""},
26 | {"id": "1", "name": "卡卷", "icon": Icons.card_giftcard, "toPage": ""},
27 | {"id": "1", "name": "心愿单", "icon": Icons.eco, "toPage": ""},
28 | {"id": "1", "name": "小红书会员", "icon": Icons.view_compact, "toPage": ""}
29 | ];
30 | List item3 = [
31 | {"id": "1", "name": "社会公约", "icon": Icons.grass, "toPage": ""}
32 | ];
33 | return Drawer(
34 | elevation: 16,
35 | child: Container(
36 | padding: EdgeInsets.only(top: 60),
37 | margin: EdgeInsets.all(10),
38 | child: Column(
39 | children: [
40 | Container(
41 | child: Column(
42 | children: item.map((e) {
43 | return itemlist(e);
44 | }).toList(),
45 | ),
46 | ),
47 | Container(
48 | margin: EdgeInsets.only(top: 5, bottom: 5, left: 20, right: 20),
49 | child: Divider(
50 | height: 1,
51 | ),
52 | ),
53 | Container(
54 | child: Column(
55 | children: item1.map((e) {
56 | return itemlist(e);
57 | }).toList(),
58 | ),
59 | ),
60 | Container(
61 | margin: EdgeInsets.only(top: 5, bottom: 5, left: 20, right: 20),
62 | child: Divider(
63 | height: 1,
64 | ),
65 | ),
66 | Container(
67 | child: Column(
68 | children: item2.map((e) {
69 | return itemlist(e);
70 | }).toList(),
71 | ),
72 | ),
73 | Container(
74 | margin: EdgeInsets.only(top: 5, bottom: 5, left: 20, right: 20),
75 | child: Divider(
76 | height: 1,
77 | ),
78 | ),
79 | Container(
80 | child: Column(
81 | children: item3.map((e) {
82 | return itemlist(e);
83 | }).toList(),
84 | ),
85 | ),
86 | Spacer(),
87 | _shezhi(),
88 | ],
89 | ),
90 | ),
91 | );
92 | }
93 |
94 | Widget itemlist(e) {
95 | return Container(
96 | padding: EdgeInsets.only(
97 | top: 15,
98 | bottom: 15,
99 | left: 22,
100 | ),
101 | child: Row(
102 | children: [
103 | Icon(
104 | e["icon"],
105 | color: Colors.black54,
106 | size: 20,
107 | ),
108 | Container(
109 | padding: EdgeInsets.only(left: 10),
110 | child: Text(
111 | "${e["name"]}",
112 | style: TextStyle(fontWeight: FontWeight.w500),
113 | ),
114 | )
115 | ],
116 | ),
117 | );
118 | }
119 |
120 | Widget _shezhi() {
121 | return Container(
122 | child: Row(
123 | children: [
124 | Expanded(
125 | child: Column(
126 | children: [
127 | Container(
128 | margin: EdgeInsets.all(5),
129 | padding: EdgeInsets.all(10),
130 | decoration: BoxDecoration(
131 | color: Color(0x0f000000),
132 | borderRadius: BorderRadius.all(
133 | Radius.circular(25),
134 | ),
135 | ),
136 | child: Icon(
137 | Icons.settings,
138 | color: Colors.black54,
139 | ),
140 | ),
141 | Text("设置")
142 | ],
143 | ),
144 | ),
145 | Expanded(
146 | child: Column(
147 | children: [
148 | Container(
149 | margin: EdgeInsets.all(5),
150 | padding: EdgeInsets.all(10),
151 | decoration: BoxDecoration(
152 | color: Color(0x0f000000),
153 | borderRadius: BorderRadius.all(
154 | Radius.circular(25),
155 | ),
156 | ),
157 | child: Icon(
158 | Icons.support_agent,
159 | color: Colors.black54,
160 | ),
161 | ),
162 | Text("帮助与客服")
163 | ],
164 | ),
165 | ),
166 | Expanded(
167 | child: Column(
168 | children: [
169 | Container(
170 | margin: EdgeInsets.all(5),
171 | padding: EdgeInsets.all(10),
172 | decoration: BoxDecoration(
173 | color: Color(0x0f000000),
174 | borderRadius: BorderRadius.all(
175 | Radius.circular(25),
176 | ),
177 | ),
178 | child: Icon(
179 | Icons.crop_free,
180 | color: Colors.black54,
181 | ),
182 | ),
183 | Text("扫一扫")
184 | ],
185 | ),
186 | )
187 | ],
188 | ),
189 | );
190 | }
191 | }
192 |
--------------------------------------------------------------------------------
/lib/page/mycenter/components/headInfo.dart:
--------------------------------------------------------------------------------
1 | /*
2 | * @Author: zxj
3 | * @Date: 2021-06-06 10:28:38
4 | * @LastEditTime: 2021-06-06 10:33:09
5 | * @Description: 个人资料头部信息
6 | */
7 | import 'package:flutter/material.dart';
8 | import 'package:flutter_screenutil/flutter_screenutil.dart';
9 |
10 | class HeadInfo extends StatelessWidget {
11 | @override
12 | Widget build(BuildContext context) {
13 | return Container(
14 | margin: EdgeInsets.all(20),
15 | child: Column(
16 | crossAxisAlignment: CrossAxisAlignment.start,
17 | children: [
18 | Spacer(),
19 | Row(
20 | children: [
21 | Container(
22 | padding: EdgeInsets.only(right: 10),
23 | child: CircleAvatar(
24 | radius: 35,
25 | backgroundImage: NetworkImage(
26 | "https://pic4.zhimg.com/v2-1fb998118e443cf3539def7aaee7da71_is.jpg"),
27 | ),
28 | ),
29 | Column(
30 | crossAxisAlignment: CrossAxisAlignment.start,
31 | children: [
32 | Text(
33 | "Curry",
34 | style: TextStyle(color: Colors.white),
35 | ),
36 | Text(
37 | "小红书号:68464565",
38 | style: TextStyle(
39 | color: Colors.white70,
40 | fontSize: ScreenUtil().setSp(20)),
41 | ),
42 | Container(
43 | padding: EdgeInsets.only(
44 | right: 10,
45 | left: 10,
46 | ),
47 | margin: EdgeInsets.only(top: 5),
48 | decoration: BoxDecoration(
49 | color: Colors.white10,
50 | borderRadius: BorderRadius.all(Radius.circular(10)),
51 | ),
52 | child: Row(
53 | children: [
54 | Icon(
55 | Icons.self_improvement,
56 | color: Colors.blue,
57 | size: 18,
58 | ),
59 | Text(
60 | "白羊座",
61 | style: TextStyle(
62 | color: Colors.white,
63 | fontSize: ScreenUtil().setSp(20)),
64 | ),
65 | ],
66 | ),
67 | )
68 | ],
69 | )
70 | ],
71 | ),
72 | Container(
73 | padding: EdgeInsets.only(top: 20, bottom: 15),
74 | child: Text(
75 | "去编辑资料完善个人资料吧",
76 | style: TextStyle(
77 | color: Colors.white, fontSize: ScreenUtil().setSp(22)),
78 | ),
79 | ),
80 | Row(
81 | children: [
82 | Row(
83 | children: [
84 | Container(
85 | padding: EdgeInsets.all(5),
86 | child: Column(
87 | children: [
88 | Text(
89 | "1",
90 | style: TextStyle(color: Colors.white),
91 | ),
92 | Text(
93 | "关注",
94 | style: TextStyle(
95 | color: Colors.white70,
96 | fontSize: ScreenUtil().setSp(20),
97 | ),
98 | )
99 | ],
100 | ),
101 | ),
102 | Container(
103 | padding: EdgeInsets.only(left: 15, right: 15),
104 | child: Column(
105 | children: [
106 | Text(
107 | "0",
108 | style: TextStyle(color: Colors.white),
109 | ),
110 | Text(
111 | "粉丝",
112 | style: TextStyle(
113 | color: Colors.white70,
114 | fontSize: ScreenUtil().setSp(20),
115 | ),
116 | )
117 | ],
118 | ),
119 | ),
120 | Container(
121 | padding: EdgeInsets.all(5),
122 | child: Column(
123 | children: [
124 | Text(
125 | "2",
126 | style: TextStyle(color: Colors.white),
127 | ),
128 | Text(
129 | "获赞与收藏",
130 | style: TextStyle(
131 | color: Color(0xFFC5C8CE),
132 | fontSize: ScreenUtil().setSp(20),
133 | ),
134 | )
135 | ],
136 | ),
137 | ),
138 | ],
139 | ),
140 | Spacer(),
141 | Container(
142 | padding:
143 | EdgeInsets.only(right: 15, left: 15, top: 5, bottom: 5),
144 | decoration: BoxDecoration(
145 | color: Colors.white10,
146 | border: Border.all(
147 | width: ScreenUtil().setWidth(1), color: Colors.white),
148 | borderRadius: BorderRadius.all(
149 | Radius.circular(20),
150 | ),
151 | ),
152 | child: Text(
153 | "编辑资料",
154 | style: TextStyle(
155 | color: Colors.white, fontSize: ScreenUtil().setSp(20)),
156 | ),
157 | ),
158 | Container(
159 | margin: EdgeInsets.only(left: 10),
160 | padding:
161 | EdgeInsets.only(right: 10, left: 10, top: 5, bottom: 5),
162 | decoration: BoxDecoration(
163 | color: Colors.white10,
164 | border: Border.all(
165 | width: ScreenUtil().setWidth(1), color: Colors.white),
166 | borderRadius: BorderRadius.all(
167 | Radius.circular(20),
168 | ),
169 | ),
170 | child: Icon(
171 | Icons.settings,
172 | color: Colors.white,
173 | size: 18,
174 | ),
175 | ),
176 | ],
177 | )
178 | ],
179 | ),
180 | );
181 | }
182 | }
183 |
--------------------------------------------------------------------------------
/lib/page/mycenter/mycenter_logic.dart:
--------------------------------------------------------------------------------
1 | import 'package:get/get.dart';
2 |
3 | import 'mycenter_state.dart';
4 |
5 | /// @description:
6 | /// @author
7 | /// @date: 2021/06/04 14:15:44
8 | class MycenterLogic extends GetxController {
9 | @override
10 | void onReady() async {
11 | super.onReady();
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/lib/page/mycenter/mycenter_state.dart:
--------------------------------------------------------------------------------
1 | /*
2 | * @Author: zxj
3 | * @Date: 2021-06-04 14:15:44
4 | * @LastEditTime: 2021-06-04 14:16:51
5 | * @Description:
6 | */
7 | import 'package:a_red_book/page/mycenter/mycenter_logic.dart';
8 | import 'package:get/get.dart';
9 |
10 | class MycenterState implements Bindings {
11 | @override
12 | void dependencies() {
13 | Get.lazyPut(() => MycenterLogic());
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/lib/page/mycenter/mycenter_view.dart:
--------------------------------------------------------------------------------
1 | /*
2 | * @Author: zxj
3 | * @Date: 2021-06-04 14:15:44
4 | * @LastEditTime: 2021-06-28 18:56:26
5 | * @Description:个人中心
6 | */
7 | import 'dart:ui';
8 |
9 | import 'package:a_red_book/page/mycenter/components/headInfo.dart';
10 | import 'package:flutter/material.dart';
11 | import 'package:flutter_screenutil/flutter_screenutil.dart';
12 | import 'package:get/get.dart';
13 |
14 | import 'components/collection.dart';
15 |
16 | import 'components/drawerMenu.dart';
17 | import 'mycenter_logic.dart';
18 | import 'package:extended_sliver/extended_sliver.dart';
19 |
20 | class MycenterPage extends StatelessWidget {
21 | Key globalKey;
22 | MycenterPage({this.globalKey});
23 |
24 | final MycenterLogic logic = Get.put(MycenterLogic());
25 |
26 | @override
27 | Widget build(BuildContext context) {
28 | return Scaffold(
29 | body: CustomScrollView(
30 | slivers: [
31 | ExtendedSliverAppbar(
32 | toolBarColor: Color(0xFF1A3445),
33 | title: Container(
34 | height: ScreenUtil().setHeight(60),
35 | width: ScreenUtil().setWidth(60),
36 | child: CircleAvatar(
37 | radius: 35,
38 | backgroundImage: NetworkImage(
39 | "https://pic4.zhimg.com/v2-1fb998118e443cf3539def7aaee7da71_is.jpg"),
40 | ),
41 | ),
42 | leading: _leading(context),
43 | background: Container(
44 | width: double.maxFinite,
45 | height: ScreenUtil().setHeight(450),
46 | color: Color(0xFF1A3445),
47 | child: HeadInfo(),
48 | ),
49 | actions: Padding(
50 | padding: const EdgeInsets.all(10.0),
51 | child: Icon(
52 | Icons.launch,
53 | color: Colors.white,
54 | ),
55 | ),
56 | ),
57 | SliverPinnedToBoxAdapter(
58 | child: Container(
59 | color: Color(0xFF1A3445),
60 | height: ScreenUtil().setHeight(1200),
61 | child: Collection(globalKey: globalKey),
62 | ),
63 | ),
64 | ],
65 | ),
66 | );
67 | }
68 |
69 | Widget _leading(context) {
70 | return InkWell(
71 | onTap: () {
72 | Scaffold.of(context).openDrawer();
73 | // _globalKey.currentState.openDrawer();
74 | },
75 | child: Container(
76 | padding: EdgeInsets.only(left: 10),
77 | child: Icon(
78 | Icons.menu,
79 | color: Colors.white,
80 | ),
81 | ),
82 | );
83 | }
84 | }
85 |
--------------------------------------------------------------------------------
/lib/page/news/news_logic.dart:
--------------------------------------------------------------------------------
1 | /*
2 | * @Author: zxj
3 | * @Date: 2021-06-04 14:08:56
4 | * @LastEditTime: 2021-06-04 14:09:12
5 | * @Description:
6 | */
7 | import 'package:get/get.dart';
8 |
9 | import 'news_state.dart';
10 |
11 | class NewsLogic extends GetxController {
12 | @override
13 | void onReady() async {
14 | super.onReady();
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/lib/page/news/news_state.dart:
--------------------------------------------------------------------------------
1 | /*
2 | * @Author: zxj
3 | * @Date: 2021-06-04 14:08:56
4 | * @LastEditTime: 2021-06-04 14:09:54
5 | * @Description:
6 | */
7 | import 'package:a_red_book/page/news/news_logic.dart';
8 | import 'package:get/get.dart';
9 |
10 | class NewsState implements Bindings {
11 | @override
12 | void dependencies() {
13 | Get.lazyPut(() => NewsLogic());
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/lib/page/news/news_view.dart:
--------------------------------------------------------------------------------
1 | /*
2 | * @Author: zxj
3 | * @Date: 2021-06-04 14:08:56
4 | * @LastEditTime: 2021-06-05 10:54:16
5 | * @Description:
6 | */
7 | import 'package:flutter/material.dart';
8 | import 'package:flutter_screenutil/flutter_screenutil.dart';
9 | import 'package:get/get.dart';
10 |
11 | import 'news_logic.dart';
12 |
13 | class NewsPage extends StatelessWidget {
14 | final NewsLogic logic = Get.put(NewsLogic());
15 |
16 | @override
17 | Widget build(BuildContext context) {
18 | return Scaffold(
19 | appBar: AppBar(
20 | elevation: 0.0,
21 | backgroundColor: Colors.white,
22 | centerTitle: true,
23 | title: Text(
24 | "消息",
25 | style: TextStyle(
26 | color: Colors.black,
27 | fontWeight: FontWeight.w100,
28 | fontSize: ScreenUtil().setSp(30)),
29 | ),
30 | actions: [
31 | Container(
32 | width: 100,
33 | child: IconButton(
34 | icon: Text(
35 | "创建聊天",
36 | style: TextStyle(color: Colors.black),
37 | ),
38 | onPressed: () {},
39 | ),
40 | ),
41 | ],
42 | ),
43 | body: Container(
44 | child: Column(
45 | children: [
46 | _newsHead(),
47 | Container(
48 | padding: EdgeInsets.only(right: 20, left: 20),
49 | child: Divider(
50 | height: 1,
51 | color: Colors.black12,
52 | ),
53 | ),
54 | _newsList(),
55 | ],
56 | ),
57 | ),
58 | );
59 | }
60 |
61 | //消息列表
62 | Widget _newsList() {
63 | return Container(
64 | color: Colors.white,
65 | child: Column(
66 | children: [
67 | ListTile(
68 | leading: Image.asset("images/im_chat_push_notification_ic_v2.png"),
69 | title: Text("推送消息"),
70 | subtitle: Text("用户调用,小红书诚要你参与调查"),
71 | trailing: Text("05-26"),
72 | ),
73 | ListTile(
74 | leading: Image.asset("images/im_chat_sys_notification_ic_v2.png"),
75 | title: Text("系统通知"),
76 | subtitle: Text("协议更新通知"),
77 | trailing: Text("04-29"),
78 | )
79 | ],
80 | ),
81 | );
82 | }
83 |
84 | //头部菜单
85 | Widget _newsHead() {
86 | return Container(
87 | color: Colors.white,
88 | padding: EdgeInsets.only(right: 20, left: 20, bottom: 10),
89 | child: Flex(
90 | direction: Axis.horizontal,
91 | children: [
92 | Expanded(
93 | flex: 1,
94 | child: Column(
95 | children: [
96 | Container(
97 | height: ScreenUtil().setHeight(70),
98 | width: ScreenUtil().setWidth(70),
99 | margin: EdgeInsets.all(10),
100 | child: Image.asset("images/im_chat_like_collect_ic_v2.png"),
101 | ),
102 | Text("赞和收藏")
103 | ],
104 | ),
105 | ),
106 | Expanded(
107 | flex: 1,
108 | child: Column(
109 | children: [
110 | Container(
111 | height: ScreenUtil().setHeight(70),
112 | width: ScreenUtil().setWidth(70),
113 | margin: EdgeInsets.all(10),
114 | child: Image.asset("images/im_chat_comment_at_ic_v2.png"),
115 | ),
116 | Text("新增关注")
117 | ],
118 | ),
119 | ),
120 | Expanded(
121 | flex: 1,
122 | child: Column(
123 | children: [
124 | Container(
125 | height: ScreenUtil().setHeight(70),
126 | width: ScreenUtil().setWidth(70),
127 | margin: EdgeInsets.all(10),
128 | child: Image.asset("images/im_chat_fans_ic_v2.png"),
129 | ),
130 | Text("评论和@")
131 | ],
132 | ),
133 | )
134 | ],
135 | ),
136 | );
137 | }
138 | }
139 |
--------------------------------------------------------------------------------
/lib/page/record/components/mianContent.dart:
--------------------------------------------------------------------------------
1 | /*
2 | * @Author: zxj
3 | * @Date: 2021-06-27 09:46:22
4 | * @LastEditTime: 2021-06-27 17:41:20
5 | * @Description:
6 | */
7 |
8 | import 'package:flutter/material.dart';
9 | import 'package:flutter_screenutil/flutter_screenutil.dart';
10 | import 'package:transparent_image/transparent_image.dart';
11 |
12 | class MainContext extends StatelessWidget {
13 | @override
14 | Widget build(BuildContext context) {
15 | return Column(
16 | children: [
17 | Container(
18 | padding: EdgeInsets.all(10),
19 | child: Column(
20 | crossAxisAlignment: CrossAxisAlignment.start,
21 | children: [
22 | Container(
23 | padding: EdgeInsets.all(5),
24 | child: Text(
25 | "附近的人的日常",
26 | style: TextStyle(color: Colors.white),
27 | ),
28 | ),
29 | Container(
30 | // width: ScreenUtil().setWidth(750),
31 |
32 | height: ScreenUtil().setHeight(370),
33 | child: ListView(
34 | scrollDirection: Axis.horizontal,
35 | children: [
36 | _item(),
37 | _item(),
38 | _item(),
39 | _item(),
40 | _item(),
41 | _item(),
42 | ],
43 | ),
44 | )
45 | ],
46 | ),
47 | ),
48 | Container(
49 | padding: EdgeInsets.all(10),
50 | child: Column(
51 | crossAxisAlignment: CrossAxisAlignment.start,
52 | children: [
53 | Container(
54 | padding: EdgeInsets.all(5),
55 | child: Text(
56 | "打开日常",
57 | style: TextStyle(color: Colors.white),
58 | ),
59 | ),
60 | Container(
61 | // width: ScreenUtil().setWidth(750),
62 |
63 | height: ScreenUtil().setHeight(370),
64 | child: ListView(
65 | scrollDirection: Axis.horizontal,
66 | children: [
67 | _item(),
68 | _item(),
69 | _item(),
70 | _item(),
71 | _item(),
72 | _item(),
73 | ],
74 | ),
75 | )
76 | ],
77 | ),
78 | ),
79 | ],
80 | );
81 | }
82 |
83 | Widget _item() {
84 | return Container(
85 | padding: EdgeInsets.all(5),
86 | decoration: BoxDecoration(),
87 | child: Stack(
88 | children: [
89 | Container(
90 | height: ScreenUtil().setHeight(350),
91 | width: ScreenUtil().setWidth(210),
92 | child: ClipRRect(
93 | borderRadius: BorderRadius.all(
94 | Radius.circular(8),
95 | ),
96 | child: FadeInImage.memoryNetwork(
97 | placeholder: kTransparentImage,
98 | fit: BoxFit.cover,
99 | image:
100 | "https://img01.jituwang.com/190520/256575-1Z52011051093.jpg",
101 | ),
102 | ),
103 | ),
104 | Positioned(
105 | top: 0,
106 | left: 0,
107 | child: Container(
108 | margin: EdgeInsets.all(10),
109 | padding: EdgeInsets.only(right: 5, left: 5, top: 2, bottom: 2),
110 | decoration: BoxDecoration(
111 | color: Colors.black54,
112 | borderRadius: BorderRadius.all(
113 | Radius.circular(15),
114 | ),
115 | ),
116 | child: Row(
117 | children: [
118 | Icon(
119 | Icons.place,
120 | color: Colors.white,
121 | size: 12,
122 | ),
123 | Text(
124 | "9.4Km",
125 | style: TextStyle(
126 | color: Colors.white,
127 | fontSize: ScreenUtil().setSp(20),
128 | ),
129 | )
130 | ],
131 | ),
132 | ),
133 | ),
134 | Positioned(
135 | bottom: 0,
136 | right: 0,
137 | left: 0,
138 | child: Container(
139 | margin: EdgeInsets.all(10),
140 | child: Column(
141 | children: [
142 | Container(
143 | height: ScreenUtil().setHeight(60),
144 | width: ScreenUtil().setWidth(60),
145 | child: CircleAvatar(
146 | backgroundImage: NetworkImage(
147 | "https://pic4.zhimg.com/v2-1fb998118e443cf3539def7aaee7da71_is.jpg"),
148 | ),
149 | ),
150 | Container(
151 | child: Text(
152 | "CURRY",
153 | style: TextStyle(
154 | color: Colors.white,
155 | ),
156 | ),
157 | ),
158 | ],
159 | ),
160 | ),
161 | ),
162 | ],
163 | ),
164 | );
165 | }
166 | }
167 |
--------------------------------------------------------------------------------
/lib/page/record/components/slivContent.dart:
--------------------------------------------------------------------------------
1 | /*
2 | * @Author: zxj
3 | * @Date: 2021-06-27 09:37:38
4 | * @LastEditTime: 2021-06-27 09:38:21
5 | * @Description:
6 | */
7 |
8 | import 'package:flutter/material.dart';
9 | import 'package:flutter_screenutil/flutter_screenutil.dart';
10 |
11 | class SlivContent extends StatelessWidget {
12 | @override
13 | Widget build(BuildContext context) {
14 | return Container(
15 | width: double.maxFinite,
16 | height: ScreenUtil().setHeight(420),
17 | color: Colors.black,
18 | child: Container(
19 | padding: EdgeInsets.all(10),
20 | child: Column(
21 | children: [
22 | Row(
23 | children: [
24 | Expanded(
25 | child: Container(
26 | padding: EdgeInsets.all(3),
27 | child:
28 | Image.asset("images/hey_guide_card_daily_emotion.png"),
29 | ),
30 | ),
31 | Expanded(
32 | child: Container(
33 | padding: EdgeInsets.all(3),
34 | child: Image.asset("images/hey_guide_card_voice.png"),
35 | ),
36 | )
37 | ],
38 | ),
39 | Row(
40 | children: [
41 | Expanded(
42 | child: Container(
43 | padding: EdgeInsets.all(3),
44 | child: Image.asset("images/hey_guide_card_clockin.png"),
45 | ),
46 | ),
47 | Expanded(
48 | child: Container(
49 | padding: EdgeInsets.all(3),
50 | child: Image.asset("images/hey_guide_card_shoot.png"),
51 | ),
52 | ),
53 | Expanded(
54 | child: Container(
55 | padding: EdgeInsets.all(3),
56 | child: Image.asset("images/hey_guide_card_text.png"),
57 | ),
58 | ),
59 | ],
60 | ),
61 | ],
62 | ),
63 | ),
64 | );
65 | }
66 | }
67 |
--------------------------------------------------------------------------------
/lib/page/record/components/sliverbar.dart:
--------------------------------------------------------------------------------
1 | /*
2 | * @Author: zxj
3 | * @Date: 2021-06-27 09:35:17
4 | * @LastEditTime: 2021-06-27 09:36:17
5 | * @Description:
6 | */
7 |
8 | import 'package:flutter/material.dart';
9 | import 'package:flutter_screenutil/flutter_screenutil.dart';
10 |
11 | class Sliverbar extends StatelessWidget {
12 | @override
13 | Widget build(BuildContext context) {
14 | return Column(
15 | children: [
16 | Container(
17 | padding: EdgeInsets.all(10),
18 | color: Colors.black,
19 | width: ScreenUtil().setWidth(750),
20 | child: Column(
21 | children: [
22 | Row(
23 | children: [
24 | Expanded(
25 | child: Container(
26 | padding: EdgeInsets.all(8),
27 | child: Column(
28 | children: [
29 | Image.asset("images/hey_ic_camera_mode.png"),
30 | Container(
31 | padding: EdgeInsets.only(top: 5),
32 | child: Text(
33 | "拍摄",
34 | style: TextStyle(color: Colors.white),
35 | ),
36 | )
37 | ],
38 | ),
39 | ),
40 | ),
41 | Expanded(
42 | child: Container(
43 | padding: EdgeInsets.all(8),
44 | child: Column(
45 | children: [
46 | Image.asset("images/hey_ic_clockin_mode.png"),
47 | Container(
48 | padding: EdgeInsets.only(top: 5),
49 | child: Text(
50 | "打卡",
51 | style: TextStyle(color: Colors.white),
52 | ),
53 | )
54 | ],
55 | ),
56 | ),
57 | ),
58 | Expanded(
59 | child: Container(
60 | padding: EdgeInsets.all(8),
61 | child: Column(
62 | children: [
63 | Image.asset("images/hey_ic_daily_mode.png"),
64 | Container(
65 | padding: EdgeInsets.only(top: 5),
66 | child: Text(
67 | "日记",
68 | style: TextStyle(color: Colors.white),
69 | ),
70 | )
71 | ],
72 | ),
73 | ),
74 | ),
75 | Expanded(
76 | child: Container(
77 | padding: EdgeInsets.all(8),
78 | child: Column(
79 | children: [
80 | Image.asset("images/hey_ic_text_mode.png"),
81 | Container(
82 | padding: EdgeInsets.only(top: 5),
83 | child: Text(
84 | "文字",
85 | style: TextStyle(color: Colors.white),
86 | ),
87 | )
88 | ],
89 | ),
90 | ),
91 | ),
92 | Expanded(
93 | child: Container(
94 | padding: EdgeInsets.all(8),
95 | child: Column(
96 | children: [
97 | Image.asset("images/hey_ic_voice_mode.png"),
98 | Container(
99 | padding: EdgeInsets.only(top: 5),
100 | child: Text(
101 | "语音",
102 | style: TextStyle(color: Colors.white),
103 | ),
104 | )
105 | ],
106 | ),
107 | ),
108 | ),
109 | ],
110 | ),
111 | ],
112 | ),
113 | ),
114 | ],
115 | );
116 | }
117 | }
118 |
--------------------------------------------------------------------------------
/lib/page/record/record_logic.dart:
--------------------------------------------------------------------------------
1 | /*
2 | * @Author: zxj
3 | * @Date: 2021-06-26 13:11:48
4 | * @LastEditTime: 2021-06-26 13:13:58
5 | * @Description:
6 | */
7 | import 'package:get/get.dart';
8 |
9 | import 'record_state.dart';
10 |
11 | class RecordLogic extends GetxController {
12 | @override
13 | void onReady() async {
14 | super.onReady();
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/lib/page/record/record_state.dart:
--------------------------------------------------------------------------------
1 | /*
2 | * @Author: zxj
3 | * @Date: 2021-06-26 13:11:48
4 | * @LastEditTime: 2021-06-26 13:16:41
5 | * @Description:
6 | */
7 |
8 | import 'package:a_red_book/page/record/record_logic.dart';
9 | import 'package:get/get.dart';
10 |
11 | class RecordState implements Bindings {
12 | @override
13 | void dependencies() {
14 | Get.lazyPut(() => RecordLogic());
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/lib/page/record/record_view.dart:
--------------------------------------------------------------------------------
1 | /*
2 | * @Author: zxj
3 | * @Date: 2021-06-26 13:11:48
4 | * @LastEditTime: 2021-06-27 16:46:58
5 | * @Description:
6 | */
7 | import 'package:a_red_book/page/record/components/mianContent.dart';
8 | import 'package:a_red_book/page/record/components/slivContent.dart';
9 | import 'package:a_red_book/page/record/components/sliverbar.dart';
10 | import 'package:flutter/material.dart';
11 | import 'package:flutter_screenutil/flutter_screenutil.dart';
12 | import 'package:get/get.dart';
13 | import 'package:get/get_connect/http/src/utils/utils.dart';
14 |
15 | import 'record_logic.dart';
16 | import 'package:extended_sliver/extended_sliver.dart';
17 | import 'record_state.dart';
18 |
19 | class RecordPage extends StatelessWidget {
20 | final RecordLogic logic = Get.put(RecordLogic());
21 |
22 | @override
23 | Widget build(BuildContext context) {
24 | return Scaffold(
25 | appBar: AppBar(
26 | brightness: Brightness.dark,
27 | backgroundColor: Colors.black,
28 | leading: Container(
29 | margin: EdgeInsets.all(8),
30 | child: CircleAvatar(
31 | backgroundImage: NetworkImage(
32 | "https://pic4.zhimg.com/v2-1fb998118e443cf3539def7aaee7da71_is.jpg"),
33 | ),
34 | ),
35 | title: Column(
36 | crossAxisAlignment: CrossAxisAlignment.start,
37 | children: [
38 | Text(
39 | "记录我的日常",
40 | style: TextStyle(
41 | color: Colors.white,
42 | fontSize: ScreenUtil().setSp(25),
43 | ),
44 | ),
45 | Text(
46 | "还没有记录",
47 | style: TextStyle(
48 | color: Colors.white70,
49 | fontSize: ScreenUtil().setSp(20),
50 | ),
51 | ),
52 | ],
53 | ),
54 | actions: [
55 | Container(
56 | child: IconButton(
57 | icon: Icon(
58 | Icons.close,
59 | color: Colors.white,
60 | ),
61 | onPressed: () {
62 | Get.back();
63 | },
64 | ),
65 | ),
66 | ],
67 | ),
68 | body: Container(
69 | child: _slivertabbar1(),
70 | ),
71 | );
72 | }
73 |
74 | Widget _slivertabbar1() {
75 | return Container(
76 | child: CustomScrollView(
77 | slivers: [
78 | ExtendedSliverAppbar(
79 | leading: Text(''),
80 | toolBarColor: Color(0xFF1A3445),
81 | toolbarHeight: ScreenUtil().setHeight(209),
82 | title: Sliverbar(),
83 | background: SlivContent(),
84 | ),
85 | SliverPinnedToBoxAdapter(
86 | child: Container(
87 | color: Colors.black,
88 | height: ScreenUtil().setHeight(1200),
89 | child: MainContext(),
90 | ),
91 | ),
92 | ],
93 | ),
94 | );
95 | }
96 |
97 | //
98 |
99 | Widget _slivertabbar() {
100 | return Container(
101 | child: NestedScrollView(
102 | headerSliverBuilder: (BuildContext context, bool innerBoxIsScrolled) {
103 | return [
104 | SliverAppBar(
105 | pinned: true,
106 | primary: true,
107 | title: Container(
108 | color: Colors.black,
109 | child: Text("data"),
110 | ),
111 | forceElevated: innerBoxIsScrolled,
112 | toolbarHeight: ScreenUtil().setHeight(300),
113 | expandedHeight: ScreenUtil().setHeight(500),
114 | flexibleSpace: FlexibleSpaceBar(
115 | collapseMode: CollapseMode.pin,
116 | background: Container(
117 | color: Colors.black45,
118 | child: Text(
119 | "data",
120 | style: TextStyle(color: Colors.white),
121 | ),
122 | ),
123 | ),
124 | ),
125 | ];
126 | },
127 | body: Container(
128 | child: Column(
129 | children: [
130 | Text("data"),
131 | ],
132 | )),
133 | ),
134 | );
135 | }
136 | }
137 |
--------------------------------------------------------------------------------
/lib/page/shop/components/goods.dart:
--------------------------------------------------------------------------------
1 | /*
2 | * @Author: zxj
3 | * @Date: 2021-06-15 17:01:09
4 | * @LastEditTime: 2021-06-16 09:11:26
5 | * @Description:
6 | */
7 |
8 | import 'package:a_red_book/page/shop/shop_logic.dart';
9 | import 'package:flutter/material.dart';
10 | import 'package:flutter_screenutil/flutter_screenutil.dart';
11 | import 'package:get/get.dart';
12 | import 'package:like_button/like_button.dart';
13 | import 'package:transparent_image/transparent_image.dart';
14 | import 'package:waterfall_flow/waterfall_flow.dart';
15 |
16 | class Goods extends StatelessWidget {
17 | final ShopLogic shopLogic = Get.put(ShopLogic());
18 | @override
19 | Widget build(BuildContext context) {
20 | return GetBuilder(
21 | builder: (shopLogic) => Container(
22 | child: WaterfallFlow.builder(
23 | itemCount: shopLogic.recommendList.length,
24 | gridDelegate: SliverWaterfallFlowDelegateWithFixedCrossAxisCount(
25 | crossAxisCount: 2,
26 | ),
27 | itemBuilder: (context, index) {
28 | return videoLayout(shopLogic.recommendList[index]);
29 | },
30 | ),
31 | ),
32 | );
33 | }
34 |
35 | Widget videoLayout(item) {
36 | return InkWell(
37 | onTap: () {
38 | // logic.tocontentPage(item["ismp4"]);
39 | },
40 | child: Container(
41 | width: ScreenUtil().setWidth(367),
42 | margin: EdgeInsets.all(2),
43 | decoration: BoxDecoration(
44 | color: Colors.white,
45 | borderRadius: BorderRadius.all(Radius.circular(5))),
46 | child: Column(
47 | children: [
48 | Container(
49 | child: Stack(
50 | children: [
51 | Container(
52 | height: ScreenUtil().setHeight(item["imgHight"]),
53 | width: ScreenUtil().setWidth(item["imgWidth"]),
54 | child: ClipRRect(
55 | borderRadius: BorderRadius.only(
56 | topLeft: Radius.circular(6),
57 | topRight: Radius.circular(6)),
58 | child: FadeInImage.memoryNetwork(
59 | placeholder: kTransparentImage,
60 | fit: BoxFit.cover,
61 | image: item["coverImg"],
62 | ),
63 | ),
64 | ),
65 | item["ismp4"] != true
66 | ? Text("")
67 | : Positioned(
68 | top: 0,
69 | right: 0,
70 | child: Container(
71 | margin: EdgeInsets.all(10),
72 | decoration: BoxDecoration(
73 | borderRadius: BorderRadius.circular(15),
74 | color: Colors.black26,
75 | ),
76 | child: Icon(
77 | Icons.play_arrow,
78 | color: Colors.white,
79 | size: 20,
80 | ),
81 | ),
82 | ),
83 | ],
84 | ),
85 | ),
86 | Container(
87 | padding: EdgeInsets.all(5),
88 | child: Text(
89 | item["name"],
90 | style: TextStyle(
91 | fontSize: ScreenUtil().setSp(28),
92 | fontWeight: FontWeight.bold),
93 | ),
94 | ),
95 | Container(
96 | padding: EdgeInsets.all(5),
97 | child: Row(
98 | children: [
99 | Icon(Icons.ac_unit),
100 | Text("${item["write"]}"),
101 | Spacer(),
102 | LikeButton(
103 | likeCount: int.parse(item["like"]),
104 | likeCountPadding: EdgeInsets.only(left: 0),
105 | likeBuilder: (bool) {
106 | if (bool) {
107 | return Icon(
108 | Icons.favorite,
109 | color: Colors.red,
110 | size: 22,
111 | );
112 | } else {
113 | return Icon(
114 | Icons.favorite_border,
115 | color: Colors.black26,
116 | size: 22,
117 | );
118 | }
119 | },
120 | ),
121 | ],
122 | ),
123 | )
124 | ],
125 | ),
126 | ),
127 | );
128 | }
129 | }
130 |
--------------------------------------------------------------------------------
/lib/page/shop/components/shopHead.dart:
--------------------------------------------------------------------------------
1 | /*
2 | * @Author: zxj
3 | * @Date: 2021-06-15 16:55:20
4 | * @LastEditTime: 2021-06-15 16:56:03
5 | * @Description:
6 | */
7 | import 'package:flutter/material.dart';
8 | import 'package:flutter_screenutil/flutter_screenutil.dart';
9 |
10 | class ShopHead extends StatelessWidget {
11 | @override
12 | Widget build(BuildContext context) {
13 | return Container(
14 | color: Colors.blue,
15 | padding: EdgeInsets.only(right: 10, left: 10),
16 | child: Column(
17 | children: [
18 | Row(
19 | children: [
20 | Expanded(
21 | child: Container(
22 | margin: EdgeInsets.all(5),
23 | height: ScreenUtil().setHeight(220),
24 | decoration: BoxDecoration(
25 | color: Colors.red,
26 | borderRadius: BorderRadius.all(Radius.circular(10)),
27 | ),
28 | child: Text("心动红包"),
29 | ),
30 | ),
31 | Expanded(
32 | child: Container(
33 | margin: EdgeInsets.all(5),
34 | height: ScreenUtil().setHeight(220),
35 | decoration: BoxDecoration(
36 | color: Colors.green,
37 | borderRadius: BorderRadius.all(Radius.circular(10)),
38 | ),
39 | child: Text("小清单"),
40 | ),
41 | ),
42 | ],
43 | ),
44 | Row(
45 | children: [
46 | Expanded(
47 | child: Container(
48 | margin: EdgeInsets.all(5),
49 | height: ScreenUtil().setHeight(200),
50 | decoration: BoxDecoration(
51 | color: Colors.red,
52 | borderRadius: BorderRadius.all(Radius.circular(10)),
53 | ),
54 | child: Text("大咖直播间"),
55 | ),
56 | ),
57 | Expanded(
58 | child: Container(
59 | margin: EdgeInsets.all(5),
60 | height: ScreenUtil().setHeight(200),
61 | decoration: BoxDecoration(
62 | color: Colors.red,
63 | borderRadius: BorderRadius.all(Radius.circular(10)),
64 | ),
65 | child: Text("提前强会场"),
66 | ),
67 | ),
68 | Expanded(
69 | child: Container(
70 | margin: EdgeInsets.all(5),
71 | height: ScreenUtil().setHeight(200),
72 | decoration: BoxDecoration(
73 | color: Colors.red,
74 | borderRadius: BorderRadius.all(Radius.circular(10)),
75 | ),
76 | child: Text("爆款分期免息"),
77 | ),
78 | ),
79 | ],
80 | )
81 | ],
82 | ),
83 | );
84 | }
85 | }
86 |
--------------------------------------------------------------------------------
/lib/page/shop/components/shopItem.dart:
--------------------------------------------------------------------------------
1 | /*
2 | * @Author: zxj
3 | * @Date: 2021-06-15 16:56:56
4 | * @LastEditTime: 2021-06-15 16:59:37
5 | * @Description:
6 | */
7 | import 'package:flutter/material.dart';
8 | import 'package:flutter_screenutil/flutter_screenutil.dart';
9 |
10 | class ShopItem extends StatelessWidget {
11 | @override
12 | Widget build(BuildContext context) {
13 | return Container(
14 | padding: EdgeInsets.only(right: 10, left: 10),
15 | child: Row(
16 | children: [
17 | Expanded(
18 | child: Container(
19 | margin: EdgeInsets.all(5),
20 | height: ScreenUtil().setHeight(200),
21 | decoration: BoxDecoration(
22 | borderRadius: BorderRadius.all(Radius.circular(10)),
23 | border: Border.all(width: 1, color: Colors.red),
24 | color: Colors.white,
25 | ),
26 | child: Text("新人一元抢购"),
27 | ),
28 | ),
29 | Expanded(
30 | child: Container(
31 | margin: EdgeInsets.all(5),
32 | height: ScreenUtil().setHeight(200),
33 | decoration: BoxDecoration(
34 | border: Border.all(width: 1, color: Colors.red),
35 | borderRadius: BorderRadius.all(Radius.circular(10)),
36 | color: Colors.white,
37 | ),
38 | child: Text("提前强会场"),
39 | ),
40 | ),
41 | Expanded(
42 | child: Container(
43 | margin: EdgeInsets.all(5),
44 | height: ScreenUtil().setHeight(200),
45 | decoration: BoxDecoration(
46 | border: Border.all(width: 1, color: Colors.red),
47 | borderRadius: BorderRadius.all(Radius.circular(10)),
48 | color: Colors.white,
49 | ),
50 | child: Text("爆款分期免息"),
51 | ),
52 | ),
53 | ],
54 | ),
55 | );
56 | }
57 | }
58 |
--------------------------------------------------------------------------------
/lib/page/shop/components/shopItem1.dart:
--------------------------------------------------------------------------------
1 | /*
2 | * @Author: zxj
3 | * @Date: 2021-06-15 16:58:19
4 | * @LastEditTime: 2021-06-15 16:58:28
5 | * @Description:
6 | */
7 | import 'package:flutter/material.dart';
8 | import 'package:flutter_screenutil/flutter_screenutil.dart';
9 |
10 | class ShopItem1 extends StatelessWidget {
11 | @override
12 | Widget build(BuildContext context) {
13 | return Container(
14 | padding: EdgeInsets.all(10),
15 | child: Row(
16 | children: [
17 | Expanded(
18 | child: Container(
19 | height: ScreenUtil().setHeight(500),
20 | margin: EdgeInsets.all(5),
21 | decoration: BoxDecoration(
22 | borderRadius: BorderRadius.all(Radius.circular(10)),
23 | border: Border.all(width: 1, color: Colors.red),
24 | color: Colors.white,
25 | ),
26 | child: Text("直播分享会"),
27 | ),
28 | ),
29 | Expanded(
30 | child: Column(
31 | children: [
32 | Container(
33 | width: double.infinity,
34 | height: ScreenUtil().setHeight(240),
35 | margin: EdgeInsets.all(5),
36 | decoration: BoxDecoration(
37 | borderRadius: BorderRadius.all(Radius.circular(10)),
38 | border: Border.all(width: 1, color: Colors.red),
39 | color: Colors.white,
40 | ),
41 | child: Text("data"),
42 | ),
43 | Container(
44 | width: double.infinity,
45 | margin: EdgeInsets.all(5),
46 | height: ScreenUtil().setHeight(240),
47 | decoration: BoxDecoration(
48 | borderRadius: BorderRadius.all(Radius.circular(10)),
49 | border: Border.all(width: 1, color: Colors.red),
50 | color: Colors.white,
51 | ),
52 | child: Text("data"),
53 | ),
54 | ],
55 | ),
56 | )
57 | ],
58 | ),
59 | );
60 | }
61 | }
62 |
--------------------------------------------------------------------------------
/lib/page/shop/components/shopSearch.dart:
--------------------------------------------------------------------------------
1 | /*
2 | * @Author: zxj
3 | * @Date: 2021-06-15 16:53:30
4 | * @LastEditTime: 2021-06-15 16:54:14
5 | * @Description:
6 | */
7 |
8 | import 'package:flutter/material.dart';
9 | import 'package:flutter_screenutil/flutter_screenutil.dart';
10 |
11 | class ShopSearch extends StatelessWidget {
12 | @override
13 | Widget build(BuildContext context) {
14 | return Container(
15 | padding: EdgeInsets.only(right: 15, left: 15),
16 | color: Colors.white,
17 | child: Row(
18 | children: [
19 | Container(
20 | child: Column(
21 | children: [
22 | Icon(
23 | Icons.post_add,
24 | color: Colors.black54,
25 | size: 23,
26 | ),
27 | Text(
28 | "订单",
29 | style: TextStyle(
30 | color: Colors.black87,
31 | fontSize: ScreenUtil().setSp(20),
32 | ),
33 | ),
34 | ],
35 | ),
36 | ),
37 | Expanded(
38 | child: Container(
39 | width: ScreenUtil().setWidth(500),
40 | padding: EdgeInsets.only(top: 3, left: 10, right: 10, bottom: 3),
41 | margin: EdgeInsets.only(right: 15, left: 15),
42 | decoration: BoxDecoration(
43 | borderRadius: BorderRadius.all(Radius.circular(20)),
44 | color: Color(0x0f000000),
45 | ),
46 | child: Row(
47 | children: [
48 | Icon(
49 | Icons.search,
50 | size: 18,
51 | color: Colors.black26,
52 | ),
53 | Text(
54 | "大家都在搜,美妆天花板",
55 | style: TextStyle(color: Colors.black38),
56 | ),
57 | ],
58 | ),
59 | ),
60 | ),
61 | Container(
62 | child: Column(
63 | children: [
64 | Icon(
65 | Icons.more_horiz,
66 | color: Colors.black54,
67 | size: 25,
68 | ),
69 | Text(
70 | "更多",
71 | style: TextStyle(
72 | color: Colors.black87,
73 | fontSize: ScreenUtil().setSp(20),
74 | ),
75 | ),
76 | ],
77 | ),
78 | ),
79 | ],
80 | ),
81 | );
82 | }
83 | }
84 |
--------------------------------------------------------------------------------
/lib/page/shop/shop_logic.dart:
--------------------------------------------------------------------------------
1 | /*
2 | * @Author: zxj
3 | * @Date: 2021-06-04 14:03:36
4 | * @LastEditTime: 2021-06-04 14:04:38
5 | * @Description:
6 | */
7 | import 'package:a_red_book/config/data/recommendList.dart';
8 | import 'package:get/get.dart';
9 |
10 | import 'shop_state.dart';
11 |
12 | class ShopLogic extends GetxController {
13 | List recommendList = [];
14 | @override
15 | void onReady() async {
16 | super.onReady();
17 | //获取推荐页的数据
18 | getRecommendList();
19 | print("推荐页");
20 | }
21 |
22 | //模拟网络获取数据
23 | getRecommendList() async {
24 | await Future.delayed(Duration(seconds: 1));
25 | recommendList = listitem;
26 | update();
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/lib/page/shop/shop_state.dart:
--------------------------------------------------------------------------------
1 | /*
2 | * @Author: zxj
3 | * @Date: 2021-06-04 14:03:36
4 | * @LastEditTime: 2021-06-04 14:04:30
5 | * @Description:
6 | */
7 |
8 | import 'package:a_red_book/page/shop/shop_logic.dart';
9 | import 'package:get/get.dart';
10 |
11 | class ShopState implements Bindings {
12 | @override
13 | void dependencies() {
14 | Get.lazyPut(() => ShopLogic());
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/lib/page/shop/shop_view.dart:
--------------------------------------------------------------------------------
1 | /*
2 | * @Author: zxj
3 | * @Date: 2021-06-04 14:03:36
4 | * @LastEditTime: 2021-06-24 14:24:28
5 | * @Description:
6 | */
7 | import 'package:a_red_book/page/shop/components/goods.dart';
8 | import 'package:a_red_book/page/shop/components/shopHead.dart';
9 | import 'package:a_red_book/page/shop/components/shopItem.dart';
10 | import 'package:a_red_book/page/shop/components/shopItem1.dart';
11 | import 'package:a_red_book/page/shop/components/shopSearch.dart';
12 | import 'package:flutter/material.dart';
13 | import 'package:flutter_screenutil/flutter_screenutil.dart';
14 | import 'package:get/get.dart';
15 | import 'package:bubble_tab_indicator/bubble_tab_indicator.dart';
16 |
17 | import 'shop_logic.dart';
18 | import 'shop_state.dart';
19 |
20 | class ShopPage extends StatefulWidget {
21 | @override
22 | _ShopPageState createState() => _ShopPageState();
23 | }
24 |
25 | class _ShopPageState extends State
26 | with SingleTickerProviderStateMixin {
27 | final ShopLogic logic = Get.put(ShopLogic());
28 |
29 | ScrollController _scrollViewController;
30 | TabController _tabController;
31 | List tabItem = [
32 | {"id": "1", "title": "推荐", "name": "猜你喜欢"},
33 | {"id": "2", "title": "活动", "name": "限时抢购"},
34 | {"id": "3", "title": "推荐", "name": "猜你喜欢"},
35 | {"id": "4", "title": "推荐", "name": "猜你喜欢"},
36 | {"id": "5", "title": "推荐", "name": "猜你喜欢"},
37 | {"id": "6", "title": "推荐", "name": "猜你喜欢"},
38 | {"id": "7", "title": "推荐", "name": "猜你喜欢"},
39 | ];
40 | var tabindex = 0;
41 |
42 | @override
43 | void initState() {
44 | super.initState();
45 | _scrollViewController = ScrollController(initialScrollOffset: 0.0);
46 | _tabController = TabController(vsync: this, length: tabItem.length);
47 | _tabController.addListener(() {
48 | _tabController.index;
49 | print(_tabController.index);
50 | setState(() {
51 | tabindex = _tabController.index;
52 | });
53 | });
54 | }
55 |
56 | @override
57 | void dispose() {
58 | super.dispose();
59 | _scrollViewController.dispose();
60 | _tabController.dispose();
61 | }
62 |
63 | @override
64 | Widget build(BuildContext context) {
65 | return Scaffold(
66 | floatingActionButton: FloatingActionButton(
67 | backgroundColor: Colors.black45,
68 | child: Icon(Icons.shopping_cart),
69 | onPressed: () {
70 | print('FloatingActionButton');
71 | },
72 | ),
73 | body: Container(
74 | padding: EdgeInsets.only(top: 30),
75 | child: Column(
76 | children: [
77 | ShopSearch(),
78 | Container(
79 | child: Expanded(
80 | child: NestedScrollView(
81 | controller: _scrollViewController,
82 | headerSliverBuilder:
83 | (BuildContext context, bool innerBoxIsScrolled) {
84 | return [
85 | SliverAppBar(
86 | pinned: true,
87 | floating: true,
88 | primary: false,
89 | elevation: 5,
90 | forceElevated: innerBoxIsScrolled,
91 | backgroundColor: Colors.white,
92 | expandedHeight: ScreenUtil().setHeight(1350),
93 | flexibleSpace: FlexibleSpaceBar(
94 | collapseMode: CollapseMode.pin,
95 | background: Container(
96 | color: Color(0x09000000),
97 | child: ListView(
98 | padding: EdgeInsets.all(0),
99 | physics: const NeverScrollableScrollPhysics(),
100 | children: [
101 | ShopHead(),
102 | ShopItem(),
103 | ShopItem1(),
104 | ],
105 | ),
106 | ),
107 | ),
108 | bottom: TabBar(
109 | isScrollable: true,
110 | indicator: BubbleTabIndicator(
111 | padding: EdgeInsets.only(
112 | top: -15,
113 | left: 8,
114 | right: 8,
115 | bottom: 15,
116 | ),
117 | indicatorColor: Colors.red,
118 | ),
119 | indicatorColor: Colors.white,
120 | labelColor: Colors.white,
121 | unselectedLabelColor: Color(0xff666666),
122 | labelStyle: TextStyle(
123 | fontSize: ScreenUtil().setSp(20),
124 | fontWeight: FontWeight.w600,
125 | ),
126 | unselectedLabelStyle: TextStyle(
127 | fontSize: ScreenUtil().setSp(20),
128 | fontWeight: FontWeight.w600,
129 | ),
130 | indicatorSize: TabBarIndicatorSize.label,
131 | controller: _tabController,
132 | tabs: tabItem.asMap().keys.map((e) {
133 | return Tab(
134 | icon: Text(
135 | tabItem[e]["title"],
136 | style: TextStyle(
137 | color: tabindex == e
138 | ? Colors.red
139 | : Colors.black,
140 | fontSize: ScreenUtil().setSp(25),
141 | ),
142 | ),
143 | text: tabItem[e]["name"]);
144 | }).toList(),
145 | ),
146 | ),
147 | ];
148 | },
149 | body: TabBarView(controller: _tabController, children: [
150 | Goods(),
151 | _buildListView("bbb:"),
152 | _buildListView("ccc:"),
153 | _buildListView("aaa:"),
154 | _buildListView("bbb:"),
155 | _buildListView("ccc:"),
156 | _buildListView("aaa:"),
157 | ]),
158 | ),
159 | ),
160 | ),
161 | ],
162 | ),
163 | ),
164 | );
165 | }
166 |
167 | Widget _buildListView(String s) {
168 | return ListView.separated(
169 | itemCount: 20,
170 | padding: EdgeInsets.all(0),
171 | separatorBuilder: (BuildContext context, int index) => Divider(
172 | color: Colors.grey,
173 | height: 1,
174 | ),
175 | itemBuilder: (BuildContext context, int index) {
176 | return Container(
177 | color: Colors.white, child: ListTile(title: Text("$s第$index 个条目")));
178 | },
179 | );
180 | }
181 | }
182 |
--------------------------------------------------------------------------------
/lib/page/splash_page/splash_page_logic.dart:
--------------------------------------------------------------------------------
1 | /*
2 | * @Author: zxj
3 | * @Date: 2021-05-31 15:25:43
4 | * @LastEditTime: 2021-06-01 11:35:43
5 | * @Description: 启动页面控制层
6 | */
7 | import 'package:flutter/material.dart';
8 | import 'package:flutter_screenutil/flutter_screenutil.dart';
9 | import 'package:get/get.dart';
10 | import 'package:shared_preferences/shared_preferences.dart';
11 |
12 | import 'splash_page_state.dart';
13 |
14 | class SplashPageLogic extends GetxController {
15 | @override
16 | void onReady() async {
17 | super.onReady();
18 | showUserAgreement();
19 | }
20 |
21 | //弹出用户协议
22 | showUserAgreement() async {
23 | SharedPreferences prefs = await SharedPreferences.getInstance();
24 |
25 | if (prefs.getInt('Agreement') == null) {
26 | //弹出用户协议
27 | Get.defaultDialog(
28 | title: "温馨提示",
29 | titleStyle: TextStyle(fontSize: ScreenUtil().setSp(50)),
30 | radius: 5,
31 | barrierDismissible: false,
32 | content: Container(
33 | margin: EdgeInsets.all(20),
34 | child: Column(
35 | crossAxisAlignment: CrossAxisAlignment.start,
36 | children: [
37 | Text(
38 | "欢迎来到小红书!",
39 | style: TextStyle(
40 | fontWeight: FontWeight.bold,
41 | fontSize: ScreenUtil().setSp(30),
42 | ),
43 | ),
44 | Container(
45 | padding: EdgeInsets.only(top: 10),
46 | height: ScreenUtil().setHeight(350),
47 | width: ScreenUtil().setWidth(700),
48 | child: ListView(
49 | children: [
50 | Text(
51 | "1.为给您提供发布服务,我们可能会申请手机存储权限、摄像头权限、麦克风权限;",
52 | style: TextStyle(
53 | height: 1.4, fontSize: ScreenUtil().setSp(23)),
54 | ),
55 | Text(
56 | "2.为了基于您所在的位置向您推荐内容,我们可能会申请您的位置权限;",
57 | style: TextStyle(
58 | height: 1.4, fontSize: ScreenUtil().setSp(23)),
59 | ),
60 | Text(
61 | "3.为了信息推送和账号安全,我们会申请系统设备权限收集设备信息、日志信息;",
62 | style: TextStyle(
63 | height: 1.4, fontSize: ScreenUtil().setSp(23)),
64 | ),
65 | Text(
66 | "4.为了帮助您发现更多好友,我们可能会申请通讯录权限;",
67 | style: TextStyle(
68 | height: 1.4, fontSize: ScreenUtil().setSp(23)),
69 | ),
70 | Text(
71 | "5.我们会努力采取各种安全技术保护您的个人信息,未经您同意,我们不会从第三方获取、共享或对外提供您的信息;",
72 | style: TextStyle(
73 | height: 1.4, fontSize: ScreenUtil().setSp(23)),
74 | )
75 | ],
76 | ),
77 | ),
78 | Container(
79 | padding: EdgeInsets.only(top: 15),
80 | child: Center(
81 | child: Text(
82 | "你可以阅读完整版用户协议和隐私政策",
83 | style: TextStyle(
84 | fontSize: ScreenUtil().setSp(25),
85 | fontWeight: FontWeight.w700,
86 | ),
87 | ),
88 | ),
89 | ),
90 | ],
91 | ),
92 | ),
93 | cancel: Container(
94 | width: ScreenUtil().setWidth(200),
95 | child: OutlinedButton(
96 | style: ButtonStyle(
97 | shape: MaterialStateProperty.all(
98 | StadiumBorder(side: BorderSide(color: Colors.white))),
99 | ),
100 | child: Text(
101 | "不同意",
102 | style: TextStyle(
103 | color: Colors.black38,
104 | fontWeight: FontWeight.bold,
105 | ),
106 | ),
107 | onPressed: () {
108 | //取消按钮
109 | },
110 | ),
111 | ),
112 | confirm: Container(
113 | width: ScreenUtil().setWidth(200),
114 | child: ElevatedButton(
115 | clipBehavior: Clip.antiAlias,
116 | style: ButtonStyle(
117 | backgroundColor: MaterialStateProperty.all(Colors.red),
118 | shape: MaterialStateProperty.all(
119 | StadiumBorder(side: BorderSide(color: Colors.black12))),
120 | ),
121 | child: Text(
122 | "同意",
123 | style: TextStyle(
124 | color: Colors.white,
125 | fontWeight: FontWeight.bold,
126 | ),
127 | ),
128 | onPressed: () {
129 | Get.back();
130 | prefs.setInt('Agreement', 1);
131 | //判断是否登录
132 | isLogin();
133 | },
134 | ),
135 | ),
136 | );
137 | } else {
138 | //判断是否登录
139 | isLogin();
140 | }
141 | }
142 |
143 | isLogin() async {
144 | await Future.delayed(Duration(seconds: 2));
145 | SharedPreferences prefs = await SharedPreferences.getInstance();
146 | var username = prefs.getString("userName");
147 | if (username == null) {
148 | //跳转登录页面
149 | Get.offNamed("/loginPage");
150 | } else {
151 | //跳转到首页
152 |
153 | }
154 | }
155 | }
156 |
--------------------------------------------------------------------------------
/lib/page/splash_page/splash_page_state.dart:
--------------------------------------------------------------------------------
1 | /*
2 | * @Author: zxj
3 | * @Date: 2021-05-31 15:25:43
4 | * @LastEditTime: 2021-05-31 15:38:59
5 | * @Description:
6 | */
7 |
8 | import 'package:a_red_book/page/splash_page/splash_page_logic.dart';
9 | import 'package:get/get.dart';
10 |
11 | class SphpPageState implements Bindings {
12 | @override
13 | void dependencies() {
14 | Get.lazyPut(() => SplashPageLogic());
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/lib/page/splash_page/splash_page_view.dart:
--------------------------------------------------------------------------------
1 | /*
2 | * @Author: zxj
3 | * @Date: 2021-05-31 15:25:43
4 | * @LastEditTime: 2021-06-25 10:44:25
5 | * @Description: 启动页面
6 | */
7 | import 'package:flutter/material.dart';
8 | import 'package:flutter_screenutil/flutter_screenutil.dart';
9 | import 'package:get/get.dart';
10 |
11 | import 'splash_page_logic.dart';
12 | import 'splash_page_state.dart';
13 |
14 | class SplashPagePage extends StatelessWidget {
15 | final SplashPageLogic logic = Get.put(SplashPageLogic());
16 |
17 | @override
18 | Widget build(BuildContext context) {
19 | return Scaffold(
20 | body: Center(
21 | child: Column(
22 | children: [
23 | Container(
24 | height: ScreenUtil().setHeight(180),
25 | width: ScreenUtil().setWidth(380),
26 | margin: EdgeInsets.only(top: 200),
27 | child: Image.asset(
28 | "images/common_logo.png",
29 | fit: BoxFit.fill,
30 | ),
31 | ),
32 | ],
33 | )),
34 | );
35 | }
36 | }
37 |
--------------------------------------------------------------------------------
/lib/page/swiper_content/swiper_content_logic.dart:
--------------------------------------------------------------------------------
1 | /*
2 | * @Author: zxj
3 | * @Date: 2021-06-09 11:16:36
4 | * @LastEditTime: 2021-06-09 11:17:02
5 | * @Description:
6 | */
7 | import 'package:get/get.dart';
8 |
9 | import 'swiper_content_state.dart';
10 |
11 | class SwiperContentLogic extends GetxController {
12 | @override
13 | void onReady() async {
14 | super.onReady();
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/lib/page/swiper_content/swiper_content_state.dart:
--------------------------------------------------------------------------------
1 | /*
2 | * @Author: zxj
3 | * @Date: 2021-06-09 11:16:36
4 | * @LastEditTime: 2021-06-09 11:25:10
5 | * @Description:
6 | */
7 |
8 | import 'package:a_red_book/page/swiper_content/swiper_content_logic.dart';
9 | import 'package:get/get.dart';
10 |
11 | class SwiperContentState implements Bindings {
12 | @override
13 | void dependencies() {
14 | Get.lazyPut(() => SwiperContentLogic());
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/lib/page/video/components/bottom_comment_widget.dart:
--------------------------------------------------------------------------------
1 | /*
2 | * @Author: zxj
3 | * @Date: 2021-06-08 15:15:41
4 | * @LastEditTime: 2021-06-09 10:03:43
5 | * @Description:
6 | */
7 |
8 | import 'package:a_red_book/page/video/video_logic.dart';
9 | import 'package:flutter/material.dart';
10 | import 'package:flutter_screenutil/flutter_screenutil.dart';
11 | import 'package:get/get.dart';
12 | import 'package:like_button/like_button.dart';
13 |
14 | class BottomCommentWidget extends StatelessWidget {
15 | final VideoLogic logic = Get.put(VideoLogic());
16 | List item = [
17 | {
18 | "id": "1",
19 | "comName": "c与拾荒者",
20 | "img":
21 | "https://pic4.zhimg.com/v2-1fb998118e443cf3539def7aaee7da71_is.jpg",
22 | "com": "我也好想滑雪呀!",
23 | "time": "2021.12.12"
24 | },
25 | {
26 | "id": "2",
27 | "comName": "c与拾荒者",
28 | "img":
29 | "https://pic4.zhimg.com/v2-1fb998118e443cf3539def7aaee7da71_is.jpg",
30 | "com": "我也好想滑雪呀!weweqwd非发涩发外网访问微风威锋网无法v测人",
31 | "time": "2021.12.12"
32 | },
33 | {
34 | "id": "3",
35 | "comName": "c与拾荒者",
36 | "img":
37 | "https://pic4.zhimg.com/v2-1fb998118e443cf3539def7aaee7da71_is.jpg",
38 | "com": "我也好想滑雪呀!",
39 | "time": "2021.12.12"
40 | },
41 | {
42 | "id": "4",
43 | "comName": "c与拾荒者",
44 | "img":
45 | "https://pic4.zhimg.com/v2-1fb998118e443cf3539def7aaee7da71_is.jpg",
46 | "com": "我也好想滑雪呀!",
47 | "time": "2021.12.12"
48 | },
49 | {
50 | "id": "5",
51 | "comName": "c与拾荒者",
52 | "img":
53 | "https://pic4.zhimg.com/v2-1fb998118e443cf3539def7aaee7da71_is.jpg",
54 | "com": "我也好想滑雪呀威风威风威风嗡嗡嗡微软微软为!",
55 | "time": "2021.12.12"
56 | },
57 | {
58 | "id": "6",
59 | "comName": "c与拾荒者",
60 | "img":
61 | "https://pic4.zhimg.com/v2-1fb998118e443cf3539def7aaee7da71_is.jpg",
62 | "com": "我也好想滑雪呀!",
63 | "time": "2021.12.12"
64 | },
65 | {
66 | "id": "7",
67 | "comName": "c与拾荒者",
68 | "img":
69 | "https://pic4.zhimg.com/v2-1fb998118e443cf3539def7aaee7da71_is.jpg",
70 | "com": "我也好想滑雪呀!",
71 | "time": "2021.12.12"
72 | },
73 | {
74 | "id": "8",
75 | "comName": "c与拾荒者",
76 | "img":
77 | "https://pic4.zhimg.com/v2-1fb998118e443cf3539def7aaee7da71_is.jpg",
78 | "com": "我也好想滑雪呀!",
79 | "time": "2021.12.12"
80 | },
81 | {
82 | "id": "9",
83 | "comName": "c与拾荒者",
84 | "img":
85 | "https://pic4.zhimg.com/v2-1fb998118e443cf3539def7aaee7da71_is.jpg",
86 | "com": "我也好想滑雪呀!",
87 | "time": "2021.12.12"
88 | },
89 | ];
90 | @override
91 | Widget build(BuildContext context) {
92 | return Container(
93 | height: ScreenUtil().setHeight(750),
94 | child: GetBuilder(
95 | builder: (logic) => Column(
96 | children: [
97 | _headCom(),
98 | Divider(
99 | height: 1,
100 | ),
101 | _comment(),
102 | _writeComment(logic.commentbutton),
103 | ],
104 | ),
105 | ),
106 | );
107 | }
108 |
109 | Widget _headCom() {
110 | return Container(
111 | padding: EdgeInsets.all(10),
112 | child: Stack(
113 | children: [
114 | Center(
115 | child: Text("共 6 条评论"),
116 | ),
117 | Positioned(
118 | right: 0,
119 | child: InkWell(
120 | onTap: () {
121 | Get.back();
122 | },
123 | child: Icon(
124 | Icons.close,
125 | color: Colors.black45,
126 | size: 20,
127 | ),
128 | ),
129 | )
130 | ],
131 | ),
132 | );
133 | }
134 |
135 | Widget _comment() {
136 | return Expanded(
137 | child: ListView.builder(
138 | itemCount: item.length,
139 | itemBuilder: (context, index) {
140 | return Container(
141 | child: ListTile(
142 | leading: CircleAvatar(
143 | backgroundImage: NetworkImage(item[index]["img"]),
144 | ),
145 | title: Text(
146 | "${item[index]["comName"]}",
147 | style: TextStyle(
148 | color: Colors.black54, fontSize: ScreenUtil().setSp(20)),
149 | ),
150 | subtitle: Row(
151 | children: [
152 | Expanded(
153 | child: Text(
154 | "${item[index]["com"]}",
155 | style: TextStyle(
156 | color: Colors.black,
157 | ),
158 | ),
159 | ),
160 | Text(
161 | "${item[index]["time"]}",
162 | style: TextStyle(
163 | color: Colors.black54,
164 | fontSize: ScreenUtil().setSp(15)),
165 | ),
166 | ],
167 | ),
168 | trailing: Icon(Icons.favorite_border),
169 | ),
170 | );
171 | },
172 | ),
173 | );
174 | }
175 |
176 | Widget _writeComment(value) {
177 | return Container(
178 | child: Column(
179 | children: [
180 | Divider(height: 1),
181 | Row(
182 | children: [
183 | Expanded(
184 | child: Container(
185 | margin:
186 | EdgeInsets.only(top: 8, bottom: 8, right: 20, left: 20),
187 | padding:
188 | EdgeInsets.only(top: 5, bottom: 5, right: 10, left: 10),
189 | decoration: BoxDecoration(
190 | color: Colors.black12,
191 | borderRadius: BorderRadius.all(Radius.circular(20)),
192 | ),
193 | child: Row(
194 | children: [
195 | Container(
196 | height: ScreenUtil().setHeight(40),
197 | width: ScreenUtil().setWidth(430),
198 | child: TextField(
199 | decoration: InputDecoration(
200 | hintText: "说点什么吧!万一火了呢?",
201 | hintStyle:
202 | TextStyle(fontSize: ScreenUtil().setSp(25)),
203 | filled: false,
204 | isCollapsed: true,
205 | border: InputBorder.none,
206 | ),
207 | onChanged: (value) {
208 | logic.controlCommentbutton(value);
209 | },
210 | ),
211 | ),
212 | Spacer(),
213 | Container(
214 | padding: EdgeInsets.only(right: 8),
215 | child: Icon(
216 | Icons.alternate_email,
217 | size: 20,
218 | color: Colors.black54,
219 | ),
220 | ),
221 | Icon(
222 | Icons.sentiment_satisfied,
223 | size: 20,
224 | color: Colors.black54,
225 | ),
226 | ],
227 | ),
228 | ),
229 | ),
230 | value == false
231 | ? Container()
232 | : Container(
233 | height: ScreenUtil().setHeight(50),
234 | margin: EdgeInsets.only(right: 5),
235 | child: ElevatedButton(
236 | style: ButtonStyle(
237 | backgroundColor:
238 | MaterialStateProperty.all(Colors.blue[400]),
239 | shape: MaterialStateProperty.all(StadiumBorder(
240 | side: BorderSide(color: Colors.white, width: 0))),
241 | ),
242 | child: Text(
243 | "发送",
244 | style: TextStyle(color: Colors.white),
245 | ),
246 | onPressed: () {
247 | print("发送评论");
248 | },
249 | ),
250 | ),
251 | ],
252 | )
253 | ],
254 | ),
255 | );
256 | }
257 | }
258 |
--------------------------------------------------------------------------------
/lib/page/video/components/bottom_share_widget.dart:
--------------------------------------------------------------------------------
1 | /*
2 | * @Author: zxj
3 | * @Date: 2021-06-07 16:26:41
4 | * @LastEditTime: 2021-06-08 15:10:37
5 | * @Description:
6 | */
7 |
8 | import 'package:flutter/material.dart';
9 | import 'package:flutter_screenutil/flutter_screenutil.dart';
10 | import 'package:get/get.dart';
11 |
12 | class BottomshareWidget extends StatelessWidget {
13 | List item = [
14 | {
15 | "id": "1",
16 | "image": "images/sharesdk_icon_friend.png",
17 | "name": "站内好友",
18 | "topage": "站内好友"
19 | },
20 | {
21 | "id": "2",
22 | "image": "images/sharesdk_icon_qq.png",
23 | "name": "微信好友",
24 | "topage": "微信好友"
25 | },
26 | {
27 | "id": "3",
28 | "image": "images/sharesdk_icon_qzone.png",
29 | "name": "朋友圈",
30 | "topage": "朋友圈"
31 | },
32 | {
33 | "id": "4",
34 | "image": "images/sharesdk_icon_wechat_moment.png",
35 | "name": "QQ好友",
36 | "topage": ""
37 | },
38 | {
39 | "id": "5",
40 | "image": "images/sharesdk_icon_wechat.png",
41 | "name": "QQ空间",
42 | "topage": ""
43 | },
44 | ];
45 | List item2 = [
46 | {
47 | "id": "1",
48 | "image": "images/sharesdk_icon_cover_shot.png",
49 | "name": "生成分享图",
50 | "topage": "站内好友"
51 | },
52 | {
53 | "id": "2",
54 | "image": "images/sharesdk_icon_download_video.png",
55 | "name": "下载",
56 | "topage": "微信好友"
57 | },
58 | {
59 | "id": "3",
60 | "image": "images/sharesdk_icon_video_speed_setting_c.png",
61 | "name": "播放速度",
62 | "topage": "朋友圈"
63 | },
64 | {
65 | "id": "4",
66 | "image": "images/sharesdk_icon_not_like.png",
67 | "name": "不喜欢",
68 | "topage": ""
69 | },
70 | {
71 | "id": "5",
72 | "image": "images/sharesdk_icon_report.png",
73 | "name": "举报",
74 | "topage": ""
75 | },
76 | {
77 | "id": "6",
78 | "image": "images/sharesdk_icon_settings.png",
79 | "name": "设置",
80 | "topage": ""
81 | },
82 | ];
83 | @override
84 | Widget build(BuildContext context) {
85 | return Container(
86 | height: ScreenUtil().setHeight(470),
87 | padding: EdgeInsets.all(10),
88 | child: Column(
89 | children: [
90 | Center(
91 | child: Text("分享至"),
92 | ),
93 | Container(
94 | padding: EdgeInsets.only(bottom: 15),
95 | child: Row(
96 | children: item.map(
97 | (e) {
98 | return Expanded(
99 | child: InkWell(
100 | onTap: () {
101 | print(e["topage"]);
102 | },
103 | child: Column(
104 | children: [
105 | Container(
106 | margin: EdgeInsets.only(top: 10, bottom: 5),
107 | height: ScreenUtil().setHeight(80),
108 | width: ScreenUtil().setWidth(80),
109 | child: Image.asset(e["image"]),
110 | ),
111 | Text(
112 | "${e["name"]}",
113 | style: TextStyle(
114 | fontSize: ScreenUtil().setSp(20),
115 | ),
116 | ),
117 | ],
118 | ),
119 | ),
120 | );
121 | },
122 | ).toList(),
123 | ),
124 | ),
125 | Container(
126 | padding: EdgeInsets.only(right: 15, left: 15),
127 | child: Divider(height: 1, color: Colors.black12),
128 | ),
129 | Container(
130 | width: ScreenUtil().setHeight(750),
131 | height: ScreenUtil().setHeight(180),
132 | padding: EdgeInsets.all(10),
133 | child: ListView.builder(
134 | // physics: const NeverScrollableScrollPhysics(),
135 | // shrinkWrap: true,
136 | scrollDirection: Axis.horizontal,
137 | itemCount: item2.length,
138 | itemBuilder: (context, index) {
139 | return Container(
140 | margin: EdgeInsets.only(right: 35),
141 | child: InkWell(
142 | onTap: () {
143 | print(item2[index]["topage"]);
144 | },
145 | child: Column(
146 | children: [
147 | Container(
148 | margin: EdgeInsets.only(top: 5),
149 | height: ScreenUtil().setHeight(80),
150 | width: ScreenUtil().setWidth(80),
151 | child: Image.asset(item2[index]["image"]),
152 | ),
153 | Text(
154 | "${item2[index]["name"]}",
155 | style: TextStyle(
156 | fontSize: ScreenUtil().setSp(20),
157 | ),
158 | ),
159 | ],
160 | ),
161 | ),
162 | );
163 | },
164 | ),
165 | ),
166 | Container(
167 | padding: EdgeInsets.only(right: 15, left: 15),
168 | child: Divider(height: 1, color: Colors.black12),
169 | ),
170 | InkWell(
171 | onTap: () {
172 | Navigator.pop(context);
173 | },
174 | child: Center(
175 | child: Container(
176 | padding: EdgeInsets.only(top: 7),
177 | child: Text(
178 | "取消",
179 | style: TextStyle(
180 | color: Colors.black45, fontSize: ScreenUtil().setSp(30)),
181 | ),
182 | ),
183 | ),
184 | ),
185 | ],
186 | ),
187 | );
188 | }
189 | }
190 |
--------------------------------------------------------------------------------
/lib/page/video/components/like_gesture_widget.dart:
--------------------------------------------------------------------------------
1 | import 'dart:async';
2 | import 'dart:math';
3 |
4 | import 'package:flutter/material.dart';
5 |
6 | /// 视频手势封装
7 | /// 单击:暂停
8 | /// 连击:点赞
9 | class LikeGestureWidget extends StatefulWidget {
10 | const LikeGestureWidget({
11 | Key key,
12 | @required this.child,
13 | this.onAddFavorite,
14 | this.onSingleTap,
15 | }) : super(key: key);
16 |
17 | final Function onAddFavorite;
18 | final Function onSingleTap;
19 | final Widget child;
20 |
21 | @override
22 | _LikeGestureWidgetState createState() => _LikeGestureWidgetState();
23 | }
24 |
25 | class _LikeGestureWidgetState extends State {
26 | GlobalKey _key = GlobalKey();
27 | List icons = [];
28 | int lastMilliSeconds = -1;
29 |
30 | @override
31 | Widget build(BuildContext context) {
32 | return GestureDetector(
33 | key: _key,
34 | onTapDown: (detail) {
35 | setState(() {
36 | int currentMilliSeconds = DateTime.now().millisecondsSinceEpoch;
37 | int diff = currentMilliSeconds - lastMilliSeconds;
38 | if (diff < 500) {
39 | icons.add(_convertPosition(detail.globalPosition));
40 | widget.onAddFavorite?.call();
41 | } else {
42 | widget.onSingleTap?.call();
43 | }
44 | });
45 | },
46 | onTapUp: (detail) {
47 | lastMilliSeconds = DateTime.now().millisecondsSinceEpoch;
48 | },
49 | child: Stack(
50 | children: [
51 | widget.child,
52 | _getIconStack(),
53 | ],
54 | ),
55 | );
56 | }
57 |
58 | // 内部转换坐标点
59 | Offset _convertPosition(Offset p) {
60 | RenderBox getBox = _key.currentContext.findRenderObject();
61 | return getBox.globalToLocal(p);
62 | }
63 |
64 | _getIconStack() {
65 | return Stack(
66 | children: icons
67 | .map(
68 | (position) => TikTokFavoriteAnimationIcon(
69 | key: Key(position.toString()),
70 | position: position,
71 | onAnimationComplete: () {
72 | icons.remove(position);
73 | },
74 | ),
75 | )
76 | .toList(),
77 | );
78 | }
79 | }
80 |
81 | class TikTokFavoriteAnimationIcon extends StatefulWidget {
82 | final Offset position;
83 | final double size;
84 | final Function onAnimationComplete;
85 |
86 | const TikTokFavoriteAnimationIcon({
87 | Key key,
88 | this.onAnimationComplete,
89 | this.position,
90 | this.size: 200,
91 | }) : super(key: key);
92 |
93 | @override
94 | _TikTokFavoriteAnimationIconState createState() =>
95 | _TikTokFavoriteAnimationIconState();
96 | }
97 |
98 | class _TikTokFavoriteAnimationIconState
99 | extends State with TickerProviderStateMixin {
100 | AnimationController _animationController;
101 |
102 | double rotate = pi / 10.0 * (2 * Random().nextDouble() - 1);
103 |
104 | double appearDuration = 0.1;
105 |
106 | double dismissDuration = 0.8;
107 |
108 | @override
109 | void initState() {
110 | _animationController = AnimationController(
111 | lowerBound: 0,
112 | upperBound: 1,
113 | duration: Duration(milliseconds: 1000),
114 | vsync: this,
115 | );
116 |
117 | _animationController.addListener(() {
118 | setState(() {});
119 | });
120 | startAnimation();
121 | super.initState();
122 | }
123 |
124 | @override
125 | void dispose() {
126 | _animationController?.dispose();
127 | super.dispose();
128 | }
129 |
130 | //开始动画
131 | startAnimation() async {
132 | await _animationController.forward();
133 | widget.onAnimationComplete?.call();
134 | }
135 |
136 | @override
137 | Widget build(BuildContext context) {
138 | return widget.position == null
139 | ? Container()
140 | : Positioned(
141 | left: widget.position.dx - widget.size / 2,
142 | top: widget.position.dy - widget.size,
143 | child: _getBody(),
144 | );
145 | }
146 |
147 | //获取动画的值
148 | double get value => _animationController?.value;
149 |
150 | double get opacity {
151 | if (value < appearDuration) {
152 | return 0.9 / appearDuration * value;
153 | }
154 | if (value < dismissDuration) {
155 | return 0.9;
156 | }
157 | var res = 0.9 - (value - dismissDuration) / (1 - dismissDuration);
158 | return res < 0 ? 0 : res;
159 | }
160 |
161 | double get scale {
162 | if (value <= 0.5) {
163 | return 0.6 + value / 0.5 * 0.5;
164 | } else if (value <= 0.8) {
165 | return 1.1 * (1 / 1.1 + (1.1 - 1) / 1.1 * (value - 0.8) / 0.25);
166 | } else {
167 | return 1 + (value - 0.8) / 0.2 * 0.5;
168 | }
169 | }
170 |
171 | _getBody() {
172 | return Transform.rotate(
173 | angle: rotate,
174 | child: Opacity(
175 | opacity: opacity,
176 | child: Transform.scale(
177 | alignment: Alignment.bottomCenter,
178 | scale: scale,
179 | child: _getContent(),
180 | ),
181 | ),
182 | );
183 | }
184 |
185 | _getContent() {
186 | return ShaderMask(
187 | child: _getChild(),
188 | blendMode: BlendMode.srcATop,
189 | shaderCallback: (Rect bounds) => RadialGradient(
190 | center: Alignment.topLeft.add(Alignment(0.5, 0.5)),
191 | colors: [
192 | Color(0xffEF6F6F),
193 | Color(0xffF03E3E),
194 | ],
195 | ).createShader(bounds),
196 | );
197 | }
198 |
199 | _getChild() {
200 | return Image.asset(
201 | 'images/red_heart.webp',
202 | width: widget.size,
203 | height: widget.size,
204 | );
205 | }
206 | }
207 |
--------------------------------------------------------------------------------
/lib/page/video/video_logic.dart:
--------------------------------------------------------------------------------
1 | /*
2 | * @Author: zxj
3 | * @Date: 2021-06-06 11:00:18
4 | * @LastEditTime: 2021-06-26 11:45:14
5 | * @Description:
6 | */
7 | import 'package:get/get.dart';
8 |
9 | import 'video_state.dart';
10 |
11 | class VideoLogic extends GetxController {
12 | bool commentbutton = false;
13 | @override
14 | void onReady() async {
15 | super.onReady();
16 | }
17 |
18 | getdt(v) {
19 | print(v);
20 | }
21 |
22 | //控制评论发送按钮
23 | controlCommentbutton(value) {
24 | print(value);
25 | if (value == null || value == "") {
26 | commentbutton = false;
27 | } else {
28 | commentbutton = true;
29 | }
30 | update();
31 | }
32 | }
33 |
--------------------------------------------------------------------------------
/lib/page/video/video_state.dart:
--------------------------------------------------------------------------------
1 | /*
2 | * @Author: zxj
3 | * @Date: 2021-06-06 11:00:18
4 | * @LastEditTime: 2021-06-06 11:40:50
5 | * @Description:
6 | */
7 | import 'package:a_red_book/page/video/video_logic.dart';
8 | import 'package:get/get.dart';
9 |
10 | class VideoState implements Bindings {
11 | @override
12 | void dependencies() {
13 | Get.lazyPut(() => VideoLogic());
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/lib/page/video/video_view.dart:
--------------------------------------------------------------------------------
1 | /*
2 | * @Author: zxj
3 | * @Date: 2021-06-06 11:00:18
4 | * @LastEditTime: 2021-06-26 11:58:55
5 | * @Description:
6 | */
7 | import 'package:flutter/material.dart';
8 | import 'package:flutter_screenutil/flutter_screenutil.dart';
9 | import 'package:get/get.dart';
10 |
11 | import 'components/videoitem.dart';
12 | import 'video_logic.dart';
13 | import 'video_state.dart';
14 |
15 | class VideoPage extends StatelessWidget {
16 | final VideoLogic logic = Get.put(VideoLogic());
17 | List list = ["第一页", "第二页", "第三页", "第四页", "第五页"];
18 | @override
19 | Widget build(BuildContext context) {
20 | return Container(
21 | width: ScreenUtil().setWidth(750),
22 | child: PageView.builder(
23 | /// pageview中 子条目的个数
24 | itemCount: list.length,
25 |
26 | /// 上下滑动
27 | scrollDirection: Axis.vertical,
28 | itemBuilder: (BuildContext context, int index) {
29 | return buildPageViewItemWidget(list[index]);
30 | },
31 | ),
32 | );
33 | }
34 |
35 | Widget buildPageViewItemWidget(list) {
36 | return Container(child: VideoItem());
37 | }
38 | }
39 |
--------------------------------------------------------------------------------
/lib/routes/app_pages.dart:
--------------------------------------------------------------------------------
1 | /*
2 | * @Author: zxj
3 | * @Date: 2021-05-31 15:41:00
4 | * @LastEditTime: 2021-06-26 13:44:51
5 | * @Description: 路由管理
6 | */
7 | import 'package:a_red_book/page/add_note/add_note_state.dart';
8 | import 'package:a_red_book/page/add_note/add_note_view.dart';
9 | import 'package:a_red_book/page/find/find_state.dart';
10 | import 'package:a_red_book/page/find/find_view.dart';
11 | import 'package:a_red_book/page/index/index_state.dart';
12 | import 'package:a_red_book/page/index/index_view.dart';
13 | import 'package:a_red_book/page/login/login_state.dart';
14 | import 'package:a_red_book/page/login/login_view.dart';
15 | import 'package:a_red_book/page/mycenter/mycenter_state.dart';
16 | import 'package:a_red_book/page/mycenter/mycenter_view.dart';
17 | import 'package:a_red_book/page/news/news_state.dart';
18 | import 'package:a_red_book/page/news/news_view.dart';
19 | import 'package:a_red_book/page/record/record_state.dart';
20 | import 'package:a_red_book/page/record/record_view.dart';
21 | import 'package:a_red_book/page/shop/shop_state.dart';
22 | import 'package:a_red_book/page/shop/shop_view.dart';
23 | import 'package:a_red_book/page/splash_page/splash_page_state.dart';
24 | import 'package:a_red_book/page/splash_page/splash_page_view.dart';
25 | import 'package:a_red_book/page/swiper_content/swiper_content_state.dart';
26 | import 'package:a_red_book/page/swiper_content/swiper_content_view.dart';
27 | import 'package:a_red_book/page/video/video_state.dart';
28 | import 'package:a_red_book/page/video/video_view.dart';
29 | import 'package:get/get.dart';
30 |
31 | part './app_routes.dart';
32 |
33 | abstract class AppPages {
34 | static final pages = [
35 | GetPage(
36 | name: Routes.SplashPagePage,
37 | page: () => SplashPagePage(),
38 | binding: SphpPageState(),
39 | ),
40 | GetPage(
41 | name: Routes.loginPage,
42 | page: () => LoginPage(),
43 | binding: LoginState(),
44 | ),
45 | GetPage(
46 | name: Routes.indexPage,
47 | page: () => IndexPage(),
48 | binding: IndexState(),
49 | ),
50 | GetPage(
51 | name: Routes.findPage,
52 | page: () => FindPage(),
53 | binding: FindState(),
54 | ),
55 | GetPage(
56 | name: Routes.shopPage,
57 | page: () => ShopPage(),
58 | binding: ShopState(),
59 | ),
60 | GetPage(
61 | name: Routes.newsPage,
62 | page: () => NewsPage(),
63 | binding: NewsState(),
64 | ),
65 | GetPage(
66 | name: Routes.mycenterPage,
67 | page: () => MycenterPage(),
68 | binding: MycenterState(),
69 | ),
70 | GetPage(
71 | name: Routes.videoPage,
72 | page: () => VideoPage(),
73 | binding: VideoState(),
74 | ),
75 | GetPage(
76 | name: Routes.swiperContentPage,
77 | page: () => SwiperContentPage(),
78 | binding: SwiperContentState(),
79 | ),
80 | GetPage(
81 | name: Routes.addNotePage,
82 | page: () => AddNotePage(),
83 | binding: AddNoteState(),
84 | transition: Transition.downToUp,
85 | ),
86 | GetPage(
87 | name: Routes.recordPage,
88 | page: () => RecordPage(),
89 | binding: RecordState(),
90 | transition: Transition.leftToRight,
91 | ),
92 | ];
93 | }
94 |
--------------------------------------------------------------------------------
/lib/routes/app_routes.dart:
--------------------------------------------------------------------------------
1 | /*
2 | * @Author: zxj
3 | * @Date: 2021-05-31 15:41:00
4 | * @LastEditTime: 2021-06-26 13:17:29
5 | * @Description: 路由配置
6 | */
7 | part of './app_pages.dart';
8 |
9 | abstract class Routes {
10 | static const INITIAL = '/';
11 | static const SplashPagePage = '/SplashPagePage'; //启动页面
12 | static const loginPage = '/loginPage'; //登陆页面
13 | static const indexPage = '/indexPage'; //配置底部导航栏页面
14 | static const findPage = '/findPage'; //首页发现页面
15 | static const shopPage = '/shopPage'; //商城
16 | static const newsPage = '/newsPage'; //消息
17 |
18 | static const mycenterPage = '/mycenterPage'; //我的中心
19 | static const videoPage = '/videoPage'; //视频页面
20 |
21 | static const swiperContentPage = '/swiperContentPage'; //轮播图内容页面
22 |
23 | static const addNotePage = '/addNotePage'; //添加笔记页面
24 |
25 | static const recordPage = '/recordPage'; //记录自己的日常页面
26 |
27 | }
28 |
--------------------------------------------------------------------------------
/pubspec.yaml:
--------------------------------------------------------------------------------
1 | name: a_red_book
2 | description: A new Flutter project.
3 |
4 | # The following line prevents the package from being accidentally published to
5 | # pub.dev using `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.7.0 <3.0.0"
22 |
23 | dependencies:
24 | flutter:
25 | sdk: flutter
26 | # 状态管理
27 | get: ^4.1.4
28 | # 网络请求
29 | dio: ^4.0.0
30 | # 加载框
31 | flutter_easyloading: ^3.0.0
32 | # 土司
33 | fluttertoast: ^8.0.6
34 | # 屏幕适配
35 | flutter_screenutil: ^5.0.0+2
36 | # 缓存
37 | shared_preferences: ^2.0.6
38 | # 视频播放
39 | video_player: ^2.1.4
40 | # 底部部选项卡
41 | persistent_bottom_nav_bar: ^4.0.2
42 | # 喜欢按钮
43 | like_button: ^2.0.2
44 | # 缓存图片
45 | transparent_image: ^2.0.0
46 | # 瀑布流布局
47 | waterfall_flow: ^3.0.1
48 | # 超级提示工具,可以用到长按视频弹出操作框
49 | super_tooltip: ^1.0.1
50 | # easy_popup
51 | easy_popup: ^1.0.0
52 | extended_sliver: ^2.0.0
53 | # 进度条
54 | audio_video_progress_bar: ^0.4.0
55 | # 轮播图
56 | flutter_swiper: ^1.1.6
57 | # 图片视频选择
58 | images_picker: ^1.2.4
59 | # tabbar 气泡样式
60 | bubble_tab_indicator: ^0.1.6
61 | # 联动tabbar
62 | extended_tabs: ^2.2.0
63 | #下拉刷新
64 | flutter_easyrefresh: ^2.2.1
65 |
66 |
67 |
68 | # The following adds the Cupertino Icons font to your application.
69 | # Use with the CupertinoIcons class for iOS style icons.
70 | cupertino_icons: ^1.0.2
71 |
72 | dev_dependencies:
73 | flutter_test:
74 | sdk: flutter
75 |
76 | # For information on the generic Dart part of this file, see the
77 | # following page: https://dart.dev/tools/pub/pubspec
78 |
79 | # The following section is specific to Flutter.
80 | flutter:
81 |
82 | # The following line ensures that the Material Icons font is
83 | # included with your application, so that you can use the icons in
84 | # the material Icons class.
85 | uses-material-design: true
86 |
87 | # To add assets to your application, add an assets section, like this:
88 | assets:
89 | - images/
90 | - images/common_logo.png
91 | - images/b2.mp4
92 | - images/xhs_1623045190083.mp4
93 | - images/xhs_1623045207024.mp4
94 | - images/login_icon_welcome_phone_v3.png
95 | - images/login_icon_welcome_qq_v3.png
96 | - images/login_icon_welcome_weibo_v3.png
97 | - images/login_icon_welcome_weixin_v3.png
98 | - images/im_chat_comment_at_ic_v2.png
99 | - images/im_chat_fans_ic_v2.png
100 | - images/im_chat_like_collect_ic_v2.png
101 | - images/im_chat_push_notification_ic_v2.png
102 | - images/im_chat_sys_notification_ic_v2.png
103 | - images/matrix_profile_head_bg_default.webp
104 | - images/hey_detail_msg_send.png
105 | - images/hey_ic_home_menu.png
106 | - images/red_heart.webp
107 |
108 | # An image asset can refer to one or more resolution-specific "variants", see
109 | # https://flutter.dev/assets-and-images/#resolution-aware.
110 |
111 | # For details regarding adding assets from package dependencies, see
112 | # https://flutter.dev/assets-and-images/#from-packages
113 |
114 | # To add custom fonts to your application, add a fonts section here,
115 | # in this "flutter" section. Each entry in this list should have a
116 | # "family" key with the font family name, and a "fonts" key with a
117 | # list giving the asset and other descriptors for the font. For
118 | # example:
119 | # fonts:
120 | # - family: Schyler
121 | # fonts:
122 | # - asset: fonts/Schyler-Regular.ttf
123 | # - asset: fonts/Schyler-Italic.ttf
124 | # style: italic
125 | # - family: Trajan Pro
126 | # fonts:
127 | # - asset: fonts/TrajanPro.ttf
128 | # - asset: fonts/TrajanPro_Bold.ttf
129 | # weight: 700
130 | #
131 | # For details regarding fonts from package dependencies,
132 | # see https://flutter.dev/custom-fonts/#from-packages
133 |
--------------------------------------------------------------------------------
/test/widget_test.dart:
--------------------------------------------------------------------------------
1 | /*
2 | * @Author: zxj
3 | * @Date: 2021-05-31 13:41:44
4 | * @LastEditTime: 2021-05-31 15:19:03
5 | * @Description:
6 | */
7 | // This is a basic Flutter widget test.
8 | //
9 | // To perform an interaction with a widget in your test, use the WidgetTester
10 | // utility that Flutter provides. For example, you can send tap and scroll
11 | // gestures. You can also use WidgetTester to find child widgets in the widget
12 | // tree, read text, and verify that the values of widget properties are correct.
13 |
14 | import 'package:flutter/material.dart';
15 | import 'package:flutter_test/flutter_test.dart';
16 |
17 | import 'package:a_red_book/main.dart';
18 |
19 | void main() {
20 | testWidgets('Counter increments smoke test', (WidgetTester tester) async {
21 | // Build our app and trigger a frame.
22 | // await tester.pumpWidget(MyApp());
23 |
24 | // Verify that our counter starts at 0.
25 | expect(find.text('0'), findsOneWidget);
26 | expect(find.text('1'), findsNothing);
27 |
28 | // Tap the '+' icon and trigger a frame.
29 | await tester.tap(find.byIcon(Icons.add));
30 | await tester.pump();
31 |
32 | // Verify that our counter has incremented.
33 | expect(find.text('0'), findsNothing);
34 | expect(find.text('1'), findsOneWidget);
35 | });
36 | }
37 |
--------------------------------------------------------------------------------
/web/favicon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zhou-Flutter/flutter_dome/f507a4464f0cc6865e534e0b28c66dc8ec162dcd/web/favicon.png
--------------------------------------------------------------------------------
/web/icons/Icon-192.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zhou-Flutter/flutter_dome/f507a4464f0cc6865e534e0b28c66dc8ec162dcd/web/icons/Icon-192.png
--------------------------------------------------------------------------------
/web/icons/Icon-512.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zhou-Flutter/flutter_dome/f507a4464f0cc6865e534e0b28c66dc8ec162dcd/web/icons/Icon-512.png
--------------------------------------------------------------------------------
/web/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 | a_red_book
30 |
31 |
32 |
33 |
36 |
43 |
44 |
45 |
46 |
--------------------------------------------------------------------------------
/web/manifest.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "a_red_book",
3 | "short_name": "a_red_book",
4 | "start_url": ".",
5 | "display": "standalone",
6 | "background_color": "#0175C2",
7 | "theme_color": "#0175C2",
8 | "description": "A new Flutter project.",
9 | "orientation": "portrait-primary",
10 | "prefer_related_applications": false,
11 | "icons": [
12 | {
13 | "src": "icons/Icon-192.png",
14 | "sizes": "192x192",
15 | "type": "image/png"
16 | },
17 | {
18 | "src": "icons/Icon-512.png",
19 | "sizes": "512x512",
20 | "type": "image/png"
21 | }
22 | ]
23 | }
24 |
--------------------------------------------------------------------------------