├── .gitattributes
├── .gitignore
├── .idea
├── libraries
│ ├── Dart_SDK.xml
│ └── KotlinJavaRuntime.xml
├── modules.xml
├── runConfigurations
│ └── main_dart.xml
└── workspace.xml
├── .metadata
├── README.md
├── analysis_options.yaml
├── android
├── .gitignore
├── app
│ ├── build.gradle
│ └── src
│ │ ├── debug
│ │ └── AndroidManifest.xml
│ │ ├── main
│ │ ├── AndroidManifest.xml
│ │ ├── kotlin
│ │ │ └── com
│ │ │ │ └── example
│ │ │ │ └── crop_experience_agency_case
│ │ │ │ └── MainActivity.kt
│ │ └── res
│ │ │ ├── drawable-v21
│ │ │ └── launch_background.xml
│ │ │ ├── drawable
│ │ │ └── launch_background.xml
│ │ │ ├── mipmap-hdpi
│ │ │ └── ic_launcher.png
│ │ │ ├── mipmap-mdpi
│ │ │ └── ic_launcher.png
│ │ │ ├── mipmap-xhdpi
│ │ │ └── ic_launcher.png
│ │ │ ├── mipmap-xxhdpi
│ │ │ └── ic_launcher.png
│ │ │ ├── mipmap-xxxhdpi
│ │ │ └── ic_launcher.png
│ │ │ ├── values-night
│ │ │ └── styles.xml
│ │ │ └── values
│ │ │ └── styles.xml
│ │ └── profile
│ │ └── AndroidManifest.xml
├── build.gradle
├── crop_experience_agency_case_android.iml
├── gradle.properties
├── gradle
│ └── wrapper
│ │ └── gradle-wrapper.properties
└── settings.gradle
├── assets
└── test_img.jpg
├── crop_experience_agency_case.iml
├── ios
├── .gitignore
├── Flutter
│ ├── AppFrameworkInfo.plist
│ ├── Debug.xcconfig
│ └── Release.xcconfig
├── Podfile
├── Podfile.lock
├── Runner.xcodeproj
│ ├── project.pbxproj
│ ├── project.xcworkspace
│ │ ├── contents.xcworkspacedata
│ │ └── xcshareddata
│ │ │ ├── IDEWorkspaceChecks.plist
│ │ │ └── WorkspaceSettings.xcsettings
│ └── xcshareddata
│ │ └── xcschemes
│ │ └── Runner.xcscheme
├── Runner.xcworkspace
│ ├── contents.xcworkspacedata
│ └── xcshareddata
│ │ ├── IDEWorkspaceChecks.plist
│ │ └── WorkspaceSettings.xcsettings
└── Runner
│ ├── AppDelegate.swift
│ ├── Assets.xcassets
│ ├── AppIcon.appiconset
│ │ ├── Contents.json
│ │ ├── Icon-App-1024x1024@1x.png
│ │ ├── Icon-App-20x20@1x.png
│ │ ├── Icon-App-20x20@2x.png
│ │ ├── Icon-App-20x20@3x.png
│ │ ├── Icon-App-29x29@1x.png
│ │ ├── Icon-App-29x29@2x.png
│ │ ├── Icon-App-29x29@3x.png
│ │ ├── Icon-App-40x40@1x.png
│ │ ├── Icon-App-40x40@2x.png
│ │ ├── Icon-App-40x40@3x.png
│ │ ├── Icon-App-60x60@2x.png
│ │ ├── Icon-App-60x60@3x.png
│ │ ├── Icon-App-76x76@1x.png
│ │ ├── Icon-App-76x76@2x.png
│ │ └── Icon-App-83.5x83.5@2x.png
│ └── 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
├── application
│ └── login
│ │ └── cubit
│ │ ├── login_cubit.dart
│ │ ├── login_cubit.freezed.dart
│ │ └── login_state.dart
├── domain
│ └── auth_models
│ │ ├── email.dart
│ │ └── password.dart
├── infrastructure
│ └── api
│ │ └── api.dart
├── main.dart
└── presentation
│ ├── core
│ └── app_widget.dart
│ ├── pages
│ ├── episode_details
│ │ ├── constants
│ │ │ ├── colors.dart
│ │ │ └── texts.dart
│ │ ├── episode_details_page.dart
│ │ └── widgets
│ │ │ ├── app_bar.dart
│ │ │ ├── custom_icon_button.dart
│ │ │ ├── custom_list_tile.dart
│ │ │ ├── episode_details_page_body.dart
│ │ │ ├── play_button.dart
│ │ │ ├── podcast_episodes.dart
│ │ │ ├── podcast_image_with_percentage.dart
│ │ │ └── podcast_text.dart
│ ├── home
│ │ ├── constants
│ │ │ ├── colors.dart
│ │ │ └── texts.dart
│ │ ├── home_page.dart
│ │ └── widgets
│ │ │ ├── colored_rectangle.dart
│ │ │ ├── custom_bottom_navigation_bar.dart
│ │ │ ├── green_straight_line.dart
│ │ │ ├── home_page_body.dart
│ │ │ ├── home_page_episode_title.dart
│ │ │ ├── home_page_episodes.dart
│ │ │ ├── linear_percentage_bar.dart
│ │ │ ├── notification_icon.dart
│ │ │ ├── screen_tab.dart
│ │ │ ├── search_bar.dart
│ │ │ ├── title_content_with_rectangles.dart
│ │ │ ├── title_text.dart
│ │ │ └── title_with_button.dart
│ ├── introduction
│ │ ├── constants
│ │ │ ├── button_styles.dart
│ │ │ ├── colors.dart
│ │ │ ├── intro_key.dart
│ │ │ ├── page_decoration.dart
│ │ │ └── texts.dart
│ │ ├── introduction_page.dart
│ │ └── widgets
│ │ │ ├── build_image.dart
│ │ │ ├── introduction_screen_custom_button.dart
│ │ │ ├── introduction_screen_custom_text.dart
│ │ │ └── introduction_screens.dart
│ ├── login
│ │ ├── constants
│ │ │ ├── colors.dart
│ │ │ └── texts.dart
│ │ ├── login_page.dart
│ │ └── widgets
│ │ │ ├── app_bar.dart
│ │ │ ├── auth_text_field.dart
│ │ │ ├── custom_text.dart
│ │ │ ├── input_fields.dart
│ │ │ ├── login_button.dart
│ │ │ ├── login_page_body.dart
│ │ │ └── sign_up_text.dart
│ └── player
│ │ ├── constants
│ │ ├── colors.dart
│ │ └── texts.dart
│ │ ├── player_page.dart
│ │ └── widgets
│ │ ├── app_bar.dart
│ │ ├── audio_action_buttons.dart
│ │ ├── audio_icon_button.dart
│ │ ├── audio_progress_bar.dart
│ │ ├── player_informations.dart
│ │ └── player_page_body.dart
│ └── routes
│ ├── router.dart
│ └── router.gr.dart
├── pubspec.yaml
├── test
└── widget_test.dart
├── web
├── favicon.png
├── icons
│ ├── Icon-192.png
│ ├── Icon-512.png
│ ├── Icon-maskable-192.png
│ └── Icon-maskable-512.png
├── index.html
└── manifest.json
└── windows
├── .gitignore
├── CMakeLists.txt
├── flutter
├── CMakeLists.txt
├── generated_plugin_registrant.cc
├── generated_plugin_registrant.h
└── generated_plugins.cmake
└── runner
├── CMakeLists.txt
├── Runner.rc
├── flutter_window.cpp
├── flutter_window.h
├── main.cpp
├── resource.h
├── resources
└── app_icon.ico
├── runner.exe.manifest
├── utils.cpp
├── utils.h
├── win32_window.cpp
└── win32_window.h
/.gitattributes:
--------------------------------------------------------------------------------
1 | # Auto detect text files and perform LF normalization
2 | * text=auto
3 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | # See https://www.dartlang.org/guides/libraries/private-files
2 |
3 | # Files and directories created by pub
4 | .dart_tool/
5 | .packages
6 | build/
7 | # If you're building an application, you may want to check-in your pubspec.lock
8 | pubspec.lock
9 |
10 | # Directory created by dartdoc
11 | # If you don't generate documentation locally you can remove this line.
12 | doc/api/
13 |
14 | # dotenv environment variables file
15 | .env*
16 |
17 | # Avoid committing generated Javascript files:
18 | *.dart.js
19 | *.info.json # Produced by the --dump-info flag.
20 | *.js # When generated by dart2js. Don't specify *.js if your
21 | # project includes source files written in JavaScript.
22 | *.js_
23 | *.js.deps
24 | *.js.map
25 |
26 | .flutter-plugins
27 | .flutter-plugins-dependencies
28 |
--------------------------------------------------------------------------------
/.idea/libraries/Dart_SDK.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
--------------------------------------------------------------------------------
/.idea/libraries/KotlinJavaRuntime.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
--------------------------------------------------------------------------------
/.idea/modules.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/.idea/runConfigurations/main_dart.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/.idea/workspace.xml:
--------------------------------------------------------------------------------
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 |
--------------------------------------------------------------------------------
/.metadata:
--------------------------------------------------------------------------------
1 | # This file tracks properties of this Flutter project.
2 | # Used by Flutter tool to assess capabilities and perform upgrades etc.
3 | #
4 | # This file should be version controlled and should not be manually edited.
5 |
6 | version:
7 | revision: 5464c5bac742001448fe4fc0597be939379f88ea
8 | channel: stable
9 |
10 | project_type: app
11 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # Podcast App UI
2 | Recently, Some people wanted me to do an application which for mobile, and they sent me figma designs. I looked it, and I adapt it for Flutter.
3 |
4 | When login app, there is text validation (not a real authentication).
5 |
6 | To login, you can just enter a valid email and min. 8 characters password.
7 |
8 | Api: https://rickandmortyapi.com/api/character/
9 |
10 |
11 | ## Figma
12 | 
13 |
14 | ## Screenshots from the app:
15 |
16 | 
17 | 
18 | 
19 | 
20 | 
21 | 
22 |
--------------------------------------------------------------------------------
/analysis_options.yaml:
--------------------------------------------------------------------------------
1 | # This file configures the analyzer, which statically analyzes Dart code to
2 | # check for errors, warnings, and lints.
3 | #
4 | # The issues identified by the analyzer are surfaced in the UI of Dart-enabled
5 | # IDEs (https://dart.dev/tools#ides-and-editors). The analyzer can also be
6 | # invoked from the command line by running `flutter analyze`.
7 |
8 | # The following line activates a set of recommended lints for Flutter apps,
9 | # packages, and plugins designed to encourage good coding practices.
10 | include: package:flutter_lints/flutter.yaml
11 |
12 | linter:
13 | # The lint rules applied to this project can be customized in the
14 | # section below to disable rules from the `package:flutter_lints/flutter.yaml`
15 | # included above or to enable additional rules. A list of all available lints
16 | # and their documentation is published at
17 | # https://dart-lang.github.io/linter/lints/index.html.
18 | #
19 | # Instead of disabling a lint rule for the entire project in the
20 | # section below, it can also be suppressed for a single line of code
21 | # or a specific dart file by using the `// ignore: name_of_lint` and
22 | # `// ignore_for_file: name_of_lint` syntax on the line or in the file
23 | # producing the lint.
24 | rules:
25 | # avoid_print: false # Uncomment to disable the `avoid_print` rule
26 | # prefer_single_quotes: true # Uncomment to enable the `prefer_single_quotes` rule
27 |
28 | # Additional information about this file can be found at
29 | # https://dart.dev/guides/language/analysis-options
30 |
--------------------------------------------------------------------------------
/android/.gitignore:
--------------------------------------------------------------------------------
1 | gradle-wrapper.jar
2 | /.gradle
3 | /captures/
4 | /gradlew
5 | /gradlew.bat
6 | /local.properties
7 | GeneratedPluginRegistrant.java
8 |
9 | # Remember to never publicly share your keystore.
10 | # See https://flutter.dev/docs/deployment/android#reference-the-keystore-from-the-app
11 | key.properties
12 | **/*.keystore
13 | **/*.jks
14 |
--------------------------------------------------------------------------------
/android/app/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 flutter.compileSdkVersion
30 |
31 | compileOptions {
32 | sourceCompatibility JavaVersion.VERSION_1_8
33 | targetCompatibility JavaVersion.VERSION_1_8
34 | }
35 |
36 | kotlinOptions {
37 | jvmTarget = '1.8'
38 | }
39 |
40 | sourceSets {
41 | main.java.srcDirs += 'src/main/kotlin'
42 | }
43 |
44 | defaultConfig {
45 | // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
46 | applicationId "com.example.podcast_app_case"
47 | minSdkVersion flutter.minSdkVersion
48 | targetSdkVersion flutter.targetSdkVersion
49 | versionCode flutterVersionCode.toInteger()
50 | versionName flutterVersionName
51 | }
52 |
53 | buildTypes {
54 | release {
55 | // TODO: Add your own signing config for the release build.
56 | // Signing with the debug keys for now, so `flutter run --release` works.
57 | signingConfig signingConfigs.debug
58 | }
59 | }
60 | }
61 |
62 | flutter {
63 | source '../..'
64 | }
65 |
66 | dependencies {
67 | implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
68 | }
69 |
--------------------------------------------------------------------------------
/android/app/src/debug/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
3 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/android/app/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
3 |
4 |
8 |
16 |
20 |
24 |
25 |
26 |
27 |
28 |
29 |
31 |
34 |
35 |
36 |
--------------------------------------------------------------------------------
/android/app/src/main/kotlin/com/example/crop_experience_agency_case/MainActivity.kt:
--------------------------------------------------------------------------------
1 | package com.example.podcast_app_case
2 |
3 | import io.flutter.embedding.android.FlutterActivity
4 |
5 | class MainActivity: FlutterActivity() {
6 | }
7 |
--------------------------------------------------------------------------------
/android/app/src/main/res/drawable-v21/launch_background.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
12 |
13 |
--------------------------------------------------------------------------------
/android/app/src/main/res/drawable/launch_background.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
12 |
13 |
--------------------------------------------------------------------------------
/android/app/src/main/res/mipmap-hdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FlutterWiz/podcast_app_case/ca9f99285d8a9ed7aa968f527dbaad2b5dd5b374/android/app/src/main/res/mipmap-hdpi/ic_launcher.png
--------------------------------------------------------------------------------
/android/app/src/main/res/mipmap-mdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FlutterWiz/podcast_app_case/ca9f99285d8a9ed7aa968f527dbaad2b5dd5b374/android/app/src/main/res/mipmap-mdpi/ic_launcher.png
--------------------------------------------------------------------------------
/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FlutterWiz/podcast_app_case/ca9f99285d8a9ed7aa968f527dbaad2b5dd5b374/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FlutterWiz/podcast_app_case/ca9f99285d8a9ed7aa968f527dbaad2b5dd5b374/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FlutterWiz/podcast_app_case/ca9f99285d8a9ed7aa968f527dbaad2b5dd5b374/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/android/app/src/main/res/values-night/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
9 |
15 |
18 |
19 |
--------------------------------------------------------------------------------
/android/app/src/main/res/values/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
9 |
15 |
18 |
19 |
--------------------------------------------------------------------------------
/android/app/src/profile/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
3 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/android/build.gradle:
--------------------------------------------------------------------------------
1 | buildscript {
2 | ext.kotlin_version = '1.6.10'
3 | repositories {
4 | google()
5 | mavenCentral()
6 | }
7 |
8 | dependencies {
9 | classpath 'com.android.tools.build:gradle:4.1.0'
10 | classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
11 | }
12 | }
13 |
14 | allprojects {
15 | repositories {
16 | google()
17 | 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 | task clean(type: Delete) {
30 | delete rootProject.buildDir
31 | }
32 |
--------------------------------------------------------------------------------
/android/crop_experience_agency_case_android.iml:
--------------------------------------------------------------------------------
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 |
--------------------------------------------------------------------------------
/android/gradle.properties:
--------------------------------------------------------------------------------
1 | org.gradle.jvmargs=-Xmx1536M
2 | android.useAndroidX=true
3 | android.enableJetifier=true
4 |
--------------------------------------------------------------------------------
/android/gradle/wrapper/gradle-wrapper.properties:
--------------------------------------------------------------------------------
1 | #Fri Jun 23 08:50:38 CEST 2017
2 | distributionBase=GRADLE_USER_HOME
3 | distributionPath=wrapper/dists
4 | zipStoreBase=GRADLE_USER_HOME
5 | zipStorePath=wrapper/dists
6 | distributionUrl=https\://services.gradle.org/distributions/gradle-6.7-all.zip
7 |
--------------------------------------------------------------------------------
/android/settings.gradle:
--------------------------------------------------------------------------------
1 | include ':app'
2 |
3 | def localPropertiesFile = new File(rootProject.projectDir, "local.properties")
4 | def properties = new Properties()
5 |
6 | assert localPropertiesFile.exists()
7 | localPropertiesFile.withReader("UTF-8") { reader -> properties.load(reader) }
8 |
9 | def flutterSdkPath = properties.getProperty("flutter.sdk")
10 | assert flutterSdkPath != null, "flutter.sdk not set in local.properties"
11 | apply from: "$flutterSdkPath/packages/flutter_tools/gradle/app_plugin_loader.gradle"
12 |
--------------------------------------------------------------------------------
/assets/test_img.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FlutterWiz/podcast_app_case/ca9f99285d8a9ed7aa968f527dbaad2b5dd5b374/assets/test_img.jpg
--------------------------------------------------------------------------------
/crop_experience_agency_case.iml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
--------------------------------------------------------------------------------
/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 | 9.0
25 |
26 |
27 |
--------------------------------------------------------------------------------
/ios/Flutter/Debug.xcconfig:
--------------------------------------------------------------------------------
1 | #include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"
2 | #include "Generated.xcconfig"
3 |
--------------------------------------------------------------------------------
/ios/Flutter/Release.xcconfig:
--------------------------------------------------------------------------------
1 | #include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"
2 | #include "Generated.xcconfig"
3 |
--------------------------------------------------------------------------------
/ios/Podfile:
--------------------------------------------------------------------------------
1 | # Uncomment this line to define a global platform for your project
2 | # platform :ios, '9.0'
3 |
4 | # CocoaPods analytics sends network stats synchronously affecting flutter build latency.
5 | ENV['COCOAPODS_DISABLE_STATS'] = 'true'
6 |
7 | project 'Runner', {
8 | 'Debug' => :debug,
9 | 'Profile' => :release,
10 | 'Release' => :release,
11 | }
12 |
13 | def flutter_root
14 | generated_xcode_build_settings_path = File.expand_path(File.join('..', 'Flutter', 'Generated.xcconfig'), __FILE__)
15 | unless File.exist?(generated_xcode_build_settings_path)
16 | raise "#{generated_xcode_build_settings_path} must exist. If you're running pod install manually, make sure flutter pub get is executed first"
17 | end
18 |
19 | File.foreach(generated_xcode_build_settings_path) do |line|
20 | matches = line.match(/FLUTTER_ROOT\=(.*)/)
21 | return matches[1].strip if matches
22 | end
23 | raise "FLUTTER_ROOT not found in #{generated_xcode_build_settings_path}. Try deleting Generated.xcconfig, then run flutter pub get"
24 | end
25 |
26 | require File.expand_path(File.join('packages', 'flutter_tools', 'bin', 'podhelper'), flutter_root)
27 |
28 | flutter_ios_podfile_setup
29 |
30 | target 'Runner' do
31 | use_frameworks!
32 | use_modular_headers!
33 |
34 | flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__))
35 | end
36 |
37 | post_install do |installer|
38 | installer.pods_project.targets.each do |target|
39 | flutter_additional_ios_build_settings(target)
40 | end
41 | end
42 |
--------------------------------------------------------------------------------
/ios/Podfile.lock:
--------------------------------------------------------------------------------
1 | PODS:
2 | - Flutter (1.0.0)
3 | - FMDB (2.7.5):
4 | - FMDB/standard (= 2.7.5)
5 | - FMDB/standard (2.7.5)
6 | - path_provider_ios (0.0.1):
7 | - Flutter
8 | - sqflite (0.0.2):
9 | - Flutter
10 | - FMDB (>= 2.7.5)
11 |
12 | DEPENDENCIES:
13 | - Flutter (from `Flutter`)
14 | - path_provider_ios (from `.symlinks/plugins/path_provider_ios/ios`)
15 | - sqflite (from `.symlinks/plugins/sqflite/ios`)
16 |
17 | SPEC REPOS:
18 | trunk:
19 | - FMDB
20 |
21 | EXTERNAL SOURCES:
22 | Flutter:
23 | :path: Flutter
24 | path_provider_ios:
25 | :path: ".symlinks/plugins/path_provider_ios/ios"
26 | sqflite:
27 | :path: ".symlinks/plugins/sqflite/ios"
28 |
29 | SPEC CHECKSUMS:
30 | Flutter: 50d75fe2f02b26cc09d224853bb45737f8b3214a
31 | FMDB: 2ce00b547f966261cd18927a3ddb07cb6f3db82a
32 | path_provider_ios: 14f3d2fd28c4fdb42f44e0f751d12861c43cee02
33 | sqflite: 6d358c025f5b867b29ed92fc697fd34924e11904
34 |
35 | PODFILE CHECKSUM: aafe91acc616949ddb318b77800a7f51bffa2a4c
36 |
37 | COCOAPODS: 1.11.3
38 |
--------------------------------------------------------------------------------
/ios/Runner.xcodeproj/project.pbxproj:
--------------------------------------------------------------------------------
1 | // !$*UTF8*$!
2 | {
3 | archiveVersion = 1;
4 | classes = {
5 | };
6 | objectVersion = 50;
7 | objects = {
8 |
9 | /* Begin PBXBuildFile section */
10 | 0015E23EEA2323D944D7C7FE /* Pods_Runner.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 0FCFA9B58C558A717826D5FB /* Pods_Runner.framework */; };
11 | 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */ = {isa = PBXBuildFile; fileRef = 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */; };
12 | 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */ = {isa = PBXBuildFile; fileRef = 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */; };
13 | 74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 74858FAE1ED2DC5600515810 /* AppDelegate.swift */; };
14 | 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FA1CF9000F007C117D /* Main.storyboard */; };
15 | 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FD1CF9000F007C117D /* Assets.xcassets */; };
16 | 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */; };
17 | /* End PBXBuildFile section */
18 |
19 | /* Begin PBXCopyFilesBuildPhase section */
20 | 9705A1C41CF9048500538489 /* Embed Frameworks */ = {
21 | isa = PBXCopyFilesBuildPhase;
22 | buildActionMask = 2147483647;
23 | dstPath = "";
24 | dstSubfolderSpec = 10;
25 | files = (
26 | );
27 | name = "Embed Frameworks";
28 | runOnlyForDeploymentPostprocessing = 0;
29 | };
30 | /* End PBXCopyFilesBuildPhase section */
31 |
32 | /* Begin PBXFileReference section */
33 | 0FCFA9B58C558A717826D5FB /* Pods_Runner.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Runner.framework; sourceTree = BUILT_PRODUCTS_DIR; };
34 | 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GeneratedPluginRegistrant.h; sourceTree = ""; };
35 | 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GeneratedPluginRegistrant.m; sourceTree = ""; };
36 | 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = ""; };
37 | 74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Runner-Bridging-Header.h"; sourceTree = ""; };
38 | 74858FAE1ED2DC5600515810 /* AppDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; };
39 | 79D1048E40E31399FE810034 /* Pods-Runner.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.debug.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"; sourceTree = ""; };
40 | 7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = Flutter/Release.xcconfig; sourceTree = ""; };
41 | 810E1BAB0926CEB7D54DC218 /* Pods-Runner.profile.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.profile.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.profile.xcconfig"; sourceTree = ""; };
42 | 9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Debug.xcconfig; path = Flutter/Debug.xcconfig; sourceTree = ""; };
43 | 9740EEB31CF90195004384FC /* Generated.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Generated.xcconfig; path = Flutter/Generated.xcconfig; sourceTree = ""; };
44 | 97C146EE1CF9000F007C117D /* Runner.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Runner.app; sourceTree = BUILT_PRODUCTS_DIR; };
45 | 97C146FB1CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; };
46 | 97C146FD1CF9000F007C117D /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; };
47 | 97C147001CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; };
48 | 97C147021CF9000F007C117D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; };
49 | B2FA56160FD9AC3018839E3E /* Pods-Runner.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.release.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"; sourceTree = ""; };
50 | /* End PBXFileReference section */
51 |
52 | /* Begin PBXFrameworksBuildPhase section */
53 | 97C146EB1CF9000F007C117D /* Frameworks */ = {
54 | isa = PBXFrameworksBuildPhase;
55 | buildActionMask = 2147483647;
56 | files = (
57 | 0015E23EEA2323D944D7C7FE /* Pods_Runner.framework in Frameworks */,
58 | );
59 | runOnlyForDeploymentPostprocessing = 0;
60 | };
61 | /* End PBXFrameworksBuildPhase section */
62 |
63 | /* Begin PBXGroup section */
64 | 9740EEB11CF90186004384FC /* Flutter */ = {
65 | isa = PBXGroup;
66 | children = (
67 | 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */,
68 | 9740EEB21CF90195004384FC /* Debug.xcconfig */,
69 | 7AFA3C8E1D35360C0083082E /* Release.xcconfig */,
70 | 9740EEB31CF90195004384FC /* Generated.xcconfig */,
71 | );
72 | name = Flutter;
73 | sourceTree = "";
74 | };
75 | 97C146E51CF9000F007C117D = {
76 | isa = PBXGroup;
77 | children = (
78 | 9740EEB11CF90186004384FC /* Flutter */,
79 | 97C146F01CF9000F007C117D /* Runner */,
80 | 97C146EF1CF9000F007C117D /* Products */,
81 | C98168D9C4ED5310ED3A7E5C /* Pods */,
82 | EA5EFEDF5838748916A6B283 /* Frameworks */,
83 | );
84 | sourceTree = "";
85 | };
86 | 97C146EF1CF9000F007C117D /* Products */ = {
87 | isa = PBXGroup;
88 | children = (
89 | 97C146EE1CF9000F007C117D /* Runner.app */,
90 | );
91 | name = Products;
92 | sourceTree = "";
93 | };
94 | 97C146F01CF9000F007C117D /* Runner */ = {
95 | isa = PBXGroup;
96 | children = (
97 | 97C146FA1CF9000F007C117D /* Main.storyboard */,
98 | 97C146FD1CF9000F007C117D /* Assets.xcassets */,
99 | 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */,
100 | 97C147021CF9000F007C117D /* Info.plist */,
101 | 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */,
102 | 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */,
103 | 74858FAE1ED2DC5600515810 /* AppDelegate.swift */,
104 | 74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */,
105 | );
106 | path = Runner;
107 | sourceTree = "";
108 | };
109 | C98168D9C4ED5310ED3A7E5C /* Pods */ = {
110 | isa = PBXGroup;
111 | children = (
112 | 79D1048E40E31399FE810034 /* Pods-Runner.debug.xcconfig */,
113 | B2FA56160FD9AC3018839E3E /* Pods-Runner.release.xcconfig */,
114 | 810E1BAB0926CEB7D54DC218 /* Pods-Runner.profile.xcconfig */,
115 | );
116 | name = Pods;
117 | path = Pods;
118 | sourceTree = "";
119 | };
120 | EA5EFEDF5838748916A6B283 /* Frameworks */ = {
121 | isa = PBXGroup;
122 | children = (
123 | 0FCFA9B58C558A717826D5FB /* Pods_Runner.framework */,
124 | );
125 | name = Frameworks;
126 | sourceTree = "";
127 | };
128 | /* End PBXGroup section */
129 |
130 | /* Begin PBXNativeTarget section */
131 | 97C146ED1CF9000F007C117D /* Runner */ = {
132 | isa = PBXNativeTarget;
133 | buildConfigurationList = 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */;
134 | buildPhases = (
135 | 50F6BD76431F78CD2444B64D /* [CP] Check Pods Manifest.lock */,
136 | 9740EEB61CF901F6004384FC /* Run Script */,
137 | 97C146EA1CF9000F007C117D /* Sources */,
138 | 97C146EB1CF9000F007C117D /* Frameworks */,
139 | 97C146EC1CF9000F007C117D /* Resources */,
140 | 9705A1C41CF9048500538489 /* Embed Frameworks */,
141 | 3B06AD1E1E4923F5004D2608 /* Thin Binary */,
142 | 481C6870802E1886BF1A7423 /* [CP] Embed Pods Frameworks */,
143 | );
144 | buildRules = (
145 | );
146 | dependencies = (
147 | );
148 | name = Runner;
149 | productName = Runner;
150 | productReference = 97C146EE1CF9000F007C117D /* Runner.app */;
151 | productType = "com.apple.product-type.application";
152 | };
153 | /* End PBXNativeTarget section */
154 |
155 | /* Begin PBXProject section */
156 | 97C146E61CF9000F007C117D /* Project object */ = {
157 | isa = PBXProject;
158 | attributes = {
159 | LastUpgradeCheck = 1300;
160 | ORGANIZATIONNAME = "";
161 | TargetAttributes = {
162 | 97C146ED1CF9000F007C117D = {
163 | CreatedOnToolsVersion = 7.3.1;
164 | LastSwiftMigration = 1100;
165 | };
166 | };
167 | };
168 | buildConfigurationList = 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */;
169 | compatibilityVersion = "Xcode 9.3";
170 | developmentRegion = en;
171 | hasScannedForEncodings = 0;
172 | knownRegions = (
173 | en,
174 | Base,
175 | );
176 | mainGroup = 97C146E51CF9000F007C117D;
177 | productRefGroup = 97C146EF1CF9000F007C117D /* Products */;
178 | projectDirPath = "";
179 | projectRoot = "";
180 | targets = (
181 | 97C146ED1CF9000F007C117D /* Runner */,
182 | );
183 | };
184 | /* End PBXProject section */
185 |
186 | /* Begin PBXResourcesBuildPhase section */
187 | 97C146EC1CF9000F007C117D /* Resources */ = {
188 | isa = PBXResourcesBuildPhase;
189 | buildActionMask = 2147483647;
190 | files = (
191 | 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */,
192 | 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */,
193 | 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */,
194 | 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */,
195 | );
196 | runOnlyForDeploymentPostprocessing = 0;
197 | };
198 | /* End PBXResourcesBuildPhase section */
199 |
200 | /* Begin PBXShellScriptBuildPhase section */
201 | 3B06AD1E1E4923F5004D2608 /* Thin Binary */ = {
202 | isa = PBXShellScriptBuildPhase;
203 | buildActionMask = 2147483647;
204 | files = (
205 | );
206 | inputPaths = (
207 | );
208 | name = "Thin Binary";
209 | outputPaths = (
210 | );
211 | runOnlyForDeploymentPostprocessing = 0;
212 | shellPath = /bin/sh;
213 | shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" embed_and_thin";
214 | };
215 | 481C6870802E1886BF1A7423 /* [CP] Embed Pods Frameworks */ = {
216 | isa = PBXShellScriptBuildPhase;
217 | buildActionMask = 2147483647;
218 | files = (
219 | );
220 | inputFileListPaths = (
221 | "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-input-files.xcfilelist",
222 | );
223 | name = "[CP] Embed Pods Frameworks";
224 | outputFileListPaths = (
225 | "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-output-files.xcfilelist",
226 | );
227 | runOnlyForDeploymentPostprocessing = 0;
228 | shellPath = /bin/sh;
229 | shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh\"\n";
230 | showEnvVarsInLog = 0;
231 | };
232 | 50F6BD76431F78CD2444B64D /* [CP] Check Pods Manifest.lock */ = {
233 | isa = PBXShellScriptBuildPhase;
234 | buildActionMask = 2147483647;
235 | files = (
236 | );
237 | inputFileListPaths = (
238 | );
239 | inputPaths = (
240 | "${PODS_PODFILE_DIR_PATH}/Podfile.lock",
241 | "${PODS_ROOT}/Manifest.lock",
242 | );
243 | name = "[CP] Check Pods Manifest.lock";
244 | outputFileListPaths = (
245 | );
246 | outputPaths = (
247 | "$(DERIVED_FILE_DIR)/Pods-Runner-checkManifestLockResult.txt",
248 | );
249 | runOnlyForDeploymentPostprocessing = 0;
250 | shellPath = /bin/sh;
251 | shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n";
252 | showEnvVarsInLog = 0;
253 | };
254 | 9740EEB61CF901F6004384FC /* Run Script */ = {
255 | isa = PBXShellScriptBuildPhase;
256 | buildActionMask = 2147483647;
257 | files = (
258 | );
259 | inputPaths = (
260 | );
261 | name = "Run Script";
262 | outputPaths = (
263 | );
264 | runOnlyForDeploymentPostprocessing = 0;
265 | shellPath = /bin/sh;
266 | shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" build";
267 | };
268 | /* End PBXShellScriptBuildPhase section */
269 |
270 | /* Begin PBXSourcesBuildPhase section */
271 | 97C146EA1CF9000F007C117D /* Sources */ = {
272 | isa = PBXSourcesBuildPhase;
273 | buildActionMask = 2147483647;
274 | files = (
275 | 74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */,
276 | 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */,
277 | );
278 | runOnlyForDeploymentPostprocessing = 0;
279 | };
280 | /* End PBXSourcesBuildPhase section */
281 |
282 | /* Begin PBXVariantGroup section */
283 | 97C146FA1CF9000F007C117D /* Main.storyboard */ = {
284 | isa = PBXVariantGroup;
285 | children = (
286 | 97C146FB1CF9000F007C117D /* Base */,
287 | );
288 | name = Main.storyboard;
289 | sourceTree = "";
290 | };
291 | 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */ = {
292 | isa = PBXVariantGroup;
293 | children = (
294 | 97C147001CF9000F007C117D /* Base */,
295 | );
296 | name = LaunchScreen.storyboard;
297 | sourceTree = "";
298 | };
299 | /* End PBXVariantGroup section */
300 |
301 | /* Begin XCBuildConfiguration section */
302 | 249021D3217E4FDB00AE95B9 /* Profile */ = {
303 | isa = XCBuildConfiguration;
304 | buildSettings = {
305 | ALWAYS_SEARCH_USER_PATHS = NO;
306 | CLANG_ANALYZER_NONNULL = YES;
307 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
308 | CLANG_CXX_LIBRARY = "libc++";
309 | CLANG_ENABLE_MODULES = YES;
310 | CLANG_ENABLE_OBJC_ARC = YES;
311 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
312 | CLANG_WARN_BOOL_CONVERSION = YES;
313 | CLANG_WARN_COMMA = YES;
314 | CLANG_WARN_CONSTANT_CONVERSION = YES;
315 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
316 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
317 | CLANG_WARN_EMPTY_BODY = YES;
318 | CLANG_WARN_ENUM_CONVERSION = YES;
319 | CLANG_WARN_INFINITE_RECURSION = YES;
320 | CLANG_WARN_INT_CONVERSION = YES;
321 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
322 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
323 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
324 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
325 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
326 | CLANG_WARN_STRICT_PROTOTYPES = YES;
327 | CLANG_WARN_SUSPICIOUS_MOVE = YES;
328 | CLANG_WARN_UNREACHABLE_CODE = YES;
329 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
330 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
331 | COPY_PHASE_STRIP = NO;
332 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
333 | ENABLE_NS_ASSERTIONS = NO;
334 | ENABLE_STRICT_OBJC_MSGSEND = YES;
335 | GCC_C_LANGUAGE_STANDARD = gnu99;
336 | GCC_NO_COMMON_BLOCKS = YES;
337 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
338 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
339 | GCC_WARN_UNDECLARED_SELECTOR = YES;
340 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
341 | GCC_WARN_UNUSED_FUNCTION = YES;
342 | GCC_WARN_UNUSED_VARIABLE = YES;
343 | IPHONEOS_DEPLOYMENT_TARGET = 9.0;
344 | MTL_ENABLE_DEBUG_INFO = NO;
345 | SDKROOT = iphoneos;
346 | SUPPORTED_PLATFORMS = iphoneos;
347 | TARGETED_DEVICE_FAMILY = "1,2";
348 | VALIDATE_PRODUCT = YES;
349 | };
350 | name = Profile;
351 | };
352 | 249021D4217E4FDB00AE95B9 /* Profile */ = {
353 | isa = XCBuildConfiguration;
354 | baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */;
355 | buildSettings = {
356 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
357 | CLANG_ENABLE_MODULES = YES;
358 | CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
359 | ENABLE_BITCODE = NO;
360 | INFOPLIST_FILE = Runner/Info.plist;
361 | LD_RUNPATH_SEARCH_PATHS = (
362 | "$(inherited)",
363 | "@executable_path/Frameworks",
364 | );
365 | PRODUCT_BUNDLE_IDENTIFIER = com.example.podcastAppCase;
366 | PRODUCT_NAME = "$(TARGET_NAME)";
367 | SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
368 | SWIFT_VERSION = 5.0;
369 | VERSIONING_SYSTEM = "apple-generic";
370 | };
371 | name = Profile;
372 | };
373 | 97C147031CF9000F007C117D /* Debug */ = {
374 | isa = XCBuildConfiguration;
375 | buildSettings = {
376 | ALWAYS_SEARCH_USER_PATHS = NO;
377 | CLANG_ANALYZER_NONNULL = YES;
378 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
379 | CLANG_CXX_LIBRARY = "libc++";
380 | CLANG_ENABLE_MODULES = YES;
381 | CLANG_ENABLE_OBJC_ARC = YES;
382 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
383 | CLANG_WARN_BOOL_CONVERSION = YES;
384 | CLANG_WARN_COMMA = YES;
385 | CLANG_WARN_CONSTANT_CONVERSION = YES;
386 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
387 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
388 | CLANG_WARN_EMPTY_BODY = YES;
389 | CLANG_WARN_ENUM_CONVERSION = YES;
390 | CLANG_WARN_INFINITE_RECURSION = YES;
391 | CLANG_WARN_INT_CONVERSION = YES;
392 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
393 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
394 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
395 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
396 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
397 | CLANG_WARN_STRICT_PROTOTYPES = YES;
398 | CLANG_WARN_SUSPICIOUS_MOVE = YES;
399 | CLANG_WARN_UNREACHABLE_CODE = YES;
400 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
401 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
402 | COPY_PHASE_STRIP = NO;
403 | DEBUG_INFORMATION_FORMAT = dwarf;
404 | ENABLE_STRICT_OBJC_MSGSEND = YES;
405 | ENABLE_TESTABILITY = YES;
406 | GCC_C_LANGUAGE_STANDARD = gnu99;
407 | GCC_DYNAMIC_NO_PIC = NO;
408 | GCC_NO_COMMON_BLOCKS = YES;
409 | GCC_OPTIMIZATION_LEVEL = 0;
410 | GCC_PREPROCESSOR_DEFINITIONS = (
411 | "DEBUG=1",
412 | "$(inherited)",
413 | );
414 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
415 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
416 | GCC_WARN_UNDECLARED_SELECTOR = YES;
417 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
418 | GCC_WARN_UNUSED_FUNCTION = YES;
419 | GCC_WARN_UNUSED_VARIABLE = YES;
420 | IPHONEOS_DEPLOYMENT_TARGET = 9.0;
421 | MTL_ENABLE_DEBUG_INFO = YES;
422 | ONLY_ACTIVE_ARCH = YES;
423 | SDKROOT = iphoneos;
424 | TARGETED_DEVICE_FAMILY = "1,2";
425 | };
426 | name = Debug;
427 | };
428 | 97C147041CF9000F007C117D /* Release */ = {
429 | isa = XCBuildConfiguration;
430 | buildSettings = {
431 | ALWAYS_SEARCH_USER_PATHS = NO;
432 | CLANG_ANALYZER_NONNULL = YES;
433 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
434 | CLANG_CXX_LIBRARY = "libc++";
435 | CLANG_ENABLE_MODULES = YES;
436 | CLANG_ENABLE_OBJC_ARC = YES;
437 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
438 | CLANG_WARN_BOOL_CONVERSION = YES;
439 | CLANG_WARN_COMMA = YES;
440 | CLANG_WARN_CONSTANT_CONVERSION = YES;
441 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
442 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
443 | CLANG_WARN_EMPTY_BODY = YES;
444 | CLANG_WARN_ENUM_CONVERSION = YES;
445 | CLANG_WARN_INFINITE_RECURSION = YES;
446 | CLANG_WARN_INT_CONVERSION = YES;
447 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
448 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
449 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
450 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
451 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
452 | CLANG_WARN_STRICT_PROTOTYPES = YES;
453 | CLANG_WARN_SUSPICIOUS_MOVE = YES;
454 | CLANG_WARN_UNREACHABLE_CODE = YES;
455 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
456 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
457 | COPY_PHASE_STRIP = NO;
458 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
459 | ENABLE_NS_ASSERTIONS = NO;
460 | ENABLE_STRICT_OBJC_MSGSEND = YES;
461 | GCC_C_LANGUAGE_STANDARD = gnu99;
462 | GCC_NO_COMMON_BLOCKS = YES;
463 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
464 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
465 | GCC_WARN_UNDECLARED_SELECTOR = YES;
466 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
467 | GCC_WARN_UNUSED_FUNCTION = YES;
468 | GCC_WARN_UNUSED_VARIABLE = YES;
469 | IPHONEOS_DEPLOYMENT_TARGET = 9.0;
470 | MTL_ENABLE_DEBUG_INFO = NO;
471 | SDKROOT = iphoneos;
472 | SUPPORTED_PLATFORMS = iphoneos;
473 | SWIFT_COMPILATION_MODE = wholemodule;
474 | SWIFT_OPTIMIZATION_LEVEL = "-O";
475 | TARGETED_DEVICE_FAMILY = "1,2";
476 | VALIDATE_PRODUCT = YES;
477 | };
478 | name = Release;
479 | };
480 | 97C147061CF9000F007C117D /* Debug */ = {
481 | isa = XCBuildConfiguration;
482 | baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */;
483 | buildSettings = {
484 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
485 | CLANG_ENABLE_MODULES = YES;
486 | CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
487 | ENABLE_BITCODE = NO;
488 | INFOPLIST_FILE = Runner/Info.plist;
489 | LD_RUNPATH_SEARCH_PATHS = (
490 | "$(inherited)",
491 | "@executable_path/Frameworks",
492 | );
493 | PRODUCT_BUNDLE_IDENTIFIER = com.example.podcastAppCase;
494 | PRODUCT_NAME = "$(TARGET_NAME)";
495 | SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
496 | SWIFT_OPTIMIZATION_LEVEL = "-Onone";
497 | SWIFT_VERSION = 5.0;
498 | VERSIONING_SYSTEM = "apple-generic";
499 | };
500 | name = Debug;
501 | };
502 | 97C147071CF9000F007C117D /* Release */ = {
503 | isa = XCBuildConfiguration;
504 | baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */;
505 | buildSettings = {
506 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
507 | CLANG_ENABLE_MODULES = YES;
508 | CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
509 | ENABLE_BITCODE = NO;
510 | INFOPLIST_FILE = Runner/Info.plist;
511 | LD_RUNPATH_SEARCH_PATHS = (
512 | "$(inherited)",
513 | "@executable_path/Frameworks",
514 | );
515 | PRODUCT_BUNDLE_IDENTIFIER = com.example.podcastAppCase;
516 | PRODUCT_NAME = "$(TARGET_NAME)";
517 | SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
518 | SWIFT_VERSION = 5.0;
519 | VERSIONING_SYSTEM = "apple-generic";
520 | };
521 | name = Release;
522 | };
523 | /* End XCBuildConfiguration section */
524 |
525 | /* Begin XCConfigurationList section */
526 | 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */ = {
527 | isa = XCConfigurationList;
528 | buildConfigurations = (
529 | 97C147031CF9000F007C117D /* Debug */,
530 | 97C147041CF9000F007C117D /* Release */,
531 | 249021D3217E4FDB00AE95B9 /* Profile */,
532 | );
533 | defaultConfigurationIsVisible = 0;
534 | defaultConfigurationName = Release;
535 | };
536 | 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */ = {
537 | isa = XCConfigurationList;
538 | buildConfigurations = (
539 | 97C147061CF9000F007C117D /* Debug */,
540 | 97C147071CF9000F007C117D /* Release */,
541 | 249021D4217E4FDB00AE95B9 /* Profile */,
542 | );
543 | defaultConfigurationIsVisible = 0;
544 | defaultConfigurationName = Release;
545 | };
546 | /* End XCConfigurationList section */
547 | };
548 | rootObject = 97C146E61CF9000F007C117D /* Project object */;
549 | }
550 |
--------------------------------------------------------------------------------
/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | IDEDidComputeMac32BitWarning
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | PreviewsEnabled
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme:
--------------------------------------------------------------------------------
1 |
2 |
5 |
8 |
9 |
15 |
21 |
22 |
23 |
24 |
25 |
30 |
31 |
37 |
38 |
39 |
40 |
41 |
42 |
52 |
54 |
60 |
61 |
62 |
63 |
69 |
71 |
77 |
78 |
79 |
80 |
82 |
83 |
86 |
87 |
88 |
--------------------------------------------------------------------------------
/ios/Runner.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | IDEDidComputeMac32BitWarning
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | PreviewsEnabled
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/ios/Runner/AppDelegate.swift:
--------------------------------------------------------------------------------
1 | import UIKit
2 | import Flutter
3 |
4 | @UIApplicationMain
5 | @objc class AppDelegate: FlutterAppDelegate {
6 | override func application(
7 | _ application: UIApplication,
8 | didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?
9 | ) -> Bool {
10 | GeneratedPluginRegistrant.register(with: self)
11 | return super.application(application, didFinishLaunchingWithOptions: launchOptions)
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "size" : "20x20",
5 | "idiom" : "iphone",
6 | "filename" : "Icon-App-20x20@2x.png",
7 | "scale" : "2x"
8 | },
9 | {
10 | "size" : "20x20",
11 | "idiom" : "iphone",
12 | "filename" : "Icon-App-20x20@3x.png",
13 | "scale" : "3x"
14 | },
15 | {
16 | "size" : "29x29",
17 | "idiom" : "iphone",
18 | "filename" : "Icon-App-29x29@1x.png",
19 | "scale" : "1x"
20 | },
21 | {
22 | "size" : "29x29",
23 | "idiom" : "iphone",
24 | "filename" : "Icon-App-29x29@2x.png",
25 | "scale" : "2x"
26 | },
27 | {
28 | "size" : "29x29",
29 | "idiom" : "iphone",
30 | "filename" : "Icon-App-29x29@3x.png",
31 | "scale" : "3x"
32 | },
33 | {
34 | "size" : "40x40",
35 | "idiom" : "iphone",
36 | "filename" : "Icon-App-40x40@2x.png",
37 | "scale" : "2x"
38 | },
39 | {
40 | "size" : "40x40",
41 | "idiom" : "iphone",
42 | "filename" : "Icon-App-40x40@3x.png",
43 | "scale" : "3x"
44 | },
45 | {
46 | "size" : "60x60",
47 | "idiom" : "iphone",
48 | "filename" : "Icon-App-60x60@2x.png",
49 | "scale" : "2x"
50 | },
51 | {
52 | "size" : "60x60",
53 | "idiom" : "iphone",
54 | "filename" : "Icon-App-60x60@3x.png",
55 | "scale" : "3x"
56 | },
57 | {
58 | "size" : "20x20",
59 | "idiom" : "ipad",
60 | "filename" : "Icon-App-20x20@1x.png",
61 | "scale" : "1x"
62 | },
63 | {
64 | "size" : "20x20",
65 | "idiom" : "ipad",
66 | "filename" : "Icon-App-20x20@2x.png",
67 | "scale" : "2x"
68 | },
69 | {
70 | "size" : "29x29",
71 | "idiom" : "ipad",
72 | "filename" : "Icon-App-29x29@1x.png",
73 | "scale" : "1x"
74 | },
75 | {
76 | "size" : "29x29",
77 | "idiom" : "ipad",
78 | "filename" : "Icon-App-29x29@2x.png",
79 | "scale" : "2x"
80 | },
81 | {
82 | "size" : "40x40",
83 | "idiom" : "ipad",
84 | "filename" : "Icon-App-40x40@1x.png",
85 | "scale" : "1x"
86 | },
87 | {
88 | "size" : "40x40",
89 | "idiom" : "ipad",
90 | "filename" : "Icon-App-40x40@2x.png",
91 | "scale" : "2x"
92 | },
93 | {
94 | "size" : "76x76",
95 | "idiom" : "ipad",
96 | "filename" : "Icon-App-76x76@1x.png",
97 | "scale" : "1x"
98 | },
99 | {
100 | "size" : "76x76",
101 | "idiom" : "ipad",
102 | "filename" : "Icon-App-76x76@2x.png",
103 | "scale" : "2x"
104 | },
105 | {
106 | "size" : "83.5x83.5",
107 | "idiom" : "ipad",
108 | "filename" : "Icon-App-83.5x83.5@2x.png",
109 | "scale" : "2x"
110 | },
111 | {
112 | "size" : "1024x1024",
113 | "idiom" : "ios-marketing",
114 | "filename" : "Icon-App-1024x1024@1x.png",
115 | "scale" : "1x"
116 | }
117 | ],
118 | "info" : {
119 | "version" : 1,
120 | "author" : "xcode"
121 | }
122 | }
123 |
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FlutterWiz/podcast_app_case/ca9f99285d8a9ed7aa968f527dbaad2b5dd5b374/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FlutterWiz/podcast_app_case/ca9f99285d8a9ed7aa968f527dbaad2b5dd5b374/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FlutterWiz/podcast_app_case/ca9f99285d8a9ed7aa968f527dbaad2b5dd5b374/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FlutterWiz/podcast_app_case/ca9f99285d8a9ed7aa968f527dbaad2b5dd5b374/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FlutterWiz/podcast_app_case/ca9f99285d8a9ed7aa968f527dbaad2b5dd5b374/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FlutterWiz/podcast_app_case/ca9f99285d8a9ed7aa968f527dbaad2b5dd5b374/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FlutterWiz/podcast_app_case/ca9f99285d8a9ed7aa968f527dbaad2b5dd5b374/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FlutterWiz/podcast_app_case/ca9f99285d8a9ed7aa968f527dbaad2b5dd5b374/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FlutterWiz/podcast_app_case/ca9f99285d8a9ed7aa968f527dbaad2b5dd5b374/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FlutterWiz/podcast_app_case/ca9f99285d8a9ed7aa968f527dbaad2b5dd5b374/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FlutterWiz/podcast_app_case/ca9f99285d8a9ed7aa968f527dbaad2b5dd5b374/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FlutterWiz/podcast_app_case/ca9f99285d8a9ed7aa968f527dbaad2b5dd5b374/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FlutterWiz/podcast_app_case/ca9f99285d8a9ed7aa968f527dbaad2b5dd5b374/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FlutterWiz/podcast_app_case/ca9f99285d8a9ed7aa968f527dbaad2b5dd5b374/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FlutterWiz/podcast_app_case/ca9f99285d8a9ed7aa968f527dbaad2b5dd5b374/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "filename" : "LaunchImage.png",
6 | "scale" : "1x"
7 | },
8 | {
9 | "idiom" : "universal",
10 | "filename" : "LaunchImage@2x.png",
11 | "scale" : "2x"
12 | },
13 | {
14 | "idiom" : "universal",
15 | "filename" : "LaunchImage@3x.png",
16 | "scale" : "3x"
17 | }
18 | ],
19 | "info" : {
20 | "version" : 1,
21 | "author" : "xcode"
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FlutterWiz/podcast_app_case/ca9f99285d8a9ed7aa968f527dbaad2b5dd5b374/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FlutterWiz/podcast_app_case/ca9f99285d8a9ed7aa968f527dbaad2b5dd5b374/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FlutterWiz/podcast_app_case/ca9f99285d8a9ed7aa968f527dbaad2b5dd5b374/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md:
--------------------------------------------------------------------------------
1 | # Launch Screen Assets
2 |
3 | You can customize the launch screen with your own desired assets by replacing the image files in this directory.
4 |
5 | You can also do it by opening your Flutter project's Xcode project with `open ios/Runner.xcworkspace`, selecting `Runner/Assets.xcassets` in the Project Navigator and dropping in the desired images.
--------------------------------------------------------------------------------
/ios/Runner/Base.lproj/LaunchScreen.storyboard:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
--------------------------------------------------------------------------------
/ios/Runner/Base.lproj/Main.storyboard:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
--------------------------------------------------------------------------------
/ios/Runner/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | $(DEVELOPMENT_LANGUAGE)
7 | CFBundleDisplayName
8 | podcast_app_case
9 | CFBundleExecutable
10 | $(EXECUTABLE_NAME)
11 | CFBundleIdentifier
12 | $(PRODUCT_BUNDLE_IDENTIFIER)
13 | CFBundleInfoDictionaryVersion
14 | 6.0
15 | CFBundleName
16 | podcast_app_case
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 |
49 |
50 |
--------------------------------------------------------------------------------
/ios/Runner/Runner-Bridging-Header.h:
--------------------------------------------------------------------------------
1 | #import "GeneratedPluginRegistrant.h"
2 |
--------------------------------------------------------------------------------
/lib/application/login/cubit/login_cubit.dart:
--------------------------------------------------------------------------------
1 | import 'package:bloc/bloc.dart';
2 |
3 | import 'package:formz/formz.dart';
4 | import 'package:freezed_annotation/freezed_annotation.dart';
5 | import 'package:podcast_ui_application/domain/auth_models/email.dart';
6 | import 'package:podcast_ui_application/domain/auth_models/password.dart';
7 |
8 | part 'login_state.dart';
9 | part 'login_cubit.freezed.dart';
10 |
11 | class LoginCubit extends Cubit {
12 | LoginCubit() : super(const LoginState.initial());
13 |
14 | void emailChanged(String value) {
15 | final email = Email.dirty(value);
16 | emit(state.copyWith(
17 | email: email,
18 | status: Formz.validate([email, state.password]),
19 | ));
20 | }
21 |
22 | void passwordChanged(String value) {
23 | final password = Password.dirty(value);
24 | emit(state.copyWith(
25 | password: password,
26 | status: Formz.validate([state.email, password]),
27 | ));
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/lib/application/login/cubit/login_cubit.freezed.dart:
--------------------------------------------------------------------------------
1 | // coverage:ignore-file
2 | // GENERATED CODE - DO NOT MODIFY BY HAND
3 | // ignore_for_file: type=lint
4 | // ignore_for_file: unused_element, deprecated_member_use, deprecated_member_use_from_same_package, use_function_type_syntax_for_parameters, unnecessary_const, avoid_init_to_null, invalid_override_different_default_values_named, prefer_expression_function_bodies, annotate_overrides, invalid_annotation_target
5 |
6 | part of 'login_cubit.dart';
7 |
8 | // **************************************************************************
9 | // FreezedGenerator
10 | // **************************************************************************
11 |
12 | T _$identity(T value) => value;
13 |
14 | final _privateConstructorUsedError = UnsupportedError(
15 | 'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#custom-getters-and-methods');
16 |
17 | /// @nodoc
18 | mixin _$LoginState {
19 | Email get email => throw _privateConstructorUsedError;
20 | Password get password => throw _privateConstructorUsedError;
21 | FormzStatus get status => throw _privateConstructorUsedError;
22 | String get exceptionError => throw _privateConstructorUsedError;
23 | @optionalTypeArgs
24 | TResult when({
25 | required TResult Function(Email email, Password password,
26 | FormzStatus status, String exceptionError)
27 | initial,
28 | }) =>
29 | throw _privateConstructorUsedError;
30 | @optionalTypeArgs
31 | TResult? whenOrNull({
32 | TResult Function(Email email, Password password, FormzStatus status,
33 | String exceptionError)?
34 | initial,
35 | }) =>
36 | throw _privateConstructorUsedError;
37 | @optionalTypeArgs
38 | TResult maybeWhen({
39 | TResult Function(Email email, Password password, FormzStatus status,
40 | String exceptionError)?
41 | initial,
42 | required TResult orElse(),
43 | }) =>
44 | throw _privateConstructorUsedError;
45 | @optionalTypeArgs
46 | TResult map({
47 | required TResult Function(_Initial value) initial,
48 | }) =>
49 | throw _privateConstructorUsedError;
50 | @optionalTypeArgs
51 | TResult? mapOrNull({
52 | TResult Function(_Initial value)? initial,
53 | }) =>
54 | throw _privateConstructorUsedError;
55 | @optionalTypeArgs
56 | TResult maybeMap({
57 | TResult Function(_Initial value)? initial,
58 | required TResult orElse(),
59 | }) =>
60 | throw _privateConstructorUsedError;
61 |
62 | @JsonKey(ignore: true)
63 | $LoginStateCopyWith get copyWith =>
64 | throw _privateConstructorUsedError;
65 | }
66 |
67 | /// @nodoc
68 | abstract class $LoginStateCopyWith<$Res> {
69 | factory $LoginStateCopyWith(
70 | LoginState value, $Res Function(LoginState) then) =
71 | _$LoginStateCopyWithImpl<$Res>;
72 | $Res call(
73 | {Email email,
74 | Password password,
75 | FormzStatus status,
76 | String exceptionError});
77 | }
78 |
79 | /// @nodoc
80 | class _$LoginStateCopyWithImpl<$Res> implements $LoginStateCopyWith<$Res> {
81 | _$LoginStateCopyWithImpl(this._value, this._then);
82 |
83 | final LoginState _value;
84 | // ignore: unused_field
85 | final $Res Function(LoginState) _then;
86 |
87 | @override
88 | $Res call({
89 | Object? email = freezed,
90 | Object? password = freezed,
91 | Object? status = freezed,
92 | Object? exceptionError = freezed,
93 | }) {
94 | return _then(_value.copyWith(
95 | email: email == freezed
96 | ? _value.email
97 | : email // ignore: cast_nullable_to_non_nullable
98 | as Email,
99 | password: password == freezed
100 | ? _value.password
101 | : password // ignore: cast_nullable_to_non_nullable
102 | as Password,
103 | status: status == freezed
104 | ? _value.status
105 | : status // ignore: cast_nullable_to_non_nullable
106 | as FormzStatus,
107 | exceptionError: exceptionError == freezed
108 | ? _value.exceptionError
109 | : exceptionError // ignore: cast_nullable_to_non_nullable
110 | as String,
111 | ));
112 | }
113 | }
114 |
115 | /// @nodoc
116 | abstract class _$$_InitialCopyWith<$Res> implements $LoginStateCopyWith<$Res> {
117 | factory _$$_InitialCopyWith(
118 | _$_Initial value, $Res Function(_$_Initial) then) =
119 | __$$_InitialCopyWithImpl<$Res>;
120 | @override
121 | $Res call(
122 | {Email email,
123 | Password password,
124 | FormzStatus status,
125 | String exceptionError});
126 | }
127 |
128 | /// @nodoc
129 | class __$$_InitialCopyWithImpl<$Res> extends _$LoginStateCopyWithImpl<$Res>
130 | implements _$$_InitialCopyWith<$Res> {
131 | __$$_InitialCopyWithImpl(_$_Initial _value, $Res Function(_$_Initial) _then)
132 | : super(_value, (v) => _then(v as _$_Initial));
133 |
134 | @override
135 | _$_Initial get _value => super._value as _$_Initial;
136 |
137 | @override
138 | $Res call({
139 | Object? email = freezed,
140 | Object? password = freezed,
141 | Object? status = freezed,
142 | Object? exceptionError = freezed,
143 | }) {
144 | return _then(_$_Initial(
145 | email: email == freezed
146 | ? _value.email
147 | : email // ignore: cast_nullable_to_non_nullable
148 | as Email,
149 | password: password == freezed
150 | ? _value.password
151 | : password // ignore: cast_nullable_to_non_nullable
152 | as Password,
153 | status: status == freezed
154 | ? _value.status
155 | : status // ignore: cast_nullable_to_non_nullable
156 | as FormzStatus,
157 | exceptionError: exceptionError == freezed
158 | ? _value.exceptionError
159 | : exceptionError // ignore: cast_nullable_to_non_nullable
160 | as String,
161 | ));
162 | }
163 | }
164 |
165 | /// @nodoc
166 |
167 | class _$_Initial implements _Initial {
168 | const _$_Initial(
169 | {this.email = const Email.pure(),
170 | this.password = const Password.pure(),
171 | this.status = FormzStatus.pure,
172 | this.exceptionError = ''});
173 |
174 | @override
175 | @JsonKey()
176 | final Email email;
177 | @override
178 | @JsonKey()
179 | final Password password;
180 | @override
181 | @JsonKey()
182 | final FormzStatus status;
183 | @override
184 | @JsonKey()
185 | final String exceptionError;
186 |
187 | @override
188 | String toString() {
189 | return 'LoginState.initial(email: $email, password: $password, status: $status, exceptionError: $exceptionError)';
190 | }
191 |
192 | @override
193 | bool operator ==(dynamic other) {
194 | return identical(this, other) ||
195 | (other.runtimeType == runtimeType &&
196 | other is _$_Initial &&
197 | const DeepCollectionEquality().equals(other.email, email) &&
198 | const DeepCollectionEquality().equals(other.password, password) &&
199 | const DeepCollectionEquality().equals(other.status, status) &&
200 | const DeepCollectionEquality()
201 | .equals(other.exceptionError, exceptionError));
202 | }
203 |
204 | @override
205 | int get hashCode => Object.hash(
206 | runtimeType,
207 | const DeepCollectionEquality().hash(email),
208 | const DeepCollectionEquality().hash(password),
209 | const DeepCollectionEquality().hash(status),
210 | const DeepCollectionEquality().hash(exceptionError));
211 |
212 | @JsonKey(ignore: true)
213 | @override
214 | _$$_InitialCopyWith<_$_Initial> get copyWith =>
215 | __$$_InitialCopyWithImpl<_$_Initial>(this, _$identity);
216 |
217 | @override
218 | @optionalTypeArgs
219 | TResult when({
220 | required TResult Function(Email email, Password password,
221 | FormzStatus status, String exceptionError)
222 | initial,
223 | }) {
224 | return initial(email, password, status, exceptionError);
225 | }
226 |
227 | @override
228 | @optionalTypeArgs
229 | TResult? whenOrNull({
230 | TResult Function(Email email, Password password, FormzStatus status,
231 | String exceptionError)?
232 | initial,
233 | }) {
234 | return initial?.call(email, password, status, exceptionError);
235 | }
236 |
237 | @override
238 | @optionalTypeArgs
239 | TResult maybeWhen({
240 | TResult Function(Email email, Password password, FormzStatus status,
241 | String exceptionError)?
242 | initial,
243 | required TResult orElse(),
244 | }) {
245 | if (initial != null) {
246 | return initial(email, password, status, exceptionError);
247 | }
248 | return orElse();
249 | }
250 |
251 | @override
252 | @optionalTypeArgs
253 | TResult map({
254 | required TResult Function(_Initial value) initial,
255 | }) {
256 | return initial(this);
257 | }
258 |
259 | @override
260 | @optionalTypeArgs
261 | TResult? mapOrNull({
262 | TResult Function(_Initial value)? initial,
263 | }) {
264 | return initial?.call(this);
265 | }
266 |
267 | @override
268 | @optionalTypeArgs
269 | TResult maybeMap({
270 | TResult Function(_Initial value)? initial,
271 | required TResult orElse(),
272 | }) {
273 | if (initial != null) {
274 | return initial(this);
275 | }
276 | return orElse();
277 | }
278 | }
279 |
280 | abstract class _Initial implements LoginState {
281 | const factory _Initial(
282 | {final Email email,
283 | final Password password,
284 | final FormzStatus status,
285 | final String exceptionError}) = _$_Initial;
286 |
287 | @override
288 | Email get email => throw _privateConstructorUsedError;
289 | @override
290 | Password get password => throw _privateConstructorUsedError;
291 | @override
292 | FormzStatus get status => throw _privateConstructorUsedError;
293 | @override
294 | String get exceptionError => throw _privateConstructorUsedError;
295 | @override
296 | @JsonKey(ignore: true)
297 | _$$_InitialCopyWith<_$_Initial> get copyWith =>
298 | throw _privateConstructorUsedError;
299 | }
300 |
--------------------------------------------------------------------------------
/lib/application/login/cubit/login_state.dart:
--------------------------------------------------------------------------------
1 | part of 'login_cubit.dart';
2 |
3 | @freezed
4 | class LoginState with _$LoginState {
5 | const factory LoginState.initial({
6 | @Default(Email.pure()) Email email,
7 | @Default(Password.pure()) Password password,
8 | @Default(FormzStatus.pure) FormzStatus status,
9 | @Default('') String exceptionError,
10 | }) = _Initial;
11 | }
12 |
--------------------------------------------------------------------------------
/lib/domain/auth_models/email.dart:
--------------------------------------------------------------------------------
1 | import 'package:formz/formz.dart';
2 |
3 | enum EmailValidationError { invalid }
4 |
5 | class Email extends FormzInput {
6 | const Email.pure() : super.pure('');
7 | const Email.dirty([String value = '']) : super.dirty(value);
8 |
9 | static final RegExp _emailRegExp = RegExp(
10 | r'^[a-zA-Z0-9.!#$%&’*+/=?^_`{|}~-]+@[a-zA-Z0-9-]+(?:\.[a-zA-Z0-9-]+)*$',
11 | );
12 |
13 | @override
14 | EmailValidationError? validator(String value) {
15 | if (value.isEmpty) {
16 | return null;
17 | }
18 | return _emailRegExp.hasMatch(value) && value.length < 30 ? null : EmailValidationError.invalid;
19 | }
20 | }
21 |
22 | extension Explanation on EmailValidationError {
23 | String? get name {
24 | switch (this) {
25 | case EmailValidationError.invalid:
26 | return "Invalid email";
27 | default:
28 | return null;
29 | }
30 | }
31 | }
32 |
--------------------------------------------------------------------------------
/lib/domain/auth_models/password.dart:
--------------------------------------------------------------------------------
1 | import 'package:formz/formz.dart';
2 |
3 | enum PasswordValidationError { invalid, empty }
4 |
5 | class Password extends FormzInput {
6 | const Password.pure() : super.pure('');
7 | const Password.dirty([String value = '']) : super.dirty(value);
8 |
9 | static final _passwordRegExp = RegExp(r'^[A-Za-z\d@$!%*?&]{8,}$');
10 |
11 | @override
12 | PasswordValidationError? validator(String value) {
13 | if (value.isEmpty) {
14 | return PasswordValidationError.empty;
15 | }
16 | return _passwordRegExp.hasMatch(value) && value.length >= 6 ? null : PasswordValidationError.invalid;
17 | }
18 | }
19 |
20 | extension Explanation on PasswordValidationError {
21 | String? get name {
22 | switch (this) {
23 | case PasswordValidationError.invalid:
24 | return "Invalid password";
25 | default:
26 | return null;
27 | }
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/lib/infrastructure/api/api.dart:
--------------------------------------------------------------------------------
1 | import 'package:dio/dio.dart';
2 |
3 | class Api {
4 | Future getPodcastInformations() async {
5 | final response = await Dio().get('https://rickandmortyapi.com/api/character/');
6 | return response.data["results"];
7 | }
8 |
9 | Future getPodcastEpisodesInformations({required String episodeUrl}) async {
10 | final response = await Dio().get(episodeUrl);
11 | return response.data;
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/lib/main.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 | import 'package:podcast_ui_application/presentation/core/app_widget.dart';
3 |
4 | void main() {
5 | runApp(const AppWidget());
6 | }
7 |
--------------------------------------------------------------------------------
/lib/presentation/core/app_widget.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 | import 'package:podcast_ui_application/presentation/routes/router.gr.dart';
3 |
4 | class AppWidget extends StatelessWidget {
5 | const AppWidget({Key? key}) : super(key: key);
6 |
7 | @override
8 | Widget build(BuildContext context) {
9 | final AppRouter _appRouter = AppRouter();
10 |
11 | return MaterialApp.router(
12 | title: "Open Source Podcast UI App",
13 | debugShowCheckedModeBanner: false,
14 | routerDelegate: _appRouter.delegate(),
15 | routeInformationParser: _appRouter.defaultRouteParser(),
16 | );
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/lib/presentation/pages/episode_details/constants/colors.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 |
3 | const Color pageBackgroundColor = Color.fromRGBO(27, 26, 31, 1);
4 | const Color transparentColor = Colors.transparent;
5 | const Color whiteColor = Colors.white;
6 | const Color podcastOwnersNameColor = Color.fromRGBO(42, 161, 118, 1);
7 | const Color constantPodcastDetailsColor = Color.fromRGBO(89, 89, 94, 1);
8 | const Color buttonColor = Color.fromRGBO(20, 220, 148, 1);
9 |
--------------------------------------------------------------------------------
/lib/presentation/pages/episode_details/constants/texts.dart:
--------------------------------------------------------------------------------
1 | const String constantPodcastDetails =
2 | "Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s";
3 |
4 | const String seeAllEpisode = "See all episode";
5 | const String podcast = "Podcast";
6 | const String play = "Play";
7 |
--------------------------------------------------------------------------------
/lib/presentation/pages/episode_details/episode_details_page.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/cupertino.dart';
2 | import 'package:flutter/material.dart';
3 | import 'package:podcast_ui_application/presentation/pages/episode_details/constants/colors.dart';
4 | import 'package:podcast_ui_application/presentation/pages/episode_details/widgets/app_bar.dart';
5 | import 'package:podcast_ui_application/presentation/pages/episode_details/widgets/custom_icon_button.dart';
6 | import 'package:podcast_ui_application/presentation/pages/episode_details/widgets/episode_details_page_body.dart';
7 |
8 | class EpisodeDetailsPage extends StatelessWidget {
9 | const EpisodeDetailsPage({
10 | Key? key,
11 | required this.podcastImageUrl,
12 | required this.podcastName,
13 | required this.podcastOwner,
14 | required this.podcastEpisodes,
15 | }) : super(key: key);
16 |
17 | final String podcastImageUrl;
18 | final String podcastName;
19 | final String podcastOwner;
20 | final List podcastEpisodes;
21 |
22 | @override
23 | Widget build(BuildContext context) {
24 | return Scaffold(
25 | backgroundColor: pageBackgroundColor,
26 | appBar: AppBarWidget(
27 | appBarActions: [
28 | CustomIconButton(buttonPadding: const EdgeInsets.only(right: 20), icon: CupertinoIcons.ellipsis_vertical, iconSize: 25, onPressed: () {}),
29 | ],
30 | ),
31 | body: EpisodeDetailsPageBody(
32 | podcastImageUrl: podcastImageUrl,
33 | podcastEpisodes: podcastEpisodes,
34 | podcastName: podcastName,
35 | podcastOwnersName: podcastOwner,
36 | ),
37 | );
38 | }
39 | }
40 |
--------------------------------------------------------------------------------
/lib/presentation/pages/episode_details/widgets/app_bar.dart:
--------------------------------------------------------------------------------
1 | import 'package:auto_route/auto_route.dart';
2 |
3 | import 'package:flutter/material.dart';
4 | import 'package:podcast_ui_application/presentation/pages/episode_details/constants/colors.dart';
5 | import 'package:podcast_ui_application/presentation/pages/episode_details/widgets/custom_icon_button.dart';
6 | import 'package:podcast_ui_application/presentation/routes/router.gr.dart';
7 |
8 | class AppBarWidget extends StatelessWidget with PreferredSizeWidget {
9 | AppBarWidget({Key? key, required this.appBarActions})
10 | : preferredSize = const Size.fromHeight(56.0),
11 | super(key: key);
12 |
13 | @override
14 | final Size preferredSize;
15 | final List appBarActions;
16 |
17 | @override
18 | Widget build(BuildContext context) {
19 | return AppBar(
20 | backgroundColor: pageBackgroundColor,
21 | elevation: 0,
22 | leading: CustomIconButton(
23 | onPressed: () => AutoRouter.of(context).replace(const HomeRoute()),
24 | buttonPadding: const EdgeInsets.only(left: 20),
25 | icon: Icons.arrow_back,
26 | iconSize: 25,
27 | ),
28 | automaticallyImplyLeading: true,
29 | actions: appBarActions);
30 | }
31 | }
32 |
--------------------------------------------------------------------------------
/lib/presentation/pages/episode_details/widgets/custom_icon_button.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 | import 'package:podcast_ui_application/presentation/pages/episode_details/constants/colors.dart';
3 |
4 | class CustomIconButton extends StatelessWidget {
5 | final EdgeInsetsGeometry buttonPadding;
6 | final IconData icon;
7 | final double iconSize;
8 | final VoidCallback? onPressed;
9 |
10 | const CustomIconButton({Key? key, required this.buttonPadding, required this.icon, required this.iconSize, this.onPressed}) : super(key: key);
11 |
12 | @override
13 | Widget build(BuildContext context) {
14 | return Padding(
15 | padding: buttonPadding,
16 | child: IconButton(onPressed: onPressed, icon: Icon(icon, size: iconSize, color: whiteColor)),
17 | );
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/lib/presentation/pages/episode_details/widgets/custom_list_tile.dart:
--------------------------------------------------------------------------------
1 | import 'package:auto_route/auto_route.dart';
2 | import 'package:cached_network_image/cached_network_image.dart';
3 | import 'package:flutter/material.dart';
4 | import 'package:podcast_ui_application/presentation/pages/episode_details/constants/colors.dart';
5 | import 'package:podcast_ui_application/presentation/pages/episode_details/widgets/custom_icon_button.dart';
6 | import 'package:podcast_ui_application/presentation/pages/episode_details/widgets/podcast_text.dart';
7 | import 'package:podcast_ui_application/presentation/routes/router.gr.dart';
8 |
9 | class CustomListTile extends StatelessWidget {
10 | const CustomListTile({
11 | Key? key,
12 | required this.podcastImageUrl,
13 | required this.episode,
14 | required this.episodeName,
15 | required this.podcastOwnersName,
16 | }) : super(key: key);
17 | final String podcastImageUrl;
18 | final String episode;
19 | final String episodeName;
20 | final String podcastOwnersName;
21 |
22 | @override
23 | Widget build(BuildContext context) {
24 | return InkWell(
25 | onTap: () => AutoRouter.of(context).navigate(PlayerRoute(
26 | podcastImageUrl: podcastImageUrl,
27 | podcastName: episodeName,
28 | podcastOwner: podcastOwnersName,
29 | )),
30 | child: Row(
31 | mainAxisAlignment: MainAxisAlignment.spaceBetween,
32 | children: [
33 | Row(
34 | children: [
35 | Padding(
36 | padding: const EdgeInsets.only(bottom: 20.0, right: 15),
37 | child: CachedNetworkImage(
38 | placeholder: (context, url) => const CircularProgressIndicator(),
39 | imageUrl: podcastImageUrl,
40 | imageBuilder: (context, imageProvider) => Container(
41 | width: 100,
42 | height: 100,
43 | decoration: BoxDecoration(
44 | borderRadius: const BorderRadius.all(Radius.circular(10)),
45 | image: DecorationImage(
46 | fit: BoxFit.fill,
47 | image: imageProvider,
48 | )),
49 | ),
50 | ),
51 | ),
52 | Padding(
53 | padding: const EdgeInsets.only(right: 15.0),
54 | child: Column(
55 | mainAxisAlignment: MainAxisAlignment.start,
56 | crossAxisAlignment: CrossAxisAlignment.start,
57 | children: [
58 | PodcastText(
59 | textPadding: const EdgeInsets.only(),
60 | textColor: whiteColor,
61 | minFontSize: 18,
62 | maxFontSize: 20,
63 | text: episodeName,
64 | fontWeight: FontWeight.w500,
65 | ),
66 | PodcastText(
67 | textPadding: const EdgeInsets.only(),
68 | textColor: constantPodcastDetailsColor,
69 | minFontSize: 15,
70 | maxFontSize: 17,
71 | text: episode,
72 | fontWeight: FontWeight.w500,
73 | )
74 | ],
75 | ),
76 | ),
77 | ],
78 | ),
79 | CustomIconButton(
80 | buttonPadding: const EdgeInsets.only(),
81 | icon: Icons.download,
82 | iconSize: 30,
83 | onPressed: () {},
84 | )
85 | ],
86 | ),
87 | );
88 | }
89 | }
90 |
--------------------------------------------------------------------------------
/lib/presentation/pages/episode_details/widgets/episode_details_page_body.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/cupertino.dart';
2 | import 'package:flutter/material.dart';
3 | import 'package:podcast_ui_application/presentation/pages/episode_details/constants/colors.dart';
4 | import 'package:podcast_ui_application/presentation/pages/episode_details/constants/texts.dart';
5 | import 'package:podcast_ui_application/presentation/pages/episode_details/widgets/custom_icon_button.dart';
6 | import 'package:podcast_ui_application/presentation/pages/episode_details/widgets/play_button.dart';
7 | import 'package:podcast_ui_application/presentation/pages/episode_details/widgets/podcast_episodes.dart';
8 | import 'package:podcast_ui_application/presentation/pages/episode_details/widgets/podcast_image_with_percentage.dart';
9 | import 'package:podcast_ui_application/presentation/pages/episode_details/widgets/podcast_text.dart';
10 |
11 | class EpisodeDetailsPageBody extends StatelessWidget {
12 | const EpisodeDetailsPageBody({
13 | Key? key,
14 | required this.podcastImageUrl,
15 | required this.podcastName,
16 | required this.podcastOwnersName,
17 | required this.podcastEpisodes,
18 | }) : super(key: key);
19 |
20 | final String podcastImageUrl;
21 | final String podcastName;
22 | final String podcastOwnersName;
23 | final List podcastEpisodes;
24 |
25 | @override
26 | Widget build(BuildContext context) {
27 | return SingleChildScrollView(
28 | child: Column(
29 | mainAxisAlignment: MainAxisAlignment.start,
30 | crossAxisAlignment: CrossAxisAlignment.start,
31 | children: [
32 | PodcastImageWithPercentageAndDownladingButton(podcastImageUrl: podcastImageUrl),
33 | PodcastText(
34 | textColor: whiteColor,
35 | minFontSize: 25,
36 | maxFontSize: 30,
37 | text: podcastName,
38 | fontWeight: FontWeight.w500,
39 | ),
40 | PodcastText(
41 | textColor: podcastOwnersNameColor,
42 | minFontSize: 16,
43 | maxFontSize: 18,
44 | text: "$podcastOwnersName $podcast",
45 | fontWeight: FontWeight.w500,
46 | ),
47 | const PodcastText(
48 | textColor: constantPodcastDetailsColor,
49 | minFontSize: 15,
50 | maxFontSize: 17,
51 | text: constantPodcastDetails,
52 | fontWeight: FontWeight.w400,
53 | ),
54 | Padding(
55 | padding: const EdgeInsets.only(left: 25, top: 15, bottom: 15),
56 | child: Row(
57 | children: [
58 | PlayButton(podcastName: podcastName, podcastImageUrl: podcastImageUrl, podcastOwnersName: podcastOwnersName),
59 | CustomIconButton(buttonPadding: const EdgeInsets.only(left: 20), icon: CupertinoIcons.share, iconSize: 25, onPressed: () {}),
60 | CustomIconButton(buttonPadding: const EdgeInsets.only(left: 15), icon: CupertinoIcons.heart, iconSize: 25, onPressed: () {})
61 | ],
62 | ),
63 | ),
64 | Row(
65 | mainAxisAlignment: MainAxisAlignment.center,
66 | children: [
67 | const PodcastText(
68 | textColor: whiteColor,
69 | minFontSize: 16,
70 | maxFontSize: 18,
71 | text: seeAllEpisode,
72 | fontWeight: FontWeight.w500,
73 | ),
74 | CustomIconButton(buttonPadding: const EdgeInsets.only(top: 10), icon: Icons.keyboard_arrow_down, iconSize: 30, onPressed: () {})
75 | ],
76 | ),
77 | PodcastEpisodes(
78 | podcastImageUrl: podcastImageUrl,
79 | podcastName: podcastName,
80 | podcastOwnersName: podcastOwnersName,
81 | podcastEpisodes: podcastEpisodes,
82 | )
83 | ],
84 | ),
85 | );
86 | }
87 | }
88 |
--------------------------------------------------------------------------------
/lib/presentation/pages/episode_details/widgets/play_button.dart:
--------------------------------------------------------------------------------
1 | import 'package:auto_route/auto_route.dart';
2 | import 'package:flutter/material.dart';
3 | import 'package:podcast_ui_application/presentation/pages/episode_details/constants/colors.dart';
4 | import 'package:podcast_ui_application/presentation/pages/episode_details/constants/texts.dart';
5 | import 'package:podcast_ui_application/presentation/pages/episode_details/widgets/podcast_text.dart';
6 | import 'package:podcast_ui_application/presentation/routes/router.gr.dart';
7 |
8 | class PlayButton extends StatelessWidget {
9 | const PlayButton({
10 | Key? key,
11 | required this.podcastName,
12 | required this.podcastImageUrl,
13 | required this.podcastOwnersName,
14 | }) : super(key: key);
15 |
16 | final String podcastName;
17 | final String podcastImageUrl;
18 | final String podcastOwnersName;
19 |
20 | @override
21 | Widget build(BuildContext context) {
22 | return InkWell(
23 | onTap: () {
24 | AutoRouter.of(context).navigate(PlayerRoute(
25 | podcastImageUrl: podcastImageUrl,
26 | podcastName: podcastName,
27 | podcastOwner: podcastOwnersName,
28 | ));
29 | },
30 | child: Container(
31 | width: 230,
32 | height: 80,
33 | decoration: const BoxDecoration(color: buttonColor, borderRadius: BorderRadius.all(Radius.circular(15))),
34 | child: const Center(
35 | child: PodcastText(textPadding: EdgeInsets.only(), fontWeight: FontWeight.w600, maxFontSize: 21, minFontSize: 17, text: play, textColor: whiteColor),
36 | ),
37 | ),
38 | );
39 | }
40 | }
41 |
--------------------------------------------------------------------------------
/lib/presentation/pages/episode_details/widgets/podcast_episodes.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 | import 'package:podcast_ui_application/infrastructure/api/api.dart';
3 | import 'package:podcast_ui_application/presentation/pages/episode_details/constants/colors.dart';
4 | import 'package:podcast_ui_application/presentation/pages/episode_details/widgets/custom_list_tile.dart';
5 | import 'package:progress_indicators/progress_indicators.dart';
6 |
7 | class PodcastEpisodes extends StatelessWidget {
8 | final String podcastImageUrl;
9 | final String podcastName;
10 | final String podcastOwnersName;
11 | final List podcastEpisodes;
12 |
13 | const PodcastEpisodes({
14 | Key? key,
15 | required this.podcastImageUrl,
16 | required this.podcastName,
17 | required this.podcastOwnersName,
18 | required this.podcastEpisodes,
19 | }) : super(key: key);
20 |
21 | @override
22 | Widget build(BuildContext context) {
23 | return ListView.builder(
24 | padding: const EdgeInsets.symmetric(vertical: 15, horizontal: 25),
25 | itemCount: 2,
26 | shrinkWrap: true,
27 | itemBuilder: (BuildContext context, int index) {
28 | final getRequest = Api().getPodcastEpisodesInformations(episodeUrl: podcastEpisodes[index]);
29 | return FutureBuilder(
30 | future: getRequest,
31 | builder: (context, AsyncSnapshot snapshot) {
32 | if (snapshot.connectionState == ConnectionState.done) {
33 | if (!snapshot.hasData) {
34 | return Center(child: JumpingDotsProgressIndicator(fontSize: 40, color: buttonColor));
35 | } else {
36 | final String episodeName = snapshot.data["name"];
37 | final String episode = snapshot.data["episode"];
38 |
39 | return CustomListTile(
40 | podcastImageUrl: podcastImageUrl,
41 | episode: episode,
42 | episodeName: episodeName,
43 | podcastOwnersName: podcastOwnersName,
44 | );
45 | }
46 | }
47 | return Center(child: JumpingDotsProgressIndicator(fontSize: 40, color: buttonColor));
48 | });
49 | },
50 | );
51 | }
52 | }
53 |
--------------------------------------------------------------------------------
/lib/presentation/pages/episode_details/widgets/podcast_image_with_percentage.dart:
--------------------------------------------------------------------------------
1 | import 'package:cached_network_image/cached_network_image.dart';
2 | import 'package:flutter/material.dart';
3 | import 'package:podcast_ui_application/presentation/pages/episode_details/widgets/custom_icon_button.dart';
4 | import 'package:podcast_ui_application/presentation/pages/home/widgets/linear_percentage_bar.dart';
5 |
6 | class PodcastImageWithPercentageAndDownladingButton extends StatelessWidget {
7 | const PodcastImageWithPercentageAndDownladingButton({Key? key, required this.podcastImageUrl}) : super(key: key);
8 | final String podcastImageUrl;
9 |
10 | @override
11 | Widget build(BuildContext context) {
12 | return Row(
13 | mainAxisAlignment: MainAxisAlignment.spaceBetween,
14 | crossAxisAlignment: CrossAxisAlignment.start,
15 | children: [
16 | Column(
17 | mainAxisAlignment: MainAxisAlignment.start,
18 | crossAxisAlignment: CrossAxisAlignment.start,
19 | children: [
20 | Padding(
21 | padding: const EdgeInsets.only(left: 25, top: 25),
22 | child: CachedNetworkImage(
23 | placeholder: (context, url) => const CircularProgressIndicator(),
24 | imageUrl: podcastImageUrl,
25 | imageBuilder: (context, imageProvider) => Container(
26 | width: 170,
27 | height: 170,
28 | decoration: BoxDecoration(
29 | borderRadius: const BorderRadius.all(Radius.circular(20)),
30 | image: DecorationImage(
31 | fit: BoxFit.fill,
32 | image: imageProvider,
33 | )),
34 | ),
35 | )),
36 | const LinearPercentageBar(linearPercentIndicatiorWith: 210, leftPadding: 25),
37 | ],
38 | ),
39 | const CustomIconButton(buttonPadding: EdgeInsets.only(top: 25, right: 25), icon: Icons.download, iconSize: 30)
40 | ],
41 | );
42 | }
43 | }
44 |
--------------------------------------------------------------------------------
/lib/presentation/pages/episode_details/widgets/podcast_text.dart:
--------------------------------------------------------------------------------
1 | import 'package:auto_size_text/auto_size_text.dart';
2 | import 'package:flutter/material.dart';
3 |
4 | class PodcastText extends StatelessWidget {
5 | const PodcastText({
6 | Key? key,
7 | required this.textColor,
8 | required this.minFontSize,
9 | required this.maxFontSize,
10 | required this.text,
11 | required this.fontWeight,
12 | this.textPadding = const EdgeInsets.only(left: 25, top: 10, right: 50),
13 | }) : super(key: key);
14 |
15 | final Color textColor;
16 | final double minFontSize;
17 | final double maxFontSize;
18 | final String text;
19 | final FontWeight fontWeight;
20 | final EdgeInsetsGeometry? textPadding;
21 |
22 | @override
23 | Widget build(BuildContext context) {
24 | return Padding(
25 | padding: textPadding!,
26 | child: AutoSizeText(
27 | text,
28 | minFontSize: minFontSize,
29 | maxFontSize: maxFontSize,
30 | overflow: TextOverflow.ellipsis,
31 | maxLines: 2,
32 | style: TextStyle(color: textColor, fontWeight: fontWeight),
33 | ),
34 | );
35 | }
36 | }
37 |
--------------------------------------------------------------------------------
/lib/presentation/pages/home/constants/colors.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 |
3 | const Color whiteColor = Colors.white;
4 | const Color transparentColor = Colors.transparent;
5 |
6 | const Color pageBackgroundColor = Color.fromRGBO(27, 26, 31, 1);
7 | const Color screenTabTextsColor = Color.fromRGBO(89, 89, 94, 1);
8 | const Color greenStraightLineColor = Color.fromRGBO(19, 124, 86, 1);
9 | const Color coloredRectangleColor = Color.fromRGBO(229, 229, 229, 1);
10 | const Color percentageIndicatorBackgroundColor = Color.fromRGBO(12, 77, 53, 1);
11 | const Color percentageIndicatorForegroundColor = Color.fromRGBO(20, 220, 148, 1);
12 | const Color navigationBarUnselectedItemsColor = Color.fromRGBO(89, 89, 94, 1);
--------------------------------------------------------------------------------
/lib/presentation/pages/home/constants/texts.dart:
--------------------------------------------------------------------------------
1 | const String searchBarHintText = "Find topics, podcaster, etc.";
2 |
3 | const String forYou = "For you";
4 | const String podcast = "Podcast";
5 | const String audiobook = "Audiobook";
6 | const String radio = "Radio";
7 | const String continueListening = "Continue Listening";
8 | const String topics = "Topics";
9 | const String newRelease = "New Release";
10 |
11 | const String home = "Home";
12 | const String search = "Search";
13 | const String live = "Live";
14 | const String profile = "Profile";
--------------------------------------------------------------------------------
/lib/presentation/pages/home/home_page.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 | import 'package:podcast_ui_application/infrastructure/api/api.dart';
3 | import 'package:podcast_ui_application/presentation/pages/home/constants/colors.dart';
4 | import 'package:podcast_ui_application/presentation/pages/home/widgets/custom_bottom_navigation_bar.dart';
5 | import 'package:podcast_ui_application/presentation/pages/home/widgets/home_page_body.dart';
6 | import 'package:progress_indicators/progress_indicators.dart';
7 |
8 | class HomePage extends StatelessWidget {
9 | const HomePage({Key? key}) : super(key: key);
10 |
11 | @override
12 | Widget build(BuildContext context) {
13 | final getRequest = Api().getPodcastInformations();
14 |
15 | return Scaffold(
16 | backgroundColor: pageBackgroundColor,
17 | body: FutureBuilder(
18 | future: getRequest,
19 | builder: (context, AsyncSnapshot snapshot) {
20 | if (snapshot.connectionState == ConnectionState.done) {
21 | if (!snapshot.hasData) {
22 | return Center(child: JumpingDotsProgressIndicator(fontSize: 40, color: percentageIndicatorForegroundColor));
23 | } else {
24 | final podcastData = snapshot.data;
25 |
26 | final _pageOptions = [
27 | HomePageBody(podcastData: podcastData),
28 | // and more pages here. Since we use just 1 screen in bottom nav bar,
29 | // we can use simply just [0] notation
30 | ];
31 | return _pageOptions[0];
32 | }
33 | }
34 | return Center(child: JumpingDotsProgressIndicator(fontSize: 40, color: percentageIndicatorForegroundColor));
35 | }),
36 | bottomNavigationBar: const CustomBottomNavigationBar());
37 | }
38 | }
39 |
--------------------------------------------------------------------------------
/lib/presentation/pages/home/widgets/colored_rectangle.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 | import 'package:podcast_ui_application/presentation/pages/home/constants/colors.dart';
3 |
4 | class ColoredRectangle extends StatelessWidget {
5 | const ColoredRectangle({Key? key, required this.height, required this.width, required this.rightPadding, required this.bottomPadding, required this.topPadding}) : super(key: key);
6 | final double height;
7 | final double width;
8 | final double rightPadding;
9 | final double bottomPadding;
10 | final double topPadding;
11 | @override
12 | Widget build(BuildContext context) {
13 | return Padding(
14 | padding: EdgeInsets.only(left: 25, right: rightPadding, top: topPadding, bottom: bottomPadding),
15 | child: Container(
16 | width: width,
17 | height: height,
18 | decoration: const BoxDecoration(
19 | color: coloredRectangleColor,
20 | borderRadius: BorderRadius.all(Radius.circular(10)),
21 | ),
22 | ),
23 | );
24 | }
25 | }
26 |
--------------------------------------------------------------------------------
/lib/presentation/pages/home/widgets/custom_bottom_navigation_bar.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/cupertino.dart';
2 | import 'package:flutter/material.dart';
3 | import 'package:podcast_ui_application/presentation/pages/home/constants/colors.dart';
4 | import 'package:podcast_ui_application/presentation/pages/home/constants/texts.dart';
5 |
6 | class CustomBottomNavigationBar extends StatelessWidget {
7 | const CustomBottomNavigationBar({Key? key}) : super(key: key);
8 |
9 | @override
10 | Widget build(BuildContext context) {
11 | return Padding(
12 | padding: const EdgeInsets.all(5.0),
13 | child: BottomNavigationBar(
14 | unselectedItemColor: navigationBarUnselectedItemsColor,
15 | selectedItemColor: percentageIndicatorForegroundColor,
16 | backgroundColor: pageBackgroundColor,
17 | type: BottomNavigationBarType.fixed,
18 | currentIndex: 0,
19 | onTap: (int index) {},
20 | items: const [
21 | BottomNavigationBarItem(
22 | backgroundColor: pageBackgroundColor,
23 | icon: Padding(
24 | padding: EdgeInsets.only(bottom: 5.0),
25 | child: Icon(CupertinoIcons.play_rectangle_fill, color: percentageIndicatorForegroundColor),
26 | ),
27 | label: home,
28 | ),
29 | BottomNavigationBarItem(icon: Icon(Icons.search), label: search),
30 | BottomNavigationBarItem(icon: Icon(CupertinoIcons.antenna_radiowaves_left_right), label: live),
31 | BottomNavigationBarItem(icon: Icon(Icons.person), label: profile),
32 | ],
33 | ),
34 | );
35 | }
36 | }
37 |
--------------------------------------------------------------------------------
/lib/presentation/pages/home/widgets/green_straight_line.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 | import 'package:podcast_ui_application/presentation/pages/home/constants/colors.dart';
3 |
4 | class GreenStraightLine extends StatelessWidget {
5 | const GreenStraightLine({Key? key}) : super(key: key);
6 |
7 | @override
8 | Widget build(BuildContext context) {
9 | return Padding(
10 | padding: const EdgeInsets.only(left: 20),
11 | child: Container(
12 | height: 3,
13 | width: 60,
14 | decoration: const BoxDecoration(borderRadius: BorderRadius.all(Radius.circular(15)), color: greenStraightLineColor),
15 | ),
16 | );
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/lib/presentation/pages/home/widgets/home_page_body.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 | import 'package:podcast_ui_application/presentation/pages/home/constants/colors.dart';
3 | import 'package:podcast_ui_application/presentation/pages/home/constants/texts.dart';
4 | import 'package:podcast_ui_application/presentation/pages/home/widgets/colored_rectangle.dart';
5 | import 'package:podcast_ui_application/presentation/pages/home/widgets/green_straight_line.dart';
6 | import 'package:podcast_ui_application/presentation/pages/home/widgets/home_page_episodes.dart';
7 | import 'package:podcast_ui_application/presentation/pages/home/widgets/notification_icon.dart';
8 | import 'package:podcast_ui_application/presentation/pages/home/widgets/screen_tab.dart';
9 | import 'package:podcast_ui_application/presentation/pages/home/widgets/search_bar.dart';
10 | import 'package:podcast_ui_application/presentation/pages/home/widgets/title_content_with_rectangles.dart';
11 | import 'package:podcast_ui_application/presentation/pages/home/widgets/title_with_button.dart';
12 |
13 | class HomePageBody extends StatelessWidget {
14 | const HomePageBody({Key? key, required this.podcastData}) : super(key: key);
15 | final dynamic podcastData;
16 | @override
17 | Widget build(BuildContext context) {
18 | return SingleChildScrollView(
19 | child: Column(
20 | children: [
21 | Row(
22 | children: const [Expanded(child: SearchBar()), NotificationIcon()],
23 | ),
24 | Row(
25 | children: [
26 | Column(
27 | children: const [ScreenTab(text: forYou, fontWeight: FontWeight.w500, textColor: whiteColor, leftPadding: 20), GreenStraightLine()],
28 | ),
29 | const ScreenTab(text: podcast, fontWeight: FontWeight.w400, textColor: screenTabTextsColor, leftPadding: 5),
30 | const ScreenTab(text: radio, fontWeight: FontWeight.w400, textColor: screenTabTextsColor, leftPadding: 5),
31 | const ScreenTab(text: audiobook, fontWeight: FontWeight.w400, textColor: screenTabTextsColor, leftPadding: 5),
32 | ],
33 | ),
34 | ColoredRectangle(height: 170, width: MediaQuery.of(context).size.width, rightPadding: 25, bottomPadding: 10, topPadding: 20),
35 | const TitleWithButton(titleText: continueListening),
36 | HomePageEpisodes(podcastData: podcastData),
37 | const TitleWithButton(titleText: topics),
38 | const TitleContentWithRectangles(height: 90),
39 | const TitleWithButton(titleText: newRelease),
40 | const TitleContentWithRectangles(height: 110),
41 | ],
42 | ),
43 | );
44 | }
45 | }
46 |
--------------------------------------------------------------------------------
/lib/presentation/pages/home/widgets/home_page_episode_title.dart:
--------------------------------------------------------------------------------
1 | import 'package:auto_size_text/auto_size_text.dart';
2 | import 'package:flutter/material.dart';
3 | import 'package:podcast_ui_application/presentation/pages/episode_details/constants/colors.dart';
4 |
5 | class HomePageEpisodeTitle extends StatelessWidget {
6 | const HomePageEpisodeTitle({Key? key, required this.index, required this.podcastName}) : super(key: key);
7 | final int index;
8 | final String podcastName;
9 |
10 | @override
11 | Widget build(BuildContext context) {
12 | return Container(
13 | padding: const EdgeInsets.only(top: 10),
14 | width: 120,
15 | child: AutoSizeText(
16 | podcastName,
17 | minFontSize: 14,
18 | maxFontSize: 17,
19 | maxLines: 1,
20 | overflow: TextOverflow.ellipsis,
21 | style: const TextStyle(color: whiteColor),
22 | ),
23 | );
24 | }
25 | }
26 |
--------------------------------------------------------------------------------
/lib/presentation/pages/home/widgets/home_page_episodes.dart:
--------------------------------------------------------------------------------
1 | import 'package:auto_route/auto_route.dart';
2 | import 'package:cached_network_image/cached_network_image.dart';
3 | import 'package:flutter/material.dart';
4 | import 'package:podcast_ui_application/presentation/pages/home/constants/colors.dart';
5 | import 'package:podcast_ui_application/presentation/pages/home/widgets/home_page_episode_title.dart';
6 | import 'package:podcast_ui_application/presentation/pages/home/widgets/linear_percentage_bar.dart';
7 | import 'package:podcast_ui_application/presentation/routes/router.gr.dart';
8 | import 'package:progress_indicators/progress_indicators.dart';
9 |
10 | class HomePageEpisodes extends StatelessWidget {
11 | const HomePageEpisodes({Key? key, required this.podcastData}) : super(key: key);
12 | final dynamic podcastData;
13 |
14 | @override
15 | Widget build(BuildContext context) {
16 | return Container(
17 | padding: const EdgeInsets.symmetric(horizontal: 25),
18 | height: 175,
19 | width: MediaQuery.of(context).size.width,
20 | child: ListView.builder(
21 | shrinkWrap: true,
22 | scrollDirection: Axis.horizontal,
23 | itemCount: 3,
24 | itemBuilder: (BuildContext context, int index) {
25 | final String podcastImageUrl = podcastData[index]["image"];
26 | final String podcastName = podcastData[index]["origin"]["name"];
27 | final String podcastOwnersName = podcastData[index]["name"];
28 | final List podcastEpisodes = podcastData[index]["episode"];
29 |
30 | return InkWell(
31 | onTap: () {
32 | AutoRouter.of(context).replace(EpisodeDetailsRoute(
33 | podcastImageUrl: podcastImageUrl,
34 | podcastName: podcastName,
35 | podcastOwner: podcastOwnersName,
36 | podcastEpisodes: podcastEpisodes,
37 | ));
38 | },
39 | child: Column(
40 | children: [
41 | Card(
42 | color: transparentColor,
43 | shape: BeveledRectangleBorder(
44 | borderRadius: BorderRadius.circular(20),
45 | ),
46 | child: CachedNetworkImage(
47 | placeholder: (context, url) => JumpingDotsProgressIndicator(fontSize: 40, color: percentageIndicatorForegroundColor),
48 | imageUrl: podcastImageUrl,
49 | imageBuilder: (context, imageProvider) => Container(
50 | width: 120,
51 | height: 120,
52 | decoration: BoxDecoration(
53 | borderRadius: const BorderRadius.all(Radius.circular(20)),
54 | image: DecorationImage(
55 | fit: BoxFit.fill,
56 | image: imageProvider,
57 | )),
58 | ),
59 | )),
60 | const LinearPercentageBar(linearPercentIndicatiorWith: 140, leftPadding: 10),
61 | HomePageEpisodeTitle(index: index, podcastName: podcastName)
62 | ],
63 | ),
64 | );
65 | },
66 | ),
67 | );
68 | }
69 | }
70 |
--------------------------------------------------------------------------------
/lib/presentation/pages/home/widgets/linear_percentage_bar.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 | import 'package:percent_indicator/percent_indicator.dart';
3 | import 'package:podcast_ui_application/presentation/pages/home/constants/colors.dart';
4 |
5 | class LinearPercentageBar extends StatelessWidget {
6 | const LinearPercentageBar({Key? key, required this.linearPercentIndicatiorWith, required this.leftPadding}) : super(key: key);
7 | final double linearPercentIndicatiorWith;
8 | final double leftPadding;
9 |
10 | @override
11 | Widget build(BuildContext context) {
12 | return LinearPercentIndicator(
13 | padding: EdgeInsets.only(top: 5, left: leftPadding, right: 10),
14 | width: linearPercentIndicatiorWith,
15 | lineHeight: 13.5,
16 | percent: 0.75,
17 | backgroundColor: percentageIndicatorBackgroundColor,
18 | progressColor: percentageIndicatorForegroundColor,
19 | barRadius: const Radius.circular(20));
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/lib/presentation/pages/home/widgets/notification_icon.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 | import 'package:podcast_ui_application/presentation/pages/home/constants/colors.dart';
3 |
4 | class NotificationIcon extends StatelessWidget {
5 | const NotificationIcon({Key? key}) : super(key: key);
6 |
7 | @override
8 | Widget build(BuildContext context) {
9 | return Padding(
10 | padding: const EdgeInsets.only(top: 40, right: 5),
11 | child: IconButton(
12 | onPressed: () {},
13 | icon: const Icon(
14 | Icons.notifications,
15 | color: whiteColor,
16 | ),
17 | ),
18 | );
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/lib/presentation/pages/home/widgets/screen_tab.dart:
--------------------------------------------------------------------------------
1 | import 'package:auto_size_text/auto_size_text.dart';
2 | import 'package:flutter/material.dart';
3 |
4 | class ScreenTab extends StatelessWidget {
5 | const ScreenTab({Key? key, required this.text, required this.fontWeight, required this.textColor, required this.leftPadding}) : super(key: key);
6 | final String text;
7 | final FontWeight fontWeight;
8 | final Color textColor;
9 | final double leftPadding;
10 | @override
11 | Widget build(BuildContext context) {
12 | return Padding(
13 | padding: EdgeInsets.only(left: leftPadding, top: 10),
14 | child: TextButton(
15 | onPressed: () {},
16 | child: AutoSizeText(
17 | text,
18 | minFontSize: 16,
19 | maxFontSize: 18,
20 | style: TextStyle(fontWeight: fontWeight, color: textColor),
21 | ),
22 | ));
23 | }
24 | }
25 |
--------------------------------------------------------------------------------
/lib/presentation/pages/home/widgets/search_bar.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 | import 'package:podcast_ui_application/presentation/pages/home/constants/texts.dart';
3 | import 'package:podcast_ui_application/presentation/pages/login/widgets/auth_text_field.dart';
4 |
5 | class SearchBar extends StatelessWidget {
6 | const SearchBar({Key? key}) : super(key: key);
7 |
8 | @override
9 | Widget build(BuildContext context) {
10 | return AuthTextField(
11 | padding: const EdgeInsets.only(left: 25, top: 40),
12 | borderRadiusCircularValue: 10,
13 | hint: searchBarHintText,
14 | keyboardType: TextInputType.emailAddress,
15 | onChanged: (value) {},
16 | );
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/lib/presentation/pages/home/widgets/title_content_with_rectangles.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 | import 'package:podcast_ui_application/presentation/pages/home/widgets/colored_rectangle.dart';
3 |
4 | class TitleContentWithRectangles extends StatelessWidget {
5 | const TitleContentWithRectangles({Key? key, required this.height}) : super(key: key);
6 | final double height;
7 | @override
8 | Widget build(BuildContext context) {
9 | return SizedBox(
10 | height: height,
11 | child: ListView.builder(
12 | shrinkWrap: true,
13 | scrollDirection: Axis.horizontal,
14 | itemCount: 3,
15 | itemBuilder: (BuildContext context, int index) {
16 | return InkWell(
17 | onTap: () {},
18 | child: ColoredRectangle(
19 | height: height,
20 | width: 155,
21 | rightPadding: 0,
22 | bottomPadding: 0,
23 | topPadding: 0,
24 | ));
25 | },
26 | ),
27 | );
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/lib/presentation/pages/home/widgets/title_text.dart:
--------------------------------------------------------------------------------
1 | import 'package:auto_size_text/auto_size_text.dart';
2 | import 'package:flutter/material.dart';
3 |
4 | class TitleText extends StatelessWidget {
5 | const TitleText({Key? key, required this.titleText}) : super(key: key);
6 | final String titleText;
7 | @override
8 | Widget build(BuildContext context) {
9 | return Padding(
10 | padding: const EdgeInsets.only(left: 25),
11 | child: AutoSizeText(
12 | titleText,
13 | maxFontSize: 18,
14 | minFontSize: 16,
15 | style: const TextStyle(fontWeight: FontWeight.w500, color: Colors.white),
16 | ),
17 | );
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/lib/presentation/pages/home/widgets/title_with_button.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 | import 'package:podcast_ui_application/presentation/pages/home/constants/colors.dart';
3 | import 'package:podcast_ui_application/presentation/pages/home/widgets/title_text.dart';
4 |
5 | class TitleWithButton extends StatelessWidget {
6 | const TitleWithButton({Key? key, required this.titleText}) : super(key: key);
7 | final String titleText;
8 | @override
9 | Widget build(BuildContext context) {
10 | return Row(
11 | mainAxisAlignment: MainAxisAlignment.spaceBetween,
12 | children: [
13 | TitleText(titleText: titleText),
14 | IconButton(padding: const EdgeInsets.only(right: 5), onPressed: () {}, icon: const Icon(Icons.arrow_forward_ios, color: whiteColor, size: 20)),
15 | ],
16 | );
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/lib/presentation/pages/introduction/constants/button_styles.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 | import 'package:podcast_ui_application/presentation/pages/introduction/constants/colors.dart';
3 |
4 | final introductionScreensButtonStyle = ButtonStyle(
5 | overlayColor: transparentColor,
6 | backgroundColor: transparentColor,
7 | foregroundColor: transparentColor,
8 | );
9 |
--------------------------------------------------------------------------------
/lib/presentation/pages/introduction/constants/colors.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 |
3 | const Color introductionScreenBodyTextColor = Color.fromRGBO(89, 89, 94, 1);
4 | const Color whiteColor = Colors.white;
5 | const Color globalBackgroundColor = Color.fromRGBO(27, 26, 31, 1);
6 | const Color introductionScreenButtonsColor = Color.fromRGBO(20, 220, 148, 1);
7 | const Color dotsInactiveColor = Color.fromRGBO(94, 94, 94, 0.702);
8 |
9 | final MaterialStateProperty? transparentColor = MaterialStateProperty.all(Colors.transparent);
10 |
--------------------------------------------------------------------------------
/lib/presentation/pages/introduction/constants/intro_key.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 | import 'package:introduction_screen/introduction_screen.dart';
3 |
4 | final introKey = GlobalKey();
5 |
--------------------------------------------------------------------------------
/lib/presentation/pages/introduction/constants/page_decoration.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 | import 'package:introduction_screen/introduction_screen.dart';
3 |
4 | const pageDecoration = PageDecoration(
5 | bodyAlignment: Alignment.bottomCenter,
6 | imageAlignment: Alignment.topCenter,
7 | titlePadding: EdgeInsets.only(top: 80, bottom: 6, left: 12, right: 12),
8 | bodyPadding: EdgeInsets.only(bottom: 10, left: 12, right: 12),
9 | imagePadding: EdgeInsets.only(left: 25, right: 25),
10 | bodyFlex: 0,
11 | );
12 |
--------------------------------------------------------------------------------
/lib/presentation/pages/introduction/constants/texts.dart:
--------------------------------------------------------------------------------
1 | const String firstScreenTitle = "Lorem Ipsum is simple";
2 | const String secondScreenTitle = "Contrary to popular belief";
3 | const String thirdScreenTitle = "Enjoy your favorit podcast";
4 |
5 | const String firstScreenBodyText = "Lorem Ipsum is simply dummy text Lorem Ipsum is simply dummy text..";
6 | const String secondScreenBodyText = "There are many variations of passages of Lorem Ipsum available";
7 | const String thirdScreenBodyText = "Conversations about science, tech, history, philosophu, and nature intelligence";
8 |
9 |
10 | const String next = "Next";
11 | const String skip = "Skip";
12 |
--------------------------------------------------------------------------------
/lib/presentation/pages/introduction/introduction_page.dart:
--------------------------------------------------------------------------------
1 | import 'package:auto_route/auto_route.dart';
2 | import 'package:flutter/material.dart';
3 | import 'package:introduction_screen/introduction_screen.dart';
4 | import 'package:podcast_ui_application/presentation/pages/introduction/constants/button_styles.dart';
5 | import 'package:podcast_ui_application/presentation/pages/introduction/constants/colors.dart';
6 | import 'package:podcast_ui_application/presentation/pages/introduction/constants/intro_key.dart';
7 | import 'package:podcast_ui_application/presentation/pages/introduction/constants/texts.dart';
8 | import 'package:podcast_ui_application/presentation/pages/introduction/widgets/introduction_screen_custom_button.dart';
9 | import 'package:podcast_ui_application/presentation/pages/introduction/widgets/introduction_screens.dart';
10 | import 'package:podcast_ui_application/presentation/routes/router.gr.dart';
11 |
12 | class IntroductionPage extends StatelessWidget {
13 | const IntroductionPage({Key? key}) : super(key: key);
14 |
15 | final emptySpace = const SizedBox(height: 60);
16 |
17 | @override
18 | Widget build(BuildContext context) {
19 | return IntroductionScreen(
20 | key: introKey,
21 | globalBackgroundColor: globalBackgroundColor,
22 | initialPage: 0,
23 | pages: introductionScreens,
24 | onDone: () => AutoRouter.of(context).replace(const LoginRoute()),
25 | showBackButton: false,
26 | showSkipButton: true,
27 | skipOrBackFlex: 1,
28 | skipStyle: introductionScreensButtonStyle,
29 | nextStyle: introductionScreensButtonStyle,
30 | doneStyle: introductionScreensButtonStyle,
31 | controlsPadding: const EdgeInsets.only(top: 10, left: 12, right: 12),
32 | curve: Curves.fastLinearToSlowEaseIn,
33 | controlsMargin: const EdgeInsets.only(bottom: 50),
34 | skip: const IntroductionScreenCustomButton(buttonText: skip),
35 | next: const IntroductionScreenCustomButton(buttonText: next),
36 | done: const IntroductionScreenCustomButton(buttonText: next),
37 | dotsDecorator: const DotsDecorator(
38 | color: dotsInactiveColor,
39 | activeColor: whiteColor,
40 | activeShape: RoundedRectangleBorder(
41 | borderRadius: BorderRadius.all(Radius.circular(25.0)),
42 | ),
43 | ),
44 | );
45 | }
46 | }
47 |
--------------------------------------------------------------------------------
/lib/presentation/pages/introduction/widgets/build_image.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 |
3 | Widget buildImage(String assetName, [double width = 350]) {
4 | return Image.asset('assets/$assetName', width: width);
5 | }
6 |
--------------------------------------------------------------------------------
/lib/presentation/pages/introduction/widgets/introduction_screen_custom_button.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 | import 'package:podcast_ui_application/presentation/pages/introduction/constants/colors.dart';
3 | import 'package:podcast_ui_application/presentation/pages/introduction/widgets/introduction_screen_custom_text.dart';
4 |
5 | class IntroductionScreenCustomButton extends StatelessWidget {
6 | const IntroductionScreenCustomButton({Key? key, required this.buttonText}) : super(key: key);
7 | final String buttonText;
8 | @override
9 | Widget build(BuildContext context) {
10 | return Column(
11 | children: [
12 | const SizedBox(height: 60),
13 | Container(
14 | padding: const EdgeInsets.symmetric(vertical: 15, horizontal: 30),
15 | decoration: const BoxDecoration(color: introductionScreenButtonsColor, borderRadius: BorderRadius.all(Radius.circular(25))),
16 | child: IntroductionScreenCustomText(
17 | text: buttonText,
18 | minFontSize: 17,
19 | maxFontSize: 21,
20 | textStyle: const TextStyle(
21 | fontWeight: FontWeight.w600,
22 | color: whiteColor,
23 | ),
24 | ),
25 | ),
26 | ],
27 | );
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/lib/presentation/pages/introduction/widgets/introduction_screen_custom_text.dart:
--------------------------------------------------------------------------------
1 | import 'package:auto_size_text/auto_size_text.dart';
2 | import 'package:flutter/material.dart';
3 |
4 | class IntroductionScreenCustomText extends StatelessWidget {
5 | const IntroductionScreenCustomText({Key? key, required this.text, required this.minFontSize, required this.maxFontSize, required this.textStyle}) : super(key: key);
6 | final String text;
7 | final double minFontSize;
8 | final double maxFontSize;
9 | final TextStyle textStyle;
10 |
11 | @override
12 | Widget build(BuildContext context) {
13 | return AutoSizeText(
14 | text,
15 | minFontSize: minFontSize,
16 | maxFontSize: maxFontSize,
17 | textAlign: TextAlign.left,
18 | style: textStyle,
19 | );
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/lib/presentation/pages/introduction/widgets/introduction_screens.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 | import 'package:introduction_screen/introduction_screen.dart';
3 | import 'package:podcast_ui_application/presentation/pages/introduction/constants/colors.dart';
4 | import 'package:podcast_ui_application/presentation/pages/introduction/constants/page_decoration.dart';
5 | import 'package:podcast_ui_application/presentation/pages/introduction/constants/texts.dart';
6 | import 'package:podcast_ui_application/presentation/pages/introduction/widgets/build_image.dart';
7 | import 'package:podcast_ui_application/presentation/pages/introduction/widgets/introduction_screen_custom_text.dart';
8 |
9 | PageViewModel pageViewModel({required String titleText, required String bodyText}) {
10 | return PageViewModel(
11 | titleWidget: IntroductionScreenCustomText(
12 | text: titleText,
13 | minFontSize: 40,
14 | maxFontSize: 45,
15 | textStyle: const TextStyle(fontWeight: FontWeight.w600, color: whiteColor),
16 | ),
17 | bodyWidget: IntroductionScreenCustomText(
18 | text: bodyText,
19 | minFontSize: 17,
20 | maxFontSize: 21,
21 | textStyle: const TextStyle(color: introductionScreenBodyTextColor),
22 | ),
23 | reverse: true,
24 | image: buildImage('test_img.jpg'),
25 | decoration: pageDecoration);
26 | }
27 |
28 | List introductionScreens = [
29 | pageViewModel(titleText: firstScreenTitle, bodyText: firstScreenBodyText),
30 | pageViewModel(titleText: secondScreenTitle, bodyText: secondScreenBodyText),
31 | pageViewModel(titleText: thirdScreenTitle, bodyText: thirdScreenBodyText),
32 | ];
33 |
--------------------------------------------------------------------------------
/lib/presentation/pages/login/constants/colors.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 |
3 | const Color fillColor = Color.fromRGBO(50, 49, 54, 1);
4 | const Color inputHintTextColor = Color.fromRGBO(89, 89, 94, 1);
5 | const Color pageBackgroundColor = Color.fromRGBO(27, 26, 31, 1);
6 | const Color loginPageButtonColor = Color.fromRGBO(20, 220, 148, 1);
7 |
8 | const Color whiteColor = Colors.white;
9 | const Color transparentColor = Colors.transparent;
10 |
--------------------------------------------------------------------------------
/lib/presentation/pages/login/constants/texts.dart:
--------------------------------------------------------------------------------
1 | const String loginText = "Login";
2 | const String emailText = "Email";
3 | const String passwordText = "Password";
4 | const String dontHaveTheAccountText = "Don't have the\naccount?";
5 | const String yourEmailText = "Your Email";
6 | const String minEighthCharacterText = "min 8 characters";
7 |
--------------------------------------------------------------------------------
/lib/presentation/pages/login/login_page.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 | import 'package:flutter_bloc/flutter_bloc.dart';
3 | import 'package:podcast_ui_application/application/login/cubit/login_cubit.dart';
4 | import 'package:podcast_ui_application/presentation/pages/login/constants/colors.dart';
5 | import 'package:podcast_ui_application/presentation/pages/login/widgets/app_bar.dart';
6 | import 'package:podcast_ui_application/presentation/pages/login/widgets/login_page_body.dart';
7 |
8 | class LoginPage extends StatelessWidget {
9 | const LoginPage({Key? key}) : super(key: key);
10 |
11 | @override
12 | Widget build(BuildContext context) {
13 | return BlocProvider(
14 | create: (context) => LoginCubit(),
15 | child: BlocBuilder(
16 | builder: (context, state) => SafeArea(
17 | child: Scaffold(
18 | resizeToAvoidBottomInset: false,
19 | backgroundColor: pageBackgroundColor,
20 | appBar: AppBarWidget(appBarActions: const []),
21 | body: LoginPageBody(
22 | state: state,
23 | ),
24 | ),
25 | ),
26 | ),
27 | );
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/lib/presentation/pages/login/widgets/app_bar.dart:
--------------------------------------------------------------------------------
1 | import 'package:auto_route/auto_route.dart';
2 | import 'package:flutter/material.dart';
3 | import 'package:podcast_ui_application/presentation/pages/login/constants/colors.dart';
4 | import 'package:podcast_ui_application/presentation/routes/router.gr.dart';
5 |
6 | class AppBarWidget extends StatelessWidget with PreferredSizeWidget {
7 | AppBarWidget({Key? key, required this.appBarActions})
8 | : preferredSize = const Size.fromHeight(56.0),
9 | super(key: key);
10 |
11 | @override
12 | final Size preferredSize;
13 | final List appBarActions;
14 |
15 | @override
16 | Widget build(BuildContext context) {
17 | return AppBar(
18 | backgroundColor: pageBackgroundColor,
19 | elevation: 0,
20 | leading: IconButton(
21 | padding: const EdgeInsets.only(left: 20),
22 | icon: const Icon(Icons.arrow_back),
23 | onPressed: () => AutoRouter.of(context).replace(const IntroductionRoute()),
24 | ),
25 | automaticallyImplyLeading: true,
26 | actions: appBarActions);
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/lib/presentation/pages/login/widgets/auth_text_field.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 | import 'package:podcast_ui_application/presentation/pages/login/constants/colors.dart';
3 |
4 | class AuthTextField extends StatelessWidget {
5 | final String hint;
6 | final ValueChanged onChanged;
7 | final TextInputType keyboardType;
8 | final bool isPasswordField;
9 | final bool isRequiredField;
10 | final String? error;
11 | final EdgeInsets padding;
12 | final double borderRadiusCircularValue;
13 |
14 | const AuthTextField({
15 | Key? key,
16 | this.hint = '',
17 | required this.onChanged,
18 | required this.keyboardType,
19 | this.isPasswordField = false,
20 | this.isRequiredField = false,
21 | this.error,
22 | this.padding = const EdgeInsets.all(15),
23 | this.borderRadiusCircularValue = 20,
24 | }) : super(key: key);
25 |
26 | @override
27 | Widget build(BuildContext context) {
28 | return Padding(
29 | padding: padding,
30 | child: TextField(
31 | style: const TextStyle(color: whiteColor),
32 | keyboardType: keyboardType,
33 | decoration: InputDecoration(
34 | fillColor: fillColor,
35 | contentPadding: const EdgeInsets.symmetric(horizontal: 12, vertical: 12),
36 | filled: true,
37 | hintText: isRequiredField ? '$hint*' : hint,
38 | hintStyle: const TextStyle(color: inputHintTextColor),
39 | border: OutlineInputBorder(
40 | borderRadius: BorderRadius.circular(borderRadiusCircularValue),
41 | borderSide: const BorderSide(width: 0, style: BorderStyle.none),
42 | ),
43 | errorText: error,
44 | floatingLabelBehavior: FloatingLabelBehavior.never,
45 | ),
46 | autocorrect: false,
47 | textInputAction: TextInputAction.done,
48 | obscureText: isPasswordField,
49 | maxLines: 1,
50 | onChanged: onChanged,
51 | ),
52 | );
53 | }
54 | }
55 |
--------------------------------------------------------------------------------
/lib/presentation/pages/login/widgets/custom_text.dart:
--------------------------------------------------------------------------------
1 | import 'package:auto_size_text/auto_size_text.dart';
2 | import 'package:flutter/material.dart';
3 |
4 | class LoginPageCustomText extends StatelessWidget {
5 | const LoginPageCustomText({
6 | Key? key,
7 | required this.padding,
8 | required this.text,
9 | required this.textStyle,
10 | required this.minFontSize,
11 | required this.maxFontSize,
12 | }) : super(key: key);
13 |
14 | final EdgeInsetsGeometry padding;
15 | final String text;
16 | final TextStyle textStyle;
17 | final double minFontSize;
18 | final double maxFontSize;
19 |
20 | @override
21 | Widget build(BuildContext context) {
22 | return Padding(
23 | padding: padding,
24 | child: AutoSizeText(text, minFontSize: minFontSize, maxFontSize: maxFontSize, style: textStyle),
25 | );
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/lib/presentation/pages/login/widgets/input_fields.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 | import 'package:flutter_bloc/flutter_bloc.dart';
3 | // ignore_for_file: unused_import
4 | import 'package:podcast_ui_application/domain/auth_models/email.dart';
5 | import 'package:podcast_ui_application/domain/auth_models/password.dart';
6 | import 'package:podcast_ui_application/application/login/cubit/login_cubit.dart';
7 | import 'package:podcast_ui_application/presentation/pages/login/constants/texts.dart';
8 | import 'package:podcast_ui_application/presentation/pages/login/widgets/auth_text_field.dart';
9 |
10 | class EmailInputField extends StatelessWidget {
11 | const EmailInputField({Key? key, required this.state}) : super(key: key);
12 | final LoginState state;
13 | @override
14 | Widget build(BuildContext context) {
15 | return AuthTextField(
16 | padding: const EdgeInsets.only(left: 25, right: 25),
17 | hint: yourEmailText,
18 | keyboardType: TextInputType.emailAddress,
19 | error: state.email.error?.name,
20 | onChanged: (email) => context.read().emailChanged(email),
21 | );
22 | }
23 | }
24 |
25 | class PasswordInputField extends StatelessWidget {
26 | const PasswordInputField({Key? key, required this.state}) : super(key: key);
27 | final LoginState state;
28 | @override
29 | Widget build(BuildContext context) {
30 | return AuthTextField(
31 | padding: const EdgeInsets.only(left: 20, right: 20, top: 6),
32 | hint: minEighthCharacterText,
33 | isPasswordField: true,
34 | keyboardType: TextInputType.text,
35 | error: state.password.error?.name,
36 | onChanged: (password) => context.read().passwordChanged(password),
37 | );
38 | }
39 | }
40 |
--------------------------------------------------------------------------------
/lib/presentation/pages/login/widgets/login_button.dart:
--------------------------------------------------------------------------------
1 | import 'package:auto_route/auto_route.dart';
2 | import 'package:flutter/material.dart';
3 | import 'package:podcast_ui_application/application/login/cubit/login_cubit.dart';
4 | import 'package:podcast_ui_application/presentation/pages/login/constants/colors.dart';
5 | import 'package:podcast_ui_application/presentation/pages/login/constants/texts.dart';
6 | import 'package:podcast_ui_application/presentation/pages/login/widgets/custom_text.dart';
7 | import 'package:podcast_ui_application/presentation/routes/router.gr.dart';
8 |
9 | class LoginButton extends StatelessWidget {
10 | const LoginButton({Key? key, required this.state}) : super(key: key);
11 | final LoginState state;
12 | @override
13 | Widget build(BuildContext context) {
14 | return InkWell(
15 | onTap: () {
16 | if (state.status.name == "valid") {
17 | AutoRouter.of(context).replace(const HomeRoute());
18 | } else {}
19 | },
20 | child: Container(
21 | padding: const EdgeInsets.symmetric(vertical: 15, horizontal: 30),
22 | decoration: const BoxDecoration(color: loginPageButtonColor, borderRadius: BorderRadius.all(Radius.circular(25))),
23 | child: const LoginPageCustomText(
24 | padding: EdgeInsets.only(), text: loginText, textStyle: TextStyle(fontWeight: FontWeight.w600, color: whiteColor), minFontSize: 17, maxFontSize: 21)),
25 | );
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/lib/presentation/pages/login/widgets/login_page_body.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 | import 'package:podcast_ui_application/application/login/cubit/login_cubit.dart';
3 | import 'package:podcast_ui_application/presentation/pages/login/constants/colors.dart';
4 | import 'package:podcast_ui_application/presentation/pages/login/constants/texts.dart';
5 | import 'package:podcast_ui_application/presentation/pages/login/widgets/custom_text.dart';
6 | import 'package:podcast_ui_application/presentation/pages/login/widgets/input_fields.dart';
7 | import 'package:podcast_ui_application/presentation/pages/login/widgets/login_button.dart';
8 | import 'package:podcast_ui_application/presentation/pages/login/widgets/sign_up_text.dart';
9 |
10 | class LoginPageBody extends StatelessWidget {
11 | const LoginPageBody({Key? key, required this.state}) : super(key: key);
12 | final LoginState state;
13 | @override
14 | Widget build(BuildContext context) {
15 | return Column(
16 | crossAxisAlignment: CrossAxisAlignment.start,
17 | mainAxisAlignment: MainAxisAlignment.start,
18 | children: [
19 | Column(
20 | crossAxisAlignment: CrossAxisAlignment.start,
21 | mainAxisAlignment: MainAxisAlignment.start,
22 | children: [
23 | const LoginPageCustomText(
24 | padding: EdgeInsets.only(top: 20.0, left: 25),
25 | text: loginText,
26 | textStyle: TextStyle(fontWeight: FontWeight.bold, color: whiteColor),
27 | maxFontSize: 33,
28 | minFontSize: 30,
29 | ),
30 | const LoginPageCustomText(
31 | padding: EdgeInsets.only(bottom: 8, top: 30.0, left: 25),
32 | text: emailText,
33 | textStyle: TextStyle(fontWeight: FontWeight.w400, color: whiteColor),
34 | maxFontSize: 20,
35 | minFontSize: 18,
36 | ),
37 | EmailInputField(state: state),
38 | const LoginPageCustomText(
39 | padding: EdgeInsets.only(top: 8, left: 25),
40 | text: passwordText,
41 | textStyle: TextStyle(fontWeight: FontWeight.w400, color: whiteColor),
42 | maxFontSize: 20,
43 | minFontSize: 18,
44 | ),
45 | PasswordInputField(state: state),
46 | ],
47 | ),
48 | const Expanded(child: SizedBox.shrink()),
49 | Padding(
50 | padding: const EdgeInsets.only(bottom: 50),
51 | child: Row(
52 | mainAxisAlignment: MainAxisAlignment.spaceBetween,
53 | children: [const SignUpText(), Padding(padding: const EdgeInsets.only(right: 25), child: LoginButton(state: state))],
54 | ),
55 | ),
56 | ],
57 | );
58 | }
59 | }
60 |
--------------------------------------------------------------------------------
/lib/presentation/pages/login/widgets/sign_up_text.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 | import 'package:podcast_ui_application/presentation/pages/login/constants/colors.dart';
3 | import 'package:podcast_ui_application/presentation/pages/login/constants/texts.dart';
4 | import 'package:podcast_ui_application/presentation/pages/login/widgets/custom_text.dart';
5 |
6 | class SignUpText extends StatelessWidget {
7 | const SignUpText({Key? key}) : super(key: key);
8 |
9 | @override
10 | Widget build(BuildContext context) {
11 | return InkWell(
12 | onTap: () {},
13 | child: const LoginPageCustomText(
14 | padding: EdgeInsets.only(left: 25),
15 | text: dontHaveTheAccountText,
16 | textStyle: TextStyle(color: loginPageButtonColor, fontSize: 16.5, fontWeight: FontWeight.w400),
17 | minFontSize: 16,
18 | maxFontSize: 18,
19 | ),
20 | );
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/lib/presentation/pages/player/constants/colors.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 |
3 | const Color pageBackgroundColor = Color.fromRGBO(27, 26, 31, 1);
4 | const Color podcastOwnersNameColor = Color.fromRGBO(42, 161, 118, 1);
5 | const Color constantPodcastDetailsColor = Color.fromRGBO(89, 89, 94, 1);
6 | const Color buttonColor = Color.fromRGBO(20, 220, 148, 1);
7 | const Color audioProgressBarBackgroundColor = Color.fromRGBO(12, 77, 53, 1);
8 | const Color audioProgressBarForegroundColor = Color.fromRGBO(20, 220, 148, 1);
9 |
10 | const Color transparentColor = Colors.transparent;
11 | const Color whiteColor = Colors.white;
12 |
--------------------------------------------------------------------------------
/lib/presentation/pages/player/constants/texts.dart:
--------------------------------------------------------------------------------
1 | const String podcast = "'Podcast";
2 |
3 | const String elapsedTime = "40:52";
4 | const String remainingTime = "1:00:52";
5 | const String ryusAirpods = "Ryu's Airpods";
6 |
--------------------------------------------------------------------------------
/lib/presentation/pages/player/player_page.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/cupertino.dart';
2 | import 'package:flutter/material.dart';
3 | import 'package:podcast_ui_application/presentation/pages/episode_details/widgets/custom_icon_button.dart';
4 | import 'package:podcast_ui_application/presentation/pages/player/constants/colors.dart';
5 | import 'package:podcast_ui_application/presentation/pages/player/constants/texts.dart';
6 | import 'package:podcast_ui_application/presentation/pages/player/widgets/app_bar.dart';
7 | import 'package:podcast_ui_application/presentation/pages/player/widgets/player_page_body.dart';
8 |
9 | class PlayerPage extends StatelessWidget {
10 | const PlayerPage({
11 | Key? key,
12 | required this.podcastImageUrl,
13 | required this.podcastName,
14 | required this.podcastOwner,
15 | }) : super(key: key);
16 |
17 | final String podcastImageUrl;
18 | final String podcastName;
19 | final String podcastOwner;
20 |
21 | @override
22 | Widget build(BuildContext context) {
23 | return Scaffold(
24 | backgroundColor: pageBackgroundColor,
25 | appBar: AppBarWidget(
26 | appBarLeadingIcon: Icons.keyboard_arrow_down_outlined,
27 | appBarActions: [
28 | CustomIconButton(buttonPadding: const EdgeInsets.only(right: 20), icon: CupertinoIcons.ellipsis_vertical, iconSize: 25, onPressed: () {}),
29 | ],
30 | ),
31 | body: PlayerPageBody(
32 | podcastImageUrl: podcastImageUrl,
33 | podcastName: podcastName,
34 | podcastOwnersName: "$podcastOwner $podcast",
35 | ),
36 | );
37 | }
38 | }
39 |
--------------------------------------------------------------------------------
/lib/presentation/pages/player/widgets/app_bar.dart:
--------------------------------------------------------------------------------
1 | import 'package:auto_route/auto_route.dart';
2 | import 'package:flutter/material.dart';
3 | import 'package:podcast_ui_application/presentation/pages/episode_details/widgets/custom_icon_button.dart';
4 | import 'package:podcast_ui_application/presentation/pages/player/constants/colors.dart';
5 |
6 | class AppBarWidget extends StatelessWidget with PreferredSizeWidget {
7 | AppBarWidget({Key? key, required this.appBarActions, this.appBarLeadingIcon = Icons.arrow_back})
8 | : preferredSize = const Size.fromHeight(56.0),
9 | super(key: key);
10 |
11 | @override
12 | final Size preferredSize;
13 | final List appBarActions;
14 | final IconData appBarLeadingIcon;
15 | @override
16 | Widget build(BuildContext context) {
17 | return AppBar(
18 | backgroundColor: pageBackgroundColor,
19 | elevation: 0,
20 | leading: CustomIconButton(
21 | onPressed: () => AutoRouter.of(context).pop(),
22 | buttonPadding: const EdgeInsets.only(left: 20),
23 | icon: appBarLeadingIcon,
24 | iconSize: 30,
25 | ),
26 | automaticallyImplyLeading: true,
27 | actions: appBarActions);
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/lib/presentation/pages/player/widgets/audio_action_buttons.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/cupertino.dart';
2 | import 'package:flutter/material.dart';
3 | import 'package:podcast_ui_application/presentation/pages/player/constants/colors.dart';
4 | import 'package:podcast_ui_application/presentation/pages/player/widgets/audio_icon_button.dart';
5 |
6 | class AudioActionButtons extends StatelessWidget {
7 | const AudioActionButtons({Key? key}) : super(key: key);
8 |
9 | @override
10 | Widget build(BuildContext context) {
11 | return Padding(
12 | padding: const EdgeInsets.only(top: 30),
13 | child: Row(
14 | mainAxisAlignment: MainAxisAlignment.spaceEvenly,
15 | children: [
16 | const AudioIconButton(iconData: CupertinoIcons.arrow_counterclockwise, iconSize: 30, iconColor: whiteColor,),
17 | InkWell(
18 | onTap: () {},
19 | child: Stack(
20 | alignment: AlignmentDirectional.center,
21 | children: const [
22 | CircleAvatar(backgroundColor: audioProgressBarForegroundColor, radius: 40),
23 | Icon(Icons.play_arrow, size: 40,color: whiteColor,),
24 | ],
25 | ),
26 | ),
27 | const AudioIconButton(iconData: CupertinoIcons.arrow_clockwise,iconSize: 30, iconColor: whiteColor)
28 | ],
29 | ),
30 | );
31 | }
32 | }
33 |
--------------------------------------------------------------------------------
/lib/presentation/pages/player/widgets/audio_icon_button.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 |
3 | class AudioIconButton extends StatelessWidget {
4 | const AudioIconButton({Key? key, this.iconData, required this.iconSize, required this.iconColor}) : super(key: key);
5 | final IconData? iconData;
6 | final double iconSize;
7 | final Color iconColor;
8 |
9 | @override
10 | Widget build(BuildContext context) {
11 | return IconButton(
12 | onPressed: () {},
13 | icon: Icon(
14 | iconData,
15 | size: iconSize,
16 | color: iconColor,
17 | ),
18 | );
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/lib/presentation/pages/player/widgets/audio_progress_bar.dart:
--------------------------------------------------------------------------------
1 | import 'package:auto_size_text/auto_size_text.dart';
2 | import 'package:flutter/material.dart';
3 | import 'package:percent_indicator/percent_indicator.dart';
4 | import 'package:podcast_ui_application/presentation/pages/player/constants/colors.dart';
5 | import 'package:podcast_ui_application/presentation/pages/player/constants/texts.dart';
6 |
7 | class AudioPercentageBar extends StatelessWidget {
8 | const AudioPercentageBar({Key? key}) : super(key: key);
9 |
10 | @override
11 | Widget build(BuildContext context) {
12 | return Stack(
13 | alignment: AlignmentDirectional.center,
14 | children: [
15 | LinearPercentIndicator(
16 | padding: const EdgeInsets.symmetric(horizontal: 25),
17 | width: MediaQuery.of(context).size.width,
18 | lineHeight: 30,
19 | percent: 0.6,
20 | backgroundColor: audioProgressBarBackgroundColor,
21 | progressColor: audioProgressBarForegroundColor,
22 | barRadius: const Radius.circular(25),
23 | ),
24 | Row(
25 | mainAxisAlignment: MainAxisAlignment.spaceBetween,
26 | children: [
27 | const Padding(padding: EdgeInsets.only(left: 35), child: AutoSizeText(elapsedTime, minFontSize: 10, maxFontSize: 13, style: TextStyle(color: whiteColor))),
28 | Stack(
29 | alignment: AlignmentDirectional.center,
30 | children: const [
31 | Padding(padding: EdgeInsets.only(left: 60), child: CircleAvatar(backgroundColor: whiteColor, radius: 15)),
32 | Padding(padding: EdgeInsets.only(left: 60), child: CircleAvatar(backgroundColor: audioProgressBarForegroundColor, radius: 7)),
33 | ],
34 | ),
35 | const Padding(padding: EdgeInsets.only(right: 35), child: AutoSizeText(remainingTime, minFontSize: 10, maxFontSize: 13, style: TextStyle(color: whiteColor)))
36 | ],
37 | )
38 | ],
39 | );
40 | }
41 | }
42 |
--------------------------------------------------------------------------------
/lib/presentation/pages/player/widgets/player_informations.dart:
--------------------------------------------------------------------------------
1 | import 'package:auto_size_text/auto_size_text.dart';
2 | import 'package:flutter/cupertino.dart';
3 | import 'package:flutter/material.dart';
4 | import 'package:podcast_ui_application/presentation/pages/player/constants/colors.dart';
5 | import 'package:podcast_ui_application/presentation/pages/player/constants/texts.dart';
6 | import 'package:podcast_ui_application/presentation/pages/player/widgets/audio_icon_button.dart';
7 |
8 | class PlayerInformations extends StatelessWidget {
9 | const PlayerInformations({Key? key}) : super(key: key);
10 |
11 | @override
12 | Widget build(BuildContext context) {
13 | return Expanded(
14 | child: Padding(
15 | padding: const EdgeInsets.only(left: 25, right: 25, top: 25),
16 | child: Row(
17 | mainAxisAlignment: MainAxisAlignment.spaceBetween,
18 | children: [
19 | Row(
20 | children: const [
21 | Icon(CupertinoIcons.headphones, color: podcastOwnersNameColor, size: 20),
22 | Padding(
23 | padding: EdgeInsets.only(left: 10),
24 | child: AutoSizeText(ryusAirpods, minFontSize: 15, maxFontSize: 17, style: TextStyle(color: podcastOwnersNameColor)),
25 | ),
26 | AudioIconButton(iconData: Icons.keyboard_arrow_down, iconSize: 15, iconColor: podcastOwnersNameColor),
27 | ],
28 | ),
29 | const AudioIconButton(iconData: Icons.computer, iconSize: 30, iconColor: whiteColor)
30 | ],
31 | ),
32 | ),
33 | );
34 | }
35 | }
36 |
--------------------------------------------------------------------------------
/lib/presentation/pages/player/widgets/player_page_body.dart:
--------------------------------------------------------------------------------
1 | import 'package:cached_network_image/cached_network_image.dart';
2 | import 'package:flutter/material.dart';
3 | import 'package:podcast_ui_application/presentation/pages/episode_details/widgets/podcast_text.dart';
4 | import 'package:podcast_ui_application/presentation/pages/player/constants/colors.dart';
5 | import 'package:podcast_ui_application/presentation/pages/player/widgets/audio_action_buttons.dart';
6 | import 'package:podcast_ui_application/presentation/pages/player/widgets/audio_progress_bar.dart';
7 | import 'package:podcast_ui_application/presentation/pages/player/widgets/player_informations.dart';
8 |
9 | class PlayerPageBody extends StatelessWidget {
10 | const PlayerPageBody({
11 | Key? key,
12 | required this.podcastImageUrl,
13 | required this.podcastName,
14 | required this.podcastOwnersName,
15 | }) : super(key: key);
16 |
17 | final String podcastImageUrl;
18 | final String podcastName;
19 | final String podcastOwnersName;
20 |
21 | @override
22 | Widget build(BuildContext context) {
23 | return Column(
24 | mainAxisAlignment: MainAxisAlignment.start,
25 | crossAxisAlignment: CrossAxisAlignment.start,
26 | children: [
27 | PodcastText(textColor: podcastOwnersNameColor, minFontSize: 17, maxFontSize: 19, text: podcastOwnersName, fontWeight: FontWeight.w500),
28 | PodcastText(textColor: whiteColor, minFontSize: 25, maxFontSize: 30, text: podcastName, fontWeight: FontWeight.w600),
29 | Padding(
30 | padding: const EdgeInsets.only(left: 25, right: 25, top: 10, bottom: 25),
31 | child: CachedNetworkImage(
32 | placeholder: (context, url) => const CircularProgressIndicator(),
33 | imageUrl: podcastImageUrl,
34 | imageBuilder: (context, imageProvider) => Container(
35 | height: 330,
36 | width: MediaQuery.of(context).size.width,
37 | decoration: BoxDecoration(
38 | borderRadius: const BorderRadius.all(Radius.circular(10)),
39 | image: DecorationImage(
40 | fit: BoxFit.fill,
41 | image: imageProvider,
42 | )),
43 | ),
44 | ),
45 | ),
46 | const AudioPercentageBar(),
47 | const AudioActionButtons(),
48 | const PlayerInformations()
49 | ],
50 | );
51 | }
52 | }
53 |
--------------------------------------------------------------------------------
/lib/presentation/routes/router.dart:
--------------------------------------------------------------------------------
1 | import 'package:auto_route/auto_route.dart';
2 | import 'package:podcast_ui_application/presentation/pages/episode_details/episode_details_page.dart';
3 | import 'package:podcast_ui_application/presentation/pages/home/home_page.dart';
4 | import 'package:podcast_ui_application/presentation/pages/introduction/introduction_page.dart';
5 | import 'package:podcast_ui_application/presentation/pages/login/login_page.dart';
6 | import 'package:podcast_ui_application/presentation/pages/player/player_page.dart';
7 |
8 | @MaterialAutoRouter(
9 | replaceInRouteName: 'Page,Route',
10 | routes: [
11 | AutoRoute(page: IntroductionPage, initial: true),
12 | AutoRoute(page: LoginPage),
13 | AutoRoute(page: HomePage),
14 | AutoRoute(page: EpisodeDetailsPage),
15 | AutoRoute(page: PlayerPage),
16 | ],
17 | )
18 | class $AppRouter {}
19 |
--------------------------------------------------------------------------------
/lib/presentation/routes/router.gr.dart:
--------------------------------------------------------------------------------
1 | // **************************************************************************
2 | // AutoRouteGenerator
3 | // **************************************************************************
4 |
5 | // GENERATED CODE - DO NOT MODIFY BY HAND
6 |
7 | // **************************************************************************
8 | // AutoRouteGenerator
9 | // **************************************************************************
10 | //
11 | // ignore_for_file: type=lint
12 |
13 | import 'package:auto_route/auto_route.dart' as _i6;
14 | import 'package:flutter/material.dart' as _i7;
15 |
16 | import '../pages/episode_details/episode_details_page.dart' as _i4;
17 | import '../pages/home/home_page.dart' as _i3;
18 | import '../pages/introduction/introduction_page.dart' as _i1;
19 | import '../pages/login/login_page.dart' as _i2;
20 | import '../pages/player/player_page.dart' as _i5;
21 |
22 | class AppRouter extends _i6.RootStackRouter {
23 | AppRouter([_i7.GlobalKey<_i7.NavigatorState>? navigatorKey])
24 | : super(navigatorKey);
25 |
26 | @override
27 | final Map pagesMap = {
28 | IntroductionRoute.name: (routeData) {
29 | return _i6.MaterialPageX(
30 | routeData: routeData, child: const _i1.IntroductionPage());
31 | },
32 | LoginRoute.name: (routeData) {
33 | return _i6.MaterialPageX(
34 | routeData: routeData, child: const _i2.LoginPage());
35 | },
36 | HomeRoute.name: (routeData) {
37 | return _i6.MaterialPageX(
38 | routeData: routeData, child: const _i3.HomePage());
39 | },
40 | EpisodeDetailsRoute.name: (routeData) {
41 | final args = routeData.argsAs();
42 | return _i6.MaterialPageX(
43 | routeData: routeData,
44 | child: _i4.EpisodeDetailsPage(
45 | key: args.key,
46 | podcastImageUrl: args.podcastImageUrl,
47 | podcastName: args.podcastName,
48 | podcastOwner: args.podcastOwner,
49 | podcastEpisodes: args.podcastEpisodes));
50 | },
51 | PlayerRoute.name: (routeData) {
52 | final args = routeData.argsAs();
53 | return _i6.MaterialPageX(
54 | routeData: routeData,
55 | child: _i5.PlayerPage(
56 | key: args.key,
57 | podcastImageUrl: args.podcastImageUrl,
58 | podcastName: args.podcastName,
59 | podcastOwner: args.podcastOwner));
60 | }
61 | };
62 |
63 | @override
64 | List<_i6.RouteConfig> get routes => [
65 | _i6.RouteConfig(IntroductionRoute.name, path: '/'),
66 | _i6.RouteConfig(LoginRoute.name, path: '/login-page'),
67 | _i6.RouteConfig(HomeRoute.name, path: '/home-page'),
68 | _i6.RouteConfig(EpisodeDetailsRoute.name,
69 | path: '/episode-details-page'),
70 | _i6.RouteConfig(PlayerRoute.name, path: '/player-page')
71 | ];
72 | }
73 |
74 | /// generated route for
75 | /// [_i1.IntroductionPage]
76 | class IntroductionRoute extends _i6.PageRouteInfo {
77 | const IntroductionRoute() : super(IntroductionRoute.name, path: '/');
78 |
79 | static const String name = 'IntroductionRoute';
80 | }
81 |
82 | /// generated route for
83 | /// [_i2.LoginPage]
84 | class LoginRoute extends _i6.PageRouteInfo {
85 | const LoginRoute() : super(LoginRoute.name, path: '/login-page');
86 |
87 | static const String name = 'LoginRoute';
88 | }
89 |
90 | /// generated route for
91 | /// [_i3.HomePage]
92 | class HomeRoute extends _i6.PageRouteInfo {
93 | const HomeRoute() : super(HomeRoute.name, path: '/home-page');
94 |
95 | static const String name = 'HomeRoute';
96 | }
97 |
98 | /// generated route for
99 | /// [_i4.EpisodeDetailsPage]
100 | class EpisodeDetailsRoute extends _i6.PageRouteInfo {
101 | EpisodeDetailsRoute(
102 | {_i7.Key? key,
103 | required String podcastImageUrl,
104 | required String podcastName,
105 | required String podcastOwner,
106 | required List podcastEpisodes})
107 | : super(EpisodeDetailsRoute.name,
108 | path: '/episode-details-page',
109 | args: EpisodeDetailsRouteArgs(
110 | key: key,
111 | podcastImageUrl: podcastImageUrl,
112 | podcastName: podcastName,
113 | podcastOwner: podcastOwner,
114 | podcastEpisodes: podcastEpisodes));
115 |
116 | static const String name = 'EpisodeDetailsRoute';
117 | }
118 |
119 | class EpisodeDetailsRouteArgs {
120 | const EpisodeDetailsRouteArgs(
121 | {this.key,
122 | required this.podcastImageUrl,
123 | required this.podcastName,
124 | required this.podcastOwner,
125 | required this.podcastEpisodes});
126 |
127 | final _i7.Key? key;
128 |
129 | final String podcastImageUrl;
130 |
131 | final String podcastName;
132 |
133 | final String podcastOwner;
134 |
135 | final List podcastEpisodes;
136 |
137 | @override
138 | String toString() {
139 | return 'EpisodeDetailsRouteArgs{key: $key, podcastImageUrl: $podcastImageUrl, podcastName: $podcastName, podcastOwner: $podcastOwner, podcastEpisodes: $podcastEpisodes}';
140 | }
141 | }
142 |
143 | /// generated route for
144 | /// [_i5.PlayerPage]
145 | class PlayerRoute extends _i6.PageRouteInfo {
146 | PlayerRoute(
147 | {_i7.Key? key,
148 | required String podcastImageUrl,
149 | required String podcastName,
150 | required String podcastOwner})
151 | : super(PlayerRoute.name,
152 | path: '/player-page',
153 | args: PlayerRouteArgs(
154 | key: key,
155 | podcastImageUrl: podcastImageUrl,
156 | podcastName: podcastName,
157 | podcastOwner: podcastOwner));
158 |
159 | static const String name = 'PlayerRoute';
160 | }
161 |
162 | class PlayerRouteArgs {
163 | const PlayerRouteArgs(
164 | {this.key,
165 | required this.podcastImageUrl,
166 | required this.podcastName,
167 | required this.podcastOwner});
168 |
169 | final _i7.Key? key;
170 |
171 | final String podcastImageUrl;
172 |
173 | final String podcastName;
174 |
175 | final String podcastOwner;
176 |
177 | @override
178 | String toString() {
179 | return 'PlayerRouteArgs{key: $key, podcastImageUrl: $podcastImageUrl, podcastName: $podcastName, podcastOwner: $podcastOwner}';
180 | }
181 | }
182 |
--------------------------------------------------------------------------------
/pubspec.yaml:
--------------------------------------------------------------------------------
1 | name: podcast_ui_application
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 used as CFBundleVersion.
16 | # Read more about iOS versioning at
17 | # https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
18 | version: 1.0.0+1
19 |
20 | environment:
21 | sdk: ">=2.16.2 <3.0.0"
22 |
23 | # Dependencies specify other packages that your package needs in order to work.
24 | # To automatically upgrade your package dependencies to the latest versions
25 | # consider running `flutter pub upgrade --major-versions`. Alternatively,
26 | # dependencies can be manually updated by changing the version numbers below to
27 | # the latest version available on pub.dev. To see which dependencies have newer
28 | # versions available, run `flutter pub outdated`.
29 | dependencies:
30 | flutter:
31 | sdk: flutter
32 | introduction_screen: ^3.0.2
33 | auto_size_text: ^3.0.0
34 | auto_route: ^4.0.0
35 | formz: ^0.4.1
36 | flutter_bloc: ^8.0.1
37 | freezed_annotation: ^2.0.3
38 | dio: ^4.0.6
39 | cached_network_image: ^3.2.0
40 | percent_indicator: ^4.0.1
41 | progress_indicators: ^1.0.0
42 | # The following adds the Cupertino Icons font to your application.
43 | # Use with the CupertinoIcons class for iOS style icons.
44 | cupertino_icons: ^1.0.2
45 |
46 | dev_dependencies:
47 | flutter_test:
48 | sdk: flutter
49 | build_runner: ^2.1.10
50 | auto_route_generator: ^4.0.0
51 | freezed: ^2.0.3
52 |
53 | # The "flutter_lints" package below contains a set of recommended lints to
54 | # encourage good coding practices. The lint set provided by the package is
55 | # activated in the `analysis_options.yaml` file located at the root of your
56 | # package. See that file for information about deactivating specific lint
57 | # rules and activating additional ones.
58 | flutter_lints: ^1.0.0
59 |
60 | # For information on the generic Dart part of this file, see the
61 | # following page: https://dart.dev/tools/pub/pubspec
62 |
63 | # The following section is specific to Flutter.
64 | flutter:
65 |
66 | # The following line ensures that the Material Icons font is
67 | # included with your application, so that you can use the icons in
68 | # the material Icons class.
69 | uses-material-design: true
70 |
71 | # To add assets to your application, add an assets section, like this:
72 | assets:
73 | - assets/test_img.jpg
74 | # - images/a_dot_ham.jpeg
75 |
76 | # An image asset can refer to one or more resolution-specific "variants", see
77 | # https://flutter.dev/assets-and-images/#resolution-aware.
78 |
79 | # For details regarding adding assets from package dependencies, see
80 | # https://flutter.dev/assets-and-images/#from-packages
81 |
82 | # To add custom fonts to your application, add a fonts section here,
83 | # in this "flutter" section. Each entry in this list should have a
84 | # "family" key with the font family name, and a "fonts" key with a
85 | # list giving the asset and other descriptors for the font. For
86 | # example:
87 | # fonts:
88 | # - family: Schyler
89 | # fonts:
90 | # - asset: fonts/Schyler-Regular.ttf
91 | # - asset: fonts/Schyler-Italic.ttf
92 | # style: italic
93 | # - family: Trajan Pro
94 | # fonts:
95 | # - asset: fonts/TrajanPro.ttf
96 | # - asset: fonts/TrajanPro_Bold.ttf
97 | # weight: 700
98 | #
99 | # For details regarding fonts from package dependencies,
100 | # see https://flutter.dev/custom-fonts/#from-packages
101 |
--------------------------------------------------------------------------------
/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 that Flutter provides. 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:podcast_ui_application/presentation/core/app_widget.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 AppWidget());
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/FlutterWiz/podcast_app_case/ca9f99285d8a9ed7aa968f527dbaad2b5dd5b374/web/favicon.png
--------------------------------------------------------------------------------
/web/icons/Icon-192.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FlutterWiz/podcast_app_case/ca9f99285d8a9ed7aa968f527dbaad2b5dd5b374/web/icons/Icon-192.png
--------------------------------------------------------------------------------
/web/icons/Icon-512.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FlutterWiz/podcast_app_case/ca9f99285d8a9ed7aa968f527dbaad2b5dd5b374/web/icons/Icon-512.png
--------------------------------------------------------------------------------
/web/icons/Icon-maskable-192.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FlutterWiz/podcast_app_case/ca9f99285d8a9ed7aa968f527dbaad2b5dd5b374/web/icons/Icon-maskable-192.png
--------------------------------------------------------------------------------
/web/icons/Icon-maskable-512.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FlutterWiz/podcast_app_case/ca9f99285d8a9ed7aa968f527dbaad2b5dd5b374/web/icons/Icon-maskable-512.png
--------------------------------------------------------------------------------
/web/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 | podcast_app_case
33 |
34 |
35 |
36 |
39 |
103 |
104 |
105 |
--------------------------------------------------------------------------------
/web/manifest.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "podcast_app_case",
3 | "short_name": "podcast_app_case",
4 | "start_url": ".",
5 | "display": "standalone",
6 | "background_color": "#0175C2",
7 | "theme_color": "#0175C2",
8 | "description": "A new Flutter project.",
9 | "orientation": "portrait-primary",
10 | "prefer_related_applications": false,
11 | "icons": [
12 | {
13 | "src": "icons/Icon-192.png",
14 | "sizes": "192x192",
15 | "type": "image/png"
16 | },
17 | {
18 | "src": "icons/Icon-512.png",
19 | "sizes": "512x512",
20 | "type": "image/png"
21 | },
22 | {
23 | "src": "icons/Icon-maskable-192.png",
24 | "sizes": "192x192",
25 | "type": "image/png",
26 | "purpose": "maskable"
27 | },
28 | {
29 | "src": "icons/Icon-maskable-512.png",
30 | "sizes": "512x512",
31 | "type": "image/png",
32 | "purpose": "maskable"
33 | }
34 | ]
35 | }
36 |
--------------------------------------------------------------------------------
/windows/.gitignore:
--------------------------------------------------------------------------------
1 | flutter/ephemeral/
2 |
3 | # Visual Studio user-specific files.
4 | *.suo
5 | *.user
6 | *.userosscache
7 | *.sln.docstates
8 |
9 | # Visual Studio build-related files.
10 | x64/
11 | x86/
12 |
13 | # Visual Studio cache files
14 | # files ending in .cache can be ignored
15 | *.[Cc]ache
16 | # but keep track of directories ending in .cache
17 | !*.[Cc]ache/
18 |
--------------------------------------------------------------------------------
/windows/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | cmake_minimum_required(VERSION 3.14)
2 | project(podcast_app_case LANGUAGES CXX)
3 |
4 | set(BINARY_NAME "podcast_app_case")
5 |
6 | cmake_policy(SET CMP0063 NEW)
7 |
8 | set(CMAKE_INSTALL_RPATH "$ORIGIN/lib")
9 |
10 | # Configure build options.
11 | get_property(IS_MULTICONFIG GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG)
12 | if(IS_MULTICONFIG)
13 | set(CMAKE_CONFIGURATION_TYPES "Debug;Profile;Release"
14 | CACHE STRING "" FORCE)
15 | else()
16 | if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
17 | set(CMAKE_BUILD_TYPE "Debug" CACHE
18 | STRING "Flutter build mode" FORCE)
19 | set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS
20 | "Debug" "Profile" "Release")
21 | endif()
22 | endif()
23 |
24 | set(CMAKE_EXE_LINKER_FLAGS_PROFILE "${CMAKE_EXE_LINKER_FLAGS_RELEASE}")
25 | set(CMAKE_SHARED_LINKER_FLAGS_PROFILE "${CMAKE_SHARED_LINKER_FLAGS_RELEASE}")
26 | set(CMAKE_C_FLAGS_PROFILE "${CMAKE_C_FLAGS_RELEASE}")
27 | set(CMAKE_CXX_FLAGS_PROFILE "${CMAKE_CXX_FLAGS_RELEASE}")
28 |
29 | # Use Unicode for all projects.
30 | add_definitions(-DUNICODE -D_UNICODE)
31 |
32 | # Compilation settings that should be applied to most targets.
33 | function(APPLY_STANDARD_SETTINGS TARGET)
34 | target_compile_features(${TARGET} PUBLIC cxx_std_17)
35 | target_compile_options(${TARGET} PRIVATE /W4 /WX /wd"4100")
36 | target_compile_options(${TARGET} PRIVATE /EHsc)
37 | target_compile_definitions(${TARGET} PRIVATE "_HAS_EXCEPTIONS=0")
38 | target_compile_definitions(${TARGET} PRIVATE "$<$:_DEBUG>")
39 | endfunction()
40 |
41 | set(FLUTTER_MANAGED_DIR "${CMAKE_CURRENT_SOURCE_DIR}/flutter")
42 |
43 | # Flutter library and tool build rules.
44 | add_subdirectory(${FLUTTER_MANAGED_DIR})
45 |
46 | # Application build
47 | add_subdirectory("runner")
48 |
49 | # Generated plugin build rules, which manage building the plugins and adding
50 | # them to the application.
51 | include(flutter/generated_plugins.cmake)
52 |
53 |
54 | # === Installation ===
55 | # Support files are copied into place next to the executable, so that it can
56 | # run in place. This is done instead of making a separate bundle (as on Linux)
57 | # so that building and running from within Visual Studio will work.
58 | set(BUILD_BUNDLE_DIR "$")
59 | # Make the "install" step default, as it's required to run.
60 | set(CMAKE_VS_INCLUDE_INSTALL_TO_DEFAULT_BUILD 1)
61 | if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
62 | set(CMAKE_INSTALL_PREFIX "${BUILD_BUNDLE_DIR}" CACHE PATH "..." FORCE)
63 | endif()
64 |
65 | set(INSTALL_BUNDLE_DATA_DIR "${CMAKE_INSTALL_PREFIX}/data")
66 | set(INSTALL_BUNDLE_LIB_DIR "${CMAKE_INSTALL_PREFIX}")
67 |
68 | install(TARGETS ${BINARY_NAME} RUNTIME DESTINATION "${CMAKE_INSTALL_PREFIX}"
69 | COMPONENT Runtime)
70 |
71 | install(FILES "${FLUTTER_ICU_DATA_FILE}" DESTINATION "${INSTALL_BUNDLE_DATA_DIR}"
72 | COMPONENT Runtime)
73 |
74 | install(FILES "${FLUTTER_LIBRARY}" DESTINATION "${INSTALL_BUNDLE_LIB_DIR}"
75 | COMPONENT Runtime)
76 |
77 | if(PLUGIN_BUNDLED_LIBRARIES)
78 | install(FILES "${PLUGIN_BUNDLED_LIBRARIES}"
79 | DESTINATION "${INSTALL_BUNDLE_LIB_DIR}"
80 | COMPONENT Runtime)
81 | endif()
82 |
83 | # Fully re-copy the assets directory on each build to avoid having stale files
84 | # from a previous install.
85 | set(FLUTTER_ASSET_DIR_NAME "flutter_assets")
86 | install(CODE "
87 | file(REMOVE_RECURSE \"${INSTALL_BUNDLE_DATA_DIR}/${FLUTTER_ASSET_DIR_NAME}\")
88 | " COMPONENT Runtime)
89 | install(DIRECTORY "${PROJECT_BUILD_DIR}/${FLUTTER_ASSET_DIR_NAME}"
90 | DESTINATION "${INSTALL_BUNDLE_DATA_DIR}" COMPONENT Runtime)
91 |
92 | # Install the AOT library on non-Debug builds only.
93 | install(FILES "${AOT_LIBRARY}" DESTINATION "${INSTALL_BUNDLE_DATA_DIR}"
94 | CONFIGURATIONS Profile;Release
95 | COMPONENT Runtime)
96 |
--------------------------------------------------------------------------------
/windows/flutter/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | cmake_minimum_required(VERSION 3.14)
2 |
3 | set(EPHEMERAL_DIR "${CMAKE_CURRENT_SOURCE_DIR}/ephemeral")
4 |
5 | # Configuration provided via flutter tool.
6 | include(${EPHEMERAL_DIR}/generated_config.cmake)
7 |
8 | # TODO: Move the rest of this into files in ephemeral. See
9 | # https://github.com/flutter/flutter/issues/57146.
10 | set(WRAPPER_ROOT "${EPHEMERAL_DIR}/cpp_client_wrapper")
11 |
12 | # === Flutter Library ===
13 | set(FLUTTER_LIBRARY "${EPHEMERAL_DIR}/flutter_windows.dll")
14 |
15 | # Published to parent scope for install step.
16 | set(FLUTTER_LIBRARY ${FLUTTER_LIBRARY} PARENT_SCOPE)
17 | set(FLUTTER_ICU_DATA_FILE "${EPHEMERAL_DIR}/icudtl.dat" PARENT_SCOPE)
18 | set(PROJECT_BUILD_DIR "${PROJECT_DIR}/build/" PARENT_SCOPE)
19 | set(AOT_LIBRARY "${PROJECT_DIR}/build/windows/app.so" PARENT_SCOPE)
20 |
21 | list(APPEND FLUTTER_LIBRARY_HEADERS
22 | "flutter_export.h"
23 | "flutter_windows.h"
24 | "flutter_messenger.h"
25 | "flutter_plugin_registrar.h"
26 | "flutter_texture_registrar.h"
27 | )
28 | list(TRANSFORM FLUTTER_LIBRARY_HEADERS PREPEND "${EPHEMERAL_DIR}/")
29 | add_library(flutter INTERFACE)
30 | target_include_directories(flutter INTERFACE
31 | "${EPHEMERAL_DIR}"
32 | )
33 | target_link_libraries(flutter INTERFACE "${FLUTTER_LIBRARY}.lib")
34 | add_dependencies(flutter flutter_assemble)
35 |
36 | # === Wrapper ===
37 | list(APPEND CPP_WRAPPER_SOURCES_CORE
38 | "core_implementations.cc"
39 | "standard_codec.cc"
40 | )
41 | list(TRANSFORM CPP_WRAPPER_SOURCES_CORE PREPEND "${WRAPPER_ROOT}/")
42 | list(APPEND CPP_WRAPPER_SOURCES_PLUGIN
43 | "plugin_registrar.cc"
44 | )
45 | list(TRANSFORM CPP_WRAPPER_SOURCES_PLUGIN PREPEND "${WRAPPER_ROOT}/")
46 | list(APPEND CPP_WRAPPER_SOURCES_APP
47 | "flutter_engine.cc"
48 | "flutter_view_controller.cc"
49 | )
50 | list(TRANSFORM CPP_WRAPPER_SOURCES_APP PREPEND "${WRAPPER_ROOT}/")
51 |
52 | # Wrapper sources needed for a plugin.
53 | add_library(flutter_wrapper_plugin STATIC
54 | ${CPP_WRAPPER_SOURCES_CORE}
55 | ${CPP_WRAPPER_SOURCES_PLUGIN}
56 | )
57 | apply_standard_settings(flutter_wrapper_plugin)
58 | set_target_properties(flutter_wrapper_plugin PROPERTIES
59 | POSITION_INDEPENDENT_CODE ON)
60 | set_target_properties(flutter_wrapper_plugin PROPERTIES
61 | CXX_VISIBILITY_PRESET hidden)
62 | target_link_libraries(flutter_wrapper_plugin PUBLIC flutter)
63 | target_include_directories(flutter_wrapper_plugin PUBLIC
64 | "${WRAPPER_ROOT}/include"
65 | )
66 | add_dependencies(flutter_wrapper_plugin flutter_assemble)
67 |
68 | # Wrapper sources needed for the runner.
69 | add_library(flutter_wrapper_app STATIC
70 | ${CPP_WRAPPER_SOURCES_CORE}
71 | ${CPP_WRAPPER_SOURCES_APP}
72 | )
73 | apply_standard_settings(flutter_wrapper_app)
74 | target_link_libraries(flutter_wrapper_app PUBLIC flutter)
75 | target_include_directories(flutter_wrapper_app PUBLIC
76 | "${WRAPPER_ROOT}/include"
77 | )
78 | add_dependencies(flutter_wrapper_app flutter_assemble)
79 |
80 | # === Flutter tool backend ===
81 | # _phony_ is a non-existent file to force this command to run every time,
82 | # since currently there's no way to get a full input/output list from the
83 | # flutter tool.
84 | set(PHONY_OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/_phony_")
85 | set_source_files_properties("${PHONY_OUTPUT}" PROPERTIES SYMBOLIC TRUE)
86 | add_custom_command(
87 | OUTPUT ${FLUTTER_LIBRARY} ${FLUTTER_LIBRARY_HEADERS}
88 | ${CPP_WRAPPER_SOURCES_CORE} ${CPP_WRAPPER_SOURCES_PLUGIN}
89 | ${CPP_WRAPPER_SOURCES_APP}
90 | ${PHONY_OUTPUT}
91 | COMMAND ${CMAKE_COMMAND} -E env
92 | ${FLUTTER_TOOL_ENVIRONMENT}
93 | "${FLUTTER_ROOT}/packages/flutter_tools/bin/tool_backend.bat"
94 | windows-x64 $
95 | VERBATIM
96 | )
97 | add_custom_target(flutter_assemble DEPENDS
98 | "${FLUTTER_LIBRARY}"
99 | ${FLUTTER_LIBRARY_HEADERS}
100 | ${CPP_WRAPPER_SOURCES_CORE}
101 | ${CPP_WRAPPER_SOURCES_PLUGIN}
102 | ${CPP_WRAPPER_SOURCES_APP}
103 | )
104 |
--------------------------------------------------------------------------------
/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 |
10 | void RegisterPlugins(flutter::PluginRegistry* registry) {
11 | }
12 |
--------------------------------------------------------------------------------
/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 | )
7 |
8 | list(APPEND FLUTTER_FFI_PLUGIN_LIST
9 | )
10 |
11 | set(PLUGIN_BUNDLED_LIBRARIES)
12 |
13 | foreach(plugin ${FLUTTER_PLUGIN_LIST})
14 | add_subdirectory(flutter/ephemeral/.plugin_symlinks/${plugin}/windows plugins/${plugin})
15 | target_link_libraries(${BINARY_NAME} PRIVATE ${plugin}_plugin)
16 | list(APPEND PLUGIN_BUNDLED_LIBRARIES $)
17 | list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${plugin}_bundled_libraries})
18 | endforeach(plugin)
19 |
20 | foreach(ffi_plugin ${FLUTTER_FFI_PLUGIN_LIST})
21 | add_subdirectory(flutter/ephemeral/.plugin_symlinks/${ffi_plugin}/windows plugins/${ffi_plugin})
22 | list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${ffi_plugin}_bundled_libraries})
23 | endforeach(ffi_plugin)
24 |
--------------------------------------------------------------------------------
/windows/runner/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | cmake_minimum_required(VERSION 3.14)
2 | project(runner LANGUAGES CXX)
3 |
4 | add_executable(${BINARY_NAME} WIN32
5 | "flutter_window.cpp"
6 | "main.cpp"
7 | "utils.cpp"
8 | "win32_window.cpp"
9 | "${FLUTTER_MANAGED_DIR}/generated_plugin_registrant.cc"
10 | "Runner.rc"
11 | "runner.exe.manifest"
12 | )
13 | apply_standard_settings(${BINARY_NAME})
14 | target_compile_definitions(${BINARY_NAME} PRIVATE "NOMINMAX")
15 | target_link_libraries(${BINARY_NAME} PRIVATE flutter flutter_wrapper_app)
16 | target_include_directories(${BINARY_NAME} PRIVATE "${CMAKE_SOURCE_DIR}")
17 | add_dependencies(${BINARY_NAME} flutter_assemble)
18 |
--------------------------------------------------------------------------------
/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 | #ifdef FLUTTER_BUILD_NUMBER
64 | #define VERSION_AS_NUMBER FLUTTER_BUILD_NUMBER
65 | #else
66 | #define VERSION_AS_NUMBER 1,0,0
67 | #endif
68 |
69 | #ifdef FLUTTER_BUILD_NAME
70 | #define VERSION_AS_STRING #FLUTTER_BUILD_NAME
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", "podcast_app_case" "\0"
94 | VALUE "FileVersion", VERSION_AS_STRING "\0"
95 | VALUE "InternalName", "podcast_app_case" "\0"
96 | VALUE "LegalCopyright", "Copyright (C) 2022 com.example. All rights reserved." "\0"
97 | VALUE "OriginalFilename", "podcast_app_case.exe" "\0"
98 | VALUE "ProductName", "podcast_app_case" "\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"podcast_app_case", 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/FlutterWiz/podcast_app_case/ca9f99285d8a9ed7aa968f527dbaad2b5dd5b374/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 | if (target_length == 0) {
52 | return std::string();
53 | }
54 | std::string utf8_string;
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 |
--------------------------------------------------------------------------------