├── .github └── workflows │ └── build.yml ├── .gitignore ├── .metadata ├── .vscode ├── launch.json └── settings.json ├── LICENSE ├── README.md ├── analysis_options.yaml ├── android ├── .gitignore ├── app │ ├── build.gradle │ └── src │ │ ├── debug │ │ └── AndroidManifest.xml │ │ ├── main │ │ ├── AndroidManifest.xml │ │ ├── ic_launcher-playstore.png │ │ ├── kotlin │ │ │ └── com │ │ │ │ └── example │ │ │ │ └── flutter_v2ex │ │ │ │ └── MainActivity.kt │ │ └── res │ │ │ ├── drawable-hdpi │ │ │ ├── ic_launcher_foreground.png │ │ │ ├── ic_launcher_round.png │ │ │ └── ic_stat_name.png │ │ │ ├── drawable-mdpi │ │ │ ├── ic_launcher_foreground.png │ │ │ ├── ic_launcher_round.png │ │ │ └── ic_stat_name.png │ │ │ ├── drawable-v21 │ │ │ └── launch_background.xml │ │ │ ├── drawable-xhdpi │ │ │ ├── ic_launcher_foreground.png │ │ │ ├── ic_launcher_round.png │ │ │ └── ic_stat_name.png │ │ │ ├── drawable-xxhdpi │ │ │ ├── ic_launcher_foreground.png │ │ │ ├── ic_launcher_round.png │ │ │ └── ic_stat_name.png │ │ │ ├── drawable-xxxhdpi │ │ │ ├── ic_launcher_foreground.png │ │ │ ├── ic_launcher_round.png │ │ │ └── ic_stat_name.png │ │ │ ├── drawable │ │ │ ├── app_icon.png │ │ │ ├── ic_launcher_background.xml │ │ │ ├── icon_hot.png │ │ │ ├── icon_search.png │ │ │ ├── icon_sign.png │ │ │ └── launch_background.xml │ │ │ ├── mipmap-anydpi-v26 │ │ │ ├── ic_launcher.xml │ │ │ └── ic_launcher_round.xml │ │ │ ├── mipmap-hdpi │ │ │ ├── ic_launcher.png │ │ │ ├── ic_launcher_foreground.png │ │ │ └── ic_launcher_round.png │ │ │ ├── mipmap-mdpi │ │ │ ├── ic_launcher.png │ │ │ ├── ic_launcher_foreground.png │ │ │ └── ic_launcher_round.png │ │ │ ├── mipmap-xhdpi │ │ │ ├── ic_launcher.png │ │ │ ├── ic_launcher_foreground.png │ │ │ └── ic_launcher_round.png │ │ │ ├── mipmap-xxhdpi │ │ │ ├── ic_launcher.png │ │ │ ├── ic_launcher_foreground.png │ │ │ └── ic_launcher_round.png │ │ │ ├── mipmap-xxxhdpi │ │ │ ├── ic_launcher.png │ │ │ ├── ic_launcher_foreground.png │ │ │ └── ic_launcher_round.png │ │ │ ├── raw │ │ │ ├── keep.xml │ │ │ └── slow_spring_board.mp3 │ │ │ ├── values-night │ │ │ └── styles.xml │ │ │ └── values │ │ │ ├── ic_launcher_background.xml │ │ │ └── styles.xml │ │ └── profile │ │ └── AndroidManifest.xml ├── build.gradle ├── gradle.properties ├── gradle │ └── wrapper │ │ └── gradle-wrapper.properties └── settings.gradle ├── assets ├── fonts │ └── NotoSansSC │ │ ├── NotoSansSC-Black.otf │ │ ├── NotoSansSC-Bold.otf │ │ ├── NotoSansSC-Light.otf │ │ ├── NotoSansSC-Medium.otf │ │ ├── NotoSansSC-Regular.otf │ │ ├── NotoSansSC-Thin.otf │ │ └── OFL.txt ├── images │ ├── avatar.png │ ├── backtop.png │ ├── bronze.png │ ├── gold.png │ ├── google.png │ ├── icon │ │ ├── app_icon.png │ │ ├── ic_launcher_foreground.png │ │ ├── icon_android.png │ │ ├── icon_ios.png │ │ ├── icon_launcher.png │ │ └── logo.html │ ├── silver.png │ └── social │ │ ├── About.me.png │ │ ├── BattleTag.png │ │ ├── Btc.png │ │ ├── Coding.net.png │ │ ├── Duolingo.png │ │ ├── Geo.png │ │ ├── Github.png │ │ ├── Goodreads.png │ │ ├── Instagram.png │ │ ├── Last.fm.png │ │ ├── NOSTR.png │ │ ├── Ps.png │ │ ├── Steam.png │ │ ├── Telegram.png │ │ ├── Twitch.tv.png │ │ ├── Twitter.png │ │ ├── Website.png │ │ ├── dribbble.png │ │ └── mario.png ├── preview │ ├── preview_1.png │ ├── preview_2.png │ ├── preview_3.png │ └── preview_4.png └── sound │ └── slow_spring_board.mp3 ├── ios ├── .gitignore ├── Flutter │ ├── AppFrameworkInfo.plist │ ├── Debug.xcconfig │ └── Release.xcconfig ├── Podfile ├── Podfile.lock ├── 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 │ ├── Contents.json │ ├── LaunchImage.imageset │ │ ├── Contents.json │ │ ├── LaunchImage.png │ │ ├── LaunchImage@2x.png │ │ ├── LaunchImage@3x.png │ │ └── README.md │ ├── icon_hot.imageset │ │ ├── Contents.json │ │ └── icon_hot.png │ ├── icon_search.imageset │ │ ├── Contents.json │ │ └── icon_search.png │ └── icon_sign.imageset │ │ ├── Contents.json │ │ └── icon_sign.png │ ├── Base.lproj │ ├── LaunchScreen.storyboard │ └── Main.storyboard │ ├── Info.plist │ ├── Runner-Bridging-Header.h │ ├── Runner.entitlements │ └── RunnerRelease.entitlements ├── lib ├── components │ ├── adaptive │ │ ├── destinations.dart │ │ ├── main.dart │ │ ├── resize_layout.dart │ │ ├── second_body.dart │ │ ├── slide.dart │ │ └── trailing.dart │ ├── common │ │ ├── appbar.dart │ │ ├── avatar.dart │ │ ├── custom_loading.dart │ │ ├── footer.dart │ │ ├── image_loading.dart │ │ ├── network_error.dart │ │ ├── node_tag.dart │ │ ├── pull_refresh.dart │ │ ├── skeleton.dart │ │ ├── skeleton_topic.dart │ │ └── skeleton_topic_recent.dart │ ├── extended_text │ │ ├── at_text.dart │ │ ├── emoji_text.dart │ │ ├── image_text.dart │ │ ├── selection_controls.dart │ │ └── text_span_builder.dart │ ├── home │ │ ├── left_drawer.dart │ │ ├── list_item.dart │ │ ├── search_bar.dart │ │ ├── search_bar_adaptive.dart │ │ ├── sticky_bar.dart │ │ └── tabBar_list.dart │ ├── member │ │ ├── reply_item.dart │ │ ├── reply_item_blank.dart │ │ ├── topic_item.dart │ │ └── topic_item_blank.dart │ ├── message │ │ └── notice_item.dart │ ├── search │ │ ├── history.dart │ │ └── menu.dart │ └── topic │ │ ├── bottom_bar.dart │ │ ├── html_render.dart │ │ ├── main.dart │ │ ├── member_list.dart │ │ ├── reply_item.dart │ │ ├── reply_new.dart │ │ ├── reply_sheet.dart │ │ └── skeleton_main.dart ├── http │ ├── dio_network.dart │ ├── dio_web.dart │ ├── github.dart │ ├── init.dart │ ├── interceptor.dart │ ├── node.dart │ ├── soV2ex.dart │ ├── topic.dart │ └── user.dart ├── main.dart ├── models │ ├── change_log.dart │ ├── network │ │ ├── item_node.dart │ │ ├── item_node_topic.dart │ │ └── item_topic.dart │ ├── tabs.dart │ ├── version.dart │ └── web │ │ ├── item_member_avatar.dart │ │ ├── item_member_notice.dart │ │ ├── item_member_reply.dart │ │ ├── item_member_social.dart │ │ ├── item_member_topic.dart │ │ ├── item_node_list.dart │ │ ├── item_tab_topic.dart │ │ ├── item_tab_topic.g.dart │ │ ├── item_topic_reply.dart │ │ ├── item_topic_reply.g.dart │ │ ├── item_topic_subtle.dart │ │ ├── item_topic_subtle.g.dart │ │ ├── model_login_detail.dart │ │ ├── model_member_notice.dart │ │ ├── model_member_profile.dart │ │ ├── model_member_reply.dart │ │ ├── model_member_topic.dart │ │ ├── model_node_fav.dart │ │ ├── model_node_list.dart │ │ ├── model_topic_detail.dart │ │ ├── model_topic_detail.g.dart │ │ ├── model_topic_fav.dart │ │ └── model_topic_follow.dart ├── package │ ├── markdown_editable_textinput │ │ ├── format_markdown.dart │ │ └── markdown_text_input.dart │ └── xpath │ │ ├── pubspec.lock │ │ ├── pubspec.yaml │ │ ├── src │ │ └── xpath_base.dart │ │ └── xpath.dart ├── pages │ ├── go │ │ └── :nodeId.dart │ ├── help │ │ ├── change_log │ │ │ ├── controller.dart │ │ │ ├── index.dart │ │ │ └── view.dart │ │ └── network.dart │ ├── home │ │ └── controller.dart │ ├── hot │ │ ├── controller.dart │ │ ├── index.dart │ │ └── view.dart │ ├── member │ │ ├── :memberId.dart │ │ ├── :memberId │ │ │ ├── replies.dart │ │ │ └── topics.dart │ │ └── controller.dart │ ├── my │ │ ├── follow.dart │ │ └── topics.dart │ ├── page_agreement.dart │ ├── page_help.dart │ ├── page_history.dart │ ├── page_history_hot.dart │ ├── page_home.dart │ ├── page_login.dart │ ├── page_message.dart │ ├── page_nodes.dart │ ├── page_nodes_topic.dart │ ├── page_preview.dart │ ├── page_setting.dart │ ├── page_webView.dart │ ├── page_write.dart │ ├── search │ │ ├── controller.dart │ │ ├── index.dart │ │ ├── view.dart │ │ └── widgets │ │ │ └── appbar.dart │ ├── setting │ │ ├── page_display_mode.dart │ │ ├── page_font.dart │ │ └── page_nodes_sort.dart │ └── t │ │ ├── :topicId.dart │ │ └── controller.dart ├── router │ └── app_pages.dart ├── service │ ├── i18n_keyword.dart │ ├── local_notice.dart │ ├── read.dart │ ├── search.dart │ └── translation.dart └── utils │ ├── app_scheme.dart │ ├── cache.dart │ ├── cookie.dart │ ├── event_bus.dart │ ├── global.dart │ ├── hive.dart │ ├── login.dart │ ├── proxy.dart │ ├── storage.dart │ ├── string.dart │ ├── upload.dart │ └── utils.dart ├── linux ├── .gitignore ├── CMakeLists.txt ├── flutter │ ├── CMakeLists.txt │ ├── generated_plugin_registrant.cc │ ├── generated_plugin_registrant.h │ └── generated_plugins.cmake ├── main.cc ├── my_application.cc └── my_application.h ├── macos ├── .gitignore ├── Flutter │ ├── Flutter-Debug.xcconfig │ ├── Flutter-Release.xcconfig │ └── GeneratedPluginRegistrant.swift ├── Podfile ├── Podfile.lock ├── Runner.xcodeproj │ ├── project.pbxproj │ ├── project.xcworkspace │ │ └── xcshareddata │ │ │ └── IDEWorkspaceChecks.plist │ └── xcshareddata │ │ └── xcschemes │ │ └── Runner.xcscheme ├── Runner.xcworkspace │ ├── contents.xcworkspacedata │ └── xcshareddata │ │ └── IDEWorkspaceChecks.plist └── Runner │ ├── AppDelegate.swift │ ├── Assets.xcassets │ └── AppIcon.appiconset │ │ ├── Contents.json │ │ ├── app_icon_1024.png │ │ ├── app_icon_128.png │ │ ├── app_icon_16.png │ │ ├── app_icon_256.png │ │ ├── app_icon_32.png │ │ ├── app_icon_512.png │ │ └── app_icon_64.png │ ├── Base.lproj │ └── MainMenu.xib │ ├── Configs │ ├── AppInfo.xcconfig │ ├── Debug.xcconfig │ ├── Release.xcconfig │ └── Warnings.xcconfig │ ├── DebugProfile.entitlements │ ├── Info.plist │ ├── MainFlutterWindow.swift │ └── Release.entitlements ├── pubspec.lock ├── pubspec.yaml ├── test └── widget_test.dart ├── web ├── favicon.png ├── icons │ ├── Icon-192.png │ ├── Icon-512.png │ ├── Icon-maskable-192.png │ └── Icon-maskable-512.png ├── index.html └── manifest.json └── windows ├── .gitignore ├── CMakeLists.txt ├── flutter ├── CMakeLists.txt ├── generated_plugin_registrant.cc ├── generated_plugin_registrant.h └── generated_plugins.cmake └── runner ├── CMakeLists.txt ├── Runner.rc ├── flutter_window.cpp ├── flutter_window.h ├── main.cpp ├── resource.h ├── resources └── app_icon.ico ├── runner.exe.manifest ├── utils.cpp ├── utils.h ├── win32_window.cpp └── win32_window.h /.github/workflows/build.yml: -------------------------------------------------------------------------------- 1 | name: build_apk 2 | 3 | # action事件触发 4 | on: 5 | # push main时触发 6 | push: 7 | # branches: [main] 8 | # push tag时触发 9 | tags: 10 | - v* 11 | # push_request: 12 | # branches: [main] 13 | 14 | # 可以有多个jobs 15 | jobs: 16 | build_apk: 17 | # 运行环境 ubuntu-latest window-latest mac-latest 18 | runs-on: ubuntu-latest 19 | 20 | # 每个jobs中可以有多个steps 21 | steps: 22 | - name: 代码迁出 23 | uses: actions/checkout@v3 24 | 25 | - name: 构建Java环境 26 | uses: actions/setup-java@v3 27 | with: 28 | distribution: "zulu" 29 | java-version: "17" 30 | token: ${{secrets.GIT_TOKEN}} 31 | 32 | # - name: 检查缓存 33 | # uses: actions/cache@v2 34 | # id: cache-flutter 35 | # with: 36 | # path: /root/flutter-sdk # Flutter SDK 的路径 37 | # key: ${{ runner.os }}-flutter-${{ hashFiles('**/pubspec.lock') }} 38 | 39 | - name: 安装Flutter 40 | # if: steps.cache-flutter.outputs.cache-hit != 'true' 41 | uses: subosito/flutter-action@v2 42 | with: 43 | flutter-version: '3.24.4' 44 | channel: 'any' 45 | - run: flutter --version 46 | 47 | # 签名文件 48 | # - name: Decode keystore 49 | # run: | 50 | # echo $KEYSTORE_BASE64 | base64 -di > android/app/vvex.jks 51 | # env: 52 | # KEYSTORE_BASE64: ${{ secrets.KEYSTORE_BASE64 }} 53 | 54 | # 下载项目依赖 55 | - name: flutter pub get 56 | run: flutter pub get 57 | 58 | - name: 解码生成 jks 59 | run: echo $KEYSTORE_BASE64 | base64 -di > android/app/vvex.jks 60 | env: 61 | KEYSTORE_BASE64: ${{ secrets.KEYSTORE_BASE64 }} 62 | 63 | - name: flutter build apk 64 | # 对应 android/app/build.gradle signingConfigs中的配置项 65 | run: flutter build apk --release --split-per-abi 66 | env: 67 | KEYSTORE_PASSWORD: ${{ secrets.KEYSTORE_PASSWORD }} 68 | KEY_ALIAS: ${{ secrets.KEY_ALIAS }} 69 | KEY_PASSWORD: ${{ secrets.KEY_PASSWORD}} 70 | 71 | - name: 发布 72 | uses: ncipollo/release-action@v1 73 | with: 74 | artifacts: "build/app/outputs/flutter-apk/vvex-*.apk" 75 | token: ${{ secrets.GIT_TOKEN }} 76 | allowUpdates: true 77 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Miscellaneous 2 | *.class 3 | *.log 4 | *.pyc 5 | *.swp 6 | .DS_Store 7 | .atom/ 8 | .build/ 9 | .buildlog/ 10 | .history 11 | .svn/ 12 | .swiftpm/ 13 | migrate_working_dir/ 14 | 15 | # IntelliJ related 16 | *.iml 17 | *.ipr 18 | *.iws 19 | .idea/ 20 | 21 | # The .vscode folder contains launch configuration and tasks you configure in 22 | # VS Code which you may wish to be included in version control, so this line 23 | # is commented out by default. 24 | #.vscode/ 25 | 26 | # Flutter/Dart/Pub related 27 | **/doc/api/ 28 | **/ios/Flutter/.last_build_id 29 | .dart_tool/ 30 | .flutter-plugins 31 | .flutter-plugins-dependencies 32 | .packages 33 | .pub-cache/ 34 | .pub/ 35 | /build/ 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. 5 | 6 | version: 7 | revision: 135454af32477f815a7525073027a3ff9eff1bfd 8 | channel: stable 9 | 10 | project_type: app 11 | 12 | # Tracks metadata for the flutter migrate command 13 | migration: 14 | platforms: 15 | - platform: root 16 | create_revision: 135454af32477f815a7525073027a3ff9eff1bfd 17 | base_revision: 135454af32477f815a7525073027a3ff9eff1bfd 18 | - platform: android 19 | create_revision: 135454af32477f815a7525073027a3ff9eff1bfd 20 | base_revision: 135454af32477f815a7525073027a3ff9eff1bfd 21 | - platform: ios 22 | create_revision: 135454af32477f815a7525073027a3ff9eff1bfd 23 | base_revision: 135454af32477f815a7525073027a3ff9eff1bfd 24 | - platform: linux 25 | create_revision: 135454af32477f815a7525073027a3ff9eff1bfd 26 | base_revision: 135454af32477f815a7525073027a3ff9eff1bfd 27 | - platform: macos 28 | create_revision: 135454af32477f815a7525073027a3ff9eff1bfd 29 | base_revision: 135454af32477f815a7525073027a3ff9eff1bfd 30 | - platform: web 31 | create_revision: 135454af32477f815a7525073027a3ff9eff1bfd 32 | base_revision: 135454af32477f815a7525073027a3ff9eff1bfd 33 | - platform: windows 34 | create_revision: 135454af32477f815a7525073027a3ff9eff1bfd 35 | base_revision: 135454af32477f815a7525073027a3ff9eff1bfd 36 | 37 | # User provided section 38 | 39 | # List of Local paths (relative to this file) that should be 40 | # ignored by the migrate tool. 41 | # 42 | # Files that are not part of the templates will be ignored by default. 43 | unmanaged_files: 44 | - 'lib/main.dart' 45 | - 'ios/Runner.xcodeproj/project.pbxproj' 46 | -------------------------------------------------------------------------------- /.vscode/launch.json: -------------------------------------------------------------------------------- 1 | { 2 | // 使用 IntelliSense 了解相关属性。 3 | // 悬停以查看现有属性的描述。 4 | // 欲了解更多信息,请访问: https://go.microsoft.com/fwlink/?linkid=830387 5 | "version": "0.2.0", 6 | "configurations": [ 7 | { 8 | "name": "flutter_v2ex", 9 | "request": "launch", 10 | "type": "dart" 11 | }, 12 | { 13 | "name": "flutter_v2ex (profile mode)", 14 | "request": "launch", 15 | "type": "dart", 16 | "flutterMode": "profile" 17 | }, 18 | { 19 | "name": "flutter_v2ex (release mode)", 20 | "request": "launch", 21 | "type": "dart", 22 | "flutterMode": "release" 23 | }, 24 | { 25 | "name": "xpath", 26 | "cwd": "lib/package/xpath", 27 | "request": "launch", 28 | "type": "dart" 29 | } 30 | ] 31 | } -------------------------------------------------------------------------------- /.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "editor.formatOnSave": true, 3 | "[dart]": { 4 | "editor.formatOnType": true 5 | } 6 | } -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2023 Infinite 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /analysis_options.yaml: -------------------------------------------------------------------------------- 1 | # This file configures the analyzer, which statically analyzes Dart code to 2 | # check for errors, warnings, and lints. 3 | # 4 | # The issues identified by the analyzer are surfaced in the UI of Dart-enabled 5 | # IDEs (https://dart.dev/tools#ides-and-editors). The analyzer can also be 6 | # invoked from the command line by running `flutter analyze`. 7 | 8 | # The following line activates a set of recommended lints for Flutter apps, 9 | # packages, and plugins designed to encourage good coding practices. 10 | include: package:flutter_lints/flutter.yaml 11 | 12 | linter: 13 | # The lint rules applied to this project can be customized in the 14 | # section below to disable rules from the `package:flutter_lints/flutter.yaml` 15 | # included above or to enable additional rules. A list of all available lints 16 | # and their documentation is published at 17 | # https://dart-lang.github.io/linter/lints/index.html. 18 | # 19 | # Instead of disabling a lint rule for the entire project in the 20 | # section below, it can also be suppressed for a single line of code 21 | # or a specific dart file by using the `// ignore: name_of_lint` and 22 | # `// ignore_for_file: name_of_lint` syntax on the line or in the file 23 | # producing the lint. 24 | rules: 25 | # avoid_print: false # Uncomment to disable the `avoid_print` rule 26 | # prefer_single_quotes: true # Uncomment to enable the `prefer_single_quotes` rule 27 | 28 | # Additional information about this file can be found at 29 | # https://dart.dev/guides/language/analysis-options 30 | -------------------------------------------------------------------------------- /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 | **/*.keystore 13 | **/*.jks 14 | -------------------------------------------------------------------------------- /android/app/src/debug/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /android/app/src/main/ic_launcher-playstore.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/guozhigq/flutter_v2ex/170417910fbb496783d3681a83e08d2467ba4eba/android/app/src/main/ic_launcher-playstore.png -------------------------------------------------------------------------------- /android/app/src/main/kotlin/com/example/flutter_v2ex/MainActivity.kt: -------------------------------------------------------------------------------- 1 | package com.guozhigq.vvex 2 | 3 | import io.flutter.embedding.android.FlutterActivity 4 | 5 | class MainActivity: FlutterActivity() { 6 | } 7 | -------------------------------------------------------------------------------- /android/app/src/main/res/drawable-hdpi/ic_launcher_foreground.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/guozhigq/flutter_v2ex/170417910fbb496783d3681a83e08d2467ba4eba/android/app/src/main/res/drawable-hdpi/ic_launcher_foreground.png -------------------------------------------------------------------------------- /android/app/src/main/res/drawable-hdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/guozhigq/flutter_v2ex/170417910fbb496783d3681a83e08d2467ba4eba/android/app/src/main/res/drawable-hdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /android/app/src/main/res/drawable-hdpi/ic_stat_name.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/guozhigq/flutter_v2ex/170417910fbb496783d3681a83e08d2467ba4eba/android/app/src/main/res/drawable-hdpi/ic_stat_name.png -------------------------------------------------------------------------------- /android/app/src/main/res/drawable-mdpi/ic_launcher_foreground.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/guozhigq/flutter_v2ex/170417910fbb496783d3681a83e08d2467ba4eba/android/app/src/main/res/drawable-mdpi/ic_launcher_foreground.png -------------------------------------------------------------------------------- /android/app/src/main/res/drawable-mdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/guozhigq/flutter_v2ex/170417910fbb496783d3681a83e08d2467ba4eba/android/app/src/main/res/drawable-mdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /android/app/src/main/res/drawable-mdpi/ic_stat_name.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/guozhigq/flutter_v2ex/170417910fbb496783d3681a83e08d2467ba4eba/android/app/src/main/res/drawable-mdpi/ic_stat_name.png -------------------------------------------------------------------------------- /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-xhdpi/ic_launcher_foreground.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/guozhigq/flutter_v2ex/170417910fbb496783d3681a83e08d2467ba4eba/android/app/src/main/res/drawable-xhdpi/ic_launcher_foreground.png -------------------------------------------------------------------------------- /android/app/src/main/res/drawable-xhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/guozhigq/flutter_v2ex/170417910fbb496783d3681a83e08d2467ba4eba/android/app/src/main/res/drawable-xhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /android/app/src/main/res/drawable-xhdpi/ic_stat_name.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/guozhigq/flutter_v2ex/170417910fbb496783d3681a83e08d2467ba4eba/android/app/src/main/res/drawable-xhdpi/ic_stat_name.png -------------------------------------------------------------------------------- /android/app/src/main/res/drawable-xxhdpi/ic_launcher_foreground.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/guozhigq/flutter_v2ex/170417910fbb496783d3681a83e08d2467ba4eba/android/app/src/main/res/drawable-xxhdpi/ic_launcher_foreground.png -------------------------------------------------------------------------------- /android/app/src/main/res/drawable-xxhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/guozhigq/flutter_v2ex/170417910fbb496783d3681a83e08d2467ba4eba/android/app/src/main/res/drawable-xxhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /android/app/src/main/res/drawable-xxhdpi/ic_stat_name.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/guozhigq/flutter_v2ex/170417910fbb496783d3681a83e08d2467ba4eba/android/app/src/main/res/drawable-xxhdpi/ic_stat_name.png -------------------------------------------------------------------------------- /android/app/src/main/res/drawable-xxxhdpi/ic_launcher_foreground.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/guozhigq/flutter_v2ex/170417910fbb496783d3681a83e08d2467ba4eba/android/app/src/main/res/drawable-xxxhdpi/ic_launcher_foreground.png -------------------------------------------------------------------------------- /android/app/src/main/res/drawable-xxxhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/guozhigq/flutter_v2ex/170417910fbb496783d3681a83e08d2467ba4eba/android/app/src/main/res/drawable-xxxhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /android/app/src/main/res/drawable-xxxhdpi/ic_stat_name.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/guozhigq/flutter_v2ex/170417910fbb496783d3681a83e08d2467ba4eba/android/app/src/main/res/drawable-xxxhdpi/ic_stat_name.png -------------------------------------------------------------------------------- /android/app/src/main/res/drawable/app_icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/guozhigq/flutter_v2ex/170417910fbb496783d3681a83e08d2467ba4eba/android/app/src/main/res/drawable/app_icon.png -------------------------------------------------------------------------------- /android/app/src/main/res/drawable/icon_hot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/guozhigq/flutter_v2ex/170417910fbb496783d3681a83e08d2467ba4eba/android/app/src/main/res/drawable/icon_hot.png -------------------------------------------------------------------------------- /android/app/src/main/res/drawable/icon_search.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/guozhigq/flutter_v2ex/170417910fbb496783d3681a83e08d2467ba4eba/android/app/src/main/res/drawable/icon_search.png -------------------------------------------------------------------------------- /android/app/src/main/res/drawable/icon_sign.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/guozhigq/flutter_v2ex/170417910fbb496783d3681a83e08d2467ba4eba/android/app/src/main/res/drawable/icon_sign.png -------------------------------------------------------------------------------- /android/app/src/main/res/drawable/launch_background.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 12 | 13 | -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/guozhigq/flutter_v2ex/170417910fbb496783d3681a83e08d2467ba4eba/android/app/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-hdpi/ic_launcher_foreground.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/guozhigq/flutter_v2ex/170417910fbb496783d3681a83e08d2467ba4eba/android/app/src/main/res/mipmap-hdpi/ic_launcher_foreground.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-hdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/guozhigq/flutter_v2ex/170417910fbb496783d3681a83e08d2467ba4eba/android/app/src/main/res/mipmap-hdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/guozhigq/flutter_v2ex/170417910fbb496783d3681a83e08d2467ba4eba/android/app/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-mdpi/ic_launcher_foreground.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/guozhigq/flutter_v2ex/170417910fbb496783d3681a83e08d2467ba4eba/android/app/src/main/res/mipmap-mdpi/ic_launcher_foreground.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-mdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/guozhigq/flutter_v2ex/170417910fbb496783d3681a83e08d2467ba4eba/android/app/src/main/res/mipmap-mdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/guozhigq/flutter_v2ex/170417910fbb496783d3681a83e08d2467ba4eba/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xhdpi/ic_launcher_foreground.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/guozhigq/flutter_v2ex/170417910fbb496783d3681a83e08d2467ba4eba/android/app/src/main/res/mipmap-xhdpi/ic_launcher_foreground.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/guozhigq/flutter_v2ex/170417910fbb496783d3681a83e08d2467ba4eba/android/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/guozhigq/flutter_v2ex/170417910fbb496783d3681a83e08d2467ba4eba/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xxhdpi/ic_launcher_foreground.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/guozhigq/flutter_v2ex/170417910fbb496783d3681a83e08d2467ba4eba/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_foreground.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/guozhigq/flutter_v2ex/170417910fbb496783d3681a83e08d2467ba4eba/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/guozhigq/flutter_v2ex/170417910fbb496783d3681a83e08d2467ba4eba/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_foreground.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/guozhigq/flutter_v2ex/170417910fbb496783d3681a83e08d2467ba4eba/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_foreground.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/guozhigq/flutter_v2ex/170417910fbb496783d3681a83e08d2467ba4eba/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /android/app/src/main/res/raw/keep.xml: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /android/app/src/main/res/raw/slow_spring_board.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/guozhigq/flutter_v2ex/170417910fbb496783d3681a83e08d2467ba4eba/android/app/src/main/res/raw/slow_spring_board.mp3 -------------------------------------------------------------------------------- /android/app/src/main/res/values-night/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 9 | 15 | 18 | 19 | -------------------------------------------------------------------------------- /android/app/src/main/res/values/ic_launcher_background.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | #FFFFFF 4 | -------------------------------------------------------------------------------- /android/app/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 9 | 15 | 18 | 19 | -------------------------------------------------------------------------------- /android/app/src/profile/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /android/build.gradle: -------------------------------------------------------------------------------- 1 | buildscript { 2 | ext.kotlin_version = '2.0.10' 3 | repositories { 4 | google() 5 | mavenCentral() 6 | } 7 | 8 | configurations.all { 9 | resolutionStrategy { 10 | force 'androidx.core:core-ktx:1.6.0' 11 | } 12 | } 13 | 14 | 15 | dependencies { 16 | classpath 'com.android.tools.build:gradle:7.2.2' 17 | classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" 18 | } 19 | 20 | // android { 21 | // defaultConfig { 22 | // multiDexEnabled true 23 | // } 24 | // } 25 | } 26 | 27 | allprojects { 28 | repositories { 29 | google() 30 | mavenCentral() 31 | } 32 | } 33 | 34 | 35 | 36 | rootProject.buildDir = '../build' 37 | subprojects { 38 | project.buildDir = "${rootProject.buildDir}/${project.name}" 39 | } 40 | subprojects { 41 | afterEvaluate { project -> 42 | if (project.plugins.hasPlugin("com.android.application") || 43 | project.plugins.hasPlugin("com.android.library")) { 44 | project.android { 45 | compileSdkVersion 34 46 | buildToolsVersion "34.0.0" 47 | } 48 | } 49 | } 50 | } 51 | subprojects { 52 | project.evaluationDependsOn(':app') 53 | } 54 | 55 | tasks.register("clean", Delete) { 56 | delete rootProject.buildDir 57 | } 58 | -------------------------------------------------------------------------------- /android/gradle.properties: -------------------------------------------------------------------------------- 1 | org.gradle.jvmargs=-Xmx1536M 2 | android.useAndroidX=true 3 | android.enableJetifier=true 4 | -------------------------------------------------------------------------------- /android/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionBase=GRADLE_USER_HOME 2 | distributionPath=wrapper/dists 3 | zipStoreBase=GRADLE_USER_HOME 4 | zipStorePath=wrapper/dists 5 | distributionUrl=https\://services.gradle.org/distributions/gradle-7.5-all.zip 6 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /assets/fonts/NotoSansSC/NotoSansSC-Black.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/guozhigq/flutter_v2ex/170417910fbb496783d3681a83e08d2467ba4eba/assets/fonts/NotoSansSC/NotoSansSC-Black.otf -------------------------------------------------------------------------------- /assets/fonts/NotoSansSC/NotoSansSC-Bold.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/guozhigq/flutter_v2ex/170417910fbb496783d3681a83e08d2467ba4eba/assets/fonts/NotoSansSC/NotoSansSC-Bold.otf -------------------------------------------------------------------------------- /assets/fonts/NotoSansSC/NotoSansSC-Light.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/guozhigq/flutter_v2ex/170417910fbb496783d3681a83e08d2467ba4eba/assets/fonts/NotoSansSC/NotoSansSC-Light.otf -------------------------------------------------------------------------------- /assets/fonts/NotoSansSC/NotoSansSC-Medium.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/guozhigq/flutter_v2ex/170417910fbb496783d3681a83e08d2467ba4eba/assets/fonts/NotoSansSC/NotoSansSC-Medium.otf -------------------------------------------------------------------------------- /assets/fonts/NotoSansSC/NotoSansSC-Regular.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/guozhigq/flutter_v2ex/170417910fbb496783d3681a83e08d2467ba4eba/assets/fonts/NotoSansSC/NotoSansSC-Regular.otf -------------------------------------------------------------------------------- /assets/fonts/NotoSansSC/NotoSansSC-Thin.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/guozhigq/flutter_v2ex/170417910fbb496783d3681a83e08d2467ba4eba/assets/fonts/NotoSansSC/NotoSansSC-Thin.otf -------------------------------------------------------------------------------- /assets/images/avatar.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/guozhigq/flutter_v2ex/170417910fbb496783d3681a83e08d2467ba4eba/assets/images/avatar.png -------------------------------------------------------------------------------- /assets/images/backtop.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/guozhigq/flutter_v2ex/170417910fbb496783d3681a83e08d2467ba4eba/assets/images/backtop.png -------------------------------------------------------------------------------- /assets/images/bronze.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/guozhigq/flutter_v2ex/170417910fbb496783d3681a83e08d2467ba4eba/assets/images/bronze.png -------------------------------------------------------------------------------- /assets/images/gold.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/guozhigq/flutter_v2ex/170417910fbb496783d3681a83e08d2467ba4eba/assets/images/gold.png -------------------------------------------------------------------------------- /assets/images/google.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/guozhigq/flutter_v2ex/170417910fbb496783d3681a83e08d2467ba4eba/assets/images/google.png -------------------------------------------------------------------------------- /assets/images/icon/app_icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/guozhigq/flutter_v2ex/170417910fbb496783d3681a83e08d2467ba4eba/assets/images/icon/app_icon.png -------------------------------------------------------------------------------- /assets/images/icon/ic_launcher_foreground.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/guozhigq/flutter_v2ex/170417910fbb496783d3681a83e08d2467ba4eba/assets/images/icon/ic_launcher_foreground.png -------------------------------------------------------------------------------- /assets/images/icon/icon_android.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/guozhigq/flutter_v2ex/170417910fbb496783d3681a83e08d2467ba4eba/assets/images/icon/icon_android.png -------------------------------------------------------------------------------- /assets/images/icon/icon_ios.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/guozhigq/flutter_v2ex/170417910fbb496783d3681a83e08d2467ba4eba/assets/images/icon/icon_ios.png -------------------------------------------------------------------------------- /assets/images/icon/icon_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/guozhigq/flutter_v2ex/170417910fbb496783d3681a83e08d2467ba4eba/assets/images/icon/icon_launcher.png -------------------------------------------------------------------------------- /assets/images/icon/logo.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | Document 8 | 9 | 10 | 11 |
12 |
13 |
14 |
15 |
16 |
17 | 18 | 19 | 65 | 66 | -------------------------------------------------------------------------------- /assets/images/silver.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/guozhigq/flutter_v2ex/170417910fbb496783d3681a83e08d2467ba4eba/assets/images/silver.png -------------------------------------------------------------------------------- /assets/images/social/About.me.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/guozhigq/flutter_v2ex/170417910fbb496783d3681a83e08d2467ba4eba/assets/images/social/About.me.png -------------------------------------------------------------------------------- /assets/images/social/BattleTag.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/guozhigq/flutter_v2ex/170417910fbb496783d3681a83e08d2467ba4eba/assets/images/social/BattleTag.png -------------------------------------------------------------------------------- /assets/images/social/Btc.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/guozhigq/flutter_v2ex/170417910fbb496783d3681a83e08d2467ba4eba/assets/images/social/Btc.png -------------------------------------------------------------------------------- /assets/images/social/Coding.net.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/guozhigq/flutter_v2ex/170417910fbb496783d3681a83e08d2467ba4eba/assets/images/social/Coding.net.png -------------------------------------------------------------------------------- /assets/images/social/Duolingo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/guozhigq/flutter_v2ex/170417910fbb496783d3681a83e08d2467ba4eba/assets/images/social/Duolingo.png -------------------------------------------------------------------------------- /assets/images/social/Geo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/guozhigq/flutter_v2ex/170417910fbb496783d3681a83e08d2467ba4eba/assets/images/social/Geo.png -------------------------------------------------------------------------------- /assets/images/social/Github.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/guozhigq/flutter_v2ex/170417910fbb496783d3681a83e08d2467ba4eba/assets/images/social/Github.png -------------------------------------------------------------------------------- /assets/images/social/Goodreads.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/guozhigq/flutter_v2ex/170417910fbb496783d3681a83e08d2467ba4eba/assets/images/social/Goodreads.png -------------------------------------------------------------------------------- /assets/images/social/Instagram.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/guozhigq/flutter_v2ex/170417910fbb496783d3681a83e08d2467ba4eba/assets/images/social/Instagram.png -------------------------------------------------------------------------------- /assets/images/social/Last.fm.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/guozhigq/flutter_v2ex/170417910fbb496783d3681a83e08d2467ba4eba/assets/images/social/Last.fm.png -------------------------------------------------------------------------------- /assets/images/social/NOSTR.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/guozhigq/flutter_v2ex/170417910fbb496783d3681a83e08d2467ba4eba/assets/images/social/NOSTR.png -------------------------------------------------------------------------------- /assets/images/social/Ps.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/guozhigq/flutter_v2ex/170417910fbb496783d3681a83e08d2467ba4eba/assets/images/social/Ps.png -------------------------------------------------------------------------------- /assets/images/social/Steam.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/guozhigq/flutter_v2ex/170417910fbb496783d3681a83e08d2467ba4eba/assets/images/social/Steam.png -------------------------------------------------------------------------------- /assets/images/social/Telegram.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/guozhigq/flutter_v2ex/170417910fbb496783d3681a83e08d2467ba4eba/assets/images/social/Telegram.png -------------------------------------------------------------------------------- /assets/images/social/Twitch.tv.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/guozhigq/flutter_v2ex/170417910fbb496783d3681a83e08d2467ba4eba/assets/images/social/Twitch.tv.png -------------------------------------------------------------------------------- /assets/images/social/Twitter.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/guozhigq/flutter_v2ex/170417910fbb496783d3681a83e08d2467ba4eba/assets/images/social/Twitter.png -------------------------------------------------------------------------------- /assets/images/social/Website.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/guozhigq/flutter_v2ex/170417910fbb496783d3681a83e08d2467ba4eba/assets/images/social/Website.png -------------------------------------------------------------------------------- /assets/images/social/dribbble.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/guozhigq/flutter_v2ex/170417910fbb496783d3681a83e08d2467ba4eba/assets/images/social/dribbble.png -------------------------------------------------------------------------------- /assets/images/social/mario.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/guozhigq/flutter_v2ex/170417910fbb496783d3681a83e08d2467ba4eba/assets/images/social/mario.png -------------------------------------------------------------------------------- /assets/preview/preview_1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/guozhigq/flutter_v2ex/170417910fbb496783d3681a83e08d2467ba4eba/assets/preview/preview_1.png -------------------------------------------------------------------------------- /assets/preview/preview_2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/guozhigq/flutter_v2ex/170417910fbb496783d3681a83e08d2467ba4eba/assets/preview/preview_2.png -------------------------------------------------------------------------------- /assets/preview/preview_3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/guozhigq/flutter_v2ex/170417910fbb496783d3681a83e08d2467ba4eba/assets/preview/preview_3.png -------------------------------------------------------------------------------- /assets/preview/preview_4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/guozhigq/flutter_v2ex/170417910fbb496783d3681a83e08d2467ba4eba/assets/preview/preview_4.png -------------------------------------------------------------------------------- /assets/sound/slow_spring_board.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/guozhigq/flutter_v2ex/170417910fbb496783d3681a83e08d2467ba4eba/assets/sound/slow_spring_board.mp3 -------------------------------------------------------------------------------- /ios/.gitignore: -------------------------------------------------------------------------------- 1 | **/dgph 2 | *.mode1v3 3 | *.mode2v3 4 | *.moved-aside 5 | *.pbxuser 6 | *.perspectivev3 7 | **/*sync/ 8 | .sconsign.dblite 9 | .tags* 10 | **/.vagrant/ 11 | **/DerivedData/ 12 | Icon? 13 | **/Pods/ 14 | **/.symlinks/ 15 | profile 16 | xcuserdata 17 | **/.generated/ 18 | Flutter/App.framework 19 | Flutter/Flutter.framework 20 | Flutter/Flutter.podspec 21 | Flutter/Generated.xcconfig 22 | Flutter/ephemeral/ 23 | Flutter/app.flx 24 | Flutter/app.zip 25 | Flutter/flutter_assets/ 26 | Flutter/flutter_export_environment.sh 27 | ServiceDefinitions.json 28 | Runner/GeneratedPluginRegistrant.* 29 | 30 | # Exceptions to above rules. 31 | !default.mode1v3 32 | !default.mode2v3 33 | !default.pbxuser 34 | !default.perspectivev3 35 | -------------------------------------------------------------------------------- /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 | 12.0 25 | 26 | 27 | -------------------------------------------------------------------------------- /ios/Flutter/Debug.xcconfig: -------------------------------------------------------------------------------- 1 | #include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig" 2 | #include "Generated.xcconfig" 3 | -------------------------------------------------------------------------------- /ios/Flutter/Release.xcconfig: -------------------------------------------------------------------------------- 1 | #include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig" 2 | #include "Generated.xcconfig" 3 | -------------------------------------------------------------------------------- /ios/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 | 37 | 38 | 39 | 40 | 41 | 42 | 52 | 54 | 60 | 61 | 62 | 63 | 69 | 71 | 77 | 78 | 79 | 80 | 82 | 83 | 86 | 87 | 88 | -------------------------------------------------------------------------------- /ios/Runner.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | PreviewsEnabled 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /ios/Runner/AppDelegate.swift: -------------------------------------------------------------------------------- 1 | import UIKit 2 | import Flutter 3 | import flutter_local_notifications 4 | 5 | @main 6 | @objc class AppDelegate: FlutterAppDelegate { 7 | override func application( 8 | _ application: UIApplication, 9 | didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]? 10 | ) -> Bool { 11 | // This is required to make any communication available in the action isolate. 12 | FlutterLocalNotificationsPlugin.setPluginRegistrantCallback { (registry) in 13 | GeneratedPluginRegistrant.register(with: registry) 14 | } 15 | 16 | if #available(iOS 10.0, *) { 17 | UNUserNotificationCenter.current().delegate = self as UNUserNotificationCenterDelegate 18 | } 19 | GeneratedPluginRegistrant.register(with: self) 20 | return super.application(application, didFinishLaunchingWithOptions: launchOptions) 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /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/guozhigq/flutter_v2ex/170417910fbb496783d3681a83e08d2467ba4eba/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/guozhigq/flutter_v2ex/170417910fbb496783d3681a83e08d2467ba4eba/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/guozhigq/flutter_v2ex/170417910fbb496783d3681a83e08d2467ba4eba/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/guozhigq/flutter_v2ex/170417910fbb496783d3681a83e08d2467ba4eba/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/guozhigq/flutter_v2ex/170417910fbb496783d3681a83e08d2467ba4eba/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/guozhigq/flutter_v2ex/170417910fbb496783d3681a83e08d2467ba4eba/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/guozhigq/flutter_v2ex/170417910fbb496783d3681a83e08d2467ba4eba/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/guozhigq/flutter_v2ex/170417910fbb496783d3681a83e08d2467ba4eba/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/guozhigq/flutter_v2ex/170417910fbb496783d3681a83e08d2467ba4eba/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/guozhigq/flutter_v2ex/170417910fbb496783d3681a83e08d2467ba4eba/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/guozhigq/flutter_v2ex/170417910fbb496783d3681a83e08d2467ba4eba/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/guozhigq/flutter_v2ex/170417910fbb496783d3681a83e08d2467ba4eba/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/guozhigq/flutter_v2ex/170417910fbb496783d3681a83e08d2467ba4eba/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/guozhigq/flutter_v2ex/170417910fbb496783d3681a83e08d2467ba4eba/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/guozhigq/flutter_v2ex/170417910fbb496783d3681a83e08d2467ba4eba/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "author" : "xcode", 4 | "version" : 1 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /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/guozhigq/flutter_v2ex/170417910fbb496783d3681a83e08d2467ba4eba/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/guozhigq/flutter_v2ex/170417910fbb496783d3681a83e08d2467ba4eba/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/guozhigq/flutter_v2ex/170417910fbb496783d3681a83e08d2467ba4eba/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/Assets.xcassets/icon_hot.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "filename" : "icon_hot.png", 5 | "idiom" : "universal", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "author" : "xcode", 19 | "version" : 1 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/icon_hot.imageset/icon_hot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/guozhigq/flutter_v2ex/170417910fbb496783d3681a83e08d2467ba4eba/ios/Runner/Assets.xcassets/icon_hot.imageset/icon_hot.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/icon_search.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "filename" : "icon_search.png", 5 | "idiom" : "universal", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "author" : "xcode", 19 | "version" : 1 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/icon_search.imageset/icon_search.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/guozhigq/flutter_v2ex/170417910fbb496783d3681a83e08d2467ba4eba/ios/Runner/Assets.xcassets/icon_search.imageset/icon_search.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/icon_sign.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "filename" : "icon_sign.png", 5 | "idiom" : "universal", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "author" : "xcode", 19 | "version" : 1 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/icon_sign.imageset/icon_sign.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/guozhigq/flutter_v2ex/170417910fbb496783d3681a83e08d2467ba4eba/ios/Runner/Assets.xcassets/icon_sign.imageset/icon_sign.png -------------------------------------------------------------------------------- /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 | CFBundleDisplayName 8 | VVEX 9 | CFBundleExecutable 10 | $(EXECUTABLE_NAME) 11 | CFBundleIdentifier 12 | $(PRODUCT_BUNDLE_IDENTIFIER) 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | VVEX 17 | CFBundlePackageType 18 | APPL 19 | CFBundleShortVersionString 20 | $(FLUTTER_BUILD_NAME) 21 | CFBundleSignature 22 | ???? 23 | CFBundleVersion 24 | $(FLUTTER_BUILD_NUMBER) 25 | LSRequiresIPhoneOS 26 | 27 | UILaunchStoryboardName 28 | LaunchScreen 29 | UIMainStoryboardFile 30 | Main 31 | UISupportedInterfaceOrientations 32 | 33 | UIInterfaceOrientationPortrait 34 | UIInterfaceOrientationLandscapeLeft 35 | UIInterfaceOrientationLandscapeRight 36 | 37 | NSPhotoLibraryAddUsageDescription 38 | 请允许APP保存图片到相册 39 | NSCameraUsageDescription 40 | App需要您的同意,才能访问相册 41 | NSPhotoLibraryUsageDescription 42 | App需要您的同意,才能访问相机 43 | NSMicrophoneUsageDescription 44 | App需要您的同意,才能访问麦克风 45 | NSContactsUsageDescription 46 | App需要您的同意,才能访问通信录 47 | NSLocationUsageDescription 48 | App需要您的同意,才能访问位置 49 | NSLocationWhenInUseUsageDescription 50 | App需要您的同意,才能在使用期间访问位置 51 | NSLocationAlwaysUsageDescription 52 | App需要您的同意,才能始终访问位置 53 | NSCalendarsUsageDescription 54 | App需要您的同意,才能访问日历 55 | NSRemindersUsageDescription 56 | App需要您的同意,才能访问提醒事项 57 | NSMotionUsageDescription 58 | App需要您的同意,才能访问运动与健身 59 | NSHealthUpdateUsageDescription 60 | App需要您的同意,才能访问健康更新 61 | NSHealthShareUsageDescription 62 | App需要您的同意,才能访问健康分享 63 | NSBluetoothPeripheralUsageDescription 64 | App需要您的同意,才能访问蓝牙 65 | NSAppleMusicUsageDescription 66 | App需要您的同意,才能访问媒体资料库 67 | UISupportedInterfaceOrientations~ipad 68 | 69 | UIInterfaceOrientationPortrait 70 | UIInterfaceOrientationPortraitUpsideDown 71 | UIInterfaceOrientationLandscapeLeft 72 | UIInterfaceOrientationLandscapeRight 73 | 74 | UIViewControllerBasedStatusBarAppearance 75 | 76 | CADisableMinimumFrameDurationOnPhone 77 | 78 | UIApplicationSupportsIndirectInputEvents 79 | 80 | LSApplicationQueriesSchemes 81 | 82 | https 83 | http 84 | 85 | NSAppTransportSecurity 86 | 87 | NSAllowsArbitraryLoads 88 | 89 | 90 | -------------------------------------------------------------------------------- /ios/Runner/Runner-Bridging-Header.h: -------------------------------------------------------------------------------- 1 | #import "GeneratedPluginRegistrant.h" 2 | -------------------------------------------------------------------------------- /ios/Runner/Runner.entitlements: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | aps-environment 6 | development 7 | com.apple.developer.networking.vpn.api 8 | 9 | allow-vpn 10 | 11 | com.apple.developer.networking.wifi-info 12 | 13 | com.apple.developer.user-fonts 14 | 15 | app-usage 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /ios/Runner/RunnerRelease.entitlements: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | aps-environment 6 | development 7 | com.apple.developer.networking.vpn.api 8 | 9 | allow-vpn 10 | 11 | com.apple.developer.networking.wifi-info 12 | 13 | com.apple.developer.user-fonts 14 | 15 | app-usage 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /lib/components/adaptive/destinations.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | // These are the destinations used within the AdaptiveScaffold navigation 4 | // builders. 5 | const List destinationsLarge = [ 6 | NavigationDestination( 7 | label: '主题列表', 8 | icon: Icon(Icons.home_outlined), 9 | ), 10 | NavigationDestination( 11 | label: '全部节点', 12 | icon: Icon(Icons.window_outlined), 13 | ), 14 | NavigationDestination( 15 | label: '今日热议', 16 | icon: Icon(Icons.whatshot_outlined), 17 | ), 18 | NavigationDestination( 19 | label: '最近浏览', 20 | icon: Icon(Icons.history_outlined), 21 | ), 22 | NavigationDestination( 23 | label: '我的关注', 24 | icon: Icon(Icons.favorite_outline), 25 | ), 26 | NavigationDestination( 27 | label: '我的收藏', 28 | icon: Icon(Icons.star_border_rounded), 29 | ), 30 | ]; 31 | 32 | 33 | NavigationRailDestination slideInNavigationItem({ 34 | required double begin, 35 | required AnimationController controller, 36 | required IconData icon, 37 | required String label, 38 | }) { 39 | return NavigationRailDestination( 40 | icon: SlideTransition( 41 | position: Tween( 42 | begin: Offset(begin, 0), 43 | end: Offset.zero, 44 | ).animate( 45 | CurvedAnimation(parent: controller, curve: Curves.easeInOut), 46 | ), 47 | child: Icon(icon), 48 | ), 49 | label: Text(label), 50 | ); 51 | } -------------------------------------------------------------------------------- /lib/components/common/appbar.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | class AppBarWidget extends StatelessWidget implements PreferredSizeWidget { 4 | const AppBarWidget({ 5 | required this.child, 6 | required this.controller, 7 | required this.visible, 8 | Key? key, 9 | }) : super(key: key); 10 | 11 | final PreferredSizeWidget child; 12 | final AnimationController controller; 13 | final bool visible; 14 | 15 | @override 16 | // TODO: implement preferredSize 17 | Size get preferredSize => child.preferredSize; 18 | 19 | @override 20 | Widget build(BuildContext context) { 21 | visible ? controller.reverse() : controller.forward(); 22 | return SlideTransition( 23 | position: Tween( 24 | begin: Offset.zero, 25 | end: const Offset(0, -1), 26 | ).animate( 27 | CurvedAnimation( 28 | parent: controller, 29 | curve: Curves.easeInOutBack, 30 | ) 31 | ), 32 | child: child, 33 | ); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /lib/components/common/avatar.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:flutter_v2ex/utils/utils.dart'; 3 | import 'package:cached_network_image/cached_network_image.dart'; 4 | 5 | class CAvatar extends StatelessWidget { 6 | final String url; 7 | final double size; 8 | final int radius = 50; 9 | final Duration? fadeOutDuration; 10 | final Duration? fadeInDuration; 11 | final String? quality; 12 | 13 | const CAvatar({ 14 | Key? key, 15 | required this.url, 16 | required this.size, 17 | this.fadeOutDuration, 18 | this.fadeInDuration, 19 | this.quality, 20 | }) : super(key: key); 21 | 22 | @override 23 | Widget build(BuildContext context) { 24 | return url != '' ? ClipOval( 25 | child: CachedNetworkImage( 26 | imageUrl: quality == 'origin' ? Utils().avatarLarge(url) : url, 27 | height: size, 28 | width: size, 29 | fit: BoxFit.cover, 30 | fadeOutDuration: fadeOutDuration ?? const Duration(milliseconds: 800), 31 | fadeInDuration: fadeInDuration ?? const Duration(milliseconds: 300), 32 | // progressIndicatorBuilder: (context, url, downloadProgress) => 33 | // CircularProgressIndicator( 34 | // value: downloadProgress.progress, 35 | // strokeWidth: 3, 36 | // ), 37 | errorWidget: (context, url, error) => errAvatar(context), 38 | placeholder: (context, url) => placeholder(context), 39 | ), 40 | ) : errAvatar(context); 41 | } 42 | 43 | Widget placeholder(context) { 44 | return 45 | Container( 46 | width: size, 47 | height: size, 48 | decoration: BoxDecoration( 49 | color: Theme.of(context).colorScheme.onInverseSurface, 50 | ), 51 | clipBehavior: Clip.antiAlias, 52 | child: CircleAvatar( 53 | backgroundColor: Theme.of(context).colorScheme.onInverseSurface, 54 | backgroundImage: const AssetImage('assets/images/avatar.png')), 55 | ); 56 | } 57 | Widget errAvatar(context) { 58 | return Container( 59 | decoration: BoxDecoration( 60 | color: Theme.of(context).colorScheme.surfaceVariant, 61 | borderRadius: BorderRadius.circular(50), 62 | ), 63 | clipBehavior: Clip.antiAlias, 64 | width: size, 65 | height: size, 66 | child: Center( 67 | child: Icon( 68 | Icons.person_rounded, 69 | size: size - 10, 70 | color: Theme.of(context).colorScheme.primary, 71 | ), 72 | ), 73 | ); 74 | } 75 | } 76 | -------------------------------------------------------------------------------- /lib/components/common/custom_loading.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | // ignore: must_be_immutable 4 | class CustomLoading extends StatelessWidget { 5 | String msg = '加载中'; 6 | CustomLoading({required this.msg, super.key}); 7 | 8 | @override 9 | Widget build(BuildContext context) { 10 | return Container( 11 | width: 120, 12 | height: 120, 13 | padding: const EdgeInsets.only(bottom: 15), 14 | decoration: BoxDecoration( 15 | color: Theme.of(context).dialogBackgroundColor, 16 | borderRadius: BorderRadius.circular(20)), 17 | child: Column( 18 | mainAxisSize: MainAxisSize.min, 19 | mainAxisAlignment: MainAxisAlignment.end, 20 | crossAxisAlignment: CrossAxisAlignment.center, 21 | children: [ 22 | const CircularProgressIndicator( 23 | strokeWidth: 3, 24 | ), 25 | const SizedBox(height: 15), 26 | Text( 27 | msg, 28 | style: Theme.of(context).textTheme.titleSmall, 29 | ), 30 | ], 31 | ), 32 | ); 33 | } 34 | } 35 | 36 | class CustomToast extends StatelessWidget { 37 | final String msg; 38 | const CustomToast({Key? key, required this.msg}) : super(key: key); 39 | 40 | @override 41 | Widget build(BuildContext context) { 42 | return Container( 43 | margin: const EdgeInsets.symmetric(horizontal: 30, vertical: 50), 44 | padding: const EdgeInsets.symmetric(horizontal: 25, vertical: 10), 45 | decoration: BoxDecoration( 46 | color: Theme.of(context).colorScheme.background, 47 | borderRadius: BorderRadius.circular(20), 48 | border: Border.all(color: Theme.of(context).colorScheme.outline.withOpacity(0.1)), 49 | boxShadow: [ 50 | BoxShadow( 51 | color: Theme.of(context).colorScheme.background.withOpacity(0.05), 52 | blurRadius: 20, 53 | spreadRadius: 2, 54 | offset: const Offset(0, 0) 55 | ), 56 | ], 57 | ), 58 | child: Text(msg, 59 | style: Theme.of(context) 60 | .textTheme 61 | .titleSmall! 62 | .copyWith(color: Theme.of(context).colorScheme.primary)), 63 | ); 64 | } 65 | } 66 | -------------------------------------------------------------------------------- /lib/components/common/footer.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | class FooterTips extends StatelessWidget { 4 | final String? type; 5 | const FooterTips({Key? key, this.type = 'noMore'}) : super(key: key); 6 | 7 | @override 8 | Widget build(BuildContext context) { 9 | return Container( 10 | width: double.infinity, 11 | height: 100 + MediaQuery.of(context).padding.bottom, 12 | padding: EdgeInsets.only(bottom: MediaQuery.of(context).padding.bottom), 13 | child: Center( 14 | child: Row( 15 | mainAxisAlignment: MainAxisAlignment.center, 16 | children: [ 17 | if(type == 'noMore') 18 | const Icon(Icons.auto_awesome), 19 | if(type == 'loading') 20 | SizedBox( 21 | width: 20, 22 | height: 20, 23 | child: CircularProgressIndicator( 24 | color: Theme.of(context) 25 | .colorScheme 26 | .onBackground, 27 | strokeWidth: 2.0)), 28 | const SizedBox(width: 16), 29 | Column( 30 | mainAxisSize: MainAxisSize.min, 31 | mainAxisAlignment: MainAxisAlignment.start, 32 | crossAxisAlignment: CrossAxisAlignment.start, 33 | children: [ 34 | Text(type == 'noMore' ? '加载完成' : '加载中...'), 35 | const SizedBox( 36 | height: 4, 37 | ), 38 | Text('最后更新于刚刚', style: Theme.of(context).textTheme.bodySmall) 39 | ], 40 | ) 41 | ], 42 | ), 43 | ), 44 | ); 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /lib/components/common/network_error.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | class NetworkErrorPage extends StatelessWidget { 4 | final String? message; 5 | final VoidCallback? onRetry; 6 | const NetworkErrorPage({super.key, this.message, this.onRetry}); 7 | 8 | @override 9 | Widget build(BuildContext context) { 10 | return Center( 11 | child: Column( 12 | mainAxisAlignment: MainAxisAlignment.center, 13 | crossAxisAlignment: CrossAxisAlignment.center, 14 | children: [ 15 | Icon( 16 | Icons.mood_bad, 17 | size: 80.0, 18 | color: Theme.of(context).colorScheme.primary, 19 | ), 20 | const SizedBox(height: 10.0), 21 | const Text( 22 | '网络请求失败', 23 | style: TextStyle(fontSize: 20.0, fontWeight: FontWeight.bold), 24 | ), 25 | const SizedBox(height: 2.0), 26 | Text( 27 | message ?? '请检查您的网络连接,然后重试', 28 | textAlign: TextAlign.center, 29 | style: const TextStyle(fontSize: 14.0), 30 | ), 31 | const SizedBox(height: 20.0), 32 | ElevatedButton( 33 | onPressed: onRetry, 34 | child: const Text('重试'), 35 | ), 36 | ], 37 | ), 38 | ); 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /lib/components/common/node_tag.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:get/get.dart'; 3 | 4 | class NodeTag extends StatelessWidget { 5 | final String? nodeId; 6 | final String? nodeName; 7 | final String? route; 8 | 9 | const NodeTag({ 10 | this.nodeId, 11 | this.nodeName, 12 | this.route, 13 | super.key, 14 | }); 15 | 16 | @override 17 | Widget build(BuildContext context) { 18 | var bgColor = route == 'detail' 19 | ? Theme.of(context).colorScheme.onInverseSurface 20 | : Theme.of(context).colorScheme.surfaceVariant; 21 | return Material( 22 | borderRadius: BorderRadius.circular(50), 23 | color: bgColor, 24 | child: InkWell( 25 | onTap: () => Get.toNamed('/go/$nodeId'), 26 | borderRadius: BorderRadius.circular(50), 27 | child: Ink( 28 | padding: const EdgeInsets.symmetric(vertical: 3.5, horizontal: 10), 29 | child: Row( 30 | mainAxisSize: MainAxisSize.min, 31 | crossAxisAlignment: CrossAxisAlignment.center, 32 | children: [ 33 | Text( 34 | nodeName!.contains('WATCH')? 'iWatch' : nodeName!, 35 | style: const TextStyle( 36 | fontSize: 11.0, 37 | textBaseline: TextBaseline.ideographic, 38 | ), 39 | ) 40 | ], 41 | ), 42 | ), 43 | ), 44 | ); 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /lib/components/common/skeleton_topic_recent.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:flutter_v2ex/utils/global.dart'; 3 | 4 | class TopicItemSkeleton extends StatelessWidget { 5 | const TopicItemSkeleton({Key? key}) : super(key: key); 6 | 7 | @override 8 | Widget build(BuildContext context) { 9 | var commonColor = Theme.of(context).colorScheme.surfaceVariant; 10 | return Container( 11 | decoration: BoxDecoration( 12 | borderRadius: BorderRadius.circular(10), 13 | color: getBackground(context, 'listItem'), 14 | // color: Theme.of(context).colorScheme.onInverseSurface, 15 | ), 16 | margin: const EdgeInsets.only(top: 8, right: 12, bottom: 0, left: 12), 17 | padding: const EdgeInsets.fromLTRB(15, 18, 15, 15), 18 | child: Column( 19 | crossAxisAlignment: CrossAxisAlignment.start, 20 | children: [ 21 | Container( 22 | width: 300, 23 | height: 16, 24 | margin: const EdgeInsets.only(top: 0, bottom: 12), 25 | color: commonColor, 26 | ), 27 | Row( 28 | mainAxisAlignment: MainAxisAlignment.spaceBetween, 29 | children: [ 30 | Row( 31 | children: [ 32 | Container( 33 | width: 135, 34 | height: 14, 35 | color: commonColor, 36 | ), 37 | const SizedBox(width: 4), 38 | Container( 39 | width: 30, 40 | height: 14, 41 | color: commonColor, 42 | ), 43 | ], 44 | ), 45 | Container( 46 | width: 55, 47 | height: 21, 48 | decoration: BoxDecoration( 49 | borderRadius: BorderRadius.circular(50), 50 | color: commonColor, 51 | ), 52 | ), 53 | ], 54 | ), 55 | ], 56 | ), 57 | ); 58 | } 59 | } 60 | 61 | -------------------------------------------------------------------------------- /lib/components/extended_text/at_text.dart: -------------------------------------------------------------------------------- 1 | import 'package:extended_text_library/extended_text_library.dart'; 2 | import 'package:flutter/gestures.dart'; 3 | import 'package:flutter/material.dart'; 4 | import 'package:get/get.dart'; 5 | 6 | class AtText extends SpecialText { 7 | AtText(TextStyle? textStyle, SpecialTextGestureTapCallback? onTap, 8 | {this.showAtBackground = false, this.start, this.controller}) 9 | : super(flag, ' ', textStyle, onTap: onTap); 10 | static const String flag = '@'; 11 | final int? start; 12 | final TextEditingController? controller; 13 | 14 | /// whether show background for @somebody 15 | final bool showAtBackground; 16 | 17 | @override 18 | InlineSpan finishText() { 19 | final TextStyle? textStyle = this.textStyle?.copyWith( 20 | color: Theme.of(Get.context!).colorScheme.primary, fontSize: 16.0); 21 | 22 | final String atText = toString(); 23 | 24 | return showAtBackground 25 | ? BackgroundTextSpan( 26 | background: Paint() 27 | ..color = 28 | Theme.of(Get.context!).colorScheme.primary.withOpacity(0.15), 29 | text: atText, 30 | actualText: atText, 31 | start: start!, 32 | 33 | ///caret can move into special text 34 | deleteAll: true, 35 | style: textStyle, 36 | recognizer: (TapGestureRecognizer() 37 | ..onTap = () { 38 | if (onTap != null) { 39 | onTap!(atText); 40 | } 41 | })) 42 | 43 | /// 点击@userName可直接删除 Text.rich与普通文本内容高度不一致 44 | // : ExtendedWidgetSpan( 45 | // actualText: atText, 46 | // start: start!, 47 | // style: textStyle, 48 | // child: GestureDetector( 49 | // child: Text.rich(TextSpan( 50 | // style: textStyle, 51 | // children: [ 52 | // TextSpan( 53 | // text: '@', 54 | // style: TextStyle( 55 | // color: 56 | // Theme.of(Get.context!).colorScheme.onBackground)), 57 | // TextSpan(text: atText.split('@')[1]), 58 | // ], 59 | // )), 60 | // onTap: () { 61 | // controller!.value = controller!.value.copyWith( 62 | // text: controller!.text 63 | // .replaceRange(start!, start! + atText.length, ''), 64 | // selection: TextSelection.fromPosition( 65 | // TextPosition(offset: start!), 66 | // ), 67 | // ); 68 | // }, 69 | // ), 70 | // deleteAll: true, 71 | // ); 72 | : SpecialTextSpan( 73 | text: atText, 74 | actualText: atText, 75 | start: start!, 76 | style: textStyle, 77 | recognizer: (TapGestureRecognizer() 78 | ..onTap = () { 79 | if (onTap != null) { 80 | onTap!(atText); 81 | } 82 | }), 83 | ); 84 | } 85 | } 86 | -------------------------------------------------------------------------------- /lib/components/extended_text/emoji_text.dart: -------------------------------------------------------------------------------- 1 | import 'package:extended_text_library/extended_text_library.dart'; 2 | import 'package:flutter/material.dart'; 3 | import 'package:flutter_v2ex/utils/string.dart'; 4 | 5 | ///emoji/image text 6 | class EmojiText extends SpecialText { 7 | EmojiText(TextStyle? textStyle, {this.start}) 8 | : super(EmojiText.flag, ']', textStyle); 9 | static const String flag = '['; 10 | final int? start; 11 | @override 12 | InlineSpan finishText() { 13 | final String key = toString(); 14 | 15 | if (EmojiUitl.instance.emojiMap.containsKey(key)) { 16 | double size = 22; 17 | 18 | // final TextStyle ts = textStyle!; 19 | // if (ts.fontSize != null) { 20 | // size = ts.fontSize! * 1.15; 21 | // } 22 | 23 | return ImageSpan( 24 | NetworkImage( 25 | EmojiUitl.instance.emojiMap[key]!, 26 | ), 27 | actualText: key, 28 | imageWidth: size, 29 | imageHeight: size, 30 | start: start!, 31 | //fit: BoxFit.fill, 32 | margin: const EdgeInsets.all(1)); 33 | } 34 | 35 | return TextSpan(text: toString(), style: textStyle); 36 | } 37 | } 38 | 39 | class EmojiUitl { 40 | final coolapkEmoticon = Strings.coolapkEmoticon; 41 | EmojiUitl._() { 42 | for (int i = 0; i < coolapkEmoticon.values.toList().length; i++) { 43 | _emojiMap['[${coolapkEmoticon.keys.toList()[i]}]'] = 44 | coolapkEmoticon.values.toList()[i]; 45 | } 46 | } 47 | 48 | final Map _emojiMap = {}; 49 | 50 | Map get emojiMap => _emojiMap; 51 | 52 | // final String _emojiFilePath = 'https://i.imgur.com/'; 53 | 54 | static EmojiUitl? _instance; 55 | static EmojiUitl get instance => _instance ??= EmojiUitl._(); 56 | } 57 | -------------------------------------------------------------------------------- /lib/components/extended_text/image_text.dart: -------------------------------------------------------------------------------- 1 | import 'dart:math'; 2 | 3 | import 'package:extended_text_field/extended_text_field.dart'; 4 | import 'package:flutter/material.dart' hide Element; 5 | import 'package:html/dom.dart' hide Text; 6 | import 'package:html/parser.dart'; 7 | 8 | class ImageText extends SpecialText { 9 | ImageText(TextStyle? textStyle, 10 | {this.start, SpecialTextGestureTapCallback? onTap}) 11 | : super( 12 | ImageText.flag, 13 | '/>', 14 | textStyle, 15 | onTap: onTap, 16 | ); 17 | 18 | static const String flag = ' _imageUrl; 22 | @override 23 | InlineSpan finishText() { 24 | ///content already has endflag '/' 25 | final String text = toString(); 26 | 27 | ///'' 28 | // var index1 = text.indexOf(''') + 1; 29 | // var index2 = text.indexOf(''', index1); 30 | // 31 | // var url = text.substring(index1, index2); 32 | // 33 | ////'' 34 | final Document html = parse(text); 35 | 36 | final Element img = html.getElementsByTagName('img').first; 37 | final String url = img.attributes['src']!; 38 | _imageUrl = url; 39 | 40 | //fontsize id define image height 41 | //size = 30.0/26.0 * fontSize 42 | double? width = 60.0; 43 | double? height = 60.0; 44 | const BoxFit fit = BoxFit.cover; 45 | const double num300 = 60.0; 46 | const double num400 = 80.0; 47 | 48 | height = num300; 49 | width = num400; 50 | const bool knowImageSize = true; 51 | if (knowImageSize) { 52 | height = double.tryParse(img.attributes['height']!); 53 | width = double.tryParse(img.attributes['width']!); 54 | final double n = height! / width!; 55 | if (n >= 4 / 3) { 56 | width = num300; 57 | height = num400; 58 | } else if (4 / 3 > n && n > 3 / 4) { 59 | final double maxValue = max(width, height); 60 | height = num400 * height / maxValue; 61 | width = num400 * width / maxValue; 62 | } else if (n <= 3 / 4) { 63 | width = num400; 64 | height = num300; 65 | } 66 | } 67 | 68 | ///fontSize 26 and text height =30.0 69 | //final double fontSize = 26.0; 70 | 71 | return ExtendedWidgetSpan( 72 | start: start!, 73 | actualText: text, 74 | child: GestureDetector( 75 | onTap: () { 76 | onTap?.call(url); 77 | }, 78 | child: Image.network( 79 | url, 80 | width: width, 81 | height: height, 82 | fit: fit, 83 | ), 84 | ), 85 | ); 86 | } 87 | } 88 | -------------------------------------------------------------------------------- /lib/components/extended_text/text_span_builder.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter_v2ex/components/extended_text/at_text.dart'; 2 | import 'package:flutter_v2ex/components/extended_text/emoji_text.dart'; 3 | import 'package:flutter_v2ex/components/extended_text/image_text.dart'; 4 | import 'package:flutter/material.dart'; 5 | import 'package:extended_text_library/extended_text_library.dart'; 6 | 7 | class MySpecialTextSpanBuilder extends SpecialTextSpanBuilder { 8 | MySpecialTextSpanBuilder({ 9 | this.showAtBackground = false, 10 | this.controller, 11 | }); 12 | 13 | /// whether show background for @somebody 14 | final bool showAtBackground; 15 | final TextEditingController? controller; 16 | 17 | @override 18 | SpecialText? createSpecialText(String flag, 19 | {TextStyle? textStyle, 20 | SpecialTextGestureTapCallback? onTap, 21 | int? index}) { 22 | if (flag == '') { 23 | return null; 24 | } 25 | 26 | ///index is end index of start flag, so text start index should be index-(flag.length-1) 27 | if (isStart(flag, AtText.flag)) { 28 | return AtText(textStyle, onTap, 29 | start: index! - (AtText.flag.length - 1), 30 | showAtBackground: showAtBackground, 31 | controller: controller); 32 | } 33 | 34 | if (isStart(flag, EmojiText.flag)) { 35 | return EmojiText(textStyle, start: index! - (EmojiText.flag.length - 1)); 36 | } else if (isStart(flag, ImageText.flag)) { 37 | return ImageText(textStyle, 38 | start: index! - (ImageText.flag.length - 1), onTap: onTap); 39 | } else if (isStart(flag, AtText.flag)) { 40 | return AtText( 41 | textStyle, 42 | onTap, 43 | start: index! - (AtText.flag.length - 1), 44 | showAtBackground: showAtBackground, 45 | ); 46 | } else if (isStart(flag, EmojiText.flag)) { 47 | return EmojiText(textStyle, start: index! - (EmojiText.flag.length - 1)); 48 | } 49 | // else if (isStart(flag, DollarText.flag)) { 50 | // return DollarText(textStyle, onTap, 51 | // start: index! - (DollarText.flag.length - 1)); 52 | // } 53 | 54 | return null; 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /lib/components/home/sticky_bar.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:flutter_adaptive_scaffold/flutter_adaptive_scaffold.dart'; 3 | import 'package:flutter_v2ex/models/tabs.dart'; 4 | import 'package:container_tab_indicator/container_tab_indicator.dart'; 5 | import 'package:flutter_v2ex/pages/home/controller.dart'; 6 | import 'package:get/get.dart'; 7 | 8 | class HomeStickyBar extends StatelessWidget { 9 | const HomeStickyBar({super.key, required this.tabs, required this.ctr}); 10 | 11 | final List tabs; 12 | final TabController ctr; 13 | 14 | @override 15 | Widget build(BuildContext context) { 16 | final TabStateController tabStateController = Get.put(TabStateController()); 17 | return SizedBox( 18 | width: double.infinity, 19 | height: 40, 20 | child: Row( 21 | children: [ 22 | Expanded( 23 | child: AdpatTabBar( 24 | controller: ctr, 25 | tabs: tabs, 26 | onTap: (index) { 27 | if (!ctr.indexIsChanging) { 28 | // tap(index); 29 | tabStateController.setTabIndex(index); 30 | } 31 | }, 32 | ), 33 | ), 34 | // const SizedBox(width: 5), 35 | if (!Breakpoints.mediumAndUp.isActive(context)) 36 | SizedBox( 37 | height: 50, 38 | child: Center( 39 | child: IconButton( 40 | onPressed: () => {Navigator.pushNamed(context, '/nodes')}, 41 | icon: const Icon(Icons.segment_rounded, size: 19), 42 | ), 43 | ), 44 | ), 45 | ], 46 | ), 47 | ); 48 | } 49 | } 50 | 51 | class AdpatTabBar extends StatelessWidget { 52 | final List tabs; 53 | final TabController? controller; 54 | final Function? onTap; 55 | 56 | const AdpatTabBar({ 57 | Key? key, 58 | required this.tabs, 59 | this.controller, 60 | this.onTap, 61 | }) : super(key: key); 62 | 63 | @override 64 | Widget build(BuildContext context) { 65 | bool isiPad = Breakpoints.mediumAndUp.isActive(context); 66 | return TabBar( 67 | controller: controller, 68 | dividerColor: Colors.transparent, 69 | tabAlignment: tabs.length > 4 ? TabAlignment.start : TabAlignment.center, 70 | onTap: (index) => onTap?.call(index), 71 | isScrollable: true, 72 | enableFeedback: true, 73 | splashBorderRadius: BorderRadius.circular(6), 74 | padding: EdgeInsets.symmetric(horizontal: isiPad ? 10 : 5), 75 | tabs: tabs.map((item) { 76 | return Tab(text: item.name); 77 | }).toList(), 78 | // iPad 79 | labelColor: isiPad 80 | ? Theme.of(context).colorScheme.onBackground 81 | : Theme.of(context).colorScheme.primary, 82 | indicator: isiPad 83 | ? ContainerTabIndicator( 84 | width: 60, 85 | height: 36, 86 | radius: BorderRadius.circular(8.0), 87 | color: Theme.of(context).colorScheme.surfaceVariant, 88 | ) 89 | : null, 90 | ); 91 | } 92 | } 93 | -------------------------------------------------------------------------------- /lib/components/member/reply_item.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:get/get.dart'; 3 | import 'package:flutter_v2ex/models/web/item_member_reply.dart'; 4 | import 'package:flutter_v2ex/components/topic/html_render.dart'; 5 | 6 | class ReplyItem extends StatelessWidget { 7 | final MemberReplyItem replyItem; 8 | 9 | const ReplyItem({required this.replyItem, Key? key}) : super(key: key); 10 | 11 | @override 12 | Widget build(BuildContext context) { 13 | return GestureDetector( 14 | child: Container( 15 | margin: const EdgeInsets.only(top: 8, right: 12, bottom: 0, left: 12), 16 | child: Material( 17 | color: Theme.of(context).colorScheme.onInverseSurface, 18 | borderRadius: BorderRadius.circular(10), 19 | child: InkWell( 20 | onTap: () => Get.toNamed('/t/${replyItem.topicId}'), 21 | borderRadius: BorderRadius.circular(10), 22 | child: Ink( 23 | padding: const EdgeInsets.fromLTRB(7, 15, 7, 0), 24 | child: content(context), 25 | ), 26 | ), 27 | ), 28 | ), 29 | ); 30 | } 31 | 32 | Widget content(context) { 33 | return Column( 34 | crossAxisAlignment: CrossAxisAlignment.start, 35 | children: [ 36 | Container( 37 | padding: const EdgeInsets.symmetric(horizontal: 2), 38 | margin: const EdgeInsets.only(top: 0, bottom: 4), 39 | child: HtmlRender(htmlContent: replyItem.replyContent), 40 | ), 41 | Container( 42 | alignment: Alignment.centerRight, 43 | padding: const EdgeInsets.symmetric(horizontal: 2), 44 | margin: const EdgeInsets.only(top: 0, bottom: 8), 45 | child: Text(replyItem.time, 46 | style: Theme.of(context) 47 | .textTheme 48 | .labelMedium! 49 | .copyWith(color: Theme.of(context).colorScheme.outline))), 50 | Container( 51 | padding: const EdgeInsets.symmetric(vertical: 10, horizontal: 10), 52 | margin: const EdgeInsets.only(bottom: 7), 53 | decoration: BoxDecoration( 54 | color: Theme.of(context).colorScheme.background.withOpacity(0.8), 55 | borderRadius: BorderRadius.circular(6), 56 | ), 57 | child: Column( 58 | crossAxisAlignment: CrossAxisAlignment.start, 59 | children: [ 60 | Row( 61 | mainAxisAlignment: MainAxisAlignment.spaceBetween, 62 | children: [ 63 | Text( 64 | replyItem.memberId, 65 | style: Theme.of(context).textTheme.titleSmall, 66 | ), 67 | Text( 68 | replyItem.nodeName, 69 | style: Theme.of(context) 70 | .textTheme 71 | .labelMedium! 72 | .copyWith(color: Theme.of(context).colorScheme.outline), 73 | ) 74 | ], 75 | ), 76 | Divider( 77 | color: Theme.of(context).dividerColor.withOpacity(0.2), 78 | ), 79 | Text(replyItem.topicTitle) 80 | ], 81 | ), 82 | ), 83 | ], 84 | ); 85 | } 86 | } 87 | -------------------------------------------------------------------------------- /lib/components/member/reply_item_blank.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | class ReplyItemBlank extends StatelessWidget { 4 | const ReplyItemBlank({Key? key}) : super(key: key); 5 | 6 | @override 7 | Widget build(BuildContext context) { 8 | return const Placeholder(); 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /lib/components/member/topic_item.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:get/get.dart'; 3 | import 'package:flutter_v2ex/models/web/item_member_topic.dart'; 4 | import 'package:flutter_v2ex/components/common/node_tag.dart'; 5 | 6 | class TopicItem extends StatelessWidget { 7 | final MemberTopicItem topicItem; 8 | 9 | const TopicItem({required this.topicItem, Key? key}) : super(key: key); 10 | 11 | @override 12 | Widget build(BuildContext context) { 13 | return Container( 14 | margin: const EdgeInsets.only(top: 8, right: 12, bottom: 0, left: 12), 15 | child: Material( 16 | color: Theme.of(context).colorScheme.onInverseSurface, 17 | borderRadius: BorderRadius.circular(10), 18 | child: InkWell( 19 | onTap: () { 20 | var topicDetail = topicItem; 21 | // topicDetail.lastReplyTime = topicItem.time; 22 | var arguments = { 23 | "topic": topicDetail, 24 | "heroTag": '' 25 | }; 26 | Get.toNamed('/t/${topicItem.topicId}', arguments: arguments); 27 | }, 28 | borderRadius: BorderRadius.circular(10), 29 | child: Ink( 30 | padding: const EdgeInsets.fromLTRB(15, 18, 15, 15), 31 | child: content(context), 32 | ), 33 | ), 34 | ), 35 | ); 36 | } 37 | 38 | Widget content(context) { 39 | return Column( 40 | crossAxisAlignment: CrossAxisAlignment.start, 41 | children: [ 42 | Container( 43 | alignment: Alignment.centerLeft, 44 | margin: const EdgeInsets.only(bottom: 8), 45 | child: Text( 46 | topicItem.topicTitle, 47 | overflow: TextOverflow.ellipsis, 48 | maxLines: 2, 49 | style: Theme.of(context) 50 | .textTheme 51 | .titleSmall! 52 | .copyWith(height: 1.6, fontWeight: FontWeight.w500), 53 | ), 54 | ), 55 | Row( 56 | // 两端对齐 57 | mainAxisAlignment: MainAxisAlignment.spaceBetween, 58 | children: [ 59 | Row( 60 | children: [ 61 | Text( 62 | topicItem.time, 63 | style: Theme.of(context) 64 | .textTheme 65 | .labelMedium! 66 | .copyWith(color: Theme.of(context).colorScheme.outline), 67 | ), 68 | const SizedBox(width: 10), 69 | Text( 70 | '${topicItem.replyCount}回复', 71 | style: Theme.of(context) 72 | .textTheme 73 | .labelMedium! 74 | .copyWith(color: Theme.of(context).colorScheme.outline), 75 | ), 76 | ], 77 | ), 78 | if (topicItem.nodeName.isNotEmpty) ...[ 79 | NodeTag( 80 | nodeId: topicItem.nodeId, 81 | nodeName: topicItem.nodeName, 82 | route: 'home') 83 | ] 84 | ], 85 | ), 86 | // title 87 | ], 88 | ); 89 | } 90 | } 91 | -------------------------------------------------------------------------------- /lib/components/member/topic_item_blank.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | class TopicItemBlank extends StatelessWidget { 4 | const TopicItemBlank({Key? key}) : super(key: key); 5 | 6 | @override 7 | Widget build(BuildContext context) { 8 | return const Placeholder(); 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /lib/components/topic/skeleton_main.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:flutter_v2ex/utils/storage.dart'; 3 | import 'package:flutter_v2ex/components/common/skeleton.dart'; 4 | 5 | class TopicDetailSkeleton extends StatelessWidget { 6 | const TopicDetailSkeleton({Key? key}) : super(key: key); 7 | 8 | 9 | @override 10 | Widget build(BuildContext context) { 11 | return Skeleton( 12 | child: Column( 13 | children: const [ 14 | TopicItemSkeleton(), 15 | TopicItemSkeleton(), 16 | TopicItemSkeleton() 17 | ], 18 | ), 19 | ); 20 | } 21 | 22 | } 23 | 24 | class TopicItemSkeleton extends StatelessWidget { 25 | const TopicItemSkeleton({Key? key}) : super(key: key); 26 | 27 | @override 28 | Widget build(BuildContext context) { 29 | var commonColor = Theme.of(context).colorScheme.onInverseSurface; 30 | double height = GStorage().getHtmlFs() + 2; 31 | return Container( 32 | margin: const EdgeInsets.fromLTRB(20, 8, 20, 0), 33 | child: Column( 34 | mainAxisAlignment: MainAxisAlignment.start, 35 | crossAxisAlignment: CrossAxisAlignment.start, 36 | children: [ 37 | Container( 38 | width: double.infinity, 39 | height: height, 40 | margin: const EdgeInsets.only(top: 0, bottom: 8), 41 | color: commonColor, 42 | ), 43 | Container( 44 | width: double.infinity, 45 | height: height, 46 | margin: const EdgeInsets.only(top: 0, bottom: 8, right: 40), 47 | color: commonColor, 48 | ), 49 | Container( 50 | width: double.infinity, 51 | height: height, 52 | margin: const EdgeInsets.only(top: 0, bottom: 8, right: 80), 53 | color: commonColor, 54 | ), 55 | Container( 56 | width: double.infinity, 57 | height: height, 58 | margin: const EdgeInsets.only(top: 0, bottom: 12, right: 200), 59 | color: commonColor, 60 | ), 61 | ], 62 | ), 63 | ); 64 | } 65 | } 66 | 67 | -------------------------------------------------------------------------------- /lib/http/dio_network.dart: -------------------------------------------------------------------------------- 1 | import 'package:dio/dio.dart'; 2 | import 'package:flutter_v2ex/http/init.dart'; 3 | // import 'package:dio_http_cache/dio_http_cache.dart'; 4 | import 'package:flutter_v2ex/models/network/item_node.dart'; 5 | import 'package:flutter_v2ex/models/network/item_topic.dart'; 6 | import 'package:flutter_v2ex/models/network/item_node_topic.dart'; 7 | 8 | class DioRequestNet { 9 | // 所有节点 10 | final String allNodes = '/api/nodes/all.json'; 11 | 12 | // 所有节点 topic 13 | final String allNodesT = 14 | '/api/nodes/list.json'; 15 | 16 | // 热议 17 | final String hotTopics = '/api/topics/hot.json'; 18 | 19 | // var cacheOptions = buildCacheOptions( 20 | // const Duration(days: 4), 21 | // forceRefresh: false, 22 | // ); 23 | 24 | // 所有节点 25 | static Future> getAllNodes() async { 26 | Response response = await Request().get( 27 | DioRequestNet().allNodes, 28 | // cacheOptions: DioRequestNet().cacheOptions, 29 | ); 30 | List list = response.data; 31 | return list.map((e) => NodeItem.fromJson(e)).toList(); 32 | } 33 | 34 | // 热议 35 | static Future> getHotTopic() async { 36 | Response response = await Request().get( 37 | DioRequestNet().hotTopics, 38 | ); 39 | List list = response.data; 40 | return list.map((e) => TopicItem.fromJson(e)).toList(); 41 | } 42 | 43 | // 所有节点 topic 44 | static Future> getAllNodesT() async { 45 | Response response = await Request().get( 46 | DioRequestNet().allNodesT, 47 | data: { 48 | 'fields': 'name,title,topics,aliases', 49 | 'sort_by': 'topics', 50 | 'reverse': 1 51 | }, 52 | // cacheOptions: DioRequestNet().cacheOptions, 53 | ); 54 | List list = response.data; 55 | return list.map((e) => TopicNodeItem.fromJson(e)).toList(); 56 | } 57 | 58 | } 59 | -------------------------------------------------------------------------------- /lib/http/github.dart: -------------------------------------------------------------------------------- 1 | import 'package:dio/dio.dart'; 2 | import 'package:flutter/material.dart'; 3 | import 'package:flutter_smart_dialog/flutter_smart_dialog.dart'; 4 | import 'package:flutter_v2ex/http/init.dart'; 5 | import 'package:flutter_v2ex/models/version.dart'; 6 | import 'package:flutter_v2ex/utils/string.dart'; 7 | import 'package:flutter_v2ex/utils/utils.dart'; 8 | 9 | class GithubApi { 10 | static Future checkUpdate() async { 11 | Map update = { 12 | 'lastVersion': '', 13 | 'downloadHref': '', 14 | 'needUpdate': false, 15 | }; 16 | Response response = await Request().get( 17 | 'https://api.github.com/repos/guozhigq/flutter_v2ex/releases/latest'); 18 | var versionDetail = VersionModel.fromJson(response.data); 19 | print(versionDetail.tag_name); 20 | // 版本号 21 | var version = versionDetail.tag_name; 22 | var updateLog = versionDetail.body; 23 | List updateLogList = updateLog.split('\r\n'); 24 | var needUpdate = Utils.needUpdate(Strings.currentVersion, version); 25 | if (needUpdate) { 26 | SmartDialog.show( 27 | useSystem: true, 28 | animationType: SmartAnimationType.centerFade_otherSlide, 29 | builder: (BuildContext context) { 30 | return AlertDialog( 31 | title: const Text('🎉 发现新版本 '), 32 | content: Column( 33 | mainAxisAlignment: MainAxisAlignment.start, 34 | crossAxisAlignment: CrossAxisAlignment.start, 35 | mainAxisSize: MainAxisSize.min, 36 | children: [ 37 | Text( 38 | version, 39 | style: const TextStyle(fontSize: 20), 40 | ), 41 | const SizedBox(height: 8), 42 | for (var i in updateLogList) ...[Text(i)] 43 | ], 44 | ), 45 | actions: [ 46 | TextButton( 47 | onPressed: () => SmartDialog.dismiss(), 48 | child: const Text('取消')), 49 | TextButton( 50 | // TODO 51 | onPressed: () { 52 | SmartDialog.dismiss(); 53 | Utils.openURL('${Strings.remoteUrl}/releases'); 54 | }, 55 | child: const Text('去更新')) 56 | ], 57 | ); 58 | }, 59 | ); 60 | } else { 61 | update[needUpdate] = true; 62 | } 63 | return update; 64 | } 65 | // 版本记录 66 | //https://api.github.com/repos/' + full_name + '/releases 67 | static Future changeLog() async { 68 | var res = await Request().get('https://api.github.com/repos/guozhigq/flutter_v2ex/releases'); 69 | return res.data; 70 | } 71 | } 72 | -------------------------------------------------------------------------------- /lib/models/change_log.dart: -------------------------------------------------------------------------------- 1 | class ChangeLogModel { 2 | 3 | ChangeLogModel( 4 | 5 | ); 6 | } -------------------------------------------------------------------------------- /lib/models/network/item_node.dart: -------------------------------------------------------------------------------- 1 | class NodeItem { 2 | int? id = 0; 3 | int? stars = 0; 4 | int? topics = 0; // 主题数 5 | String? url = ''; 6 | String? name = ''; // 节点名 7 | String? title = ''; // 展示使用 8 | bool? root = false; // 是否父节点 9 | String? header = ''; // 节点 10 | String? footer = ''; 11 | String? avatarMini = ''; 12 | String? avatarLarge = ''; 13 | String? avatarNormal = ''; 14 | String? parentNodeName = ''; // 父节点名 15 | String? titleAlternative = ''; // 好像没什么用 16 | 17 | NodeItem({ 18 | this.id, 19 | this.stars, 20 | this.topics, 21 | this.url, 22 | this.name, 23 | this.title, 24 | this.root, 25 | this.header, 26 | this.footer, 27 | this.avatarMini, 28 | this.avatarLarge, 29 | this.avatarNormal, 30 | this.parentNodeName, 31 | this.titleAlternative, 32 | }); 33 | 34 | NodeItem.fromJson(Map json) { 35 | id = json['id']; 36 | stars = json['stars']; 37 | topics = json['topics']; 38 | url = json['url']; 39 | name = json['name']; 40 | title = json['title']; 41 | root = json['root']; 42 | header = json['header']; 43 | footer = json['footer']; 44 | avatarMini = json['avatar_mini']; 45 | avatarLarge = json['avatar_large']; 46 | avatarNormal = json['avatar_normal']; 47 | parentNodeName = json['parent_node_name']; 48 | titleAlternative = json['title_alternative']; 49 | } 50 | 51 | Map toJson() { 52 | final Map data = {}; 53 | data['id'] = id; 54 | data['stars'] = stars; 55 | data['topics'] = topics; 56 | data['url'] = url; 57 | data['name'] = name; 58 | data['title'] = title; 59 | data['root'] = root; 60 | data['header'] = header; 61 | data['footer'] = footer; 62 | data['avatar_mini'] = avatarMini; 63 | data['avatar_large'] = avatarLarge; 64 | data['avatar_normal'] = avatarNormal; 65 | data['parent_node_name'] = parentNodeName; 66 | data['title_alternative'] = titleAlternative; 67 | return data; 68 | } 69 | 70 | } 71 | -------------------------------------------------------------------------------- /lib/models/network/item_node_topic.dart: -------------------------------------------------------------------------------- 1 | class TopicNodeItem { 2 | int? topics = 0; 3 | List? aliases = []; 4 | String? name = ""; 5 | String? title = ""; 6 | 7 | TopicNodeItem({ 8 | this.topics, 9 | this.aliases, 10 | this.name, 11 | this.title, 12 | }); 13 | 14 | TopicNodeItem.fromJson(Map json) { 15 | topics = json['topics']; 16 | aliases = json['aliases']; 17 | name = json['name']; 18 | title = json['title']; 19 | } 20 | 21 | Map toJson() { 22 | final Map data = {}; 23 | data['topics'] = topics; 24 | data['aliases'] = aliases; 25 | data['name'] = name; 26 | data['title'] = title; 27 | 28 | return data; 29 | } 30 | 31 | } 32 | -------------------------------------------------------------------------------- /lib/models/network/item_topic.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter_v2ex/models/network/item_node.dart'; 2 | 3 | class TopicItem { 4 | String? memberId = ''; // 发布人id 5 | String? topicId = ''; // 话题id 6 | String? avatar = ''; // 头像 7 | String? topicTitle = ''; // 话题标题 8 | int? replyCount = 0; // 回复数 9 | String? clickCount = ''; // 点击数 10 | String? nodeId = ''; // 节点id 11 | String? nodeName = ''; // 节点名称 12 | String? lastReplyMId = ''; // 最后回复人id 13 | String? lastReplyTime = ''; // 最后回复时间 14 | 15 | TopicItem({ 16 | this.memberId, 17 | this.topicId, 18 | this.avatar, 19 | this.topicTitle, 20 | this.replyCount, 21 | this.clickCount, 22 | this.nodeId, 23 | this.nodeName, 24 | this.lastReplyMId, 25 | this.lastReplyTime, 26 | }); 27 | 28 | TopicItem.fromJson(Map json) { 29 | memberId = MemberItem.fromJson(json['member']).memberId; 30 | avatar = MemberItem.fromJson(json['member']).avatar; 31 | 32 | nodeId = NodeItem.fromJson(json['node']).name; 33 | nodeName = NodeItem.fromJson(json['node']).title; 34 | 35 | topicId = json['id'].toString(); 36 | topicTitle = json['title']; 37 | replyCount = json['replies']; 38 | lastReplyMId = json['last_reply_by']; 39 | int time = json['last_touched']; 40 | lastReplyTime = DateTime.fromMillisecondsSinceEpoch(time * 1000).toString().split('.')[0]; 41 | } 42 | 43 | Map toJson() { 44 | final Map data = {}; 45 | data['id'] = memberId; 46 | data['stars'] = topicId; 47 | data['topics'] = avatar; 48 | data['url'] = topicTitle; 49 | data['name'] = replyCount; 50 | data['title'] = nodeId; 51 | data['root'] = nodeName; 52 | data['header'] = lastReplyMId; 53 | data['footer'] = lastReplyTime; 54 | return data; 55 | } 56 | 57 | } 58 | 59 | class MemberItem { 60 | String? memberId = ''; 61 | String? avatar = ''; 62 | 63 | MemberItem.fromJson(Map json) { 64 | memberId = json['username']; 65 | avatar = json['avatar_large']; 66 | } 67 | 68 | Map toJson() { 69 | final Map data = {}; 70 | data['username'] = memberId; 71 | data['avatar_large'] = avatar; 72 | 73 | return data; 74 | } 75 | } 76 | 77 | 78 | -------------------------------------------------------------------------------- /lib/models/tabs.dart: -------------------------------------------------------------------------------- 1 | class TabModel { 2 | String name; 3 | String id; 4 | String type; 5 | bool checked; 6 | 7 | TabModel(this.name, this.id, this.type, this.checked); 8 | 9 | TabModel.fromJson(Map json) 10 | : name = json['name'], 11 | id = json['id'], 12 | type = json['type'], 13 | checked = json['checked']; 14 | 15 | Map toJson() => 16 | {'name': name, 'id': id, 'type': type, 'checked': checked}; 17 | } 18 | -------------------------------------------------------------------------------- /lib/models/version.dart: -------------------------------------------------------------------------------- 1 | class VersionModel { 2 | String tag_name; // 版本号 3 | List assets; // 资源 4 | String body; // 更新日志 5 | 6 | VersionModel( 7 | this.tag_name, 8 | this.assets, 9 | this.body, 10 | ); 11 | 12 | VersionModel.fromJson(Map json) 13 | : tag_name = json['tag_name'], 14 | assets = json['assets'], 15 | body = json['body']; 16 | 17 | Map toJson() => 18 | {'tag_name': tag_name, 'assets': assets, 'body': body}; 19 | } 20 | -------------------------------------------------------------------------------- /lib/models/web/item_member_avatar.dart: -------------------------------------------------------------------------------- 1 | class Avatar { 2 | String avatar = ''; 3 | String avatarMini = ''; 4 | String avatarNormal = ''; 5 | String avatarLarge = ''; 6 | String avatarXlarge = ''; 7 | String avatar2Xlarge = ''; 8 | String avatar3Xlarge = ''; 9 | } 10 | -------------------------------------------------------------------------------- /lib/models/web/item_member_notice.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter_v2ex/utils/string.dart'; 2 | 3 | class MemberNoticeItem { 4 | String memberId = ''; // 回复用户id 5 | String memberAvatar = ''; // 回复用户头像 6 | String replyContent = ''; // 回复内容 7 | var replyContentHtml; 8 | List replyMemberId = []; // 被回复id 9 | String replyTime = ''; // 回复时间 10 | String topicTitle = ''; // 主题标题 11 | var topicTitleHtml; // 主题标题 12 | String topicId = ''; // 主题id 13 | String delIdOne = ''; // 删除id 14 | String delIdTwo = ''; // 删除id 15 | NoticeType noticeType = NoticeType.reply; // 消息类型 可枚举 16 | String topicHref = ''; // 主题href /t/923791#reply101 17 | } 18 | -------------------------------------------------------------------------------- /lib/models/web/item_member_reply.dart: -------------------------------------------------------------------------------- 1 | // 个人中心 回复item 2 | class MemberReplyItem { 3 | String time = ''; 4 | String replyContent = ''; 5 | String memberId = ''; 6 | String nodeName = ''; 7 | String topicTitle = ''; 8 | String topicId = ''; 9 | } 10 | -------------------------------------------------------------------------------- /lib/models/web/item_member_social.dart: -------------------------------------------------------------------------------- 1 | class MemberSocialItem { 2 | String name = ''; 3 | String href = ''; 4 | String type = ''; 5 | String icon = ''; 6 | } -------------------------------------------------------------------------------- /lib/models/web/item_member_topic.dart: -------------------------------------------------------------------------------- 1 | // 个人中心 主题item 2 | class MemberTopicItem { 3 | String topicTitle = ''; 4 | String topicId = ''; 5 | String nodeName = ''; 6 | String nodeId = ''; 7 | String time = ''; 8 | String replyCount = '0'; 9 | String lastReplyTime = ''; 10 | String avatar = ''; 11 | String memberId = ''; 12 | } 13 | -------------------------------------------------------------------------------- /lib/models/web/item_node_list.dart: -------------------------------------------------------------------------------- 1 | class NodeListItem { 2 | /// unread 未读 3 | /// read 已读 4 | String readStatus = 'unread'; 5 | String memberId = ''; // 发布人id 6 | String topicId = ''; // 主题id 7 | String avatar = ''; // 头像 8 | String topicTitle = ''; // 标题 9 | String replyCount = ''; // 回复数 10 | String clickCount = ''; // 点击数 11 | String lastReplyTime = ''; // 上次回复时间 12 | } 13 | -------------------------------------------------------------------------------- /lib/models/web/item_tab_topic.dart: -------------------------------------------------------------------------------- 1 | import 'package:hive/hive.dart'; 2 | 3 | part 'item_tab_topic.g.dart'; 4 | 5 | // 主页tab下的item 6 | @HiveType(typeId: 0) 7 | class TabTopicItem extends HiveObject { 8 | /// unread 未读 9 | /// read 已读 10 | @HiveField(0) 11 | String readStatus = 'unread'; 12 | 13 | @HiveField(1) 14 | String memberId = ''; // 发布人id 15 | 16 | @HiveField(2) 17 | String topicId = ''; // 话题id 18 | 19 | @HiveField(3) 20 | String avatar = ''; // 头像 21 | 22 | @HiveField(4) 23 | String topicTitle = ''; // 话题标题 24 | 25 | @HiveField(5) 26 | int replyCount = 0; // 回复数 27 | 28 | @HiveField(6) 29 | String clickCount = ''; // 点击数 30 | 31 | @HiveField(7) 32 | String nodeId = ''; // 节点id 33 | 34 | @HiveField(8) 35 | String nodeName = ''; // 节点名称 36 | 37 | @HiveField(9) 38 | String lastReplyMId = ''; // 最后回复人id 39 | 40 | @HiveField(10) 41 | String lastReplyTime = ''; // 最后回复时间 42 | 43 | // TabTopicItem(); 44 | 45 | // get name => null; 46 | 47 | // Map toMap() { 48 | // final map = {}; 49 | // map['readStatus'] = readStatus; 50 | // map['memberId'] = memberId; 51 | // map['topicId'] = topicId; 52 | // map['avatar'] = avatar; 53 | // map['topicTitle'] = topicTitle; 54 | // map['replyCount'] = replyCount; 55 | // map['clickCount'] = clickCount; 56 | // map['nodeId'] = nodeId; 57 | // map['nodeName'] = nodeName; 58 | // map['lastReplyMId'] = lastReplyMId; 59 | // map['lastReplyTime'] = lastReplyTime; 60 | // return map; 61 | // } 62 | 63 | // TabTopicItem.fromMap(Map map) { 64 | // readStatus = map['readStatus']; 65 | // memberId = map['memberId']; 66 | // topicId = map['topicId']; 67 | // avatar = map['avatar']; 68 | // topicTitle = map['topicTitle']; 69 | // replyCount = map['replyCount']; 70 | // clickCount = map['clickCount']; 71 | // nodeId = map['nodeId']; 72 | // nodeName = map['nodeName']; 73 | // lastReplyMId = map['lastReplyMId']; 74 | // lastReplyTime = map['lastReplyTime']; 75 | // } 76 | } 77 | -------------------------------------------------------------------------------- /lib/models/web/item_tab_topic.g.dart: -------------------------------------------------------------------------------- 1 | // GENERATED CODE - DO NOT MODIFY BY HAND 2 | 3 | part of 'item_tab_topic.dart'; 4 | 5 | // ************************************************************************** 6 | // TypeAdapterGenerator 7 | // ************************************************************************** 8 | 9 | class TabTopicItemAdapter extends TypeAdapter { 10 | @override 11 | final int typeId = 0; 12 | 13 | @override 14 | TabTopicItem read(BinaryReader reader) { 15 | final numOfFields = reader.readByte(); 16 | final fields = { 17 | for (int i = 0; i < numOfFields; i++) reader.readByte(): reader.read(), 18 | }; 19 | return TabTopicItem() 20 | ..readStatus = fields[0] as String 21 | ..memberId = fields[1] as String 22 | ..topicId = fields[2] as String 23 | ..avatar = fields[3] as String 24 | ..topicTitle = fields[4] as String 25 | ..replyCount = fields[5] as int 26 | ..clickCount = fields[6] as String 27 | ..nodeId = fields[7] as String 28 | ..nodeName = fields[8] as String 29 | ..lastReplyMId = fields[9] as String 30 | ..lastReplyTime = fields[10] as String; 31 | } 32 | 33 | @override 34 | void write(BinaryWriter writer, TabTopicItem obj) { 35 | writer 36 | ..writeByte(11) 37 | ..writeByte(0) 38 | ..write(obj.readStatus) 39 | ..writeByte(1) 40 | ..write(obj.memberId) 41 | ..writeByte(2) 42 | ..write(obj.topicId) 43 | ..writeByte(3) 44 | ..write(obj.avatar) 45 | ..writeByte(4) 46 | ..write(obj.topicTitle) 47 | ..writeByte(5) 48 | ..write(obj.replyCount) 49 | ..writeByte(6) 50 | ..write(obj.clickCount) 51 | ..writeByte(7) 52 | ..write(obj.nodeId) 53 | ..writeByte(8) 54 | ..write(obj.nodeName) 55 | ..writeByte(9) 56 | ..write(obj.lastReplyMId) 57 | ..writeByte(10) 58 | ..write(obj.lastReplyTime); 59 | } 60 | 61 | @override 62 | int get hashCode => typeId.hashCode; 63 | 64 | @override 65 | bool operator ==(Object other) => 66 | identical(this, other) || 67 | other is TabTopicItemAdapter && 68 | runtimeType == other.runtimeType && 69 | typeId == other.typeId; 70 | } 71 | -------------------------------------------------------------------------------- /lib/models/web/item_topic_reply.dart: -------------------------------------------------------------------------------- 1 | // 帖子详情页下的评论item 2 | import 'package:hive/hive.dart'; 3 | part 'item_topic_reply.g.dart'; 4 | 5 | @HiveType(typeId: 2) 6 | class ReplyItem { 7 | @HiveField(0) 8 | bool isOwner = false; // 是否op主 9 | @HiveField(1) 10 | String avatar = ''; 11 | @HiveField(2) 12 | String userName = ''; 13 | @HiveField(3) 14 | String lastReplyTime = ''; 15 | @HiveField(4) 16 | String content = ''; // 纯文本 17 | @HiveField(5) 18 | String contentRendered = ''; // 带html标签 19 | @HiveField(6) 20 | String replyId = ''; 21 | @HiveField(7) 22 | int favorites = 0; // 感谢数量 23 | @HiveField(8) 24 | bool favoritesStatus = false; // 感谢状态 登录状态 25 | @HiveField(9) 26 | String number = ''; // 楼层 27 | @HiveField(10) 28 | int floorNumber = 0; // 楼层 29 | @HiveField(11) 30 | String platform = ''; // 平台 Android ios 31 | @HiveField(12) 32 | bool isChoose = false; // 默认不选中, 33 | @HiveField(13) 34 | List replyMemberList = []; // 回复的用户id 35 | @HiveField(14) 36 | List imgList = []; // image 37 | @HiveField(15) 38 | bool isMod = false; // 管理员 39 | } 40 | -------------------------------------------------------------------------------- /lib/models/web/item_topic_reply.g.dart: -------------------------------------------------------------------------------- 1 | // GENERATED CODE - DO NOT MODIFY BY HAND 2 | 3 | part of 'item_topic_reply.dart'; 4 | 5 | // ************************************************************************** 6 | // TypeAdapterGenerator 7 | // ************************************************************************** 8 | 9 | class ReplyItemAdapter extends TypeAdapter { 10 | @override 11 | final int typeId = 2; 12 | 13 | @override 14 | ReplyItem read(BinaryReader reader) { 15 | final numOfFields = reader.readByte(); 16 | final fields = { 17 | for (int i = 0; i < numOfFields; i++) reader.readByte(): reader.read(), 18 | }; 19 | return ReplyItem() 20 | ..isOwner = fields[0] as bool 21 | ..avatar = fields[1] as String 22 | ..userName = fields[2] as String 23 | ..lastReplyTime = fields[3] as String 24 | ..content = fields[4] as String 25 | ..contentRendered = fields[5] as String 26 | ..replyId = fields[6] as String 27 | ..favorites = fields[7] as int 28 | ..favoritesStatus = fields[8] as bool 29 | ..number = fields[9] as String 30 | ..floorNumber = fields[10] as int 31 | ..platform = fields[11] as String 32 | ..isChoose = fields[12] as bool 33 | ..replyMemberList = (fields[13] as List).cast() 34 | ..imgList = (fields[14] as List).cast() 35 | ..isMod = fields[15] as bool; 36 | } 37 | 38 | @override 39 | void write(BinaryWriter writer, ReplyItem obj) { 40 | writer 41 | ..writeByte(16) 42 | ..writeByte(0) 43 | ..write(obj.isOwner) 44 | ..writeByte(1) 45 | ..write(obj.avatar) 46 | ..writeByte(2) 47 | ..write(obj.userName) 48 | ..writeByte(3) 49 | ..write(obj.lastReplyTime) 50 | ..writeByte(4) 51 | ..write(obj.content) 52 | ..writeByte(5) 53 | ..write(obj.contentRendered) 54 | ..writeByte(6) 55 | ..write(obj.replyId) 56 | ..writeByte(7) 57 | ..write(obj.favorites) 58 | ..writeByte(8) 59 | ..write(obj.favoritesStatus) 60 | ..writeByte(9) 61 | ..write(obj.number) 62 | ..writeByte(10) 63 | ..write(obj.floorNumber) 64 | ..writeByte(11) 65 | ..write(obj.platform) 66 | ..writeByte(12) 67 | ..write(obj.isChoose) 68 | ..writeByte(13) 69 | ..write(obj.replyMemberList) 70 | ..writeByte(14) 71 | ..write(obj.imgList) 72 | ..writeByte(15) 73 | ..write(obj.isMod); 74 | } 75 | 76 | @override 77 | int get hashCode => typeId.hashCode; 78 | 79 | @override 80 | bool operator ==(Object other) => 81 | identical(this, other) || 82 | other is ReplyItemAdapter && 83 | runtimeType == other.runtimeType && 84 | typeId == other.typeId; 85 | } 86 | -------------------------------------------------------------------------------- /lib/models/web/item_topic_subtle.dart: -------------------------------------------------------------------------------- 1 | // 帖子详情页下附言 2 | import 'package:hive/hive.dart'; 3 | part 'item_topic_subtle.g.dart'; 4 | 5 | @HiveType(typeId: 3) 6 | class TopicSubtleItem { 7 | @HiveField(0) 8 | String fade = ''; 9 | @HiveField(1) 10 | String content = ''; 11 | } 12 | -------------------------------------------------------------------------------- /lib/models/web/item_topic_subtle.g.dart: -------------------------------------------------------------------------------- 1 | // GENERATED CODE - DO NOT MODIFY BY HAND 2 | 3 | part of 'item_topic_subtle.dart'; 4 | 5 | // ************************************************************************** 6 | // TypeAdapterGenerator 7 | // ************************************************************************** 8 | 9 | class TopicSubtleItemAdapter extends TypeAdapter { 10 | @override 11 | final int typeId = 3; 12 | 13 | @override 14 | TopicSubtleItem read(BinaryReader reader) { 15 | final numOfFields = reader.readByte(); 16 | final fields = { 17 | for (int i = 0; i < numOfFields; i++) reader.readByte(): reader.read(), 18 | }; 19 | return TopicSubtleItem() 20 | ..fade = fields[0] as String 21 | ..content = fields[1] as String; 22 | } 23 | 24 | @override 25 | void write(BinaryWriter writer, TopicSubtleItem obj) { 26 | writer 27 | ..writeByte(2) 28 | ..writeByte(0) 29 | ..write(obj.fade) 30 | ..writeByte(1) 31 | ..write(obj.content); 32 | } 33 | 34 | @override 35 | int get hashCode => typeId.hashCode; 36 | 37 | @override 38 | bool operator ==(Object other) => 39 | identical(this, other) || 40 | other is TopicSubtleItemAdapter && 41 | runtimeType == other.runtimeType && 42 | typeId == other.typeId; 43 | } 44 | -------------------------------------------------------------------------------- /lib/models/web/model_login_detail.dart: -------------------------------------------------------------------------------- 1 | import 'dart:typed_data'; 2 | 3 | class LoginDetailModel { 4 | String userNameHash = ''; // 用户名key 随机 5 | String passwordHash = ''; // 用户密码key 随机 6 | String codeHash = ''; // 验证码key 随机 7 | String once = ''; // 用户标识id 随机 8 | String captchaImg = ''; // 验证码图片 随机 9 | Uint8List? captchaImgBytes; 10 | String next = '/'; 11 | 12 | String userNameValue = ''; 13 | String passwordValue = ''; 14 | String codeValue = ''; 15 | 16 | bool twoFa = false; 17 | } 18 | -------------------------------------------------------------------------------- /lib/models/web/model_member_notice.dart: -------------------------------------------------------------------------------- 1 | import 'item_member_notice.dart'; 2 | 3 | class MemberNoticeModel { 4 | int totalPage = 1; // 总页数 5 | int totalCount = 0; // 总条目 6 | List noticeList = []; // 消息列表 7 | bool isEmpty = false; // 无内容 8 | } 9 | -------------------------------------------------------------------------------- /lib/models/web/model_member_profile.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter_v2ex/models/web/item_member_topic.dart'; 2 | import 'package:flutter_v2ex/models/web/item_member_reply.dart'; 3 | import 'package:flutter_v2ex/models/web/item_member_social.dart'; 4 | 5 | class ModelMemberProfile { 6 | List topicList = []; // 主题列表 7 | List replyList = []; // 回复列表 8 | List socialList = []; // 社交 9 | String memberId = ''; 10 | String mbAvatar = ''; 11 | String mbSort = ''; 12 | String mbCreatedTime = ''; 13 | String mbSign = ''; // 简介 14 | bool isOnline = false; // 是否在线 15 | bool isFollow = false; // 是否关注 16 | bool isBlock = false; // 是否block 17 | bool isShowTopic = true; // 隐私设置 主题 18 | bool isShowReply = true; // 隐私设置 回复 19 | bool isEmptyTopic = false; // 主题列表为空 20 | bool isEmptyReply = false; // 回复列表为空 21 | bool isOwner = false; // 是否 本人 22 | } -------------------------------------------------------------------------------- /lib/models/web/model_member_reply.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter_v2ex/models/web/item_member_reply.dart'; 2 | 3 | class ModelMemberReply { 4 | int totalPage = 1; 5 | int replyCount = 0; 6 | late List replyList = []; 7 | } -------------------------------------------------------------------------------- /lib/models/web/model_member_topic.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter_v2ex/models/web/item_member_topic.dart'; 2 | 3 | class ModelMemberTopic { 4 | String totalPage = '1'; 5 | bool isShow = true; // 是否设置隐私 6 | bool isEmpty = false; // 主题列表为空 7 | int topicCount = 0; 8 | late List topicList; 9 | } 10 | -------------------------------------------------------------------------------- /lib/models/web/model_node_fav.dart: -------------------------------------------------------------------------------- 1 | class NodeFavModel { 2 | String nodeCover = ''; // 节点图标 3 | String nodeName = ''; // 节点 名称 4 | String nodeId = ''; // 节点id 5 | String topicCount = ''; // 节点主题数量 6 | } 7 | -------------------------------------------------------------------------------- /lib/models/web/model_node_list.dart: -------------------------------------------------------------------------------- 1 | // import 'package:flutter_v2ex/models/web/item_node_list.dart'; 2 | // 某节点下的主题列表 3 | import 'package:flutter_v2ex/models/web/item_tab_topic.dart'; 4 | 5 | class NodeListModel { 6 | String nodeId = ''; // 节点id 7 | String nodeName = ''; // 节点名称 8 | String nodeIntro = ''; // 节点描述 9 | String topicCount = ''; // 主题数量 10 | bool isFavorite = false; // 是否收藏节点 11 | int favoriteCount = 0; // 收藏人数 12 | int totalPage = 1; // 总页数 13 | String nodeCover = ''; // 封面 14 | 15 | late List topicList; 16 | } 17 | -------------------------------------------------------------------------------- /lib/models/web/model_topic_detail.dart: -------------------------------------------------------------------------------- 1 | import 'package:hive/hive.dart'; 2 | import 'package:flutter_v2ex/models/web/item_topic_reply.dart'; 3 | import 'package:flutter_v2ex/models/web/item_topic_subtle.dart'; 4 | 5 | part 'model_topic_detail.g.dart'; 6 | /// 帖子详情(含评论)数据 7 | 8 | @HiveType(typeId: 1) 9 | class TopicDetailModel { 10 | @HiveField(0) 11 | String topicId = ''; // 帖子id 12 | @HiveField(1) 13 | String nodeId = ''; // 节点id 14 | @HiveField(2) 15 | String nodeName = ''; // 节点名称 16 | @HiveField(3) 17 | String topicTitle = ''; // 标题 18 | @HiveField(4) 19 | String createdId = ''; // 创建人 20 | @HiveField(5) 21 | String avatar = ''; 22 | @HiveField(6) 23 | int replyCount = 0; 24 | @HiveField(7) 25 | // String smallGray = ''; // 6 小时 21 分钟前 · 3366 次点击 26 | String createdTime = ''; // 创建时间 27 | @HiveField(8) 28 | String visitorCount = ''; // 点击数 29 | @HiveField(9) 30 | String content = ''; // 纯文本内容 31 | @HiveField(10) 32 | String contentRendered = ''; // 带html标签内容 33 | @HiveField(11) 34 | late List subtleList = []; // 附言 35 | @HiveField(12) 36 | int imgCount = 0; // 正文&附言image数量 37 | @HiveField(13) 38 | List imgList = []; // 正文&附言image 39 | @HiveField(14) 40 | bool isAuth = false; // 是否需要登录 默认不需要 41 | @HiveField(15) 42 | String token = ''; // 用于操作:对主题收藏 43 | // 忽略主题 45 | // String once = ''; // 用于操作:对忽略主题、给主题发送感谢、对评论发送感谢 46 | @HiveField(16) 47 | bool isFavorite = false; // 是否已收藏 48 | @HiveField(17) 49 | int favoriteCount = 0; // 收藏的人数 50 | @HiveField(18) 51 | bool isThank = false; // 是否已感谢 52 | 53 | // op 54 | @HiveField(19) 55 | bool isAPPEND = false; // 默认不可增加附言 56 | @HiveField(20) 57 | bool isEDIT = false; // 默认不可编辑主题 58 | @HiveField(21) 59 | bool isMOVE = false; // 默认不可移动节点 60 | @HiveField(22) 61 | int totalPage = 1; // 共有多少页数评论 62 | @HiveField(23) 63 | late List replyList; 64 | } 65 | -------------------------------------------------------------------------------- /lib/models/web/model_topic_fav.dart: -------------------------------------------------------------------------------- 1 | // 收藏的主题列表 2 | import 'package:flutter_v2ex/models/web/item_tab_topic.dart'; 3 | 4 | class FavTopicModel { 5 | int totalPage = 1; // 总页数 6 | late List topicList; // 主题列表 7 | } 8 | -------------------------------------------------------------------------------- /lib/models/web/model_topic_follow.dart: -------------------------------------------------------------------------------- 1 | // 关注的主题列表 2 | import 'package:flutter_v2ex/models/web/item_tab_topic.dart'; 3 | 4 | class FollowTopicModel { 5 | int totalPage = 1; // 总页数 6 | late List topicList; // 主题列表 7 | } 8 | -------------------------------------------------------------------------------- /lib/package/xpath/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: path_pro 2 | description: A starting point for Dart libraries or applications. 3 | version: 0.1.0 4 | homepage: https://github.com/riczhao/xpath 5 | 6 | environment: 7 | sdk: ">=2.12.0 <3.0.0" 8 | 9 | dev_dependencies: 10 | test: ^1.18.2 11 | -------------------------------------------------------------------------------- /lib/package/xpath/xpath.dart: -------------------------------------------------------------------------------- 1 | library xpath; 2 | 3 | export 'src/xpath_base.dart' show ETree, ElementType, Element; 4 | -------------------------------------------------------------------------------- /lib/pages/help/change_log/controller.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter_v2ex/http/github.dart'; 2 | import 'package:get/get.dart'; 3 | 4 | class ChangeLogController extends GetxController { 5 | 6 | @override 7 | void onInit() { 8 | super.onInit(); 9 | queryChangeLog(); 10 | } 11 | 12 | Future queryChangeLog() async{ 13 | var res = await GithubApi.changeLog(); 14 | return res; 15 | } 16 | } -------------------------------------------------------------------------------- /lib/pages/help/change_log/index.dart: -------------------------------------------------------------------------------- 1 | library change_log; 2 | 3 | export './controller.dart'; 4 | export './view.dart'; 5 | -------------------------------------------------------------------------------- /lib/pages/help/change_log/view.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:flutter_v2ex/utils/utils.dart'; 3 | import 'package:get/get.dart'; 4 | import 'controller.dart'; 5 | 6 | class ChangeLogPage extends StatefulWidget { 7 | const ChangeLogPage({Key? key}) : super(key: key); 8 | 9 | @override 10 | State createState() => _ChangeLogPageState(); 11 | } 12 | 13 | class _ChangeLogPageState extends State { 14 | final ChangeLogController _changeLogController = 15 | Get.put(ChangeLogController()); 16 | 17 | @override 18 | Widget build(BuildContext context) { 19 | return SafeArea( 20 | top: false, 21 | child: Scaffold( 22 | appBar: AppBar( 23 | title: const Text('更新日志'), 24 | actions: [ 25 | IconButton( 26 | onPressed: () => Utils.openURL( 27 | 'https://github.com/guozhigq/flutter_v2ex/releases'), 28 | icon: const Icon(Icons.open_in_browser)) 29 | ], 30 | ), 31 | body: FutureBuilder( 32 | future: _changeLogController.queryChangeLog(), 33 | builder: (context, snapshot) { 34 | if (snapshot.connectionState == ConnectionState.done) { 35 | if (snapshot.data.isNotEmpty) { 36 | return _buildView(context, snapshot.data); 37 | } else { 38 | return const Center(child: Text('没有数据')); 39 | } 40 | } else { 41 | return const Center( 42 | child: CircularProgressIndicator(), 43 | ); 44 | } 45 | }, 46 | ), 47 | )); 48 | } 49 | 50 | Widget _buildView(context, data) { 51 | List versionList = []; 52 | for (var i in data) { 53 | versionList.add( 54 | Column( 55 | children: [ 56 | ListTile( 57 | title: Text(i['tag_name']), 58 | trailing: IconButton( 59 | icon: Icon( 60 | Icons.download, 61 | color: Theme.of(context).colorScheme.primary, 62 | ), 63 | onPressed: () => Utils.openURL(i['html_url']), 64 | ), 65 | ), 66 | Divider( 67 | color: Theme.of(context).dividerColor.withOpacity(0.1), 68 | height: 1, 69 | indent: 15, 70 | endIndent: 15, 71 | ), 72 | // if(i['body'] != '') 73 | Container( 74 | padding: const EdgeInsets.only( 75 | left: 15, right: 15, top: 20, bottom: 20), 76 | alignment: Alignment.centerLeft, 77 | child: Text(i['body'] != '' ? i['body'] : '无说明'), 78 | ), 79 | ], 80 | ), 81 | ); 82 | } 83 | return SingleChildScrollView( 84 | child: Column( 85 | children: versionList, 86 | ), 87 | ); 88 | } 89 | } 90 | -------------------------------------------------------------------------------- /lib/pages/help/network.dart: -------------------------------------------------------------------------------- 1 | import 'package:dio/dio.dart'; 2 | import 'package:flutter/material.dart'; 3 | import 'package:flutter_v2ex/utils/string.dart'; 4 | 5 | class NetworkCheckPage extends StatefulWidget { 6 | const NetworkCheckPage({Key? key}) : super(key: key); 7 | 8 | @override 9 | State createState() => _NetworkCheckPageState(); 10 | } 11 | 12 | class _NetworkCheckPageState extends State { 13 | String response = ''; 14 | bool isLoading = true; 15 | 16 | @override 17 | void initState() { 18 | // TODO: implement initState 19 | super.initState(); 20 | init(); 21 | } 22 | 23 | init() async { 24 | var res; 25 | try { 26 | res = await Dio().get('${Strings.v2exHost}/'); 27 | response = res.data.toString(); 28 | } on DioError catch (e) { 29 | res = e; 30 | response = e.toString(); 31 | } 32 | setState(() { 33 | isLoading = false; 34 | }); 35 | } 36 | 37 | @override 38 | Widget build(BuildContext context) { 39 | return Scaffold( 40 | appBar: AppBar( 41 | title: Text.rich( 42 | TextSpan( 43 | style: Theme.of(context) 44 | .textTheme 45 | .titleMedium! 46 | .copyWith(letterSpacing: 1), 47 | children: [ 48 | TextSpan( 49 | text: '网络信息', style: Theme.of(context).textTheme.titleLarge), 50 | const TextSpan(text: ' '), 51 | if (response != '' && response.startsWith(' hotTopicList = [].obs; 9 | 10 | Future> queryHotTopic({type = 'init'}) async { 11 | var res = await DioRequestNet.getHotTopic(); 12 | List list = []; 13 | for (var i in res) { 14 | TabTopicItem item = TabTopicItem(); 15 | item.memberId = i.memberId!; 16 | item.topicId = i.topicId!; 17 | item.avatar = i.avatar!; 18 | item.topicTitle = i.topicTitle!; 19 | item.replyCount = i.replyCount!; 20 | item.clickCount = i.clickCount!; 21 | item.nodeId = i.nodeId!; 22 | item.nodeName = i.nodeName!; 23 | item.lastReplyMId = i.lastReplyMId!; 24 | item.lastReplyTime = i.lastReplyTime!; 25 | list.add(item); 26 | } 27 | final TopicController topicController = Get.find(); 28 | hotTopicList.value = list; 29 | topicController.setTopic(list[0]); 30 | return res; 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /lib/pages/hot/index.dart: -------------------------------------------------------------------------------- 1 | library hot_page; 2 | 3 | export 'controller.dart'; 4 | export 'view.dart'; 5 | -------------------------------------------------------------------------------- /lib/pages/page_agreement.dart: -------------------------------------------------------------------------------- 1 | import 'package:get/get.dart'; 2 | import 'package:flutter/material.dart'; 3 | 4 | class AgreementPage extends StatelessWidget { 5 | const AgreementPage({Key? key}) : super(key: key); 6 | 7 | @override 8 | Widget build(BuildContext context) { 9 | return Scaffold( 10 | appBar: AppBar( 11 | title: Text( Get.parameters['source'] == 'privacy' ? '隐私政策' : '用户协议'), 12 | ), 13 | body: SingleChildScrollView( 14 | child: Padding( 15 | padding: const EdgeInsets.all(20), 16 | child: Column( 17 | crossAxisAlignment: CrossAxisAlignment.start, 18 | children: const [ 19 | Text( 20 | '欢迎使用我们的应用程序。本隐私政策旨在向您介绍我们如何收集、使用和共享关于您的信息。我们会尊重您的隐私并保护您的数据。如果您有任何问题,请随时联系我们。我们会尽力为你解答疑问。', 21 | style: TextStyle(fontSize: 16), 22 | ), 23 | SizedBox(height: 25), 24 | Text( 25 | '信息收集和使用', 26 | style: TextStyle(fontSize: 20, fontWeight: FontWeight.bold), 27 | ), 28 | SizedBox(height: 10), 29 | Text( 30 | '我们不会收集、存储、分享或使用您的个人身份信息。我们仅收集您的匿名数据以改进您的应用体验。例如,我们可能会记录您访问应用程序中的哪些页面,使用了哪些功能,并记录一些设备信息,例如您的操作系统版本和移动设备型号。这些数据与您的身份信息是分离的,不会被用于任何其他目的。', 31 | style: TextStyle(fontSize: 16), 32 | ), 33 | SizedBox(height: 25), 34 | Text( 35 | '数据安全', 36 | style: TextStyle(fontSize: 20, fontWeight: FontWeight.bold), 37 | ), 38 | SizedBox(height: 10), 39 | Text( 40 | '我们会采取合理的措施来保护您的数据,并确保其完整性。我们将尽力防止未经授权访问、使用、更改或泄露您的数据。', 41 | style: TextStyle(fontSize: 16), 42 | ), 43 | SizedBox(height: 25), 44 | Text( 45 | '法律信息', 46 | style: TextStyle(fontSize: 20, fontWeight: FontWeight.bold), 47 | ), 48 | SizedBox(height: 10), 49 | Text( 50 | '我们将尽力遵守适用的隐私法律。', 51 | style: TextStyle(fontSize: 16), 52 | ), 53 | SizedBox(height: 25), 54 | Text( 55 | '变更与更新', 56 | style: TextStyle(fontSize: 20, fontWeight: FontWeight.bold), 57 | ), 58 | SizedBox(height: 10), 59 | Text( 60 | '我们保留随时更新或修改本隐私政策的权利。如果我们对本隐私政策进行重大更改,我们将通过向您发送电子邮件或在我们的网站上发布通知来通知您。为了确保您了解我们如何收集和使用您的数据,我们建议您定期查看此页面以获取最新信息。', 61 | style: TextStyle(fontSize: 16), 62 | ), 63 | SizedBox(height: 25), 64 | Text( 65 | '联系我们', 66 | style: TextStyle(fontSize: 20, fontWeight: FontWeight.bold), 67 | ), 68 | SizedBox(height: 10), 69 | Text( 70 | '如果您对本隐私政策有任何疑问或意见,请与我们联系。', 71 | style: TextStyle(fontSize: 16), 72 | ), 73 | SizedBox(height: 10), 74 | Text('Email: guozhigq@outlook.com'), 75 | SizedBox(height: 25), 76 | Text('感谢您使用我们的应用!', style: TextStyle(fontSize: 16)), 77 | SizedBox(height: 30), 78 | ], 79 | ), 80 | ), 81 | ), 82 | ); 83 | } 84 | } 85 | -------------------------------------------------------------------------------- /lib/pages/search/index.dart: -------------------------------------------------------------------------------- 1 | library search; 2 | 3 | export './controller.dart'; 4 | export './view.dart'; 5 | -------------------------------------------------------------------------------- /lib/pages/search/widgets/appbar.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:flutter_v2ex/components/search/menu.dart'; 3 | import 'package:flutter_v2ex/pages/search/controller.dart'; 4 | import 'package:flutter_v2ex/service/i18n_keyword.dart'; 5 | import 'package:get/get.dart'; 6 | 7 | class SAppBar extends StatelessWidget implements PreferredSizeWidget { 8 | SAppBar({super.key}); 9 | final SSearchController _searchController = Get.put(SSearchController()); 10 | 11 | @override 12 | Size get preferredSize => AppBar().preferredSize + const Offset(0, 50); 13 | 14 | @override 15 | Widget build(BuildContext context) { 16 | return AppBar( 17 | elevation: 1, 18 | title: Obx( 19 | () => TextField( 20 | controller: _searchController.controller.value, 21 | autofocus: true, 22 | focusNode: _searchController.replyContentFocusNode.value, 23 | textInputAction: TextInputAction.search, 24 | onChanged: (value) => _searchController.onChange(value), 25 | decoration: InputDecoration( 26 | hintText: I18nKeyword.searchPower.tr, 27 | border: InputBorder.none, 28 | suffixIcon: _searchController.searchKeyWord.value.isNotEmpty 29 | ? IconButton( 30 | icon: Icon( 31 | Icons.clear, 32 | color: Theme.of(context).colorScheme.outline, 33 | ), 34 | onPressed: () => _searchController.onClear()) 35 | : null, 36 | ), 37 | onSubmitted: (String value) => _searchController.submit(value), 38 | ), 39 | ), 40 | bottom: PreferredSize( 41 | preferredSize: const Size.fromHeight(50.0), 42 | child: SearchMenu( 43 | setSort: _searchController.setSort, 44 | setOrder: _searchController.setOrder, 45 | setStartTime: _searchController.setStartTime, 46 | setEndTime: _searchController.setEndTime, 47 | ), 48 | ), 49 | ); 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /lib/pages/setting/page_display_mode.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:flutter/scheduler.dart'; 3 | import 'package:flutter/services.dart'; 4 | import 'package:flutter_displaymode/flutter_displaymode.dart'; 5 | import 'package:flutter_v2ex/utils/storage.dart'; 6 | 7 | class SetDiaplayMode extends StatefulWidget { 8 | const SetDiaplayMode({super.key}); 9 | 10 | @override 11 | State createState() => _SetDiaplayModeState(); 12 | } 13 | 14 | class _SetDiaplayModeState extends State { 15 | List modes = []; 16 | DisplayMode? active; 17 | DisplayMode? preferred; 18 | 19 | final ValueNotifier page = ValueNotifier(0); 20 | late final PageController controller = PageController() 21 | ..addListener(() { 22 | page.value = controller.page!.round(); 23 | }); 24 | @override 25 | void initState() { 26 | super.initState(); 27 | init(); 28 | SchedulerBinding.instance.addPostFrameCallback((_) { 29 | fetchAll(); 30 | }); 31 | } 32 | 33 | Future fetchAll() async { 34 | preferred = await FlutterDisplayMode.preferred; 35 | active = await FlutterDisplayMode.active; 36 | GStorage().setDisplayModeType(preferred!); 37 | setState(() {}); 38 | } 39 | 40 | Future init() async { 41 | try { 42 | modes = await FlutterDisplayMode.supported; 43 | } on PlatformException catch (e) { 44 | print(e); 45 | } 46 | var res = await GStorage().getDisplayModeType(); 47 | preferred = modes.toList().firstWhere((el) => el == res); 48 | FlutterDisplayMode.setPreferredMode(preferred!); 49 | } 50 | 51 | @override 52 | Widget build(BuildContext context) { 53 | return Scaffold( 54 | appBar: AppBar(title: const Text('屏幕帧率设置')), 55 | body: SafeArea( 56 | top: false, 57 | child: Column( 58 | crossAxisAlignment: CrossAxisAlignment.start, 59 | children: [ 60 | if (modes.isEmpty) const Text('Nothing here'), 61 | Padding( 62 | padding: const EdgeInsets.only(left: 25, top: 10, bottom: 5), 63 | child: Text( 64 | '没有生效?重启app试试', 65 | style: TextStyle(color: Theme.of(context).colorScheme.outline), 66 | ), 67 | ), 68 | Expanded( 69 | child: ListView.builder( 70 | itemCount: modes.length, 71 | itemBuilder: (_, int i) { 72 | final DisplayMode mode = modes[i]; 73 | return RadioListTile( 74 | value: mode, 75 | title: mode == DisplayMode.auto 76 | ? const Text('自动') 77 | : Text('$mode${mode == active ? " [系统]" : ""}'), 78 | groupValue: preferred, 79 | onChanged: (DisplayMode? newMode) async { 80 | await FlutterDisplayMode.setPreferredMode(newMode!); 81 | await Future.delayed( 82 | const Duration(milliseconds: 100), 83 | ); 84 | await fetchAll(); 85 | }, 86 | ); 87 | }, 88 | ), 89 | ), 90 | ], 91 | ), 92 | ), 93 | ); 94 | } 95 | } 96 | -------------------------------------------------------------------------------- /lib/pages/t/controller.dart: -------------------------------------------------------------------------------- 1 | import 'package:get/get.dart'; 2 | import 'package:flutter_v2ex/models/web/item_tab_topic.dart'; 3 | 4 | class TopicController extends GetxController { 5 | RxString topicId = ''.obs; 6 | Rx topic = TabTopicItem().obs; 7 | 8 | void setTopic(value) { 9 | topic.value = value; 10 | topicId.value = value.topicId; 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /lib/service/i18n_keyword.dart: -------------------------------------------------------------------------------- 1 | class I18nKeyword{ 2 | // 首页 3 | static const String drawer = "drawer"; 4 | static const String search = "search"; 5 | static const String avatar = "avatar"; 6 | static const String notice = "notice"; 7 | static const String node = "node"; 8 | static const String searchPower = "The search function is provided by sov2ex"; 9 | static const String createdTime = "createdTime"; 10 | static const String startDate = "startDate"; 11 | static const String endDate = "endDate"; 12 | static const String recentPriority = "Recent Priority"; 13 | static const String historicalPriority = "Historical Priority"; 14 | static const String selectOrder = "Select Ascending or Descending Order"; 15 | 16 | // 侧边栏 17 | static const String todayHot = "todayHot"; 18 | static const String history = "history"; 19 | static const String myFollow = "myFollow"; 20 | static const String myFavorite = "myFavorite"; 21 | static const String createTopic = "createTopic"; 22 | static const String chooseTheme = "theme"; 23 | static const String setting = "setting"; 24 | static const String help = "help"; 25 | 26 | // topic 27 | static const String replyAction = "reply"; 28 | static const String replies = "replies"; 29 | static const String topicClick = "topicClick"; 30 | static const String topicFav = "topicFav"; 31 | static const String topicIgnore = "Ignore Topic"; 32 | static const String topicShare = "Share"; 33 | static const String topicReport = "Report Topic"; 34 | static const String topicThank = "Thank Topic"; 35 | static const String openInBrowser = "To open in a browser"; 36 | 37 | static const String replyThank = "Thank"; 38 | static const String viewResponse = "View Response"; 39 | static const String noMoreResponses = "No more responses"; 40 | 41 | static const String noData = "no data"; 42 | static const String clearHistory = "clear History"; 43 | } 44 | -------------------------------------------------------------------------------- /lib/service/search.dart: -------------------------------------------------------------------------------- 1 | import 'package:hive/hive.dart'; 2 | import 'package:hive_flutter/hive_flutter.dart'; 3 | 4 | class Search { 5 | final Box box = Hive.box('recentSearchBox'); 6 | 7 | Future queryList() async { 8 | return box.get('history') ?? []; 9 | } 10 | 11 | Future add(String searchText) async { 12 | List historyList = box.get('history') ?? []; 13 | if (historyList.contains(searchText.trim())) { 14 | historyList.remove(searchText.trim()); 15 | } 16 | historyList.insert(0, searchText); 17 | await box.put('history', historyList); 18 | return historyList; 19 | } 20 | 21 | void move(String searchText) { 22 | List historyList = box.get('history') ?? []; 23 | historyList.removeAt(historyList.indexOf(searchText)); 24 | box.put('history', historyList); 25 | } 26 | 27 | void clear() { 28 | box.clear(); 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /lib/utils/app_scheme.dart: -------------------------------------------------------------------------------- 1 | import 'package:appscheme/appscheme.dart'; 2 | import 'package:get/get.dart'; 3 | 4 | class VvexScheme { 5 | static AppScheme appScheme = AppSchemeImpl.getInstance()!; 6 | static Future init() async { 7 | /// 8 | final SchemeEntity? value = await appScheme.getInitScheme(); 9 | if (value != null) { 10 | print('SchemeEntity:${value.host}'); 11 | } 12 | 13 | /// 完整链接进入 14 | appScheme.getLatestScheme().then((SchemeEntity? value) { 15 | if (value != null) { 16 | print('getLatestScheme: ${value.host}'); 17 | } 18 | }); 19 | 20 | /// 注册从外部打开的Scheme监听信息 # 21 | appScheme.registerSchemeListener().listen((SchemeEntity? event) { 22 | if (event != null) { 23 | print('registerSchemeListener: ${event.host}'); 24 | print('registerSchemeListener: ${event.path}'); 25 | print('registerSchemeListener: ${event.query}'); 26 | Get.toNamed(event.path!, arguments: null); 27 | } 28 | }); 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /lib/utils/cookie.dart: -------------------------------------------------------------------------------- 1 | import 'dart:io'; 2 | import 'package:flutter_v2ex/http/init.dart'; 3 | 4 | class SetCookie { 5 | static onSet(List cookiesList, String url) async { 6 | // 接收 flutter_inappwebview Cookie List 7 | // domain url 8 | List jarCookies = []; 9 | if (cookiesList.isNotEmpty) { 10 | for (var i in cookiesList) { 11 | Cookie jarCookie = Cookie(i.name, i.value); 12 | jarCookies.add(jarCookie); 13 | } 14 | } 15 | await Request.cookieManager.cookieJar 16 | .saveFromResponse(Uri.parse("https://www.v2ex.com/"), jarCookies); 17 | var cookieString = 18 | jarCookies.map((cookie) => '${cookie.name}=${cookie.value}').join('; '); 19 | Request.dio.options.headers['cookie'] = cookieString; 20 | 21 | return true; 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /lib/utils/event_bus.dart: -------------------------------------------------------------------------------- 1 | //订阅者回调签名 2 | typedef void EventCallback(arg); 3 | 4 | class EventBus { 5 | //私有构造函数 6 | EventBus._internal(); 7 | 8 | //保存单例 9 | static final EventBus _singleton = EventBus._internal(); 10 | 11 | //工厂构造函数 12 | factory EventBus() => _singleton; 13 | 14 | //保存事件订阅者队列,key:事件名(id),value: 对应事件的订阅者队列 15 | final _emap = Map?>(); 16 | 17 | //添加订阅者 18 | void on(eventName, EventCallback f) { 19 | _emap[eventName] ??= []; 20 | _emap[eventName]!.add(f); 21 | } 22 | 23 | //移除订阅者 24 | void off(eventName, [EventCallback? f]) { 25 | var list = _emap[eventName]; 26 | if (eventName == null || list == null) return; 27 | if (f == null) { 28 | _emap[eventName] = null; 29 | } else { 30 | list.remove(f); 31 | } 32 | } 33 | 34 | //触发事件,事件触发后该事件所有订阅者会被调用 35 | void emit(eventName, [arg]) { 36 | var list = _emap[eventName]; 37 | if (list == null) return; 38 | int len = list.length - 1; 39 | //反向遍历,防止订阅者在回调中移除自身带来的下标错位 40 | for (var i = len; i > -1; --i) { 41 | list[i](arg); 42 | } 43 | } 44 | } 45 | 46 | //定义一个top-level(全局)变量,页面引入该文件后可以直接使用bus 47 | var eventBus = EventBus(); 48 | -------------------------------------------------------------------------------- /lib/utils/global.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:flutter_adaptive_scaffold/flutter_adaptive_scaffold.dart'; 3 | import 'package:flutter_v2ex/http/dio_web.dart'; 4 | import 'package:flutter_v2ex/http/init.dart'; 5 | import 'package:flutter_v2ex/service/local_notice.dart'; 6 | import 'package:flutter_v2ex/utils/hive.dart'; 7 | import 'package:flutter_v2ex/utils/proxy.dart'; 8 | import 'package:flutter_v2ex/utils/storage.dart'; 9 | import 'package:get_storage/get_storage.dart'; 10 | 11 | class Routes { 12 | static GlobalKey navigatorKey = GlobalKey(); 13 | static const String toHomePage = '/'; 14 | static const String toLoginPage = '/login'; 15 | } 16 | 17 | Color getBackground(BuildContext context, tag) { 18 | List case_1 = ['secondBody', 'homePage', 'adaptMain']; 19 | List case_2 = ['searchBar', 'listItem']; 20 | 21 | // ipad 横屏 22 | bool isiPadHorizontal = Breakpoints.large.isActive(context); 23 | if (isiPadHorizontal) { 24 | if(case_1.contains(tag)){ 25 | return Theme.of(context).colorScheme.onInverseSurface; 26 | }else if(case_2.contains(tag)){ 27 | return Theme.of(context).colorScheme.background; 28 | }else{ 29 | return Theme.of(context).colorScheme.onInverseSurface; 30 | } 31 | } else { 32 | if(case_1.contains(tag)){ 33 | return Theme.of(context).colorScheme.background; 34 | }else if(case_2.contains(tag)){ 35 | return Theme.of(context).colorScheme.onInverseSurface; 36 | }else{ 37 | return Theme.of(context).colorScheme.onInverseSurface; 38 | } 39 | } 40 | } 41 | 42 | class Global { 43 | static Future init() async { 44 | WidgetsFlutterBinding.ensureInitialized(); 45 | // 消息通知初始化 46 | try { 47 | await LocalNoticeService().init(); 48 | } catch (err) { 49 | print('LocalNoticeService err: ${err.toString()}'); 50 | } 51 | // 配置代理 52 | CustomProxy().init(); 53 | // 本地存储初始化 54 | try { 55 | await GetStorage.init(); 56 | } catch (err) { 57 | print('GetStorage err: ${err.toString()}'); 58 | } 59 | // Hive初始化 历史浏览box 60 | await initHive(); 61 | // Dio 初始化 62 | await Request().setCookie(); 63 | // 自动签到 64 | var userInfo = GStorage().getUserInfo(); 65 | if (userInfo.isNotEmpty && GStorage().getAutoSign()) { 66 | DioRequestWeb.dailyMission(); 67 | } 68 | // 高帧率滚动性能优化 69 | // GestureBinding.instance.resamplingEnabled = true; 70 | } 71 | } -------------------------------------------------------------------------------- /lib/utils/hive.dart: -------------------------------------------------------------------------------- 1 | import 'package:path_provider/path_provider.dart'; 2 | import 'package:hive_flutter/hive_flutter.dart'; 3 | import 'package:flutter_v2ex/models/web/item_tab_topic.dart'; 4 | import 'package:flutter_v2ex/models/web/item_topic_reply.dart'; 5 | import 'package:flutter_v2ex/models/web/item_topic_subtle.dart'; 6 | import 'package:flutter_v2ex/models/web/model_topic_detail.dart'; 7 | 8 | Future initHive() async { 9 | var databasesPath = await getApplicationSupportDirectory(); 10 | //Hive.init('./'); 11 | await Hive.initFlutter('${databasesPath.path}/hive_db'); 12 | 13 | Hive.registerAdapter(TabTopicItemAdapter()); // 话题列表item 14 | Hive.registerAdapter(TopicDetailModelAdapter()); // 话题详情 15 | Hive.registerAdapter(ReplyItemAdapter()); // 回复item 16 | Hive.registerAdapter(TopicSubtleItemAdapter()); // 附言item 17 | 18 | // 打开历史浏览盒子 19 | await Hive.openBox('recentTopicsBox'); 20 | // 历史搜索 21 | await Hive.openBox('recentSearchBox'); 22 | } 23 | 24 | void closeHive() { 25 | Hive.close(); 26 | } -------------------------------------------------------------------------------- /lib/utils/proxy.dart: -------------------------------------------------------------------------------- 1 | import 'dart:io'; 2 | import 'package:system_proxy/system_proxy.dart'; 3 | 4 | class CustomProxy { 5 | init() async{ 6 | Map? proxy = await SystemProxy.getProxySettings(); 7 | if (proxy != null) { 8 | HttpOverrides.global = ProxiedHttpOverrides(proxy['host']!, proxy['port']!); 9 | } 10 | } 11 | } 12 | class ProxiedHttpOverrides extends HttpOverrides { 13 | final String _port; 14 | final String _host; 15 | 16 | ProxiedHttpOverrides(this._host, this._port); 17 | 18 | @override 19 | HttpClient createHttpClient(SecurityContext? context) { 20 | return super.createHttpClient(context) 21 | // set proxy 22 | ..findProxy = (uri) { 23 | return "PROXY $_host:$_port;"; 24 | }; 25 | } 26 | } -------------------------------------------------------------------------------- /lib/utils/upload.dart: -------------------------------------------------------------------------------- 1 | import 'dart:math'; 2 | import 'package:dio/dio.dart' as dio; 3 | import 'package:flutter_v2ex/http/init.dart'; 4 | import 'package:wechat_assets_picker/wechat_assets_picker.dart'; 5 | 6 | class Upload { 7 | static const clientId = ["0db8b3c3e10d89b", "6b91ec71f6af441"]; 8 | static const String uploadBaseUrl = 'https://api.imgur.com/3/image'; 9 | static Future uploadImage(String key, AssetEntity file) async { 10 | dio.FormData formData = dio.FormData.fromMap( 11 | { 12 | 'image': await Upload().multipartFileFromAssetEntity(file), 13 | // 'type': 'file' 14 | }, 15 | ); 16 | dio.Options options = dio.Options(); 17 | options.headers = { 18 | 'Authorization': "Client-ID ${clientId[Random().nextInt(2)]}" 19 | }; 20 | options.contentType = 'multipart/form-data'; 21 | var result = 22 | await Request().post(uploadBaseUrl, data: formData, options: options); 23 | return result.data['data']; 24 | } 25 | 26 | Future multipartFileFromAssetEntity( 27 | AssetEntity entity) async { 28 | dio.MultipartFile mf; 29 | // Using the file path. 30 | final file = await entity.file; 31 | if (file == null) { 32 | throw StateError('Unable to obtain file of the entity ${entity.id}.'); 33 | } 34 | mf = await dio.MultipartFile.fromFile(file.path, filename: 'image'); 35 | // Using the bytes. 36 | final bytes = await entity.originBytes; 37 | if (bytes == null) { 38 | throw StateError('Unable to obtain bytes of the entity ${entity.id}.'); 39 | } 40 | mf = dio.MultipartFile.fromBytes(bytes); 41 | return mf; 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /linux/.gitignore: -------------------------------------------------------------------------------- 1 | flutter/ephemeral 2 | -------------------------------------------------------------------------------- /linux/flutter/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # This file controls Flutter-level build steps. It should not be edited. 2 | cmake_minimum_required(VERSION 3.10) 3 | 4 | set(EPHEMERAL_DIR "${CMAKE_CURRENT_SOURCE_DIR}/ephemeral") 5 | 6 | # Configuration provided via flutter tool. 7 | include(${EPHEMERAL_DIR}/generated_config.cmake) 8 | 9 | # TODO: Move the rest of this into files in ephemeral. See 10 | # https://github.com/flutter/flutter/issues/57146. 11 | 12 | # Serves the same purpose as list(TRANSFORM ... PREPEND ...), 13 | # which isn't available in 3.10. 14 | function(list_prepend LIST_NAME PREFIX) 15 | set(NEW_LIST "") 16 | foreach(element ${${LIST_NAME}}) 17 | list(APPEND NEW_LIST "${PREFIX}${element}") 18 | endforeach(element) 19 | set(${LIST_NAME} "${NEW_LIST}" PARENT_SCOPE) 20 | endfunction() 21 | 22 | # === Flutter Library === 23 | # System-level dependencies. 24 | find_package(PkgConfig REQUIRED) 25 | pkg_check_modules(GTK REQUIRED IMPORTED_TARGET gtk+-3.0) 26 | pkg_check_modules(GLIB REQUIRED IMPORTED_TARGET glib-2.0) 27 | pkg_check_modules(GIO REQUIRED IMPORTED_TARGET gio-2.0) 28 | 29 | set(FLUTTER_LIBRARY "${EPHEMERAL_DIR}/libflutter_linux_gtk.so") 30 | 31 | # Published to parent scope for install step. 32 | set(FLUTTER_LIBRARY ${FLUTTER_LIBRARY} PARENT_SCOPE) 33 | set(FLUTTER_ICU_DATA_FILE "${EPHEMERAL_DIR}/icudtl.dat" PARENT_SCOPE) 34 | set(PROJECT_BUILD_DIR "${PROJECT_DIR}/build/" PARENT_SCOPE) 35 | set(AOT_LIBRARY "${PROJECT_DIR}/build/lib/libapp.so" PARENT_SCOPE) 36 | 37 | list(APPEND FLUTTER_LIBRARY_HEADERS 38 | "fl_basic_message_channel.h" 39 | "fl_binary_codec.h" 40 | "fl_binary_messenger.h" 41 | "fl_dart_project.h" 42 | "fl_engine.h" 43 | "fl_json_message_codec.h" 44 | "fl_json_method_codec.h" 45 | "fl_message_codec.h" 46 | "fl_method_call.h" 47 | "fl_method_channel.h" 48 | "fl_method_codec.h" 49 | "fl_method_response.h" 50 | "fl_plugin_registrar.h" 51 | "fl_plugin_registry.h" 52 | "fl_standard_message_codec.h" 53 | "fl_standard_method_codec.h" 54 | "fl_string_codec.h" 55 | "fl_value.h" 56 | "fl_view.h" 57 | "flutter_linux.h" 58 | ) 59 | list_prepend(FLUTTER_LIBRARY_HEADERS "${EPHEMERAL_DIR}/flutter_linux/") 60 | add_library(flutter INTERFACE) 61 | target_include_directories(flutter INTERFACE 62 | "${EPHEMERAL_DIR}" 63 | ) 64 | target_link_libraries(flutter INTERFACE "${FLUTTER_LIBRARY}") 65 | target_link_libraries(flutter INTERFACE 66 | PkgConfig::GTK 67 | PkgConfig::GLIB 68 | PkgConfig::GIO 69 | ) 70 | add_dependencies(flutter flutter_assemble) 71 | 72 | # === Flutter tool backend === 73 | # _phony_ is a non-existent file to force this command to run every time, 74 | # since currently there's no way to get a full input/output list from the 75 | # flutter tool. 76 | add_custom_command( 77 | OUTPUT ${FLUTTER_LIBRARY} ${FLUTTER_LIBRARY_HEADERS} 78 | ${CMAKE_CURRENT_BINARY_DIR}/_phony_ 79 | COMMAND ${CMAKE_COMMAND} -E env 80 | ${FLUTTER_TOOL_ENVIRONMENT} 81 | "${FLUTTER_ROOT}/packages/flutter_tools/bin/tool_backend.sh" 82 | ${FLUTTER_TARGET_PLATFORM} ${CMAKE_BUILD_TYPE} 83 | VERBATIM 84 | ) 85 | add_custom_target(flutter_assemble DEPENDS 86 | "${FLUTTER_LIBRARY}" 87 | ${FLUTTER_LIBRARY_HEADERS} 88 | ) 89 | -------------------------------------------------------------------------------- /linux/flutter/generated_plugin_registrant.cc: -------------------------------------------------------------------------------- 1 | // 2 | // Generated file. Do not edit. 3 | // 4 | 5 | // clang-format off 6 | 7 | #include "generated_plugin_registrant.h" 8 | 9 | #include 10 | #include 11 | 12 | void fl_register_plugins(FlPluginRegistry* registry) { 13 | g_autoptr(FlPluginRegistrar) dynamic_color_registrar = 14 | fl_plugin_registry_get_registrar_for_plugin(registry, "DynamicColorPlugin"); 15 | dynamic_color_plugin_register_with_registrar(dynamic_color_registrar); 16 | g_autoptr(FlPluginRegistrar) url_launcher_linux_registrar = 17 | fl_plugin_registry_get_registrar_for_plugin(registry, "UrlLauncherPlugin"); 18 | url_launcher_plugin_register_with_registrar(url_launcher_linux_registrar); 19 | } 20 | -------------------------------------------------------------------------------- /linux/flutter/generated_plugin_registrant.h: -------------------------------------------------------------------------------- 1 | // 2 | // Generated file. Do not edit. 3 | // 4 | 5 | // clang-format off 6 | 7 | #ifndef GENERATED_PLUGIN_REGISTRANT_ 8 | #define GENERATED_PLUGIN_REGISTRANT_ 9 | 10 | #include 11 | 12 | // Registers Flutter plugins. 13 | void fl_register_plugins(FlPluginRegistry* registry); 14 | 15 | #endif // GENERATED_PLUGIN_REGISTRANT_ 16 | -------------------------------------------------------------------------------- /linux/flutter/generated_plugins.cmake: -------------------------------------------------------------------------------- 1 | # 2 | # Generated file, do not edit. 3 | # 4 | 5 | list(APPEND FLUTTER_PLUGIN_LIST 6 | dynamic_color 7 | url_launcher_linux 8 | ) 9 | 10 | list(APPEND FLUTTER_FFI_PLUGIN_LIST 11 | ) 12 | 13 | set(PLUGIN_BUNDLED_LIBRARIES) 14 | 15 | foreach(plugin ${FLUTTER_PLUGIN_LIST}) 16 | add_subdirectory(flutter/ephemeral/.plugin_symlinks/${plugin}/linux plugins/${plugin}) 17 | target_link_libraries(${BINARY_NAME} PRIVATE ${plugin}_plugin) 18 | list(APPEND PLUGIN_BUNDLED_LIBRARIES $) 19 | list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${plugin}_bundled_libraries}) 20 | endforeach(plugin) 21 | 22 | foreach(ffi_plugin ${FLUTTER_FFI_PLUGIN_LIST}) 23 | add_subdirectory(flutter/ephemeral/.plugin_symlinks/${ffi_plugin}/linux plugins/${ffi_plugin}) 24 | list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${ffi_plugin}_bundled_libraries}) 25 | endforeach(ffi_plugin) 26 | -------------------------------------------------------------------------------- /linux/main.cc: -------------------------------------------------------------------------------- 1 | #include "my_application.h" 2 | 3 | int main(int argc, char** argv) { 4 | g_autoptr(MyApplication) app = my_application_new(); 5 | return g_application_run(G_APPLICATION(app), argc, argv); 6 | } 7 | -------------------------------------------------------------------------------- /linux/my_application.h: -------------------------------------------------------------------------------- 1 | #ifndef FLUTTER_MY_APPLICATION_H_ 2 | #define FLUTTER_MY_APPLICATION_H_ 3 | 4 | #include 5 | 6 | G_DECLARE_FINAL_TYPE(MyApplication, my_application, MY, APPLICATION, 7 | GtkApplication) 8 | 9 | /** 10 | * my_application_new: 11 | * 12 | * Creates a new Flutter-based application. 13 | * 14 | * Returns: a new #MyApplication. 15 | */ 16 | MyApplication* my_application_new(); 17 | 18 | #endif // FLUTTER_MY_APPLICATION_H_ 19 | -------------------------------------------------------------------------------- /macos/.gitignore: -------------------------------------------------------------------------------- 1 | # Flutter-related 2 | **/Flutter/ephemeral/ 3 | **/Pods/ 4 | 5 | # Xcode-related 6 | **/dgph 7 | **/xcuserdata/ 8 | -------------------------------------------------------------------------------- /macos/Flutter/Flutter-Debug.xcconfig: -------------------------------------------------------------------------------- 1 | #include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig" 2 | #include "ephemeral/Flutter-Generated.xcconfig" 3 | -------------------------------------------------------------------------------- /macos/Flutter/Flutter-Release.xcconfig: -------------------------------------------------------------------------------- 1 | #include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig" 2 | #include "ephemeral/Flutter-Generated.xcconfig" 3 | -------------------------------------------------------------------------------- /macos/Flutter/GeneratedPluginRegistrant.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Generated file. Do not edit. 3 | // 4 | 5 | import FlutterMacOS 6 | import Foundation 7 | 8 | import device_info_plus 9 | import dynamic_color 10 | import flutter_local_notifications 11 | import path_provider_foundation 12 | import photo_manager 13 | import share_plus 14 | import sqflite_darwin 15 | import url_launcher_macos 16 | import video_player_avfoundation 17 | import webview_flutter_wkwebview 18 | 19 | func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) { 20 | DeviceInfoPlusMacosPlugin.register(with: registry.registrar(forPlugin: "DeviceInfoPlusMacosPlugin")) 21 | DynamicColorPlugin.register(with: registry.registrar(forPlugin: "DynamicColorPlugin")) 22 | FlutterLocalNotificationsPlugin.register(with: registry.registrar(forPlugin: "FlutterLocalNotificationsPlugin")) 23 | PathProviderPlugin.register(with: registry.registrar(forPlugin: "PathProviderPlugin")) 24 | PhotoManagerPlugin.register(with: registry.registrar(forPlugin: "PhotoManagerPlugin")) 25 | SharePlusMacosPlugin.register(with: registry.registrar(forPlugin: "SharePlusMacosPlugin")) 26 | SqflitePlugin.register(with: registry.registrar(forPlugin: "SqflitePlugin")) 27 | UrlLauncherPlugin.register(with: registry.registrar(forPlugin: "UrlLauncherPlugin")) 28 | FVPVideoPlayerPlugin.register(with: registry.registrar(forPlugin: "FVPVideoPlayerPlugin")) 29 | FLTWebViewFlutterPlugin.register(with: registry.registrar(forPlugin: "FLTWebViewFlutterPlugin")) 30 | } 31 | -------------------------------------------------------------------------------- /macos/Podfile: -------------------------------------------------------------------------------- 1 | platform :osx, '10.14' 2 | 3 | # CocoaPods analytics sends network stats synchronously affecting flutter build latency. 4 | ENV['COCOAPODS_DISABLE_STATS'] = 'true' 5 | 6 | project 'Runner', { 7 | 'Debug' => :debug, 8 | 'Profile' => :release, 9 | 'Release' => :release, 10 | } 11 | 12 | def flutter_root 13 | generated_xcode_build_settings_path = File.expand_path(File.join('..', 'Flutter', 'ephemeral', 'Flutter-Generated.xcconfig'), __FILE__) 14 | unless File.exist?(generated_xcode_build_settings_path) 15 | raise "#{generated_xcode_build_settings_path} must exist. If you're running pod install manually, make sure \"flutter pub get\" is executed first" 16 | end 17 | 18 | File.foreach(generated_xcode_build_settings_path) do |line| 19 | matches = line.match(/FLUTTER_ROOT\=(.*)/) 20 | return matches[1].strip if matches 21 | end 22 | raise "FLUTTER_ROOT not found in #{generated_xcode_build_settings_path}. Try deleting Flutter-Generated.xcconfig, then run \"flutter pub get\"" 23 | end 24 | 25 | require File.expand_path(File.join('packages', 'flutter_tools', 'bin', 'podhelper'), flutter_root) 26 | 27 | flutter_macos_podfile_setup 28 | 29 | target 'Runner' do 30 | use_frameworks! 31 | use_modular_headers! 32 | 33 | flutter_install_all_macos_pods File.dirname(File.realpath(__FILE__)) 34 | end 35 | 36 | post_install do |installer| 37 | installer.pods_project.targets.each do |target| 38 | flutter_additional_macos_build_settings(target) 39 | end 40 | end 41 | -------------------------------------------------------------------------------- /macos/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /macos/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 37 | 38 | 39 | 40 | 41 | 42 | 52 | 54 | 60 | 61 | 62 | 63 | 69 | 71 | 77 | 78 | 79 | 80 | 82 | 83 | 86 | 87 | 88 | -------------------------------------------------------------------------------- /macos/Runner.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /macos/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /macos/Runner/AppDelegate.swift: -------------------------------------------------------------------------------- 1 | import Cocoa 2 | import FlutterMacOS 3 | 4 | @NSApplicationMain 5 | class AppDelegate: FlutterAppDelegate { 6 | override func applicationShouldTerminateAfterLastWindowClosed(_ sender: NSApplication) -> Bool { 7 | return true 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /macos/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "size" : "16x16", 5 | "idiom" : "mac", 6 | "filename" : "app_icon_16.png", 7 | "scale" : "1x" 8 | }, 9 | { 10 | "size" : "16x16", 11 | "idiom" : "mac", 12 | "filename" : "app_icon_32.png", 13 | "scale" : "2x" 14 | }, 15 | { 16 | "size" : "32x32", 17 | "idiom" : "mac", 18 | "filename" : "app_icon_32.png", 19 | "scale" : "1x" 20 | }, 21 | { 22 | "size" : "32x32", 23 | "idiom" : "mac", 24 | "filename" : "app_icon_64.png", 25 | "scale" : "2x" 26 | }, 27 | { 28 | "size" : "128x128", 29 | "idiom" : "mac", 30 | "filename" : "app_icon_128.png", 31 | "scale" : "1x" 32 | }, 33 | { 34 | "size" : "128x128", 35 | "idiom" : "mac", 36 | "filename" : "app_icon_256.png", 37 | "scale" : "2x" 38 | }, 39 | { 40 | "size" : "256x256", 41 | "idiom" : "mac", 42 | "filename" : "app_icon_256.png", 43 | "scale" : "1x" 44 | }, 45 | { 46 | "size" : "256x256", 47 | "idiom" : "mac", 48 | "filename" : "app_icon_512.png", 49 | "scale" : "2x" 50 | }, 51 | { 52 | "size" : "512x512", 53 | "idiom" : "mac", 54 | "filename" : "app_icon_512.png", 55 | "scale" : "1x" 56 | }, 57 | { 58 | "size" : "512x512", 59 | "idiom" : "mac", 60 | "filename" : "app_icon_1024.png", 61 | "scale" : "2x" 62 | } 63 | ], 64 | "info" : { 65 | "version" : 1, 66 | "author" : "xcode" 67 | } 68 | } 69 | -------------------------------------------------------------------------------- /macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_1024.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/guozhigq/flutter_v2ex/170417910fbb496783d3681a83e08d2467ba4eba/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_1024.png -------------------------------------------------------------------------------- /macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_128.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/guozhigq/flutter_v2ex/170417910fbb496783d3681a83e08d2467ba4eba/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_128.png -------------------------------------------------------------------------------- /macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/guozhigq/flutter_v2ex/170417910fbb496783d3681a83e08d2467ba4eba/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_16.png -------------------------------------------------------------------------------- /macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_256.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/guozhigq/flutter_v2ex/170417910fbb496783d3681a83e08d2467ba4eba/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_256.png -------------------------------------------------------------------------------- /macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/guozhigq/flutter_v2ex/170417910fbb496783d3681a83e08d2467ba4eba/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_32.png -------------------------------------------------------------------------------- /macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/guozhigq/flutter_v2ex/170417910fbb496783d3681a83e08d2467ba4eba/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_512.png -------------------------------------------------------------------------------- /macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_64.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/guozhigq/flutter_v2ex/170417910fbb496783d3681a83e08d2467ba4eba/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_64.png -------------------------------------------------------------------------------- /macos/Runner/Configs/AppInfo.xcconfig: -------------------------------------------------------------------------------- 1 | // Application-level settings for the Runner target. 2 | // 3 | // This may be replaced with something auto-generated from metadata (e.g., pubspec.yaml) in the 4 | // future. If not, the values below would default to using the project name when this becomes a 5 | // 'flutter create' template. 6 | 7 | // The application's name. By default this is also the title of the Flutter window. 8 | PRODUCT_NAME = vvex 9 | 10 | // The application's bundle identifier 11 | PRODUCT_BUNDLE_IDENTIFIER = com.guozhigq.vvex 12 | 13 | // The copyright displayed in application information 14 | PRODUCT_COPYRIGHT = Copyright © 2022 com.example. All rights reserved. 15 | -------------------------------------------------------------------------------- /macos/Runner/Configs/Debug.xcconfig: -------------------------------------------------------------------------------- 1 | #include "../../Flutter/Flutter-Debug.xcconfig" 2 | #include "Warnings.xcconfig" 3 | -------------------------------------------------------------------------------- /macos/Runner/Configs/Release.xcconfig: -------------------------------------------------------------------------------- 1 | #include "../../Flutter/Flutter-Release.xcconfig" 2 | #include "Warnings.xcconfig" 3 | -------------------------------------------------------------------------------- /macos/Runner/Configs/Warnings.xcconfig: -------------------------------------------------------------------------------- 1 | WARNING_CFLAGS = -Wall -Wconditional-uninitialized -Wnullable-to-nonnull-conversion -Wmissing-method-return-type -Woverlength-strings 2 | GCC_WARN_UNDECLARED_SELECTOR = YES 3 | CLANG_UNDEFINED_BEHAVIOR_SANITIZER_NULLABILITY = YES 4 | CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE 5 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES 6 | CLANG_WARN_PRAGMA_PACK = YES 7 | CLANG_WARN_STRICT_PROTOTYPES = YES 8 | CLANG_WARN_COMMA = YES 9 | GCC_WARN_STRICT_SELECTOR_MATCH = YES 10 | CLANG_WARN_OBJC_REPEATED_USE_OF_WEAK = YES 11 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES 12 | GCC_WARN_SHADOW = YES 13 | CLANG_WARN_UNREACHABLE_CODE = YES 14 | -------------------------------------------------------------------------------- /macos/Runner/DebugProfile.entitlements: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | com.apple.security.app-sandbox 6 | 7 | com.apple.security.cs.allow-jit 8 | 9 | com.apple.security.network.server 10 | 11 | com.apple.security.network.client 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /macos/Runner/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | $(DEVELOPMENT_LANGUAGE) 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIconFile 10 | 11 | CFBundleIdentifier 12 | $(PRODUCT_BUNDLE_IDENTIFIER) 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | $(PRODUCT_NAME) 17 | CFBundlePackageType 18 | APPL 19 | CFBundleShortVersionString 20 | $(FLUTTER_BUILD_NAME) 21 | CFBundleVersion 22 | $(FLUTTER_BUILD_NUMBER) 23 | LSMinimumSystemVersion 24 | $(MACOSX_DEPLOYMENT_TARGET) 25 | NSHumanReadableCopyright 26 | $(PRODUCT_COPYRIGHT) 27 | NSMainNibFile 28 | MainMenu 29 | NSPrincipalClass 30 | NSApplication 31 | 32 | 33 | -------------------------------------------------------------------------------- /macos/Runner/MainFlutterWindow.swift: -------------------------------------------------------------------------------- 1 | import Cocoa 2 | import FlutterMacOS 3 | 4 | class MainFlutterWindow: NSWindow { 5 | override func awakeFromNib() { 6 | let flutterViewController = FlutterViewController.init() 7 | let windowFrame = self.frame 8 | self.contentViewController = flutterViewController 9 | self.setFrame(windowFrame, display: true) 10 | 11 | RegisterGeneratedPlugins(registry: flutterViewController) 12 | 13 | super.awakeFromNib() 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /macos/Runner/Release.entitlements: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | com.apple.security.app-sandbox 6 | 7 | com.apple.security.network.client 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /test/widget_test.dart: -------------------------------------------------------------------------------- 1 | // This is a basic Flutter widget test. 2 | // 3 | // To perform an interaction with a widget in your test, use the WidgetTester 4 | // utility in the flutter_test package. For example, you can send tap and scroll 5 | // gestures. You can also use WidgetTester to find child widgets in the widget 6 | // tree, read text, and verify that the values of widget properties are correct. 7 | 8 | import 'package:flutter/material.dart'; 9 | import 'package:flutter_test/flutter_test.dart'; 10 | 11 | import 'package:flutter_v2ex/main.dart'; 12 | 13 | void main() { 14 | testWidgets('Counter increments smoke test', (WidgetTester tester) async { 15 | // Build our app and trigger a frame. 16 | await tester.pumpWidget(const MyApp()); 17 | 18 | // Verify that our counter starts at 0. 19 | expect(find.text('0'), findsOneWidget); 20 | expect(find.text('1'), findsNothing); 21 | 22 | // Tap the '+' icon and trigger a frame. 23 | await tester.tap(find.byIcon(Icons.add)); 24 | await tester.pump(); 25 | 26 | // Verify that our counter has incremented. 27 | expect(find.text('0'), findsNothing); 28 | expect(find.text('1'), findsOneWidget); 29 | }); 30 | } 31 | -------------------------------------------------------------------------------- /web/favicon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/guozhigq/flutter_v2ex/170417910fbb496783d3681a83e08d2467ba4eba/web/favicon.png -------------------------------------------------------------------------------- /web/icons/Icon-192.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/guozhigq/flutter_v2ex/170417910fbb496783d3681a83e08d2467ba4eba/web/icons/Icon-192.png -------------------------------------------------------------------------------- /web/icons/Icon-512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/guozhigq/flutter_v2ex/170417910fbb496783d3681a83e08d2467ba4eba/web/icons/Icon-512.png -------------------------------------------------------------------------------- /web/icons/Icon-maskable-192.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/guozhigq/flutter_v2ex/170417910fbb496783d3681a83e08d2467ba4eba/web/icons/Icon-maskable-192.png -------------------------------------------------------------------------------- /web/icons/Icon-maskable-512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/guozhigq/flutter_v2ex/170417910fbb496783d3681a83e08d2467ba4eba/web/icons/Icon-maskable-512.png -------------------------------------------------------------------------------- /web/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | flutter_v2ex 33 | 34 | 35 | 39 | 40 | 41 | 42 | 43 | 57 | 58 | 59 | -------------------------------------------------------------------------------- /web/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "flutter_v2ex", 3 | "short_name": "flutter_v2ex", 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 | "src": "icons/Icon-maskable-192.png", 24 | "sizes": "192x192", 25 | "type": "image/png", 26 | "purpose": "maskable" 27 | }, 28 | { 29 | "src": "icons/Icon-maskable-512.png", 30 | "sizes": "512x512", 31 | "type": "image/png", 32 | "purpose": "maskable" 33 | } 34 | ] 35 | } 36 | -------------------------------------------------------------------------------- /windows/.gitignore: -------------------------------------------------------------------------------- 1 | flutter/ephemeral/ 2 | 3 | # Visual Studio user-specific files. 4 | *.suo 5 | *.user 6 | *.userosscache 7 | *.sln.docstates 8 | 9 | # Visual Studio build-related files. 10 | x64/ 11 | x86/ 12 | 13 | # Visual Studio cache files 14 | # files ending in .cache can be ignored 15 | *.[Cc]ache 16 | # but keep track of directories ending in .cache 17 | !*.[Cc]ache/ 18 | -------------------------------------------------------------------------------- /windows/flutter/generated_plugin_registrant.cc: -------------------------------------------------------------------------------- 1 | // 2 | // Generated file. Do not edit. 3 | // 4 | 5 | // clang-format off 6 | 7 | #include "generated_plugin_registrant.h" 8 | 9 | #include 10 | #include 11 | #include 12 | #include 13 | 14 | void RegisterPlugins(flutter::PluginRegistry* registry) { 15 | DynamicColorPluginCApiRegisterWithRegistrar( 16 | registry->GetRegistrarForPlugin("DynamicColorPluginCApi")); 17 | PermissionHandlerWindowsPluginRegisterWithRegistrar( 18 | registry->GetRegistrarForPlugin("PermissionHandlerWindowsPlugin")); 19 | SharePlusWindowsPluginCApiRegisterWithRegistrar( 20 | registry->GetRegistrarForPlugin("SharePlusWindowsPluginCApi")); 21 | UrlLauncherWindowsRegisterWithRegistrar( 22 | registry->GetRegistrarForPlugin("UrlLauncherWindows")); 23 | } 24 | -------------------------------------------------------------------------------- /windows/flutter/generated_plugin_registrant.h: -------------------------------------------------------------------------------- 1 | // 2 | // Generated file. Do not edit. 3 | // 4 | 5 | // clang-format off 6 | 7 | #ifndef GENERATED_PLUGIN_REGISTRANT_ 8 | #define GENERATED_PLUGIN_REGISTRANT_ 9 | 10 | #include 11 | 12 | // Registers Flutter plugins. 13 | void RegisterPlugins(flutter::PluginRegistry* registry); 14 | 15 | #endif // GENERATED_PLUGIN_REGISTRANT_ 16 | -------------------------------------------------------------------------------- /windows/flutter/generated_plugins.cmake: -------------------------------------------------------------------------------- 1 | # 2 | # Generated file, do not edit. 3 | # 4 | 5 | list(APPEND FLUTTER_PLUGIN_LIST 6 | dynamic_color 7 | permission_handler_windows 8 | share_plus 9 | url_launcher_windows 10 | ) 11 | 12 | list(APPEND FLUTTER_FFI_PLUGIN_LIST 13 | ) 14 | 15 | set(PLUGIN_BUNDLED_LIBRARIES) 16 | 17 | foreach(plugin ${FLUTTER_PLUGIN_LIST}) 18 | add_subdirectory(flutter/ephemeral/.plugin_symlinks/${plugin}/windows plugins/${plugin}) 19 | target_link_libraries(${BINARY_NAME} PRIVATE ${plugin}_plugin) 20 | list(APPEND PLUGIN_BUNDLED_LIBRARIES $) 21 | list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${plugin}_bundled_libraries}) 22 | endforeach(plugin) 23 | 24 | foreach(ffi_plugin ${FLUTTER_FFI_PLUGIN_LIST}) 25 | add_subdirectory(flutter/ephemeral/.plugin_symlinks/${ffi_plugin}/windows plugins/${ffi_plugin}) 26 | list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${ffi_plugin}_bundled_libraries}) 27 | endforeach(ffi_plugin) 28 | -------------------------------------------------------------------------------- /windows/runner/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.14) 2 | project(runner LANGUAGES CXX) 3 | 4 | # Define the application target. To change its name, change BINARY_NAME in the 5 | # top-level CMakeLists.txt, not the value here, or `flutter run` will no longer 6 | # work. 7 | # 8 | # Any new source files that you add to the application should be added here. 9 | add_executable(${BINARY_NAME} WIN32 10 | "flutter_window.cpp" 11 | "main.cpp" 12 | "utils.cpp" 13 | "win32_window.cpp" 14 | "${FLUTTER_MANAGED_DIR}/generated_plugin_registrant.cc" 15 | "Runner.rc" 16 | "runner.exe.manifest" 17 | ) 18 | 19 | # Apply the standard set of build settings. This can be removed for applications 20 | # that need different build settings. 21 | apply_standard_settings(${BINARY_NAME}) 22 | 23 | # Add preprocessor definitions for the build version. 24 | target_compile_definitions(${BINARY_NAME} PRIVATE "FLUTTER_VERSION=\"${FLUTTER_VERSION}\"") 25 | target_compile_definitions(${BINARY_NAME} PRIVATE "FLUTTER_VERSION_MAJOR=${FLUTTER_VERSION_MAJOR}") 26 | target_compile_definitions(${BINARY_NAME} PRIVATE "FLUTTER_VERSION_MINOR=${FLUTTER_VERSION_MINOR}") 27 | target_compile_definitions(${BINARY_NAME} PRIVATE "FLUTTER_VERSION_PATCH=${FLUTTER_VERSION_PATCH}") 28 | target_compile_definitions(${BINARY_NAME} PRIVATE "FLUTTER_VERSION_BUILD=${FLUTTER_VERSION_BUILD}") 29 | 30 | # Disable Windows macros that collide with C++ standard library functions. 31 | target_compile_definitions(${BINARY_NAME} PRIVATE "NOMINMAX") 32 | 33 | # Add dependency libraries and include directories. Add any application-specific 34 | # dependencies here. 35 | target_link_libraries(${BINARY_NAME} PRIVATE flutter flutter_wrapper_app) 36 | target_include_directories(${BINARY_NAME} PRIVATE "${CMAKE_SOURCE_DIR}") 37 | 38 | # Run the Flutter tool portions of the build. This must not be removed. 39 | add_dependencies(${BINARY_NAME} flutter_assemble) 40 | -------------------------------------------------------------------------------- /windows/runner/flutter_window.cpp: -------------------------------------------------------------------------------- 1 | #include "flutter_window.h" 2 | 3 | #include 4 | 5 | #include "flutter/generated_plugin_registrant.h" 6 | 7 | FlutterWindow::FlutterWindow(const flutter::DartProject& project) 8 | : project_(project) {} 9 | 10 | FlutterWindow::~FlutterWindow() {} 11 | 12 | bool FlutterWindow::OnCreate() { 13 | if (!Win32Window::OnCreate()) { 14 | return false; 15 | } 16 | 17 | RECT frame = GetClientArea(); 18 | 19 | // The size here must match the window dimensions to avoid unnecessary surface 20 | // creation / destruction in the startup path. 21 | flutter_controller_ = std::make_unique( 22 | frame.right - frame.left, frame.bottom - frame.top, project_); 23 | // Ensure that basic setup of the controller was successful. 24 | if (!flutter_controller_->engine() || !flutter_controller_->view()) { 25 | return false; 26 | } 27 | RegisterPlugins(flutter_controller_->engine()); 28 | SetChildContent(flutter_controller_->view()->GetNativeWindow()); 29 | return true; 30 | } 31 | 32 | void FlutterWindow::OnDestroy() { 33 | if (flutter_controller_) { 34 | flutter_controller_ = nullptr; 35 | } 36 | 37 | Win32Window::OnDestroy(); 38 | } 39 | 40 | LRESULT 41 | FlutterWindow::MessageHandler(HWND hwnd, UINT const message, 42 | WPARAM const wparam, 43 | LPARAM const lparam) noexcept { 44 | // Give Flutter, including plugins, an opportunity to handle window messages. 45 | if (flutter_controller_) { 46 | std::optional result = 47 | flutter_controller_->HandleTopLevelWindowProc(hwnd, message, wparam, 48 | lparam); 49 | if (result) { 50 | return *result; 51 | } 52 | } 53 | 54 | switch (message) { 55 | case WM_FONTCHANGE: 56 | flutter_controller_->engine()->ReloadSystemFonts(); 57 | break; 58 | } 59 | 60 | return Win32Window::MessageHandler(hwnd, message, wparam, lparam); 61 | } 62 | -------------------------------------------------------------------------------- /windows/runner/flutter_window.h: -------------------------------------------------------------------------------- 1 | #ifndef RUNNER_FLUTTER_WINDOW_H_ 2 | #define RUNNER_FLUTTER_WINDOW_H_ 3 | 4 | #include 5 | #include 6 | 7 | #include 8 | 9 | #include "win32_window.h" 10 | 11 | // A window that does nothing but host a Flutter view. 12 | class FlutterWindow : public Win32Window { 13 | public: 14 | // Creates a new FlutterWindow hosting a Flutter view running |project|. 15 | explicit FlutterWindow(const flutter::DartProject& project); 16 | virtual ~FlutterWindow(); 17 | 18 | protected: 19 | // Win32Window: 20 | bool OnCreate() override; 21 | void OnDestroy() override; 22 | LRESULT MessageHandler(HWND window, UINT const message, WPARAM const wparam, 23 | LPARAM const lparam) noexcept override; 24 | 25 | private: 26 | // The project to run. 27 | flutter::DartProject project_; 28 | 29 | // The Flutter instance hosted by this window. 30 | std::unique_ptr flutter_controller_; 31 | }; 32 | 33 | #endif // RUNNER_FLUTTER_WINDOW_H_ 34 | -------------------------------------------------------------------------------- /windows/runner/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | #include "flutter_window.h" 6 | #include "utils.h" 7 | 8 | int APIENTRY wWinMain(_In_ HINSTANCE instance, _In_opt_ HINSTANCE prev, 9 | _In_ wchar_t *command_line, _In_ int show_command) { 10 | // Attach to console when present (e.g., 'flutter run') or create a 11 | // new console when running with a debugger. 12 | if (!::AttachConsole(ATTACH_PARENT_PROCESS) && ::IsDebuggerPresent()) { 13 | CreateAndAttachConsole(); 14 | } 15 | 16 | // Initialize COM, so that it is available for use in the library and/or 17 | // plugins. 18 | ::CoInitializeEx(nullptr, COINIT_APARTMENTTHREADED); 19 | 20 | flutter::DartProject project(L"data"); 21 | 22 | std::vector command_line_arguments = 23 | GetCommandLineArguments(); 24 | 25 | project.set_dart_entrypoint_arguments(std::move(command_line_arguments)); 26 | 27 | FlutterWindow window(project); 28 | Win32Window::Point origin(10, 10); 29 | Win32Window::Size size(1280, 720); 30 | if (!window.CreateAndShow(L"flutter_v2ex", origin, size)) { 31 | return EXIT_FAILURE; 32 | } 33 | window.SetQuitOnClose(true); 34 | 35 | ::MSG msg; 36 | while (::GetMessage(&msg, nullptr, 0, 0)) { 37 | ::TranslateMessage(&msg); 38 | ::DispatchMessage(&msg); 39 | } 40 | 41 | ::CoUninitialize(); 42 | return EXIT_SUCCESS; 43 | } 44 | -------------------------------------------------------------------------------- /windows/runner/resource.h: -------------------------------------------------------------------------------- 1 | //{{NO_DEPENDENCIES}} 2 | // Microsoft Visual C++ generated include file. 3 | // Used by Runner.rc 4 | // 5 | #define IDI_APP_ICON 101 6 | 7 | // Next default values for new objects 8 | // 9 | #ifdef APSTUDIO_INVOKED 10 | #ifndef APSTUDIO_READONLY_SYMBOLS 11 | #define _APS_NEXT_RESOURCE_VALUE 102 12 | #define _APS_NEXT_COMMAND_VALUE 40001 13 | #define _APS_NEXT_CONTROL_VALUE 1001 14 | #define _APS_NEXT_SYMED_VALUE 101 15 | #endif 16 | #endif 17 | -------------------------------------------------------------------------------- /windows/runner/resources/app_icon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/guozhigq/flutter_v2ex/170417910fbb496783d3681a83e08d2467ba4eba/windows/runner/resources/app_icon.ico -------------------------------------------------------------------------------- /windows/runner/runner.exe.manifest: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | PerMonitorV2 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /windows/runner/utils.cpp: -------------------------------------------------------------------------------- 1 | #include "utils.h" 2 | 3 | #include 4 | #include 5 | #include 6 | #include 7 | 8 | #include 9 | 10 | void CreateAndAttachConsole() { 11 | if (::AllocConsole()) { 12 | FILE *unused; 13 | if (freopen_s(&unused, "CONOUT$", "w", stdout)) { 14 | _dup2(_fileno(stdout), 1); 15 | } 16 | if (freopen_s(&unused, "CONOUT$", "w", stderr)) { 17 | _dup2(_fileno(stdout), 2); 18 | } 19 | std::ios::sync_with_stdio(); 20 | FlutterDesktopResyncOutputStreams(); 21 | } 22 | } 23 | 24 | std::vector GetCommandLineArguments() { 25 | // Convert the UTF-16 command line arguments to UTF-8 for the Engine to use. 26 | int argc; 27 | wchar_t** argv = ::CommandLineToArgvW(::GetCommandLineW(), &argc); 28 | if (argv == nullptr) { 29 | return std::vector(); 30 | } 31 | 32 | std::vector command_line_arguments; 33 | 34 | // Skip the first argument as it's the binary name. 35 | for (int i = 1; i < argc; i++) { 36 | command_line_arguments.push_back(Utf8FromUtf16(argv[i])); 37 | } 38 | 39 | ::LocalFree(argv); 40 | 41 | return command_line_arguments; 42 | } 43 | 44 | std::string Utf8FromUtf16(const wchar_t* utf16_string) { 45 | if (utf16_string == nullptr) { 46 | return std::string(); 47 | } 48 | int target_length = ::WideCharToMultiByte( 49 | CP_UTF8, WC_ERR_INVALID_CHARS, utf16_string, 50 | -1, nullptr, 0, nullptr, nullptr); 51 | std::string utf8_string; 52 | if (target_length == 0 || target_length > utf8_string.max_size()) { 53 | return utf8_string; 54 | } 55 | utf8_string.resize(target_length); 56 | int converted_length = ::WideCharToMultiByte( 57 | CP_UTF8, WC_ERR_INVALID_CHARS, utf16_string, 58 | -1, utf8_string.data(), 59 | target_length, nullptr, nullptr); 60 | if (converted_length == 0) { 61 | return std::string(); 62 | } 63 | return utf8_string; 64 | } 65 | -------------------------------------------------------------------------------- /windows/runner/utils.h: -------------------------------------------------------------------------------- 1 | #ifndef RUNNER_UTILS_H_ 2 | #define RUNNER_UTILS_H_ 3 | 4 | #include 5 | #include 6 | 7 | // Creates a console for the process, and redirects stdout and stderr to 8 | // it for both the runner and the Flutter library. 9 | void CreateAndAttachConsole(); 10 | 11 | // Takes a null-terminated wchar_t* encoded in UTF-16 and returns a std::string 12 | // encoded in UTF-8. Returns an empty std::string on failure. 13 | std::string Utf8FromUtf16(const wchar_t* utf16_string); 14 | 15 | // Gets the command line arguments passed in as a std::vector, 16 | // encoded in UTF-8. Returns an empty std::vector on failure. 17 | std::vector GetCommandLineArguments(); 18 | 19 | #endif // RUNNER_UTILS_H_ 20 | --------------------------------------------------------------------------------