├── .gitignore ├── .metadata ├── README.md ├── analysis_options.yaml ├── android ├── .gitignore ├── app │ ├── build.gradle │ └── src │ │ ├── debug │ │ └── AndroidManifest.xml │ │ ├── main │ │ ├── AndroidManifest.xml │ │ ├── java │ │ │ └── io │ │ │ │ └── flutter │ │ │ │ └── app │ │ │ │ └── FlutterMultiDexApplication.java │ │ ├── kotlin │ │ │ └── com │ │ │ │ └── example │ │ │ │ └── flutter_tv │ │ │ │ └── MainActivity.kt │ │ └── res │ │ │ ├── drawable-v21 │ │ │ ├── background.png │ │ │ └── launch_background.xml │ │ │ ├── drawable │ │ │ ├── background.png │ │ │ └── launch_background.xml │ │ │ ├── mipmap-hdpi │ │ │ └── ic_launcher.png │ │ │ ├── mipmap-mdpi │ │ │ └── ic_launcher.png │ │ │ ├── mipmap-xhdpi │ │ │ └── ic_launcher.png │ │ │ ├── mipmap-xxhdpi │ │ │ └── ic_launcher.png │ │ │ ├── mipmap-xxxhdpi │ │ │ └── ic_launcher.png │ │ │ ├── values-night-v31 │ │ │ └── styles.xml │ │ │ ├── values-night │ │ │ └── styles.xml │ │ │ ├── values-v31 │ │ │ └── styles.xml │ │ │ └── values │ │ │ └── styles.xml │ │ └── profile │ │ └── AndroidManifest.xml ├── build.gradle ├── gradle.properties ├── gradle │ └── wrapper │ │ └── gradle-wrapper.properties └── settings.gradle ├── assets └── splash.png ├── flutter_native_splash.yaml ├── ios ├── .gitignore ├── Flutter │ ├── AppFrameworkInfo.plist │ ├── Debug.xcconfig │ └── Release.xcconfig ├── Runner.xcodeproj │ ├── project.pbxproj │ ├── project.xcworkspace │ │ ├── contents.xcworkspacedata │ │ └── xcshareddata │ │ │ ├── IDEWorkspaceChecks.plist │ │ │ └── WorkspaceSettings.xcsettings │ └── xcshareddata │ │ └── xcschemes │ │ └── Runner.xcscheme ├── Runner.xcworkspace │ ├── contents.xcworkspacedata │ └── xcshareddata │ │ ├── IDEWorkspaceChecks.plist │ │ └── WorkspaceSettings.xcsettings └── Runner │ ├── AppDelegate.swift │ ├── Assets.xcassets │ ├── AppIcon.appiconset │ │ ├── 100.png │ │ ├── 102.png │ │ ├── 1024.png │ │ ├── 114.png │ │ ├── 120.png │ │ ├── 128.png │ │ ├── 144.png │ │ ├── 152.png │ │ ├── 16.png │ │ ├── 167.png │ │ ├── 172.png │ │ ├── 180.png │ │ ├── 196.png │ │ ├── 20.png │ │ ├── 216.png │ │ ├── 256.png │ │ ├── 29.png │ │ ├── 32.png │ │ ├── 40.png │ │ ├── 48.png │ │ ├── 50.png │ │ ├── 512.png │ │ ├── 55.png │ │ ├── 57.png │ │ ├── 58.png │ │ ├── 60.png │ │ ├── 64.png │ │ ├── 66.png │ │ ├── 72.png │ │ ├── 76.png │ │ ├── 80.png │ │ ├── 87.png │ │ ├── 88.png │ │ ├── 92.png │ │ └── Contents.json │ ├── LaunchBackground.imageset │ │ ├── Contents.json │ │ └── background.png │ └── LaunchImage.imageset │ │ ├── Contents.json │ │ ├── LaunchImage.png │ │ ├── LaunchImage@2x.png │ │ ├── LaunchImage@3x.png │ │ └── README.md │ ├── Base.lproj │ ├── LaunchScreen.storyboard │ └── Main.storyboard │ ├── Info.plist │ └── Runner-Bridging-Header.h ├── lib ├── commons │ └── vars.dart ├── controller │ ├── get_channel.dart │ ├── get_episode.dart │ ├── provider │ │ ├── altadefinizione.dart │ │ ├── cb01_film.dart │ │ └── guardaserie.dart │ ├── tmdb.dart │ └── web_loader.dart ├── main.dart ├── model │ ├── channel_model.dart │ ├── episodio_model.dart │ ├── film_model.dart │ ├── popular_serie.dart │ └── season_model.dart ├── pages │ ├── film │ │ ├── film_details.dart │ │ ├── film_search.dart │ │ └── film_view.dart │ ├── home_page.dart │ ├── serie │ │ ├── serie_details.dart │ │ ├── serie_search.dart │ │ └── series_view.dart │ ├── settings_page.dart │ └── video_player.dart └── widget │ ├── barra_ricerca.dart │ ├── channel_card.dart │ ├── channel_list.dart │ ├── film_field.dart │ ├── home_field.dart │ └── serie_field.dart ├── linux ├── .gitignore ├── CMakeLists.txt ├── flutter │ ├── CMakeLists.txt │ ├── generated_plugin_registrant.cc │ ├── generated_plugin_registrant.h │ └── generated_plugins.cmake ├── main.cc ├── my_application.cc └── my_application.h ├── macos ├── .gitignore ├── Flutter │ ├── Flutter-Debug.xcconfig │ ├── Flutter-Release.xcconfig │ └── GeneratedPluginRegistrant.swift ├── Runner.xcodeproj │ ├── project.pbxproj │ ├── project.xcworkspace │ │ └── xcshareddata │ │ │ └── IDEWorkspaceChecks.plist │ └── xcshareddata │ │ └── xcschemes │ │ └── Runner.xcscheme ├── Runner.xcworkspace │ ├── contents.xcworkspacedata │ └── xcshareddata │ │ └── IDEWorkspaceChecks.plist └── Runner │ ├── AppDelegate.swift │ ├── Assets.xcassets │ └── AppIcon.appiconset │ │ ├── Contents.json │ │ ├── app_icon_1024.png │ │ ├── app_icon_128.png │ │ ├── app_icon_16.png │ │ ├── app_icon_256.png │ │ ├── app_icon_32.png │ │ ├── app_icon_512.png │ │ └── app_icon_64.png │ ├── Base.lproj │ └── MainMenu.xib │ ├── Configs │ ├── AppInfo.xcconfig │ ├── Debug.xcconfig │ ├── Release.xcconfig │ └── Warnings.xcconfig │ ├── DebugProfile.entitlements │ ├── Info.plist │ ├── MainFlutterWindow.swift │ └── Release.entitlements ├── pubspec.lock ├── pubspec.yaml ├── test └── widget_test.dart ├── web ├── favicon.png ├── icons │ ├── Icon-192.png │ ├── Icon-512.png │ ├── Icon-maskable-192.png │ └── Icon-maskable-512.png ├── index.html ├── manifest.json └── splash │ ├── img │ └── light-background.png │ ├── splash.js │ └── style.css └── 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: e99c9c7cd9f6c0b2f8ae6e3ebfd585239f5568f4 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: e99c9c7cd9f6c0b2f8ae6e3ebfd585239f5568f4 17 | base_revision: e99c9c7cd9f6c0b2f8ae6e3ebfd585239f5568f4 18 | - platform: android 19 | create_revision: e99c9c7cd9f6c0b2f8ae6e3ebfd585239f5568f4 20 | base_revision: e99c9c7cd9f6c0b2f8ae6e3ebfd585239f5568f4 21 | - platform: ios 22 | create_revision: e99c9c7cd9f6c0b2f8ae6e3ebfd585239f5568f4 23 | base_revision: e99c9c7cd9f6c0b2f8ae6e3ebfd585239f5568f4 24 | - platform: linux 25 | create_revision: e99c9c7cd9f6c0b2f8ae6e3ebfd585239f5568f4 26 | base_revision: e99c9c7cd9f6c0b2f8ae6e3ebfd585239f5568f4 27 | - platform: macos 28 | create_revision: e99c9c7cd9f6c0b2f8ae6e3ebfd585239f5568f4 29 | base_revision: e99c9c7cd9f6c0b2f8ae6e3ebfd585239f5568f4 30 | - platform: web 31 | create_revision: e99c9c7cd9f6c0b2f8ae6e3ebfd585239f5568f4 32 | base_revision: e99c9c7cd9f6c0b2f8ae6e3ebfd585239f5568f4 33 | - platform: windows 34 | create_revision: e99c9c7cd9f6c0b2f8ae6e3ebfd585239f5568f4 35 | base_revision: e99c9c7cd9f6c0b2f8ae6e3ebfd585239f5568f4 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 | # Flutter TV 2 | App per la visione di film, serie tv 3 | 4 | ## Features 5 | 6 | - Film 7 | - Serie TV 8 | - Ricerca 9 | 10 | ## Provider 11 | WIP 12 | 13 | 14 | ## To-Do 15 | - [ ] Guarda Film 16 | - [ ] Guarda Serie TV 17 | - [x] Selezione Stagione Serie TV 18 | - [x] Notifica Aggiornamento 19 | - [x] Ricerca 20 | - [x] UI Home 21 | - [x] UI Dettagli Film 22 | - [x] UI Dettagli Serie 23 | -------------------------------------------------------------------------------- /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 | compileSdkVersion 33 30 | ndkVersion flutter.ndkVersion 31 | 32 | compileOptions { 33 | sourceCompatibility JavaVersion.VERSION_1_8 34 | targetCompatibility JavaVersion.VERSION_1_8 35 | } 36 | 37 | kotlinOptions { 38 | jvmTarget = '1.8' 39 | } 40 | 41 | sourceSets { 42 | main.java.srcDirs += 'src/main/kotlin' 43 | } 44 | 45 | defaultConfig { 46 | // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html). 47 | applicationId "it.d4n73.fluttertv" 48 | // You can update the following values to match your application needs. 49 | // For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-build-configuration. 50 | minSdkVersion 19 51 | targetSdkVersion flutter.targetSdkVersion 52 | versionCode flutterVersionCode.toInteger() 53 | versionName flutterVersionName 54 | } 55 | 56 | buildTypes { 57 | release { 58 | // TODO: Add your own signing config for the release build. 59 | // Signing with the debug keys for now, so `flutter run --release` works. 60 | signingConfig signingConfigs.debug 61 | } 62 | } 63 | } 64 | 65 | flutter { 66 | source '../..' 67 | } 68 | 69 | dependencies { 70 | implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" 71 | } 72 | -------------------------------------------------------------------------------- /android/app/src/debug/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /android/app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 6 | 10 | 18 | 22 | 26 | 27 | 28 | 29 | 30 | 31 | 33 | 36 | 37 | 38 | -------------------------------------------------------------------------------- /android/app/src/main/java/io/flutter/app/FlutterMultiDexApplication.java: -------------------------------------------------------------------------------- 1 | // Generated file. 2 | // 3 | // If you wish to remove Flutter's multidex support, delete this entire file. 4 | // 5 | // Modifications to this file should be done in a copy under a different name 6 | // as this file may be regenerated. 7 | 8 | package io.flutter.app; 9 | 10 | import android.app.Application; 11 | import android.content.Context; 12 | import androidx.annotation.CallSuper; 13 | import androidx.multidex.MultiDex; 14 | 15 | /** 16 | * Extension of {@link android.app.Application}, adding multidex support. 17 | */ 18 | public class FlutterMultiDexApplication extends Application { 19 | @Override 20 | @CallSuper 21 | protected void attachBaseContext(Context base) { 22 | super.attachBaseContext(base); 23 | MultiDex.install(this); 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /android/app/src/main/kotlin/com/example/flutter_tv/MainActivity.kt: -------------------------------------------------------------------------------- 1 | package it.d4n73.fluttertv 2 | 3 | import io.flutter.embedding.android.FlutterActivity 4 | 5 | class MainActivity: FlutterActivity() { 6 | } 7 | -------------------------------------------------------------------------------- /android/app/src/main/res/drawable-v21/background.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IsD4n73/Flutter-TV/8e6e2740c0cee10f0f11283188798974a86e3ca0/android/app/src/main/res/drawable-v21/background.png -------------------------------------------------------------------------------- /android/app/src/main/res/drawable-v21/launch_background.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /android/app/src/main/res/drawable/background.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IsD4n73/Flutter-TV/8e6e2740c0cee10f0f11283188798974a86e3ca0/android/app/src/main/res/drawable/background.png -------------------------------------------------------------------------------- /android/app/src/main/res/drawable/launch_background.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IsD4n73/Flutter-TV/8e6e2740c0cee10f0f11283188798974a86e3ca0/android/app/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IsD4n73/Flutter-TV/8e6e2740c0cee10f0f11283188798974a86e3ca0/android/app/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IsD4n73/Flutter-TV/8e6e2740c0cee10f0f11283188798974a86e3ca0/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IsD4n73/Flutter-TV/8e6e2740c0cee10f0f11283188798974a86e3ca0/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IsD4n73/Flutter-TV/8e6e2740c0cee10f0f11283188798974a86e3ca0/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/values-night-v31/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 10 | 16 | 19 | 20 | -------------------------------------------------------------------------------- /android/app/src/main/res/values-night/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 13 | 19 | 22 | 23 | -------------------------------------------------------------------------------- /android/app/src/main/res/values-v31/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 10 | 16 | 19 | 20 | -------------------------------------------------------------------------------- /android/app/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 13 | 19 | 22 | 23 | -------------------------------------------------------------------------------- /android/app/src/profile/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /android/build.gradle: -------------------------------------------------------------------------------- 1 | buildscript { 2 | ext.kotlin_version = '1.6.10' 3 | repositories { 4 | google() 5 | mavenCentral() 6 | } 7 | 8 | dependencies { 9 | classpath 'com.android.tools.build:gradle:7.1.2' 10 | classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" 11 | } 12 | } 13 | 14 | allprojects { 15 | repositories { 16 | google() 17 | mavenCentral() 18 | } 19 | } 20 | 21 | rootProject.buildDir = '../build' 22 | subprojects { 23 | project.buildDir = "${rootProject.buildDir}/${project.name}" 24 | } 25 | subprojects { 26 | project.evaluationDependsOn(':app') 27 | } 28 | 29 | tasks.register("clean", Delete) { 30 | delete rootProject.buildDir 31 | } 32 | -------------------------------------------------------------------------------- /android/gradle.properties: -------------------------------------------------------------------------------- 1 | org.gradle.jvmargs=-Xmx1536M 2 | android.useAndroidX=true 3 | android.enableJetifier=true 4 | -------------------------------------------------------------------------------- /android/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | 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.4-all.zip 6 | -------------------------------------------------------------------------------- /android/settings.gradle: -------------------------------------------------------------------------------- 1 | include ':app' 2 | 3 | def localPropertiesFile = new File(rootProject.projectDir, "local.properties") 4 | def properties = new Properties() 5 | 6 | assert localPropertiesFile.exists() 7 | localPropertiesFile.withReader("UTF-8") { reader -> properties.load(reader) } 8 | 9 | def flutterSdkPath = properties.getProperty("flutter.sdk") 10 | assert flutterSdkPath != null, "flutter.sdk not set in local.properties" 11 | apply from: "$flutterSdkPath/packages/flutter_tools/gradle/app_plugin_loader.gradle" 12 | -------------------------------------------------------------------------------- /assets/splash.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IsD4n73/Flutter-TV/8e6e2740c0cee10f0f11283188798974a86e3ca0/assets/splash.png -------------------------------------------------------------------------------- /flutter_native_splash.yaml: -------------------------------------------------------------------------------- 1 | flutter_native_splash: 2 | # This package generates native code to customize Flutter's default white native splash screen 3 | # with background color and splash image. 4 | # Customize the parameters below, and run the following command in the terminal: 5 | # dart run flutter_native_splash:create 6 | # To restore Flutter's default white splash screen, run the following command in the terminal: 7 | # dart run flutter_native_splash:remove 8 | 9 | # color or background_image is the only required parameter. Use color to set the background 10 | # of your splash screen to a solid color. Use background_image to set the background of your 11 | # splash screen to a png image. This is useful for gradients. The image will be stretch to the 12 | # size of the app. Only one parameter can be used, color and background_image cannot both be set. 13 | #color: "#42a5f5" 14 | background_image: "assets/splash.png" 15 | 16 | # Optional parameters are listed below. To enable a parameter, uncomment the line by removing 17 | # the leading # character. 18 | 19 | # The image parameter allows you to specify an image used in the splash screen. It must be a 20 | # png file and should be sized for 4x pixel density. 21 | #image: assets/splash.png 22 | 23 | # The branding property allows you to specify an image used as branding in the splash screen. 24 | # It must be a png file. It is supported for Android, iOS and the Web. For Android 12, 25 | # see the Android 12 section below. 26 | #branding: assets/dart.png 27 | 28 | # To position the branding image at the bottom of the screen you can use bottom, bottomRight, 29 | # and bottomLeft. The default values is bottom if not specified or specified something else. 30 | #branding_mode: bottom 31 | 32 | # The color_dark, background_image_dark, image_dark, branding_dark are parameters that set the background 33 | # and image when the device is in dark mode. If they are not specified, the app will use the 34 | # parameters from above. If the image_dark parameter is specified, color_dark or 35 | # background_image_dark must be specified. color_dark and background_image_dark cannot both be 36 | # set. 37 | #color_dark: "#042a49" 38 | #background_image_dark: "assets/dark-background.png" 39 | #image_dark: assets/splash-invert.png 40 | #branding_dark: assets/dart_dark.png 41 | 42 | # Android 12 handles the splash screen differently than previous versions. Please visit 43 | # https://developer.android.com/guide/topics/ui/splash-screen 44 | # Following are Android 12 specific parameter. 45 | android_12: 46 | # The image parameter sets the splash screen icon image. If this parameter is not specified, 47 | # the app's launcher icon will be used instead. 48 | # Please note that the splash screen will be clipped to a circle on the center of the screen. 49 | # App icon with an icon background: This should be 960×960 pixels, and fit within a circle 50 | # 640 pixels in diameter. 51 | # App icon without an icon background: This should be 1152×1152 pixels, and fit within a circle 52 | # 768 pixels in diameter. 53 | #image: assets/android12splash.png 54 | 55 | # Splash screen background color. 56 | #color: "#42a5f5" 57 | 58 | # App icon background color. 59 | #icon_background_color: "#111111" 60 | 61 | # The branding property allows you to specify an image used as branding in the splash screen. 62 | #branding: assets/dart.png 63 | 64 | # The image_dark, color_dark, icon_background_color_dark, and branding_dark set values that 65 | # apply when the device is in dark mode. If they are not specified, the app will use the 66 | # parameters from above. 67 | #image_dark: assets/android12splash-invert.png 68 | #color_dark: "#042a49" 69 | #icon_background_color_dark: "#eeeeee" 70 | 71 | # The android, ios and web parameters can be used to disable generating a splash screen on a given 72 | # platform. 73 | #android: false 74 | #ios: false 75 | #web: false 76 | 77 | # Platform specific images can be specified with the following parameters, which will override 78 | # the respective parameter. You may specify all, selected, or none of these parameters: 79 | #color_android: "#42a5f5" 80 | #color_dark_android: "#042a49" 81 | #color_ios: "#42a5f5" 82 | #color_dark_ios: "#042a49" 83 | #color_web: "#42a5f5" 84 | #color_dark_web: "#042a49" 85 | #image_android: assets/splash-android.png 86 | #image_dark_android: assets/splash-invert-android.png 87 | #image_ios: assets/splash-ios.png 88 | #image_dark_ios: assets/splash-invert-ios.png 89 | #image_web: assets/splash-web.gif 90 | #image_dark_web: assets/splash-invert-web.gif 91 | #background_image_android: "assets/background-android.png" 92 | #background_image_dark_android: "assets/dark-background-android.png" 93 | #background_image_ios: "assets/background-ios.png" 94 | #background_image_dark_ios: "assets/dark-background-ios.png" 95 | #background_image_web: "assets/background-web.png" 96 | #background_image_dark_web: "assets/dark-background-web.png" 97 | #branding_android: assets/brand-android.png 98 | #branding_dark_android: assets/dart_dark-android.png 99 | #branding_ios: assets/brand-ios.gif 100 | #branding_dark_ios: assets/dart_dark-ios.gif 101 | 102 | # The position of the splash image can be set with android_gravity, ios_content_mode, and 103 | # web_image_mode parameters. All default to center. 104 | # 105 | # android_gravity can be one of the following Android Gravity (see 106 | # https://developer.android.com/reference/android/view/Gravity): bottom, center, 107 | # center_horizontal, center_vertical, clip_horizontal, clip_vertical, end, fill, fill_horizontal, 108 | # fill_vertical, left, right, start, or top. 109 | #android_gravity: center 110 | # 111 | # ios_content_mode can be one of the following iOS UIView.ContentMode (see 112 | # https://developer.apple.com/documentation/uikit/uiview/contentmode): scaleToFill, 113 | # scaleAspectFit, scaleAspectFill, center, top, bottom, left, right, topLeft, topRight, 114 | # bottomLeft, or bottomRight. 115 | #ios_content_mode: center 116 | # 117 | # web_image_mode can be one of the following modes: center, contain, stretch, and cover. 118 | #web_image_mode: center 119 | 120 | # The screen orientation can be set in Android with the android_screen_orientation parameter. 121 | # Valid parameters can be found here: 122 | # https://developer.android.com/guide/topics/manifest/activity-element#screen 123 | #android_screen_orientation: sensorLandscape 124 | 125 | # To hide the notification bar, use the fullscreen parameter. Has no effect in web since web 126 | # has no notification bar. Defaults to false. 127 | # NOTE: Unlike Android, iOS will not automatically show the notification bar when the app loads. 128 | # To show the notification bar, add the following code to your Flutter app: 129 | # WidgetsFlutterBinding.ensureInitialized(); 130 | # SystemChrome.setEnabledSystemUIMode(SystemUiMode.manual, overlays: [SystemUiOverlay.bottom, SystemUiOverlay.top], ); 131 | #fullscreen: true 132 | 133 | # If you have changed the name(s) of your info.plist file(s), you can specify the filename(s) 134 | # with the info_plist_files parameter. Remove only the # characters in the three lines below, 135 | # do not remove any spaces: 136 | #info_plist_files: 137 | # - 'ios/Runner/Info-Debug.plist' 138 | # - 'ios/Runner/Info-Release.plist' -------------------------------------------------------------------------------- /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 "Generated.xcconfig" 2 | -------------------------------------------------------------------------------- /ios/Flutter/Release.xcconfig: -------------------------------------------------------------------------------- 1 | #include "Generated.xcconfig" 2 | -------------------------------------------------------------------------------- /ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | PreviewsEnabled 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 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 | 8 | -------------------------------------------------------------------------------- /ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | PreviewsEnabled 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /ios/Runner/AppDelegate.swift: -------------------------------------------------------------------------------- 1 | import UIKit 2 | import Flutter 3 | 4 | @UIApplicationMain 5 | @objc class AppDelegate: FlutterAppDelegate { 6 | override func application( 7 | _ application: UIApplication, 8 | didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]? 9 | ) -> Bool { 10 | GeneratedPluginRegistrant.register(with: self) 11 | return super.application(application, didFinishLaunchingWithOptions: launchOptions) 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/100.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IsD4n73/Flutter-TV/8e6e2740c0cee10f0f11283188798974a86e3ca0/ios/Runner/Assets.xcassets/AppIcon.appiconset/100.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/102.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IsD4n73/Flutter-TV/8e6e2740c0cee10f0f11283188798974a86e3ca0/ios/Runner/Assets.xcassets/AppIcon.appiconset/102.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/1024.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IsD4n73/Flutter-TV/8e6e2740c0cee10f0f11283188798974a86e3ca0/ios/Runner/Assets.xcassets/AppIcon.appiconset/1024.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/114.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IsD4n73/Flutter-TV/8e6e2740c0cee10f0f11283188798974a86e3ca0/ios/Runner/Assets.xcassets/AppIcon.appiconset/114.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/120.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IsD4n73/Flutter-TV/8e6e2740c0cee10f0f11283188798974a86e3ca0/ios/Runner/Assets.xcassets/AppIcon.appiconset/120.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/128.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IsD4n73/Flutter-TV/8e6e2740c0cee10f0f11283188798974a86e3ca0/ios/Runner/Assets.xcassets/AppIcon.appiconset/128.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/144.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IsD4n73/Flutter-TV/8e6e2740c0cee10f0f11283188798974a86e3ca0/ios/Runner/Assets.xcassets/AppIcon.appiconset/144.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/152.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IsD4n73/Flutter-TV/8e6e2740c0cee10f0f11283188798974a86e3ca0/ios/Runner/Assets.xcassets/AppIcon.appiconset/152.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IsD4n73/Flutter-TV/8e6e2740c0cee10f0f11283188798974a86e3ca0/ios/Runner/Assets.xcassets/AppIcon.appiconset/16.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/167.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IsD4n73/Flutter-TV/8e6e2740c0cee10f0f11283188798974a86e3ca0/ios/Runner/Assets.xcassets/AppIcon.appiconset/167.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/172.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IsD4n73/Flutter-TV/8e6e2740c0cee10f0f11283188798974a86e3ca0/ios/Runner/Assets.xcassets/AppIcon.appiconset/172.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/180.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IsD4n73/Flutter-TV/8e6e2740c0cee10f0f11283188798974a86e3ca0/ios/Runner/Assets.xcassets/AppIcon.appiconset/180.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/196.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IsD4n73/Flutter-TV/8e6e2740c0cee10f0f11283188798974a86e3ca0/ios/Runner/Assets.xcassets/AppIcon.appiconset/196.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/20.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IsD4n73/Flutter-TV/8e6e2740c0cee10f0f11283188798974a86e3ca0/ios/Runner/Assets.xcassets/AppIcon.appiconset/20.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/216.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IsD4n73/Flutter-TV/8e6e2740c0cee10f0f11283188798974a86e3ca0/ios/Runner/Assets.xcassets/AppIcon.appiconset/216.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/256.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IsD4n73/Flutter-TV/8e6e2740c0cee10f0f11283188798974a86e3ca0/ios/Runner/Assets.xcassets/AppIcon.appiconset/256.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/29.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IsD4n73/Flutter-TV/8e6e2740c0cee10f0f11283188798974a86e3ca0/ios/Runner/Assets.xcassets/AppIcon.appiconset/29.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IsD4n73/Flutter-TV/8e6e2740c0cee10f0f11283188798974a86e3ca0/ios/Runner/Assets.xcassets/AppIcon.appiconset/32.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/40.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IsD4n73/Flutter-TV/8e6e2740c0cee10f0f11283188798974a86e3ca0/ios/Runner/Assets.xcassets/AppIcon.appiconset/40.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/48.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IsD4n73/Flutter-TV/8e6e2740c0cee10f0f11283188798974a86e3ca0/ios/Runner/Assets.xcassets/AppIcon.appiconset/48.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/50.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IsD4n73/Flutter-TV/8e6e2740c0cee10f0f11283188798974a86e3ca0/ios/Runner/Assets.xcassets/AppIcon.appiconset/50.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IsD4n73/Flutter-TV/8e6e2740c0cee10f0f11283188798974a86e3ca0/ios/Runner/Assets.xcassets/AppIcon.appiconset/512.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/55.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IsD4n73/Flutter-TV/8e6e2740c0cee10f0f11283188798974a86e3ca0/ios/Runner/Assets.xcassets/AppIcon.appiconset/55.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/57.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IsD4n73/Flutter-TV/8e6e2740c0cee10f0f11283188798974a86e3ca0/ios/Runner/Assets.xcassets/AppIcon.appiconset/57.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/58.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IsD4n73/Flutter-TV/8e6e2740c0cee10f0f11283188798974a86e3ca0/ios/Runner/Assets.xcassets/AppIcon.appiconset/58.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/60.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IsD4n73/Flutter-TV/8e6e2740c0cee10f0f11283188798974a86e3ca0/ios/Runner/Assets.xcassets/AppIcon.appiconset/60.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/64.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IsD4n73/Flutter-TV/8e6e2740c0cee10f0f11283188798974a86e3ca0/ios/Runner/Assets.xcassets/AppIcon.appiconset/64.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/66.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IsD4n73/Flutter-TV/8e6e2740c0cee10f0f11283188798974a86e3ca0/ios/Runner/Assets.xcassets/AppIcon.appiconset/66.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/72.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IsD4n73/Flutter-TV/8e6e2740c0cee10f0f11283188798974a86e3ca0/ios/Runner/Assets.xcassets/AppIcon.appiconset/72.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/76.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IsD4n73/Flutter-TV/8e6e2740c0cee10f0f11283188798974a86e3ca0/ios/Runner/Assets.xcassets/AppIcon.appiconset/76.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/80.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IsD4n73/Flutter-TV/8e6e2740c0cee10f0f11283188798974a86e3ca0/ios/Runner/Assets.xcassets/AppIcon.appiconset/80.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/87.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IsD4n73/Flutter-TV/8e6e2740c0cee10f0f11283188798974a86e3ca0/ios/Runner/Assets.xcassets/AppIcon.appiconset/87.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/88.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IsD4n73/Flutter-TV/8e6e2740c0cee10f0f11283188798974a86e3ca0/ios/Runner/Assets.xcassets/AppIcon.appiconset/88.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/92.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IsD4n73/Flutter-TV/8e6e2740c0cee10f0f11283188798974a86e3ca0/ios/Runner/Assets.xcassets/AppIcon.appiconset/92.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | {"images":[{"size":"60x60","expected-size":"180","filename":"180.png","folder":"Assets.xcassets/AppIcon.appiconset/","idiom":"iphone","scale":"3x"},{"size":"40x40","expected-size":"80","filename":"80.png","folder":"Assets.xcassets/AppIcon.appiconset/","idiom":"iphone","scale":"2x"},{"size":"40x40","expected-size":"120","filename":"120.png","folder":"Assets.xcassets/AppIcon.appiconset/","idiom":"iphone","scale":"3x"},{"size":"60x60","expected-size":"120","filename":"120.png","folder":"Assets.xcassets/AppIcon.appiconset/","idiom":"iphone","scale":"2x"},{"size":"57x57","expected-size":"57","filename":"57.png","folder":"Assets.xcassets/AppIcon.appiconset/","idiom":"iphone","scale":"1x"},{"size":"29x29","expected-size":"58","filename":"58.png","folder":"Assets.xcassets/AppIcon.appiconset/","idiom":"iphone","scale":"2x"},{"size":"29x29","expected-size":"29","filename":"29.png","folder":"Assets.xcassets/AppIcon.appiconset/","idiom":"iphone","scale":"1x"},{"size":"29x29","expected-size":"87","filename":"87.png","folder":"Assets.xcassets/AppIcon.appiconset/","idiom":"iphone","scale":"3x"},{"size":"57x57","expected-size":"114","filename":"114.png","folder":"Assets.xcassets/AppIcon.appiconset/","idiom":"iphone","scale":"2x"},{"size":"20x20","expected-size":"40","filename":"40.png","folder":"Assets.xcassets/AppIcon.appiconset/","idiom":"iphone","scale":"2x"},{"size":"20x20","expected-size":"60","filename":"60.png","folder":"Assets.xcassets/AppIcon.appiconset/","idiom":"iphone","scale":"3x"},{"size":"1024x1024","filename":"1024.png","expected-size":"1024","idiom":"ios-marketing","folder":"Assets.xcassets/AppIcon.appiconset/","scale":"1x"},{"size":"40x40","expected-size":"80","filename":"80.png","folder":"Assets.xcassets/AppIcon.appiconset/","idiom":"ipad","scale":"2x"},{"size":"72x72","expected-size":"72","filename":"72.png","folder":"Assets.xcassets/AppIcon.appiconset/","idiom":"ipad","scale":"1x"},{"size":"76x76","expected-size":"152","filename":"152.png","folder":"Assets.xcassets/AppIcon.appiconset/","idiom":"ipad","scale":"2x"},{"size":"50x50","expected-size":"100","filename":"100.png","folder":"Assets.xcassets/AppIcon.appiconset/","idiom":"ipad","scale":"2x"},{"size":"29x29","expected-size":"58","filename":"58.png","folder":"Assets.xcassets/AppIcon.appiconset/","idiom":"ipad","scale":"2x"},{"size":"76x76","expected-size":"76","filename":"76.png","folder":"Assets.xcassets/AppIcon.appiconset/","idiom":"ipad","scale":"1x"},{"size":"29x29","expected-size":"29","filename":"29.png","folder":"Assets.xcassets/AppIcon.appiconset/","idiom":"ipad","scale":"1x"},{"size":"50x50","expected-size":"50","filename":"50.png","folder":"Assets.xcassets/AppIcon.appiconset/","idiom":"ipad","scale":"1x"},{"size":"72x72","expected-size":"144","filename":"144.png","folder":"Assets.xcassets/AppIcon.appiconset/","idiom":"ipad","scale":"2x"},{"size":"40x40","expected-size":"40","filename":"40.png","folder":"Assets.xcassets/AppIcon.appiconset/","idiom":"ipad","scale":"1x"},{"size":"83.5x83.5","expected-size":"167","filename":"167.png","folder":"Assets.xcassets/AppIcon.appiconset/","idiom":"ipad","scale":"2x"},{"size":"20x20","expected-size":"20","filename":"20.png","folder":"Assets.xcassets/AppIcon.appiconset/","idiom":"ipad","scale":"1x"},{"size":"20x20","expected-size":"40","filename":"40.png","folder":"Assets.xcassets/AppIcon.appiconset/","idiom":"ipad","scale":"2x"},{"idiom":"watch","filename":"172.png","folder":"Assets.xcassets/AppIcon.appiconset/","subtype":"38mm","scale":"2x","size":"86x86","expected-size":"172","role":"quickLook"},{"idiom":"watch","filename":"80.png","folder":"Assets.xcassets/AppIcon.appiconset/","subtype":"38mm","scale":"2x","size":"40x40","expected-size":"80","role":"appLauncher"},{"idiom":"watch","filename":"88.png","folder":"Assets.xcassets/AppIcon.appiconset/","subtype":"40mm","scale":"2x","size":"44x44","expected-size":"88","role":"appLauncher"},{"idiom":"watch","filename":"102.png","folder":"Assets.xcassets/AppIcon.appiconset/","subtype":"41mm","scale":"2x","size":"45x45","expected-size":"102","role":"appLauncher"},{"idiom":"watch","filename":"92.png","folder":"Assets.xcassets/AppIcon.appiconset/","subtype":"41mm","scale":"2x","size":"46x46","expected-size":"92","role":"appLauncher"},{"idiom":"watch","filename":"100.png","folder":"Assets.xcassets/AppIcon.appiconset/","subtype":"44mm","scale":"2x","size":"50x50","expected-size":"100","role":"appLauncher"},{"idiom":"watch","filename":"196.png","folder":"Assets.xcassets/AppIcon.appiconset/","subtype":"42mm","scale":"2x","size":"98x98","expected-size":"196","role":"quickLook"},{"idiom":"watch","filename":"216.png","folder":"Assets.xcassets/AppIcon.appiconset/","subtype":"44mm","scale":"2x","size":"108x108","expected-size":"216","role":"quickLook"},{"idiom":"watch","filename":"48.png","folder":"Assets.xcassets/AppIcon.appiconset/","subtype":"38mm","scale":"2x","size":"24x24","expected-size":"48","role":"notificationCenter"},{"idiom":"watch","filename":"55.png","folder":"Assets.xcassets/AppIcon.appiconset/","subtype":"42mm","scale":"2x","size":"27.5x27.5","expected-size":"55","role":"notificationCenter"},{"idiom":"watch","filename":"66.png","folder":"Assets.xcassets/AppIcon.appiconset/","subtype":"45mm","scale":"2x","size":"33x33","expected-size":"66","role":"notificationCenter"},{"size":"29x29","expected-size":"87","filename":"87.png","folder":"Assets.xcassets/AppIcon.appiconset/","idiom":"watch","role":"companionSettings","scale":"3x"},{"size":"29x29","expected-size":"58","filename":"58.png","folder":"Assets.xcassets/AppIcon.appiconset/","idiom":"watch","role":"companionSettings","scale":"2x"},{"size":"1024x1024","expected-size":"1024","filename":"1024.png","folder":"Assets.xcassets/AppIcon.appiconset/","idiom":"watch-marketing","scale":"1x"},{"size":"128x128","expected-size":"128","filename":"128.png","folder":"Assets.xcassets/AppIcon.appiconset/","idiom":"mac","scale":"1x"},{"size":"256x256","expected-size":"256","filename":"256.png","folder":"Assets.xcassets/AppIcon.appiconset/","idiom":"mac","scale":"1x"},{"size":"128x128","expected-size":"256","filename":"256.png","folder":"Assets.xcassets/AppIcon.appiconset/","idiom":"mac","scale":"2x"},{"size":"256x256","expected-size":"512","filename":"512.png","folder":"Assets.xcassets/AppIcon.appiconset/","idiom":"mac","scale":"2x"},{"size":"32x32","expected-size":"32","filename":"32.png","folder":"Assets.xcassets/AppIcon.appiconset/","idiom":"mac","scale":"1x"},{"size":"512x512","expected-size":"512","filename":"512.png","folder":"Assets.xcassets/AppIcon.appiconset/","idiom":"mac","scale":"1x"},{"size":"16x16","expected-size":"16","filename":"16.png","folder":"Assets.xcassets/AppIcon.appiconset/","idiom":"mac","scale":"1x"},{"size":"16x16","expected-size":"32","filename":"32.png","folder":"Assets.xcassets/AppIcon.appiconset/","idiom":"mac","scale":"2x"},{"size":"32x32","expected-size":"64","filename":"64.png","folder":"Assets.xcassets/AppIcon.appiconset/","idiom":"mac","scale":"2x"},{"size":"512x512","expected-size":"1024","filename":"1024.png","folder":"Assets.xcassets/AppIcon.appiconset/","idiom":"mac","scale":"2x"}]} -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/LaunchBackground.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "filename" : "background.png", 5 | "idiom" : "universal", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "author" : "xcode", 19 | "version" : 1 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/LaunchBackground.imageset/background.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IsD4n73/Flutter-TV/8e6e2740c0cee10f0f11283188798974a86e3ca0/ios/Runner/Assets.xcassets/LaunchBackground.imageset/background.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "filename" : "LaunchImage.png", 5 | "idiom" : "universal", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "filename" : "LaunchImage@2x.png", 10 | "idiom" : "universal", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "filename" : "LaunchImage@3x.png", 15 | "idiom" : "universal", 16 | "scale" : "3x" 17 | } 18 | ], 19 | "info" : { 20 | "author" : "xcode", 21 | "version" : 1 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IsD4n73/Flutter-TV/8e6e2740c0cee10f0f11283188798974a86e3ca0/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IsD4n73/Flutter-TV/8e6e2740c0cee10f0f11283188798974a86e3ca0/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IsD4n73/Flutter-TV/8e6e2740c0cee10f0f11283188798974a86e3ca0/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 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | -------------------------------------------------------------------------------- /ios/Runner/Base.lproj/Main.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /ios/Runner/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | $(DEVELOPMENT_LANGUAGE) 7 | CFBundleDisplayName 8 | Flutter Tv 9 | CFBundleExecutable 10 | $(EXECUTABLE_NAME) 11 | CFBundleIdentifier 12 | $(PRODUCT_BUNDLE_IDENTIFIER) 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | flutter_tv 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 | UIStatusBarHidden 51 | 52 | 53 | 54 | -------------------------------------------------------------------------------- /ios/Runner/Runner-Bridging-Header.h: -------------------------------------------------------------------------------- 1 | #import "GeneratedPluginRegistrant.h" 2 | -------------------------------------------------------------------------------- /lib/commons/vars.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | const TextStyle dropdownMenuItem = TextStyle(color: Colors.black, fontSize: 18); 4 | 5 | const Color bgColor = Color(0xff202020); 6 | 7 | const primary = Color.fromARGB(255, 114, 158, 105); 8 | const secondary = Color.fromARGB(255, 114, 158, 105); 9 | 10 | String noImg = 11 | "https://upload.wikimedia.org/wikipedia/commons/1/14/No_Image_Available.jpg?20200913095930"; 12 | 13 | var filmPopolari = []; 14 | var seriePopolari = []; 15 | 16 | var filmCercati = []; 17 | var serieCercati = []; 18 | 19 | String apiKey = "7e438eba5e1c995839ac0bacf9f33f23"; 20 | String urlTv = "https://api.themoviedb.org/3/tv/"; 21 | 22 | const appcastURL = 23 | 'https://raw.githubusercontent.com/IsD4n73/IsD4n73/file/Upgrade.xml'; 24 | 25 | String userAgent = 26 | "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/108.0.0.0 Safari/537.36"; 27 | -------------------------------------------------------------------------------- /lib/controller/get_channel.dart: -------------------------------------------------------------------------------- 1 | 2 | import 'package:http/http.dart' as http; 3 | import 'package:http/http.dart'; 4 | 5 | Future getChannels() async { 6 | var url = Uri.parse( 7 | "https://raw.githubusercontent.com/IsD4n73/IsD4n73/file/channel.json"); 8 | Response response = await http.get(url); 9 | 10 | String data = response.body; 11 | 12 | return data; 13 | } 14 | -------------------------------------------------------------------------------- /lib/controller/get_episode.dart: -------------------------------------------------------------------------------- 1 | import 'dart:convert'; 2 | 3 | import 'package:flutter_tv/commons/vars.dart'; 4 | import 'package:flutter_tv/model/episodio_model.dart'; 5 | import 'package:http/http.dart' as http; 6 | import 'package:flutter_tv/model/season_model.dart'; 7 | 8 | Future fetchEpisode(int id) async { 9 | final response = 10 | await http.get(Uri.parse("$urlTv$id?api_key=$apiKey&language=it")); 11 | 12 | if (response.statusCode == 200) { 13 | return SeasonModel.fromJson(jsonDecode(response.body)); 14 | } else { 15 | throw Exception('Failed to load season'); 16 | } 17 | } 18 | 19 | Future> fetchListEpisode(int id, String? season) async { 20 | season = season ?? "1"; 21 | season = season.replaceAll("Stagione ", ""); 22 | final response = 23 | await http.get(Uri.parse("$urlTv$id/season/$season?api_key=$apiKey&language=it")); 24 | 25 | if (response.statusCode == 200) { 26 | List list = []; 27 | var ris = jsonDecode(response.body); 28 | 29 | for (var episodio in ris["episodes"]) { 30 | list.add(EpisodioModel(episodio["episode_number"], episodio["name"], 31 | "https://image.tmdb.org/t/p/w500/${episodio["still_path"]}")); 32 | } 33 | 34 | return list; 35 | } else { 36 | throw Exception('Failed to load episodes'); 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /lib/controller/provider/altadefinizione.dart: -------------------------------------------------------------------------------- 1 | import 'package:bot_toast/bot_toast.dart'; 2 | import 'package:flutter/material.dart'; 3 | import 'package:loader_overlay/loader_overlay.dart'; 4 | import 'package:tmdb_dart/tmdb_dart.dart'; 5 | import 'package:html/parser.dart'; 6 | import '../../commons/vars.dart'; 7 | import 'package:flutter_tv/widget/channel_list.dart'; 8 | import 'package:http/http.dart' as http; 9 | 10 | String urlAltadefinizione = 11 | "https://altadefinizione.haus/index.php?do=search&subaction=search&story="; 12 | 13 | Future altadefinizioneProvider( 14 | BuildContext context, MovieBase movie) async { 15 | context.loaderOverlay.show(); 16 | String query = movie.title.replaceAll(" ", "%20"); 17 | query = query.replaceAll("'", "%27"); 18 | 19 | final filmResponse = await http.get( 20 | Uri.parse('$urlAltadefinizione$query&sortby=news_read'), 21 | headers: {"user-agent": userAgent}, 22 | ); 23 | 24 | if (filmResponse.statusCode == 200) { 25 | var document = parse(filmResponse.body); 26 | var link = document.getElementsByClassName("titleFilm").first; 27 | 28 | String? filmPageUrl = link.children.first.attributes["href"]; 29 | if (filmPageUrl != null) { 30 | final channelResponse = await http 31 | .get(Uri.parse(filmPageUrl), headers: {"user-agent": userAgent}); 32 | if (channelResponse.statusCode == 200) { 33 | document = parse(channelResponse.body); 34 | var link = document 35 | .getElementsByClassName("player-container-wrap guardahd-player") 36 | .first 37 | .children 38 | .first 39 | .attributes["src"]; 40 | 41 | if (link != null) { 42 | final videoResponse = await http 43 | .get(Uri.parse(link), headers: {"user-agent": userAgent}); 44 | if (videoResponse.statusCode == 200) { 45 | document = parse(videoResponse.body); 46 | var links = document 47 | .getElementsByClassName("_player-mirrors") 48 | .first 49 | .children; 50 | List canaliNomi = []; 51 | List canaliLink = []; 52 | for (var canale in links) { 53 | canaliNomi.add(canale.text); 54 | canaliLink.add(canale.attributes["data-link"]); 55 | } 56 | 57 | showChannelMenu(context, canaliNomi, canaliLink); 58 | } else { 59 | BotToast.showSimpleNotification( 60 | title: 61 | "C'è stato un errore nel recuperare i link - Errore: ${videoResponse.statusCode}", 62 | backgroundColor: Colors.white, 63 | ); 64 | } 65 | } else { 66 | BotToast.showSimpleNotification( 67 | title: "Non sono stati trovati link", 68 | backgroundColor: Colors.white, 69 | ); 70 | } 71 | } else { 72 | BotToast.showSimpleNotification( 73 | title: 74 | "C'è stato un errore nel recuperare il film - Errore: ${channelResponse.statusCode}", 75 | backgroundColor: Colors.white, 76 | ); 77 | } 78 | } else { 79 | BotToast.showSimpleNotification( 80 | title: "Non è stato trovato il link del film.", 81 | backgroundColor: Colors.white, 82 | ); 83 | } 84 | } else { 85 | BotToast.showSimpleNotification( 86 | title: 87 | "C'è stato un errore nel recuperare il film - Errore: ${filmResponse.statusCode}", 88 | backgroundColor: Colors.white, 89 | ); 90 | } 91 | context.loaderOverlay.hide(); 92 | } 93 | -------------------------------------------------------------------------------- /lib/controller/provider/cb01_film.dart: -------------------------------------------------------------------------------- 1 | import 'package:bot_toast/bot_toast.dart'; 2 | import 'package:flutter/material.dart'; 3 | import 'package:loader_overlay/loader_overlay.dart'; 4 | import 'package:tmdb_dart/tmdb_dart.dart'; 5 | import 'package:html/parser.dart'; 6 | import '../../commons/vars.dart'; 7 | import 'package:flutter_tv/widget/channel_list.dart'; 8 | import 'package:http/http.dart' as http; 9 | 10 | String urlCB01 = "https://cb01.institute/?s="; 11 | 12 | Future cb01FilmProvider(BuildContext context, MovieBase movie) async { 13 | context.loaderOverlay.show(); 14 | 15 | String query = movie.title.replaceAll(" ", "+"); 16 | query = query.replaceAll("'", "%27"); 17 | 18 | final filmResponse = await http.get( 19 | Uri.parse('$urlCB01$query'), 20 | headers: {"user-agent": userAgent}, 21 | ); 22 | 23 | if (filmResponse.statusCode == 200) { 24 | var document = parse(filmResponse.body); 25 | var link = document.getElementsByClassName("sequex-one-columns"); 26 | 27 | String? linkPage; 28 | 29 | for (var tile in link) { 30 | for (var anchor in tile.querySelectorAll("a").where( 31 | (element) => element.text.contains(movie.title), 32 | )) { 33 | linkPage = anchor.attributes["href"]; 34 | } 35 | } 36 | 37 | print(linkPage); 38 | 39 | if (linkPage != null) { 40 | final pageResponse = await http.get( 41 | Uri.parse(linkPage), 42 | headers: {"user-agent": userAgent}, 43 | ); 44 | var doc = parse(pageResponse.body); 45 | 46 | try {} catch (_) { 47 | BotToast.showSimpleNotification( 48 | title: "Non sono stati trovati link a questo episodio", 49 | backgroundColor: Colors.white, 50 | ); 51 | } 52 | 53 | /// 54 | } else { 55 | BotToast.showSimpleNotification( 56 | title: "Non è stata trovata la pagina della serie", 57 | backgroundColor: Colors.white, 58 | ); 59 | } 60 | } else { 61 | BotToast.showSimpleNotification( 62 | title: 63 | "C'è stato un errore nel recuperare il film - Errore: ${filmResponse.statusCode}", 64 | backgroundColor: Colors.white, 65 | ); 66 | } 67 | context.loaderOverlay.hide(); 68 | } 69 | -------------------------------------------------------------------------------- /lib/controller/provider/guardaserie.dart: -------------------------------------------------------------------------------- 1 | import 'package:bot_toast/bot_toast.dart'; 2 | import 'package:flutter/material.dart'; 3 | import 'package:loader_overlay/loader_overlay.dart'; 4 | import 'package:tmdb_dart/tmdb_dart.dart'; 5 | import 'package:html/parser.dart'; 6 | import '../../commons/vars.dart'; 7 | import 'package:flutter_tv/widget/channel_list.dart'; 8 | import 'package:http/http.dart' as http; 9 | 10 | String urlGuardaserie = 11 | "https://guardaserie.one/index.php?do=search&subaction=search&story="; 12 | String urlGuardaserieShort = "https://guardaserie.one"; 13 | 14 | Future guardaserieProvider( 15 | BuildContext context, TvBase movie, int episode, String season) async { 16 | context.loaderOverlay.show(); 17 | 18 | String query = movie.name.replaceAll(" ", "%20"); 19 | query = query.replaceAll("'", "%27"); 20 | 21 | final filmResponse = await http.get( 22 | Uri.parse('$urlGuardaserie$query'), 23 | headers: {"user-agent": userAgent}, 24 | ); 25 | 26 | if (filmResponse.statusCode == 200) { 27 | var document = parse(filmResponse.body); 28 | var link = document.getElementsByClassName("mlnew-list"); 29 | 30 | String? linkPage; 31 | 32 | for (var tile in link) { 33 | for (var anchor in tile.querySelectorAll("a").where( 34 | (element) => element.text.contains(movie.name), 35 | )) { 36 | linkPage = anchor.attributes["href"]; 37 | } 38 | } 39 | 40 | if (linkPage != null) { 41 | final pageResponse = await http.get( 42 | Uri.parse(linkPage), 43 | headers: {"user-agent": userAgent}, 44 | ); 45 | var doc = parse(pageResponse.body); 46 | 47 | try { 48 | var episodes = doc.getElementsByClassName("tt_series").first; 49 | var episodesSeason = episodes.children.last.children; 50 | 51 | var seasonLinks = episodesSeason 52 | .where((element) => element.attributes["id"] == "season-$season"); 53 | 54 | var links = seasonLinks.first.children.first.children 55 | .where((element) => element.children.first.text == "$episode") 56 | .first 57 | .children 58 | .last 59 | .children; 60 | 61 | List canaliNomi = []; 62 | List canaliLink = []; 63 | 64 | canaliNomi = links.map((e) => e.text).toList(); 65 | canaliLink = links.map((e) { 66 | if (e.attributes["data-link"] == null) { 67 | return urlGuardaserie; 68 | } else { 69 | if (e.attributes["data-link"]!.contains("http")) { 70 | return e.attributes["data-link"]; 71 | } else { 72 | return "$urlGuardaserieShort${e.attributes["data-link"]}"; 73 | } 74 | } 75 | }).toList(); 76 | 77 | showChannelMenu(context, canaliNomi, canaliLink); 78 | } catch (_) { 79 | BotToast.showSimpleNotification( 80 | title: "Non sono stati trovati link a questo episodio", 81 | backgroundColor: Colors.white, 82 | ); 83 | } 84 | 85 | /// 86 | } else { 87 | BotToast.showSimpleNotification( 88 | title: "Non è stata trovata la pagina della serie", 89 | backgroundColor: Colors.white, 90 | ); 91 | } 92 | } else { 93 | BotToast.showSimpleNotification( 94 | title: 95 | "C'è stato un errore nel recuperare il film - Errore: ${filmResponse.statusCode}", 96 | backgroundColor: Colors.white, 97 | ); 98 | } 99 | context.loaderOverlay.hide(); 100 | } 101 | -------------------------------------------------------------------------------- /lib/controller/tmdb.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter_tv/commons/vars.dart'; 2 | import 'package:tmdb_dart/tmdb_dart.dart'; 3 | 4 | class MoviePopular { 5 | static List movieResult = []; 6 | static List serieResult = []; 7 | } 8 | 9 | Future tmdbFilm() async { 10 | TmdbService service = TmdbService(apiKey); 11 | await service.initConfiguration(); 12 | 13 | var pageMovieResult = await service.movie 14 | .getPopular(page: 1, settings: const MovieSearchSettings(language: "it")); 15 | MoviePopular.movieResult = pageMovieResult.results; 16 | } 17 | 18 | Future tmdbSerie() async { 19 | TmdbService service = TmdbService(apiKey); 20 | await service.initConfiguration(); 21 | 22 | var pagedTvResult = await service.tv 23 | .getTopRated(page: 1, settings: const TvSearchSettings(language: "it")); 24 | 25 | MoviePopular.serieResult = pagedTvResult.results; 26 | } 27 | 28 | Future tmdbSeriePage(int pagina) async { 29 | await Future.delayed(const Duration(seconds: 2)); 30 | TmdbService service = TmdbService(apiKey); 31 | await service.initConfiguration(); 32 | 33 | var pagedTvResult = await service.tv.getTopRated( 34 | page: pagina, settings: const TvSearchSettings(language: "it")); 35 | 36 | MoviePopular.serieResult = pagedTvResult.results; 37 | } 38 | 39 | Future tmdbFilmPage(int pagina) async { 40 | TmdbService service = TmdbService(apiKey); 41 | await service.initConfiguration(); 42 | 43 | var pageMovieResult = await service.movie.getPopular( 44 | page: pagina, settings: const MovieSearchSettings(language: "it")); 45 | 46 | MoviePopular.movieResult = pageMovieResult.results; 47 | } 48 | 49 | Future cercaFilmVal(String film) async { 50 | TmdbService service = TmdbService(apiKey); 51 | await service.initConfiguration(); 52 | 53 | var pageMovieResult = await service.movie.search(film); 54 | 55 | MoviePopular.movieResult = pageMovieResult.results; 56 | } 57 | 58 | Future cercaSerieVal(String serie) async { 59 | TmdbService service = TmdbService(apiKey); 60 | await service.initConfiguration(); 61 | 62 | var pageMovieResult = await service.tv.search(serie); 63 | 64 | MoviePopular.serieResult = pageMovieResult.results; 65 | } 66 | -------------------------------------------------------------------------------- /lib/controller/web_loader.dart: -------------------------------------------------------------------------------- 1 | import 'package:bot_toast/bot_toast.dart'; 2 | import 'package:flutter_inappwebview/flutter_inappwebview.dart'; 3 | 4 | Future> getEntriesFrom(String url) async { 5 | List entries = []; 6 | 7 | print("URL: $url"); 8 | 9 | String javaScript = '''var resource = window.performance.getEntries(); 10 | 11 | resource.forEach(function(x) { 12 | console.log(x.name); 13 | }); 14 | '''; 15 | 16 | HeadlessInAppWebView headlessWebView = HeadlessInAppWebView( 17 | initialUrlRequest: URLRequest(url: Uri.parse(url)), 18 | onProgressChanged: (controller, progress) => 19 | BotToast.showText(text: "$progress%", onlyOne: false), 20 | onConsoleMessage: (controller, consoleMessage) { 21 | print(consoleMessage.message); 22 | }, 23 | onLoadStop: (controller, url) async { 24 | print("Caricato $url"); 25 | controller.evaluateJavascript(source: javaScript); 26 | }, 27 | ); 28 | 29 | await headlessWebView.run(); 30 | 31 | await headlessWebView.webViewController 32 | .evaluateJavascript(source: javaScript); 33 | 34 | headlessWebView.dispose(); 35 | return entries; 36 | } 37 | -------------------------------------------------------------------------------- /lib/main.dart: -------------------------------------------------------------------------------- 1 | import 'dart:io'; 2 | import 'package:bot_toast/bot_toast.dart'; 3 | import 'package:flutter/foundation.dart'; 4 | import 'package:flutter_inappwebview/flutter_inappwebview.dart'; 5 | import 'package:flutter_native_splash/flutter_native_splash.dart'; 6 | 7 | import 'package:flutter/material.dart'; 8 | import 'package:flutter_tv/commons/vars.dart'; 9 | import 'package:flutter_tv/pages/home_page.dart'; 10 | import 'package:upgrader/upgrader.dart'; 11 | 12 | void main(List args) { 13 | WidgetsBinding widgetsBinding = WidgetsFlutterBinding.ensureInitialized(); 14 | FlutterNativeSplash.preserve(widgetsBinding: widgetsBinding); 15 | HttpOverrides.global = MyHttpOverrides(); 16 | 17 | runApp(const MainApp()); 18 | } 19 | 20 | class MainApp extends StatelessWidget { 21 | const MainApp({Key? key}) : super(key: key); 22 | 23 | @override 24 | Widget build(BuildContext context) { 25 | final cfg = AppcastConfiguration(url: appcastURL, supportedOS: ['android']); 26 | 27 | return MaterialApp( 28 | builder: BotToastInit(), 29 | navigatorObservers: [BotToastNavigatorObserver()], 30 | home: UpgradeAlert( 31 | upgrader: Upgrader( 32 | countryCode: "it", 33 | languageCode: "it", 34 | appcastConfig: cfg, 35 | durationUntilAlertAgain: const Duration(seconds: 5), 36 | messages: UpgraderMessages(code: 'it'), 37 | showIgnore: false, 38 | ), 39 | child: const HomePage(), 40 | ), 41 | title: "Flutter TV", 42 | theme: ThemeData( 43 | primarySwatch: Colors.green, 44 | ), 45 | ); 46 | } 47 | } 48 | 49 | class MyHttpOverrides extends HttpOverrides { 50 | @override 51 | HttpClient createHttpClient(SecurityContext? context) { 52 | return super.createHttpClient(context) 53 | ..badCertificateCallback = (cert, host, port) => true; 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /lib/model/channel_model.dart: -------------------------------------------------------------------------------- 1 | class ChannelModel { 2 | String nome; 3 | String link; 4 | String image; 5 | 6 | ChannelModel({ 7 | this.nome = ":(", 8 | this.image = 9 | "https://www.messoanuovo.it/wp-content/uploads/2022/05/watch-free-iptv-online-with-tablet-pc-smartphone-laptop-tv-min.jpg", 10 | required this.link, 11 | }); 12 | } 13 | -------------------------------------------------------------------------------- /lib/model/episodio_model.dart: -------------------------------------------------------------------------------- 1 | // ignore_for_file: non_constant_identifier_names 2 | 3 | class EpisodioModel { 4 | int episode_number; 5 | String name; 6 | String poster; 7 | 8 | EpisodioModel(this.episode_number, this.name, [this.poster = ""]); 9 | } 10 | -------------------------------------------------------------------------------- /lib/model/film_model.dart: -------------------------------------------------------------------------------- 1 | class FilmModel{ 2 | 3 | } -------------------------------------------------------------------------------- /lib/model/popular_serie.dart: -------------------------------------------------------------------------------- 1 | class PopularSerieModel { 2 | int? page; 3 | List? results; 4 | int? totalPages; 5 | int? totalResults; 6 | 7 | PopularSerieModel( 8 | {this.page, this.results, this.totalPages, this.totalResults}); 9 | 10 | PopularSerieModel.fromJson(Map json) { 11 | page = json['page']; 12 | if (json['results'] != null) { 13 | results = []; 14 | json['results'].forEach((v) { 15 | results!.add(Results.fromJson(v)); 16 | }); 17 | } 18 | totalPages = json['total_pages']; 19 | totalResults = json['total_results']; 20 | } 21 | 22 | Map toJson() { 23 | final Map data = {}; 24 | data['page'] = page; 25 | if (results != null) { 26 | data['results'] = results!.map((v) => v.toJson()).toList(); 27 | } 28 | data['total_pages'] = totalPages; 29 | data['total_results'] = totalResults; 30 | return data; 31 | } 32 | } 33 | 34 | class Results { 35 | String? backdropPath; 36 | String? firstAirDate; 37 | List? genreIds; 38 | int? id; 39 | String? name; 40 | List? originCountry; 41 | String? originalLanguage; 42 | String? originalName; 43 | String? overview; 44 | double? popularity; 45 | String? posterPath; 46 | double? voteAverage; 47 | int? voteCount; 48 | 49 | Results( 50 | {this.backdropPath, 51 | this.firstAirDate, 52 | this.genreIds, 53 | this.id, 54 | this.name, 55 | this.originCountry, 56 | this.originalLanguage, 57 | this.originalName, 58 | this.overview, 59 | this.popularity, 60 | this.posterPath, 61 | this.voteAverage, 62 | this.voteCount}); 63 | 64 | Results.fromJson(Map json) { 65 | backdropPath = json['backdrop_path']; 66 | firstAirDate = json['first_air_date']; 67 | genreIds = json['genre_ids'].cast(); 68 | id = json['id']; 69 | name = json['name']; 70 | originCountry = json['origin_country'].cast(); 71 | originalLanguage = json['original_language']; 72 | originalName = json['original_name']; 73 | overview = json['overview']; 74 | popularity = json['popularity']; 75 | posterPath = json['poster_path']; 76 | voteAverage = json['vote_average']; 77 | voteCount = json['vote_count']; 78 | } 79 | 80 | Map toJson() { 81 | final Map data = {}; 82 | data['backdrop_path'] = backdropPath; 83 | data['first_air_date'] = firstAirDate; 84 | data['genre_ids'] = genreIds; 85 | data['id'] = id; 86 | data['name'] = name; 87 | data['origin_country'] = originCountry; 88 | data['original_language'] = originalLanguage; 89 | data['original_name'] = originalName; 90 | data['overview'] = overview; 91 | data['popularity'] = popularity; 92 | data['poster_path'] = posterPath; 93 | data['vote_average'] = voteAverage; 94 | data['vote_count'] = voteCount; 95 | return data; 96 | } 97 | } 98 | -------------------------------------------------------------------------------- /lib/model/season_model.dart: -------------------------------------------------------------------------------- 1 | // ignore_for_file: non_constant_identifier_names 2 | 3 | class SeasonModel { 4 | int number_of_seasons; 5 | int number_of_episodes; 6 | bool in_production; 7 | List seasons; 8 | 9 | SeasonModel(this.number_of_episodes, this.number_of_seasons, this.seasons, 10 | this.in_production); 11 | 12 | factory SeasonModel.fromJson(Map json) { 13 | return SeasonModel(json["number_of_episodes"], json["number_of_seasons"], 14 | json["seasons"], json["in_production"]); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /lib/pages/film/film_details.dart: -------------------------------------------------------------------------------- 1 | // ignore_for_file: must_be_immutable, use_build_context_synchronously 2 | 3 | import 'dart:ui' as ui; 4 | 5 | import 'package:flutter/material.dart'; 6 | import 'package:flutter_tv/commons/vars.dart'; 7 | import 'package:loader_overlay/loader_overlay.dart'; 8 | import 'package:tmdb_dart/tmdb_dart.dart'; 9 | 10 | import '../../controller/provider/altadefinizione.dart'; 11 | import '../../controller/provider/cb01_film.dart'; 12 | 13 | class MoviePage extends StatelessWidget { 14 | final MovieBase movie; 15 | 16 | const MoviePage(this.movie, {super.key}); 17 | 18 | @override 19 | Widget build(BuildContext context) { 20 | return Scaffold( 21 | backgroundColor: bgColor, 22 | body: MediaQuery.removePadding( 23 | removeTop: true, 24 | context: context, 25 | child: LoaderOverlay( 26 | overlayColor: Colors.black, 27 | overlayOpacity: 0.8, 28 | child: ListView( 29 | children: [ 30 | MovieThumbnail(movie.backdropPath), 31 | MovieHeaderWithPoster(movie), 32 | const HorizontalLine(), 33 | MoviePeople(movie), 34 | MovieFeedback(movie), 35 | ], 36 | ), 37 | ), 38 | ), 39 | ); 40 | } 41 | } 42 | 43 | class MovieThumbnail extends StatelessWidget { 44 | final String? thumbnail; 45 | 46 | const MovieThumbnail(this.thumbnail, {super.key}); 47 | 48 | @override 49 | Widget build(BuildContext context) { 50 | return Stack( 51 | alignment: Alignment.bottomCenter, 52 | children: [ 53 | Stack( 54 | alignment: Alignment.center, 55 | children: [ 56 | Padding( 57 | padding: const EdgeInsets.only(bottom: 1), 58 | child: Image.network(thumbnail!), 59 | ), 60 | // const Icon( 61 | // Icons.play_circle_outline, 62 | // size: 100, 63 | // color: Colors.white, 64 | // ), 65 | ], 66 | ), 67 | Container( 68 | decoration: const BoxDecoration( 69 | gradient: LinearGradient( 70 | colors: [ui.Color.fromARGB(17, 114, 158, 105), bgColor], 71 | begin: Alignment.topCenter, 72 | end: Alignment.bottomCenter, 73 | ), 74 | ), 75 | height: 80, 76 | ) 77 | ], 78 | ); 79 | } 80 | } 81 | 82 | class MovieHeaderWithPoster extends StatelessWidget { 83 | final MovieBase movie; 84 | 85 | const MovieHeaderWithPoster(this.movie, {super.key}); 86 | 87 | @override 88 | Widget build(BuildContext context) { 89 | return Padding( 90 | padding: const EdgeInsets.symmetric(horizontal: 16), 91 | child: Row( 92 | children: [ 93 | MoviePoster(movie.posterPath!), 94 | const SizedBox(width: 16), 95 | Expanded( 96 | child: MovieHeader(movie), 97 | ), 98 | ], 99 | ), 100 | ); 101 | } 102 | } 103 | 104 | class MoviePoster extends StatelessWidget { 105 | final String poster; 106 | 107 | const MoviePoster(this.poster, {super.key}); 108 | 109 | @override 110 | Widget build(BuildContext context) { 111 | var borderRadius = const BorderRadius.all(Radius.circular(10)); 112 | return Card( 113 | shape: RoundedRectangleBorder(borderRadius: borderRadius), 114 | elevation: 8, 115 | child: ClipRRect( 116 | borderRadius: borderRadius, 117 | child: Image.network( 118 | poster, 119 | height: 160, 120 | ), 121 | ), 122 | ); 123 | } 124 | } 125 | 126 | class MovieHeader extends StatelessWidget { 127 | const MovieHeader(this.movie, {super.key}); 128 | 129 | final MovieBase movie; 130 | 131 | @override 132 | Widget build(BuildContext context) { 133 | return Column( 134 | crossAxisAlignment: CrossAxisAlignment.start, 135 | children: [ 136 | Text( 137 | "${movie.releaseDate} · ${movie.voteAverage}".toUpperCase(), 138 | style: const TextStyle( 139 | fontWeight: FontWeight.w400, 140 | color: primary, 141 | ), 142 | ), 143 | Text( 144 | movie.title, 145 | style: const TextStyle( 146 | fontSize: 32, fontWeight: FontWeight.w500, color: Colors.white), 147 | ), 148 | //const Rating(3), 149 | Padding( 150 | padding: const EdgeInsets.symmetric(vertical: 18), 151 | child: Text.rich( 152 | TextSpan( 153 | style: const TextStyle(fontSize: 11, fontWeight: FontWeight.w300), 154 | children: [ 155 | TextSpan( 156 | text: movie.overview, 157 | style: const TextStyle(color: Colors.white, fontSize: 14)), 158 | // const TextSpan( 159 | // text: "More...", 160 | // style: TextStyle(color: Colors.indigoAccent), 161 | // ), 162 | ], 163 | ), 164 | ), 165 | ) 166 | ], 167 | ); 168 | } 169 | } 170 | 171 | class Rating extends StatelessWidget { 172 | final int rating; 173 | 174 | const Rating(this.rating, {super.key}); 175 | 176 | @override 177 | Widget build(BuildContext context) { 178 | return Row( 179 | children: Iterable.generate( 180 | 5, 181 | (i) => ShaderMask( 182 | shaderCallback: shader, 183 | child: Icon( 184 | i < rating ? Icons.star : Icons.star_border, 185 | size: 24, 186 | color: Colors.yellow, 187 | ), 188 | ), 189 | ).toList(), 190 | ); 191 | } 192 | 193 | ui.Shader shader(Rect rect) => ui.Gradient.linear( 194 | const Offset(0, 0), 195 | Offset(0, rect.height), 196 | [Colors.yellowAccent, Colors.orange], 197 | ); 198 | } 199 | 200 | class HorizontalLine extends StatelessWidget { 201 | const HorizontalLine({super.key}); 202 | 203 | @override 204 | Widget build(BuildContext context) { 205 | return Padding( 206 | padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 12), 207 | child: Container( 208 | height: 0.5, 209 | color: Colors.white12, 210 | ), 211 | ); 212 | } 213 | } 214 | 215 | class MoviePeople extends StatelessWidget { 216 | final MovieBase movie; 217 | 218 | const MoviePeople(this.movie, {super.key}); 219 | 220 | @override 221 | Widget build(BuildContext context) { 222 | return Padding( 223 | padding: const EdgeInsets.symmetric(horizontal: 16.0), 224 | child: Column( 225 | children: [ 226 | MovieField("Lingua Originale: ", movie.originalLanguage), 227 | ], 228 | ), 229 | ); 230 | } 231 | } 232 | 233 | class MovieField extends StatelessWidget { 234 | final String field; 235 | final String value; 236 | 237 | const MovieField(this.field, this.value, {super.key}); 238 | 239 | @override 240 | Widget build(BuildContext context) { 241 | return Padding( 242 | padding: const EdgeInsets.symmetric(vertical: 8.0), 243 | child: Row( 244 | crossAxisAlignment: CrossAxisAlignment.start, 245 | children: [ 246 | Text("$field: ", 247 | style: const TextStyle( 248 | color: Colors.white38, 249 | fontSize: 12, 250 | fontWeight: FontWeight.w300)), 251 | Expanded( 252 | child: Text( 253 | value, 254 | style: const TextStyle( 255 | color: Colors.white, fontSize: 12, fontWeight: FontWeight.w300), 256 | )) 257 | ], 258 | ), 259 | ); 260 | } 261 | } 262 | 263 | class MovieFeedback extends StatelessWidget { 264 | MovieBase movie; 265 | MovieFeedback(this.movie, {super.key}); 266 | 267 | @override 268 | Widget build(BuildContext context) { 269 | return Padding( 270 | padding: const EdgeInsets.symmetric(vertical: 12), 271 | child: Row( 272 | mainAxisAlignment: MainAxisAlignment.spaceEvenly, 273 | children: [ 274 | FeedbackButton(Icons.play_arrow, "Guarda", movie), 275 | ], 276 | ), 277 | ); 278 | } 279 | } 280 | 281 | class FeedbackButton extends StatelessWidget { 282 | final IconData icon; 283 | final String text; 284 | MovieBase movie; 285 | 286 | FeedbackButton(this.icon, this.text, this.movie, {super.key}); 287 | 288 | @override 289 | Widget build(BuildContext context) { 290 | return InkWell( 291 | onTap: () async { 292 | await altadefinizioneProvider(context, movie); 293 | }, 294 | child: Padding( 295 | padding: const EdgeInsets.all(8.0), 296 | child: Column( 297 | children: [ 298 | Padding( 299 | padding: const EdgeInsets.all(8.0), 300 | child: Icon( 301 | icon, 302 | size: 32, 303 | color: primary, 304 | ), 305 | ), 306 | Text(text, style: const TextStyle(fontSize: 14, color: primary)) 307 | ], 308 | ), 309 | ), 310 | ); 311 | } 312 | } 313 | -------------------------------------------------------------------------------- /lib/pages/film/film_search.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:flutter_tv/commons/vars.dart'; 3 | import 'package:flutter_tv/controller/tmdb.dart'; 4 | import 'package:flutter_tv/pages/film/film_details.dart'; 5 | import 'package:text_scroll/text_scroll.dart'; 6 | 7 | class CercaFilm extends StatefulWidget { 8 | const CercaFilm({Key? key}) : super(key: key); 9 | 10 | @override 11 | CercaFilmState createState() => CercaFilmState(); 12 | } 13 | 14 | class CercaFilmState extends State { 15 | TextEditingController ricerca = TextEditingController(); 16 | 17 | @override 18 | Widget build(BuildContext context) { 19 | return Scaffold( 20 | backgroundColor: bgColor, 21 | body: Column( 22 | children: [ 23 | const SizedBox(height: 50), 24 | Material( 25 | elevation: 5.0, 26 | borderRadius: const BorderRadius.all(Radius.circular(30)), 27 | child: TextField( 28 | controller: ricerca, 29 | cursorColor: primary, 30 | style: dropdownMenuItem, 31 | onChanged: (value) async { 32 | if (value.isNotEmpty) { 33 | await cercaFilmVal(value); 34 | setState(() { 35 | filmCercati = List.of(MoviePopular.movieResult); 36 | }); 37 | } 38 | }, 39 | decoration: const InputDecoration( 40 | hintText: "Cerca Film", 41 | hintStyle: TextStyle(color: Colors.black38, fontSize: 16), 42 | prefixIcon: Material( 43 | elevation: 0.0, 44 | borderRadius: BorderRadius.all(Radius.circular(30)), 45 | child: Icon(Icons.search), 46 | ), 47 | border: InputBorder.none, 48 | contentPadding: 49 | EdgeInsets.symmetric(horizontal: 25, vertical: 13)), 50 | ), 51 | ), 52 | Expanded( 53 | child: GridView.builder( 54 | gridDelegate: const SliverGridDelegateWithFixedCrossAxisCount( 55 | crossAxisCount: 2, 56 | ), 57 | itemCount: filmCercati.length, 58 | scrollDirection: Axis.vertical, 59 | shrinkWrap: true, 60 | itemBuilder: (context, index) { 61 | return Padding( 62 | padding: const EdgeInsets.all(10), 63 | child: InkWell( 64 | onTap: () { 65 | Navigator.push( 66 | context, 67 | MaterialPageRoute( 68 | builder: (context) => 69 | MoviePage(filmCercati[index])), 70 | ); 71 | }, 72 | child: Container( 73 | decoration: BoxDecoration( 74 | color: primary, 75 | borderRadius: BorderRadius.circular(10.0), 76 | image: DecorationImage( 77 | image: NetworkImage( 78 | filmCercati[index].posterPath ?? noImg), 79 | fit: BoxFit.cover, 80 | ), 81 | ), 82 | child: Container( 83 | color: Colors.black.withOpacity(0.5), 84 | width: double.infinity, 85 | child: Row( 86 | crossAxisAlignment: CrossAxisAlignment.end, 87 | mainAxisAlignment: MainAxisAlignment.center, 88 | children: [ 89 | Flexible( 90 | child: Padding( 91 | padding: const EdgeInsets.all(10), 92 | child: TextScroll( 93 | "${filmCercati[index].title} ", 94 | textAlign: TextAlign.center, 95 | velocity: const Velocity( 96 | pixelsPerSecond: Offset(50, 0)), 97 | style: const TextStyle( 98 | color: Colors.white, 99 | fontSize: 20, 100 | fontWeight: FontWeight.bold), 101 | ), 102 | ), 103 | ), 104 | ], 105 | ), 106 | )), 107 | ), 108 | ); 109 | }, 110 | ), 111 | ), 112 | ], 113 | ), 114 | ); 115 | } 116 | } 117 | -------------------------------------------------------------------------------- /lib/pages/film/film_view.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:flutter_tv/commons/vars.dart'; 3 | import 'package:flutter_tv/controller/tmdb.dart'; 4 | import 'package:flutter_tv/widget/film_field.dart'; 5 | import 'package:loader_overlay/loader_overlay.dart'; 6 | 7 | class FilmPopolari extends StatefulWidget { 8 | const FilmPopolari({Key? key}) : super(key: key); 9 | 10 | @override 11 | FilmPopolariState createState() => FilmPopolariState(); 12 | } 13 | 14 | class FilmPopolariState extends State { 15 | int pagina = 1; 16 | TextEditingController ricerca = TextEditingController(); 17 | 18 | @override 19 | void initState() { 20 | super.initState(); 21 | Future.delayed(Duration.zero, () async { 22 | await tmdbFilm(); 23 | setState(() { 24 | filmPopolari = List.of(MoviePopular.movieResult); 25 | }); 26 | }); 27 | } 28 | 29 | @override 30 | Widget build(BuildContext context) { 31 | return LoaderOverlay( 32 | overlayColor: Colors.black, 33 | overlayOpacity: 0.8, 34 | child: SingleChildScrollView( 35 | child: ListView.builder( 36 | itemCount: filmPopolari.length, 37 | shrinkWrap: true, 38 | physics: const NeverScrollableScrollPhysics(), 39 | itemBuilder: (BuildContext context, int index) { 40 | if (index == filmPopolari.length - 1) { 41 | return Padding( 42 | padding: const EdgeInsets.only(bottom: 30), 43 | child: ElevatedButton( 44 | style: ButtonStyle( 45 | backgroundColor: MaterialStateProperty.all(primary), 46 | shape: MaterialStateProperty.all( 47 | RoundedRectangleBorder( 48 | borderRadius: BorderRadius.circular(18.0), 49 | ), 50 | ), 51 | ), 52 | onPressed: () async { 53 | context.loaderOverlay.show(); 54 | pagina = pagina + 1; 55 | await tmdbFilmPage(pagina); 56 | setState(() { 57 | filmPopolari.addAll(MoviePopular.movieResult); 58 | }); 59 | await Future.delayed(const Duration(seconds: 2)); 60 | context.loaderOverlay.hide(); 61 | }, 62 | child: const Text( 63 | "Carica Altro", 64 | style: TextStyle(color: Colors.white), 65 | ), 66 | ), 67 | ); 68 | } else { 69 | return BuildMovie( 70 | index: index, 71 | channelList: filmPopolari, 72 | ); 73 | } 74 | }, 75 | ), 76 | ), 77 | ); 78 | } 79 | } 80 | -------------------------------------------------------------------------------- /lib/pages/home_page.dart: -------------------------------------------------------------------------------- 1 | import 'package:animated_bottom_navigation_bar/animated_bottom_navigation_bar.dart'; 2 | import 'package:flutter/material.dart'; 3 | import 'package:flutter_native_splash/flutter_native_splash.dart'; 4 | import 'package:flutter_tv/commons/vars.dart'; 5 | import 'package:flutter_tv/controller/provider/guardaserie.dart'; 6 | import 'package:flutter_tv/pages/film/film_search.dart'; 7 | import 'package:flutter_tv/pages/film/film_view.dart'; 8 | import 'package:flutter_tv/pages/serie/serie_search.dart'; 9 | import 'package:flutter_tv/pages/serie/series_view.dart'; 10 | import 'package:flutter_tv/pages/settings_page.dart'; 11 | 12 | class HomePage extends StatefulWidget { 13 | const HomePage({Key? key}) : super(key: key); 14 | 15 | @override 16 | HomePageState createState() => HomePageState(); 17 | } 18 | 19 | class HomePageState extends State { 20 | int _bottomNavIndex = 0; 21 | 22 | @override 23 | Widget build(BuildContext context) { 24 | FlutterNativeSplash.remove(); 25 | return Scaffold( 26 | backgroundColor: bgColor, 27 | appBar: AppBar( 28 | backgroundColor: primary, 29 | shape: const RoundedRectangleBorder( 30 | borderRadius: BorderRadius.vertical( 31 | bottom: Radius.circular(20), 32 | ), 33 | ), 34 | centerTitle: true, 35 | leading: IconButton( 36 | onPressed: () { 37 | if (_bottomNavIndex == 0) { 38 | Navigator.push( 39 | context, 40 | MaterialPageRoute( 41 | builder: (context) => const CercaFilm(), 42 | ), 43 | ); 44 | } else { 45 | Navigator.push( 46 | context, 47 | MaterialPageRoute( 48 | builder: (context) => const CercaSerie(), 49 | ), 50 | ); 51 | } 52 | }, 53 | icon: const Icon( 54 | Icons.search, 55 | ), 56 | ), 57 | title: const Text( 58 | "Flutter TV", 59 | style: TextStyle(color: Colors.white), 60 | ), 61 | ), 62 | bottomNavigationBar: AnimatedBottomNavigationBar( 63 | icons: const [Icons.movie, Icons.tv], 64 | activeColor: primary, 65 | activeIndex: _bottomNavIndex, 66 | gapLocation: GapLocation.center, 67 | notchSmoothness: NotchSmoothness.verySmoothEdge, 68 | onTap: (index) => setState(() => _bottomNavIndex = index), 69 | ), 70 | floatingActionButton: FloatingActionButton( 71 | onPressed: () { 72 | Navigator.push( 73 | context, 74 | MaterialPageRoute( 75 | builder: (context) => const SettingsPage(), 76 | ), 77 | ); 78 | }, 79 | backgroundColor: primary, 80 | child: const Icon(Icons.settings), 81 | ), 82 | floatingActionButtonLocation: FloatingActionButtonLocation.centerDocked, 83 | body: _bottomNavIndex == 0 ? const FilmPopolari() : const SeriePopolari(), 84 | ); 85 | } 86 | } 87 | -------------------------------------------------------------------------------- /lib/pages/serie/serie_search.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:flutter_tv/commons/vars.dart'; 3 | import 'package:flutter_tv/controller/tmdb.dart'; 4 | import 'package:flutter_tv/pages/serie/serie_details.dart'; 5 | import 'package:text_scroll/text_scroll.dart'; 6 | 7 | class CercaSerie extends StatefulWidget { 8 | const CercaSerie({Key? key}) : super(key: key); 9 | 10 | @override 11 | CercaSerieState createState() => CercaSerieState(); 12 | } 13 | 14 | class CercaSerieState extends State { 15 | TextEditingController ricerca = TextEditingController(); 16 | 17 | @override 18 | void initState() { 19 | super.initState(); 20 | } 21 | 22 | @override 23 | Widget build(BuildContext context) { 24 | return Scaffold( 25 | backgroundColor: bgColor, 26 | body: Column( 27 | children: [ 28 | const SizedBox(height: 50), 29 | Material( 30 | elevation: 5.0, 31 | borderRadius: const BorderRadius.all(Radius.circular(30)), 32 | child: TextField( 33 | controller: ricerca, 34 | cursorColor: primary, 35 | style: dropdownMenuItem, 36 | onChanged: (value) async { 37 | if (value.isNotEmpty) { 38 | await cercaSerieVal(value); 39 | setState(() { 40 | serieCercati = List.of(MoviePopular.serieResult); 41 | }); 42 | } 43 | }, 44 | decoration: const InputDecoration( 45 | hintText: "Cerca Serie TV", 46 | hintStyle: TextStyle(color: Colors.black38, fontSize: 16), 47 | prefixIcon: Material( 48 | elevation: 0.0, 49 | borderRadius: BorderRadius.all(Radius.circular(30)), 50 | child: Icon(Icons.search), 51 | ), 52 | border: InputBorder.none, 53 | contentPadding: 54 | EdgeInsets.symmetric(horizontal: 25, vertical: 13), 55 | ), 56 | ), 57 | ), 58 | Expanded( 59 | child: GridView.builder( 60 | gridDelegate: const SliverGridDelegateWithFixedCrossAxisCount( 61 | crossAxisCount: 2, 62 | ), 63 | itemCount: serieCercati.length, 64 | scrollDirection: Axis.vertical, 65 | shrinkWrap: true, 66 | itemBuilder: (context, index) { 67 | return Padding( 68 | padding: const EdgeInsets.all(10), 69 | child: InkWell( 70 | onTap: () { 71 | Navigator.push( 72 | context, 73 | MaterialPageRoute( 74 | builder: (context) => 75 | SeriePage(serieCercati[index])), 76 | ); 77 | }, 78 | child: Container( 79 | decoration: BoxDecoration( 80 | color: primary, 81 | borderRadius: BorderRadius.circular(10.0), 82 | image: DecorationImage( 83 | image: NetworkImage( 84 | serieCercati[index].posterPath ?? noImg), 85 | fit: BoxFit.cover, 86 | ), 87 | ), 88 | child: Container( 89 | color: Colors.black.withOpacity(0.5), 90 | width: double.infinity, 91 | child: Row( 92 | crossAxisAlignment: CrossAxisAlignment.end, 93 | mainAxisAlignment: MainAxisAlignment.center, 94 | children: [ 95 | Flexible( 96 | child: Padding( 97 | padding: const EdgeInsets.all(10), 98 | child: TextScroll( 99 | "${serieCercati[index].name} ", 100 | textAlign: TextAlign.center, 101 | velocity: const Velocity( 102 | pixelsPerSecond: Offset(50, 0)), 103 | style: const TextStyle( 104 | color: Colors.white, 105 | fontSize: 20, 106 | fontWeight: FontWeight.bold), 107 | ), 108 | ), 109 | ), 110 | ], 111 | ), 112 | ), 113 | ), 114 | ), 115 | ); 116 | }, 117 | ), 118 | ), 119 | ], 120 | ), 121 | ); 122 | } 123 | } 124 | -------------------------------------------------------------------------------- /lib/pages/serie/series_view.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:flutter_tv/commons/vars.dart'; 3 | import 'package:flutter_tv/controller/tmdb.dart'; 4 | import 'package:flutter_tv/widget/serie_field.dart'; 5 | import 'package:loader_overlay/loader_overlay.dart'; 6 | import 'package:tmdb_dart/tmdb_dart.dart'; 7 | 8 | class SeriePopolari extends StatefulWidget { 9 | const SeriePopolari({Key? key}) : super(key: key); 10 | 11 | @override 12 | SeriePopolariState createState() => SeriePopolariState(); 13 | } 14 | 15 | class SeriePopolariState extends State { 16 | int pagina = 1; 17 | List seriePopolari = []; 18 | 19 | @override 20 | void initState() { 21 | super.initState(); 22 | Future.delayed(Duration.zero, () async { 23 | await tmdbSerie(); 24 | setState(() { 25 | seriePopolari = List.of(MoviePopular.serieResult); 26 | }); 27 | }); 28 | } 29 | 30 | @override 31 | Widget build(BuildContext context) { 32 | return LoaderOverlay( 33 | overlayColor: Colors.black, 34 | overlayOpacity: 0.8, 35 | child: SingleChildScrollView( 36 | child: ListView.builder( 37 | itemCount: seriePopolari.length, 38 | shrinkWrap: true, 39 | physics: const NeverScrollableScrollPhysics(), 40 | itemBuilder: (BuildContext context, int index) { 41 | if (index == seriePopolari.length - 1) { 42 | return Padding( 43 | padding: const EdgeInsets.only(bottom: 30), 44 | child: ElevatedButton( 45 | style: ButtonStyle( 46 | backgroundColor: MaterialStateProperty.all(primary), 47 | shape: MaterialStateProperty.all( 48 | RoundedRectangleBorder( 49 | borderRadius: BorderRadius.circular(18.0), 50 | ))), 51 | onPressed: () async { 52 | context.loaderOverlay.show(); 53 | 54 | pagina = pagina + 1; 55 | 56 | await tmdbSeriePage(pagina); 57 | setState(() { 58 | seriePopolari.addAll(MoviePopular.serieResult); 59 | }); 60 | await Future.delayed(const Duration(seconds: 2)); 61 | context.loaderOverlay.hide(); 62 | }, 63 | child: const Text( 64 | "Carica Altro", 65 | style: TextStyle(color: Colors.white), 66 | ), 67 | ), 68 | ); 69 | } else { 70 | return BuildSerie( 71 | index: index, 72 | channelList: seriePopolari, 73 | ); 74 | } 75 | }, 76 | ), 77 | ), 78 | ); 79 | } 80 | } 81 | -------------------------------------------------------------------------------- /lib/pages/settings_page.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | import '../commons/vars.dart'; 4 | 5 | class SettingsPage extends StatefulWidget { 6 | const SettingsPage({Key? key}) : super(key: key); 7 | 8 | @override 9 | State createState() => _SettingsPageState(); 10 | } 11 | 12 | class _SettingsPageState extends State { 13 | @override 14 | Widget build(BuildContext context) { 15 | return Scaffold( 16 | appBar: AppBar( 17 | backgroundColor: primary, 18 | shape: const RoundedRectangleBorder( 19 | borderRadius: BorderRadius.vertical( 20 | bottom: Radius.circular(20), 21 | ), 22 | ), 23 | centerTitle: true, 24 | leading: IconButton( 25 | onPressed: () { 26 | Navigator.pop(context); 27 | }, 28 | icon: const Icon( 29 | Icons.arrow_back_ios_new, 30 | ), 31 | ), 32 | title: const Text( 33 | "Impostazioni", 34 | style: TextStyle(color: Colors.white), 35 | ), 36 | ), 37 | body: Placeholder(), 38 | ); 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /lib/pages/video_player.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:video_player/video_player.dart'; 3 | 4 | class VideoPlayerWidget extends StatefulWidget { 5 | final String link; 6 | const VideoPlayerWidget({Key? key, required this.link}) : super(key: key); 7 | 8 | @override 9 | State createState() => _VideoPlayerWidgetState(); 10 | } 11 | 12 | class _VideoPlayerWidgetState extends State { 13 | late VideoPlayerController controller; 14 | 15 | @override 16 | void initState() { 17 | super.initState(); 18 | controller = VideoPlayerController.network(widget.link) 19 | ..initialize().then((_) { 20 | setState(() {}); 21 | }); 22 | } 23 | 24 | @override 25 | Widget build(BuildContext context) { 26 | return Scaffold( 27 | body: VideoPlayer(controller), 28 | ); 29 | } 30 | 31 | @override 32 | void dispose() { 33 | super.dispose(); 34 | controller.dispose(); 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /lib/widget/barra_ricerca.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:flutter_tv/commons/vars.dart'; 3 | 4 | Widget barraRIcerca(TextEditingController textController) { 5 | return Padding( 6 | padding: const EdgeInsets.symmetric(horizontal: 20), 7 | child: Material( 8 | elevation: 5.0, 9 | borderRadius: const BorderRadius.all(Radius.circular(30)), 10 | child: TextField( 11 | controller: textController, 12 | cursorColor: primary, 13 | style: dropdownMenuItem, 14 | decoration: const InputDecoration( 15 | hintText: "Cerca", 16 | hintStyle: TextStyle(color: Colors.black38, fontSize: 16), 17 | prefixIcon: Material( 18 | elevation: 0.0, 19 | borderRadius: BorderRadius.all(Radius.circular(30)), 20 | child: Icon(Icons.search), 21 | ), 22 | border: InputBorder.none, 23 | contentPadding: EdgeInsets.symmetric(horizontal: 25, vertical: 13)), 24 | ), 25 | ), 26 | ); 27 | } 28 | -------------------------------------------------------------------------------- /lib/widget/channel_card.dart: -------------------------------------------------------------------------------- 1 | // ignore_for_file: must_be_immutable 2 | 3 | import 'package:flutter/material.dart'; 4 | import 'package:flutter_tv/model/channel_model.dart'; 5 | import 'package:flutter_tv/pages/video_player.dart'; 6 | 7 | class ChannelCard extends StatefulWidget { 8 | ChannelModel channel; 9 | 10 | ChannelCard({super.key, required this.channel}); 11 | 12 | @override 13 | State createState() => _ChannelCardState(); 14 | } 15 | 16 | class _ChannelCardState extends State { 17 | @override 18 | Widget build(BuildContext context) { 19 | return InkWell( 20 | onTap: () { 21 | Navigator.push( 22 | context, 23 | MaterialPageRoute( 24 | builder: (context) => VideoPlayerWidget( 25 | link: widget.channel.link, 26 | ), 27 | ), 28 | ); 29 | }, 30 | child: Card( 31 | margin: const EdgeInsets.all(4), 32 | color: const Color(0xffffffff), 33 | shadowColor: const Color(0xff000000), 34 | elevation: 4, 35 | shape: RoundedRectangleBorder( 36 | borderRadius: BorderRadius.circular(12.0), 37 | ), 38 | child: Padding( 39 | padding: const EdgeInsets.all(8), 40 | child: Column( 41 | mainAxisAlignment: MainAxisAlignment.start, 42 | crossAxisAlignment: CrossAxisAlignment.start, 43 | mainAxisSize: MainAxisSize.min, 44 | children: [ 45 | Image( 46 | image: NetworkImage(widget.channel.image), 47 | height: MediaQuery.of(context).size.height * 0.15, 48 | width: MediaQuery.of(context).size.width, 49 | fit: BoxFit.cover, 50 | ), 51 | Expanded( 52 | flex: 1, 53 | child: Padding( 54 | padding: const EdgeInsets.fromLTRB(0, 8, 0, 0), 55 | child: Column( 56 | mainAxisAlignment: MainAxisAlignment.start, 57 | crossAxisAlignment: CrossAxisAlignment.start, 58 | mainAxisSize: MainAxisSize.min, 59 | children: [ 60 | Text( 61 | widget.channel.nome, 62 | textAlign: TextAlign.start, 63 | maxLines: 1, 64 | overflow: TextOverflow.clip, 65 | style: const TextStyle( 66 | fontWeight: FontWeight.w700, 67 | fontStyle: FontStyle.normal, 68 | fontSize: 16, 69 | color: Color(0xff000000), 70 | ), 71 | ), 72 | /*Expanded( 73 | flex: 1, 74 | child: Row( 75 | mainAxisAlignment: MainAxisAlignment.start, 76 | crossAxisAlignment: CrossAxisAlignment.center, 77 | mainAxisSize: MainAxisSize.max, 78 | children: [ 79 | Container( 80 | alignment: Alignment.center, 81 | margin: const EdgeInsets.all(0), 82 | padding: const EdgeInsets.all(0), 83 | width: 40, 84 | height: 20, 85 | decoration: BoxDecoration( 86 | color: primary, 87 | shape: BoxShape.rectangle, 88 | borderRadius: BorderRadius.zero, 89 | border: Border.all( 90 | color: const Color(0x4d9e9e9e), width: 1), 91 | ), 92 | child: const Text( 93 | "50%", 94 | textAlign: TextAlign.start, 95 | overflow: TextOverflow.clip, 96 | style: TextStyle( 97 | fontWeight: FontWeight.w400, 98 | fontStyle: FontStyle.normal, 99 | fontSize: 11, 100 | color: Color(0xffffffff), 101 | ), 102 | ), 103 | ), 104 | ], 105 | ), 106 | ),*/ 107 | ], 108 | ), 109 | ), 110 | ), 111 | ], 112 | ), 113 | ), 114 | ), 115 | ); 116 | } 117 | } 118 | -------------------------------------------------------------------------------- /lib/widget/channel_list.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:flutter_tv/commons/vars.dart'; 3 | import 'package:flutter_tv/controller/web_loader.dart'; 4 | 5 | showChannelMenu( 6 | BuildContext parentContext, List canali, List links) { 7 | showModalBottomSheet( 8 | context: parentContext, 9 | backgroundColor: Colors.transparent, 10 | isScrollControlled: true, 11 | builder: (BuildContext context) { 12 | return Column( 13 | mainAxisSize: MainAxisSize.min, 14 | crossAxisAlignment: CrossAxisAlignment.end, 15 | children: [ 16 | Container( 17 | height: 36, 18 | ), 19 | SizedBox( 20 | height: (56 * 6).toDouble(), 21 | child: Container( 22 | decoration: const BoxDecoration( 23 | borderRadius: BorderRadius.only( 24 | topLeft: Radius.circular(16.0), 25 | topRight: Radius.circular(16.0), 26 | ), 27 | color: bgColor, 28 | ), 29 | child: Stack( 30 | alignment: const Alignment(0, 0), 31 | children: [ 32 | Positioned( 33 | child: ListView.builder( 34 | itemCount: canali.length, 35 | physics: const ClampingScrollPhysics(), 36 | itemBuilder: (contextChild, index) { 37 | return ListTile( 38 | title: Text( 39 | canali[index].trim(), 40 | style: const TextStyle(color: Colors.white), 41 | ), 42 | leading: const Icon( 43 | Icons.mail_outline, 44 | color: Colors.white, 45 | ), 46 | onTap: () async { 47 | if (links[index] != null) { 48 | List names = 49 | await getEntriesFrom("${links[index]}"); 50 | /*Navigator.of(context).push( 51 | MaterialPageRoute( 52 | builder: (context) => VideoPlayerWidget( 53 | link: "https:${links[index]!}"), 54 | ), 55 | );*/ 56 | //todo: link to player 57 | } else { 58 | ScaffoldMessenger.of(context).showSnackBar( 59 | const SnackBar( 60 | content: Text( 61 | "Questo link non è disponibile."), 62 | ), 63 | ); 64 | } 65 | }, 66 | ); 67 | }, 68 | ), 69 | ) 70 | ], 71 | ))), 72 | ], 73 | ); 74 | }); 75 | } 76 | 77 | /* 78 | 79 | 80 | ListTile( 81 | title: const Text( 82 | "Drafts", 83 | style: TextStyle(color: Colors.white), 84 | ), 85 | leading: const Icon( 86 | Icons.mail_outline, 87 | color: Colors.white, 88 | ), 89 | onTap: () {}, 90 | ), 91 | 92 | 93 | 94 | */ 95 | -------------------------------------------------------------------------------- /lib/widget/film_field.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:flutter_tv/pages/film/film_details.dart'; 3 | 4 | import '../commons/vars.dart'; 5 | 6 | class BuildMovie extends StatelessWidget { 7 | final int index; 8 | final List channelList; 9 | const BuildMovie({Key? key, required this.index, required this.channelList}) 10 | : super(key: key); 11 | 12 | @override 13 | Widget build(BuildContext context) { 14 | return Padding( 15 | padding: const EdgeInsets.all(10), 16 | child: ListTile( 17 | shape: const RoundedRectangleBorder( 18 | borderRadius: BorderRadius.all( 19 | Radius.circular(10), 20 | ), 21 | ), 22 | onTap: () async { 23 | Navigator.push( 24 | context, 25 | MaterialPageRoute( 26 | builder: (context) => MoviePage(channelList[index]), 27 | ), 28 | ); 29 | }, 30 | leading: Container( 31 | width: 60, 32 | height: 60, 33 | margin: const EdgeInsets.only(right: 15), 34 | decoration: BoxDecoration( 35 | borderRadius: BorderRadius.circular(60), 36 | border: Border.all(width: 3, color: secondary), 37 | image: DecorationImage( 38 | image: NetworkImage(channelList[index].posterPath), 39 | fit: BoxFit.fill), 40 | ), 41 | ), 42 | tileColor: Colors.white, 43 | title: Text( 44 | channelList[index].title, 45 | style: const TextStyle( 46 | color: primary, fontWeight: FontWeight.bold, fontSize: 18), 47 | ), 48 | subtitle: RichText( 49 | text: TextSpan( 50 | children: [ 51 | const WidgetSpan( 52 | child: Icon( 53 | Icons.tag, 54 | size: 14, 55 | color: Colors.black, 56 | ), 57 | ), 58 | TextSpan( 59 | text: " ${channelList[index].releaseDate}", 60 | style: const TextStyle(color: Colors.black), 61 | ), 62 | ], 63 | ), 64 | ), 65 | ), 66 | ); 67 | } 68 | } 69 | -------------------------------------------------------------------------------- /lib/widget/home_field.dart: -------------------------------------------------------------------------------- 1 | import 'package:bot_toast/bot_toast.dart'; 2 | import 'package:flutter/material.dart'; 3 | import 'package:flutter_tv/pages/film/film_view.dart'; 4 | import 'package:flutter_tv/pages/serie/series_view.dart'; 5 | import 'package:url_launcher/url_launcher.dart'; 6 | 7 | import '../commons/vars.dart'; 8 | 9 | class BuildList extends StatelessWidget { 10 | final int index; 11 | final List> channelList; 12 | 13 | const BuildList({Key? key, required this.index, required this.channelList}) 14 | : super(key: key); 15 | 16 | @override 17 | Widget build(BuildContext context) { 18 | return InkWell( 19 | onTap: () async { 20 | String url = channelList[index]['url']; 21 | if (url == "pagina") { 22 | if (channelList[index]['direzione'] == "film") { 23 | Navigator.push( 24 | context, 25 | MaterialPageRoute(builder: (context) => const FilmPopolari()), 26 | ); 27 | } else if (channelList[index]['direzione'] == "serie") { 28 | Navigator.push( 29 | context, 30 | MaterialPageRoute(builder: (context) => const SeriePopolari()), 31 | ); 32 | } 33 | } else { 34 | if (!await launchUrl(Uri.parse(url), mode: LaunchMode.inAppWebView)) { 35 | BotToast.showSimpleNotification( 36 | title: "Non è stao possibile aprire il link", 37 | backgroundColor: Colors.white, 38 | ); 39 | } 40 | } 41 | }, 42 | borderRadius: BorderRadius.circular(25), 43 | child: Container( 44 | decoration: BoxDecoration( 45 | borderRadius: BorderRadius.circular(25), 46 | color: Colors.white, 47 | ), 48 | width: double.infinity, 49 | height: 110, 50 | margin: const EdgeInsets.symmetric(vertical: 10, horizontal: 20), 51 | padding: const EdgeInsets.symmetric(vertical: 10, horizontal: 20), 52 | child: Row( 53 | crossAxisAlignment: CrossAxisAlignment.start, 54 | children: [ 55 | Container( 56 | width: 70, 57 | height: 70, 58 | margin: const EdgeInsets.only(right: 15), 59 | decoration: BoxDecoration( 60 | borderRadius: BorderRadius.circular(50), 61 | border: Border.all(width: 3, color: secondary), 62 | image: DecorationImage( 63 | image: NetworkImage(channelList[index]['img'] ?? noImg), 64 | fit: BoxFit.fill), 65 | ), 66 | ), 67 | Expanded( 68 | child: Column( 69 | crossAxisAlignment: CrossAxisAlignment.start, 70 | children: [ 71 | Text( 72 | channelList[index]['nome'], 73 | style: const TextStyle( 74 | color: primary, 75 | fontWeight: FontWeight.bold, 76 | fontSize: 18), 77 | ), 78 | const SizedBox( 79 | height: 6, 80 | ), 81 | Row( 82 | children: [ 83 | const Icon( 84 | Icons.tag, 85 | color: secondary, 86 | size: 20, 87 | ), 88 | const SizedBox( 89 | width: 5, 90 | ), 91 | Text(channelList[index]['categorie'], 92 | style: const TextStyle( 93 | color: primary, fontSize: 13, letterSpacing: .3)), 94 | ], 95 | ), 96 | const SizedBox( 97 | height: 6, 98 | ), 99 | ], 100 | ), 101 | ) 102 | ], 103 | ), 104 | ), 105 | ); 106 | } 107 | } 108 | -------------------------------------------------------------------------------- /lib/widget/serie_field.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:flutter_tv/pages/serie/serie_details.dart'; 3 | import 'package:tmdb_dart/tmdb_dart.dart'; 4 | 5 | import '../commons/vars.dart'; 6 | 7 | class BuildSerie extends StatelessWidget { 8 | final int index; 9 | final List channelList; 10 | const BuildSerie({Key? key, required this.index, required this.channelList}) 11 | : super(key: key); 12 | 13 | @override 14 | Widget build(BuildContext context) { 15 | return Padding( 16 | padding: const EdgeInsets.all(10), 17 | child: ListTile( 18 | shape: const RoundedRectangleBorder( 19 | borderRadius: BorderRadius.all( 20 | Radius.circular(10), 21 | ), 22 | ), 23 | onTap: () async { 24 | Navigator.push( 25 | context, 26 | MaterialPageRoute( 27 | builder: (context) => SeriePage(channelList[index]), 28 | ), 29 | ); 30 | }, 31 | leading: Container( 32 | width: 60, 33 | height: 60, 34 | margin: const EdgeInsets.only(right: 15), 35 | decoration: BoxDecoration( 36 | borderRadius: BorderRadius.circular(60), 37 | border: Border.all(width: 3, color: secondary), 38 | image: DecorationImage( 39 | image: NetworkImage(channelList[index].posterPath!), 40 | fit: BoxFit.fill), 41 | ), 42 | ), 43 | tileColor: Colors.white, 44 | title: Text( 45 | channelList[index].name, 46 | style: const TextStyle( 47 | color: primary, fontWeight: FontWeight.bold, fontSize: 18), 48 | ), 49 | subtitle: RichText( 50 | text: TextSpan( 51 | children: [ 52 | const WidgetSpan( 53 | child: Icon( 54 | Icons.tag, 55 | size: 14, 56 | color: Colors.black, 57 | ), 58 | ), 59 | TextSpan( 60 | text: " ${channelList[index].firstAirDate}", 61 | style: const TextStyle(color: Colors.black), 62 | ), 63 | ], 64 | ), 65 | ), 66 | ), 67 | ); 68 | } 69 | } 70 | -------------------------------------------------------------------------------- /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 "flutter_tv") 8 | # The unique GTK application identifier for this application. See: 9 | # https://wiki.gnome.org/HowDoI/ChooseApplicationID 10 | set(APPLICATION_ID "it.d4n73.fluttertv") 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, "flutter_tv"); 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, "flutter_tv"); 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 "ephemeral/Flutter-Generated.xcconfig" 2 | -------------------------------------------------------------------------------- /macos/Flutter/Flutter-Release.xcconfig: -------------------------------------------------------------------------------- 1 | #include "ephemeral/Flutter-Generated.xcconfig" 2 | -------------------------------------------------------------------------------- /macos/Flutter/GeneratedPluginRegistrant.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Generated file. Do not edit. 3 | // 4 | 5 | import FlutterMacOS 6 | import Foundation 7 | 8 | import device_info_plus 9 | import package_info_plus 10 | import path_provider_macos 11 | import shared_preferences_macos 12 | import url_launcher_macos 13 | import wakelock_macos 14 | 15 | func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) { 16 | DeviceInfoPlusMacosPlugin.register(with: registry.registrar(forPlugin: "DeviceInfoPlusMacosPlugin")) 17 | FLTPackageInfoPlusPlugin.register(with: registry.registrar(forPlugin: "FLTPackageInfoPlusPlugin")) 18 | PathProviderPlugin.register(with: registry.registrar(forPlugin: "PathProviderPlugin")) 19 | SharedPreferencesPlugin.register(with: registry.registrar(forPlugin: "SharedPreferencesPlugin")) 20 | UrlLauncherPlugin.register(with: registry.registrar(forPlugin: "UrlLauncherPlugin")) 21 | WakelockMacosPlugin.register(with: registry.registrar(forPlugin: "WakelockMacosPlugin")) 22 | } 23 | -------------------------------------------------------------------------------- /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 | 8 | -------------------------------------------------------------------------------- /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/IsD4n73/Flutter-TV/8e6e2740c0cee10f0f11283188798974a86e3ca0/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_1024.png -------------------------------------------------------------------------------- /macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_128.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IsD4n73/Flutter-TV/8e6e2740c0cee10f0f11283188798974a86e3ca0/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_128.png -------------------------------------------------------------------------------- /macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IsD4n73/Flutter-TV/8e6e2740c0cee10f0f11283188798974a86e3ca0/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_16.png -------------------------------------------------------------------------------- /macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_256.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IsD4n73/Flutter-TV/8e6e2740c0cee10f0f11283188798974a86e3ca0/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_256.png -------------------------------------------------------------------------------- /macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IsD4n73/Flutter-TV/8e6e2740c0cee10f0f11283188798974a86e3ca0/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_32.png -------------------------------------------------------------------------------- /macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IsD4n73/Flutter-TV/8e6e2740c0cee10f0f11283188798974a86e3ca0/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_512.png -------------------------------------------------------------------------------- /macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_64.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IsD4n73/Flutter-TV/8e6e2740c0cee10f0f11283188798974a86e3ca0/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 = flutter_tv 9 | 10 | // The application's bundle identifier 11 | PRODUCT_BUNDLE_IDENTIFIER = com.example.flutterTv 12 | 13 | // The copyright displayed in application information 14 | PRODUCT_COPYRIGHT = Copyright © 2022 com.example. All rights reserved. 15 | -------------------------------------------------------------------------------- /macos/Runner/Configs/Debug.xcconfig: -------------------------------------------------------------------------------- 1 | #include "../../Flutter/Flutter-Debug.xcconfig" 2 | #include "Warnings.xcconfig" 3 | -------------------------------------------------------------------------------- /macos/Runner/Configs/Release.xcconfig: -------------------------------------------------------------------------------- 1 | #include "../../Flutter/Flutter-Release.xcconfig" 2 | #include "Warnings.xcconfig" 3 | -------------------------------------------------------------------------------- /macos/Runner/Configs/Warnings.xcconfig: -------------------------------------------------------------------------------- 1 | WARNING_CFLAGS = -Wall -Wconditional-uninitialized -Wnullable-to-nonnull-conversion -Wmissing-method-return-type -Woverlength-strings 2 | GCC_WARN_UNDECLARED_SELECTOR = YES 3 | CLANG_UNDEFINED_BEHAVIOR_SANITIZER_NULLABILITY = YES 4 | CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE 5 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES 6 | CLANG_WARN_PRAGMA_PACK = YES 7 | CLANG_WARN_STRICT_PROTOTYPES = YES 8 | CLANG_WARN_COMMA = YES 9 | GCC_WARN_STRICT_SELECTOR_MATCH = YES 10 | CLANG_WARN_OBJC_REPEATED_USE_OF_WEAK = YES 11 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES 12 | GCC_WARN_SHADOW = YES 13 | CLANG_WARN_UNREACHABLE_CODE = YES 14 | -------------------------------------------------------------------------------- /macos/Runner/DebugProfile.entitlements: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | com.apple.security.app-sandbox 6 | 7 | com.apple.security.cs.allow-jit 8 | 9 | com.apple.security.network.server 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /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 | 8 | 9 | -------------------------------------------------------------------------------- /pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: flutter_tv 2 | description: A new Flutter project. 3 | 4 | # The following line prevents the package from being accidentally published to 5 | # pub.dev using `flutter pub publish`. This is preferred for private packages. 6 | publish_to: 'none' # Remove this line if you wish to publish to pub.dev 7 | 8 | # The following defines the version and build number for your application. 9 | # A version number is three numbers separated by dots, like 1.2.43 10 | # followed by an optional build number separated by a +. 11 | # Both the version and the builder number may be overridden in flutter 12 | # build by specifying --build-name and --build-number, respectively. 13 | # In Android, build-name is used as versionName while build-number used as versionCode. 14 | # Read more about Android versioning at https://developer.android.com/studio/publish/versioning 15 | # In iOS, build-name is used as CFBundleShortVersionString while build-number is used as CFBundleVersion. 16 | # Read more about iOS versioning at 17 | # https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html 18 | # In Windows, build-name is used as the major, minor, and patch parts 19 | # of the product and file versions while build-number is used as the build suffix. 20 | version: 1.6.5+1 21 | 22 | environment: 23 | sdk: '>=2.19.0-0 <4.0.0' 24 | 25 | # Dependencies specify other packages that your package needs in order to work. 26 | # To automatically upgrade your package dependencies to the latest versions 27 | # consider running `flutter pub upgrade --major-versions`. Alternatively, 28 | # dependencies can be manually updated by changing the version numbers below to 29 | # the latest version available on pub.dev. To see which dependencies have newer 30 | # versions available, run `flutter pub outdated`. 31 | dependencies: 32 | flutter: 33 | sdk: flutter 34 | 35 | 36 | # The following adds the Cupertino Icons font to your application. 37 | # Use with the CupertinoIcons class for iOS style icons. 38 | 39 | # UI 40 | cupertino_icons: ^1.0.5 41 | loader_overlay: ^2.2.0 42 | text_scroll: ^0.2.0 43 | dropdown_button2: ^2.1.3 44 | animated_bottom_navigation_bar: ^1.2.0 45 | flutter_native_splash: ^2.3.1 46 | bot_toast: ^4.0.4 47 | 48 | # UTILS 49 | http: ^0.13.3 50 | tmdb_dart: ^0.2.2 51 | url_launcher: ^6.1.11 52 | upgrader: ^7.0.2 53 | version: ^3.0.2 54 | video_player: ^2.6.1 55 | universal_html: ^2.2.3 56 | flutter_inappwebview: ^5.7.2+3 57 | 58 | dev_dependencies: 59 | flutter_test: 60 | sdk: flutter 61 | 62 | # The "flutter_lints" package below contains a set of recommended lints to 63 | # encourage good coding practices. The lint set provided by the package is 64 | # activated in the `analysis_options.yaml` file located at the root of your 65 | # package. See that file for information about deactivating specific lint 66 | # rules and activating additional ones. 67 | flutter_lints: ^2.0.1 68 | 69 | # For information on the generic Dart part of this file, see the 70 | # following page: https://dart.dev/tools/pub/pubspec 71 | 72 | # The following section is specific to Flutter packages. 73 | flutter: 74 | 75 | # The following line ensures that the Material Icons font is 76 | # included with your application, so that you can use the icons in 77 | # the material Icons class. 78 | uses-material-design: true 79 | 80 | # To add assets to your application, add an assets section, like this: 81 | # assets: 82 | # - images/a_dot_burr.jpeg 83 | # - images/a_dot_ham.jpeg 84 | 85 | # An image asset can refer to one or more resolution-specific "variants", see 86 | # https://flutter.dev/assets-and-images/#resolution-aware 87 | 88 | # For details regarding adding assets from package dependencies, see 89 | # https://flutter.dev/assets-and-images/#from-packages 90 | 91 | # To add custom fonts to your application, add a fonts section here, 92 | # in this "flutter" section. Each entry in this list should have a 93 | # "family" key with the font family name, and a "fonts" key with a 94 | # list giving the asset and other descriptors for the font. For 95 | # example: 96 | # fonts: 97 | # - family: Schyler 98 | # fonts: 99 | # - asset: fonts/Schyler-Regular.ttf 100 | # - asset: fonts/Schyler-Italic.ttf 101 | # style: italic 102 | # - family: Trajan Pro 103 | # fonts: 104 | # - asset: fonts/TrajanPro.ttf 105 | # - asset: fonts/TrajanPro_Bold.ttf 106 | # weight: 700 107 | # 108 | # For details regarding fonts from package dependencies, 109 | # see https://flutter.dev/custom-fonts/#from-packages 110 | -------------------------------------------------------------------------------- /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 | import 'package:flutter_tv/pages/home_page.dart'; 11 | 12 | void main() { 13 | testWidgets('Counter increments smoke test', (WidgetTester tester) async { 14 | // Build our app and trigger a frame. 15 | await tester.pumpWidget(const HomePage()); 16 | 17 | // Verify that our counter starts at 0. 18 | expect(find.text('0'), findsOneWidget); 19 | expect(find.text('1'), findsNothing); 20 | 21 | // Tap the '+' icon and trigger a frame. 22 | await tester.tap(find.byIcon(Icons.add)); 23 | await tester.pump(); 24 | 25 | // Verify that our counter has incremented. 26 | expect(find.text('0'), findsNothing); 27 | expect(find.text('1'), findsOneWidget); 28 | }); 29 | } 30 | -------------------------------------------------------------------------------- /web/favicon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IsD4n73/Flutter-TV/8e6e2740c0cee10f0f11283188798974a86e3ca0/web/favicon.png -------------------------------------------------------------------------------- /web/icons/Icon-192.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IsD4n73/Flutter-TV/8e6e2740c0cee10f0f11283188798974a86e3ca0/web/icons/Icon-192.png -------------------------------------------------------------------------------- /web/icons/Icon-512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IsD4n73/Flutter-TV/8e6e2740c0cee10f0f11283188798974a86e3ca0/web/icons/Icon-512.png -------------------------------------------------------------------------------- /web/icons/Icon-maskable-192.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IsD4n73/Flutter-TV/8e6e2740c0cee10f0f11283188798974a86e3ca0/web/icons/Icon-maskable-192.png -------------------------------------------------------------------------------- /web/icons/Icon-maskable-512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IsD4n73/Flutter-TV/8e6e2740c0cee10f0f11283188798974a86e3ca0/web/icons/Icon-maskable-512.png -------------------------------------------------------------------------------- /web/index.html: -------------------------------------------------------------------------------- 1 | 2 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | flutter_tv 31 | 32 | 33 | 37 | 38 | 39 | 40 | 41 | 42 | 101 | 108 | 109 | 110 | 124 | 125 | 126 | -------------------------------------------------------------------------------- /web/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "flutter_tv", 3 | "short_name": "flutter_tv", 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 | -------------------------------------------------------------------------------- /web/splash/img/light-background.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IsD4n73/Flutter-TV/8e6e2740c0cee10f0f11283188798974a86e3ca0/web/splash/img/light-background.png -------------------------------------------------------------------------------- /web/splash/splash.js: -------------------------------------------------------------------------------- 1 | function removeSplashFromWeb() { 2 | document.getElementById("splash")?.remove(); 3 | document.getElementById("splash-branding")?.remove(); 4 | document.body.style.background = "transparent"; 5 | } 6 | -------------------------------------------------------------------------------- /web/splash/style.css: -------------------------------------------------------------------------------- 1 | html { 2 | height: 100% 3 | } 4 | 5 | body { 6 | margin: 0; 7 | min-height: 100%; 8 | background-color: #ffffff; 9 | background-image: url("img/light-background.png"); 10 | background-size: 100% 100%; 11 | } 12 | 13 | .center { 14 | margin: 0; 15 | position: absolute; 16 | top: 50%; 17 | left: 50%; 18 | -ms-transform: translate(-50%, -50%); 19 | transform: translate(-50%, -50%); 20 | } 21 | 22 | .contain { 23 | display:block; 24 | width:100%; height:100%; 25 | object-fit: contain; 26 | } 27 | 28 | .stretch { 29 | display:block; 30 | width:100%; height:100%; 31 | } 32 | 33 | .cover { 34 | display:block; 35 | width:100%; height:100%; 36 | object-fit: cover; 37 | } 38 | 39 | .bottom { 40 | position: absolute; 41 | bottom: 0; 42 | left: 50%; 43 | -ms-transform: translate(-50%, 0); 44 | transform: translate(-50%, 0); 45 | } 46 | 47 | .bottomLeft { 48 | position: absolute; 49 | bottom: 0; 50 | left: 0; 51 | } 52 | 53 | .bottomRight { 54 | position: absolute; 55 | bottom: 0; 56 | right: 0; 57 | } 58 | -------------------------------------------------------------------------------- /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(flutter_tv 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 "flutter_tv") 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 | 11 | void RegisterPlugins(flutter::PluginRegistry* registry) { 12 | UrlLauncherWindowsRegisterWithRegistrar( 13 | registry->GetRegistrarForPlugin("UrlLauncherWindows")); 14 | } 15 | -------------------------------------------------------------------------------- /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 | url_launcher_windows 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}/windows 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}/windows plugins/${ffi_plugin}) 23 | list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${ffi_plugin}_bundled_libraries}) 24 | endforeach(ffi_plugin) 25 | -------------------------------------------------------------------------------- /windows/runner/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.14) 2 | project(runner LANGUAGES CXX) 3 | 4 | # Define the application target. To change its name, change BINARY_NAME in the 5 | # top-level CMakeLists.txt, not the value here, or `flutter run` will no longer 6 | # work. 7 | # 8 | # Any new source files that you add to the application should be added here. 9 | add_executable(${BINARY_NAME} WIN32 10 | "flutter_window.cpp" 11 | "main.cpp" 12 | "utils.cpp" 13 | "win32_window.cpp" 14 | "${FLUTTER_MANAGED_DIR}/generated_plugin_registrant.cc" 15 | "Runner.rc" 16 | "runner.exe.manifest" 17 | ) 18 | 19 | # Apply the standard set of build settings. This can be removed for applications 20 | # that need different build settings. 21 | apply_standard_settings(${BINARY_NAME}) 22 | 23 | # Add preprocessor definitions for the build version. 24 | target_compile_definitions(${BINARY_NAME} PRIVATE "FLUTTER_VERSION=\"${FLUTTER_VERSION}\"") 25 | target_compile_definitions(${BINARY_NAME} PRIVATE "FLUTTER_VERSION_MAJOR=${FLUTTER_VERSION_MAJOR}") 26 | target_compile_definitions(${BINARY_NAME} PRIVATE "FLUTTER_VERSION_MINOR=${FLUTTER_VERSION_MINOR}") 27 | target_compile_definitions(${BINARY_NAME} PRIVATE "FLUTTER_VERSION_PATCH=${FLUTTER_VERSION_PATCH}") 28 | target_compile_definitions(${BINARY_NAME} PRIVATE "FLUTTER_VERSION_BUILD=${FLUTTER_VERSION_BUILD}") 29 | 30 | # Disable Windows macros that collide with C++ standard library functions. 31 | target_compile_definitions(${BINARY_NAME} PRIVATE "NOMINMAX") 32 | 33 | # Add dependency libraries and include directories. Add any application-specific 34 | # dependencies here. 35 | target_link_libraries(${BINARY_NAME} PRIVATE flutter flutter_wrapper_app) 36 | target_include_directories(${BINARY_NAME} PRIVATE "${CMAKE_SOURCE_DIR}") 37 | 38 | # Run the Flutter tool portions of the build. This must not be removed. 39 | add_dependencies(${BINARY_NAME} flutter_assemble) 40 | -------------------------------------------------------------------------------- /windows/runner/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.example" "\0" 93 | VALUE "FileDescription", "flutter_tv" "\0" 94 | VALUE "FileVersion", VERSION_AS_STRING "\0" 95 | VALUE "InternalName", "flutter_tv" "\0" 96 | VALUE "LegalCopyright", "Copyright (C) 2022 com.example. All rights reserved." "\0" 97 | VALUE "OriginalFilename", "flutter_tv.exe" "\0" 98 | VALUE "ProductName", "flutter_tv" "\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 | return true; 30 | } 31 | 32 | void FlutterWindow::OnDestroy() { 33 | if (flutter_controller_) { 34 | flutter_controller_ = nullptr; 35 | } 36 | 37 | Win32Window::OnDestroy(); 38 | } 39 | 40 | LRESULT 41 | FlutterWindow::MessageHandler(HWND hwnd, UINT const message, 42 | WPARAM const wparam, 43 | LPARAM const lparam) noexcept { 44 | // Give Flutter, including plugins, an opportunity to handle window messages. 45 | if (flutter_controller_) { 46 | std::optional result = 47 | flutter_controller_->HandleTopLevelWindowProc(hwnd, message, wparam, 48 | lparam); 49 | if (result) { 50 | return *result; 51 | } 52 | } 53 | 54 | switch (message) { 55 | case WM_FONTCHANGE: 56 | flutter_controller_->engine()->ReloadSystemFonts(); 57 | break; 58 | } 59 | 60 | return Win32Window::MessageHandler(hwnd, message, wparam, lparam); 61 | } 62 | -------------------------------------------------------------------------------- /windows/runner/flutter_window.h: -------------------------------------------------------------------------------- 1 | #ifndef RUNNER_FLUTTER_WINDOW_H_ 2 | #define RUNNER_FLUTTER_WINDOW_H_ 3 | 4 | #include 5 | #include 6 | 7 | #include 8 | 9 | #include "win32_window.h" 10 | 11 | // A window that does nothing but host a Flutter view. 12 | class FlutterWindow : public Win32Window { 13 | public: 14 | // Creates a new FlutterWindow hosting a Flutter view running |project|. 15 | explicit FlutterWindow(const flutter::DartProject& project); 16 | virtual ~FlutterWindow(); 17 | 18 | protected: 19 | // Win32Window: 20 | bool OnCreate() override; 21 | void OnDestroy() override; 22 | LRESULT MessageHandler(HWND window, UINT const message, WPARAM const wparam, 23 | LPARAM const lparam) noexcept override; 24 | 25 | private: 26 | // The project to run. 27 | flutter::DartProject project_; 28 | 29 | // The Flutter instance hosted by this window. 30 | std::unique_ptr flutter_controller_; 31 | }; 32 | 33 | #endif // RUNNER_FLUTTER_WINDOW_H_ 34 | -------------------------------------------------------------------------------- /windows/runner/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | #include "flutter_window.h" 6 | #include "utils.h" 7 | 8 | int APIENTRY wWinMain(_In_ HINSTANCE instance, _In_opt_ HINSTANCE prev, 9 | _In_ wchar_t *command_line, _In_ int show_command) { 10 | // Attach to console when present (e.g., 'flutter run') or create a 11 | // new console when running with a debugger. 12 | if (!::AttachConsole(ATTACH_PARENT_PROCESS) && ::IsDebuggerPresent()) { 13 | CreateAndAttachConsole(); 14 | } 15 | 16 | // Initialize COM, so that it is available for use in the library and/or 17 | // plugins. 18 | ::CoInitializeEx(nullptr, COINIT_APARTMENTTHREADED); 19 | 20 | flutter::DartProject project(L"data"); 21 | 22 | std::vector command_line_arguments = 23 | GetCommandLineArguments(); 24 | 25 | project.set_dart_entrypoint_arguments(std::move(command_line_arguments)); 26 | 27 | FlutterWindow window(project); 28 | Win32Window::Point origin(10, 10); 29 | Win32Window::Size size(1280, 720); 30 | if (!window.CreateAndShow(L"flutter_tv", 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/IsD4n73/Flutter-TV/8e6e2740c0cee10f0f11283188798974a86e3ca0/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.cpp: -------------------------------------------------------------------------------- 1 | #include "win32_window.h" 2 | 3 | #include 4 | 5 | #include "resource.h" 6 | 7 | namespace { 8 | 9 | constexpr const wchar_t kWindowClassName[] = L"FLUTTER_RUNNER_WIN32_WINDOW"; 10 | 11 | // The number of Win32Window objects that currently exist. 12 | static int g_active_window_count = 0; 13 | 14 | using EnableNonClientDpiScaling = BOOL __stdcall(HWND hwnd); 15 | 16 | // Scale helper to convert logical scaler values to physical using passed in 17 | // scale factor 18 | int Scale(int source, double scale_factor) { 19 | return static_cast(source * scale_factor); 20 | } 21 | 22 | // Dynamically loads the |EnableNonClientDpiScaling| from the User32 module. 23 | // This API is only needed for PerMonitor V1 awareness mode. 24 | void EnableFullDpiSupportIfAvailable(HWND hwnd) { 25 | HMODULE user32_module = LoadLibraryA("User32.dll"); 26 | if (!user32_module) { 27 | return; 28 | } 29 | auto enable_non_client_dpi_scaling = 30 | reinterpret_cast( 31 | GetProcAddress(user32_module, "EnableNonClientDpiScaling")); 32 | if (enable_non_client_dpi_scaling != nullptr) { 33 | enable_non_client_dpi_scaling(hwnd); 34 | FreeLibrary(user32_module); 35 | } 36 | } 37 | 38 | } // namespace 39 | 40 | // Manages the Win32Window's window class registration. 41 | class WindowClassRegistrar { 42 | public: 43 | ~WindowClassRegistrar() = default; 44 | 45 | // Returns the singleton registar instance. 46 | static WindowClassRegistrar* GetInstance() { 47 | if (!instance_) { 48 | instance_ = new WindowClassRegistrar(); 49 | } 50 | return instance_; 51 | } 52 | 53 | // Returns the name of the window class, registering the class if it hasn't 54 | // previously been registered. 55 | const wchar_t* GetWindowClass(); 56 | 57 | // Unregisters the window class. Should only be called if there are no 58 | // instances of the window. 59 | void UnregisterWindowClass(); 60 | 61 | private: 62 | WindowClassRegistrar() = default; 63 | 64 | static WindowClassRegistrar* instance_; 65 | 66 | bool class_registered_ = false; 67 | }; 68 | 69 | WindowClassRegistrar* WindowClassRegistrar::instance_ = nullptr; 70 | 71 | const wchar_t* WindowClassRegistrar::GetWindowClass() { 72 | if (!class_registered_) { 73 | WNDCLASS window_class{}; 74 | window_class.hCursor = LoadCursor(nullptr, IDC_ARROW); 75 | window_class.lpszClassName = kWindowClassName; 76 | window_class.style = CS_HREDRAW | CS_VREDRAW; 77 | window_class.cbClsExtra = 0; 78 | window_class.cbWndExtra = 0; 79 | window_class.hInstance = GetModuleHandle(nullptr); 80 | window_class.hIcon = 81 | LoadIcon(window_class.hInstance, MAKEINTRESOURCE(IDI_APP_ICON)); 82 | window_class.hbrBackground = 0; 83 | window_class.lpszMenuName = nullptr; 84 | window_class.lpfnWndProc = Win32Window::WndProc; 85 | RegisterClass(&window_class); 86 | class_registered_ = true; 87 | } 88 | return kWindowClassName; 89 | } 90 | 91 | void WindowClassRegistrar::UnregisterWindowClass() { 92 | UnregisterClass(kWindowClassName, nullptr); 93 | class_registered_ = false; 94 | } 95 | 96 | Win32Window::Win32Window() { 97 | ++g_active_window_count; 98 | } 99 | 100 | Win32Window::~Win32Window() { 101 | --g_active_window_count; 102 | Destroy(); 103 | } 104 | 105 | bool Win32Window::CreateAndShow(const std::wstring& title, 106 | const Point& origin, 107 | const Size& size) { 108 | Destroy(); 109 | 110 | const wchar_t* window_class = 111 | WindowClassRegistrar::GetInstance()->GetWindowClass(); 112 | 113 | const POINT target_point = {static_cast(origin.x), 114 | static_cast(origin.y)}; 115 | HMONITOR monitor = MonitorFromPoint(target_point, MONITOR_DEFAULTTONEAREST); 116 | UINT dpi = FlutterDesktopGetDpiForMonitor(monitor); 117 | double scale_factor = dpi / 96.0; 118 | 119 | HWND window = CreateWindow( 120 | window_class, title.c_str(), WS_OVERLAPPEDWINDOW | WS_VISIBLE, 121 | Scale(origin.x, scale_factor), Scale(origin.y, scale_factor), 122 | Scale(size.width, scale_factor), Scale(size.height, scale_factor), 123 | nullptr, nullptr, GetModuleHandle(nullptr), this); 124 | 125 | if (!window) { 126 | return false; 127 | } 128 | 129 | return OnCreate(); 130 | } 131 | 132 | // static 133 | LRESULT CALLBACK Win32Window::WndProc(HWND const window, 134 | UINT const message, 135 | WPARAM const wparam, 136 | LPARAM const lparam) noexcept { 137 | if (message == WM_NCCREATE) { 138 | auto window_struct = reinterpret_cast(lparam); 139 | SetWindowLongPtr(window, GWLP_USERDATA, 140 | reinterpret_cast(window_struct->lpCreateParams)); 141 | 142 | auto that = static_cast(window_struct->lpCreateParams); 143 | EnableFullDpiSupportIfAvailable(window); 144 | that->window_handle_ = window; 145 | } else if (Win32Window* that = GetThisFromHandle(window)) { 146 | return that->MessageHandler(window, message, wparam, lparam); 147 | } 148 | 149 | return DefWindowProc(window, message, wparam, lparam); 150 | } 151 | 152 | LRESULT 153 | Win32Window::MessageHandler(HWND hwnd, 154 | UINT const message, 155 | WPARAM const wparam, 156 | LPARAM const lparam) noexcept { 157 | switch (message) { 158 | case WM_DESTROY: 159 | window_handle_ = nullptr; 160 | Destroy(); 161 | if (quit_on_close_) { 162 | PostQuitMessage(0); 163 | } 164 | return 0; 165 | 166 | case WM_DPICHANGED: { 167 | auto newRectSize = reinterpret_cast(lparam); 168 | LONG newWidth = newRectSize->right - newRectSize->left; 169 | LONG newHeight = newRectSize->bottom - newRectSize->top; 170 | 171 | SetWindowPos(hwnd, nullptr, newRectSize->left, newRectSize->top, newWidth, 172 | newHeight, SWP_NOZORDER | SWP_NOACTIVATE); 173 | 174 | return 0; 175 | } 176 | case WM_SIZE: { 177 | RECT rect = GetClientArea(); 178 | if (child_content_ != nullptr) { 179 | // Size and position the child window. 180 | MoveWindow(child_content_, rect.left, rect.top, rect.right - rect.left, 181 | rect.bottom - rect.top, TRUE); 182 | } 183 | return 0; 184 | } 185 | 186 | case WM_ACTIVATE: 187 | if (child_content_ != nullptr) { 188 | SetFocus(child_content_); 189 | } 190 | return 0; 191 | } 192 | 193 | return DefWindowProc(window_handle_, message, wparam, lparam); 194 | } 195 | 196 | void Win32Window::Destroy() { 197 | OnDestroy(); 198 | 199 | if (window_handle_) { 200 | DestroyWindow(window_handle_); 201 | window_handle_ = nullptr; 202 | } 203 | if (g_active_window_count == 0) { 204 | WindowClassRegistrar::GetInstance()->UnregisterWindowClass(); 205 | } 206 | } 207 | 208 | Win32Window* Win32Window::GetThisFromHandle(HWND const window) noexcept { 209 | return reinterpret_cast( 210 | GetWindowLongPtr(window, GWLP_USERDATA)); 211 | } 212 | 213 | void Win32Window::SetChildContent(HWND content) { 214 | child_content_ = content; 215 | SetParent(content, window_handle_); 216 | RECT frame = GetClientArea(); 217 | 218 | MoveWindow(content, frame.left, frame.top, frame.right - frame.left, 219 | frame.bottom - frame.top, true); 220 | 221 | SetFocus(child_content_); 222 | } 223 | 224 | RECT Win32Window::GetClientArea() { 225 | RECT frame; 226 | GetClientRect(window_handle_, &frame); 227 | return frame; 228 | } 229 | 230 | HWND Win32Window::GetHandle() { 231 | return window_handle_; 232 | } 233 | 234 | void Win32Window::SetQuitOnClose(bool quit_on_close) { 235 | quit_on_close_ = quit_on_close; 236 | } 237 | 238 | bool Win32Window::OnCreate() { 239 | // No-op; provided for subclasses. 240 | return true; 241 | } 242 | 243 | void Win32Window::OnDestroy() { 244 | // No-op; provided for subclasses. 245 | } 246 | -------------------------------------------------------------------------------- /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 and shows a win32 window with |title| and position and size 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 to will treat the width height passed in to this function 35 | // as logical pixels and scale to appropriate for the default monitor. Returns 36 | // true if the window was created successfully. 37 | bool CreateAndShow(const std::wstring& title, 38 | const Point& origin, 39 | const Size& size); 40 | 41 | // Release OS resources associated with window. 42 | void Destroy(); 43 | 44 | // Inserts |content| into the window tree. 45 | void SetChildContent(HWND content); 46 | 47 | // Returns the backing Window handle to enable clients to set icon and other 48 | // window properties. Returns nullptr if the window has been destroyed. 49 | HWND GetHandle(); 50 | 51 | // If true, closing this window will quit the application. 52 | void SetQuitOnClose(bool quit_on_close); 53 | 54 | // Return a RECT representing the bounds of the current client area. 55 | RECT GetClientArea(); 56 | 57 | protected: 58 | // Processes and route salient window messages for mouse handling, 59 | // size change and DPI. Delegates handling of these to member overloads that 60 | // inheriting classes can handle. 61 | virtual LRESULT MessageHandler(HWND window, 62 | UINT const message, 63 | WPARAM const wparam, 64 | LPARAM const lparam) noexcept; 65 | 66 | // Called when CreateAndShow is called, allowing subclass window-related 67 | // setup. Subclasses should return false if setup fails. 68 | virtual bool OnCreate(); 69 | 70 | // Called when Destroy is called. 71 | virtual void OnDestroy(); 72 | 73 | private: 74 | friend class WindowClassRegistrar; 75 | 76 | // OS callback called by message pump. Handles the WM_NCCREATE message which 77 | // is passed when the non-client area is being created and enables automatic 78 | // non-client DPI scaling so that the non-client area automatically 79 | // responsponds to changes in DPI. All other messages are handled by 80 | // MessageHandler. 81 | static LRESULT CALLBACK WndProc(HWND const window, 82 | UINT const message, 83 | WPARAM const wparam, 84 | LPARAM const lparam) noexcept; 85 | 86 | // Retrieves a class instance pointer for |window| 87 | static Win32Window* GetThisFromHandle(HWND const window) noexcept; 88 | 89 | bool quit_on_close_ = false; 90 | 91 | // window handle for top level window. 92 | HWND window_handle_ = nullptr; 93 | 94 | // window handle for hosted content. 95 | HWND child_content_ = nullptr; 96 | }; 97 | 98 | #endif // RUNNER_WIN32_WINDOW_H_ 99 | --------------------------------------------------------------------------------