├── .gitignore ├── .metadata ├── README.md ├── analysis_options.yaml ├── android ├── .gitignore ├── app │ ├── build.gradle │ ├── proguard-rules.pro │ └── src │ │ ├── debug │ │ └── AndroidManifest.xml │ │ ├── main │ │ ├── AndroidManifest.xml │ │ ├── ic_launcher-playstore.png │ │ ├── kotlin │ │ │ └── com │ │ │ │ └── muhua │ │ │ │ └── mu_hua_movie │ │ │ │ ├── InstallUtil.kt │ │ │ │ ├── MainActivity.kt │ │ │ │ └── MyApp.kt │ │ └── res │ │ │ ├── drawable-v21 │ │ │ └── launch_background.xml │ │ │ ├── drawable │ │ │ ├── ic_launcher_foreground.xml │ │ │ └── launch_background.xml │ │ │ ├── mipmap-anydpi-v26 │ │ │ ├── ic_launcher.xml │ │ │ └── ic_launcher_round.xml │ │ │ ├── mipmap-hdpi │ │ │ ├── ic_launcher.png │ │ │ └── ic_launcher_round.png │ │ │ ├── mipmap-mdpi │ │ │ ├── ic_launcher.png │ │ │ └── ic_launcher_round.png │ │ │ ├── mipmap-xhdpi │ │ │ ├── ic_launcher.png │ │ │ └── ic_launcher_round.png │ │ │ ├── mipmap-xxhdpi │ │ │ ├── ic_launcher.png │ │ │ └── ic_launcher_round.png │ │ │ ├── mipmap-xxxhdpi │ │ │ ├── ic_launcher.png │ │ │ └── ic_launcher_round.png │ │ │ ├── values-night │ │ │ └── styles.xml │ │ │ ├── values │ │ │ ├── ic_launcher_background.xml │ │ │ └── styles.xml │ │ │ └── xml │ │ │ └── filepaths.xml │ │ └── profile │ │ └── AndroidManifest.xml ├── build.gradle ├── gradle.properties ├── gradle │ └── wrapper │ │ └── gradle-wrapper.properties └── settings.gradle ├── ios ├── .gitignore ├── Flutter │ ├── AppFrameworkInfo.plist │ ├── Debug.xcconfig │ ├── Flutter.podspec │ ├── Generated.xcconfig │ ├── Release.xcconfig │ └── flutter_export_environment.sh ├── 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 │ └── xcuserdata │ │ └── jeck.xcuserdatad │ │ └── UserInterfaceState.xcuserstate └── Runner │ ├── AppDelegate.swift │ ├── Assets.xcassets │ ├── AppIcon.appiconset │ │ ├── Contents.json │ │ ├── Icon-App-1024x1024@1x.png │ │ ├── Icon-App-20x20@1x.png │ │ ├── Icon-App-20x20@2x.png │ │ ├── Icon-App-20x20@3x.png │ │ ├── Icon-App-29x29@1x.png │ │ ├── Icon-App-29x29@2x.png │ │ ├── Icon-App-29x29@3x.png │ │ ├── Icon-App-40x40@1x.png │ │ ├── Icon-App-40x40@2x.png │ │ ├── Icon-App-40x40@3x.png │ │ ├── Icon-App-60x60@2x.png │ │ ├── Icon-App-60x60@3x.png │ │ ├── Icon-App-76x76@1x.png │ │ ├── Icon-App-76x76@2x.png │ │ └── Icon-App-83.5x83.5@2x.png │ └── LaunchImage.imageset │ │ ├── Contents.json │ │ ├── LaunchImage.png │ │ ├── LaunchImage@2x.png │ │ ├── LaunchImage@3x.png │ │ └── README.md │ ├── Base.lproj │ ├── LaunchScreen.storyboard │ └── Main.storyboard │ ├── GeneratedPluginRegistrant.h │ ├── GeneratedPluginRegistrant.m │ ├── Info.plist │ └── Runner-Bridging-Header.h ├── lib ├── generated │ └── json │ │ ├── base │ │ ├── json_convert_content.dart │ │ └── json_field.dart │ │ ├── response_base_entity.g.dart │ │ ├── update_info_entity.g.dart │ │ ├── vd_class.g.dart │ │ └── vod_info_entity.g.dart ├── getx_bindings │ └── my_bindings.dart ├── main.dart ├── model │ ├── entity │ │ ├── response_base_entity.dart │ │ ├── update_info_entity.dart │ │ ├── vd_class.dart │ │ └── vod_info_entity.dart │ └── repository │ │ ├── net_base_repository.dart │ │ ├── net_repository.dart │ │ └── net_versoin_update_repository.dart ├── modules │ ├── index │ │ ├── home_con.dart │ │ └── home_screen.dart │ ├── player │ │ ├── my_better_player_data_source.dart │ │ ├── play_url_entity.dart │ │ ├── player_con.dart │ │ └── player_screen.dart │ ├── source │ │ ├── source_entity.dart │ │ ├── source_entity.g.dart │ │ ├── source_mange_con.dart │ │ └── source_mange_screen.dart │ └── splash │ │ ├── splash_con.dart │ │ └── splash_screen.dart ├── native_channel │ └── native_channel.dart ├── routes │ ├── app_page.dart │ └── app_routes.dart ├── service │ └── my_service.dart ├── utils │ └── EsoImageCacheManager.dart └── version_update.json ├── 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 ├── screenshot ├── Screenshot_1.jpg └── Screenshot_2.jpg ├── talkingdata_sdk_plugin ├── CHANGELOG.md ├── analysis_options.yaml ├── android │ ├── .gitignore │ ├── build.gradle │ ├── gradle │ │ └── wrapper │ │ │ ├── gradle-wrapper.jar │ │ │ └── gradle-wrapper.properties │ ├── gradlew │ ├── gradlew.bat │ ├── libs │ │ └── SaaS_TalkingDataSDK_Android_V5.0.13.jar │ ├── settings.gradle │ └── src │ │ └── main │ │ ├── AndroidManifest.xml │ │ └── java │ │ └── com │ │ └── talkingdata │ │ └── talkingdata_sdk_plugin │ │ └── TalkingDataSDKPlugin.java ├── ios │ ├── .gitignore │ ├── Assets │ │ └── libTalkingDataSDK.a │ ├── Classes │ │ ├── TalkingDataSDK.h │ │ ├── TalkingDataSDKPlugin.h │ │ └── TalkingDataSDKPlugin.m │ └── talkingdata_sdk_plugin.podspec ├── lib │ └── talkingdata_sdk_plugin.dart ├── 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 /.gitignore: -------------------------------------------------------------------------------- 1 | # Miscellaneous 2 | *.class 3 | *.log 4 | *.pyc 5 | *.swp 6 | .DS_Store 7 | .atom/ 8 | .buildlog/ 9 | .history 10 | .svn/ 11 | migrate_working_dir/ 12 | 13 | # IntelliJ related 14 | *.iml 15 | *.ipr 16 | *.iws 17 | .idea/ 18 | 19 | # The .vscode folder contains launch configuration and tasks you configure in 20 | # VS Code which you may wish to be included in version control, so this line 21 | # is commented out by default. 22 | #.vscode/ 23 | 24 | # Flutter/Dart/Pub related 25 | **/doc/api/ 26 | **/ios/Flutter/.last_build_id 27 | .dart_tool/ 28 | .flutter-plugins 29 | .flutter-plugins-dependencies 30 | .packages 31 | .pub-cache/ 32 | .pub/ 33 | /build/ 34 | 35 | # Symbolication related 36 | app.*.symbols 37 | 38 | # Obfuscation related 39 | app.*.map.json 40 | 41 | # Android Studio will place build artifacts here 42 | /android/app/debug 43 | /android/app/profile 44 | /android/app/release 45 | -------------------------------------------------------------------------------- /.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: 12cb4eb7a009f52b347b62ade7cb4854b926af72 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: 12cb4eb7a009f52b347b62ade7cb4854b926af72 17 | base_revision: 12cb4eb7a009f52b347b62ade7cb4854b926af72 18 | - platform: android 19 | create_revision: 12cb4eb7a009f52b347b62ade7cb4854b926af72 20 | base_revision: 12cb4eb7a009f52b347b62ade7cb4854b926af72 21 | - platform: ios 22 | create_revision: 12cb4eb7a009f52b347b62ade7cb4854b926af72 23 | base_revision: 12cb4eb7a009f52b347b62ade7cb4854b926af72 24 | - platform: linux 25 | create_revision: 12cb4eb7a009f52b347b62ade7cb4854b926af72 26 | base_revision: 12cb4eb7a009f52b347b62ade7cb4854b926af72 27 | - platform: macos 28 | create_revision: 12cb4eb7a009f52b347b62ade7cb4854b926af72 29 | base_revision: 12cb4eb7a009f52b347b62ade7cb4854b926af72 30 | - platform: web 31 | create_revision: 12cb4eb7a009f52b347b62ade7cb4854b926af72 32 | base_revision: 12cb4eb7a009f52b347b62ade7cb4854b926af72 33 | - platform: windows 34 | create_revision: 12cb4eb7a009f52b347b62ade7cb4854b926af72 35 | base_revision: 12cb4eb7a009f52b347b62ade7cb4854b926af72 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 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | 2 | 一个影视采集播放APP,仅做技术交流,请一定点个小星星 3 | 4 | 安卓手机可以下载 [APK安装包](https://github.com/alun1/mu_hua_movie/releases/download/v1.0.0/app-release.apk) 5 | 6 | 苹果手机自己编译咯 7 | 8 | ![截图1](https://github.com/alun1/mu_hua_movie/blob/master/screenshot/Screenshot_1.jpg) 9 | 10 | ![截图2](https://github.com/alun1/mu_hua_movie/blob/master/screenshot/Screenshot_2.jpg) 11 | 12 | 13 | -------------------------------------------------------------------------------- /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/build.gradle: -------------------------------------------------------------------------------- 1 | def localProperties = new Properties() 2 | def localPropertiesFile = rootProject.file('local.properties') 3 | if (localPropertiesFile.exists()) { 4 | localPropertiesFile.withReader('UTF-8') { reader -> 5 | localProperties.load(reader) 6 | } 7 | } 8 | 9 | def flutterRoot = localProperties.getProperty('flutter.sdk') 10 | if (flutterRoot == null) { 11 | throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.") 12 | } 13 | 14 | def flutterVersionCode = localProperties.getProperty('flutter.versionCode') 15 | if (flutterVersionCode == null) { 16 | flutterVersionCode = '1' 17 | } 18 | 19 | def flutterVersionName = localProperties.getProperty('flutter.versionName') 20 | if (flutterVersionName == null) { 21 | flutterVersionName = '1.0' 22 | } 23 | 24 | apply plugin: 'com.android.application' 25 | apply plugin: 'kotlin-android' 26 | apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle" 27 | 28 | android { 29 | signingConfigs { 30 | debug { 31 | storeFile file('../yuanbo.jks') 32 | storePassword '4434123456' 33 | keyAlias 'key0' 34 | keyPassword '4434123456' 35 | } 36 | release { 37 | storeFile file('../yuanbo.jks') 38 | storePassword '4434123456' 39 | keyAlias 'key0' 40 | keyPassword '4434123456' 41 | } 42 | } 43 | compileSdkVersion flutter.compileSdkVersion 44 | ndkVersion flutter.ndkVersion 45 | 46 | compileOptions { 47 | sourceCompatibility JavaVersion.VERSION_1_8 48 | targetCompatibility JavaVersion.VERSION_1_8 49 | } 50 | 51 | kotlinOptions { 52 | jvmTarget = '1.8' 53 | } 54 | 55 | sourceSets { 56 | main.java.srcDirs += 'src/main/kotlin' 57 | } 58 | 59 | defaultConfig { 60 | // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html). 61 | applicationId "com.muhua.mu_hua_movie" 62 | // You can update the following values to match your application needs. 63 | // For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-gradle-build-configuration. 64 | minSdkVersion flutter.minSdkVersion 65 | targetSdkVersion flutter.targetSdkVersion 66 | versionCode flutterVersionCode.toInteger() 67 | versionName flutterVersionName 68 | } 69 | 70 | buildTypes { 71 | release { 72 | // TODO: Add your own signing config for the release build. 73 | // Signing with the debug keys for now, so `flutter run --release` works. 74 | signingConfig signingConfigs.release 75 | // minifyEnabled true 76 | // shrinkResources true 77 | // proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' 78 | } 79 | 80 | debug { 81 | // TODO: Add your own signing config for the release build. 82 | // Signing with the debug keys for now, so `flutter run --release` works. 83 | signingConfig signingConfigs.debug 84 | // minifyEnabled true 85 | // shrinkResources true 86 | // proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' 87 | } 88 | } 89 | } 90 | 91 | flutter { 92 | source '../..' 93 | } 94 | 95 | dependencies { 96 | implementation fileTree(dir:'libs', include: ['*.jar']) 97 | implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" 98 | } 99 | -------------------------------------------------------------------------------- /android/app/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | -dontwarn com.tendcloud.tenddata.** 2 | -keep class com.tendcloud.** {*;} 3 | -keep public class com.tendcloud.** { public protected *;} 4 | -------------------------------------------------------------------------------- /android/app/src/debug/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /android/app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 20 | 28 | 32 | 35 | 36 | 37 | 38 | 39 | 40 | 42 | 45 | 50 | 53 | 54 | 55 | 56 | 57 | -------------------------------------------------------------------------------- /android/app/src/main/ic_launcher-playstore.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alun1/mu_hua_movie/a07e9b5078b6ed4399667aca08e15ef07240f2dc/android/app/src/main/ic_launcher-playstore.png -------------------------------------------------------------------------------- /android/app/src/main/kotlin/com/muhua/mu_hua_movie/InstallUtil.kt: -------------------------------------------------------------------------------- 1 | package com.muhua.mu_hua_movie 2 | 3 | import android.app.Activity 4 | import android.content.Intent 5 | import android.net.Uri 6 | import android.os.Build 7 | import android.text.TextUtils 8 | import android.util.Log 9 | import android.widget.Toast 10 | import androidx.core.content.FileProvider 11 | 12 | import java.io.File 13 | 14 | class InstallUtil { 15 | 16 | fun installApk(context: Activity, filePath: String, requestCode: Int) { 17 | Log.e("TAG", "install apk$filePath") 18 | if (TextUtils.isEmpty(filePath)) { 19 | Toast.makeText(context, "安装路径出错", Toast.LENGTH_SHORT).show() 20 | return 21 | } 22 | val file = File(filePath) 23 | var uri = Uri.fromFile(file) ?: throw RuntimeException("安装路径不正确") 24 | if (Build.VERSION.SDK_INT >= 24) { 25 | uri = FileProvider.getUriForFile(context, "${context.packageName}.FileProvider", file) 26 | } 27 | val intent = Intent() 28 | if (Build.VERSION.SDK_INT < 24) { 29 | intent.action = Intent.ACTION_INSTALL_PACKAGE 30 | intent.flags = Intent.FLAG_ACTIVITY_NEW_TASK 31 | intent.setDataAndType(uri, "application/vnd.android.package-archive") 32 | intent.putExtra(Intent.EXTRA_RETURN_RESULT, true) 33 | intent.putExtra(Intent.EXTRA_NOT_UNKNOWN_SOURCE, true) 34 | intent.putExtra(Intent.EXTRA_ALLOW_REPLACE, true) 35 | } else { 36 | intent.action = Intent.ACTION_INSTALL_PACKAGE 37 | intent.data = uri 38 | intent.addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION) 39 | intent.putExtra(Intent.EXTRA_RETURN_RESULT, true) 40 | intent.putExtra(Intent.EXTRA_NOT_UNKNOWN_SOURCE, true) 41 | intent.putExtra(Intent.EXTRA_ALLOW_REPLACE, true) 42 | } 43 | try { 44 | context.startActivityForResult(intent, requestCode) 45 | } catch (e: Exception) { 46 | e.message?.let { Log.e("TAG", it) } 47 | } 48 | } 49 | } -------------------------------------------------------------------------------- /android/app/src/main/kotlin/com/muhua/mu_hua_movie/MainActivity.kt: -------------------------------------------------------------------------------- 1 | package com.muhua.mu_hua_movie 2 | 3 | import io.flutter.embedding.android.FlutterActivity 4 | import io.flutter.embedding.engine.FlutterEngine 5 | import io.flutter.plugin.common.MethodChannel 6 | 7 | class MainActivity : FlutterActivity() { 8 | override fun configureFlutterEngine(flutterEngine: FlutterEngine) { 9 | super.configureFlutterEngine(flutterEngine) 10 | MethodChannel( 11 | flutterEngine.dartExecutor.binaryMessenger, 12 | "native_channel" 13 | ).setMethodCallHandler { call, result -> 14 | when (call.method) { 15 | "installApk" -> { 16 | InstallUtil().installApk(this, call.arguments as String, 10001) 17 | } 18 | } 19 | 20 | } 21 | 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /android/app/src/main/kotlin/com/muhua/mu_hua_movie/MyApp.kt: -------------------------------------------------------------------------------- 1 | package com.muhua.mu_hua_movie 2 | 3 | import com.talkingdata.talkingdata_sdk_plugin.TalkingDataSDKPlugin 4 | import io.flutter.app.FlutterApplication 5 | 6 | class MyApp : FlutterApplication() { 7 | override fun onCreate() { 8 | super.onCreate() 9 | TalkingDataSDKPlugin.setContext(this) 10 | } 11 | } -------------------------------------------------------------------------------- /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/ic_launcher_foreground.xml: -------------------------------------------------------------------------------- 1 | 8 | 12 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /android/app/src/main/res/drawable/launch_background.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 11 | 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/alun1/mu_hua_movie/a07e9b5078b6ed4399667aca08e15ef07240f2dc/android/app/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-hdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alun1/mu_hua_movie/a07e9b5078b6ed4399667aca08e15ef07240f2dc/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/alun1/mu_hua_movie/a07e9b5078b6ed4399667aca08e15ef07240f2dc/android/app/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-mdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alun1/mu_hua_movie/a07e9b5078b6ed4399667aca08e15ef07240f2dc/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/alun1/mu_hua_movie/a07e9b5078b6ed4399667aca08e15ef07240f2dc/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alun1/mu_hua_movie/a07e9b5078b6ed4399667aca08e15ef07240f2dc/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/alun1/mu_hua_movie/a07e9b5078b6ed4399667aca08e15ef07240f2dc/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alun1/mu_hua_movie/a07e9b5078b6ed4399667aca08e15ef07240f2dc/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/alun1/mu_hua_movie/a07e9b5078b6ed4399667aca08e15ef07240f2dc/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alun1/mu_hua_movie/a07e9b5078b6ed4399667aca08e15ef07240f2dc/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /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 | #009688 4 | -------------------------------------------------------------------------------- /android/app/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 9 | 15 | 18 | 19 | -------------------------------------------------------------------------------- /android/app/src/main/res/xml/filepaths.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /android/app/src/profile/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /android/build.gradle: -------------------------------------------------------------------------------- 1 | buildscript { 2 | ext.kotlin_version = '1.8.0' 3 | repositories { 4 | // google() 5 | // mavenCentral() 6 | maven { 7 | url 'https://maven.aliyun.com/repository/public/' 8 | } 9 | maven { 10 | url 'https://maven.aliyun.com/repository/central/' 11 | } 12 | maven { 13 | url 'https://maven.aliyun.com/repository/google/' 14 | } 15 | maven { 16 | url 'https://maven.aliyun.com/repository/gradle-plugin/' 17 | } 18 | } 19 | 20 | dependencies { 21 | classpath 'com.android.tools.build:gradle:7.4.2' 22 | classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" 23 | } 24 | } 25 | 26 | allprojects { 27 | repositories { 28 | // google() 29 | // mavenCentral() 30 | maven { 31 | url 'https://maven.aliyun.com/repository/public/' 32 | } 33 | maven { 34 | url 'https://maven.aliyun.com/repository/central/' 35 | } 36 | maven { 37 | url 'https://maven.aliyun.com/repository/google/' 38 | } 39 | maven { 40 | url 'https://maven.aliyun.com/repository/gradle-plugin/' 41 | } 42 | } 43 | } 44 | 45 | rootProject.buildDir = '../build' 46 | subprojects { 47 | project.buildDir = "${rootProject.buildDir}/${project.name}" 48 | } 49 | subprojects { 50 | project.evaluationDependsOn(':app') 51 | } 52 | 53 | task clean(type: Delete) { 54 | delete rootProject.buildDir 55 | } 56 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | 11.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/Flutter.podspec: -------------------------------------------------------------------------------- 1 | # 2 | # NOTE: This podspec is NOT to be published. It is only used as a local source! 3 | # This is a generated file; do not edit or check into version control. 4 | # 5 | 6 | Pod::Spec.new do |s| 7 | s.name = 'Flutter' 8 | s.version = '1.0.0' 9 | s.summary = 'A UI toolkit for beautiful and fast apps.' 10 | s.homepage = 'https://flutter.dev' 11 | s.license = { :type => 'BSD' } 12 | s.author = { 'Flutter Dev Team' => 'flutter-dev@googlegroups.com' } 13 | s.source = { :git => 'https://github.com/flutter/engine', :tag => s.version.to_s } 14 | s.ios.deployment_target = '11.0' 15 | # Framework linking is handled by Flutter tooling, not CocoaPods. 16 | # Add a placeholder to satisfy `s.dependency 'Flutter'` plugin podspecs. 17 | s.vendored_frameworks = 'path/to/nothing' 18 | end 19 | -------------------------------------------------------------------------------- /ios/Flutter/Generated.xcconfig: -------------------------------------------------------------------------------- 1 | // This is a generated file; do not edit or check into version control. 2 | FLUTTER_ROOT=/Users/jeck/Library/Android/flutter 3 | FLUTTER_APPLICATION_PATH=/Users/jeck/AndroidStudioProjects/mu_hua_movie 4 | COCOAPODS_PARALLEL_CODE_SIGN=true 5 | FLUTTER_TARGET=/Users/jeck/AndroidStudioProjects/mu_hua_movie/lib/main.dart 6 | FLUTTER_BUILD_DIR=build 7 | FLUTTER_BUILD_NAME=1.0.0 8 | FLUTTER_BUILD_NUMBER=1 9 | EXCLUDED_ARCHS[sdk=iphonesimulator*]=i386 arm64 10 | EXCLUDED_ARCHS[sdk=iphoneos*]=armv7 11 | DART_DEFINES=Zmx1dHRlci5pbnNwZWN0b3Iuc3RydWN0dXJlZEVycm9ycz10cnVl,RkxVVFRFUl9XRUJfQVVUT19ERVRFQ1Q9dHJ1ZQ== 12 | DART_OBFUSCATION=false 13 | TRACK_WIDGET_CREATION=true 14 | TREE_SHAKE_ICONS=false 15 | PACKAGE_CONFIG=/Users/jeck/AndroidStudioProjects/mu_hua_movie/.dart_tool/package_config.json 16 | -------------------------------------------------------------------------------- /ios/Flutter/Release.xcconfig: -------------------------------------------------------------------------------- 1 | #include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig" 2 | #include "Generated.xcconfig" 3 | -------------------------------------------------------------------------------- /ios/Flutter/flutter_export_environment.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # This is a generated file; do not edit or check into version control. 3 | export "FLUTTER_ROOT=/Users/jeck/Library/Android/flutter" 4 | export "FLUTTER_APPLICATION_PATH=/Users/jeck/AndroidStudioProjects/mu_hua_movie" 5 | export "COCOAPODS_PARALLEL_CODE_SIGN=true" 6 | export "FLUTTER_TARGET=/Users/jeck/AndroidStudioProjects/mu_hua_movie/lib/main.dart" 7 | export "FLUTTER_BUILD_DIR=build" 8 | export "FLUTTER_BUILD_NAME=1.0.0" 9 | export "FLUTTER_BUILD_NUMBER=1" 10 | export "DART_DEFINES=Zmx1dHRlci5pbnNwZWN0b3Iuc3RydWN0dXJlZEVycm9ycz10cnVl,RkxVVFRFUl9XRUJfQVVUT19ERVRFQ1Q9dHJ1ZQ==" 11 | export "DART_OBFUSCATION=false" 12 | export "TRACK_WIDGET_CREATION=true" 13 | export "TREE_SHAKE_ICONS=false" 14 | export "PACKAGE_CONFIG=/Users/jeck/AndroidStudioProjects/mu_hua_movie/.dart_tool/package_config.json" 15 | -------------------------------------------------------------------------------- /ios/Podfile: -------------------------------------------------------------------------------- 1 | # Uncomment this line to define a global platform for your project 2 | # platform :ios, '11.0' 3 | 4 | # CocoaPods analytics sends network stats synchronously affecting flutter build latency. 5 | ENV['COCOAPODS_DISABLE_STATS'] = 'true' 6 | 7 | project 'Runner', { 8 | 'Debug' => :debug, 9 | 'Profile' => :release, 10 | 'Release' => :release, 11 | } 12 | 13 | def flutter_root 14 | generated_xcode_build_settings_path = File.expand_path(File.join('..', 'Flutter', 'Generated.xcconfig'), __FILE__) 15 | unless File.exist?(generated_xcode_build_settings_path) 16 | raise "#{generated_xcode_build_settings_path} must exist. If you're running pod install manually, make sure flutter pub get is executed first" 17 | end 18 | 19 | File.foreach(generated_xcode_build_settings_path) do |line| 20 | matches = line.match(/FLUTTER_ROOT\=(.*)/) 21 | return matches[1].strip if matches 22 | end 23 | raise "FLUTTER_ROOT not found in #{generated_xcode_build_settings_path}. Try deleting Generated.xcconfig, then run flutter pub get" 24 | end 25 | 26 | require File.expand_path(File.join('packages', 'flutter_tools', 'bin', 'podhelper'), flutter_root) 27 | 28 | flutter_ios_podfile_setup 29 | 30 | target 'Runner' do 31 | use_frameworks! 32 | use_modular_headers! 33 | 34 | flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__)) 35 | end 36 | 37 | # post_install do |installer| 38 | # installer.pods_project.targets.each do |target| 39 | # flutter_additional_ios_build_settings(target) 40 | # end 41 | # end 42 | 43 | 44 | post_install do |installer| 45 | installer.pods_project.targets.each do |target| 46 | flutter_additional_ios_build_settings(target) 47 | target.build_configurations.each do |config| 48 | config.build_settings["EXCLUDED_ARCHS[sdk=iphonesimulator*]"] = "arm64" 49 | end 50 | end 51 | end -------------------------------------------------------------------------------- /ios/Podfile.lock: -------------------------------------------------------------------------------- 1 | PODS: 2 | - Cache (6.0.0) 3 | - extended_betterplayer (0.0.1): 4 | - Cache (~> 6.0.0) 5 | - Flutter 6 | - GCDWebServer 7 | - HLSCachingReverseProxyServer 8 | - PINCache 9 | - Flutter (1.0.0) 10 | - FMDB (2.7.5): 11 | - FMDB/standard (= 2.7.5) 12 | - FMDB/standard (2.7.5) 13 | - GCDWebServer (3.5.4): 14 | - GCDWebServer/Core (= 3.5.4) 15 | - GCDWebServer/Core (3.5.4) 16 | - HLSCachingReverseProxyServer (0.1.0): 17 | - GCDWebServer (~> 3.5) 18 | - PINCache (>= 3.0.1-beta.3) 19 | - package_info_plus (0.4.5): 20 | - Flutter 21 | - path_provider_foundation (0.0.1): 22 | - Flutter 23 | - FlutterMacOS 24 | - permission_handler_apple (9.0.4): 25 | - Flutter 26 | - PINCache (3.0.3): 27 | - PINCache/Arc-exception-safe (= 3.0.3) 28 | - PINCache/Core (= 3.0.3) 29 | - PINCache/Arc-exception-safe (3.0.3): 30 | - PINCache/Core 31 | - PINCache/Core (3.0.3): 32 | - PINOperation (~> 1.2.1) 33 | - PINOperation (1.2.2) 34 | - share_plus (0.0.1): 35 | - Flutter 36 | - sqflite (0.0.2): 37 | - Flutter 38 | - FMDB (>= 2.7.5) 39 | - talkingdata_sdk_plugin (0.0.1): 40 | - Flutter 41 | - video_player_avfoundation (0.0.1): 42 | - Flutter 43 | - wakelock (0.0.1): 44 | - Flutter 45 | 46 | DEPENDENCIES: 47 | - extended_betterplayer (from `.symlinks/plugins/extended_betterplayer/ios`) 48 | - Flutter (from `Flutter`) 49 | - package_info_plus (from `.symlinks/plugins/package_info_plus/ios`) 50 | - path_provider_foundation (from `.symlinks/plugins/path_provider_foundation/ios`) 51 | - permission_handler_apple (from `.symlinks/plugins/permission_handler_apple/ios`) 52 | - share_plus (from `.symlinks/plugins/share_plus/ios`) 53 | - sqflite (from `.symlinks/plugins/sqflite/ios`) 54 | - talkingdata_sdk_plugin (from `.symlinks/plugins/talkingdata_sdk_plugin/ios`) 55 | - video_player_avfoundation (from `.symlinks/plugins/video_player_avfoundation/ios`) 56 | - wakelock (from `.symlinks/plugins/wakelock/ios`) 57 | 58 | SPEC REPOS: 59 | trunk: 60 | - Cache 61 | - FMDB 62 | - GCDWebServer 63 | - HLSCachingReverseProxyServer 64 | - PINCache 65 | - PINOperation 66 | 67 | EXTERNAL SOURCES: 68 | extended_betterplayer: 69 | :path: ".symlinks/plugins/extended_betterplayer/ios" 70 | Flutter: 71 | :path: Flutter 72 | package_info_plus: 73 | :path: ".symlinks/plugins/package_info_plus/ios" 74 | path_provider_foundation: 75 | :path: ".symlinks/plugins/path_provider_foundation/ios" 76 | permission_handler_apple: 77 | :path: ".symlinks/plugins/permission_handler_apple/ios" 78 | share_plus: 79 | :path: ".symlinks/plugins/share_plus/ios" 80 | sqflite: 81 | :path: ".symlinks/plugins/sqflite/ios" 82 | talkingdata_sdk_plugin: 83 | :path: ".symlinks/plugins/talkingdata_sdk_plugin/ios" 84 | video_player_avfoundation: 85 | :path: ".symlinks/plugins/video_player_avfoundation/ios" 86 | wakelock: 87 | :path: ".symlinks/plugins/wakelock/ios" 88 | 89 | SPEC CHECKSUMS: 90 | Cache: 4ca7e00363fca5455f26534e5607634c820ffc2d 91 | extended_betterplayer: a2f6b5a5dc79b60cd0957eada16564884a5bcd96 92 | Flutter: f04841e97a9d0b0a8025694d0796dd46242b2854 93 | FMDB: 2ce00b547f966261cd18927a3ddb07cb6f3db82a 94 | GCDWebServer: 2c156a56c8226e2d5c0c3f208a3621ccffbe3ce4 95 | HLSCachingReverseProxyServer: 59935e1e0244ad7f3375d75b5ef46e8eb26ab181 96 | package_info_plus: 6c92f08e1f853dc01228d6f553146438dafcd14e 97 | path_provider_foundation: c68054786f1b4f3343858c1e1d0caaded73f0be9 98 | permission_handler_apple: 44366e37eaf29454a1e7b1b7d736c2cceaeb17ce 99 | PINCache: 7a8fc1a691173d21dbddbf86cd515de6efa55086 100 | PINOperation: daa34d4aa1d8449089be7d405b9d974abc4724c6 101 | share_plus: 056a1e8ac890df3e33cb503afffaf1e9b4fbae68 102 | sqflite: 6d358c025f5b867b29ed92fc697fd34924e11904 103 | talkingdata_sdk_plugin: afe59648f75aa36bb694de23f991bc5971677703 104 | video_player_avfoundation: 81e49bb3d9fb63dccf9fa0f6d877dc3ddbeac126 105 | wakelock: d0fc7c864128eac40eba1617cb5264d9c940b46f 106 | 107 | PODFILE CHECKSUM: 1d4e16d065ea3ba810ac6812a4002b6c91946d64 108 | 109 | COCOAPODS: 1.11.3 110 | -------------------------------------------------------------------------------- /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.xcworkspace/xcuserdata/jeck.xcuserdatad/UserInterfaceState.xcuserstate: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alun1/mu_hua_movie/a07e9b5078b6ed4399667aca08e15ef07240f2dc/ios/Runner.xcworkspace/xcuserdata/jeck.xcuserdatad/UserInterfaceState.xcuserstate -------------------------------------------------------------------------------- /ios/Runner/AppDelegate.swift: -------------------------------------------------------------------------------- 1 | import UIKit 2 | import Flutter 3 | 4 | @UIApplicationMain 5 | @objc class AppDelegate: FlutterAppDelegate { 6 | override func application( 7 | _ application: UIApplication, 8 | didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]? 9 | ) -> Bool { 10 | GeneratedPluginRegistrant.register(with: self) 11 | 12 | TalkingDataSDKPlugin.`init`("94AEA0CDD9F647C0BDE6F022B8D2583C", channelId: "ios", custom: "") 13 | return super.application(application, didFinishLaunchingWithOptions: launchOptions) 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /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/alun1/mu_hua_movie/a07e9b5078b6ed4399667aca08e15ef07240f2dc/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/alun1/mu_hua_movie/a07e9b5078b6ed4399667aca08e15ef07240f2dc/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/alun1/mu_hua_movie/a07e9b5078b6ed4399667aca08e15ef07240f2dc/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/alun1/mu_hua_movie/a07e9b5078b6ed4399667aca08e15ef07240f2dc/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/alun1/mu_hua_movie/a07e9b5078b6ed4399667aca08e15ef07240f2dc/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/alun1/mu_hua_movie/a07e9b5078b6ed4399667aca08e15ef07240f2dc/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/alun1/mu_hua_movie/a07e9b5078b6ed4399667aca08e15ef07240f2dc/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/alun1/mu_hua_movie/a07e9b5078b6ed4399667aca08e15ef07240f2dc/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/alun1/mu_hua_movie/a07e9b5078b6ed4399667aca08e15ef07240f2dc/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/alun1/mu_hua_movie/a07e9b5078b6ed4399667aca08e15ef07240f2dc/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/alun1/mu_hua_movie/a07e9b5078b6ed4399667aca08e15ef07240f2dc/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/alun1/mu_hua_movie/a07e9b5078b6ed4399667aca08e15ef07240f2dc/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/alun1/mu_hua_movie/a07e9b5078b6ed4399667aca08e15ef07240f2dc/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/alun1/mu_hua_movie/a07e9b5078b6ed4399667aca08e15ef07240f2dc/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/alun1/mu_hua_movie/a07e9b5078b6ed4399667aca08e15ef07240f2dc/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "LaunchImage.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "filename" : "LaunchImage@2x.png", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "universal", 15 | "filename" : "LaunchImage@3x.png", 16 | "scale" : "3x" 17 | } 18 | ], 19 | "info" : { 20 | "version" : 1, 21 | "author" : "xcode" 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alun1/mu_hua_movie/a07e9b5078b6ed4399667aca08e15ef07240f2dc/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alun1/mu_hua_movie/a07e9b5078b6ed4399667aca08e15ef07240f2dc/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alun1/mu_hua_movie/a07e9b5078b6ed4399667aca08e15ef07240f2dc/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md: -------------------------------------------------------------------------------- 1 | # Launch Screen Assets 2 | 3 | You can customize the launch screen with your own desired assets by replacing the image files in this directory. 4 | 5 | You can also do it by opening your Flutter project's Xcode project with `open ios/Runner.xcworkspace`, selecting `Runner/Assets.xcassets` in the Project Navigator and dropping in the desired images. -------------------------------------------------------------------------------- /ios/Runner/Base.lproj/LaunchScreen.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | -------------------------------------------------------------------------------- /ios/Runner/Base.lproj/Main.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /ios/Runner/GeneratedPluginRegistrant.h: -------------------------------------------------------------------------------- 1 | // 2 | // Generated file. Do not edit. 3 | // 4 | 5 | // clang-format off 6 | 7 | #ifndef GeneratedPluginRegistrant_h 8 | #define GeneratedPluginRegistrant_h 9 | 10 | #import 11 | 12 | NS_ASSUME_NONNULL_BEGIN 13 | 14 | @interface GeneratedPluginRegistrant : NSObject 15 | + (void)registerWithRegistry:(NSObject*)registry; 16 | @end 17 | 18 | NS_ASSUME_NONNULL_END 19 | #endif /* GeneratedPluginRegistrant_h */ 20 | -------------------------------------------------------------------------------- /ios/Runner/GeneratedPluginRegistrant.m: -------------------------------------------------------------------------------- 1 | // 2 | // Generated file. Do not edit. 3 | // 4 | 5 | // clang-format off 6 | 7 | #import "GeneratedPluginRegistrant.h" 8 | 9 | #if __has_include() 10 | #import 11 | #else 12 | @import extended_betterplayer; 13 | #endif 14 | 15 | #if __has_include() 16 | #import 17 | #else 18 | @import package_info_plus; 19 | #endif 20 | 21 | #if __has_include() 22 | #import 23 | #else 24 | @import path_provider_foundation; 25 | #endif 26 | 27 | #if __has_include() 28 | #import 29 | #else 30 | @import permission_handler_apple; 31 | #endif 32 | 33 | #if __has_include() 34 | #import 35 | #else 36 | @import share_plus; 37 | #endif 38 | 39 | #if __has_include() 40 | #import 41 | #else 42 | @import sqflite; 43 | #endif 44 | 45 | #if __has_include() 46 | #import 47 | #else 48 | @import talkingdata_sdk_plugin; 49 | #endif 50 | 51 | #if __has_include() 52 | #import 53 | #else 54 | @import video_player_avfoundation; 55 | #endif 56 | 57 | #if __has_include() 58 | #import 59 | #else 60 | @import wakelock; 61 | #endif 62 | 63 | @implementation GeneratedPluginRegistrant 64 | 65 | + (void)registerWithRegistry:(NSObject*)registry { 66 | [BetterPlayerPlugin registerWithRegistrar:[registry registrarForPlugin:@"BetterPlayerPlugin"]]; 67 | [FLTPackageInfoPlusPlugin registerWithRegistrar:[registry registrarForPlugin:@"FLTPackageInfoPlusPlugin"]]; 68 | [PathProviderPlugin registerWithRegistrar:[registry registrarForPlugin:@"PathProviderPlugin"]]; 69 | [PermissionHandlerPlugin registerWithRegistrar:[registry registrarForPlugin:@"PermissionHandlerPlugin"]]; 70 | [FLTSharePlusPlugin registerWithRegistrar:[registry registrarForPlugin:@"FLTSharePlusPlugin"]]; 71 | [SqflitePlugin registerWithRegistrar:[registry registrarForPlugin:@"SqflitePlugin"]]; 72 | [TalkingDataSDKPlugin registerWithRegistrar:[registry registrarForPlugin:@"TalkingDataSDKPlugin"]]; 73 | [FLTVideoPlayerPlugin registerWithRegistrar:[registry registrarForPlugin:@"FLTVideoPlayerPlugin"]]; 74 | [WakelockPlugin registerWithRegistrar:[registry registrarForPlugin:@"WakelockPlugin"]]; 75 | } 76 | 77 | @end 78 | -------------------------------------------------------------------------------- /ios/Runner/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | $(DEVELOPMENT_LANGUAGE) 7 | CFBundleDisplayName 8 | Mu Hua Movie 9 | CFBundleExecutable 10 | $(EXECUTABLE_NAME) 11 | CFBundleIdentifier 12 | $(PRODUCT_BUNDLE_IDENTIFIER) 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | mu_hua_movie 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 | UISupportedInterfaceOrientations~ipad 38 | 39 | UIInterfaceOrientationPortrait 40 | UIInterfaceOrientationPortraitUpsideDown 41 | UIInterfaceOrientationLandscapeLeft 42 | UIInterfaceOrientationLandscapeRight 43 | 44 | UIViewControllerBasedStatusBarAppearance 45 | 46 | CADisableMinimumFrameDurationOnPhone 47 | 48 | UIApplicationSupportsIndirectInputEvents 49 | 50 | 51 | 52 | -------------------------------------------------------------------------------- /ios/Runner/Runner-Bridging-Header.h: -------------------------------------------------------------------------------- 1 | #import "GeneratedPluginRegistrant.h" 2 | #import "TalkingDataSDKPlugin.h" 3 | -------------------------------------------------------------------------------- /lib/generated/json/base/json_convert_content.dart: -------------------------------------------------------------------------------- 1 | // ignore_for_file: non_constant_identifier_names 2 | // ignore_for_file: camel_case_types 3 | // ignore_for_file: prefer_single_quotes 4 | 5 | // This file is automatically generated. DO NOT EDIT, all your changes would be lost. 6 | import 'package:flutter/material.dart' show debugPrint; 7 | import 'package:mu_hua_movie/model/entity/response_base_entity.dart'; 8 | import 'package:mu_hua_movie/model/entity/update_info_entity.dart'; 9 | import 'package:mu_hua_movie/model/entity/vd_class.dart'; 10 | import 'package:mu_hua_movie/model/entity/vod_info_entity.dart'; 11 | 12 | JsonConvert jsonConvert = JsonConvert(); 13 | typedef JsonConvertFunction = T Function(Map json); 14 | typedef EnumConvertFunction = T Function(String value); 15 | 16 | class JsonConvert { 17 | static final Map convertFuncMap = { 18 | (ResponseBaseEntity).toString(): ResponseBaseEntity.fromJson, 19 | (UpdateInfoEntity).toString(): UpdateInfoEntity.fromJson, 20 | (VdClass).toString(): VdClass.fromJson, 21 | (VodInfoEntity).toString(): VodInfoEntity.fromJson, 22 | }; 23 | 24 | T? convert(dynamic value, {EnumConvertFunction? enumConvert}) { 25 | if (value == null) { 26 | return null; 27 | } 28 | if (value is T) { 29 | return value; 30 | } 31 | try { 32 | return _asT(value, enumConvert: enumConvert); 33 | } catch (e, stackTrace) { 34 | debugPrint('asT<$T> $e $stackTrace'); 35 | return null; 36 | } 37 | } 38 | 39 | List? convertList(List? value, {EnumConvertFunction? enumConvert}) { 40 | if (value == null) { 41 | return null; 42 | } 43 | try { 44 | return value.map((dynamic e) => _asT(e,enumConvert: enumConvert)).toList(); 45 | } catch (e, stackTrace) { 46 | debugPrint('asT<$T> $e $stackTrace'); 47 | return []; 48 | } 49 | } 50 | 51 | List? convertListNotNull(dynamic value, {EnumConvertFunction? enumConvert}) { 52 | if (value == null) { 53 | return null; 54 | } 55 | try { 56 | return (value as List).map((dynamic e) => _asT(e,enumConvert: enumConvert)!).toList(); 57 | } catch (e, stackTrace) { 58 | debugPrint('asT<$T> $e $stackTrace'); 59 | return []; 60 | } 61 | } 62 | 63 | T? _asT(dynamic value, 64 | {EnumConvertFunction? enumConvert}) { 65 | final String type = T.toString(); 66 | final String valueS = value.toString(); 67 | if (enumConvert != null) { 68 | return enumConvert(valueS) as T; 69 | } else if (type == "String") { 70 | return valueS as T; 71 | } else if (type == "int") { 72 | final int? intValue = int.tryParse(valueS); 73 | if (intValue == null) { 74 | return double.tryParse(valueS)?.toInt() as T?; 75 | } else { 76 | return intValue as T; 77 | } 78 | } else if (type == "double") { 79 | return double.parse(valueS) as T; 80 | } else if (type == "DateTime") { 81 | return DateTime.parse(valueS) as T; 82 | } else if (type == "bool") { 83 | if (valueS == '0' || valueS == '1') { 84 | return (valueS == '1') as T; 85 | } 86 | return (valueS == 'true') as T; 87 | } else if (type == "Map" || type.startsWith("Map<")) { 88 | return value as T; 89 | } else { 90 | if (convertFuncMap.containsKey(type)) { 91 | return convertFuncMap[type]!(Map.from(value)) as T; 92 | } else { 93 | throw UnimplementedError('$type unimplemented'); 94 | } 95 | } 96 | } 97 | 98 | //list is returned by type 99 | static M? _getListChildType(List> data) { 100 | if([] is M){ 101 | return data.map((Map e) => ResponseBaseEntity.fromJson(e)).toList() as M; 102 | } 103 | if([] is M){ 104 | return data.map((Map e) => UpdateInfoEntity.fromJson(e)).toList() as M; 105 | } 106 | if([] is M){ 107 | return data.map((Map e) => VdClass.fromJson(e)).toList() as M; 108 | } 109 | if([] is M){ 110 | return data.map((Map e) => VodInfoEntity.fromJson(e)).toList() as M; 111 | } 112 | 113 | debugPrint("${M.toString()} not found"); 114 | 115 | return null; 116 | } 117 | 118 | static M? fromJsonAsT(dynamic json) { 119 | if (json is List) { 120 | return _getListChildType(json.map((e) => e as Map).toList()); 121 | } else { 122 | return jsonConvert.convert(json); 123 | } 124 | } 125 | } -------------------------------------------------------------------------------- /lib/generated/json/base/json_field.dart: -------------------------------------------------------------------------------- 1 | // ignore_for_file: non_constant_identifier_names 2 | // ignore_for_file: camel_case_types 3 | // ignore_for_file: prefer_single_quotes 4 | 5 | // This file is automatically generated. DO NOT EDIT, all your changes would be lost. 6 | 7 | class JsonSerializable{ 8 | const JsonSerializable(); 9 | } 10 | 11 | class JSONField { 12 | //Specify the parse field name 13 | final String? name; 14 | 15 | //Whether to participate in toJson 16 | final bool? serialize; 17 | 18 | //Whether to participate in fromMap 19 | final bool? deserialize; 20 | 21 | //Enumeration or not 22 | final bool? isEnum; 23 | 24 | const JSONField({this.name, this.serialize, this.deserialize, this.isEnum}); 25 | } 26 | -------------------------------------------------------------------------------- /lib/generated/json/response_base_entity.g.dart: -------------------------------------------------------------------------------- 1 | import 'package:mu_hua_movie/generated/json/base/json_convert_content.dart'; 2 | import 'package:mu_hua_movie/model/entity/response_base_entity.dart'; 3 | import 'package:mu_hua_movie/model/entity/vd_class.dart'; 4 | 5 | import 'package:mu_hua_movie/model/entity/vod_info_entity.dart'; 6 | 7 | 8 | ResponseBaseEntity $ResponseBaseEntityFromJson(Map json) { 9 | final ResponseBaseEntity responseBaseEntity = ResponseBaseEntity(); 10 | final int? code = jsonConvert.convert(json['code']); 11 | if (code != null) { 12 | responseBaseEntity.code = code; 13 | } 14 | final String? msg = jsonConvert.convert(json['msg']); 15 | if (msg != null) { 16 | responseBaseEntity.msg = msg; 17 | } 18 | final int? page = jsonConvert.convert(json['page']); 19 | if (page != null) { 20 | responseBaseEntity.page = page; 21 | } 22 | final int? pagecount = jsonConvert.convert(json['pagecount']); 23 | if (pagecount != null) { 24 | responseBaseEntity.pagecount = pagecount; 25 | } 26 | final String? limit = jsonConvert.convert(json['limit']); 27 | if (limit != null) { 28 | responseBaseEntity.limit = limit; 29 | } 30 | final int? total = jsonConvert.convert(json['total']); 31 | if (total != null) { 32 | responseBaseEntity.total = total; 33 | } 34 | final List? list = jsonConvert.convertListNotNull(json['list']); 35 | if (list != null) { 36 | responseBaseEntity.list = list; 37 | } 38 | final List? xClass = jsonConvert.convertListNotNull(json['class']); 39 | if (xClass != null) { 40 | responseBaseEntity.xClass = xClass; 41 | } 42 | return responseBaseEntity; 43 | } 44 | 45 | Map $ResponseBaseEntityToJson(ResponseBaseEntity entity) { 46 | final Map data = {}; 47 | data['code'] = entity.code; 48 | data['msg'] = entity.msg; 49 | data['page'] = entity.page; 50 | data['pagecount'] = entity.pagecount; 51 | data['limit'] = entity.limit; 52 | data['total'] = entity.total; 53 | data['list'] = entity.list?.map((v) => v.toJson()).toList(); 54 | data['class'] = entity.xClass.map((v) => v.toJson()).toList(); 55 | return data; 56 | } -------------------------------------------------------------------------------- /lib/generated/json/update_info_entity.g.dart: -------------------------------------------------------------------------------- 1 | import 'package:mu_hua_movie/generated/json/base/json_convert_content.dart'; 2 | import 'package:mu_hua_movie/model/entity/update_info_entity.dart'; 3 | 4 | UpdateInfoEntity $UpdateInfoEntityFromJson(Map json) { 5 | final UpdateInfoEntity updateInfoEntity = UpdateInfoEntity(); 6 | final int? versionCode = jsonConvert.convert(json['versionCode']); 7 | if (versionCode != null) { 8 | updateInfoEntity.versionCode = versionCode; 9 | } 10 | final String? versionName = jsonConvert.convert(json['versionName']); 11 | if (versionName != null) { 12 | updateInfoEntity.versionName = versionName; 13 | } 14 | final String? log = jsonConvert.convert(json['log']); 15 | if (log != null) { 16 | updateInfoEntity.log = log; 17 | } 18 | final int? force = jsonConvert.convert(json['force']); 19 | if (force != null) { 20 | updateInfoEntity.force = force; 21 | } 22 | final String? url = jsonConvert.convert(json['url']); 23 | if (url != null) { 24 | updateInfoEntity.url = url; 25 | } 26 | return updateInfoEntity; 27 | } 28 | 29 | Map $UpdateInfoEntityToJson(UpdateInfoEntity entity) { 30 | final Map data = {}; 31 | data['versionCode'] = entity.versionCode; 32 | data['versionName'] = entity.versionName; 33 | data['log'] = entity.log; 34 | data['force'] = entity.force; 35 | data['url'] = entity.url; 36 | return data; 37 | } -------------------------------------------------------------------------------- /lib/generated/json/vd_class.g.dart: -------------------------------------------------------------------------------- 1 | import 'package:mu_hua_movie/generated/json/base/json_convert_content.dart'; 2 | import 'package:mu_hua_movie/model/entity/vd_class.dart'; 3 | 4 | VdClass $VdClassFromJson(Map json) { 5 | final VdClass vdClass = VdClass(); 6 | final int? typeId = jsonConvert.convert(json['type_id']); 7 | if (typeId != null) { 8 | vdClass.typeId = typeId; 9 | } 10 | final int? typePid = jsonConvert.convert(json['type_pid']); 11 | if (typePid != null) { 12 | vdClass.typePid = typePid; 13 | } 14 | final String? typeName = jsonConvert.convert(json['type_name']); 15 | if (typeName != null) { 16 | vdClass.typeName = typeName; 17 | } 18 | return vdClass; 19 | } 20 | 21 | Map $VdClassToJson(VdClass entity) { 22 | final Map data = {}; 23 | data['type_id'] = entity.typeId; 24 | data['type_pid'] = entity.typePid; 25 | data['type_name'] = entity.typeName; 26 | return data; 27 | } -------------------------------------------------------------------------------- /lib/getx_bindings/my_bindings.dart: -------------------------------------------------------------------------------- 1 | import 'package:get/get.dart'; 2 | 3 | import '../model/repository/net_repository.dart'; 4 | import '../model/repository/net_versoin_update_repository.dart'; 5 | import '../service/my_service.dart'; 6 | 7 | class MyBinding implements Bindings { 8 | @override 9 | Future dependencies() async { 10 | Get.put(NetRepository(), permanent: true); 11 | 12 | final myService = MyService(); 13 | Get.put(myService, permanent: true); 14 | Get.put(NetVersionUpdateRepository(), permanent: true); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /lib/main.dart: -------------------------------------------------------------------------------- 1 | import 'dart:io'; 2 | 3 | import 'package:flutter/material.dart'; 4 | import 'package:flutter/services.dart'; 5 | import 'package:get/get.dart'; 6 | import 'package:mu_hua_movie/routes/app_page.dart'; 7 | import 'package:talkingdata_sdk_plugin/talkingdata_sdk_plugin.dart'; 8 | import 'getx_bindings/my_bindings.dart'; 9 | 10 | Future main() async { 11 | 12 | runApp(const MyApp()); 13 | SystemChrome.setPreferredOrientations([ 14 | DeviceOrientation.portraitUp, 15 | DeviceOrientation.portraitDown 16 | ]); 17 | 18 | if (Platform.isIOS) { 19 | TalkingDataSDK.backgroundSessionEnabled(); 20 | } 21 | TalkingDataSDK.init( 22 | appID: "94AEA0CDD9F647C0BDE6F022B8D2583C", 23 | channelID: Platform.operatingSystem, 24 | custom: ""); 25 | } 26 | 27 | class MyApp extends StatelessWidget { 28 | const MyApp({super.key}); 29 | // This widget is the root of your application. 30 | @override 31 | Widget build(BuildContext context) { 32 | return GetMaterialApp( 33 | title: '源播', 34 | theme: ThemeData.light(useMaterial3: true), 35 | darkTheme: ThemeData.dark(useMaterial3: true), 36 | initialRoute: AppPages.initial, 37 | getPages: AppPages.uPages, 38 | initialBinding: MyBinding(), 39 | ); 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /lib/model/entity/response_base_entity.dart: -------------------------------------------------------------------------------- 1 | import 'package:mu_hua_movie/generated/json/base/json_field.dart'; 2 | import 'package:mu_hua_movie/generated/json/response_base_entity.g.dart'; 3 | import 'package:mu_hua_movie/model/entity/vd_class.dart'; 4 | import 'dart:convert'; 5 | 6 | import 'package:mu_hua_movie/model/entity/vod_info_entity.dart'; 7 | 8 | @JsonSerializable() 9 | class ResponseBaseEntity { 10 | 11 | int? code; 12 | String? msg; 13 | int? page; 14 | int? pagecount; 15 | String? limit; 16 | int? total; 17 | List? list; 18 | @JSONField(name: "class") 19 | late List xClass; 20 | 21 | ResponseBaseEntity(); 22 | 23 | factory ResponseBaseEntity.fromJson(Map json) => $ResponseBaseEntityFromJson(json); 24 | 25 | Map toJson() => $ResponseBaseEntityToJson(this); 26 | 27 | ResponseBaseEntity copyWith({int? code, String? msg, int? page, int? pagecount, String? limit, int? total, List? list}) { 28 | return ResponseBaseEntity()..code= code ?? this.code 29 | ..msg= msg ?? this.msg 30 | ..page= page ?? this.page 31 | ..pagecount= pagecount ?? this.pagecount 32 | ..limit= limit ?? this.limit 33 | ..total= total ?? this.total 34 | ..list= list ?? this.list; 35 | } 36 | 37 | @override 38 | String toString() { 39 | return jsonEncode(this); 40 | } 41 | } -------------------------------------------------------------------------------- /lib/model/entity/update_info_entity.dart: -------------------------------------------------------------------------------- 1 | import 'package:mu_hua_movie/generated/json/base/json_field.dart'; 2 | import 'package:mu_hua_movie/generated/json/update_info_entity.g.dart'; 3 | import 'dart:convert'; 4 | 5 | @JsonSerializable() 6 | class UpdateInfoEntity { 7 | 8 | late int versionCode; 9 | late String versionName; 10 | late String log; 11 | late int force; 12 | late String url; 13 | 14 | UpdateInfoEntity(); 15 | 16 | factory UpdateInfoEntity.fromJson(Map json) => $UpdateInfoEntityFromJson(json); 17 | 18 | Map toJson() => $UpdateInfoEntityToJson(this); 19 | 20 | UpdateInfoEntity copyWith({int? versionCode, String? versionName, String? log, int? force, String? url}) { 21 | return UpdateInfoEntity()..versionCode= versionCode ?? this.versionCode 22 | ..versionName= versionName ?? this.versionName 23 | ..log= log ?? this.log 24 | ..force= force ?? this.force 25 | ..url= url ?? this.url; 26 | } 27 | 28 | @override 29 | String toString() { 30 | return jsonEncode(this); 31 | } 32 | } -------------------------------------------------------------------------------- /lib/model/entity/vd_class.dart: -------------------------------------------------------------------------------- 1 | import 'package:mu_hua_movie/generated/json/base/json_field.dart'; 2 | 3 | import 'dart:convert'; 4 | 5 | import '../../generated/json/vd_class.g.dart'; 6 | 7 | @JsonSerializable() 8 | class VdClass { 9 | @JSONField(name: "type_id") 10 | late int typeId; 11 | @JSONField(name: "type_pid") 12 | late int typePid; 13 | @JSONField(name: "type_name") 14 | late String typeName; 15 | 16 | VdClass(); 17 | 18 | factory VdClass.fromJson(Map json) => $VdClassFromJson(json); 19 | 20 | Map toJson() => $VdClassToJson(this); 21 | 22 | VdClass copyWith({int? typeId, int? typePid, String? typeName}) { 23 | return VdClass() 24 | ..typeId = typeId ?? this.typeId 25 | ..typePid = typePid ?? this.typePid 26 | ..typeName = typeName ?? this.typeName; 27 | } 28 | 29 | @override 30 | String toString() { 31 | return jsonEncode(this); 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /lib/model/repository/net_base_repository.dart: -------------------------------------------------------------------------------- 1 | import 'package:get/get.dart'; 2 | 3 | class NetBaseRepository extends GetConnect { 4 | @override 5 | void onInit() { 6 | allowAutoSignedCert = true; 7 | httpClient.defaultContentType = "application/json"; 8 | httpClient.timeout = const Duration(seconds: 30); 9 | // 请求拦截 10 | httpClient.addRequestModifier((request) { 11 | print(request); 12 | return request; 13 | }); 14 | // 响应拦截 15 | httpClient.addResponseModifier((request, response) { 16 | print(response); 17 | return response; 18 | }); 19 | httpClient.maxAuthRetries = 3; 20 | httpClient.maxRedirects = 3; 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /lib/model/repository/net_repository.dart: -------------------------------------------------------------------------------- 1 | import 'dart:convert'; 2 | 3 | import 'package:get/get.dart'; 4 | import 'package:mu_hua_movie/service/my_service.dart'; 5 | import '../entity/response_base_entity.dart'; 6 | import 'net_base_repository.dart'; 7 | 8 | class NetRepository extends NetBaseRepository { 9 | Future getIndex( 10 | {String? url, 11 | bool? isList = false, 12 | int? page, 13 | String? category, 14 | String? keyword}) async { 15 | Map map = {}; 16 | if (isList == true) { 17 | map['ac'] = "list"; 18 | } else { 19 | map['ac'] = "videolist"; 20 | } 21 | 22 | if (page != null) { 23 | map['pg'] = page.toString(); 24 | } 25 | 26 | if (category != null && category.isNotEmpty) { 27 | map['t'] = category; 28 | } 29 | if (keyword != null && keyword.isNotEmpty) { 30 | map['wd'] = keyword; 31 | } 32 | 33 | var selectSourceUrl = url ?? Get.find().selectSourceUrl.value; 34 | Response response = 35 | await get(selectSourceUrl, query: map, 36 | decoder: (map) { 37 | return ResponseBaseEntity.fromJson(jsonDecode(map)); 38 | }); 39 | return response.body; 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /lib/model/repository/net_versoin_update_repository.dart: -------------------------------------------------------------------------------- 1 | import 'dart:async'; 2 | import 'dart:io'; 3 | import 'package:get/get.dart'; 4 | import 'package:path_provider/path_provider.dart'; 5 | import 'net_base_repository.dart'; 6 | 7 | typedef OnDownloadProgress = void Function(int byteCount, int totalBytes); 8 | 9 | class NetVersionUpdateRepository extends NetBaseRepository { 10 | Future?> getUpdateInfo() async { 11 | Response> response = await get>( 12 | "https://ec2-3-85-234-92.compute-1.amazonaws.com/version_update.json"); 13 | return response.body; 14 | } 15 | 16 | Future downApp(url, {OnDownloadProgress? onDownloadProgress}) async { 17 | final HttpClientResponse httpResponse; 18 | try { 19 | final Uri resolved = Uri.base.resolve(url); 20 | HttpClient httpClient = HttpClient(); 21 | httpClient.badCertificateCallback = (cert, host, port) => true; 22 | final HttpClientRequest req = await httpClient.getUrl(resolved); 23 | httpResponse = await req.close(); 24 | } catch (e) { 25 | return Future.error(e); 26 | } 27 | Directory appDocDir = await getTemporaryDirectory(); 28 | String path = "${appDocDir.path}/eeee.apk"; 29 | File file = File(path); 30 | var raf = file.openSync(mode: FileMode.write); 31 | int totalBytes = httpResponse.contentLength; 32 | int byteCount = 0; 33 | Completer completer = Completer(); 34 | httpResponse.listen((event) { 35 | if (onDownloadProgress != null) { 36 | byteCount += event.length; 37 | onDownloadProgress(byteCount, totalBytes); 38 | } 39 | raf.writeFromSync(event); 40 | }, onDone: () { 41 | raf.closeSync(); 42 | completer.complete(file.path); 43 | }, onError: (err) { 44 | raf.closeSync(); 45 | file.deleteSync(); 46 | completer.completeError(err); 47 | }, cancelOnError: true); 48 | 49 | return completer.future; 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /lib/modules/index/home_con.dart: -------------------------------------------------------------------------------- 1 | import 'package:get/get.dart'; 2 | import 'package:mu_hua_movie/model/repository/net_repository.dart'; 3 | import 'package:mu_hua_movie/service/my_service.dart'; 4 | import 'package:talkingdata_sdk_plugin/talkingdata_sdk_plugin.dart'; 5 | 6 | import '../../model/entity/vd_class.dart'; 7 | import '../../model/entity/vod_info_entity.dart'; 8 | 9 | class HomeCon extends GetxController { 10 | RxList vodInfo = RxList(); 11 | RxList vdClass = RxList(); 12 | int page = 1; 13 | int pageC = 0; 14 | var keyword = "".obs; 15 | var isShowSearch = false.obs; 16 | 17 | Rx category = Rx(null); 18 | 19 | @override 20 | void onInit() { 21 | super.onInit(); 22 | TalkingDataSDK.onPageBegin("主页面"); 23 | getCategory(); 24 | getIndex(); 25 | 26 | Get.find().selectSourceUrl.listen((p0) { 27 | category.value = null; 28 | page = 1; 29 | getCategory(); 30 | getIndex(url: p0); 31 | }); 32 | 33 | super.onInit(); 34 | } 35 | @override 36 | onClose(){ 37 | TalkingDataSDK.onPageEnd("主页面"); 38 | super.onClose(); 39 | } 40 | 41 | getIndex({String? url}) async { 42 | try { 43 | var req = await Get.find().getIndex( 44 | url: url, 45 | page: page, 46 | keyword: keyword.value, 47 | category: category.value?.typeId.toString() ); 48 | if (page == 1) { 49 | vodInfo.clear(); 50 | } 51 | vodInfo.addAll(req?.list ?? []); 52 | pageC = req?.pagecount ?? 0; 53 | page++; 54 | } catch (e) { 55 | e.printError(); 56 | } 57 | } 58 | 59 | getCategory() async { 60 | try { 61 | vdClass.clear(); 62 | var req = await Get.find().getIndex(isList: true); 63 | vdClass.addAll(req?.xClass ?? []); 64 | } catch (e) { 65 | e.printError(); 66 | } 67 | } 68 | } 69 | -------------------------------------------------------------------------------- /lib/modules/player/my_better_player_data_source.dart: -------------------------------------------------------------------------------- 1 | import 'package:extended_betterplayer/better_player.dart'; 2 | 3 | class MyBetterPlayerDataSource extends BetterPlayerDataSource { 4 | final String name; 5 | MyBetterPlayerDataSource(super.type, super.url, this.name); 6 | } 7 | -------------------------------------------------------------------------------- /lib/modules/player/play_url_entity.dart: -------------------------------------------------------------------------------- 1 | class PlayUrlEntity { 2 | PlayUrlEntity(this.name, this.url); 3 | late String name; 4 | late String url; 5 | } 6 | -------------------------------------------------------------------------------- /lib/modules/player/player_con.dart: -------------------------------------------------------------------------------- 1 | import 'package:extended_betterplayer/better_player.dart'; 2 | import 'package:flutter/material.dart'; 3 | import 'package:get/get.dart'; 4 | import 'package:mu_hua_movie/model/entity/vod_info_entity.dart'; 5 | import 'package:talkingdata_sdk_plugin/talkingdata_sdk_plugin.dart'; 6 | 7 | import 'my_better_player_data_source.dart'; 8 | 9 | class PlayerCon extends GetxController { 10 | late VodInfoEntity arguments; 11 | late RxList> vodPlayUrlEntityList = RxList(); 12 | 13 | late List vodPlayFromList; 14 | var currentPlayFromIndex = 0.obs; 15 | 16 | var currentDataSourceIndex = 0.obs; 17 | final GlobalKey betterPlayerPlaylistStateKey = 18 | GlobalKey(); 19 | 20 | BetterPlayerPlaylistController? get betterPlayerPlaylistController => 21 | betterPlayerPlaylistStateKey.currentState?.betterPlayerPlaylistController; 22 | 23 | @override 24 | void onInit() { 25 | super.onInit(); 26 | TalkingDataSDK.onPageBegin("播放"); 27 | arguments = Get.arguments; 28 | 29 | vodPlayFromList = arguments.vodPlayFrom.split('\$\$\$'); 30 | String vodPlayUrlStr = arguments.vodPlayUrl; 31 | analysisUrl(vodPlayUrlStr); 32 | } 33 | 34 | @override 35 | void onReady() { 36 | // TODO: implement onReady 37 | super.onReady(); 38 | 39 | betterPlayerPlaylistController?.betterPlayerController 40 | ?.addEventsListener((event) { 41 | // print("Better player event: ${event.betterPlayerEventType}"); 42 | if (event.betterPlayerEventType == 43 | BetterPlayerEventType.setupDataSource) { 44 | currentDataSourceIndex.value = 45 | betterPlayerPlaylistController?.currentDataSourceIndex ?? 0; 46 | } 47 | }); 48 | } 49 | 50 | @override 51 | onClose() { 52 | TalkingDataSDK.onPageEnd("播放"); 53 | super.onClose(); 54 | } 55 | 56 | analysisUrl(String vodPlayUrlStr) { 57 | var vodPlayUrlTypeArray = vodPlayUrlStr.split('\$\$\$'); 58 | 59 | vodPlayUrlTypeArray.removeWhere((element) { 60 | if (element.contains(".m3u8") || 61 | element.contains(".m3u") || 62 | element.contains(".mp4")) { 63 | return false; 64 | } 65 | int index = vodPlayUrlTypeArray.indexOf(element); 66 | vodPlayFromList.removeAt(index); 67 | return true; 68 | }); 69 | 70 | vodPlayUrlEntityList.value = vodPlayUrlTypeArray.map((e) { 71 | var vodPlayUrlArray = e.split('#'); 72 | vodPlayUrlArray.removeWhere((element) => element.isEmpty); 73 | var entityList = vodPlayUrlArray.map((e) { 74 | var item = e.split('\$'); 75 | return MyBetterPlayerDataSource( 76 | BetterPlayerDataSourceType.network, item[1], item[0]); 77 | }).toList(); 78 | 79 | return entityList; 80 | }).toList(); 81 | } 82 | } 83 | -------------------------------------------------------------------------------- /lib/modules/player/player_screen.dart: -------------------------------------------------------------------------------- 1 | import 'package:extended_betterplayer/better_player.dart'; 2 | import 'package:flutter/material.dart'; 3 | import 'package:flutter/services.dart'; 4 | import 'package:get/get.dart'; 5 | import 'package:mu_hua_movie/modules/player/player_con.dart'; 6 | 7 | class PlayerScreen extends GetView { 8 | const PlayerScreen({super.key}); 9 | 10 | @override 11 | Widget build(BuildContext context) { 12 | return Scaffold( 13 | // extendBodyBehindAppBar: true, 14 | extendBody: true, 15 | appBar: AppBar( 16 | // systemOverlayStyle: const SystemUiOverlayStyle( 17 | // statusBarIconBrightness: Brightness.dark), 18 | // backgroundColor: Colors.transparent, 19 | // foregroundColor: Colors.white 20 | title: Text(controller.arguments.vodName ?? ""), 21 | ), 22 | 23 | body: Column( 24 | mainAxisSize: MainAxisSize.max, 25 | children: [ 26 | Obx( 27 | () => BetterPlayerPlaylist( 28 | key: controller.betterPlayerPlaylistStateKey, 29 | betterPlayerConfiguration: const BetterPlayerConfiguration( 30 | fit: BoxFit.contain, 31 | autoPlay: true, 32 | looping: true, 33 | // placeholder: CachedNetworkImage( 34 | // width: Get.width, 35 | // fit: BoxFit.cover, 36 | // imageUrl: controller.arguments.vodPic), 37 | allowedScreenSleep: false, 38 | fullScreenByDefault: true, 39 | autoDetectFullscreenDeviceOrientation: true, 40 | autoDetectFullscreenAspectRatio: true, 41 | deviceOrientationsAfterFullScreen: [ 42 | DeviceOrientation.portraitUp, 43 | DeviceOrientation.portraitDown, 44 | // DeviceOrientation.landscapeLeft, 45 | // DeviceOrientation.landscapeRight, 46 | ]), 47 | betterPlayerPlaylistConfiguration: 48 | const BetterPlayerPlaylistConfiguration(), 49 | betterPlayerDataSourceList: controller.vodPlayUrlEntityList[ 50 | controller.currentPlayFromIndex.value]), 51 | ), 52 | InkWell( 53 | onTap: () { 54 | showModalBottomSheet( 55 | context: context, 56 | builder: (context) { 57 | return Padding( 58 | padding: const EdgeInsets.all(16.0), 59 | child: Column( 60 | textBaseline: TextBaseline.ideographic, 61 | crossAxisAlignment: CrossAxisAlignment.start, 62 | children: [ 63 | Text( 64 | controller.arguments.vodName, 65 | style: const TextStyle( 66 | fontSize: 16, fontWeight: FontWeight.bold), 67 | ), 68 | Text( 69 | "演员:${controller.arguments.vodActor}", 70 | style: const TextStyle(fontSize: 12), 71 | ), 72 | Text( 73 | "共${controller.arguments.vodTotal}集 ${controller.arguments.vodPubdate}"), 74 | Text("简介:\n${controller.arguments.vodBlurb}"), 75 | ], 76 | ), 77 | ); 78 | }); 79 | }, 80 | child: Padding( 81 | padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 8), 82 | child: Row( 83 | children: [ 84 | Expanded( 85 | flex: 1, 86 | child: Obx( 87 | () => Text( 88 | "${controller.arguments.vodName} ${controller.vodPlayUrlEntityList[controller.currentPlayFromIndex.value][controller.currentDataSourceIndex.value].name}", 89 | style: const TextStyle( 90 | fontSize: 16, fontWeight: FontWeight.w600), 91 | ), 92 | ), 93 | ), 94 | const Text( 95 | "介绍", 96 | style: TextStyle(fontSize: 14, color: Colors.grey), 97 | ), 98 | const Icon(Icons.arrow_forward_ios, 99 | size: 12, color: Colors.grey) 100 | ], 101 | ), 102 | ), 103 | ), 104 | const Divider(), 105 | SizedBox( 106 | height: 40, 107 | child: Padding( 108 | padding: const EdgeInsets.symmetric(horizontal: 16), 109 | child: Row( 110 | children: [ 111 | const Text("线路:"), 112 | Flexible( 113 | child: ListView.separated( 114 | separatorBuilder: (BuildContext context, int index) { 115 | return const Padding( 116 | padding: EdgeInsets.symmetric(horizontal: 2)); 117 | }, 118 | padding: const EdgeInsets.symmetric(horizontal: 8, vertical: 2), 119 | scrollDirection: Axis.horizontal, 120 | itemCount: controller.vodPlayFromList.length, 121 | itemBuilder: (BuildContext context, int index) { 122 | return Row(children: [ 123 | Obx(() => Radio( 124 | value: index, 125 | groupValue: controller.currentPlayFromIndex.value, 126 | onChanged: (int? value) { 127 | controller.currentPlayFromIndex.value = value!; 128 | 129 | controller.betterPlayerPlaylistController 130 | ?.setupDataSourceList( 131 | controller.vodPlayUrlEntityList[value]); 132 | }, 133 | )), 134 | Text(controller.vodPlayFromList[index], 135 | style: const TextStyle(fontSize: 14)) 136 | ]); 137 | }), 138 | ), 139 | ], 140 | ), 141 | ), 142 | ), 143 | const Divider(), 144 | Flexible( 145 | fit: FlexFit.tight, 146 | child: Obx(() { 147 | var currentList = controller.vodPlayUrlEntityList[ 148 | controller.currentPlayFromIndex.value]; 149 | return GridView.count( 150 | padding: 151 | const EdgeInsets.symmetric(horizontal: 8, vertical: 8), 152 | physics: const AlwaysScrollableScrollPhysics(), 153 | crossAxisCount: 3, 154 | mainAxisSpacing: 10, 155 | crossAxisSpacing: 10, 156 | childAspectRatio: 3, 157 | children: currentList.map((e) { 158 | var index = currentList.indexOf(e); 159 | return ElevatedButton( 160 | onPressed: 161 | index == controller.currentDataSourceIndex.value 162 | ? null 163 | : () { 164 | controller.betterPlayerPlaylistController 165 | ?.setupDataSource(index); 166 | }, 167 | child: Text(e.name)); 168 | }).toList(), 169 | ); 170 | })) 171 | ], 172 | ), 173 | ); 174 | } 175 | } 176 | -------------------------------------------------------------------------------- /lib/modules/source/source_entity.dart: -------------------------------------------------------------------------------- 1 | import 'package:hive/hive.dart'; 2 | 3 | part 'source_entity.g.dart'; 4 | 5 | @HiveType(typeId: 0) 6 | class SourceEntity { 7 | @HiveField(0) 8 | late String name; 9 | @HiveField(1) 10 | late String url; 11 | 12 | SourceEntity(this.name, this.url); 13 | } 14 | -------------------------------------------------------------------------------- /lib/modules/source/source_entity.g.dart: -------------------------------------------------------------------------------- 1 | // GENERATED CODE - DO NOT MODIFY BY HAND 2 | 3 | part of 'source_entity.dart'; 4 | 5 | // ************************************************************************** 6 | // TypeAdapterGenerator 7 | // ************************************************************************** 8 | 9 | class SourceEntityAdapter extends TypeAdapter { 10 | @override 11 | final int typeId = 0; 12 | 13 | @override 14 | SourceEntity 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 SourceEntity( 20 | fields[0] as String, 21 | fields[1] as String, 22 | ); 23 | } 24 | 25 | @override 26 | void write(BinaryWriter writer, SourceEntity obj) { 27 | writer 28 | ..writeByte(2) 29 | ..writeByte(0) 30 | ..write(obj.name) 31 | ..writeByte(1) 32 | ..write(obj.url); 33 | } 34 | 35 | @override 36 | int get hashCode => typeId.hashCode; 37 | 38 | @override 39 | bool operator ==(Object other) => 40 | identical(this, other) || 41 | other is SourceEntityAdapter && 42 | runtimeType == other.runtimeType && 43 | typeId == other.typeId; 44 | } 45 | -------------------------------------------------------------------------------- /lib/modules/source/source_mange_con.dart: -------------------------------------------------------------------------------- 1 | import 'package:get/get.dart'; 2 | import 'package:hive/hive.dart'; 3 | import 'package:hive_flutter/adapters.dart'; 4 | import 'package:mu_hua_movie/modules/source/source_entity.dart'; 5 | import 'package:mu_hua_movie/service/my_service.dart'; 6 | 7 | class SourceMangeCon extends GetxController { 8 | String addName = ""; 9 | String addUrl = ""; 10 | 11 | var count = 0.obs; 12 | 13 | late Box sourceBox; 14 | 15 | late MyService myService; 16 | 17 | @override 18 | Future onInit() async { 19 | super.onInit(); 20 | 21 | sourceBox = await Hive.openBox('source'); 22 | count.value = sourceBox.length; 23 | 24 | myService = Get.find(); 25 | } 26 | 27 | addSource() { 28 | // if (sourceBox.containsKey(addName)) { 29 | // Get.snackbar("提示", "标题重复了,换一个吧"); 30 | // return; 31 | // } 32 | final addSourceEntity = SourceEntity(addName, addUrl); 33 | sourceBox.put(addName, addSourceEntity).then((value) { 34 | if (count.value == sourceBox.length) { 35 | count.refresh(); 36 | } else { 37 | count.value = sourceBox.length; 38 | } 39 | }); 40 | 41 | if (myService.selectSourceKey.value.isEmpty) { 42 | myService.selectSourceKey.value = addName; 43 | changeSelectSource(addSourceEntity); 44 | } 45 | Get.back(); 46 | } 47 | 48 | deleteSource(key) { 49 | sourceBox.delete(key).then((value) { 50 | if (count.value == sourceBox.length) { 51 | count.refresh(); 52 | } else { 53 | count.value = sourceBox.length; 54 | } 55 | }); 56 | } 57 | 58 | @override 59 | void onClose() { 60 | sourceBox.close(); 61 | super.onClose(); 62 | } 63 | 64 | changeSelectSource(SourceEntity source) { 65 | myService.changeSelectSource(source.name, source.url); 66 | } 67 | } 68 | -------------------------------------------------------------------------------- /lib/modules/source/source_mange_screen.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:get/get.dart'; 3 | import 'package:mu_hua_movie/modules/source/source_entity.dart'; 4 | import 'package:mu_hua_movie/modules/source/source_mange_con.dart'; 5 | 6 | class SourceMangeScreen extends GetView { 7 | const SourceMangeScreen({super.key}); 8 | 9 | @override 10 | Widget build(BuildContext context) { 11 | return Scaffold( 12 | resizeToAvoidBottomInset: true, 13 | appBar: AppBar( 14 | title: const Text("源管理"), 15 | ), 16 | body: Obx( 17 | () { 18 | return ListView.separated( 19 | itemBuilder: (BuildContext context, int index) { 20 | SourceEntity? source = controller.sourceBox.getAt(index); 21 | return Obx(() => RadioListTile( 22 | title: Row( 23 | children: [ 24 | Text(source?.name ?? ""), 25 | const Spacer(), 26 | Visibility( 27 | visible: 28 | controller.myService.selectSourceKey.value != 29 | (source?.name ?? ""), 30 | child: Row( 31 | children: [ 32 | IconButton( 33 | onPressed: () { 34 | controller.addName = source?.name ?? ""; 35 | controller.addUrl = source?.url ?? ""; 36 | showEdit(context); 37 | }, 38 | icon: const Icon(Icons.edit, size: 20)), 39 | IconButton( 40 | onPressed: () { 41 | showDialog( 42 | context: context, 43 | builder: (context) { 44 | return AlertDialog( 45 | title: const Text("删除"), 46 | content: Text( 47 | "你将要删除 ${source?.name ?? ""} !"), 48 | actions: [ 49 | TextButton( 50 | onPressed: () { 51 | Get.back(); 52 | }, 53 | child: 54 | const Text("取消")), 55 | ElevatedButton( 56 | onPressed: () { 57 | controller 58 | .deleteSource( 59 | source?.name ?? 60 | ""); 61 | Get.back(); 62 | }, 63 | child: const Text("确定")) 64 | ]); 65 | }); 66 | }, 67 | icon: const Icon(Icons.delete, size: 20)) 68 | ], 69 | )) 70 | ], 71 | ), 72 | subtitle: Text(source?.url ?? ""), 73 | value: source?.name ?? "", 74 | groupValue: controller.myService.selectSourceKey.value, 75 | onChanged: (value) { 76 | controller.myService.selectSourceKey.value = 77 | source?.name ?? ""; 78 | controller.changeSelectSource(source!); 79 | }, 80 | )); 81 | }, 82 | separatorBuilder: (BuildContext context, int index) { 83 | return const Divider(); 84 | }, 85 | itemCount: controller.count.value); 86 | }, 87 | ), 88 | floatingActionButton: FloatingActionButton( 89 | onPressed: () { 90 | controller.addName = ""; 91 | controller.addUrl = ""; 92 | showEdit(context); 93 | }, 94 | child: const Icon(Icons.add), 95 | ), 96 | ); 97 | } 98 | 99 | showEdit(BuildContext context) { 100 | GlobalKey key = GlobalKey(); 101 | showModalBottomSheet( 102 | isScrollControlled: true, 103 | context: context, 104 | builder: (context) { 105 | return AnimatedPadding( 106 | padding: MediaQuery.of(context).viewInsets, 107 | duration: const Duration(milliseconds: 100), 108 | child: Padding( 109 | padding: const EdgeInsets.all(16), 110 | child: Column( 111 | mainAxisSize: MainAxisSize.min, 112 | children: [ 113 | const Text("添加源", 114 | style: TextStyle( 115 | fontWeight: FontWeight.bold, fontSize: 16)), 116 | Form( 117 | key: key, 118 | child: Column( 119 | mainAxisSize: MainAxisSize.min, 120 | children: [ 121 | TextFormField( 122 | initialValue: controller.addName, 123 | maxLines: 1, 124 | maxLength: 10, 125 | decoration: const InputDecoration( 126 | labelText: "标题", hintText: "标题相同会被覆盖哦!!"), 127 | validator: (v) { 128 | if (v?.isEmpty == true) { 129 | return "不能为空哦"; 130 | } 131 | return null; 132 | }, 133 | onSaved: (v) { 134 | controller.addName = v!; 135 | }, 136 | ), 137 | const SizedBox(height: 10), 138 | TextFormField( 139 | initialValue: controller.addUrl, 140 | maxLength: 200, 141 | validator: (v) { 142 | if (v?.isEmpty == true) { 143 | return "不能为空哦"; 144 | } 145 | return null; 146 | }, 147 | onSaved: (v) { 148 | controller.addUrl = v!; 149 | }, 150 | decoration: const InputDecoration(labelText: "源地址"), 151 | ), 152 | ], 153 | ), 154 | ), 155 | const SizedBox(height: 30), 156 | ElevatedButton( 157 | style: ButtonStyle( 158 | fixedSize: 159 | MaterialStateProperty.all(const Size(200, 50))), 160 | onPressed: () { 161 | var state = key.currentState; 162 | if (state?.validate() == true) { 163 | state?.save(); 164 | controller.addSource(); 165 | } 166 | }, 167 | child: const Text("添加")) 168 | ], 169 | ), 170 | )); 171 | }); 172 | } 173 | } 174 | -------------------------------------------------------------------------------- /lib/modules/splash/splash_con.dart: -------------------------------------------------------------------------------- 1 | import 'dart:io'; 2 | import 'package:flutter/material.dart'; 3 | import 'package:flutter/services.dart'; 4 | import 'package:get/get.dart'; 5 | import 'package:hive_flutter/adapters.dart'; 6 | import 'package:mu_hua_movie/model/entity/update_info_entity.dart'; 7 | import 'package:mu_hua_movie/model/repository/net_versoin_update_repository.dart'; 8 | import 'package:package_info_plus/package_info_plus.dart'; 9 | import 'package:mu_hua_movie/native_channel/native_channel.dart'; 10 | import 'package:permission_handler/permission_handler.dart'; 11 | import '../../routes/app_routes.dart'; 12 | import '../../service/my_service.dart'; 13 | import '../source/source_entity.dart'; 14 | 15 | class SplashCon extends GetxController { 16 | var progress = 0.0.obs; 17 | 18 | UpdateInfoEntity? updateInfo; 19 | String version = ""; 20 | String buildNumber = ""; 21 | 22 | @override 23 | void onReady() { 24 | init(); 25 | } 26 | 27 | init() async { 28 | await Hive.initFlutter(); 29 | if (!Hive.isAdapterRegistered(0)) { 30 | Hive.registerAdapter(SourceEntityAdapter()); 31 | } 32 | PackageInfo packageInfo = await PackageInfo.fromPlatform(); 33 | buildNumber = packageInfo.buildNumber; 34 | await Get.find().initBox(); 35 | if(Platform.isAndroid){ 36 | await updateVersion(); 37 | } 38 | 39 | Get.offAndToNamed(Routes.home); 40 | } 41 | 42 | updateVersion() async { 43 | Map? updateInfo = 44 | await Get.find().getUpdateInfo(); 45 | if (updateInfo != null) { 46 | Map? platformUpdateInfo; 47 | 48 | platformUpdateInfo = updateInfo[Platform.operatingSystem]; 49 | if (platformUpdateInfo != null) { 50 | var updateInfo = UpdateInfoEntity.fromJson(platformUpdateInfo); 51 | 52 | if (int.parse(buildNumber) < updateInfo.versionCode) { 53 | String operatingSystem = Platform.operatingSystem; 54 | if (operatingSystem == "android") { 55 | await updateAndroid(updateInfo); 56 | } 57 | } 58 | } 59 | } 60 | } 61 | 62 | updateAndroid(UpdateInfoEntity updateInfo) async { 63 | bool isUpdate = await Get.defaultDialog( 64 | title: "更新", 65 | content: Text(updateInfo.log), 66 | confirm: ElevatedButton( 67 | onPressed: () async { 68 | Get.back(result: true); 69 | }, 70 | child: const Text("确定")), 71 | cancel: TextButton( 72 | onPressed: int.parse(buildNumber) < updateInfo.force 73 | ? null 74 | : () { 75 | Get.back(result: false); 76 | }, 77 | child: const Text("取消"))); 78 | 79 | if (isUpdate) { 80 | bool isGranted = await androidInstallPermission(); 81 | if (isGranted) { 82 | String path = await Get.find() 83 | .downApp(updateInfo.url, 84 | onDownloadProgress: (int byteCount, int totalBytes) { 85 | progress.value = byteCount / totalBytes; 86 | }); 87 | 88 | await NativeChannel().installApk(path); 89 | } else { 90 | if (int.parse(buildNumber) < updateInfo.force) { 91 | Get.snackbar("提示", "用户授权失败!将推出app"); 92 | await Future.delayed(const Duration(seconds: 3)); 93 | SystemNavigator.pop(); 94 | exit(0); 95 | } else { 96 | Get.snackbar("提示", "用户授权失败!无法更新"); 97 | } 98 | } 99 | } 100 | } 101 | 102 | Future androidInstallPermission() async { 103 | var status = await Permission.requestInstallPackages.request(); 104 | if (status.isGranted) { 105 | return true; 106 | } else if (status.isPermanentlyDenied) { 107 | return await openAppSettings(); 108 | } 109 | return false; 110 | } 111 | } 112 | -------------------------------------------------------------------------------- /lib/modules/splash/splash_screen.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:get/get.dart'; 3 | import 'package:mu_hua_movie/modules/splash/splash_con.dart'; 4 | 5 | class SplashScreen extends GetView { 6 | const SplashScreen({super.key}); 7 | 8 | @override 9 | Widget build(BuildContext context) { 10 | return Scaffold( 11 | backgroundColor: Colors.teal, 12 | body: SizedBox( 13 | width: double.infinity, 14 | child: Column( 15 | mainAxisAlignment: MainAxisAlignment.center, 16 | crossAxisAlignment: CrossAxisAlignment.center, 17 | children: [ 18 | const Icon( 19 | Icons.play_arrow, 20 | color: Colors.white, 21 | size: 100, 22 | ), 23 | Obx( 24 | () => Visibility( 25 | visible: controller.progress.value > 0, 26 | child: LinearProgressIndicator( 27 | value: controller.progress.value)), 28 | ) 29 | ], 30 | ), 31 | )); 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /lib/native_channel/native_channel.dart: -------------------------------------------------------------------------------- 1 | import 'dart:ffi'; 2 | 3 | import 'package:flutter/services.dart'; 4 | 5 | class NativeChannel { 6 | late MethodChannel methodChannel; 7 | 8 | NativeChannel() { 9 | methodChannel = const MethodChannel('native_channel'); 10 | } 11 | 12 | 13 | installApk(apkPath){ 14 | Future result = methodChannel.invokeMethod('installApk', apkPath); 15 | return result; 16 | } 17 | 18 | 19 | } 20 | -------------------------------------------------------------------------------- /lib/routes/app_page.dart: -------------------------------------------------------------------------------- 1 | import 'package:get/get.dart'; 2 | import 'package:mu_hua_movie/modules/index/home_con.dart'; 3 | import 'package:mu_hua_movie/modules/index/home_screen.dart'; 4 | import 'package:mu_hua_movie/modules/player/player_con.dart'; 5 | import 'package:mu_hua_movie/modules/player/player_screen.dart'; 6 | import 'package:mu_hua_movie/modules/source/source_mange_con.dart'; 7 | import 'package:mu_hua_movie/modules/splash/splash_con.dart'; 8 | import 'package:mu_hua_movie/modules/splash/splash_screen.dart'; 9 | 10 | import '../modules/source/source_mange_screen.dart'; 11 | import 'app_routes.dart'; 12 | 13 | class AppPages { 14 | static const initial = Routes.splash; 15 | 16 | static final List uPages = [ 17 | GetPage( 18 | name: Routes.splash, 19 | page: () => const SplashScreen(), 20 | binding: BindingsBuilder.put(() => SplashCon())), 21 | GetPage( 22 | name: Routes.home, 23 | page: () => HomeScreen(), 24 | binding: BindingsBuilder.put(() => HomeCon(), permanent: true)), 25 | GetPage( 26 | name: Routes.player, 27 | page: () => PlayerScreen(), 28 | binding: BindingsBuilder.put(() => PlayerCon())), 29 | GetPage( 30 | name: Routes.source, 31 | page: () => const SourceMangeScreen(), 32 | binding: BindingsBuilder.put(() => SourceMangeCon())), 33 | ]; 34 | } 35 | -------------------------------------------------------------------------------- /lib/routes/app_routes.dart: -------------------------------------------------------------------------------- 1 | abstract class Routes { 2 | Routes._(); 3 | 4 | static const splash = '/splash'; 5 | static const home = '/home'; 6 | static const player = '/player'; 7 | static const source = '/source'; 8 | } 9 | -------------------------------------------------------------------------------- /lib/service/my_service.dart: -------------------------------------------------------------------------------- 1 | import 'package:get/get.dart'; 2 | import 'package:hive/hive.dart'; 3 | 4 | import '../modules/source/source_entity.dart'; 5 | 6 | class MyService extends GetxService { 7 | late Box allBox; 8 | var selectSourceUrl = "".obs; 9 | var selectSourceKey = "".obs; 10 | 11 | // @override 12 | // onInit() { 13 | // super.onInit(); 14 | // } 15 | 16 | initBox() async { 17 | allBox = await Hive.openBox('allBox'); 18 | 19 | final isFirstRun = allBox.get("isFirstRun", defaultValue: true); 20 | if (isFirstRun) { 21 | final sourceBox = await Hive.openBox('source'); 22 | 23 | sourceBox.put( 24 | "卧龙资源", 25 | SourceEntity( 26 | "卧龙资源", "https://collect.wolongzyw.com/api.php/provide/vod/")); 27 | 28 | sourceBox.put( 29 | "百度云资源", 30 | SourceEntity( 31 | "百度云资源", "https://api.apibdzy.com/api.php/provide/vod/")); 32 | sourceBox.put( 33 | "天空资源", 34 | SourceEntity( 35 | "天空资源", "https://api.tiankongapi.com/api.php/provide/vod/")); 36 | 37 | sourceBox.put("淘片", 38 | SourceEntity("淘片", "https://sdzyapi.com/api.php/provide/vod/")); 39 | 40 | allBox.put("selectSourceUrl", 41 | "https://collect.wolongzyw.com/api.php/provide/vod/"); 42 | allBox.put("selectSourceKey", "卧龙资源"); 43 | 44 | // sourceBox.put("老鸭", 45 | // SourceEntity("老鸭", "https://api.apilyzy.com/api.php/provide/vod/")); 46 | // sourceBox.put("lj", 47 | // SourceEntity("lj", "https://caiji.semaozy.net/inc/apijson_vod.php")); 48 | // 49 | 50 | allBox.put("isFirstRun", false); 51 | } 52 | 53 | selectSourceUrl.value = allBox.get("selectSourceUrl", defaultValue: ""); 54 | selectSourceKey.value = allBox.get("selectSourceKey", defaultValue: ""); 55 | } 56 | 57 | changeSelectSource(key, url) { 58 | selectSourceUrl.value = url; 59 | selectSourceKey.value = key; 60 | allBox.put("selectSourceKey", key); 61 | allBox.put("selectSourceUrl", url); 62 | } 63 | } 64 | -------------------------------------------------------------------------------- /lib/utils/EsoImageCacheManager.dart: -------------------------------------------------------------------------------- 1 | import 'dart:async'; 2 | 3 | import 'package:flutter_cache_manager/flutter_cache_manager.dart'; 4 | import 'package:http/http.dart' as http; 5 | import 'dart:io'; 6 | 7 | /// 缓存管理 8 | class EsoImageCacheManager extends CacheManager { 9 | static const key = 'libEsoCachedImageData'; 10 | 11 | static EsoImageCacheManager? _instance; 12 | 13 | factory EsoImageCacheManager() { 14 | _instance ??= EsoImageCacheManager._(); 15 | return _instance!; 16 | } 17 | 18 | EsoImageCacheManager._() 19 | : super(Config(key, fileService: EsoHttpFileService())); 20 | } 21 | 22 | class EsoHttpFileService extends FileService { 23 | late HttpClient _httpClient; 24 | 25 | EsoHttpFileService({HttpClient? httpClient}) { 26 | _httpClient = httpClient ?? HttpClient(); 27 | _httpClient.badCertificateCallback = (cert, host, port) => true; 28 | } 29 | 30 | @override 31 | Future get(String url, 32 | {Map? headers}) async { 33 | final Uri resolved = Uri.base.resolve(url); 34 | final HttpClientRequest req = await _httpClient.getUrl(resolved); 35 | headers?.forEach((key, value) { 36 | req.headers.add(key, value); 37 | }); 38 | final HttpClientResponse httpResponse = await req.close(); 39 | final http.StreamedResponse response = http.StreamedResponse( 40 | httpResponse.timeout(const Duration(seconds: 60)), 41 | httpResponse.statusCode, 42 | // contentLength: httpResponse.contentLength, 43 | reasonPhrase: httpResponse.reasonPhrase, 44 | isRedirect: httpResponse.isRedirect, 45 | ); 46 | return HttpGetResponse(response); 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /lib/version_update.json: -------------------------------------------------------------------------------- 1 | { 2 | "android": { 3 | "versionCode": 2, 4 | "versionName": "1.0.1", 5 | "log": "更新", 6 | "force": 1, 7 | "url": "https://ec2-3-85-234-92.compute-1.amazonaws.com/app-release.apk" 8 | }, 9 | "ios": { 10 | 11 | } 12 | } -------------------------------------------------------------------------------- /linux/.gitignore: -------------------------------------------------------------------------------- 1 | flutter/ephemeral 2 | -------------------------------------------------------------------------------- /linux/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Project-level configuration. 2 | cmake_minimum_required(VERSION 3.10) 3 | project(runner LANGUAGES CXX) 4 | 5 | # The name of the executable created for the application. Change this to change 6 | # the on-disk name of your application. 7 | set(BINARY_NAME "mu_hua_movie") 8 | # The unique GTK application identifier for this application. See: 9 | # https://wiki.gnome.org/HowDoI/ChooseApplicationID 10 | set(APPLICATION_ID "com.muhua.mu_hua_movie") 11 | 12 | # Explicitly opt in to modern CMake behaviors to avoid warnings with recent 13 | # versions of CMake. 14 | cmake_policy(SET CMP0063 NEW) 15 | 16 | # Load bundled libraries from the lib/ directory relative to the binary. 17 | set(CMAKE_INSTALL_RPATH "$ORIGIN/lib") 18 | 19 | # Root filesystem for cross-building. 20 | if(FLUTTER_TARGET_PLATFORM_SYSROOT) 21 | set(CMAKE_SYSROOT ${FLUTTER_TARGET_PLATFORM_SYSROOT}) 22 | set(CMAKE_FIND_ROOT_PATH ${CMAKE_SYSROOT}) 23 | set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) 24 | set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY) 25 | set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) 26 | set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY) 27 | endif() 28 | 29 | # Define build configuration options. 30 | if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES) 31 | set(CMAKE_BUILD_TYPE "Debug" CACHE 32 | STRING "Flutter build mode" FORCE) 33 | set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS 34 | "Debug" "Profile" "Release") 35 | endif() 36 | 37 | # Compilation settings that should be applied to most targets. 38 | # 39 | # Be cautious about adding new options here, as plugins use this function by 40 | # default. In most cases, you should add new options to specific targets instead 41 | # of modifying this function. 42 | function(APPLY_STANDARD_SETTINGS TARGET) 43 | target_compile_features(${TARGET} PUBLIC cxx_std_14) 44 | target_compile_options(${TARGET} PRIVATE -Wall -Werror) 45 | target_compile_options(${TARGET} PRIVATE "$<$>:-O3>") 46 | target_compile_definitions(${TARGET} PRIVATE "$<$>:NDEBUG>") 47 | endfunction() 48 | 49 | # Flutter library and tool build rules. 50 | set(FLUTTER_MANAGED_DIR "${CMAKE_CURRENT_SOURCE_DIR}/flutter") 51 | add_subdirectory(${FLUTTER_MANAGED_DIR}) 52 | 53 | # System-level dependencies. 54 | find_package(PkgConfig REQUIRED) 55 | pkg_check_modules(GTK REQUIRED IMPORTED_TARGET gtk+-3.0) 56 | 57 | add_definitions(-DAPPLICATION_ID="${APPLICATION_ID}") 58 | 59 | # Define the application target. To change its name, change BINARY_NAME above, 60 | # not the value here, or `flutter run` will no longer work. 61 | # 62 | # Any new source files that you add to the application should be added here. 63 | add_executable(${BINARY_NAME} 64 | "main.cc" 65 | "my_application.cc" 66 | "${FLUTTER_MANAGED_DIR}/generated_plugin_registrant.cc" 67 | ) 68 | 69 | # Apply the standard set of build settings. This can be removed for applications 70 | # that need different build settings. 71 | apply_standard_settings(${BINARY_NAME}) 72 | 73 | # Add dependency libraries. Add any application-specific dependencies here. 74 | target_link_libraries(${BINARY_NAME} PRIVATE flutter) 75 | target_link_libraries(${BINARY_NAME} PRIVATE PkgConfig::GTK) 76 | 77 | # Run the Flutter tool portions of the build. This must not be removed. 78 | add_dependencies(${BINARY_NAME} flutter_assemble) 79 | 80 | # Only the install-generated bundle's copy of the executable will launch 81 | # correctly, since the resources must in the right relative locations. To avoid 82 | # people trying to run the unbundled copy, put it in a subdirectory instead of 83 | # the default top-level location. 84 | set_target_properties(${BINARY_NAME} 85 | PROPERTIES 86 | RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/intermediates_do_not_run" 87 | ) 88 | 89 | # Generated plugin build rules, which manage building the plugins and adding 90 | # them to the application. 91 | include(flutter/generated_plugins.cmake) 92 | 93 | 94 | # === Installation === 95 | # By default, "installing" just makes a relocatable bundle in the build 96 | # directory. 97 | set(BUILD_BUNDLE_DIR "${PROJECT_BINARY_DIR}/bundle") 98 | if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT) 99 | set(CMAKE_INSTALL_PREFIX "${BUILD_BUNDLE_DIR}" CACHE PATH "..." FORCE) 100 | endif() 101 | 102 | # Start with a clean build bundle directory every time. 103 | install(CODE " 104 | file(REMOVE_RECURSE \"${BUILD_BUNDLE_DIR}/\") 105 | " COMPONENT Runtime) 106 | 107 | set(INSTALL_BUNDLE_DATA_DIR "${CMAKE_INSTALL_PREFIX}/data") 108 | set(INSTALL_BUNDLE_LIB_DIR "${CMAKE_INSTALL_PREFIX}/lib") 109 | 110 | install(TARGETS ${BINARY_NAME} RUNTIME DESTINATION "${CMAKE_INSTALL_PREFIX}" 111 | COMPONENT Runtime) 112 | 113 | install(FILES "${FLUTTER_ICU_DATA_FILE}" DESTINATION "${INSTALL_BUNDLE_DATA_DIR}" 114 | COMPONENT Runtime) 115 | 116 | install(FILES "${FLUTTER_LIBRARY}" DESTINATION "${INSTALL_BUNDLE_LIB_DIR}" 117 | COMPONENT Runtime) 118 | 119 | foreach(bundled_library ${PLUGIN_BUNDLED_LIBRARIES}) 120 | install(FILES "${bundled_library}" 121 | DESTINATION "${INSTALL_BUNDLE_LIB_DIR}" 122 | COMPONENT Runtime) 123 | endforeach(bundled_library) 124 | 125 | # Fully re-copy the assets directory on each build to avoid having stale files 126 | # from a previous install. 127 | set(FLUTTER_ASSET_DIR_NAME "flutter_assets") 128 | install(CODE " 129 | file(REMOVE_RECURSE \"${INSTALL_BUNDLE_DATA_DIR}/${FLUTTER_ASSET_DIR_NAME}\") 130 | " COMPONENT Runtime) 131 | install(DIRECTORY "${PROJECT_BUILD_DIR}/${FLUTTER_ASSET_DIR_NAME}" 132 | DESTINATION "${INSTALL_BUNDLE_DATA_DIR}" COMPONENT Runtime) 133 | 134 | # Install the AOT library on non-Debug builds only. 135 | if(NOT CMAKE_BUILD_TYPE MATCHES "Debug") 136 | install(FILES "${AOT_LIBRARY}" DESTINATION "${INSTALL_BUNDLE_LIB_DIR}" 137 | COMPONENT Runtime) 138 | endif() 139 | -------------------------------------------------------------------------------- /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 | 11 | void fl_register_plugins(FlPluginRegistry* registry) { 12 | g_autoptr(FlPluginRegistrar) url_launcher_linux_registrar = 13 | fl_plugin_registry_get_registrar_for_plugin(registry, "UrlLauncherPlugin"); 14 | url_launcher_plugin_register_with_registrar(url_launcher_linux_registrar); 15 | } 16 | -------------------------------------------------------------------------------- /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 | url_launcher_linux 7 | ) 8 | 9 | list(APPEND FLUTTER_FFI_PLUGIN_LIST 10 | ) 11 | 12 | set(PLUGIN_BUNDLED_LIBRARIES) 13 | 14 | foreach(plugin ${FLUTTER_PLUGIN_LIST}) 15 | add_subdirectory(flutter/ephemeral/.plugin_symlinks/${plugin}/linux plugins/${plugin}) 16 | target_link_libraries(${BINARY_NAME} PRIVATE ${plugin}_plugin) 17 | list(APPEND PLUGIN_BUNDLED_LIBRARIES $) 18 | list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${plugin}_bundled_libraries}) 19 | endforeach(plugin) 20 | 21 | foreach(ffi_plugin ${FLUTTER_FFI_PLUGIN_LIST}) 22 | add_subdirectory(flutter/ephemeral/.plugin_symlinks/${ffi_plugin}/linux plugins/${ffi_plugin}) 23 | list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${ffi_plugin}_bundled_libraries}) 24 | endforeach(ffi_plugin) 25 | -------------------------------------------------------------------------------- /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.cc: -------------------------------------------------------------------------------- 1 | #include "my_application.h" 2 | 3 | #include 4 | #ifdef GDK_WINDOWING_X11 5 | #include 6 | #endif 7 | 8 | #include "flutter/generated_plugin_registrant.h" 9 | 10 | struct _MyApplication { 11 | GtkApplication parent_instance; 12 | char** dart_entrypoint_arguments; 13 | }; 14 | 15 | G_DEFINE_TYPE(MyApplication, my_application, GTK_TYPE_APPLICATION) 16 | 17 | // Implements GApplication::activate. 18 | static void my_application_activate(GApplication* application) { 19 | MyApplication* self = MY_APPLICATION(application); 20 | GtkWindow* window = 21 | GTK_WINDOW(gtk_application_window_new(GTK_APPLICATION(application))); 22 | 23 | // Use a header bar when running in GNOME as this is the common style used 24 | // by applications and is the setup most users will be using (e.g. Ubuntu 25 | // desktop). 26 | // If running on X and not using GNOME then just use a traditional title bar 27 | // in case the window manager does more exotic layout, e.g. tiling. 28 | // If running on Wayland assume the header bar will work (may need changing 29 | // if future cases occur). 30 | gboolean use_header_bar = TRUE; 31 | #ifdef GDK_WINDOWING_X11 32 | GdkScreen* screen = gtk_window_get_screen(window); 33 | if (GDK_IS_X11_SCREEN(screen)) { 34 | const gchar* wm_name = gdk_x11_screen_get_window_manager_name(screen); 35 | if (g_strcmp0(wm_name, "GNOME Shell") != 0) { 36 | use_header_bar = FALSE; 37 | } 38 | } 39 | #endif 40 | if (use_header_bar) { 41 | GtkHeaderBar* header_bar = GTK_HEADER_BAR(gtk_header_bar_new()); 42 | gtk_widget_show(GTK_WIDGET(header_bar)); 43 | gtk_header_bar_set_title(header_bar, "mu_hua_movie"); 44 | gtk_header_bar_set_show_close_button(header_bar, TRUE); 45 | gtk_window_set_titlebar(window, GTK_WIDGET(header_bar)); 46 | } else { 47 | gtk_window_set_title(window, "mu_hua_movie"); 48 | } 49 | 50 | gtk_window_set_default_size(window, 1280, 720); 51 | gtk_widget_show(GTK_WIDGET(window)); 52 | 53 | g_autoptr(FlDartProject) project = fl_dart_project_new(); 54 | fl_dart_project_set_dart_entrypoint_arguments(project, self->dart_entrypoint_arguments); 55 | 56 | FlView* view = fl_view_new(project); 57 | gtk_widget_show(GTK_WIDGET(view)); 58 | gtk_container_add(GTK_CONTAINER(window), GTK_WIDGET(view)); 59 | 60 | fl_register_plugins(FL_PLUGIN_REGISTRY(view)); 61 | 62 | gtk_widget_grab_focus(GTK_WIDGET(view)); 63 | } 64 | 65 | // Implements GApplication::local_command_line. 66 | static gboolean my_application_local_command_line(GApplication* application, gchar*** arguments, int* exit_status) { 67 | MyApplication* self = MY_APPLICATION(application); 68 | // Strip out the first argument as it is the binary name. 69 | self->dart_entrypoint_arguments = g_strdupv(*arguments + 1); 70 | 71 | g_autoptr(GError) error = nullptr; 72 | if (!g_application_register(application, nullptr, &error)) { 73 | g_warning("Failed to register: %s", error->message); 74 | *exit_status = 1; 75 | return TRUE; 76 | } 77 | 78 | g_application_activate(application); 79 | *exit_status = 0; 80 | 81 | return TRUE; 82 | } 83 | 84 | // Implements GObject::dispose. 85 | static void my_application_dispose(GObject* object) { 86 | MyApplication* self = MY_APPLICATION(object); 87 | g_clear_pointer(&self->dart_entrypoint_arguments, g_strfreev); 88 | G_OBJECT_CLASS(my_application_parent_class)->dispose(object); 89 | } 90 | 91 | static void my_application_class_init(MyApplicationClass* klass) { 92 | G_APPLICATION_CLASS(klass)->activate = my_application_activate; 93 | G_APPLICATION_CLASS(klass)->local_command_line = my_application_local_command_line; 94 | G_OBJECT_CLASS(klass)->dispose = my_application_dispose; 95 | } 96 | 97 | static void my_application_init(MyApplication* self) {} 98 | 99 | MyApplication* my_application_new() { 100 | return MY_APPLICATION(g_object_new(my_application_get_type(), 101 | "application-id", APPLICATION_ID, 102 | "flags", G_APPLICATION_NON_UNIQUE, 103 | nullptr)); 104 | } 105 | -------------------------------------------------------------------------------- /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 package_info_plus 9 | import path_provider_foundation 10 | import share_plus 11 | import sqflite 12 | import wakelock_macos 13 | 14 | func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) { 15 | FLTPackageInfoPlusPlugin.register(with: registry.registrar(forPlugin: "FLTPackageInfoPlusPlugin")) 16 | PathProviderPlugin.register(with: registry.registrar(forPlugin: "PathProviderPlugin")) 17 | SharePlusMacosPlugin.register(with: registry.registrar(forPlugin: "SharePlusMacosPlugin")) 18 | SqflitePlugin.register(with: registry.registrar(forPlugin: "SqflitePlugin")) 19 | WakelockMacosPlugin.register(with: registry.registrar(forPlugin: "WakelockMacosPlugin")) 20 | } 21 | -------------------------------------------------------------------------------- /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/Podfile.lock: -------------------------------------------------------------------------------- 1 | PODS: 2 | - FlutterMacOS (1.0.0) 3 | - FMDB (2.7.5): 4 | - FMDB/standard (= 2.7.5) 5 | - FMDB/standard (2.7.5) 6 | - path_provider_foundation (0.0.1): 7 | - Flutter 8 | - FlutterMacOS 9 | - share_plus (0.0.1): 10 | - FlutterMacOS 11 | - sqflite (0.0.2): 12 | - FlutterMacOS 13 | - FMDB (>= 2.7.5) 14 | - wakelock_macos (0.0.1): 15 | - FlutterMacOS 16 | 17 | DEPENDENCIES: 18 | - FlutterMacOS (from `Flutter/ephemeral`) 19 | - path_provider_foundation (from `Flutter/ephemeral/.symlinks/plugins/path_provider_foundation/macos`) 20 | - share_plus (from `Flutter/ephemeral/.symlinks/plugins/share_plus/macos`) 21 | - sqflite (from `Flutter/ephemeral/.symlinks/plugins/sqflite/macos`) 22 | - wakelock_macos (from `Flutter/ephemeral/.symlinks/plugins/wakelock_macos/macos`) 23 | 24 | SPEC REPOS: 25 | trunk: 26 | - FMDB 27 | 28 | EXTERNAL SOURCES: 29 | FlutterMacOS: 30 | :path: Flutter/ephemeral 31 | path_provider_foundation: 32 | :path: Flutter/ephemeral/.symlinks/plugins/path_provider_foundation/macos 33 | share_plus: 34 | :path: Flutter/ephemeral/.symlinks/plugins/share_plus/macos 35 | sqflite: 36 | :path: Flutter/ephemeral/.symlinks/plugins/sqflite/macos 37 | wakelock_macos: 38 | :path: Flutter/ephemeral/.symlinks/plugins/wakelock_macos/macos 39 | 40 | SPEC CHECKSUMS: 41 | FlutterMacOS: 8f6f14fa908a6fb3fba0cd85dbd81ec4b251fb24 42 | FMDB: 2ce00b547f966261cd18927a3ddb07cb6f3db82a 43 | path_provider_foundation: c68054786f1b4f3343858c1e1d0caaded73f0be9 44 | share_plus: 76dd39142738f7a68dd57b05093b5e8193f220f7 45 | sqflite: a5789cceda41d54d23f31d6de539d65bb14100ea 46 | wakelock_macos: bc3f2a9bd8d2e6c89fee1e1822e7ddac3bd004a9 47 | 48 | PODFILE CHECKSUM: 353c8bcc5d5b0994e508d035b5431cfe18c1dea7 49 | 50 | COCOAPODS: 1.11.3 51 | -------------------------------------------------------------------------------- /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/alun1/mu_hua_movie/a07e9b5078b6ed4399667aca08e15ef07240f2dc/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_1024.png -------------------------------------------------------------------------------- /macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_128.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alun1/mu_hua_movie/a07e9b5078b6ed4399667aca08e15ef07240f2dc/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_128.png -------------------------------------------------------------------------------- /macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alun1/mu_hua_movie/a07e9b5078b6ed4399667aca08e15ef07240f2dc/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_16.png -------------------------------------------------------------------------------- /macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_256.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alun1/mu_hua_movie/a07e9b5078b6ed4399667aca08e15ef07240f2dc/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_256.png -------------------------------------------------------------------------------- /macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alun1/mu_hua_movie/a07e9b5078b6ed4399667aca08e15ef07240f2dc/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_32.png -------------------------------------------------------------------------------- /macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alun1/mu_hua_movie/a07e9b5078b6ed4399667aca08e15ef07240f2dc/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_512.png -------------------------------------------------------------------------------- /macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_64.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alun1/mu_hua_movie/a07e9b5078b6ed4399667aca08e15ef07240f2dc/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 = mu_hua_movie 9 | 10 | // The application's bundle identifier 11 | PRODUCT_BUNDLE_IDENTIFIER = com.muhua.muHuaMovie 12 | 13 | // The copyright displayed in application information 14 | PRODUCT_COPYRIGHT = Copyright © 2023 com.muhua. 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 | -------------------------------------------------------------------------------- /pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: mu_hua_movie 2 | description: A new Flutter project. 3 | # The following line prevents the package from being accidentally published to 4 | # pub.dev using `flutter pub publish`. This is preferred for private packages. 5 | publish_to: 'none' # Remove this line if you wish to publish to pub.dev 6 | 7 | # The following defines the version and build number for your application. 8 | # A version number is three numbers separated by dots, like 1.2.43 9 | # followed by an optional build number separated by a +. 10 | # Both the version and the builder number may be overridden in flutter 11 | # build by specifying --build-name and --build-number, respectively. 12 | # In Android, build-name is used as versionName while build-number used as versionCode. 13 | # Read more about Android versioning at https://developer.android.com/studio/publish/versioning 14 | # In iOS, build-name is used as CFBundleShortVersionString while build-number is used as CFBundleVersion. 15 | # Read more about iOS versioning at 16 | # https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html 17 | # In Windows, build-name is used as the major, minor, and patch parts 18 | # of the product and file versions while build-number is used as the build suffix. 19 | version: 1.0.0+1 20 | 21 | environment: 22 | sdk: '>=2.19.2 <3.0.0' 23 | 24 | # Dependencies specify other packages that your package needs in order to work. 25 | # To automatically upgrade your package dependencies to the latest versions 26 | # consider running `flutter pub upgrade --major-versions`. Alternatively, 27 | # dependencies can be manually updated by changing the version numbers below to 28 | # the latest version available on pub.dev. To see which dependencies have newer 29 | # versions available, run `flutter pub outdated`. 30 | dependencies: 31 | flutter: 32 | sdk: flutter 33 | 34 | 35 | # The following adds the Cupertino Icons font to your application. 36 | # Use with the CupertinoIcons class for iOS style icons. 37 | cupertino_icons: ^1.0.2 38 | 39 | get: ^4.6.5 40 | 41 | # video_player: ^2.5.3 42 | 43 | cached_network_image: ^3.2.3 44 | 45 | flutter_cache_manager: ^3.3.0 46 | 47 | # http: ^0.13.5 48 | 49 | flutter_staggered_grid_view: ^0.6.2 50 | 51 | extended_betterplayer: ^1.0.12 52 | 53 | hive: ^2.2.3 54 | 55 | hive_flutter: ^1.1.0 56 | 57 | share_plus: ^6.3.1 58 | 59 | package_info_plus: ^3.0.3 60 | 61 | path_provider: ^2.0.13 62 | 63 | permission_handler: ^10.2.0 64 | 65 | talkingdata_sdk_plugin: 66 | path: ./talkingdata_sdk_plugin 67 | 68 | 69 | 70 | dev_dependencies: 71 | flutter_test: 72 | sdk: flutter 73 | 74 | # The "flutter_lints" package below contains a set of recommended lints to 75 | # encourage good coding practices. The lint set provided by the package is 76 | # activated in the `analysis_options.yaml` file located at the root of your 77 | # package. See that file for information about deactivating specific lint 78 | # rules and activating additional ones. 79 | flutter_lints: ^2.0.0 80 | 81 | hive_generator: 2.0.0 82 | 83 | build_runner: ^2.3.3 84 | 85 | # talkingdata_sdk_plugin: 86 | # path: ./talkingdata_sdk_plugin 87 | 88 | 89 | 90 | 91 | # For information on the generic Dart part of this file, see the 92 | # following page: https://dart.dev/tools/pub/pubspec 93 | 94 | # The following section is specific to Flutter packages. 95 | flutter: 96 | 97 | # The following line ensures that the Material Icons font is 98 | # included with your application, so that you can use the icons in 99 | # the material Icons class. 100 | uses-material-design: true 101 | 102 | # To add assets to your application, add an assets section, like this: 103 | # assets: 104 | # - images/a_dot_burr.jpeg 105 | # - images/a_dot_ham.jpeg 106 | 107 | # An image asset can refer to one or more resolution-specific "variants", see 108 | # https://flutter.dev/assets-and-images/#resolution-aware 109 | 110 | # For details regarding adding assets from package dependencies, see 111 | # https://flutter.dev/assets-and-images/#from-packages 112 | 113 | # To add custom fonts to your application, add a fonts section here, 114 | # in this "flutter" section. Each entry in this list should have a 115 | # "family" key with the font family name, and a "fonts" key with a 116 | # list giving the asset and other descriptors for the font. For 117 | # example: 118 | # fonts: 119 | # - family: Schyler 120 | # fonts: 121 | # - asset: fonts/Schyler-Regular.ttf 122 | # - asset: fonts/Schyler-Italic.ttf 123 | # style: italic 124 | # - family: Trajan Pro 125 | # fonts: 126 | # - asset: fonts/TrajanPro.ttf 127 | # - asset: fonts/TrajanPro_Bold.ttf 128 | # weight: 700 129 | # 130 | # For details regarding fonts from package dependencies, 131 | # see https://flutter.dev/custom-fonts/#from-packages 132 | -------------------------------------------------------------------------------- /screenshot/Screenshot_1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alun1/mu_hua_movie/a07e9b5078b6ed4399667aca08e15ef07240f2dc/screenshot/Screenshot_1.jpg -------------------------------------------------------------------------------- /screenshot/Screenshot_2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alun1/mu_hua_movie/a07e9b5078b6ed4399667aca08e15ef07240f2dc/screenshot/Screenshot_2.jpg -------------------------------------------------------------------------------- /talkingdata_sdk_plugin/CHANGELOG.md: -------------------------------------------------------------------------------- 1 | ## 0.0.1 2 | 3 | * Initial version 4 | -------------------------------------------------------------------------------- /talkingdata_sdk_plugin/analysis_options.yaml: -------------------------------------------------------------------------------- 1 | include: package:flutter_lints/flutter.yaml 2 | 3 | # Additional information about this file can be found at 4 | # https://dart.dev/guides/language/analysis-options 5 | -------------------------------------------------------------------------------- /talkingdata_sdk_plugin/android/.gitignore: -------------------------------------------------------------------------------- 1 | *.iml 2 | .gradle 3 | /local.properties 4 | /.idea/workspace.xml 5 | /.idea/libraries 6 | .DS_Store 7 | /build 8 | /captures 9 | -------------------------------------------------------------------------------- /talkingdata_sdk_plugin/android/build.gradle: -------------------------------------------------------------------------------- 1 | group 'com.talkingdata.talkingdata_sdk_plugin' 2 | version '1.0' 3 | 4 | buildscript { 5 | repositories { 6 | google() 7 | mavenCentral() 8 | } 9 | 10 | dependencies { 11 | classpath 'com.android.tools.build:gradle:7.3.1' 12 | } 13 | } 14 | 15 | rootProject.allprojects { 16 | repositories { 17 | google() 18 | mavenCentral() 19 | } 20 | } 21 | 22 | apply plugin: 'com.android.library' 23 | 24 | android { 25 | compileSdkVersion 31 26 | 27 | compileOptions { 28 | sourceCompatibility JavaVersion.VERSION_1_8 29 | targetCompatibility JavaVersion.VERSION_1_8 30 | } 31 | 32 | defaultConfig { 33 | minSdkVersion 16 34 | } 35 | } 36 | dependencies { 37 | implementation fileTree(dir: 'libs', include: ['*.jar']) 38 | // implementation files('libs/SaaS_TalkingDataSDK_Android_V5.0.13.jar') 39 | } -------------------------------------------------------------------------------- /talkingdata_sdk_plugin/android/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alun1/mu_hua_movie/a07e9b5078b6ed4399667aca08e15ef07240f2dc/talkingdata_sdk_plugin/android/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /talkingdata_sdk_plugin/android/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionBase=GRADLE_USER_HOME 2 | distributionPath=wrapper/dists 3 | distributionUrl=https\://services.gradle.org/distributions/gradle-7.4-bin.zip 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | -------------------------------------------------------------------------------- /talkingdata_sdk_plugin/android/gradlew.bat: -------------------------------------------------------------------------------- 1 | @rem 2 | @rem Copyright 2015 the original author or authors. 3 | @rem 4 | @rem Licensed under the Apache License, Version 2.0 (the "License"); 5 | @rem you may not use this file except in compliance with the License. 6 | @rem You may obtain a copy of the License at 7 | @rem 8 | @rem https://www.apache.org/licenses/LICENSE-2.0 9 | @rem 10 | @rem Unless required by applicable law or agreed to in writing, software 11 | @rem distributed under the License is distributed on an "AS IS" BASIS, 12 | @rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | @rem See the License for the specific language governing permissions and 14 | @rem limitations under the License. 15 | @rem 16 | 17 | @if "%DEBUG%" == "" @echo off 18 | @rem ########################################################################## 19 | @rem 20 | @rem Gradle startup script for Windows 21 | @rem 22 | @rem ########################################################################## 23 | 24 | @rem Set local scope for the variables with windows NT shell 25 | if "%OS%"=="Windows_NT" setlocal 26 | 27 | set DIRNAME=%~dp0 28 | if "%DIRNAME%" == "" set DIRNAME=. 29 | set APP_BASE_NAME=%~n0 30 | set APP_HOME=%DIRNAME% 31 | 32 | @rem Resolve any "." and ".." in APP_HOME to make it shorter. 33 | for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi 34 | 35 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 36 | set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" 37 | 38 | @rem Find java.exe 39 | if defined JAVA_HOME goto findJavaFromJavaHome 40 | 41 | set JAVA_EXE=java.exe 42 | %JAVA_EXE% -version >NUL 2>&1 43 | if "%ERRORLEVEL%" == "0" goto execute 44 | 45 | echo. 46 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 47 | echo. 48 | echo Please set the JAVA_HOME variable in your environment to match the 49 | echo location of your Java installation. 50 | 51 | goto fail 52 | 53 | :findJavaFromJavaHome 54 | set JAVA_HOME=%JAVA_HOME:"=% 55 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe 56 | 57 | if exist "%JAVA_EXE%" goto execute 58 | 59 | echo. 60 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 61 | echo. 62 | echo Please set the JAVA_HOME variable in your environment to match the 63 | echo location of your Java installation. 64 | 65 | goto fail 66 | 67 | :execute 68 | @rem Setup the command line 69 | 70 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar 71 | 72 | 73 | @rem Execute Gradle 74 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* 75 | 76 | :end 77 | @rem End local scope for the variables with windows NT shell 78 | if "%ERRORLEVEL%"=="0" goto mainEnd 79 | 80 | :fail 81 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of 82 | rem the _cmd.exe /c_ return code! 83 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 84 | exit /b 1 85 | 86 | :mainEnd 87 | if "%OS%"=="Windows_NT" endlocal 88 | 89 | :omega 90 | -------------------------------------------------------------------------------- /talkingdata_sdk_plugin/android/libs/SaaS_TalkingDataSDK_Android_V5.0.13.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alun1/mu_hua_movie/a07e9b5078b6ed4399667aca08e15ef07240f2dc/talkingdata_sdk_plugin/android/libs/SaaS_TalkingDataSDK_Android_V5.0.13.jar -------------------------------------------------------------------------------- /talkingdata_sdk_plugin/android/settings.gradle: -------------------------------------------------------------------------------- 1 | rootProject.name = 'talkingdata_sdk_plugin' 2 | 3 | -------------------------------------------------------------------------------- /talkingdata_sdk_plugin/android/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 4 | -------------------------------------------------------------------------------- /talkingdata_sdk_plugin/ios/.gitignore: -------------------------------------------------------------------------------- 1 | .idea/ 2 | .vagrant/ 3 | .sconsign.dblite 4 | .svn/ 5 | 6 | .DS_Store 7 | *.swp 8 | profile 9 | 10 | DerivedData/ 11 | build/ 12 | GeneratedPluginRegistrant.h 13 | GeneratedPluginRegistrant.m 14 | 15 | .generated/ 16 | 17 | *.pbxuser 18 | *.mode1v3 19 | *.mode2v3 20 | *.perspectivev3 21 | 22 | !default.pbxuser 23 | !default.mode1v3 24 | !default.mode2v3 25 | !default.perspectivev3 26 | 27 | xcuserdata 28 | 29 | *.moved-aside 30 | 31 | *.pyc 32 | *sync/ 33 | Icon? 34 | .tags* 35 | 36 | /Flutter/Generated.xcconfig 37 | -------------------------------------------------------------------------------- /talkingdata_sdk_plugin/ios/Assets/libTalkingDataSDK.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alun1/mu_hua_movie/a07e9b5078b6ed4399667aca08e15ef07240f2dc/talkingdata_sdk_plugin/ios/Assets/libTalkingDataSDK.a -------------------------------------------------------------------------------- /talkingdata_sdk_plugin/ios/Classes/TalkingDataSDKPlugin.h: -------------------------------------------------------------------------------- 1 | #import 2 | 3 | @interface TalkingDataSDKPlugin : NSObject 4 | /// SDK初始化 5 | + (void)init:(NSString*)appId channelId:(NSString*)channelId custom:(NSString *)custom; 6 | @end 7 | -------------------------------------------------------------------------------- /talkingdata_sdk_plugin/ios/talkingdata_sdk_plugin.podspec: -------------------------------------------------------------------------------- 1 | # 2 | # To learn more about a Podspec see http://guides.cocoapods.org/syntax/podspec.html. 3 | # Run `pod lib lint talkingdata_sdk_plugin.podspec` to validate before publishing. 4 | # 5 | Pod::Spec.new do |s| 6 | s.name = 'talkingdata_sdk_plugin' 7 | s.version = '0.0.1' 8 | s.summary = 'TalkingData SDK Flutter plugin.' 9 | s.description = <<-DESC 10 | TalkingData SDK Flutter plugin. 11 | DESC 12 | s.homepage = 'http://example.com' 13 | s.license = { :file => '../LICENSE' } 14 | s.author = { 'Your Company' => 'email@example.com' } 15 | s.source = { :path => '.' } 16 | s.source_files = 'Classes/**/*' 17 | s.public_header_files = 'Classes/**/*.h' 18 | s.dependency 'Flutter' 19 | s.platform = :ios, '9.0' 20 | s.vendored_libraries = 'Assets/*.a' 21 | s.libraries = 'c++', 'z' 22 | # Flutter.framework does not contain a i386 slice. 23 | s.pod_target_xcconfig = { 'DEFINES_MODULE' => 'YES', 'EXCLUDED_ARCHS[sdk=iphonesimulator*]' => 'i386' } 24 | end 25 | -------------------------------------------------------------------------------- /talkingdata_sdk_plugin/pubspec.lock: -------------------------------------------------------------------------------- 1 | # Generated by pub 2 | # See https://dart.dev/tools/pub/glossary#lockfile 3 | packages: 4 | async: 5 | dependency: transitive 6 | description: 7 | name: async 8 | sha256: bfe67ef28df125b7dddcea62755991f807aa39a2492a23e1550161692950bbe0 9 | url: "https://pub.dev" 10 | source: hosted 11 | version: "2.10.0" 12 | boolean_selector: 13 | dependency: transitive 14 | description: 15 | name: boolean_selector 16 | sha256: "6cfb5af12253eaf2b368f07bacc5a80d1301a071c73360d746b7f2e32d762c66" 17 | url: "https://pub.dev" 18 | source: hosted 19 | version: "2.1.1" 20 | characters: 21 | dependency: transitive 22 | description: 23 | name: characters 24 | sha256: e6a326c8af69605aec75ed6c187d06b349707a27fbff8222ca9cc2cff167975c 25 | url: "https://pub.dev" 26 | source: hosted 27 | version: "1.2.1" 28 | clock: 29 | dependency: transitive 30 | description: 31 | name: clock 32 | sha256: cb6d7f03e1de671e34607e909a7213e31d7752be4fb66a86d29fe1eb14bfb5cf 33 | url: "https://pub.dev" 34 | source: hosted 35 | version: "1.1.1" 36 | collection: 37 | dependency: transitive 38 | description: 39 | name: collection 40 | sha256: cfc915e6923fe5ce6e153b0723c753045de46de1b4d63771530504004a45fae0 41 | url: "https://pub.dev" 42 | source: hosted 43 | version: "1.17.0" 44 | fake_async: 45 | dependency: transitive 46 | description: 47 | name: fake_async 48 | sha256: "511392330127add0b769b75a987850d136345d9227c6b94c96a04cf4a391bf78" 49 | url: "https://pub.dev" 50 | source: hosted 51 | version: "1.3.1" 52 | flutter: 53 | dependency: "direct main" 54 | description: flutter 55 | source: sdk 56 | version: "0.0.0" 57 | flutter_lints: 58 | dependency: "direct dev" 59 | description: 60 | name: flutter_lints 61 | sha256: b543301ad291598523947dc534aaddc5aaad597b709d2426d3a0e0d44c5cb493 62 | url: "https://pub.dev" 63 | source: hosted 64 | version: "1.0.4" 65 | flutter_test: 66 | dependency: "direct dev" 67 | description: flutter 68 | source: sdk 69 | version: "0.0.0" 70 | js: 71 | dependency: transitive 72 | description: 73 | name: js 74 | sha256: "5528c2f391ededb7775ec1daa69e65a2d61276f7552de2b5f7b8d34ee9fd4ab7" 75 | url: "https://pub.dev" 76 | source: hosted 77 | version: "0.6.5" 78 | lints: 79 | dependency: transitive 80 | description: 81 | name: lints 82 | sha256: a2c3d198cb5ea2e179926622d433331d8b58374ab8f29cdda6e863bd62fd369c 83 | url: "https://pub.dev" 84 | source: hosted 85 | version: "1.0.1" 86 | matcher: 87 | dependency: transitive 88 | description: 89 | name: matcher 90 | sha256: "16db949ceee371e9b99d22f88fa3a73c4e59fd0afed0bd25fc336eb76c198b72" 91 | url: "https://pub.dev" 92 | source: hosted 93 | version: "0.12.13" 94 | material_color_utilities: 95 | dependency: transitive 96 | description: 97 | name: material_color_utilities 98 | sha256: d92141dc6fe1dad30722f9aa826c7fbc896d021d792f80678280601aff8cf724 99 | url: "https://pub.dev" 100 | source: hosted 101 | version: "0.2.0" 102 | meta: 103 | dependency: transitive 104 | description: 105 | name: meta 106 | sha256: "6c268b42ed578a53088d834796959e4a1814b5e9e164f147f580a386e5decf42" 107 | url: "https://pub.dev" 108 | source: hosted 109 | version: "1.8.0" 110 | path: 111 | dependency: transitive 112 | description: 113 | name: path 114 | sha256: db9d4f58c908a4ba5953fcee2ae317c94889433e5024c27ce74a37f94267945b 115 | url: "https://pub.dev" 116 | source: hosted 117 | version: "1.8.2" 118 | sky_engine: 119 | dependency: transitive 120 | description: flutter 121 | source: sdk 122 | version: "0.0.99" 123 | source_span: 124 | dependency: transitive 125 | description: 126 | name: source_span 127 | sha256: dd904f795d4b4f3b870833847c461801f6750a9fa8e61ea5ac53f9422b31f250 128 | url: "https://pub.dev" 129 | source: hosted 130 | version: "1.9.1" 131 | stack_trace: 132 | dependency: transitive 133 | description: 134 | name: stack_trace 135 | sha256: c3c7d8edb15bee7f0f74debd4b9c5f3c2ea86766fe4178eb2a18eb30a0bdaed5 136 | url: "https://pub.dev" 137 | source: hosted 138 | version: "1.11.0" 139 | stream_channel: 140 | dependency: transitive 141 | description: 142 | name: stream_channel 143 | sha256: "83615bee9045c1d322bbbd1ba209b7a749c2cbcdcb3fdd1df8eb488b3279c1c8" 144 | url: "https://pub.dev" 145 | source: hosted 146 | version: "2.1.1" 147 | string_scanner: 148 | dependency: transitive 149 | description: 150 | name: string_scanner 151 | sha256: "556692adab6cfa87322a115640c11f13cb77b3f076ddcc5d6ae3c20242bedcde" 152 | url: "https://pub.dev" 153 | source: hosted 154 | version: "1.2.0" 155 | term_glyph: 156 | dependency: transitive 157 | description: 158 | name: term_glyph 159 | sha256: a29248a84fbb7c79282b40b8c72a1209db169a2e0542bce341da992fe1bc7e84 160 | url: "https://pub.dev" 161 | source: hosted 162 | version: "1.2.1" 163 | test_api: 164 | dependency: transitive 165 | description: 166 | name: test_api 167 | sha256: ad540f65f92caa91bf21dfc8ffb8c589d6e4dc0c2267818b4cc2792857706206 168 | url: "https://pub.dev" 169 | source: hosted 170 | version: "0.4.16" 171 | vector_math: 172 | dependency: transitive 173 | description: 174 | name: vector_math 175 | sha256: "80b3257d1492ce4d091729e3a67a60407d227c27241d6927be0130c98e741803" 176 | url: "https://pub.dev" 177 | source: hosted 178 | version: "2.1.4" 179 | sdks: 180 | dart: ">=2.19.2 <3.0.0" 181 | -------------------------------------------------------------------------------- /talkingdata_sdk_plugin/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: talkingdata_sdk_plugin 2 | description: TalkingData SDK Flutter plugin. 3 | version: 0.0.1 4 | homepage: 5 | 6 | environment: 7 | sdk: '>=2.19.2 <3.0.0' 8 | flutter: '>=2.2.3' 9 | 10 | dependencies: 11 | flutter: 12 | sdk: flutter 13 | 14 | dev_dependencies: 15 | flutter_test: 16 | sdk: flutter 17 | flutter_lints: ^1.0.0 18 | 19 | # For information on the generic Dart part of this file, see the 20 | # following page: https://dart.dev/tools/pub/pubspec 21 | 22 | # The following section is specific to Flutter. 23 | flutter: 24 | # This section identifies this Flutter project as a plugin project. 25 | # The 'pluginClass' and Android 'package' identifiers should not ordinarily 26 | # be modified. They are used by the tooling to maintain consistency when 27 | # adding or updating assets for this project. 28 | plugin: 29 | platforms: 30 | android: 31 | package: com.talkingdata.talkingdata_sdk_plugin 32 | pluginClass: TalkingDataSDKPlugin 33 | ios: 34 | pluginClass: TalkingDataSDKPlugin 35 | 36 | # To add assets to your plugin package, add an assets section, like this: 37 | # assets: 38 | # - images/a_dot_burr.jpeg 39 | # - images/a_dot_ham.jpeg 40 | # 41 | # For details regarding assets in packages, see 42 | # https://flutter.dev/assets-and-images/#from-packages 43 | # 44 | # An image asset can refer to one or more resolution-specific "variants", see 45 | # https://flutter.dev/assets-and-images/#resolution-aware. 46 | 47 | # To add custom fonts to your plugin package, add a fonts section here, 48 | # in this "flutter" section. Each entry in this list should have a 49 | # "family" key with the font family name, and a "fonts" key with a 50 | # list giving the asset and other descriptors for the font. For 51 | # example: 52 | # fonts: 53 | # - family: Schyler 54 | # fonts: 55 | # - asset: fonts/Schyler-Regular.ttf 56 | # - asset: fonts/Schyler-Italic.ttf 57 | # style: italic 58 | # - family: Trajan Pro 59 | # fonts: 60 | # - asset: fonts/TrajanPro.ttf 61 | # - asset: fonts/TrajanPro_Bold.ttf 62 | # weight: 700 63 | # 64 | # For details regarding fonts in packages, see 65 | # https://flutter.dev/custom-fonts/#from-packages 66 | -------------------------------------------------------------------------------- /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:mu_hua_movie/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/alun1/mu_hua_movie/a07e9b5078b6ed4399667aca08e15ef07240f2dc/web/favicon.png -------------------------------------------------------------------------------- /web/icons/Icon-192.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alun1/mu_hua_movie/a07e9b5078b6ed4399667aca08e15ef07240f2dc/web/icons/Icon-192.png -------------------------------------------------------------------------------- /web/icons/Icon-512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alun1/mu_hua_movie/a07e9b5078b6ed4399667aca08e15ef07240f2dc/web/icons/Icon-512.png -------------------------------------------------------------------------------- /web/icons/Icon-maskable-192.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alun1/mu_hua_movie/a07e9b5078b6ed4399667aca08e15ef07240f2dc/web/icons/Icon-maskable-192.png -------------------------------------------------------------------------------- /web/icons/Icon-maskable-512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alun1/mu_hua_movie/a07e9b5078b6ed4399667aca08e15ef07240f2dc/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 | mu_hua_movie 33 | 34 | 35 | 39 | 40 | 41 | 42 | 43 | 58 | 59 | 60 | -------------------------------------------------------------------------------- /web/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "mu_hua_movie", 3 | "short_name": "mu_hua_movie", 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/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Project-level configuration. 2 | cmake_minimum_required(VERSION 3.14) 3 | project(mu_hua_movie LANGUAGES CXX) 4 | 5 | # The name of the executable created for the application. Change this to change 6 | # the on-disk name of your application. 7 | set(BINARY_NAME "mu_hua_movie") 8 | 9 | # Explicitly opt in to modern CMake behaviors to avoid warnings with recent 10 | # versions of CMake. 11 | cmake_policy(SET CMP0063 NEW) 12 | 13 | # Define build configuration option. 14 | get_property(IS_MULTICONFIG GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG) 15 | if(IS_MULTICONFIG) 16 | set(CMAKE_CONFIGURATION_TYPES "Debug;Profile;Release" 17 | CACHE STRING "" FORCE) 18 | else() 19 | if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES) 20 | set(CMAKE_BUILD_TYPE "Debug" CACHE 21 | STRING "Flutter build mode" FORCE) 22 | set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS 23 | "Debug" "Profile" "Release") 24 | endif() 25 | endif() 26 | # Define settings for the Profile build mode. 27 | set(CMAKE_EXE_LINKER_FLAGS_PROFILE "${CMAKE_EXE_LINKER_FLAGS_RELEASE}") 28 | set(CMAKE_SHARED_LINKER_FLAGS_PROFILE "${CMAKE_SHARED_LINKER_FLAGS_RELEASE}") 29 | set(CMAKE_C_FLAGS_PROFILE "${CMAKE_C_FLAGS_RELEASE}") 30 | set(CMAKE_CXX_FLAGS_PROFILE "${CMAKE_CXX_FLAGS_RELEASE}") 31 | 32 | # Use Unicode for all projects. 33 | add_definitions(-DUNICODE -D_UNICODE) 34 | 35 | # Compilation settings that should be applied to most targets. 36 | # 37 | # Be cautious about adding new options here, as plugins use this function by 38 | # default. In most cases, you should add new options to specific targets instead 39 | # of modifying this function. 40 | function(APPLY_STANDARD_SETTINGS TARGET) 41 | target_compile_features(${TARGET} PUBLIC cxx_std_17) 42 | target_compile_options(${TARGET} PRIVATE /W4 /WX /wd"4100") 43 | target_compile_options(${TARGET} PRIVATE /EHsc) 44 | target_compile_definitions(${TARGET} PRIVATE "_HAS_EXCEPTIONS=0") 45 | target_compile_definitions(${TARGET} PRIVATE "$<$:_DEBUG>") 46 | endfunction() 47 | 48 | # Flutter library and tool build rules. 49 | set(FLUTTER_MANAGED_DIR "${CMAKE_CURRENT_SOURCE_DIR}/flutter") 50 | add_subdirectory(${FLUTTER_MANAGED_DIR}) 51 | 52 | # Application build; see runner/CMakeLists.txt. 53 | add_subdirectory("runner") 54 | 55 | # Generated plugin build rules, which manage building the plugins and adding 56 | # them to the application. 57 | include(flutter/generated_plugins.cmake) 58 | 59 | 60 | # === Installation === 61 | # Support files are copied into place next to the executable, so that it can 62 | # run in place. This is done instead of making a separate bundle (as on Linux) 63 | # so that building and running from within Visual Studio will work. 64 | set(BUILD_BUNDLE_DIR "$") 65 | # Make the "install" step default, as it's required to run. 66 | set(CMAKE_VS_INCLUDE_INSTALL_TO_DEFAULT_BUILD 1) 67 | if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT) 68 | set(CMAKE_INSTALL_PREFIX "${BUILD_BUNDLE_DIR}" CACHE PATH "..." FORCE) 69 | endif() 70 | 71 | set(INSTALL_BUNDLE_DATA_DIR "${CMAKE_INSTALL_PREFIX}/data") 72 | set(INSTALL_BUNDLE_LIB_DIR "${CMAKE_INSTALL_PREFIX}") 73 | 74 | install(TARGETS ${BINARY_NAME} RUNTIME DESTINATION "${CMAKE_INSTALL_PREFIX}" 75 | COMPONENT Runtime) 76 | 77 | install(FILES "${FLUTTER_ICU_DATA_FILE}" DESTINATION "${INSTALL_BUNDLE_DATA_DIR}" 78 | COMPONENT Runtime) 79 | 80 | install(FILES "${FLUTTER_LIBRARY}" DESTINATION "${INSTALL_BUNDLE_LIB_DIR}" 81 | COMPONENT Runtime) 82 | 83 | if(PLUGIN_BUNDLED_LIBRARIES) 84 | install(FILES "${PLUGIN_BUNDLED_LIBRARIES}" 85 | DESTINATION "${INSTALL_BUNDLE_LIB_DIR}" 86 | COMPONENT Runtime) 87 | endif() 88 | 89 | # Fully re-copy the assets directory on each build to avoid having stale files 90 | # from a previous install. 91 | set(FLUTTER_ASSET_DIR_NAME "flutter_assets") 92 | install(CODE " 93 | file(REMOVE_RECURSE \"${INSTALL_BUNDLE_DATA_DIR}/${FLUTTER_ASSET_DIR_NAME}\") 94 | " COMPONENT Runtime) 95 | install(DIRECTORY "${PROJECT_BUILD_DIR}/${FLUTTER_ASSET_DIR_NAME}" 96 | DESTINATION "${INSTALL_BUNDLE_DATA_DIR}" COMPONENT Runtime) 97 | 98 | # Install the AOT library on non-Debug builds only. 99 | install(FILES "${AOT_LIBRARY}" DESTINATION "${INSTALL_BUNDLE_DATA_DIR}" 100 | CONFIGURATIONS Profile;Release 101 | COMPONENT Runtime) 102 | -------------------------------------------------------------------------------- /windows/flutter/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # This file controls Flutter-level build steps. It should not be edited. 2 | cmake_minimum_required(VERSION 3.14) 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 | set(WRAPPER_ROOT "${EPHEMERAL_DIR}/cpp_client_wrapper") 12 | 13 | # === Flutter Library === 14 | set(FLUTTER_LIBRARY "${EPHEMERAL_DIR}/flutter_windows.dll") 15 | 16 | # Published to parent scope for install step. 17 | set(FLUTTER_LIBRARY ${FLUTTER_LIBRARY} PARENT_SCOPE) 18 | set(FLUTTER_ICU_DATA_FILE "${EPHEMERAL_DIR}/icudtl.dat" PARENT_SCOPE) 19 | set(PROJECT_BUILD_DIR "${PROJECT_DIR}/build/" PARENT_SCOPE) 20 | set(AOT_LIBRARY "${PROJECT_DIR}/build/windows/app.so" PARENT_SCOPE) 21 | 22 | list(APPEND FLUTTER_LIBRARY_HEADERS 23 | "flutter_export.h" 24 | "flutter_windows.h" 25 | "flutter_messenger.h" 26 | "flutter_plugin_registrar.h" 27 | "flutter_texture_registrar.h" 28 | ) 29 | list(TRANSFORM FLUTTER_LIBRARY_HEADERS PREPEND "${EPHEMERAL_DIR}/") 30 | add_library(flutter INTERFACE) 31 | target_include_directories(flutter INTERFACE 32 | "${EPHEMERAL_DIR}" 33 | ) 34 | target_link_libraries(flutter INTERFACE "${FLUTTER_LIBRARY}.lib") 35 | add_dependencies(flutter flutter_assemble) 36 | 37 | # === Wrapper === 38 | list(APPEND CPP_WRAPPER_SOURCES_CORE 39 | "core_implementations.cc" 40 | "standard_codec.cc" 41 | ) 42 | list(TRANSFORM CPP_WRAPPER_SOURCES_CORE PREPEND "${WRAPPER_ROOT}/") 43 | list(APPEND CPP_WRAPPER_SOURCES_PLUGIN 44 | "plugin_registrar.cc" 45 | ) 46 | list(TRANSFORM CPP_WRAPPER_SOURCES_PLUGIN PREPEND "${WRAPPER_ROOT}/") 47 | list(APPEND CPP_WRAPPER_SOURCES_APP 48 | "flutter_engine.cc" 49 | "flutter_view_controller.cc" 50 | ) 51 | list(TRANSFORM CPP_WRAPPER_SOURCES_APP PREPEND "${WRAPPER_ROOT}/") 52 | 53 | # Wrapper sources needed for a plugin. 54 | add_library(flutter_wrapper_plugin STATIC 55 | ${CPP_WRAPPER_SOURCES_CORE} 56 | ${CPP_WRAPPER_SOURCES_PLUGIN} 57 | ) 58 | apply_standard_settings(flutter_wrapper_plugin) 59 | set_target_properties(flutter_wrapper_plugin PROPERTIES 60 | POSITION_INDEPENDENT_CODE ON) 61 | set_target_properties(flutter_wrapper_plugin PROPERTIES 62 | CXX_VISIBILITY_PRESET hidden) 63 | target_link_libraries(flutter_wrapper_plugin PUBLIC flutter) 64 | target_include_directories(flutter_wrapper_plugin PUBLIC 65 | "${WRAPPER_ROOT}/include" 66 | ) 67 | add_dependencies(flutter_wrapper_plugin flutter_assemble) 68 | 69 | # Wrapper sources needed for the runner. 70 | add_library(flutter_wrapper_app STATIC 71 | ${CPP_WRAPPER_SOURCES_CORE} 72 | ${CPP_WRAPPER_SOURCES_APP} 73 | ) 74 | apply_standard_settings(flutter_wrapper_app) 75 | target_link_libraries(flutter_wrapper_app PUBLIC flutter) 76 | target_include_directories(flutter_wrapper_app PUBLIC 77 | "${WRAPPER_ROOT}/include" 78 | ) 79 | add_dependencies(flutter_wrapper_app flutter_assemble) 80 | 81 | # === Flutter tool backend === 82 | # _phony_ is a non-existent file to force this command to run every time, 83 | # since currently there's no way to get a full input/output list from the 84 | # flutter tool. 85 | set(PHONY_OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/_phony_") 86 | set_source_files_properties("${PHONY_OUTPUT}" PROPERTIES SYMBOLIC TRUE) 87 | add_custom_command( 88 | OUTPUT ${FLUTTER_LIBRARY} ${FLUTTER_LIBRARY_HEADERS} 89 | ${CPP_WRAPPER_SOURCES_CORE} ${CPP_WRAPPER_SOURCES_PLUGIN} 90 | ${CPP_WRAPPER_SOURCES_APP} 91 | ${PHONY_OUTPUT} 92 | COMMAND ${CMAKE_COMMAND} -E env 93 | ${FLUTTER_TOOL_ENVIRONMENT} 94 | "${FLUTTER_ROOT}/packages/flutter_tools/bin/tool_backend.bat" 95 | windows-x64 $ 96 | VERBATIM 97 | ) 98 | add_custom_target(flutter_assemble DEPENDS 99 | "${FLUTTER_LIBRARY}" 100 | ${FLUTTER_LIBRARY_HEADERS} 101 | ${CPP_WRAPPER_SOURCES_CORE} 102 | ${CPP_WRAPPER_SOURCES_PLUGIN} 103 | ${CPP_WRAPPER_SOURCES_APP} 104 | ) 105 | -------------------------------------------------------------------------------- /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 | 13 | void RegisterPlugins(flutter::PluginRegistry* registry) { 14 | PermissionHandlerWindowsPluginRegisterWithRegistrar( 15 | registry->GetRegistrarForPlugin("PermissionHandlerWindowsPlugin")); 16 | SharePlusWindowsPluginCApiRegisterWithRegistrar( 17 | registry->GetRegistrarForPlugin("SharePlusWindowsPluginCApi")); 18 | UrlLauncherWindowsRegisterWithRegistrar( 19 | registry->GetRegistrarForPlugin("UrlLauncherWindows")); 20 | } 21 | -------------------------------------------------------------------------------- /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 | permission_handler_windows 7 | share_plus 8 | url_launcher_windows 9 | ) 10 | 11 | list(APPEND FLUTTER_FFI_PLUGIN_LIST 12 | ) 13 | 14 | set(PLUGIN_BUNDLED_LIBRARIES) 15 | 16 | foreach(plugin ${FLUTTER_PLUGIN_LIST}) 17 | add_subdirectory(flutter/ephemeral/.plugin_symlinks/${plugin}/windows plugins/${plugin}) 18 | target_link_libraries(${BINARY_NAME} PRIVATE ${plugin}_plugin) 19 | list(APPEND PLUGIN_BUNDLED_LIBRARIES $) 20 | list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${plugin}_bundled_libraries}) 21 | endforeach(plugin) 22 | 23 | foreach(ffi_plugin ${FLUTTER_FFI_PLUGIN_LIST}) 24 | add_subdirectory(flutter/ephemeral/.plugin_symlinks/${ffi_plugin}/windows plugins/${ffi_plugin}) 25 | list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${ffi_plugin}_bundled_libraries}) 26 | endforeach(ffi_plugin) 27 | -------------------------------------------------------------------------------- /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_link_libraries(${BINARY_NAME} PRIVATE "dwmapi.lib") 37 | target_include_directories(${BINARY_NAME} PRIVATE "${CMAKE_SOURCE_DIR}") 38 | 39 | # Run the Flutter tool portions of the build. This must not be removed. 40 | add_dependencies(${BINARY_NAME} flutter_assemble) 41 | -------------------------------------------------------------------------------- /windows/runner/Runner.rc: -------------------------------------------------------------------------------- 1 | // Microsoft Visual C++ generated resource script. 2 | // 3 | #pragma code_page(65001) 4 | #include "resource.h" 5 | 6 | #define APSTUDIO_READONLY_SYMBOLS 7 | ///////////////////////////////////////////////////////////////////////////// 8 | // 9 | // Generated from the TEXTINCLUDE 2 resource. 10 | // 11 | #include "winres.h" 12 | 13 | ///////////////////////////////////////////////////////////////////////////// 14 | #undef APSTUDIO_READONLY_SYMBOLS 15 | 16 | ///////////////////////////////////////////////////////////////////////////// 17 | // English (United States) resources 18 | 19 | #if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) 20 | LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US 21 | 22 | #ifdef APSTUDIO_INVOKED 23 | ///////////////////////////////////////////////////////////////////////////// 24 | // 25 | // TEXTINCLUDE 26 | // 27 | 28 | 1 TEXTINCLUDE 29 | BEGIN 30 | "resource.h\0" 31 | END 32 | 33 | 2 TEXTINCLUDE 34 | BEGIN 35 | "#include ""winres.h""\r\n" 36 | "\0" 37 | END 38 | 39 | 3 TEXTINCLUDE 40 | BEGIN 41 | "\r\n" 42 | "\0" 43 | END 44 | 45 | #endif // APSTUDIO_INVOKED 46 | 47 | 48 | ///////////////////////////////////////////////////////////////////////////// 49 | // 50 | // Icon 51 | // 52 | 53 | // Icon with lowest ID value placed first to ensure application icon 54 | // remains consistent on all systems. 55 | IDI_APP_ICON ICON "resources\\app_icon.ico" 56 | 57 | 58 | ///////////////////////////////////////////////////////////////////////////// 59 | // 60 | // Version 61 | // 62 | 63 | #if defined(FLUTTER_VERSION_MAJOR) && defined(FLUTTER_VERSION_MINOR) && defined(FLUTTER_VERSION_PATCH) && defined(FLUTTER_VERSION_BUILD) 64 | #define VERSION_AS_NUMBER FLUTTER_VERSION_MAJOR,FLUTTER_VERSION_MINOR,FLUTTER_VERSION_PATCH,FLUTTER_VERSION_BUILD 65 | #else 66 | #define VERSION_AS_NUMBER 1,0,0,0 67 | #endif 68 | 69 | #if defined(FLUTTER_VERSION) 70 | #define VERSION_AS_STRING FLUTTER_VERSION 71 | #else 72 | #define VERSION_AS_STRING "1.0.0" 73 | #endif 74 | 75 | VS_VERSION_INFO VERSIONINFO 76 | FILEVERSION VERSION_AS_NUMBER 77 | PRODUCTVERSION VERSION_AS_NUMBER 78 | FILEFLAGSMASK VS_FFI_FILEFLAGSMASK 79 | #ifdef _DEBUG 80 | FILEFLAGS VS_FF_DEBUG 81 | #else 82 | FILEFLAGS 0x0L 83 | #endif 84 | FILEOS VOS__WINDOWS32 85 | FILETYPE VFT_APP 86 | FILESUBTYPE 0x0L 87 | BEGIN 88 | BLOCK "StringFileInfo" 89 | BEGIN 90 | BLOCK "040904e4" 91 | BEGIN 92 | VALUE "CompanyName", "com.muhua" "\0" 93 | VALUE "FileDescription", "mu_hua_movie" "\0" 94 | VALUE "FileVersion", VERSION_AS_STRING "\0" 95 | VALUE "InternalName", "mu_hua_movie" "\0" 96 | VALUE "LegalCopyright", "Copyright (C) 2023 com.muhua. All rights reserved." "\0" 97 | VALUE "OriginalFilename", "mu_hua_movie.exe" "\0" 98 | VALUE "ProductName", "mu_hua_movie" "\0" 99 | VALUE "ProductVersion", VERSION_AS_STRING "\0" 100 | END 101 | END 102 | BLOCK "VarFileInfo" 103 | BEGIN 104 | VALUE "Translation", 0x409, 1252 105 | END 106 | END 107 | 108 | #endif // English (United States) resources 109 | ///////////////////////////////////////////////////////////////////////////// 110 | 111 | 112 | 113 | #ifndef APSTUDIO_INVOKED 114 | ///////////////////////////////////////////////////////////////////////////// 115 | // 116 | // Generated from the TEXTINCLUDE 3 resource. 117 | // 118 | 119 | 120 | ///////////////////////////////////////////////////////////////////////////// 121 | #endif // not APSTUDIO_INVOKED 122 | -------------------------------------------------------------------------------- /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 | 30 | flutter_controller_->engine()->SetNextFrameCallback([&]() { 31 | this->Show(); 32 | }); 33 | 34 | return true; 35 | } 36 | 37 | void FlutterWindow::OnDestroy() { 38 | if (flutter_controller_) { 39 | flutter_controller_ = nullptr; 40 | } 41 | 42 | Win32Window::OnDestroy(); 43 | } 44 | 45 | LRESULT 46 | FlutterWindow::MessageHandler(HWND hwnd, UINT const message, 47 | WPARAM const wparam, 48 | LPARAM const lparam) noexcept { 49 | // Give Flutter, including plugins, an opportunity to handle window messages. 50 | if (flutter_controller_) { 51 | std::optional result = 52 | flutter_controller_->HandleTopLevelWindowProc(hwnd, message, wparam, 53 | lparam); 54 | if (result) { 55 | return *result; 56 | } 57 | } 58 | 59 | switch (message) { 60 | case WM_FONTCHANGE: 61 | flutter_controller_->engine()->ReloadSystemFonts(); 62 | break; 63 | } 64 | 65 | return Win32Window::MessageHandler(hwnd, message, wparam, lparam); 66 | } 67 | -------------------------------------------------------------------------------- /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.Create(L"mu_hua_movie", 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/alun1/mu_hua_movie/a07e9b5078b6ed4399667aca08e15ef07240f2dc/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 | -------------------------------------------------------------------------------- /windows/runner/win32_window.h: -------------------------------------------------------------------------------- 1 | #ifndef RUNNER_WIN32_WINDOW_H_ 2 | #define RUNNER_WIN32_WINDOW_H_ 3 | 4 | #include 5 | 6 | #include 7 | #include 8 | #include 9 | 10 | // A class abstraction for a high DPI-aware Win32 Window. Intended to be 11 | // inherited from by classes that wish to specialize with custom 12 | // rendering and input handling 13 | class Win32Window { 14 | public: 15 | struct Point { 16 | unsigned int x; 17 | unsigned int y; 18 | Point(unsigned int x, unsigned int y) : x(x), y(y) {} 19 | }; 20 | 21 | struct Size { 22 | unsigned int width; 23 | unsigned int height; 24 | Size(unsigned int width, unsigned int height) 25 | : width(width), height(height) {} 26 | }; 27 | 28 | Win32Window(); 29 | virtual ~Win32Window(); 30 | 31 | // Creates a win32 window with |title| that is positioned and sized using 32 | // |origin| and |size|. New windows are created on the default monitor. Window 33 | // sizes are specified to the OS in physical pixels, hence to ensure a 34 | // consistent size this function will scale the inputted width and height as 35 | // as appropriate for the default monitor. The window is invisible until 36 | // |Show| is called. Returns true if the window was created successfully. 37 | bool Create(const std::wstring& title, const Point& origin, const Size& size); 38 | 39 | // Show the current window. Returns true if the window was successfully shown. 40 | bool Show(); 41 | 42 | // Release OS resources associated with window. 43 | void Destroy(); 44 | 45 | // Inserts |content| into the window tree. 46 | void SetChildContent(HWND content); 47 | 48 | // Returns the backing Window handle to enable clients to set icon and other 49 | // window properties. Returns nullptr if the window has been destroyed. 50 | HWND GetHandle(); 51 | 52 | // If true, closing this window will quit the application. 53 | void SetQuitOnClose(bool quit_on_close); 54 | 55 | // Return a RECT representing the bounds of the current client area. 56 | RECT GetClientArea(); 57 | 58 | protected: 59 | // Processes and route salient window messages for mouse handling, 60 | // size change and DPI. Delegates handling of these to member overloads that 61 | // inheriting classes can handle. 62 | virtual LRESULT MessageHandler(HWND window, 63 | UINT const message, 64 | WPARAM const wparam, 65 | LPARAM const lparam) noexcept; 66 | 67 | // Called when CreateAndShow is called, allowing subclass window-related 68 | // setup. Subclasses should return false if setup fails. 69 | virtual bool OnCreate(); 70 | 71 | // Called when Destroy is called. 72 | virtual void OnDestroy(); 73 | 74 | private: 75 | friend class WindowClassRegistrar; 76 | 77 | // OS callback called by message pump. Handles the WM_NCCREATE message which 78 | // is passed when the non-client area is being created and enables automatic 79 | // non-client DPI scaling so that the non-client area automatically 80 | // responsponds to changes in DPI. All other messages are handled by 81 | // MessageHandler. 82 | static LRESULT CALLBACK WndProc(HWND const window, 83 | UINT const message, 84 | WPARAM const wparam, 85 | LPARAM const lparam) noexcept; 86 | 87 | // Retrieves a class instance pointer for |window| 88 | static Win32Window* GetThisFromHandle(HWND const window) noexcept; 89 | 90 | // Update the window frame's theme to match the system theme. 91 | static void UpdateTheme(HWND const window); 92 | 93 | bool quit_on_close_ = false; 94 | 95 | // window handle for top level window. 96 | HWND window_handle_ = nullptr; 97 | 98 | // window handle for hosted content. 99 | HWND child_content_ = nullptr; 100 | }; 101 | 102 | #endif // RUNNER_WIN32_WINDOW_H_ 103 | --------------------------------------------------------------------------------