├── .gitattributes
├── .gitignore
├── .metadata
├── README.md
├── analysis_options.yaml
├── android
├── .gitignore
├── app
│ ├── build.gradle
│ └── src
│ │ ├── debug
│ │ └── AndroidManifest.xml
│ │ ├── main
│ │ ├── AndroidManifest.xml
│ │ ├── kotlin
│ │ │ └── com
│ │ │ │ └── example
│ │ │ │ └── flutter_components
│ │ │ │ └── MainActivity.kt
│ │ └── res
│ │ │ ├── drawable-v21
│ │ │ └── launch_background.xml
│ │ │ ├── drawable
│ │ │ └── launch_background.xml
│ │ │ ├── mipmap-hdpi
│ │ │ └── ic_launcher.png
│ │ │ ├── mipmap-mdpi
│ │ │ └── ic_launcher.png
│ │ │ ├── mipmap-xhdpi
│ │ │ └── ic_launcher.png
│ │ │ ├── mipmap-xxhdpi
│ │ │ └── ic_launcher.png
│ │ │ ├── mipmap-xxxhdpi
│ │ │ └── ic_launcher.png
│ │ │ ├── values-night
│ │ │ └── styles.xml
│ │ │ └── values
│ │ │ └── styles.xml
│ │ └── profile
│ │ └── AndroidManifest.xml
├── build.gradle
├── gradle.properties
├── gradle
│ └── wrapper
│ │ └── gradle-wrapper.properties
└── settings.gradle
├── assets
├── Logo.png
├── dev.png
├── done.png
├── github.png
├── insta.png
├── linkedin.png
├── mountain.jpg
├── mountain1.jpg
├── mountain2.jpg
├── mountain3.jpg
├── mountain4.jpg
├── onBoardImage.png
├── onBoardLogo.png
├── pages_images
│ ├── calenderIcon.svg
│ ├── homeIcon.svg
│ ├── messageIcon.svg
│ ├── profileIcon.svg
│ └── userLogo.svg
├── secondOnboard1.png
├── secondOnboard2.png
├── secondOnboard3.png
└── travelerImage1.jpg
├── ios
├── .gitignore
├── Flutter
│ ├── AppFrameworkInfo.plist
│ ├── Debug.xcconfig
│ └── Release.xcconfig
├── Runner.xcodeproj
│ ├── project.pbxproj
│ ├── project.xcworkspace
│ │ ├── contents.xcworkspacedata
│ │ └── xcshareddata
│ │ │ ├── IDEWorkspaceChecks.plist
│ │ │ └── WorkspaceSettings.xcsettings
│ └── xcshareddata
│ │ └── xcschemes
│ │ └── Runner.xcscheme
├── Runner.xcworkspace
│ ├── contents.xcworkspacedata
│ └── xcshareddata
│ │ ├── IDEWorkspaceChecks.plist
│ │ └── WorkspaceSettings.xcsettings
├── Runner
│ ├── AppDelegate.swift
│ ├── Assets.xcassets
│ │ ├── AppIcon.appiconset
│ │ │ ├── Contents.json
│ │ │ ├── Icon-App-1024x1024@1x.png
│ │ │ ├── Icon-App-20x20@1x.png
│ │ │ ├── Icon-App-20x20@2x.png
│ │ │ ├── Icon-App-20x20@3x.png
│ │ │ ├── Icon-App-29x29@1x.png
│ │ │ ├── Icon-App-29x29@2x.png
│ │ │ ├── Icon-App-29x29@3x.png
│ │ │ ├── Icon-App-40x40@1x.png
│ │ │ ├── Icon-App-40x40@2x.png
│ │ │ ├── Icon-App-40x40@3x.png
│ │ │ ├── Icon-App-60x60@2x.png
│ │ │ ├── Icon-App-60x60@3x.png
│ │ │ ├── Icon-App-76x76@1x.png
│ │ │ ├── Icon-App-76x76@2x.png
│ │ │ └── Icon-App-83.5x83.5@2x.png
│ │ └── LaunchImage.imageset
│ │ │ ├── Contents.json
│ │ │ ├── LaunchImage.png
│ │ │ ├── LaunchImage@2x.png
│ │ │ ├── LaunchImage@3x.png
│ │ │ └── README.md
│ ├── Base.lproj
│ │ ├── LaunchScreen.storyboard
│ │ └── Main.storyboard
│ ├── Info.plist
│ └── Runner-Bridging-Header.h
└── RunnerTests
│ └── RunnerTests.swift
├── lib
├── components
│ ├── animated_shadow_elevated_button.dart
│ ├── custom_animated_card.dart
│ ├── custom_animated_crousel_scroll.dart
│ ├── custom_animated_dialogbox.dart
│ ├── custom_animated_expandable_card.dart
│ ├── custom_animated_image_shile_show.dart
│ ├── custom_animated_paralele_effect.dart
│ ├── custom_animated_rating_box.dart
│ ├── custom_animated_slide_button.dart
│ ├── custom_animated_snackbar.dart
│ ├── custom_circular_progress_indicator.dart
│ ├── custom_designed_animated_onboard_screen.dart
│ ├── custom_instagram_like_button.dart
│ ├── custom_like_button.dart
│ ├── custom_otp_field.dart
│ ├── custom_rolling_animated_switch.dart
│ ├── custom_second_bottom_nav_bar.dart
│ ├── custom_shimmer_effect.dart
│ ├── custom_tab_controller.dart
│ ├── edit_custom_animated_scroll_view.dart
│ ├── email_validation_form.dart
│ ├── first_contained_bottom_navigation_bar.dart
│ ├── first_onBoarding_screen.dart
│ ├── page_navigation_animation.dart
│ ├── password_authenticator_field.dart
│ ├── secondContaineredBottomBar.dart
│ ├── second_animated_onboarding_screen.dart
│ ├── second_animated_overlay_bottom_navbar.dart
│ └── tab_base_navigation.dart
├── main.dart
├── main_button.dart
├── main_home_page.dart
├── pages_design
│ └── animated_travel_pages
│ │ ├── components
│ │ ├── item_detial_component
│ │ │ ├── content_detial_component.dart
│ │ │ ├── elevated_button_travle_page.dart
│ │ │ └── iconButton.dart
│ │ └── main_page_component
│ │ │ ├── app_bar_travel_main_page.dart
│ │ │ ├── bottom_app_bar_travel_page.dart
│ │ │ ├── sliding_content_travel_page.dart
│ │ │ ├── title_main_page_text_component.dart
│ │ │ └── travel_page_model.dart
│ │ ├── content_full_see_page.dart
│ │ └── travel_main_page.dart
└── using_custom_package
│ ├── fancy_animated_snackbar.dart
│ └── first_animated_carousel_scroll.dart
├── linux
├── .gitignore
├── CMakeLists.txt
├── flutter
│ ├── CMakeLists.txt
│ ├── generated_plugin_registrant.cc
│ ├── generated_plugin_registrant.h
│ └── generated_plugins.cmake
├── main.cc
├── my_application.cc
└── my_application.h
├── macos
├── .gitignore
├── Flutter
│ ├── Flutter-Debug.xcconfig
│ ├── Flutter-Release.xcconfig
│ └── GeneratedPluginRegistrant.swift
├── Runner.xcodeproj
│ ├── project.pbxproj
│ ├── project.xcworkspace
│ │ └── xcshareddata
│ │ │ └── IDEWorkspaceChecks.plist
│ └── xcshareddata
│ │ └── xcschemes
│ │ └── Runner.xcscheme
├── Runner.xcworkspace
│ ├── contents.xcworkspacedata
│ └── xcshareddata
│ │ └── IDEWorkspaceChecks.plist
├── Runner
│ ├── AppDelegate.swift
│ ├── Assets.xcassets
│ │ └── AppIcon.appiconset
│ │ │ ├── Contents.json
│ │ │ ├── app_icon_1024.png
│ │ │ ├── app_icon_128.png
│ │ │ ├── app_icon_16.png
│ │ │ ├── app_icon_256.png
│ │ │ ├── app_icon_32.png
│ │ │ ├── app_icon_512.png
│ │ │ └── app_icon_64.png
│ ├── Base.lproj
│ │ └── MainMenu.xib
│ ├── Configs
│ │ ├── AppInfo.xcconfig
│ │ ├── Debug.xcconfig
│ │ ├── Release.xcconfig
│ │ └── Warnings.xcconfig
│ ├── DebugProfile.entitlements
│ ├── Info.plist
│ ├── MainFlutterWindow.swift
│ └── Release.entitlements
└── RunnerTests
│ └── RunnerTests.swift
├── pubspec.lock
├── pubspec.yaml
├── test
└── widget_test.dart
├── web
├── favicon.png
├── icons
│ ├── Icon-192.png
│ ├── Icon-512.png
│ ├── Icon-maskable-192.png
│ └── Icon-maskable-512.png
├── index.html
└── manifest.json
└── windows
├── .gitignore
├── CMakeLists.txt
├── flutter
├── CMakeLists.txt
├── generated_plugin_registrant.cc
├── generated_plugin_registrant.h
└── generated_plugins.cmake
└── runner
├── CMakeLists.txt
├── Runner.rc
├── flutter_window.cpp
├── flutter_window.h
├── main.cpp
├── resource.h
├── resources
└── app_icon.ico
├── runner.exe.manifest
├── utils.cpp
├── utils.h
├── win32_window.cpp
└── win32_window.h
/.gitattributes:
--------------------------------------------------------------------------------
1 | # Auto detect text files and perform LF normalization
2 | * text=auto
3 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | # Miscellaneous
2 | *.class
3 | *.log
4 | *.pyc
5 | *.swp
6 | .DS_Store
7 | .atom/
8 | .buildlog/
9 | .history
10 | .svn/
11 | migrate_working_dir/
12 |
13 | # IntelliJ related
14 | *.iml
15 | *.ipr
16 | *.iws
17 | .idea/
18 |
19 | # The .vscode folder contains launch configuration and tasks you configure in
20 | # VS Code which you may wish to be included in version control, so this line
21 | # is commented out by default.
22 | #.vscode/
23 |
24 | # Flutter/Dart/Pub related
25 | **/doc/api/
26 | **/ios/Flutter/.last_build_id
27 | .dart_tool/
28 | .flutter-plugins
29 | .flutter-plugins-dependencies
30 | .pub-cache/
31 | .pub/
32 | /build/
33 |
34 | # Symbolication related
35 | app.*.symbols
36 |
37 | # Obfuscation related
38 | app.*.map.json
39 |
40 | # Android Studio will place build artifacts here
41 | /android/app/debug
42 | /android/app/profile
43 | /android/app/release
44 |
--------------------------------------------------------------------------------
/.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: "b0850beeb25f6d5b10426284f506557f66181b36"
8 | channel: "stable"
9 |
10 | project_type: app
11 |
12 | # Tracks metadata for the flutter migrate command
13 | migration:
14 | platforms:
15 | - platform: root
16 | create_revision: b0850beeb25f6d5b10426284f506557f66181b36
17 | base_revision: b0850beeb25f6d5b10426284f506557f66181b36
18 | - platform: android
19 | create_revision: b0850beeb25f6d5b10426284f506557f66181b36
20 | base_revision: b0850beeb25f6d5b10426284f506557f66181b36
21 | - platform: ios
22 | create_revision: b0850beeb25f6d5b10426284f506557f66181b36
23 | base_revision: b0850beeb25f6d5b10426284f506557f66181b36
24 | - platform: linux
25 | create_revision: b0850beeb25f6d5b10426284f506557f66181b36
26 | base_revision: b0850beeb25f6d5b10426284f506557f66181b36
27 | - platform: macos
28 | create_revision: b0850beeb25f6d5b10426284f506557f66181b36
29 | base_revision: b0850beeb25f6d5b10426284f506557f66181b36
30 | - platform: web
31 | create_revision: b0850beeb25f6d5b10426284f506557f66181b36
32 | base_revision: b0850beeb25f6d5b10426284f506557f66181b36
33 | - platform: windows
34 | create_revision: b0850beeb25f6d5b10426284f506557f66181b36
35 | base_revision: b0850beeb25f6d5b10426284f506557f66181b36
36 |
37 | # User provided section
38 |
39 | # List of Local paths (relative to this file) that should be
40 | # ignored by the migrate tool.
41 | #
42 | # Files that are not part of the templates will be ignored by default.
43 | unmanaged_files:
44 | - 'lib/main.dart'
45 | - 'ios/Runner.xcodeproj/project.pbxproj'
46 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # Flutter Components Repository
2 |
3 | Welcome to the Flutter Components Repository! This project is a collection of custom Flutter widgets and components designed to enhance and streamline your development process. Each component has been created to offer unique functionality and aesthetic enhancements for your Flutter applications.
4 |
5 | ## Components Overview
6 |
7 | Here is a list of the components currently available in this repository:
8 |
9 | 1. **OnBoard Screen**
10 | *Description:* A customizable onboarding screen to guide users through initial app interactions.
11 |
12 | 2. **Custom Tab Bar Navigation**
13 | *Description:* A fully customizable tab bar for navigation with various styling options.
14 | *Video Link:* [Coming Soon]
15 |
16 | 3. **Custom Bottom Navigation Bar**
17 | *Description:* A flexible bottom navigation bar with custom styling and behavior.
18 | *Video Link:* [Coming Soon]
19 |
20 | 4. **Custom Shimmer Effect**
21 | *Description:* A shimmer effect to create loading placeholders that mimic the loading of content.
22 | *Video Link:* [Coming Soon]
23 |
24 | 5. **Password Validation Field**
25 | *Description:* A text field with built-in password validation and strength indicators.
26 | *Video Link:* [Coming Soon]
27 |
28 | 6. **Expandable Card**
29 | *Description:* A card widget that expands and collapses to show more content.
30 | *Video Link:* [Coming Soon]
31 |
32 | 7. **Custom Like Button**
33 | *Description:* A customizable like button with animation effects.
34 | *Video Link:* [Coming Soon]
35 |
36 | 8. **Custom Circular Progress Indicator**
37 | *Description:* A circular progress indicator with customizable styles and animations.
38 | *Video Link:* [Coming Soon]
39 |
40 | 9. **Custom Carousel Scroll**
41 | *Description:* A carousel widget for scrolling through a series of items with smooth transitions.
42 | *Video Link:* [Coming Soon]
43 |
44 | 10. **Custom Animated Snackbar**
45 | *Description:* A snackbar with customizable animations and styles for notifications.
46 | *Video Link:* [Coming Soon]
47 |
48 | 11. **Custom Tab Base Navigation**
49 | *Description:* A tab-based navigation system with customizable tabs and animations.
50 | *Video Link:* [Coming Soon]
51 |
52 | 12. **Custom Animated Slider Button**
53 | *Description:* An animated slider button with customizable design and behavior.
54 |
55 | 13. **Custom Animated Dialog Box**
56 | *Description:* A dialog box with animations for showing and hiding content.
57 | *Video Link:* [Coming Soon]
58 |
59 | 14. **Custom Overlay Bottom App Bar**
60 | *Description:* An overlay bottom app bar that appears above other content.
61 | *Video Link:* [Coming Soon]
62 |
63 | 15. **Custom Pin Field**
64 | *Description:* A pin input field with customizable styles and behaviors.
65 | *Video Link:* [Coming Soon]
66 |
67 | ## Future Components
68 |
69 | I am continuously working on new components and features. Stay tuned for more additions to this repository, including:
70 |
71 | - Advanced input fields
72 | - Interactive charts and graphs
73 | - Customizable widgets for advanced UI/UX
74 |
--------------------------------------------------------------------------------
/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 https://dart.dev/lints.
17 | #
18 | # Instead of disabling a lint rule for the entire project in the
19 | # section below, it can also be suppressed for a single line of code
20 | # or a specific dart file by using the `// ignore: name_of_lint` and
21 | # `// ignore_for_file: name_of_lint` syntax on the line or in the file
22 | # producing the lint.
23 | rules:
24 | # avoid_print: false # Uncomment to disable the `avoid_print` rule
25 | # prefer_single_quotes: true # Uncomment to enable the `prefer_single_quotes` rule
26 |
27 | # Additional information about this file can be found at
28 | # https://dart.dev/guides/language/analysis-options
29 |
--------------------------------------------------------------------------------
/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 | plugins {
2 | id "com.android.application"
3 | id "kotlin-android"
4 | // The Flutter Gradle Plugin must be applied after the Android and Kotlin Gradle plugins.
5 | id "dev.flutter.flutter-gradle-plugin"
6 | }
7 |
8 | def localProperties = new Properties()
9 | def localPropertiesFile = rootProject.file("local.properties")
10 | if (localPropertiesFile.exists()) {
11 | localPropertiesFile.withReader("UTF-8") { reader ->
12 | localProperties.load(reader)
13 | }
14 | }
15 |
16 | def flutterVersionCode = localProperties.getProperty("flutter.versionCode")
17 | if (flutterVersionCode == null) {
18 | flutterVersionCode = "1"
19 | }
20 |
21 | def flutterVersionName = localProperties.getProperty("flutter.versionName")
22 | if (flutterVersionName == null) {
23 | flutterVersionName = "1.0"
24 | }
25 |
26 | android {
27 | namespace = "com.example.flutter_components"
28 | compileSdk = flutter.compileSdkVersion
29 | ndkVersion = flutter.ndkVersion
30 |
31 | compileOptions {
32 | sourceCompatibility = JavaVersion.VERSION_1_8
33 | targetCompatibility = JavaVersion.VERSION_1_8
34 | }
35 |
36 | defaultConfig {
37 | // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
38 | applicationId = "com.example.flutter_components"
39 | // You can update the following values to match your application needs.
40 | // For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-gradle-build-configuration.
41 | minSdk = flutter.minSdkVersion
42 | targetSdk = flutter.targetSdkVersion
43 | versionCode = flutterVersionCode.toInteger()
44 | versionName = flutterVersionName
45 | }
46 |
47 | buildTypes {
48 | release {
49 | // TODO: Add your own signing config for the release build.
50 | // Signing with the debug keys for now, so `flutter run --release` works.
51 | signingConfig = signingConfigs.debug
52 | }
53 | }
54 | }
55 |
56 | flutter {
57 | source = "../.."
58 | }
59 |
--------------------------------------------------------------------------------
/android/app/src/debug/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/android/app/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
15 |
19 |
23 |
24 |
25 |
26 |
27 |
28 |
30 |
33 |
34 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
--------------------------------------------------------------------------------
/android/app/src/main/kotlin/com/example/flutter_components/MainActivity.kt:
--------------------------------------------------------------------------------
1 | package com.example.flutter_components
2 |
3 | import io.flutter.embedding.android.FlutterActivity
4 |
5 | class MainActivity: FlutterActivity()
6 |
--------------------------------------------------------------------------------
/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/fahadazizz/Flutter_Components/91bdc750c9b089bf2b1bf4f9f7ca7c6b394bec81/android/app/src/main/res/mipmap-hdpi/ic_launcher.png
--------------------------------------------------------------------------------
/android/app/src/main/res/mipmap-mdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fahadazizz/Flutter_Components/91bdc750c9b089bf2b1bf4f9f7ca7c6b394bec81/android/app/src/main/res/mipmap-mdpi/ic_launcher.png
--------------------------------------------------------------------------------
/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fahadazizz/Flutter_Components/91bdc750c9b089bf2b1bf4f9f7ca7c6b394bec81/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fahadazizz/Flutter_Components/91bdc750c9b089bf2b1bf4f9f7ca7c6b394bec81/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fahadazizz/Flutter_Components/91bdc750c9b089bf2b1bf4f9f7ca7c6b394bec81/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 |
2 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/android/build.gradle:
--------------------------------------------------------------------------------
1 | allprojects {
2 | repositories {
3 | google()
4 | mavenCentral()
5 | }
6 | }
7 |
8 | rootProject.buildDir = "../build"
9 | subprojects {
10 | project.buildDir = "${rootProject.buildDir}/${project.name}"
11 | }
12 | subprojects {
13 | project.evaluationDependsOn(":app")
14 | }
15 |
16 | tasks.register("clean", Delete) {
17 | delete rootProject.buildDir
18 | }
19 |
--------------------------------------------------------------------------------
/android/gradle.properties:
--------------------------------------------------------------------------------
1 | org.gradle.jvmargs=-Xmx4G -XX:+HeapDumpOnOutOfMemoryError
2 | android.useAndroidX=true
3 | android.enableJetifier=true
4 |
--------------------------------------------------------------------------------
/android/gradle/wrapper/gradle-wrapper.properties:
--------------------------------------------------------------------------------
1 | distributionBase=GRADLE_USER_HOME
2 | distributionPath=wrapper/dists
3 | zipStoreBase=GRADLE_USER_HOME
4 | zipStorePath=wrapper/dists
5 | distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.3-all.zip
6 |
--------------------------------------------------------------------------------
/android/settings.gradle:
--------------------------------------------------------------------------------
1 | pluginManagement {
2 | def flutterSdkPath = {
3 | def properties = new Properties()
4 | file("local.properties").withInputStream { properties.load(it) }
5 | def flutterSdkPath = properties.getProperty("flutter.sdk")
6 | assert flutterSdkPath != null, "flutter.sdk not set in local.properties"
7 | return flutterSdkPath
8 | }()
9 |
10 | includeBuild("$flutterSdkPath/packages/flutter_tools/gradle")
11 |
12 | repositories {
13 | google()
14 | mavenCentral()
15 | gradlePluginPortal()
16 | }
17 | }
18 |
19 | plugins {
20 | id "dev.flutter.flutter-plugin-loader" version "1.0.0"
21 | id "com.android.application" version "7.3.0" apply false
22 | id "org.jetbrains.kotlin.android" version "1.7.10" apply false
23 | }
24 |
25 | include ":app"
26 |
--------------------------------------------------------------------------------
/assets/Logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fahadazizz/Flutter_Components/91bdc750c9b089bf2b1bf4f9f7ca7c6b394bec81/assets/Logo.png
--------------------------------------------------------------------------------
/assets/dev.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fahadazizz/Flutter_Components/91bdc750c9b089bf2b1bf4f9f7ca7c6b394bec81/assets/dev.png
--------------------------------------------------------------------------------
/assets/done.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fahadazizz/Flutter_Components/91bdc750c9b089bf2b1bf4f9f7ca7c6b394bec81/assets/done.png
--------------------------------------------------------------------------------
/assets/github.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fahadazizz/Flutter_Components/91bdc750c9b089bf2b1bf4f9f7ca7c6b394bec81/assets/github.png
--------------------------------------------------------------------------------
/assets/insta.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fahadazizz/Flutter_Components/91bdc750c9b089bf2b1bf4f9f7ca7c6b394bec81/assets/insta.png
--------------------------------------------------------------------------------
/assets/linkedin.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fahadazizz/Flutter_Components/91bdc750c9b089bf2b1bf4f9f7ca7c6b394bec81/assets/linkedin.png
--------------------------------------------------------------------------------
/assets/mountain.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fahadazizz/Flutter_Components/91bdc750c9b089bf2b1bf4f9f7ca7c6b394bec81/assets/mountain.jpg
--------------------------------------------------------------------------------
/assets/mountain1.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fahadazizz/Flutter_Components/91bdc750c9b089bf2b1bf4f9f7ca7c6b394bec81/assets/mountain1.jpg
--------------------------------------------------------------------------------
/assets/mountain2.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fahadazizz/Flutter_Components/91bdc750c9b089bf2b1bf4f9f7ca7c6b394bec81/assets/mountain2.jpg
--------------------------------------------------------------------------------
/assets/mountain3.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fahadazizz/Flutter_Components/91bdc750c9b089bf2b1bf4f9f7ca7c6b394bec81/assets/mountain3.jpg
--------------------------------------------------------------------------------
/assets/mountain4.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fahadazizz/Flutter_Components/91bdc750c9b089bf2b1bf4f9f7ca7c6b394bec81/assets/mountain4.jpg
--------------------------------------------------------------------------------
/assets/onBoardImage.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fahadazizz/Flutter_Components/91bdc750c9b089bf2b1bf4f9f7ca7c6b394bec81/assets/onBoardImage.png
--------------------------------------------------------------------------------
/assets/onBoardLogo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fahadazizz/Flutter_Components/91bdc750c9b089bf2b1bf4f9f7ca7c6b394bec81/assets/onBoardLogo.png
--------------------------------------------------------------------------------
/assets/pages_images/calenderIcon.svg:
--------------------------------------------------------------------------------
1 |
13 |
--------------------------------------------------------------------------------
/assets/pages_images/homeIcon.svg:
--------------------------------------------------------------------------------
1 |
6 |
--------------------------------------------------------------------------------
/assets/pages_images/messageIcon.svg:
--------------------------------------------------------------------------------
1 |
4 |
--------------------------------------------------------------------------------
/assets/pages_images/profileIcon.svg:
--------------------------------------------------------------------------------
1 |
5 |
--------------------------------------------------------------------------------
/assets/secondOnboard1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fahadazizz/Flutter_Components/91bdc750c9b089bf2b1bf4f9f7ca7c6b394bec81/assets/secondOnboard1.png
--------------------------------------------------------------------------------
/assets/secondOnboard2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fahadazizz/Flutter_Components/91bdc750c9b089bf2b1bf4f9f7ca7c6b394bec81/assets/secondOnboard2.png
--------------------------------------------------------------------------------
/assets/secondOnboard3.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fahadazizz/Flutter_Components/91bdc750c9b089bf2b1bf4f9f7ca7c6b394bec81/assets/secondOnboard3.png
--------------------------------------------------------------------------------
/assets/travelerImage1.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fahadazizz/Flutter_Components/91bdc750c9b089bf2b1bf4f9f7ca7c6b394bec81/assets/travelerImage1.jpg
--------------------------------------------------------------------------------
/ios/.gitignore:
--------------------------------------------------------------------------------
1 | **/dgph
2 | *.mode1v3
3 | *.mode2v3
4 | *.moved-aside
5 | *.pbxuser
6 | *.perspectivev3
7 | **/*sync/
8 | .sconsign.dblite
9 | .tags*
10 | **/.vagrant/
11 | **/DerivedData/
12 | Icon?
13 | **/Pods/
14 | **/.symlinks/
15 | profile
16 | xcuserdata
17 | **/.generated/
18 | Flutter/App.framework
19 | Flutter/Flutter.framework
20 | Flutter/Flutter.podspec
21 | Flutter/Generated.xcconfig
22 | Flutter/ephemeral/
23 | Flutter/app.flx
24 | Flutter/app.zip
25 | Flutter/flutter_assets/
26 | Flutter/flutter_export_environment.sh
27 | ServiceDefinitions.json
28 | Runner/GeneratedPluginRegistrant.*
29 |
30 | # Exceptions to above rules.
31 | !default.mode1v3
32 | !default.mode2v3
33 | !default.pbxuser
34 | !default.perspectivev3
35 |
--------------------------------------------------------------------------------
/ios/Flutter/AppFrameworkInfo.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | en
7 | CFBundleExecutable
8 | App
9 | CFBundleIdentifier
10 | io.flutter.flutter.app
11 | CFBundleInfoDictionaryVersion
12 | 6.0
13 | CFBundleName
14 | App
15 | CFBundlePackageType
16 | FMWK
17 | CFBundleShortVersionString
18 | 1.0
19 | CFBundleSignature
20 | ????
21 | CFBundleVersion
22 | 1.0
23 | MinimumOSVersion
24 | 12.0
25 |
26 |
27 |
--------------------------------------------------------------------------------
/ios/Flutter/Debug.xcconfig:
--------------------------------------------------------------------------------
1 | #include "Generated.xcconfig"
2 |
--------------------------------------------------------------------------------
/ios/Flutter/Release.xcconfig:
--------------------------------------------------------------------------------
1 | #include "Generated.xcconfig"
2 |
--------------------------------------------------------------------------------
/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | IDEDidComputeMac32BitWarning
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | PreviewsEnabled
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme:
--------------------------------------------------------------------------------
1 |
2 |
5 |
8 |
9 |
15 |
21 |
22 |
23 |
24 |
25 |
30 |
31 |
37 |
38 |
39 |
40 |
43 |
49 |
50 |
51 |
52 |
53 |
63 |
65 |
71 |
72 |
73 |
74 |
80 |
82 |
88 |
89 |
90 |
91 |
93 |
94 |
97 |
98 |
99 |
--------------------------------------------------------------------------------
/ios/Runner.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | IDEDidComputeMac32BitWarning
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | PreviewsEnabled
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/ios/Runner/AppDelegate.swift:
--------------------------------------------------------------------------------
1 | import Flutter
2 | import UIKit
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/fahadazizz/Flutter_Components/91bdc750c9b089bf2b1bf4f9f7ca7c6b394bec81/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/fahadazizz/Flutter_Components/91bdc750c9b089bf2b1bf4f9f7ca7c6b394bec81/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/fahadazizz/Flutter_Components/91bdc750c9b089bf2b1bf4f9f7ca7c6b394bec81/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/fahadazizz/Flutter_Components/91bdc750c9b089bf2b1bf4f9f7ca7c6b394bec81/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/fahadazizz/Flutter_Components/91bdc750c9b089bf2b1bf4f9f7ca7c6b394bec81/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/fahadazizz/Flutter_Components/91bdc750c9b089bf2b1bf4f9f7ca7c6b394bec81/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/fahadazizz/Flutter_Components/91bdc750c9b089bf2b1bf4f9f7ca7c6b394bec81/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/fahadazizz/Flutter_Components/91bdc750c9b089bf2b1bf4f9f7ca7c6b394bec81/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/fahadazizz/Flutter_Components/91bdc750c9b089bf2b1bf4f9f7ca7c6b394bec81/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/fahadazizz/Flutter_Components/91bdc750c9b089bf2b1bf4f9f7ca7c6b394bec81/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/fahadazizz/Flutter_Components/91bdc750c9b089bf2b1bf4f9f7ca7c6b394bec81/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/fahadazizz/Flutter_Components/91bdc750c9b089bf2b1bf4f9f7ca7c6b394bec81/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/fahadazizz/Flutter_Components/91bdc750c9b089bf2b1bf4f9f7ca7c6b394bec81/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/fahadazizz/Flutter_Components/91bdc750c9b089bf2b1bf4f9f7ca7c6b394bec81/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/fahadazizz/Flutter_Components/91bdc750c9b089bf2b1bf4f9f7ca7c6b394bec81/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/fahadazizz/Flutter_Components/91bdc750c9b089bf2b1bf4f9f7ca7c6b394bec81/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fahadazizz/Flutter_Components/91bdc750c9b089bf2b1bf4f9f7ca7c6b394bec81/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fahadazizz/Flutter_Components/91bdc750c9b089bf2b1bf4f9f7ca7c6b394bec81/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 | Flutter Components
9 | CFBundleExecutable
10 | $(EXECUTABLE_NAME)
11 | CFBundleIdentifier
12 | $(PRODUCT_BUNDLE_IDENTIFIER)
13 | CFBundleInfoDictionaryVersion
14 | 6.0
15 | CFBundleName
16 | flutter_components
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 | CADisableMinimumFrameDurationOnPhone
45 |
46 | UIApplicationSupportsIndirectInputEvents
47 |
48 |
49 |
50 |
--------------------------------------------------------------------------------
/ios/Runner/Runner-Bridging-Header.h:
--------------------------------------------------------------------------------
1 | #import "GeneratedPluginRegistrant.h"
2 |
--------------------------------------------------------------------------------
/ios/RunnerTests/RunnerTests.swift:
--------------------------------------------------------------------------------
1 | import Flutter
2 | import UIKit
3 | import XCTest
4 |
5 | class RunnerTests: XCTestCase {
6 |
7 | func testExample() {
8 | // If you add code to the Runner application, consider adding tests here.
9 | // See https://developer.apple.com/documentation/xctest for more information about using XCTest.
10 | }
11 |
12 | }
13 |
--------------------------------------------------------------------------------
/lib/components/animated_shadow_elevated_button.dart:
--------------------------------------------------------------------------------
1 | import 'package:control_style/control_style.dart';
2 | import 'package:flutter/material.dart';
3 |
4 | class AnimatedShadowButton extends StatefulWidget {
5 | const AnimatedShadowButton({super.key});
6 |
7 | @override
8 | State createState() => _AnimatedShadowButtonState();
9 | }
10 |
11 | class _AnimatedShadowButtonState extends State
12 | with SingleTickerProviderStateMixin {
13 | late AnimationController controller;
14 | late Tween tween;
15 | late Animation animation;
16 |
17 | @override
18 | void initState() {
19 | controller =
20 | AnimationController(duration: const Duration(seconds: 3), vsync: this);
21 | tween = Tween(begin: 0, end: 359);
22 | animation = controller.drive(tween);
23 |
24 | controller.forward();
25 | controller.repeat();
26 | super.initState();
27 | }
28 |
29 | @override
30 | void dispose() {
31 | controller.dispose();
32 | super.dispose();
33 | }
34 |
35 | @override
36 | Widget build(BuildContext context) {
37 | return Scaffold(
38 | backgroundColor: Colors.transparent,
39 | body: Center(
40 | child: Padding(
41 | padding: const EdgeInsets.all(8.0),
42 | child: AnimatedBuilder(
43 | animation: animation,
44 | builder: (context, child) {
45 | return TextButton(
46 | onPressed: () {},
47 | style: TextButton.styleFrom(
48 | fixedSize: const Size(300, 50),
49 | shape: DecoratedOutlinedBorder(
50 | shadow: [
51 | GradientShadow(
52 | gradient: LinearGradient(
53 | begin: Alignment.topLeft,
54 | end: Alignment.topRight,
55 | colors: _generateGradientColors(animation.value),
56 | stops: _generateGradientStops(),
57 | ),
58 | offset: const Offset(-4, 4),
59 | blurRadius: 12,
60 | spreadRadius: 2)
61 | ],
62 | child: RoundedRectangleBorder(
63 | borderRadius: BorderRadius.circular(8),
64 | ),
65 | ),
66 | ),
67 | child: const Text(
68 | "Welcome",
69 | style: TextStyle(
70 | fontSize: 16,
71 | fontWeight: FontWeight.w300,
72 | color: Colors.white),
73 | ),
74 | );
75 | },
76 | ),
77 | ),
78 | ),
79 | );
80 | }
81 |
82 | List _generateGradientColors(double offset) {
83 | List colors = [];
84 | const int divisions = 10;
85 | for (int i = 0; i < divisions; i++) {
86 | double hue = (360 / divisions) * i;
87 | hue += offset;
88 | if (hue > 360) {
89 | hue -= 360;
90 | }
91 | final Color color = HSVColor.fromAHSV(1.0, hue, 1.0, 1.0).toColor();
92 | colors.add(color);
93 | }
94 | colors.add(colors[0]);
95 | return colors;
96 | }
97 |
98 | List _generateGradientStops() {
99 | const int divisions = 10;
100 | List stops = [];
101 | for (int i = 0; i <= divisions; i++) {
102 | stops.add(i / divisions);
103 | }
104 | return stops;
105 | }
106 | }
107 |
--------------------------------------------------------------------------------
/lib/components/custom_animated_card.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 |
3 | class CustomAnimatedCard extends StatefulWidget {
4 | const CustomAnimatedCard({super.key});
5 |
6 | @override
7 | State createState() => _CustomAnimatedCardState();
8 | }
9 |
10 | class _CustomAnimatedCardState extends State
11 | with TickerProviderStateMixin {
12 | late AnimationController _animationController;
13 | late Animation _transfromAnimationOne;
14 | late Animation _transfromAnimationTwo;
15 | bool isExpanded = false;
16 |
17 | @override
18 | void initState() {
19 | _animationController =
20 | AnimationController(vsync: this, duration: Duration(milliseconds: 800));
21 |
22 | _transfromAnimationOne = Tween(begin: 0, end: 1).animate(
23 | CurvedAnimation(parent: _animationController, curve: Curves.easeInOut));
24 |
25 | _transfromAnimationTwo = Tween(begin: 1, end: 0).animate(
26 | CurvedAnimation(parent: _animationController, curve: Curves.easeInOut));
27 | super.initState();
28 | }
29 |
30 | @override
31 | Widget build(BuildContext context) {
32 | return Scaffold(
33 | body: Center(
34 | child: Padding(
35 | padding: EdgeInsets.all(20),
36 | child: GestureDetector(
37 | onTap: () {
38 | setState(() {
39 | isExpanded = !isExpanded;
40 | if (isExpanded) {
41 | _animationController.reverse();
42 | } else {
43 | _animationController.forward();
44 | }
45 | });
46 | },
47 | child: Stack(
48 | children: [
49 | AnimatedBuilder(
50 | animation: _animationController,
51 | builder: (context, child) {
52 | return AnimatedOpacity(
53 | opacity: isExpanded ? 1 : 0,
54 | duration: Duration(milliseconds: 600),
55 | child: Transform(
56 | transform: Matrix4.rotationX(
57 | _transfromAnimationOne.value * 1.65),
58 | child: Container(
59 | margin: EdgeInsets.all(12),
60 | height: 200,
61 | color: Colors.pink,
62 | ),
63 | ),
64 | );
65 | }),
66 | AnimatedBuilder(
67 | animation: _animationController,
68 | builder: (context, child) {
69 | return AnimatedOpacity(
70 | opacity: isExpanded ? 0 : 1,
71 | duration: Duration(milliseconds: 600),
72 | child: Transform(
73 | transform: Matrix4.rotationX(
74 | _transfromAnimationTwo.value * 1.5708),
75 | child: Container(
76 | margin: EdgeInsets.all(12),
77 | height: 400,
78 | color: Colors.pink,
79 | child: Column(
80 | children: [
81 | Image.asset('assets/dev.png'),
82 | _rowItem(Image.asset('assets/github.p'),
83 | 'http/ihaoi-aga/dgad'),
84 | _rowItem(Image.asset('assets/github.p'),
85 | 'http/ihaoi-aga/dgad'),
86 | ],
87 | ),
88 | ),
89 | ),
90 | );
91 | }),
92 | ],
93 | ),
94 | ),
95 | ),
96 | ),
97 | );
98 | }
99 |
100 | Widget _rowItem(Image icon, String url) {
101 | return Padding(
102 | padding: EdgeInsets.only(left: 12, right: 12, top: 6),
103 | child: Row(
104 | children: [
105 | SizedBox(width: 24, height: 24, child: icon),
106 | const SizedBox(width: 3),
107 | Flexible(
108 | flex: 1,
109 | child: Text(
110 | url,
111 | style:
112 | TextStyle(color: Colors.white, fontWeight: FontWeight.w500),
113 | ),
114 | ),
115 | ],
116 | ),
117 | );
118 | }
119 | }
120 |
--------------------------------------------------------------------------------
/lib/components/custom_animated_crousel_scroll.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 |
3 | class CustomAnimatedCrouselScroll extends StatefulWidget {
4 | const CustomAnimatedCrouselScroll({super.key});
5 |
6 | @override
7 | State createState() =>
8 | _CustomAnimatedCrouselScrollState();
9 | }
10 |
11 | class _CustomAnimatedCrouselScrollState
12 | extends State {
13 | int _currentIndex = 2;
14 |
15 | @override
16 | Widget build(BuildContext context) {
17 | return Scaffold(
18 | appBar: AppBar(
19 | title: const Text('Custom Carousel Scroll'),
20 | centerTitle: true,
21 | ),
22 | body: Center(
23 | child: Container(
24 | padding: const EdgeInsets.all(2),
25 | child: Row(
26 | mainAxisAlignment: MainAxisAlignment.center,
27 | children: [
28 | _containeredImage(0, 'assets/mountain.jpg'),
29 | _containeredImage(1, 'assets/mountain1.jpg'),
30 | _containeredImage(2, 'assets/mountain2.jpg'),
31 | _containeredImage(3, 'assets/mountain3.jpg'),
32 | _containeredImage(4, 'assets/mountain4.jpg'),
33 | ],
34 | ),
35 | ),
36 | ),
37 | );
38 | }
39 |
40 | Widget _containeredImage(int thisIndex, String image) {
41 | bool isSelected = _currentIndex == thisIndex;
42 |
43 | return GestureDetector(
44 | onTap: () {
45 | setState(() {
46 | _currentIndex = thisIndex;
47 | });
48 | },
49 | child: AnimatedOpacity(
50 | opacity: _currentIndex == thisIndex ? 1 : 0.5,
51 | duration: Duration(milliseconds: 600),
52 | child: AnimatedContainer(
53 | duration: const Duration(milliseconds: 600),
54 | width: isSelected ? 180 : 30,
55 | height: 200,
56 | margin: const EdgeInsets.all(3.5),
57 | decoration: BoxDecoration(
58 | borderRadius: BorderRadius.circular(12),
59 | color: Colors.white10,
60 | ),
61 | child: ClipRRect(
62 | borderRadius: BorderRadius.circular(12),
63 | child: Image.asset(
64 | image,
65 | fit: BoxFit.cover,
66 | ),
67 | ),
68 | ),
69 | ),
70 | );
71 | }
72 | }
73 |
--------------------------------------------------------------------------------
/lib/components/custom_animated_image_shile_show.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 | import 'package:flutter_image_slideshow/flutter_image_slideshow.dart';
3 |
4 | class CustomAnimatedImageShileShow extends StatelessWidget {
5 | List images = [
6 | Image.asset('assets/mountain.jpg', fit: BoxFit.cover),
7 | Image.asset('assets/mountain1.jpg', fit: BoxFit.cover),
8 | Image.asset(
9 | 'assets/mountain2.jpg',
10 | fit: BoxFit.cover,
11 | ),
12 | Image.asset(
13 | 'assets/mountain3.jpg',
14 | fit: BoxFit.cover,
15 | ),
16 | Image.asset(
17 | 'assets/mountain4.jpg',
18 | fit: BoxFit.cover,
19 | ),
20 | ];
21 |
22 | @override
23 | Widget build(BuildContext context) {
24 | return Scaffold(
25 | body: Center(
26 | child: ImageSlideshow(
27 | width: 300,
28 | height: 200,
29 | autoPlayInterval: 3000,
30 | indicatorColor: Colors.amber,
31 | children: List.generate(
32 | 4,
33 | (index) {
34 | return Padding(
35 | padding: const EdgeInsets.symmetric(horizontal: 4),
36 | child: images[index]);
37 | },
38 | ),
39 | ),
40 | ),
41 | );
42 | }
43 | }
44 |
--------------------------------------------------------------------------------
/lib/components/custom_animated_paralele_effect.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 |
3 | class CustomAnimatedParallelEffect extends StatefulWidget {
4 | const CustomAnimatedParallelEffect({super.key});
5 |
6 | @override
7 | State createState() =>
8 | _CustomAnimatedParallelEffectState();
9 | }
10 |
11 | class _CustomAnimatedParallelEffectState
12 | extends State {
13 | PageController pageController = PageController(viewportFraction: 0.6);
14 |
15 | double pageOffSet = 0;
16 | @override
17 | void initState() {
18 | super.initState();
19 | pageController.addListener(() {
20 | setState(() {
21 | pageOffSet = pageController.page!;
22 | });
23 | debugPrint(pageOffSet.toString());
24 | });
25 | }
26 |
27 | @override
28 | void dispose() {
29 | super.dispose();
30 | pageController.dispose();
31 | }
32 |
33 | final List _items = [
34 | ParallexModel(image: 'assets/mountain1.jpg', title: 'Mountain 1'),
35 | ParallexModel(image: 'assets/mountain2.jpg', title: 'Mountain 2'),
36 | ParallexModel(image: 'assets/mountain3.jpg', title: 'Mountain 3'),
37 | ParallexModel(image: 'assets/mountain4.jpg', title: 'Mountain 4'),
38 | ];
39 | @override
40 | Widget build(BuildContext context) {
41 | return Scaffold(
42 | appBar: AppBar(
43 | title: const Text('Custom Parallel Effect'),
44 | centerTitle: true,
45 | ),
46 | body: Center(
47 | child: SizedBox(
48 | height: 300,
49 | child: PageView.builder(
50 | controller: pageController,
51 | itemCount: _items.length,
52 | itemBuilder: (context, index) {
53 | List _showItem = _items;
54 | debugPrint("${-pageOffSet.abs() + index}");
55 | return Padding(
56 | padding: const EdgeInsets.all(8.0),
57 | child: Stack(
58 | children: [
59 | ClipRRect(
60 | borderRadius: BorderRadius.circular(16),
61 | child: SizedBox(
62 | height: 300,
63 | width: 300,
64 | child: Image.asset(
65 | '${_showItem[index].image}',
66 | fit: BoxFit.cover,
67 | alignment: Alignment(-pageOffSet.abs() + index, 0),
68 | ),
69 | ),
70 | ),
71 | Positioned(
72 | bottom: 20,
73 | child: Padding(
74 | padding: const EdgeInsets.all(15),
75 | child: Text(
76 | '${_showItem[index].title}',
77 | style: const TextStyle(
78 | color: Colors.white,
79 | fontSize: 22,
80 | fontWeight: FontWeight.bold),
81 | ),
82 | ))
83 | ],
84 | ),
85 | );
86 | }),
87 | ),
88 | ),
89 | );
90 | }
91 | }
92 |
93 | class ParallexModel {
94 | String? image;
95 | String? title;
96 |
97 | ParallexModel({required this.image, required this.title});
98 | }
99 |
--------------------------------------------------------------------------------
/lib/components/custom_circular_progress_indicator.dart:
--------------------------------------------------------------------------------
1 | // ignore_for_file: must_be_immutable
2 |
3 | import 'dart:async';
4 |
5 | import 'package:flutter/material.dart';
6 |
7 | class CustomCircularProgressIndicator extends StatefulWidget {
8 | double progressValue;
9 | CustomCircularProgressIndicator({required this.progressValue});
10 | @override
11 | State createState() =>
12 | _CustomCircularProgressIndicatorState();
13 | }
14 |
15 | class _CustomCircularProgressIndicatorState
16 | extends State
17 | with TickerProviderStateMixin {
18 | late AnimationController _animationController;
19 |
20 | late Animation _animation;
21 | late Animation _colorAnimation;
22 |
23 | bool isClicked = false;
24 |
25 | List _colors = [
26 | Colors.green,
27 | Colors.amber,
28 | Colors.blue,
29 | Colors.red,
30 | ];
31 | int _colorIndex = 0;
32 |
33 | @override
34 | void initState() {
35 | _animationController = AnimationController(
36 | vsync: this,
37 | duration: Duration(milliseconds: 1000),
38 | );
39 |
40 | _animation = Tween(begin: 0.0, end: widget.progressValue).animate(
41 | CurvedAnimation(parent: _animationController, curve: Curves.easeInOut),
42 | );
43 |
44 | _colorAnimation = ColorTween(begin: _colors[0], end: _colors[3]).animate(
45 | CurvedAnimation(parent: _animationController, curve: Curves.easeInOut)
46 | ..addListener(() {
47 | setState(() {});
48 | }));
49 |
50 | super.initState();
51 | }
52 |
53 | @override
54 | void dispose() {
55 | super.dispose();
56 | _animationController.dispose();
57 | }
58 |
59 | @override
60 | Widget build(BuildContext context) {
61 | return Scaffold(
62 | body: Center(
63 | child: AnimatedBuilder(
64 | animation: _animation,
65 | builder: (context, child) {
66 | return Stack(
67 | alignment: Alignment.center,
68 | children: [
69 | SizedBox(
70 | width: 200,
71 | height: 200,
72 | child: CircularProgressIndicator(
73 | value: _animation.value,
74 | backgroundColor: Colors.white10,
75 | strokeWidth: 12,
76 | valueColor: _colorAnimation,
77 | ),
78 | ),
79 | Text(
80 | '${(_animation.value * 100).toStringAsFixed(0)}%',
81 | style: const TextStyle(
82 | fontSize: 16,
83 | fontWeight: FontWeight.bold,
84 | ),
85 | softWrap: true,
86 | ),
87 | ],
88 | );
89 | })),
90 | floatingActionButton: FloatingActionButton(
91 | onPressed: () {
92 | setState(() {
93 | isClicked = !isClicked;
94 | if (isClicked) {
95 | Timer(Duration(milliseconds: 800), () {
96 | _colorIndex = (_colorIndex + 1) % _colors.length;
97 | _colorAnimation = ColorTween(
98 | begin: _colorAnimation.value,
99 | end: _colors[_colorIndex],
100 | ).animate(
101 | CurvedAnimation(
102 | parent: _animationController,
103 | curve: Curves.easeInOut,
104 | ),
105 | );
106 | _animationController.forward();
107 | });
108 | } else {
109 | Timer(Duration(milliseconds: 800), () {
110 | _colorIndex = (_colorIndex + 1) % _colors.length;
111 | _colorAnimation = ColorTween(
112 | begin: _colorAnimation.value,
113 | end: _colors[_colorIndex],
114 | ).animate(
115 | CurvedAnimation(
116 | parent: _animationController,
117 | curve: Curves.easeInOut,
118 | ),
119 | );
120 | _animationController.reverse();
121 | });
122 | }
123 | });
124 | },
125 | child: Icon(Icons.ads_click),
126 | ),
127 | );
128 | }
129 | }
130 |
--------------------------------------------------------------------------------
/lib/components/custom_designed_animated_onboard_screen.dart:
--------------------------------------------------------------------------------
1 | import 'dart:ui';
2 |
3 | import 'package:flutter/material.dart';
4 |
5 | class CustomDesignedAnimatedOnboardScreen extends StatefulWidget {
6 | const CustomDesignedAnimatedOnboardScreen({super.key});
7 |
8 | @override
9 | State createState() =>
10 | _CustomDesignedAnimatedOnboardScreenState();
11 | }
12 |
13 | class _CustomDesignedAnimatedOnboardScreenState
14 | extends State {
15 | @override
16 | Widget build(BuildContext context) {
17 | return Scaffold(
18 | body: Stack(
19 | clipBehavior: Clip.none,
20 | children: [
21 | Container(
22 | width: MediaQuery.of(context).size.width,
23 | height: MediaQuery.of(context).size.height,
24 | color: Colors.white12,
25 | ),
26 | ClipPath(
27 | clipper: CustomShapeClipper(),
28 | child: Container(
29 | width: MediaQuery.of(context).size.width,
30 | height: MediaQuery.of(context).size.height * 0.5, // Adjusted height
31 | decoration: BoxDecoration(
32 | color: Colors.black12,
33 | image: DecorationImage(
34 | image: AssetImage('assets/travelerImage1.jpg'),
35 | fit: BoxFit.cover,
36 | alignment: Alignment.center, // Centering the image
37 | ),
38 | ),
39 | ),
40 | ),
41 | ],
42 | ),
43 | );
44 | }
45 | }
46 |
47 | class CustomShapeClipper extends CustomClipper {
48 | @override
49 | Path getClip(Size size) {
50 | Path path = Path();
51 | path.moveTo(size.width * 0.0059524, size.height * 0.0028571);
52 | path.quadraticBezierTo(size.width * -0.0059524, size.height * 0.4414286, 0,
53 | size.height * 0.5414286);
54 | path.cubicTo(
55 | size.width * 0.0401786,
56 | size.height * 0.5667857,
57 | size.width * 0.1078869,
58 | size.height * 0.5900000,
59 | size.width * 0.1488095,
60 | size.height * 0.5928571);
61 | path.cubicTo(
62 | size.width * 0.1971726,
63 | size.height * 0.5896429,
64 | size.width * 0.2611607,
65 | size.height * 0.5532143,
66 | size.width * 0.3184524,
67 | size.height * 0.5471429);
68 | path.cubicTo(
69 | size.width * 0.3742560,
70 | size.height * 0.5414286,
71 | size.width * 0.4345238,
72 | size.height * 0.6025000,
73 | size.width * 0.5148810,
74 | size.height * 0.6014286);
75 | path.cubicTo(
76 | size.width * 0.6026786,
77 | size.height * 0.5985714,
78 | size.width * 0.6279762,
79 | size.height * 0.5328571,
80 | size.width * 0.6964286,
81 | size.height * 0.5328571);
82 | path.cubicTo(
83 | size.width * 0.7552083,
84 | size.height * 0.5275000,
85 | size.width * 0.7790179,
86 | size.height * 0.5571429,
87 | size.width * 0.8125000,
88 | size.height * 0.5728571);
89 | path.quadraticBezierTo(size.width * 0.8668155, size.height * 0.5975000,
90 | size.width * 0.9434524, size.height * 0.5428571);
91 | path.lineTo(size.width * 0.9970238, size.height * 0.4871429);
92 | path.lineTo(size.width * 0.9940476, size.height * 0.0028571);
93 | path.close();
94 | return path;
95 | }
96 |
97 | @override
98 | bool shouldReclip(CustomClipper oldClipper) => false;
99 | }
100 |
--------------------------------------------------------------------------------
/lib/components/custom_instagram_like_button.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 |
3 | class ShowLike extends StatefulWidget {
4 | const ShowLike({super.key});
5 |
6 | @override
7 | State createState() => _ShowLikeState();
8 | }
9 |
10 | class _ShowLikeState extends State with TickerProviderStateMixin {
11 | late AnimationController _animationController;
12 | late Animation _likeAnimation;
13 |
14 | @override
15 | void initState() {
16 | super.initState();
17 |
18 | _animationController = AnimationController(
19 | vsync: this,
20 | duration: const Duration(milliseconds: 1500),
21 | );
22 |
23 | _likeAnimation = Tween(begin: 24, end: 100).animate(
24 | CurvedAnimation(
25 | parent: _animationController,
26 | curve: Curves.bounceOut,
27 | ),
28 | );
29 |
30 | // Start the animation immediately
31 | _animationController.forward().whenComplete(() {
32 | _animationController.reverse();
33 | });
34 | }
35 |
36 | @override
37 | void dispose() {
38 | _animationController.dispose();
39 | super.dispose();
40 | }
41 |
42 | @override
43 | Widget build(BuildContext context) {
44 | return Material(
45 | color: Colors.transparent,
46 | child: Center(
47 | child: AnimatedBuilder(
48 | animation: _likeAnimation,
49 | builder: (context, child) {
50 | return Icon(
51 | Icons.favorite,
52 | size: _likeAnimation.value,
53 | color: Colors.redAccent,
54 | );
55 | },
56 | ),
57 | ),
58 | );
59 | }
60 | }
61 |
62 | class LikeButton {
63 | static OverlayEntry? overlayEntry;
64 |
65 | static void showLike(BuildContext context) {
66 | final overlay = Overlay.of(context);
67 |
68 | overlayEntry = OverlayEntry(
69 | builder: (context) {
70 | return ShowLike();
71 | },
72 | );
73 | overlay.insert(overlayEntry!);
74 | Future.delayed(const Duration(seconds: 2), () {
75 | overlayEntry?.remove();
76 | });
77 | }
78 | }
79 |
80 | class CustomInstagramLikeButton extends StatelessWidget {
81 | const CustomInstagramLikeButton({super.key});
82 |
83 | @override
84 | Widget build(BuildContext context) {
85 | return Scaffold(
86 | body: GestureDetector(
87 | onDoubleTap: () {
88 | LikeButton.showLike(context);
89 | },
90 | child: Container(
91 | width: double.infinity,
92 | height: double.infinity,
93 | color: Colors.white10,
94 | child: Center(
95 | child: IconButton(
96 | onPressed: () {
97 | LikeButton.showLike(context);
98 | },
99 | icon: const Icon(Icons.favorite_outline),
100 | ),
101 | ),
102 | ),
103 | ),
104 | );
105 | }
106 | }
107 |
--------------------------------------------------------------------------------
/lib/components/custom_like_button.dart:
--------------------------------------------------------------------------------
1 | import 'package:animated_react_button/animated_react_button.dart';
2 | import 'package:flutter/material.dart';
3 |
4 | class CustomLikeButton extends StatefulWidget {
5 | const CustomLikeButton({super.key});
6 |
7 | @override
8 | State createState() => _CustomLikeButtonState();
9 | }
10 |
11 | class _CustomLikeButtonState extends State {
12 | @override
13 | Widget build(BuildContext context) {
14 | return Scaffold(
15 | body: Center(
16 | child: AnimatedReactButton(
17 | defaultColor: Colors.grey,
18 | reactColor: Colors.red,
19 | iconSize: 45,
20 | onPressed: () async {
21 | await Future.delayed(Duration(seconds: 1));
22 | })),
23 | );
24 | }
25 | }
26 |
--------------------------------------------------------------------------------
/lib/components/custom_otp_field.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/cupertino.dart';
2 | import 'package:flutter/material.dart';
3 | import 'package:flutter/services.dart';
4 |
5 | class CustomOtpField extends StatefulWidget {
6 | const CustomOtpField({super.key});
7 |
8 | @override
9 | State createState() => _CustomOtpFieldState();
10 | }
11 |
12 | class _CustomOtpFieldState extends State {
13 | late List _controller;
14 | late List _focuNode;
15 |
16 | @override
17 | void initState() {
18 | _controller = List.generate(4, (_) => TextEditingController());
19 | _focuNode = List.generate(4, (_) => FocusNode());
20 | super.initState();
21 | }
22 |
23 | @override
24 | void dispose() {
25 | _controller = List.generate(4, (_) => TextEditingController());
26 | _focuNode = List.generate(4, (_) => FocusNode());
27 | super.dispose();
28 | }
29 |
30 | @override
31 | Widget build(BuildContext context) {
32 | return Scaffold(
33 | resizeToAvoidBottomInset: false,
34 | body: Center(
35 | child: Row(
36 | mainAxisAlignment: MainAxisAlignment.center,
37 | crossAxisAlignment: CrossAxisAlignment.center,
38 | children: List.generate(
39 | 4,
40 | (index) => _otpField(
41 | _controller[index],
42 | _focuNode[index],
43 | index,
44 | ),
45 | ),
46 | ),
47 | ),
48 | );
49 | }
50 |
51 | Widget _otpField(
52 | TextEditingController controller, FocusNode focusNode, int index) {
53 | return Container(
54 | width: 60,
55 | height: 60,
56 | alignment: Alignment.center,
57 | margin: const EdgeInsets.all(5),
58 | decoration: BoxDecoration(
59 | borderRadius: BorderRadius.circular(12),
60 | color: Colors.white10,
61 | ),
62 | child: TextField(
63 | controller: controller,
64 | keyboardType: TextInputType.number,
65 | focusNode: focusNode,
66 | maxLength: 1,
67 | style: TextStyle(color: Colors.white),
68 | textAlign: TextAlign.center,
69 | maxLengthEnforcement: MaxLengthEnforcement.truncateAfterCompositionEnds,
70 | decoration: const InputDecoration(
71 | border: InputBorder.none,
72 | counterText: '',
73 | focusedBorder: OutlineInputBorder(
74 | borderSide: BorderSide(color: Colors.blueAccent),
75 | borderRadius: BorderRadius.all(
76 | Radius.circular(12),
77 | ),
78 | ),
79 | errorBorder: OutlineInputBorder(
80 | borderSide: BorderSide(color: Colors.redAccent),
81 | borderRadius: BorderRadius.all(
82 | Radius.circular(12),
83 | ),
84 | ),
85 | ),
86 | onChanged: (value) {
87 | if (value.isNotEmpty) {
88 | int _index = _controller.indexOf(controller) + 1;
89 | if (_index < _controller.length) {
90 | FocusScope.of(context).requestFocus(_focuNode[_index]);
91 | }
92 | } else {
93 | if (index > 0) {
94 | FocusScope.of(context).requestFocus(_focuNode[index - 1]);
95 | }
96 | }
97 | },
98 | ),
99 | );
100 | }
101 | }
102 |
--------------------------------------------------------------------------------
/lib/components/custom_second_bottom_nav_bar.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 |
3 | class BottomNavCustomTabView extends StatefulWidget {
4 | const BottomNavCustomTabView({super.key});
5 |
6 | @override
7 | State createState() => _BottomNavCustomTabViewState();
8 | }
9 |
10 | class _BottomNavCustomTabViewState extends State {
11 | int _currentIndex = 0;
12 | void checkItem(index) {
13 | setState(() {
14 | _currentIndex = index;
15 | });
16 | }
17 |
18 | @override
19 | Widget build(BuildContext context) {
20 | return Scaffold(
21 | body: AnimatedContainer(
22 | duration: Duration(milliseconds: 400),
23 | child: Pages[_currentIndex],
24 | ),
25 | bottomNavigationBar: Container(
26 | width: MediaQuery.of(context).size.width,
27 | height: 90,
28 | child: BottomAppBar(
29 | color: Colors.grey.withOpacity(0.5),
30 | child: Row(
31 | mainAxisAlignment: MainAxisAlignment.spaceAround,
32 | children: [
33 | _columnItem(0, Icons.home),
34 | _columnItem(1, Icons.inbox),
35 | _columnItem(2, Icons.settings),
36 | _columnItem(3, Icons.person),
37 | ],
38 | ),
39 | ),
40 | ),
41 | );
42 | }
43 |
44 | Widget _columnItem(int thisIndex, IconData icon) {
45 | return Stack(
46 | children: [
47 | Column(
48 | children: [
49 | IconButton(
50 | onPressed: () {
51 | checkItem(thisIndex);
52 | },
53 | icon: Icon(icon),
54 | ),
55 | AnimatedContainer(
56 | duration: Duration(milliseconds: 500),
57 | alignment: Alignment.centerLeft,
58 | width: 60,
59 | height: 3,
60 | color: _currentIndex == thisIndex
61 | ? Colors.pinkAccent
62 | : Colors.transparent,
63 | ),
64 | ],
65 | ),
66 | Visibility(
67 | visible: _currentIndex == thisIndex ? true : false,
68 | child: Positioned(
69 | bottom: 15,
70 | child: Opacity(
71 | opacity: 0.4,
72 | child: AnimatedContainer(
73 | duration: Duration(milliseconds: 500),
74 | width: 60,
75 | height: 80,
76 | decoration: BoxDecoration(
77 | borderRadius: BorderRadius.only(
78 | topLeft: Radius.circular(12),
79 | topRight: Radius.circular(12),
80 | ),
81 | gradient: LinearGradient(
82 | colors: [
83 | Colors.white,
84 | Colors.pinkAccent,
85 | ],
86 | begin: Alignment.topCenter,
87 | end: Alignment.bottomCenter,
88 | ),
89 | ),
90 | ),
91 | ),
92 | ),
93 | ),
94 | ],
95 | );
96 | }
97 | }
98 |
99 | List Pages = [
100 | Container(
101 | alignment: Alignment.center,
102 | child: Text("1"),
103 | ),
104 | Container(
105 | alignment: Alignment.center,
106 | child: Text("2"),
107 | ),
108 | Container(
109 | alignment: Alignment.center,
110 | child: Text("3"),
111 | ),
112 | Container(
113 | alignment: Alignment.center,
114 | child: Text("4"),
115 | ),
116 | ];
117 |
--------------------------------------------------------------------------------
/lib/components/custom_shimmer_effect.dart:
--------------------------------------------------------------------------------
1 | import 'dart:async';
2 |
3 | import 'package:flutter/material.dart';
4 |
5 | class CustomShimmerEffect extends StatefulWidget {
6 | const CustomShimmerEffect({super.key});
7 |
8 | @override
9 | State createState() => _CustomShimmerEffectState();
10 | }
11 |
12 | class _CustomShimmerEffectState extends State
13 | with SingleTickerProviderStateMixin {
14 | Color mainColor = Colors.white60;
15 | List colors = [
16 | Colors.white60,
17 | // Colors.white38,
18 | Colors.white24,
19 | ];
20 | int _colorIndex = 0;
21 | Timer? timer;
22 |
23 | late AnimationController _animationController;
24 | late Animation _colorAnimation;
25 |
26 | @override
27 | void initState() {
28 | _animationController = AnimationController(
29 | vsync: this,
30 | duration: Duration(milliseconds: 800),
31 | );
32 |
33 | _colorAnimation = ColorTween(
34 | begin: colors[0],
35 | end: colors[1],
36 | ).animate(
37 | CurvedAnimation(
38 | parent: _animationController,
39 | curve: Curves.easeInOut,
40 | ),
41 | )..addListener(() {
42 | setState(() {});
43 | });
44 |
45 | timer = Timer.periodic(Duration(milliseconds: 800), (Timer timer) {
46 | setState(() {
47 | _colorIndex = (_colorIndex + 1) % colors.length;
48 | _colorAnimation = ColorTween(
49 | begin: _colorAnimation.value,
50 | end: colors[_colorIndex],
51 | ).animate(
52 | CurvedAnimation(
53 | parent: _animationController,
54 | curve: Curves.easeInOut,
55 | ),
56 | );
57 | _animationController.forward(from: 0.0);
58 | });
59 | });
60 |
61 | _animationController.repeat(reverse: true);
62 |
63 | super.initState();
64 | }
65 |
66 | @override
67 | Widget build(BuildContext context) {
68 | return Scaffold(
69 | body: Column(
70 | mainAxisAlignment: MainAxisAlignment.center,
71 | crossAxisAlignment: CrossAxisAlignment.center,
72 | children: [
73 | Stack(
74 | children: [
75 | _container(
76 | 330,
77 | 350,
78 | mainColor,
79 | ),
80 | ListTile(
81 | leading: _container(60, 60, _colorAnimation.value ?? mainColor),
82 | title: _container(60, 20, _colorAnimation.value ?? mainColor),
83 | trailing:
84 | _container(30, 30, _colorAnimation.value ?? mainColor),
85 | subtitle:
86 | _container(60, 10, _colorAnimation.value ?? mainColor),
87 | ),
88 | Positioned(
89 | top: 80,
90 | left: 20,
91 | child:
92 | _container(300, 260, _colorAnimation.value ?? mainColor)),
93 | ],
94 | ),
95 | ],
96 | ),
97 | );
98 | }
99 |
100 | Widget _container(double width, double height, Color color) {
101 | return Container(
102 | width: width,
103 | height: height,
104 | color: color,
105 | );
106 | }
107 | }
108 |
--------------------------------------------------------------------------------
/lib/components/custom_tab_controller.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/cupertino.dart';
2 | import 'package:flutter/material.dart';
3 |
4 | class CustomTabController extends StatefulWidget {
5 | @override
6 | State createState() => _CustomTabControllerState();
7 | }
8 |
9 | class _CustomTabControllerState extends State {
10 | int _currentIndex = 0;
11 | PageController _pageController = PageController();
12 | Color mainColor = Color(0xFF8C6EC4);
13 |
14 | @override
15 | Widget build(BuildContext context) {
16 | return Scaffold(
17 | body: Column(
18 | children: [
19 | const SizedBox(
20 | height: 25,
21 | ),
22 | Container(
23 | height: 120,
24 | margin: EdgeInsets.all(12),
25 | width: MediaQuery.of(context).size.width,
26 | child: Row(
27 | mainAxisAlignment: MainAxisAlignment.spaceEvenly,
28 | children: [
29 | _tabBars('Home', 0),
30 | _tabBars('Status', 1),
31 | _tabBars('Group', 2),
32 | _tabBars('Calls', 3),
33 | ],
34 | ),
35 | ),
36 | Expanded(
37 | child: SizedBox(
38 | child: PageView.builder(
39 | controller: _pageController,
40 | itemCount: itemPage.length,
41 | itemBuilder: (context, index) {
42 | return itemPage[index];
43 | },
44 | onPageChanged: (value) {
45 | setState(() {
46 | _currentIndex = value;
47 | });
48 | },
49 | ),
50 | ),
51 | ),
52 | ],
53 | ));
54 | }
55 |
56 | List get itemPage {
57 | return [
58 | _items('assets/Logo.png'),
59 | _items('assets/Logo.png'),
60 | _items('assets/Logo.png'),
61 | _items('assets/Logo.png'),
62 | ];
63 | }
64 |
65 | // tab bars
66 | Widget _tabBars(String text, int thisIndex) {
67 | return Column(
68 | children: [
69 | GestureDetector(
70 | onTap: () {
71 | _pageController.animateToPage(
72 | thisIndex,
73 | duration: Duration(milliseconds: 500),
74 | curve: Curves.easeIn,
75 | );
76 | setState(() {
77 | _currentIndex = thisIndex;
78 | });
79 | },
80 | child: Container(
81 | padding: EdgeInsets.only(left: 10, top: 10, right: 10),
82 | child: Text(
83 | '$text',
84 | style: const TextStyle(
85 | fontSize: 18,
86 | fontWeight: FontWeight.w500,
87 | ),
88 | ),
89 | ),
90 | ),
91 | AnimatedSize(
92 | duration: Duration(milliseconds: 500),
93 | curve: Curves.easeInOut,
94 | child: Container(
95 | width: _currentIndex == thisIndex ? 60 : 0,
96 | height: 4,
97 | decoration: BoxDecoration(
98 | borderRadius: BorderRadius.circular(8), color: mainColor),
99 | ),
100 | ),
101 | ],
102 | );
103 | }
104 |
105 | // page items
106 | Widget _items(String image) {
107 | return SizedBox(
108 | width: 300,
109 | height: 300,
110 | child: ClipRRect(
111 | borderRadius: BorderRadius.circular(8),
112 | child: Image.asset('$image'),
113 | ),
114 | );
115 | }
116 | }
117 |
--------------------------------------------------------------------------------
/lib/components/edit_custom_animated_scroll_view.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 |
3 | class CustomAnimatedScrollView extends StatelessWidget {
4 | const CustomAnimatedScrollView({super.key});
5 |
6 | @override
7 | Widget build(BuildContext context) {
8 | return Scaffold(
9 | appBar: AppBar(),
10 | body: Row(
11 | mainAxisAlignment: MainAxisAlignment.center,
12 | children: [
13 | Container(
14 | width: MediaQuery.of(context).size.width / 1.1,
15 | height: MediaQuery.of(context).size.height / 1.2,
16 | child: SizedBox(
17 | width: MediaQuery.of(context).size.width / 1.1,
18 | height: MediaQuery.of(context).size.height / 3,
19 | child: ListWheelScrollView(itemExtent: 100, children: [
20 | Container(
21 | color: Colors.amber,
22 | ),
23 | Container(
24 | color: Colors.redAccent,
25 | ),
26 | Container(
27 | color: Colors.blue,
28 | ),
29 | Container(
30 | color: Colors.green,
31 | ),
32 | Container(
33 | color: Colors.yellow,
34 | ),
35 | ]),
36 | ),
37 | )
38 | ],
39 | ),
40 | );
41 | }
42 | }
--------------------------------------------------------------------------------
/lib/components/email_validation_form.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 |
3 | class EmailValidationForm extends StatefulWidget {
4 | @override
5 | _EmailValidationFormState createState() => _EmailValidationFormState();
6 | }
7 |
8 | class _EmailValidationFormState extends State {
9 | final _formKey = GlobalKey();
10 | final _emailController = TextEditingController();
11 | Color borderColor = Colors.grey; // Initial border color
12 |
13 | // Email Regular Expression
14 | String emailPattern =
15 | r'^[a-zA-Z0-9.!#$%&*+/=?^_`{|}~-]+@[a-zA-Z0-9-]+(?:\.[a-zA-Z0-9-]+)*$';
16 |
17 | @override
18 | Widget build(BuildContext context) {
19 | return Scaffold(
20 | resizeToAvoidBottomInset: false,
21 | appBar: AppBar(
22 | title: Text('Email Validation '),
23 | ),
24 | body: Padding(
25 | padding: const EdgeInsets.all(16.0),
26 | child: Form(
27 | key: _formKey,
28 | child: Column(
29 | mainAxisAlignment: MainAxisAlignment.center,
30 | children: [
31 | TextFormField(
32 | controller: _emailController,
33 | decoration: InputDecoration(
34 | labelText: 'Email',
35 | border: OutlineInputBorder(),
36 | enabledBorder: OutlineInputBorder(
37 | borderSide: BorderSide(color: borderColor),
38 | ),
39 | focusedBorder: OutlineInputBorder(
40 | borderSide: BorderSide(color: borderColor, width: 2.0),
41 | ),
42 | ),
43 | // Email Validation using RegEx
44 | validator: (value) {
45 | if (value == null || value.isEmpty) {
46 | setState(() {
47 | borderColor = Colors.red; // Set to red when invalid
48 | });
49 | } else if (!RegExp(emailPattern).hasMatch(value)) {
50 | setState(() {
51 | borderColor = Colors.red; // Set to red when invalid
52 | });
53 | return 'Please enter a valid email';
54 | }
55 | setState(() {
56 | borderColor = Colors.green; // Set to green when valid
57 | });
58 | return null;
59 | },
60 | ),
61 | SizedBox(height: 20),
62 | ElevatedButton(
63 | onPressed: () {
64 | if (_formKey.currentState?.validate() ?? false) {
65 | ScaffoldMessenger.of(context).showSnackBar(
66 | SnackBar(content: Text('Email is valid')),
67 | );
68 | }
69 | },
70 | child: Text('Submit'),
71 | ),
72 | ],
73 | ),
74 | ),
75 | ),
76 | );
77 | }
78 | }
79 |
80 | void main() => runApp(MaterialApp(
81 | home: EmailValidationForm(),
82 | ));
83 |
--------------------------------------------------------------------------------
/lib/components/first_contained_bottom_navigation_bar.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 | import 'package:provider/provider.dart';
3 |
4 | class FirstContainedBottomNavigationBar extends StatefulWidget {
5 | const FirstContainedBottomNavigationBar({super.key});
6 |
7 | @override
8 | State createState() =>
9 | _FirstContainedBottomNavigationBarState();
10 | }
11 |
12 | class _FirstContainedBottomNavigationBarState
13 | extends State {
14 | @override
15 | Widget build(BuildContext context) {
16 | final containedProvider =
17 | Provider.of(context);
18 | // list of body
19 | List _bodyItem = [
20 | Container(
21 | alignment: Alignment.center,
22 | width: MediaQuery.of(context).size.width,
23 | height: MediaQuery.of(context).size.height,
24 | child: Icon(
25 | Icons.home_filled,
26 | size: 80,
27 | color: Color(0xff8274FF),
28 | ),
29 | ),
30 | Container(
31 | alignment: Alignment.center,
32 | width: MediaQuery.of(context).size.width,
33 | height: MediaQuery.of(context).size.height,
34 | child: Icon(
35 | Icons.wallet,
36 | size: 80,
37 | color: Color(0xff8274FF),
38 | ),
39 | ),
40 | Container(
41 | alignment: Alignment.center,
42 | width: MediaQuery.of(context).size.width,
43 | height: MediaQuery.of(context).size.height,
44 | child: Icon(
45 | Icons.pie_chart,
46 | size: 80,
47 | color: Color(0xff8274FF),
48 | ),
49 | ),
50 | Container(
51 | alignment: Alignment.center,
52 | width: MediaQuery.of(context).size.width,
53 | height: MediaQuery.of(context).size.height,
54 | child: Icon(
55 | Icons.settings,
56 | size: 80,
57 | color: Color(0xff8274FF),
58 | ),
59 | ),
60 | ];
61 |
62 | // main code
63 | return Scaffold(
64 | body: _bodyItem[containedProvider.currentIndex],
65 | bottomNavigationBar: Container(
66 | width: MediaQuery.of(context).size.width,
67 | height: 80,
68 | child: Row(
69 | mainAxisAlignment: MainAxisAlignment.spaceEvenly,
70 | children: [
71 | _bottomNavItem(0, Icons.home, 'Home'),
72 | _bottomNavItem(1, Icons.wallet, 'Wallet'),
73 | _bottomNavItem(2, Icons.pie_chart, 'Chart'),
74 | _bottomNavItem(3, Icons.settings, 'Seting'),
75 | ],
76 | ),
77 | ),
78 | );
79 | }
80 |
81 | Widget _bottomNavItem(int thisIndex, IconData icon, String data) {
82 | final containedProvider =
83 | Provider.of(context);
84 | return GestureDetector(
85 | onTap: () {
86 | containedProvider.setIndex(thisIndex);
87 | },
88 | child: Container(
89 | width: containedProvider.currentIndex == thisIndex ? 75 : 35,
90 | height: 40,
91 | padding: const EdgeInsets.all(3),
92 | decoration: BoxDecoration(
93 | color: containedProvider.currentIndex == thisIndex
94 | ? const Color(0xff7F71FF).withOpacity(0.15)
95 | : Colors.transparent,
96 | borderRadius: BorderRadius.circular(8),
97 | ),
98 | child: AnimatedOpacity(
99 | opacity: containedProvider.currentIndex == thisIndex ? 1.0 : 0.5,
100 | duration: Duration(milliseconds: 600),
101 | child: Row(
102 | mainAxisAlignment: MainAxisAlignment.spaceAround,
103 | children: [
104 | Icon(
105 | icon,
106 | color: containedProvider.currentIndex == thisIndex
107 | ? Color(0xff8274FF)
108 | : Colors.white70,
109 | ),
110 | Text(
111 | '${containedProvider.currentIndex == thisIndex ? data : ""}',
112 | style: TextStyle(
113 | color: containedProvider.currentIndex == thisIndex
114 | ? Color(0xff8274FF)
115 | : Colors.white70,
116 | fontWeight: FontWeight.w600,
117 | ),
118 | ),
119 | ],
120 | ),
121 | ),
122 | ),
123 | );
124 | }
125 | }
126 |
127 | class FirstContainedBottomNavigationBarProvider with ChangeNotifier {
128 | int _currentIndex = 0;
129 |
130 | int get currentIndex => _currentIndex;
131 |
132 | void setIndex(int index) {
133 | _currentIndex = index;
134 | notifyListeners();
135 | }
136 | }
137 |
--------------------------------------------------------------------------------
/lib/components/page_navigation_animation.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/cupertino.dart';
2 | import 'package:flutter/material.dart';
3 |
4 | class PageNavigationAnimation extends StatelessWidget {
5 | const PageNavigationAnimation({super.key});
6 |
7 | @override
8 | Widget build(BuildContext context) {
9 | return Scaffold(
10 | appBar: AppBar(),
11 | body: Center(
12 | child: Column(
13 | mainAxisAlignment: MainAxisAlignment.center,
14 | children: [
15 | _buttons('Fade Animation Transition', () {
16 | Navigator.push(
17 | context,
18 | _fadeNavigation(
19 | FadeAnimationCheckpage(),
20 | ),
21 | );
22 | }),
23 | _buttons('Scale Animation Transition', () {
24 | Navigator.push(
25 | context,
26 | _scaleNavigation(
27 | ScaleAnimationCheckpage(),
28 | ),
29 | );
30 | }),
31 | _buttons('Scale Animation Transition to Left', () {
32 | Navigator.push(
33 | context,
34 | _slideNavigation(SlideAnimationCheckpage(), -1, 0),
35 | );
36 | }),
37 | _buttons('Scale Animation Transition to Right', () {
38 | Navigator.push(
39 | context,
40 | _slideNavigation(SlideAnimationCheckpage(), 1, 0),
41 | );
42 | }),
43 | ],
44 | ),
45 | ),
46 | );
47 | }
48 |
49 | Widget _buttons(String text, VoidCallback onPress) {
50 | return Padding(
51 | padding: EdgeInsets.all(12),
52 | child: ElevatedButton(
53 | onPressed: onPress,
54 | child: Text('$text'),
55 | ),
56 | );
57 | }
58 | }
59 |
60 | // fade animation check
61 | class FadeAnimationCheckpage extends StatelessWidget {
62 | const FadeAnimationCheckpage({super.key});
63 |
64 | @override
65 | Widget build(BuildContext context) {
66 | return Scaffold(
67 | appBar: AppBar(),
68 | body: Center(
69 | child: Text('Fade Animatin Transition Page'),
70 | ),
71 | );
72 | }
73 | }
74 |
75 | class ScaleAnimationCheckpage extends StatelessWidget {
76 | const ScaleAnimationCheckpage({super.key});
77 |
78 | @override
79 | Widget build(BuildContext context) {
80 | return Scaffold(
81 | appBar: AppBar(),
82 | body: Center(
83 | child: Text('Scale Animation Transition Page'),
84 | ),
85 | );
86 | }
87 | }
88 |
89 | class SlideAnimationCheckpage extends StatelessWidget {
90 | const SlideAnimationCheckpage({super.key});
91 |
92 | @override
93 | Widget build(BuildContext context) {
94 | return Scaffold(
95 | appBar: AppBar(),
96 | body: Center(
97 | child: Text('Slide Animation Transition Page'),
98 | ),
99 | );
100 | }
101 | }
102 |
103 | // animation for page navigation
104 | PageRouteBuilder _fadeNavigation(Widget page) {
105 | return PageRouteBuilder(
106 | pageBuilder: (context, animation, secondryAnimation) {
107 | var tween =
108 | Tween(begin: 0, end: 1).chain(CurveTween(curve: Curves.easeInOut));
109 | var offsetAnimation = animation.drive(tween);
110 |
111 | return FadeTransition(
112 | opacity: animation,
113 | child: page,
114 | );
115 | },
116 | transitionsBuilder: (context, animation, secondaryAnimation, child) {
117 | return FadeTransition(
118 | opacity: animation,
119 | child: child,
120 | );
121 | },
122 | );
123 | }
124 |
125 | PageRouteBuilder _scaleNavigation(Widget page) {
126 | return PageRouteBuilder(
127 | pageBuilder: (context, animation, secondryAnimation) {
128 | var tween =
129 | Tween(begin: 0, end: 2).chain(CurveTween(curve: Curves.easeInOut));
130 | var offsetAnimation = animation.drive(tween);
131 |
132 | return ScaleTransition(
133 | scale: animation,
134 | child: page,
135 | );
136 | },
137 | transitionsBuilder: (context, animation, secondaryAnimation, child) {
138 | return ScaleTransition(
139 | scale: animation,
140 | child: child,
141 | );
142 | },
143 | transitionDuration: Duration(milliseconds: 500),
144 | );
145 | }
146 |
147 | PageRouteBuilder _slideNavigation(Widget page, double begin, double end) {
148 | return PageRouteBuilder(
149 | pageBuilder: (context, animation, secondryAnimation) {
150 | var tween = Tween(begin: Offset(begin, 0), end: Offset(end, 0))
151 | .chain(CurveTween(curve: Curves.easeInOut));
152 | var offsetAnimation = animation.drive(tween);
153 |
154 | return SlideTransition(
155 | position: offsetAnimation,
156 | child: page,
157 | );
158 | },
159 | transitionsBuilder: (context, animation, secondaryAnimation, child) {
160 | return SlideTransition(
161 | position: Tween(begin: Offset(begin, 0), end: Offset(end, 0))
162 | .animate(animation),
163 | child: child,
164 | );
165 | },
166 | transitionDuration: Duration(milliseconds: 800),
167 | );
168 | }
169 |
--------------------------------------------------------------------------------
/lib/components/password_authenticator_field.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 |
3 | class PasswordAuthenticatorField extends StatefulWidget {
4 | @override
5 | State createState() =>
6 | _PasswordAuthenticatorFieldState();
7 | }
8 |
9 | class _PasswordAuthenticatorFieldState
10 | extends State {
11 | final textController = TextEditingController();
12 |
13 | bool isSpecialCharacter = false;
14 | bool isUpperCaseLetter = false;
15 | bool isLengthGood = false;
16 | bool isAnyNumber = false;
17 |
18 | void checkAuth(String value) {
19 | setState(() {
20 | isSpecialCharacter =
21 | value.contains(RegExp(r'[!@#\$%^&*()_+{}\[\]:;"\<>,.?/|\\]'));
22 | isUpperCaseLetter = value.contains(RegExp(r'[A-Z]'));
23 | isAnyNumber = value.contains(RegExp(r'[0-9]'));
24 | isLengthGood = value.length >= 6 && value.length <= 12;
25 | });
26 | }
27 |
28 | @override
29 | Widget build(BuildContext context) {
30 | return Scaffold(
31 | appBar: AppBar(
32 | title: const Text('PasswordAuthenticatorField'),
33 | centerTitle: true,
34 | ),
35 | body: Padding(
36 | padding: EdgeInsets.only(left: 6, right: 6),
37 | child: Center(
38 | child: Column(
39 | mainAxisAlignment: MainAxisAlignment.center,
40 | children: [
41 | SizedBox(
42 | width: MediaQuery.of(context).size.width * 0.9,
43 | height: MediaQuery.of(context).size.height * 0.08,
44 | child: TextField(
45 | controller: textController,
46 | decoration: InputDecoration(
47 | hintText: 'Enter any text',
48 | border: OutlineInputBorder(
49 | borderRadius: BorderRadius.circular(8),
50 | ),
51 | ),
52 | onChanged: checkAuth,
53 | ),
54 | ),
55 | SizedBox(
56 | height: 10,
57 | ),
58 | _rowCheckAuth(
59 | isUpperCaseLetter
60 | ? Icon(
61 | Icons.circle,
62 | color: Colors.amber,
63 | )
64 | : Icon(Icons.circle_outlined),
65 | 'Any upperCase letter',
66 | ),
67 | _rowCheckAuth(
68 | isSpecialCharacter
69 | ? Icon(
70 | Icons.circle,
71 | color: Colors.amber,
72 | )
73 | : Icon(Icons.circle_outlined),
74 | 'Any Special letter',
75 | ),
76 | _rowCheckAuth(
77 | isAnyNumber
78 | ? Icon(
79 | Icons.circle,
80 | color: Colors.amber,
81 | )
82 | : Icon(Icons.circle_outlined),
83 | 'Any number 0-9',
84 | ),
85 | _rowCheckAuth(
86 | isLengthGood
87 | ? Icon(
88 | Icons.circle,
89 | color: Colors.amber,
90 | )
91 | : Icon(Icons.circle_outlined),
92 | 'Length range > 6 and < 12',
93 | ),
94 | ],
95 | ),
96 | ),
97 | ),
98 | );
99 | }
100 |
101 | Widget _rowCheckAuth(Icon icon, String text) {
102 | return Padding(
103 | padding: EdgeInsets.only(
104 | left: MediaQuery.of(context).size.width * 0.2, top: 3),
105 | child: Row(
106 | mainAxisAlignment: MainAxisAlignment.start,
107 | children: [
108 | icon,
109 | SizedBox(
110 | width: 5,
111 | ),
112 | Text('$text'),
113 | ],
114 | ),
115 | );
116 | }
117 | }
118 |
--------------------------------------------------------------------------------
/lib/components/secondContaineredBottomBar.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/cupertino.dart';
2 | import 'package:flutter/material.dart';
3 |
4 | class SecondContaineredBottomBar extends StatefulWidget {
5 | const SecondContaineredBottomBar({super.key});
6 |
7 | @override
8 | State createState() =>
9 | _SecondContaineredBottomBarState();
10 | }
11 |
12 | class _SecondContaineredBottomBarState
13 | extends State {
14 | int _currentIndex = 0;
15 | PageController _pageController = PageController(); // Add PageController
16 |
17 | // Function to set the page using PageController with animation
18 | void setPage(int value) {
19 | setState(() {
20 | _currentIndex = value;
21 | _pageController.animateToPage(
22 | value,
23 | duration:
24 | Duration(milliseconds: 300), // Adjust the duration for smoothness
25 | curve: Curves.easeInOut,
26 | );
27 | });
28 | }
29 |
30 | @override
31 | void dispose() {
32 | _pageController.dispose(); // Dispose of the controller
33 | super.dispose();
34 | }
35 |
36 | @override
37 | Widget build(BuildContext context) {
38 | return Scaffold(
39 | body: Stack(
40 | children: [
41 | // PageView to handle page transitions with swipe and animation
42 | PageView(
43 | controller: _pageController,
44 | onPageChanged: (index) {
45 | setState(() {
46 | _currentIndex = index;
47 | });
48 | },
49 | children: [
50 | Container(
51 | alignment: Alignment.center,
52 | child: Text(
53 | '1',
54 | style: Theme.of(context).textTheme.headlineLarge,
55 | ),
56 | ),
57 | Container(
58 | alignment: Alignment.center,
59 | child: Text(
60 | '2',
61 | style: Theme.of(context).textTheme.headlineLarge,
62 | ),
63 | ),
64 | Container(
65 | alignment: Alignment.center,
66 | child: Text(
67 | '3',
68 | style: Theme.of(context).textTheme.headlineLarge,
69 | ),
70 | ),
71 | Container(
72 | alignment: Alignment.center,
73 | child: Text(
74 | '4',
75 | style: Theme.of(context).textTheme.headlineLarge,
76 | ),
77 | ),
78 | ],
79 | ),
80 | Align(
81 | alignment: Alignment.bottomCenter,
82 | child: Container(
83 | width: MediaQuery.of(context).size.width,
84 | height: 70,
85 | margin: EdgeInsets.all(16),
86 | decoration: BoxDecoration(
87 | color: Colors.black38,
88 | borderRadius: BorderRadius.circular(100),
89 | ),
90 | child: Row(
91 | mainAxisAlignment: MainAxisAlignment.spaceEvenly,
92 | children: [
93 | _bottomNavigationItems(
94 | Icons.home_outlined,
95 | 0,
96 | _currentIndex,
97 | () => setPage(0),
98 | ),
99 | _bottomNavigationItems(
100 | Icons.category_outlined,
101 | 1,
102 | _currentIndex,
103 | () => setPage(1),
104 | ),
105 | _bottomNavigationItems(
106 | Icons.create_outlined,
107 | 2,
108 | _currentIndex,
109 | () => setPage(2),
110 | ),
111 | _bottomNavigationItems(
112 | Icons.person_outline_outlined,
113 | 3,
114 | _currentIndex,
115 | () => setPage(3),
116 | ),
117 | ],
118 | ),
119 | ),
120 | ),
121 | ],
122 | ),
123 | );
124 | }
125 |
126 | // Widget for custom bottom app bar items with animation (Scale and Opacity)
127 | Widget _bottomNavigationItems(
128 | IconData icon, int index, int currentIndex, VoidCallback onPress) {
129 | bool isSelected = currentIndex == index;
130 |
131 | return GestureDetector(
132 | onTap: onPress,
133 | child: AnimatedContainer(
134 | duration: Duration(milliseconds: 300), // Animation duration
135 | width: isSelected ? 70 : 60, // Scale up selected icon
136 | height: 40,
137 | decoration: BoxDecoration(
138 | color: isSelected ? Colors.white : Colors.transparent,
139 | borderRadius: BorderRadius.circular(100),
140 | ),
141 | child: Center(
142 | child: Icon(
143 | icon,
144 | color: isSelected ? Colors.black : Colors.white,
145 | size: isSelected ? 28 : 24, // Increase size for selected icon
146 | ),
147 | ),
148 | ),
149 | );
150 | }
151 | }
152 |
--------------------------------------------------------------------------------
/lib/components/tab_base_navigation.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/gestures.dart';
2 | import 'package:flutter/material.dart';
3 |
4 | class TabBaseNavigation extends StatefulWidget {
5 | const TabBaseNavigation({super.key});
6 |
7 | @override
8 | State createState() => _TabBaseNavigationState();
9 | }
10 |
11 | class _TabBaseNavigationState extends State
12 | with TickerProviderStateMixin {
13 | late AnimationController _animationController;
14 | late Animation _pageAnimation;
15 | late Animation _colorAnimation;
16 |
17 | @override
18 | void initState() {
19 | _animationController =
20 | AnimationController(vsync: this, duration: Duration(milliseconds: 600));
21 | _pageAnimation = Tween(begin: 0, end: 1).animate(
22 | CurvedAnimation(parent: _animationController, curve: Curves.easeInOut),
23 | );
24 |
25 | _colorAnimation =
26 | ColorTween(begin: Colors.black, end: const Color(0xff8274FF)).animate(
27 | CurvedAnimation(parent: _animationController, curve: Curves.easeInOut),
28 | );
29 |
30 | super.initState();
31 | }
32 |
33 | int _currentItem = 0;
34 |
35 | void setItem(index) {
36 | setState(() {
37 | _currentItem = index;
38 | _animationController.reset();
39 | _animationController.forward();
40 | });
41 | }
42 |
43 | @override
44 | void dispose() {
45 | _animationController.dispose();
46 | super.dispose();
47 | }
48 |
49 | @override
50 | Widget build(BuildContext context) {
51 | // List of pages
52 | List pages = [
53 | _buildPage(context, Icons.home_filled),
54 | _buildPage(context, Icons.wallet),
55 | _buildPage(context, Icons.pie_chart),
56 | _buildPage(context, Icons.settings),
57 | ];
58 |
59 | return Scaffold(
60 | appBar: AppBar(),
61 | body: Column(
62 | children: [
63 | SingleChildScrollView(
64 | scrollDirection: Axis.horizontal,
65 | dragStartBehavior: DragStartBehavior.down,
66 | child: Padding(
67 | padding: EdgeInsets.only(left: 10, right: 10),
68 | child: Row(
69 | children: [
70 | _headers(0, 'Home'),
71 | _headers(1, 'Wallet'),
72 | _headers(2, 'Charts'),
73 | _headers(3, 'Setting'),
74 | ],
75 | ),
76 | ),
77 | ),
78 | // Use Expanded to prevent overflow
79 | Expanded(
80 | child: Container(
81 | width: MediaQuery.of(context).size.width,
82 | margin: const EdgeInsets.only(top: 10),
83 | child: FadeTransition(
84 | opacity: _pageAnimation,
85 | child: pages[_currentItem],
86 | ),
87 | ),
88 | ),
89 | ],
90 | ),
91 | );
92 | }
93 |
94 | // pages to show
95 | Widget _buildPage(BuildContext context, IconData icon) {
96 | return Container(
97 | alignment: Alignment.center,
98 | width: MediaQuery.of(context).size.width,
99 | height: MediaQuery.of(context).size.height,
100 | child: Icon(
101 | icon,
102 | size: 80,
103 | color: Color(0xff8274FF),
104 | ),
105 | );
106 | }
107 |
108 | // header bar containing tab
109 | Widget _headers(int index, String text) {
110 | return GestureDetector(
111 | onTap: () {
112 | setItem(index);
113 | },
114 | child: AnimatedBuilder(
115 | animation: _colorAnimation,
116 | builder: (context, child) {
117 | return NavItems(
118 | title: text,
119 | front: _currentItem == index ? Colors.white : Colors.white,
120 | back:
121 | _currentItem == index ? _colorAnimation.value : Colors.black87,
122 | );
123 | },
124 | ),
125 | );
126 | }
127 | }
128 |
129 | // navigation button
130 | class NavItems extends StatelessWidget {
131 | final String title;
132 | final Color? back;
133 | final Color front;
134 | const NavItems({
135 | required this.title,
136 | required this.back,
137 | required this.front,
138 | });
139 |
140 | @override
141 | Widget build(BuildContext context) {
142 | return Container(
143 | alignment: Alignment.center,
144 | height: 45,
145 | width: 100,
146 | margin: const EdgeInsets.only(left: 10),
147 | decoration: BoxDecoration(
148 | borderRadius: BorderRadius.circular(9),
149 | border: Border.all(color: const Color(0xff8274FF).withOpacity(0.5)),
150 | color: back,
151 | ),
152 | child: RichText(
153 | text: TextSpan(
154 | text: title,
155 | style: TextStyle(
156 | color: front,
157 | fontWeight: FontWeight.w600,
158 | ),
159 | ),
160 | ),
161 | );
162 | }
163 | }
164 |
--------------------------------------------------------------------------------
/lib/main.dart:
--------------------------------------------------------------------------------
1 | // ignore_for_file: unused_import
2 |
3 | import 'package:flutter/material.dart';
4 | import 'package:flutter_components/components/custom_animated_crousel_scroll.dart';
5 | import 'package:flutter_components/components/custom_animated_card.dart';
6 | import 'package:flutter_components/components/custom_animated_dialogbox.dart';
7 | import 'package:flutter_components/components/custom_animated_image_shile_show.dart';
8 | import 'package:flutter_components/components/custom_animated_paralele_effect.dart';
9 | import 'package:flutter_components/components/custom_animated_rating_box.dart';
10 | import 'package:flutter_components/components/custom_instagram_like_button.dart';
11 | import 'package:flutter_components/components/edit_custom_animated_scroll_view.dart';
12 | import 'package:flutter_components/components/custom_animated_slide_button.dart';
13 | import 'package:flutter_components/components/custom_animated_snackbar.dart';
14 | import 'package:flutter_components/components/custom_designed_animated_onboard_screen.dart';
15 | import 'package:flutter_components/components/custom_otp_field.dart';
16 | import 'package:flutter_components/components/custom_rolling_animated_switch.dart';
17 | import 'package:flutter_components/components/first_contained_bottom_navigation_bar.dart';
18 | import 'package:flutter_components/components/page_navigation_animation.dart';
19 | import 'package:flutter_components/components/secondContaineredBottomBar.dart';
20 | import 'package:flutter_components/components/second_animated_onboarding_screen.dart';
21 | import 'package:flutter_components/components/second_animated_overlay_bottom_navbar.dart';
22 | import 'package:flutter_components/components/tab_base_navigation.dart';
23 | import 'package:flutter_components/main_home_page.dart';
24 | import 'package:flutter_components/pages_design/animated_travel_pages/travel_main_page.dart';
25 | import 'package:flutter_components/using_custom_package/fancy_animated_snackbar.dart';
26 | import 'package:flutter_components/using_custom_package/first_animated_carousel_scroll.dart';
27 | import 'package:flutter_components/components/email_validation_form.dart';
28 | import 'package:provider/provider.dart';
29 |
30 | import 'components/animated_shadow_elevated_button.dart';
31 | import 'components/custom_circular_progress_indicator.dart';
32 | import 'components/custom_like_button.dart';
33 | import 'components/custom_second_bottom_nav_bar.dart';
34 |
35 | void main() {
36 | runApp(MultiProvider(
37 | providers: [
38 | ChangeNotifierProvider(
39 | create: (context) => FirstContainedBottomNavigationBarProvider(),
40 | ),
41 | ],
42 | child: MyApp(),
43 | ));
44 | }
45 |
46 | class MyApp extends StatefulWidget {
47 | const MyApp({super.key});
48 |
49 | @override
50 | State createState() => _MyAppState();
51 | }
52 |
53 | class _MyAppState extends State {
54 | @override
55 | Widget build(BuildContext context) {
56 | return MaterialApp(
57 | theme: ThemeData.dark(),
58 | home: CustomInstagramLikeButton(),
59 | );
60 | }
61 | }
62 |
--------------------------------------------------------------------------------
/lib/main_button.dart:
--------------------------------------------------------------------------------
1 | // ignore_for_file: must_be_immutable
2 |
3 | import 'package:flutter/material.dart';
4 |
5 | class MainButton extends StatelessWidget {
6 | VoidCallback onPress;
7 | String? data;
8 | MainButton({required this.data, required this.onPress});
9 |
10 | @override
11 | Widget build(BuildContext context) {
12 | return Container(
13 | margin: EdgeInsets.all(8),
14 | width: MediaQuery.of(context).size.width * 0.9,
15 | height: MediaQuery.of(context).size.height * 0.08,
16 | child: ElevatedButton(
17 | style: ElevatedButton.styleFrom(
18 | backgroundColor: Colors.blueAccent,
19 | foregroundColor: Colors.white,
20 | shape: RoundedRectangleBorder(
21 | borderRadius: BorderRadius.circular(8),
22 | ),
23 | ),
24 | onPressed: onPress,
25 | child: Text('$data')),
26 | );
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/lib/pages_design/animated_travel_pages/components/item_detial_component/content_detial_component.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 | import 'package:google_fonts/google_fonts.dart';
3 | import 'package:svg_flutter/svg.dart';
4 |
5 | class ContentDetailComponent extends StatelessWidget {
6 | String? image;
7 | String? name;
8 | String? place;
9 | String? rating;
10 | String? people;
11 | String? description;
12 |
13 | ContentDetailComponent({
14 | required this.image,
15 | required this.name,
16 | required this.place,
17 | required this.rating,
18 | required this.people,
19 | required this.description,
20 | });
21 |
22 | @override
23 | Widget build(BuildContext context) {
24 | return Column(
25 | children: [
26 | ListTile(
27 | title: Text(
28 | '$name',
29 | style: GoogleFonts.poppins(
30 | textStyle: const TextStyle(
31 | fontSize: 22,
32 | ),
33 | ),
34 | ),
35 | subtitle: Text(
36 | '$place',
37 | style: const TextStyle(
38 | color: Colors.grey,
39 | ),
40 | ),
41 | trailing: Container(
42 | width: 38,
43 | height: 38,
44 | decoration: BoxDecoration(
45 | borderRadius: BorderRadius.circular(38),
46 | color: Color(0xffFFEADF),
47 | ),
48 | child: SvgPicture.asset(
49 | 'assets/pages_images/userLogo.svg',
50 | fit: BoxFit.cover,
51 | ),
52 | ),
53 | ),
54 | const SizedBox(
55 | height: 24,
56 | ),
57 | Padding(
58 | padding: const EdgeInsets.symmetric(horizontal: 8),
59 | child: Row(
60 | children: [
61 | Icon(
62 | Icons.location_on_outlined,
63 | color: Colors.grey,
64 | size: 20,
65 | ),
66 | Text(
67 | '$place',
68 | style: GoogleFonts.poppins(
69 | textStyle: TextStyle(
70 | fontSize: 12,
71 | color: Colors.grey,
72 | )),
73 | ),
74 | Spacer(),
75 | Icon(
76 | Icons.star,
77 | size: 22,
78 | color: Colors.amber,
79 | ),
80 | Text(
81 | '$rating',
82 | style: GoogleFonts.poppins(
83 | textStyle: TextStyle(
84 | fontSize: 12,
85 | color: Colors.grey,
86 | )),
87 | ),
88 | Spacer(),
89 | Text(
90 | '$people',
91 | style: GoogleFonts.poppins(
92 | textStyle: const TextStyle(
93 | fontSize: 14,
94 | fontWeight: FontWeight.w500,
95 | color: Colors.blueAccent,
96 | )),
97 | ),
98 | Text(
99 | ' /Person',
100 | style: GoogleFonts.poppins(
101 | textStyle: const TextStyle(
102 | fontSize: 12,
103 | color: Colors.grey,
104 | )),
105 | ),
106 | ],
107 | ),
108 | ),
109 | const SizedBox(
110 | height: 16,
111 | ),
112 | Padding(
113 | padding: const EdgeInsets.symmetric(horizontal: 8),
114 | child: RichText(
115 | text: TextSpan(
116 | children: [
117 | TextSpan(
118 | text:
119 | 'You will get a complete travel package on the beaches. Packages in the form of airline tickets, recommended Hotel rooms, Transportation, Have you ever been on holiday to the Greek ETC... ',
120 | style: GoogleFonts.poppins(
121 | textStyle: const TextStyle(
122 | fontSize: 13,
123 | color: Colors.grey,
124 | ),
125 | ),
126 | ),
127 | TextSpan(
128 | text: 'Read More',
129 | style: GoogleFonts.poppins(
130 | textStyle: const TextStyle(
131 | fontWeight: FontWeight.w600,
132 | color: Colors.orange,
133 | ),
134 | ),
135 | ),
136 | ],
137 | )),
138 | )
139 | ],
140 | );
141 | }
142 | }
143 |
--------------------------------------------------------------------------------
/lib/pages_design/animated_travel_pages/components/item_detial_component/elevated_button_travle_page.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 | import 'package:flutter_components/components/custom_animated_snackbar.dart';
3 | import 'package:flutter_components/pages_design/animated_travel_pages/travel_main_page.dart';
4 |
5 | class ElevatedButtonTravlePage extends StatelessWidget {
6 | const ElevatedButtonTravlePage({super.key});
7 |
8 | @override
9 | Widget build(BuildContext context) {
10 | return ElevatedButton(
11 | style: ElevatedButton.styleFrom(
12 | backgroundColor: Colors.blueAccent,
13 | foregroundColor: Colors.white,
14 | shape: RoundedRectangleBorder(
15 | borderRadius: BorderRadius.circular(16),
16 | ),
17 | maximumSize: Size(double.infinity, 55),
18 | minimumSize: Size(double.infinity, 55),
19 | ),
20 | onPressed: () {
21 | Navigator.pushReplacement(
22 | context,
23 | MaterialPageRoute(
24 | builder: (context) => TravelMainPage(),
25 | ),
26 | );
27 | },
28 | child: const Text('Book Now'));
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/lib/pages_design/animated_travel_pages/components/item_detial_component/iconButton.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 | import 'package:google_fonts/google_fonts.dart';
3 |
4 | class IconButtonDetialPage extends StatelessWidget {
5 | AnimationController animationController;
6 | IconButtonDetialPage({required this.animationController});
7 |
8 | @override
9 | Widget build(BuildContext context) {
10 | return FadeTransition(
11 | opacity: Tween(begin: 0, end: 1).animate(
12 | CurvedAnimation(parent: animationController, curve: Curves.easeIn),
13 | ),
14 | child: Padding(
15 | padding: EdgeInsets.symmetric(horizontal: 16, vertical: 16),
16 | child: Row(
17 | mainAxisAlignment: MainAxisAlignment.spaceBetween,
18 | children: [
19 | _iconButton(
20 | Icons.arrow_back,
21 | () {
22 | Navigator.pop(context);
23 | },
24 | ),
25 | Text(
26 | 'Details',
27 | style: GoogleFonts.poppins(
28 | textStyle: const TextStyle(
29 | color: Colors.white,
30 | fontWeight: FontWeight.w600,
31 | )),
32 | ),
33 | _iconButton(
34 | Icons.bookmark_border_outlined,
35 | () {
36 | Navigator.pop(context);
37 | },
38 | ),
39 | ],
40 | )),
41 | );
42 | }
43 |
44 | Widget _iconButton(IconData icon, VoidCallback onPress) {
45 | return GestureDetector(
46 | onTap: onPress,
47 | child: Container(
48 | width: 45,
49 | height: 45,
50 | decoration: BoxDecoration(
51 | borderRadius: BorderRadius.circular(45),
52 | color: Color(0xff7D848D).withOpacity(0.4),
53 | ),
54 | alignment: Alignment.center,
55 | child: Icon(
56 | icon,
57 | color: Colors.white,
58 | ),
59 | ),
60 | );
61 | }
62 | }
63 |
--------------------------------------------------------------------------------
/lib/pages_design/animated_travel_pages/components/main_page_component/app_bar_travel_main_page.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 | import 'package:google_fonts/google_fonts.dart';
3 | import 'package:svg_flutter/svg.dart';
4 |
5 | class AppBarTravelMainPage extends StatelessWidget {
6 | AnimationController animationController;
7 |
8 | AppBarTravelMainPage({required this.animationController});
9 |
10 | @override
11 | Widget build(BuildContext context) {
12 | return Expanded(
13 | flex: 2,
14 | child: FadeTransition(
15 | opacity: Tween(begin: 0, end: 1).animate(
16 | CurvedAnimation(parent: animationController, curve: Curves.easeIn),
17 | ),
18 | child: SlideTransition(
19 | position:
20 | Tween(begin: Offset(0, -1), end: Offset(0, 0)).animate(
21 | CurvedAnimation(parent: animationController, curve: Curves.easeIn),
22 | ),
23 | child: ListTile(
24 | leading: Container(
25 | width: 38,
26 | height: 38,
27 | decoration: BoxDecoration(
28 | borderRadius: BorderRadius.circular(38),
29 | color: Color(0xffFFEADF),
30 | ),
31 | child: SvgPicture.asset(
32 | 'assets/pages_images/userLogo.svg',
33 | fit: BoxFit.cover,
34 | ),
35 | ),
36 | title: Text(
37 | 'Leonardo',
38 | style: GoogleFonts.poppins(
39 | textStyle: const TextStyle(
40 | color: Colors.black,
41 | ),
42 | ),
43 | ),
44 | ),
45 | ),
46 | ),
47 | );
48 | }
49 | }
50 |
--------------------------------------------------------------------------------
/lib/pages_design/animated_travel_pages/components/main_page_component/bottom_app_bar_travel_page.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 | import 'package:google_fonts/google_fonts.dart';
3 | import 'package:svg_flutter/svg.dart';
4 |
5 | class BottomAppBarTravelPage extends StatelessWidget {
6 | int _currentIndex = 0;
7 |
8 | @override
9 | Widget build(BuildContext context) {
10 | return BottomAppBar(
11 | shape: CircularNotchedRectangle(),
12 | clipBehavior: Clip.none,
13 | color: Colors.white54,
14 | child: Row(
15 | crossAxisAlignment: CrossAxisAlignment.center,
16 | mainAxisAlignment: MainAxisAlignment.spaceAround,
17 | children: [
18 | _bottomItem(0, 'assets/pages_images/homeIcon.svg', 'Home'),
19 | _bottomItem(1, 'assets/pages_images/calenderIcon.svg', 'Calender'),
20 | Container(
21 | width: 55,
22 | height: 55,
23 | decoration: BoxDecoration(
24 | borderRadius: BorderRadius.circular(38),
25 | color: Colors.blueAccent,
26 | ),
27 | child: const Icon(
28 | Icons.search,
29 | color: Colors.white,
30 | ),
31 | ),
32 | _bottomItem(2, 'assets/pages_images/messageIcon.svg', 'Messages'),
33 | _bottomItem(3, 'assets/pages_images/profileIcon.svg', 'Profile'),
34 | ],
35 | ),
36 | );
37 | }
38 |
39 | Widget _bottomItem(int thisIndex, String icon, String text) {
40 | return Column(
41 | children: [
42 | SvgPicture.asset(
43 | '$icon',
44 | color: _currentIndex == thisIndex
45 | ? Colors.blueAccent
46 | : Color(0xff7D848D),
47 | ),
48 | Text(
49 | '$text',
50 | style: GoogleFonts.poppins(
51 | textStyle: TextStyle(
52 | fontSize: 12,
53 | color: _currentIndex == thisIndex
54 | ? Colors.blueAccent
55 | : Color(0xff7D848D),
56 | )),
57 | )
58 | ],
59 | );
60 | }
61 | }
62 |
--------------------------------------------------------------------------------
/lib/pages_design/animated_travel_pages/components/main_page_component/title_main_page_text_component.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 |
3 | class TitleMainPageTextComponent extends StatelessWidget {
4 | AnimationController animationController;
5 |
6 | TitleMainPageTextComponent({required this.animationController});
7 |
8 | @override
9 | Widget build(BuildContext context) {
10 | return FadeTransition(
11 | opacity: Tween(begin: 0, end: 1).animate(
12 | CurvedAnimation(parent: animationController, curve: Curves.easeIn),
13 | ),
14 | child: SlideTransition(
15 | position:
16 | Tween(begin: Offset(-1, 0), end: Offset(0, 0)).animate(
17 | CurvedAnimation(parent: animationController, curve: Curves.easeInOut),
18 | ),
19 | child: RichText(
20 | text: TextSpan(children: [
21 | TextSpan(
22 | text: 'Explore the ',
23 | style: Theme.of(context).textTheme.displaySmall?.copyWith(
24 | color: Color(0xff2E323E),
25 | fontWeight: FontWeight.w300,
26 | ),
27 | ),
28 | TextSpan(
29 | text: 'Beautiful ',
30 | style: Theme.of(context).textTheme.displaySmall?.copyWith(
31 | color: Colors.black,
32 | fontSize: 38,
33 | fontWeight: FontWeight.bold,
34 | ),
35 | ),
36 | TextSpan(
37 | text: 'world!',
38 | style: Theme.of(context).textTheme.displaySmall?.copyWith(
39 | fontSize: 38,
40 | color: Colors.orange,
41 | fontWeight: FontWeight.bold,
42 | ),
43 | ),
44 | ]),
45 | ),
46 | ),
47 | );
48 | }
49 | }
50 |
--------------------------------------------------------------------------------
/lib/pages_design/animated_travel_pages/components/main_page_component/travel_page_model.dart:
--------------------------------------------------------------------------------
1 | class TravelPageModel {
2 | String? image;
3 | String? name;
4 | String? place;
5 | String? rating;
6 | String? people;
7 | String? description;
8 |
9 | TravelPageModel({
10 | required this.image,
11 | required this.name,
12 | required this.place,
13 | required this.rating,
14 | required this.people,
15 | required this.description,
16 | });
17 | }
18 |
--------------------------------------------------------------------------------
/lib/pages_design/animated_travel_pages/content_full_see_page.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 | import 'package:flutter_components/pages_design/animated_travel_pages/components/item_detial_component/content_detial_component.dart';
3 | import 'package:flutter_components/pages_design/animated_travel_pages/components/item_detial_component/elevated_button_travle_page.dart';
4 | import 'package:flutter_components/pages_design/animated_travel_pages/components/item_detial_component/iconButton.dart';
5 |
6 | class ContentFullSeePage extends StatefulWidget {
7 | String? image;
8 | String? name;
9 | String? place;
10 | String? rating;
11 | String? people;
12 | String? description;
13 |
14 | ContentFullSeePage({
15 | required this.image,
16 | required this.name,
17 | required this.place,
18 | required this.rating,
19 | required this.people,
20 | required this.description,
21 | });
22 |
23 | @override
24 | State createState() => _ContentFullSeePageState();
25 | }
26 |
27 | class _ContentFullSeePageState extends State
28 | with TickerProviderStateMixin {
29 | late AnimationController _animationController;
30 |
31 | @override
32 | void initState() {
33 | _animationController = AnimationController(
34 | vsync: this, duration: const Duration(milliseconds: 800));
35 |
36 | _animationController.forward();
37 | super.initState();
38 | }
39 |
40 | @override
41 | Widget build(BuildContext context) {
42 | return SafeArea(
43 | child: Scaffold(
44 | body: AnimatedBuilder(
45 | animation: _animationController,
46 | builder: (context, child) {
47 | return Stack(
48 | children: [
49 | SizedBox(
50 | width: MediaQuery.of(context).size.width,
51 | height: MediaQuery.of(context).size.height,
52 | child: Image.asset(
53 | '${widget.image}',
54 | fit: BoxFit.cover,
55 | ),
56 | ),
57 | Column(
58 | children: [
59 | IconButtonDetialPage(
60 | animationController: _animationController),
61 | Spacer(),
62 | SlideTransition(
63 | position: Tween(
64 | begin: Offset(0, 1), end: Offset(0, 0))
65 | .animate(
66 | CurvedAnimation(
67 | parent: _animationController,
68 | curve: Curves.easeInOut),
69 | ),
70 | child: Container(
71 | height: 350,
72 | width: double.infinity,
73 | padding: const EdgeInsets.symmetric(
74 | horizontal: 16, vertical: 16),
75 | decoration: const BoxDecoration(
76 | color: Colors.white,
77 | borderRadius: BorderRadius.only(
78 | topRight: Radius.circular(32),
79 | topLeft: Radius.circular(32),
80 | ),
81 | ),
82 | child: Column(
83 | children: [
84 | ContentDetailComponent(
85 | image: widget.image,
86 | name: widget.name,
87 | place: widget.place,
88 | rating: widget.rating,
89 | people: widget.people,
90 | description: widget.description,
91 | ),
92 | Spacer(),
93 | ElevatedButtonTravlePage(),
94 | ],
95 | ),
96 | ),
97 | ),
98 | ],
99 | ),
100 | ],
101 | );
102 | })),
103 | );
104 | }
105 | }
106 |
--------------------------------------------------------------------------------
/lib/pages_design/animated_travel_pages/travel_main_page.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 | import 'package:flutter_components/pages_design/animated_travel_pages/components/main_page_component/bottom_app_bar_travel_page.dart';
3 |
4 | import 'components/main_page_component/app_bar_travel_main_page.dart';
5 | import 'components/main_page_component/sliding_content_travel_page.dart';
6 | import 'components/main_page_component/title_main_page_text_component.dart';
7 |
8 | // use light theme in app
9 | class TravelMainPage extends StatefulWidget {
10 | @override
11 | State createState() => _TravelMainPageState();
12 | }
13 |
14 | class _TravelMainPageState extends State
15 | with TickerProviderStateMixin {
16 | late AnimationController _animationController;
17 |
18 | @override
19 | void initState() {
20 | _animationController = AnimationController(
21 | vsync: this,
22 | duration: Duration(milliseconds: 800),
23 | );
24 |
25 | _animationController.forward();
26 | super.initState();
27 | }
28 |
29 | @override
30 | Widget build(BuildContext context) {
31 | return Scaffold(
32 | backgroundColor: Colors.white,
33 | body: Padding(
34 | padding: const EdgeInsets.symmetric(horizontal: 22, vertical: 32),
35 | child: AnimatedBuilder(
36 | animation: _animationController,
37 | builder: (context, child) {
38 | return Column(
39 | children: [
40 | AppBarTravelMainPage(
41 | animationController: _animationController,
42 | ),
43 | Expanded(
44 | flex: 14,
45 | child: SizedBox(
46 | child: Column(
47 | children: [
48 | TitleMainPageTextComponent(
49 | animationController: _animationController,
50 | ),
51 | const SizedBox(
52 | height: 22,
53 | ),
54 | Row(
55 | mainAxisAlignment: MainAxisAlignment.spaceBetween,
56 | children: [
57 | Text(
58 | 'Best Destination',
59 | style: Theme.of(context)
60 | .textTheme
61 | .bodyLarge
62 | ?.copyWith(
63 | fontWeight: FontWeight.bold,
64 | ),
65 | ),
66 | TextButton(
67 | onPressed: () {},
68 | child: const Text(
69 | 'View more',
70 | style: TextStyle(
71 | color: Colors.blueAccent,
72 | ),
73 | )),
74 | ],
75 | ),
76 | SlidingContentTravelPage(
77 | animationController: _animationController,
78 | ),
79 | ],
80 | ),
81 | ),
82 | ),
83 | ],
84 | );
85 | })),
86 | bottomSheet: BottomAppBarTravelPage(),
87 | );
88 | }
89 | }
90 |
--------------------------------------------------------------------------------
/lib/using_custom_package/fancy_animated_snackbar.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 |
3 | class FancyAnimatedSnackbar extends StatelessWidget {
4 | const FancyAnimatedSnackbar({super.key});
5 |
6 | @override
7 | Widget build(BuildContext context) {
8 | return Scaffold(
9 | body: Center(
10 | child: Column(
11 | mainAxisAlignment: MainAxisAlignment.center,
12 | children: [
13 | ElevatedButton(onPressed: () {}, child: Text('Using Snackbar')),
14 | ],
15 | ),
16 | ),
17 | );
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/lib/using_custom_package/first_animated_carousel_scroll.dart:
--------------------------------------------------------------------------------
1 | import 'package:animated_carousel_scroller/animated_carousel_scroller.dart';
2 | import 'package:flutter/material.dart';
3 |
4 | class FirstAnimatedCarouselScroll extends StatelessWidget {
5 | const FirstAnimatedCarouselScroll({super.key});
6 |
7 | @override
8 | Widget build(BuildContext context) {
9 | return Scaffold(
10 | body: Center(
11 | child: AnimatedCarouselScroller(
12 | images: const [
13 | 'assets/mountain.jpg',
14 | 'assets/mountain1.jpg',
15 | 'assets/mountain2.jpg',
16 | 'assets/mountain3.jpg',
17 | 'assets/mountain4.jpg',
18 | ],
19 | initialIndex: 2,
20 | duration: Duration(milliseconds: 600),
21 | height: 200,
22 | currentCrouselWidth: 180,
23 | otherCrouselWidth: 28),
24 | ),
25 | );
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/linux/.gitignore:
--------------------------------------------------------------------------------
1 | flutter/ephemeral
2 |
--------------------------------------------------------------------------------
/linux/flutter/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | # This file controls Flutter-level build steps. It should not be edited.
2 | cmake_minimum_required(VERSION 3.10)
3 |
4 | set(EPHEMERAL_DIR "${CMAKE_CURRENT_SOURCE_DIR}/ephemeral")
5 |
6 | # Configuration provided via flutter tool.
7 | include(${EPHEMERAL_DIR}/generated_config.cmake)
8 |
9 | # TODO: Move the rest of this into files in ephemeral. See
10 | # https://github.com/flutter/flutter/issues/57146.
11 |
12 | # Serves the same purpose as list(TRANSFORM ... PREPEND ...),
13 | # which isn't available in 3.10.
14 | function(list_prepend LIST_NAME PREFIX)
15 | set(NEW_LIST "")
16 | foreach(element ${${LIST_NAME}})
17 | list(APPEND NEW_LIST "${PREFIX}${element}")
18 | endforeach(element)
19 | set(${LIST_NAME} "${NEW_LIST}" PARENT_SCOPE)
20 | endfunction()
21 |
22 | # === Flutter Library ===
23 | # System-level dependencies.
24 | find_package(PkgConfig REQUIRED)
25 | pkg_check_modules(GTK REQUIRED IMPORTED_TARGET gtk+-3.0)
26 | pkg_check_modules(GLIB REQUIRED IMPORTED_TARGET glib-2.0)
27 | pkg_check_modules(GIO REQUIRED IMPORTED_TARGET gio-2.0)
28 |
29 | set(FLUTTER_LIBRARY "${EPHEMERAL_DIR}/libflutter_linux_gtk.so")
30 |
31 | # Published to parent scope for install step.
32 | set(FLUTTER_LIBRARY ${FLUTTER_LIBRARY} PARENT_SCOPE)
33 | set(FLUTTER_ICU_DATA_FILE "${EPHEMERAL_DIR}/icudtl.dat" PARENT_SCOPE)
34 | set(PROJECT_BUILD_DIR "${PROJECT_DIR}/build/" PARENT_SCOPE)
35 | set(AOT_LIBRARY "${PROJECT_DIR}/build/lib/libapp.so" PARENT_SCOPE)
36 |
37 | list(APPEND FLUTTER_LIBRARY_HEADERS
38 | "fl_basic_message_channel.h"
39 | "fl_binary_codec.h"
40 | "fl_binary_messenger.h"
41 | "fl_dart_project.h"
42 | "fl_engine.h"
43 | "fl_json_message_codec.h"
44 | "fl_json_method_codec.h"
45 | "fl_message_codec.h"
46 | "fl_method_call.h"
47 | "fl_method_channel.h"
48 | "fl_method_codec.h"
49 | "fl_method_response.h"
50 | "fl_plugin_registrar.h"
51 | "fl_plugin_registry.h"
52 | "fl_standard_message_codec.h"
53 | "fl_standard_method_codec.h"
54 | "fl_string_codec.h"
55 | "fl_value.h"
56 | "fl_view.h"
57 | "flutter_linux.h"
58 | )
59 | list_prepend(FLUTTER_LIBRARY_HEADERS "${EPHEMERAL_DIR}/flutter_linux/")
60 | add_library(flutter INTERFACE)
61 | target_include_directories(flutter INTERFACE
62 | "${EPHEMERAL_DIR}"
63 | )
64 | target_link_libraries(flutter INTERFACE "${FLUTTER_LIBRARY}")
65 | target_link_libraries(flutter INTERFACE
66 | PkgConfig::GTK
67 | PkgConfig::GLIB
68 | PkgConfig::GIO
69 | )
70 | add_dependencies(flutter flutter_assemble)
71 |
72 | # === Flutter tool backend ===
73 | # _phony_ is a non-existent file to force this command to run every time,
74 | # since currently there's no way to get a full input/output list from the
75 | # flutter tool.
76 | add_custom_command(
77 | OUTPUT ${FLUTTER_LIBRARY} ${FLUTTER_LIBRARY_HEADERS}
78 | ${CMAKE_CURRENT_BINARY_DIR}/_phony_
79 | COMMAND ${CMAKE_COMMAND} -E env
80 | ${FLUTTER_TOOL_ENVIRONMENT}
81 | "${FLUTTER_ROOT}/packages/flutter_tools/bin/tool_backend.sh"
82 | ${FLUTTER_TARGET_PLATFORM} ${CMAKE_BUILD_TYPE}
83 | VERBATIM
84 | )
85 | add_custom_target(flutter_assemble DEPENDS
86 | "${FLUTTER_LIBRARY}"
87 | ${FLUTTER_LIBRARY_HEADERS}
88 | )
89 |
--------------------------------------------------------------------------------
/linux/flutter/generated_plugin_registrant.cc:
--------------------------------------------------------------------------------
1 | //
2 | // Generated file. Do not edit.
3 | //
4 |
5 | // clang-format off
6 |
7 | #include "generated_plugin_registrant.h"
8 |
9 | #include
10 |
11 | void fl_register_plugins(FlPluginRegistry* registry) {
12 | g_autoptr(FlPluginRegistrar) audioplayers_linux_registrar =
13 | fl_plugin_registry_get_registrar_for_plugin(registry, "AudioplayersLinuxPlugin");
14 | audioplayers_linux_plugin_register_with_registrar(audioplayers_linux_registrar);
15 | }
16 |
--------------------------------------------------------------------------------
/linux/flutter/generated_plugin_registrant.h:
--------------------------------------------------------------------------------
1 | //
2 | // Generated file. Do not edit.
3 | //
4 |
5 | // clang-format off
6 |
7 | #ifndef GENERATED_PLUGIN_REGISTRANT_
8 | #define GENERATED_PLUGIN_REGISTRANT_
9 |
10 | #include
11 |
12 | // Registers Flutter plugins.
13 | void fl_register_plugins(FlPluginRegistry* registry);
14 |
15 | #endif // GENERATED_PLUGIN_REGISTRANT_
16 |
--------------------------------------------------------------------------------
/linux/flutter/generated_plugins.cmake:
--------------------------------------------------------------------------------
1 | #
2 | # Generated file, do not edit.
3 | #
4 |
5 | list(APPEND FLUTTER_PLUGIN_LIST
6 | audioplayers_linux
7 | )
8 |
9 | list(APPEND FLUTTER_FFI_PLUGIN_LIST
10 | )
11 |
12 | set(PLUGIN_BUNDLED_LIBRARIES)
13 |
14 | foreach(plugin ${FLUTTER_PLUGIN_LIST})
15 | add_subdirectory(flutter/ephemeral/.plugin_symlinks/${plugin}/linux plugins/${plugin})
16 | target_link_libraries(${BINARY_NAME} PRIVATE ${plugin}_plugin)
17 | list(APPEND PLUGIN_BUNDLED_LIBRARIES $)
18 | list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${plugin}_bundled_libraries})
19 | endforeach(plugin)
20 |
21 | foreach(ffi_plugin ${FLUTTER_FFI_PLUGIN_LIST})
22 | add_subdirectory(flutter/ephemeral/.plugin_symlinks/${ffi_plugin}/linux plugins/${ffi_plugin})
23 | list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${ffi_plugin}_bundled_libraries})
24 | endforeach(ffi_plugin)
25 |
--------------------------------------------------------------------------------
/linux/main.cc:
--------------------------------------------------------------------------------
1 | #include "my_application.h"
2 |
3 | int main(int argc, char** argv) {
4 | g_autoptr(MyApplication) app = my_application_new();
5 | return g_application_run(G_APPLICATION(app), argc, argv);
6 | }
7 |
--------------------------------------------------------------------------------
/linux/my_application.cc:
--------------------------------------------------------------------------------
1 | #include "my_application.h"
2 |
3 | #include
4 | #ifdef GDK_WINDOWING_X11
5 | #include
6 | #endif
7 |
8 | #include "flutter/generated_plugin_registrant.h"
9 |
10 | struct _MyApplication {
11 | GtkApplication parent_instance;
12 | char** dart_entrypoint_arguments;
13 | };
14 |
15 | G_DEFINE_TYPE(MyApplication, my_application, GTK_TYPE_APPLICATION)
16 |
17 | // Implements GApplication::activate.
18 | static void my_application_activate(GApplication* application) {
19 | MyApplication* self = MY_APPLICATION(application);
20 | GtkWindow* window =
21 | GTK_WINDOW(gtk_application_window_new(GTK_APPLICATION(application)));
22 |
23 | // Use a header bar when running in GNOME as this is the common style used
24 | // by applications and is the setup most users will be using (e.g. Ubuntu
25 | // desktop).
26 | // If running on X and not using GNOME then just use a traditional title bar
27 | // in case the window manager does more exotic layout, e.g. tiling.
28 | // If running on Wayland assume the header bar will work (may need changing
29 | // if future cases occur).
30 | gboolean use_header_bar = TRUE;
31 | #ifdef GDK_WINDOWING_X11
32 | GdkScreen* screen = gtk_window_get_screen(window);
33 | if (GDK_IS_X11_SCREEN(screen)) {
34 | const gchar* wm_name = gdk_x11_screen_get_window_manager_name(screen);
35 | if (g_strcmp0(wm_name, "GNOME Shell") != 0) {
36 | use_header_bar = FALSE;
37 | }
38 | }
39 | #endif
40 | if (use_header_bar) {
41 | GtkHeaderBar* header_bar = GTK_HEADER_BAR(gtk_header_bar_new());
42 | gtk_widget_show(GTK_WIDGET(header_bar));
43 | gtk_header_bar_set_title(header_bar, "flutter_components");
44 | gtk_header_bar_set_show_close_button(header_bar, TRUE);
45 | gtk_window_set_titlebar(window, GTK_WIDGET(header_bar));
46 | } else {
47 | gtk_window_set_title(window, "flutter_components");
48 | }
49 |
50 | gtk_window_set_default_size(window, 1280, 720);
51 | gtk_widget_show(GTK_WIDGET(window));
52 |
53 | g_autoptr(FlDartProject) project = fl_dart_project_new();
54 | fl_dart_project_set_dart_entrypoint_arguments(project, self->dart_entrypoint_arguments);
55 |
56 | FlView* view = fl_view_new(project);
57 | gtk_widget_show(GTK_WIDGET(view));
58 | gtk_container_add(GTK_CONTAINER(window), GTK_WIDGET(view));
59 |
60 | fl_register_plugins(FL_PLUGIN_REGISTRY(view));
61 |
62 | gtk_widget_grab_focus(GTK_WIDGET(view));
63 | }
64 |
65 | // Implements GApplication::local_command_line.
66 | static gboolean my_application_local_command_line(GApplication* application, gchar*** arguments, int* exit_status) {
67 | MyApplication* self = MY_APPLICATION(application);
68 | // Strip out the first argument as it is the binary name.
69 | self->dart_entrypoint_arguments = g_strdupv(*arguments + 1);
70 |
71 | g_autoptr(GError) error = nullptr;
72 | if (!g_application_register(application, nullptr, &error)) {
73 | g_warning("Failed to register: %s", error->message);
74 | *exit_status = 1;
75 | return TRUE;
76 | }
77 |
78 | g_application_activate(application);
79 | *exit_status = 0;
80 |
81 | return TRUE;
82 | }
83 |
84 | // Implements GApplication::startup.
85 | static void my_application_startup(GApplication* application) {
86 | //MyApplication* self = MY_APPLICATION(object);
87 |
88 | // Perform any actions required at application startup.
89 |
90 | G_APPLICATION_CLASS(my_application_parent_class)->startup(application);
91 | }
92 |
93 | // Implements GApplication::shutdown.
94 | static void my_application_shutdown(GApplication* application) {
95 | //MyApplication* self = MY_APPLICATION(object);
96 |
97 | // Perform any actions required at application shutdown.
98 |
99 | G_APPLICATION_CLASS(my_application_parent_class)->shutdown(application);
100 | }
101 |
102 | // Implements GObject::dispose.
103 | static void my_application_dispose(GObject* object) {
104 | MyApplication* self = MY_APPLICATION(object);
105 | g_clear_pointer(&self->dart_entrypoint_arguments, g_strfreev);
106 | G_OBJECT_CLASS(my_application_parent_class)->dispose(object);
107 | }
108 |
109 | static void my_application_class_init(MyApplicationClass* klass) {
110 | G_APPLICATION_CLASS(klass)->activate = my_application_activate;
111 | G_APPLICATION_CLASS(klass)->local_command_line = my_application_local_command_line;
112 | G_APPLICATION_CLASS(klass)->startup = my_application_startup;
113 | G_APPLICATION_CLASS(klass)->shutdown = my_application_shutdown;
114 | G_OBJECT_CLASS(klass)->dispose = my_application_dispose;
115 | }
116 |
117 | static void my_application_init(MyApplication* self) {}
118 |
119 | MyApplication* my_application_new() {
120 | return MY_APPLICATION(g_object_new(my_application_get_type(),
121 | "application-id", APPLICATION_ID,
122 | "flags", G_APPLICATION_NON_UNIQUE,
123 | nullptr));
124 | }
125 |
--------------------------------------------------------------------------------
/linux/my_application.h:
--------------------------------------------------------------------------------
1 | #ifndef FLUTTER_MY_APPLICATION_H_
2 | #define FLUTTER_MY_APPLICATION_H_
3 |
4 | #include
5 |
6 | G_DECLARE_FINAL_TYPE(MyApplication, my_application, MY, APPLICATION,
7 | GtkApplication)
8 |
9 | /**
10 | * my_application_new:
11 | *
12 | * Creates a new Flutter-based application.
13 | *
14 | * Returns: a new #MyApplication.
15 | */
16 | MyApplication* my_application_new();
17 |
18 | #endif // FLUTTER_MY_APPLICATION_H_
19 |
--------------------------------------------------------------------------------
/macos/.gitignore:
--------------------------------------------------------------------------------
1 | # Flutter-related
2 | **/Flutter/ephemeral/
3 | **/Pods/
4 |
5 | # Xcode-related
6 | **/dgph
7 | **/xcuserdata/
8 |
--------------------------------------------------------------------------------
/macos/Flutter/Flutter-Debug.xcconfig:
--------------------------------------------------------------------------------
1 | #include "ephemeral/Flutter-Generated.xcconfig"
2 |
--------------------------------------------------------------------------------
/macos/Flutter/Flutter-Release.xcconfig:
--------------------------------------------------------------------------------
1 | #include "ephemeral/Flutter-Generated.xcconfig"
2 |
--------------------------------------------------------------------------------
/macos/Flutter/GeneratedPluginRegistrant.swift:
--------------------------------------------------------------------------------
1 | //
2 | // Generated file. Do not edit.
3 | //
4 |
5 | import FlutterMacOS
6 | import Foundation
7 |
8 | import audioplayers_darwin
9 | import path_provider_foundation
10 |
11 | func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) {
12 | AudioplayersDarwinPlugin.register(with: registry.registrar(forPlugin: "AudioplayersDarwinPlugin"))
13 | PathProviderPlugin.register(with: registry.registrar(forPlugin: "PathProviderPlugin"))
14 | }
15 |
--------------------------------------------------------------------------------
/macos/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | IDEDidComputeMac32BitWarning
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/macos/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme:
--------------------------------------------------------------------------------
1 |
2 |
5 |
8 |
9 |
15 |
21 |
22 |
23 |
24 |
25 |
30 |
31 |
37 |
38 |
39 |
40 |
43 |
49 |
50 |
51 |
52 |
53 |
63 |
65 |
71 |
72 |
73 |
74 |
80 |
82 |
88 |
89 |
90 |
91 |
93 |
94 |
97 |
98 |
99 |
--------------------------------------------------------------------------------
/macos/Runner.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/macos/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | IDEDidComputeMac32BitWarning
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/macos/Runner/AppDelegate.swift:
--------------------------------------------------------------------------------
1 | import Cocoa
2 | import FlutterMacOS
3 |
4 | @NSApplicationMain
5 | class AppDelegate: FlutterAppDelegate {
6 | override func applicationShouldTerminateAfterLastWindowClosed(_ sender: NSApplication) -> Bool {
7 | return true
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/macos/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "size" : "16x16",
5 | "idiom" : "mac",
6 | "filename" : "app_icon_16.png",
7 | "scale" : "1x"
8 | },
9 | {
10 | "size" : "16x16",
11 | "idiom" : "mac",
12 | "filename" : "app_icon_32.png",
13 | "scale" : "2x"
14 | },
15 | {
16 | "size" : "32x32",
17 | "idiom" : "mac",
18 | "filename" : "app_icon_32.png",
19 | "scale" : "1x"
20 | },
21 | {
22 | "size" : "32x32",
23 | "idiom" : "mac",
24 | "filename" : "app_icon_64.png",
25 | "scale" : "2x"
26 | },
27 | {
28 | "size" : "128x128",
29 | "idiom" : "mac",
30 | "filename" : "app_icon_128.png",
31 | "scale" : "1x"
32 | },
33 | {
34 | "size" : "128x128",
35 | "idiom" : "mac",
36 | "filename" : "app_icon_256.png",
37 | "scale" : "2x"
38 | },
39 | {
40 | "size" : "256x256",
41 | "idiom" : "mac",
42 | "filename" : "app_icon_256.png",
43 | "scale" : "1x"
44 | },
45 | {
46 | "size" : "256x256",
47 | "idiom" : "mac",
48 | "filename" : "app_icon_512.png",
49 | "scale" : "2x"
50 | },
51 | {
52 | "size" : "512x512",
53 | "idiom" : "mac",
54 | "filename" : "app_icon_512.png",
55 | "scale" : "1x"
56 | },
57 | {
58 | "size" : "512x512",
59 | "idiom" : "mac",
60 | "filename" : "app_icon_1024.png",
61 | "scale" : "2x"
62 | }
63 | ],
64 | "info" : {
65 | "version" : 1,
66 | "author" : "xcode"
67 | }
68 | }
69 |
--------------------------------------------------------------------------------
/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_1024.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fahadazizz/Flutter_Components/91bdc750c9b089bf2b1bf4f9f7ca7c6b394bec81/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_1024.png
--------------------------------------------------------------------------------
/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_128.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fahadazizz/Flutter_Components/91bdc750c9b089bf2b1bf4f9f7ca7c6b394bec81/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_128.png
--------------------------------------------------------------------------------
/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_16.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fahadazizz/Flutter_Components/91bdc750c9b089bf2b1bf4f9f7ca7c6b394bec81/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_16.png
--------------------------------------------------------------------------------
/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_256.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fahadazizz/Flutter_Components/91bdc750c9b089bf2b1bf4f9f7ca7c6b394bec81/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_256.png
--------------------------------------------------------------------------------
/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_32.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fahadazizz/Flutter_Components/91bdc750c9b089bf2b1bf4f9f7ca7c6b394bec81/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_32.png
--------------------------------------------------------------------------------
/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_512.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fahadazizz/Flutter_Components/91bdc750c9b089bf2b1bf4f9f7ca7c6b394bec81/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_512.png
--------------------------------------------------------------------------------
/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_64.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fahadazizz/Flutter_Components/91bdc750c9b089bf2b1bf4f9f7ca7c6b394bec81/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_64.png
--------------------------------------------------------------------------------
/macos/Runner/Configs/AppInfo.xcconfig:
--------------------------------------------------------------------------------
1 | // Application-level settings for the Runner target.
2 | //
3 | // This may be replaced with something auto-generated from metadata (e.g., pubspec.yaml) in the
4 | // future. If not, the values below would default to using the project name when this becomes a
5 | // 'flutter create' template.
6 |
7 | // The application's name. By default this is also the title of the Flutter window.
8 | PRODUCT_NAME = flutter_components
9 |
10 | // The application's bundle identifier
11 | PRODUCT_BUNDLE_IDENTIFIER = com.example.flutterComponents
12 |
13 | // The copyright displayed in application information
14 | PRODUCT_COPYRIGHT = Copyright © 2024 com.example. All rights reserved.
15 |
--------------------------------------------------------------------------------
/macos/Runner/Configs/Debug.xcconfig:
--------------------------------------------------------------------------------
1 | #include "../../Flutter/Flutter-Debug.xcconfig"
2 | #include "Warnings.xcconfig"
3 |
--------------------------------------------------------------------------------
/macos/Runner/Configs/Release.xcconfig:
--------------------------------------------------------------------------------
1 | #include "../../Flutter/Flutter-Release.xcconfig"
2 | #include "Warnings.xcconfig"
3 |
--------------------------------------------------------------------------------
/macos/Runner/Configs/Warnings.xcconfig:
--------------------------------------------------------------------------------
1 | WARNING_CFLAGS = -Wall -Wconditional-uninitialized -Wnullable-to-nonnull-conversion -Wmissing-method-return-type -Woverlength-strings
2 | GCC_WARN_UNDECLARED_SELECTOR = YES
3 | CLANG_UNDEFINED_BEHAVIOR_SANITIZER_NULLABILITY = YES
4 | CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE
5 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES
6 | CLANG_WARN_PRAGMA_PACK = YES
7 | CLANG_WARN_STRICT_PROTOTYPES = YES
8 | CLANG_WARN_COMMA = YES
9 | GCC_WARN_STRICT_SELECTOR_MATCH = YES
10 | CLANG_WARN_OBJC_REPEATED_USE_OF_WEAK = YES
11 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES
12 | GCC_WARN_SHADOW = YES
13 | CLANG_WARN_UNREACHABLE_CODE = YES
14 |
--------------------------------------------------------------------------------
/macos/Runner/DebugProfile.entitlements:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | com.apple.security.app-sandbox
6 |
7 | com.apple.security.cs.allow-jit
8 |
9 | com.apple.security.network.server
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/macos/Runner/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | $(DEVELOPMENT_LANGUAGE)
7 | CFBundleExecutable
8 | $(EXECUTABLE_NAME)
9 | CFBundleIconFile
10 |
11 | CFBundleIdentifier
12 | $(PRODUCT_BUNDLE_IDENTIFIER)
13 | CFBundleInfoDictionaryVersion
14 | 6.0
15 | CFBundleName
16 | $(PRODUCT_NAME)
17 | CFBundlePackageType
18 | APPL
19 | CFBundleShortVersionString
20 | $(FLUTTER_BUILD_NAME)
21 | CFBundleVersion
22 | $(FLUTTER_BUILD_NUMBER)
23 | LSMinimumSystemVersion
24 | $(MACOSX_DEPLOYMENT_TARGET)
25 | NSHumanReadableCopyright
26 | $(PRODUCT_COPYRIGHT)
27 | NSMainNibFile
28 | MainMenu
29 | NSPrincipalClass
30 | NSApplication
31 |
32 |
33 |
--------------------------------------------------------------------------------
/macos/Runner/MainFlutterWindow.swift:
--------------------------------------------------------------------------------
1 | import Cocoa
2 | import FlutterMacOS
3 |
4 | class MainFlutterWindow: NSWindow {
5 | override func awakeFromNib() {
6 | let flutterViewController = FlutterViewController()
7 | let windowFrame = self.frame
8 | self.contentViewController = flutterViewController
9 | self.setFrame(windowFrame, display: true)
10 |
11 | RegisterGeneratedPlugins(registry: flutterViewController)
12 |
13 | super.awakeFromNib()
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/macos/Runner/Release.entitlements:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | com.apple.security.app-sandbox
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/macos/RunnerTests/RunnerTests.swift:
--------------------------------------------------------------------------------
1 | import Cocoa
2 | import FlutterMacOS
3 | import XCTest
4 |
5 | class RunnerTests: XCTestCase {
6 |
7 | func testExample() {
8 | // If you add code to the Runner application, consider adding tests here.
9 | // See https://developer.apple.com/documentation/xctest for more information about using XCTest.
10 | }
11 |
12 | }
13 |
--------------------------------------------------------------------------------
/pubspec.yaml:
--------------------------------------------------------------------------------
1 | name: flutter_components
2 | description: "A new Flutter project."
3 | # The following line prevents the package from being accidentally published to
4 | # pub.dev using `flutter pub publish`. This is preferred for private packages.
5 | publish_to: 'none' # Remove this line if you wish to publish to pub.dev
6 |
7 | # The following defines the version and build number for your application.
8 | # A version number is three numbers separated by dots, like 1.2.43
9 | # followed by an optional build number separated by a +.
10 | # Both the version and the builder number may be overridden in flutter
11 | # build by specifying --build-name and --build-number, respectively.
12 | # In Android, build-name is used as versionName while build-number used as versionCode.
13 | # Read more about Android versioning at https://developer.android.com/studio/publish/versioning
14 | # In iOS, build-name is used as CFBundleShortVersionString while build-number is used as CFBundleVersion.
15 | # Read more about iOS versioning at
16 | # https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
17 | # In Windows, build-name is used as the major, minor, and patch parts
18 | # of the product and file versions while build-number is used as the build suffix.
19 | version: 1.0.0+1
20 |
21 | environment:
22 | sdk: '>=3.4.4 <4.0.0'
23 |
24 | # Dependencies specify other packages that your package needs in order to work.
25 | # To automatically upgrade your package dependencies to the latest versions
26 | # consider running `flutter pub upgrade --major-versions`. Alternatively,
27 | # dependencies can be manually updated by changing the version numbers below to
28 | # the latest version available on pub.dev. To see which dependencies have newer
29 | # versions available, run `flutter pub outdated`.
30 | dependencies:
31 | flutter:
32 | sdk: flutter
33 |
34 |
35 | # The following adds the Cupertino Icons font to your application.
36 | # Use with the CupertinoIcons class for iOS style icons.
37 | cupertino_icons: ^1.0.6
38 | flutter_onboarding_slider: ^1.0.11
39 | provider: ^6.1.2
40 | animated_carousel_scroller: ^0.0.3
41 | google_fonts: ^6.2.1
42 | animated_react_button: ^0.0.4
43 | svg_flutter: ^0.0.1
44 | flutter_image_slideshow: ^0.1.6
45 | control_style: ^0.1.0
46 | audioplayers: ^6.1.0
47 | circle_wheel_scroll: ^0.0.3
48 |
49 | dev_dependencies:
50 | flutter_test:
51 | sdk: flutter
52 |
53 |
54 | flutter_lints: ^3.0.0
55 |
56 |
57 |
58 | # For information on the generic Dart part of this file, see the
59 | # following page: https://dart.dev/tools/pub/pubspec
60 |
61 | # The following section is specific to Flutter packages.
62 | flutter:
63 |
64 | # The following line ensures that the Material Icons font is
65 | # included with your application, so that you can use the icons in
66 | # the material Icons class.
67 | uses-material-design: true
68 |
69 | # To add assets to your application, add an assets section, like this:
70 | # assets:
71 | # - images/a_dot_burr.jpeg
72 | # - images/a_dot_ham.jpeg
73 | assets:
74 | - assets/
75 | - assets/pages_images/
76 |
77 | # An image asset can refer to one or more resolution-specific "variants", see
78 | # https://flutter.dev/assets-and-images/#resolution-aware
79 |
80 | # For details regarding adding assets from package dependencies, see
81 | # https://flutter.dev/assets-and-images/#from-packages
82 |
83 | # To add custom fonts to your application, add a fonts section here,
84 | # in this "flutter" section. Each entry in this list should have a
85 | # "family" key with the font family name, and a "fonts" key with a
86 | # list giving the asset and other descriptors for the font. For
87 | # example:
88 | # fonts:
89 | # - family: Schyler
90 | # fonts:
91 | # - asset: fonts/Schyler-Regular.ttf
92 | # - asset: fonts/Schyler-Italic.ttf
93 | # style: italic
94 | # - family: Trajan Pro
95 | # fonts:
96 | # - asset: fonts/TrajanPro.ttf
97 | # - asset: fonts/TrajanPro_Bold.ttf
98 | # weight: 700
99 | #
100 | # For details regarding fonts from package dependencies,
101 | # see https://flutter.dev/custom-fonts/#from-packages
102 |
--------------------------------------------------------------------------------
/test/widget_test.dart:
--------------------------------------------------------------------------------
1 | // This is a basic Flutter widget test.
2 | //
3 | // To perform an interaction with a widget in your test, use the WidgetTester
4 | // utility in the flutter_test package. For example, you can send tap and scroll
5 | // gestures. You can also use WidgetTester to find child widgets in the widget
6 | // tree, read text, and verify that the values of widget properties are correct.
7 |
8 | import 'package:flutter/material.dart';
9 | import 'package:flutter_test/flutter_test.dart';
10 |
11 | import 'package:flutter_components/main.dart';
12 |
13 | void main() {
14 | testWidgets('Counter increments smoke test', (WidgetTester tester) async {
15 | // Build our app and trigger a frame.
16 | await tester.pumpWidget(const MyApp());
17 |
18 | // Verify that our counter starts at 0.
19 | expect(find.text('0'), findsOneWidget);
20 | expect(find.text('1'), findsNothing);
21 |
22 | // Tap the '+' icon and trigger a frame.
23 | await tester.tap(find.byIcon(Icons.add));
24 | await tester.pump();
25 |
26 | // Verify that our counter has incremented.
27 | expect(find.text('0'), findsNothing);
28 | expect(find.text('1'), findsOneWidget);
29 | });
30 | }
31 |
--------------------------------------------------------------------------------
/web/favicon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fahadazizz/Flutter_Components/91bdc750c9b089bf2b1bf4f9f7ca7c6b394bec81/web/favicon.png
--------------------------------------------------------------------------------
/web/icons/Icon-192.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fahadazizz/Flutter_Components/91bdc750c9b089bf2b1bf4f9f7ca7c6b394bec81/web/icons/Icon-192.png
--------------------------------------------------------------------------------
/web/icons/Icon-512.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fahadazizz/Flutter_Components/91bdc750c9b089bf2b1bf4f9f7ca7c6b394bec81/web/icons/Icon-512.png
--------------------------------------------------------------------------------
/web/icons/Icon-maskable-192.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fahadazizz/Flutter_Components/91bdc750c9b089bf2b1bf4f9f7ca7c6b394bec81/web/icons/Icon-maskable-192.png
--------------------------------------------------------------------------------
/web/icons/Icon-maskable-512.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fahadazizz/Flutter_Components/91bdc750c9b089bf2b1bf4f9f7ca7c6b394bec81/web/icons/Icon-maskable-512.png
--------------------------------------------------------------------------------
/web/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 | flutter_components
33 |
34 |
35 |
36 |
37 |
38 |
39 |
--------------------------------------------------------------------------------
/web/manifest.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "flutter_components",
3 | "short_name": "flutter_components",
4 | "start_url": ".",
5 | "display": "standalone",
6 | "background_color": "#0175C2",
7 | "theme_color": "#0175C2",
8 | "description": "A new Flutter project.",
9 | "orientation": "portrait-primary",
10 | "prefer_related_applications": false,
11 | "icons": [
12 | {
13 | "src": "icons/Icon-192.png",
14 | "sizes": "192x192",
15 | "type": "image/png"
16 | },
17 | {
18 | "src": "icons/Icon-512.png",
19 | "sizes": "512x512",
20 | "type": "image/png"
21 | },
22 | {
23 | "src": "icons/Icon-maskable-192.png",
24 | "sizes": "192x192",
25 | "type": "image/png",
26 | "purpose": "maskable"
27 | },
28 | {
29 | "src": "icons/Icon-maskable-512.png",
30 | "sizes": "512x512",
31 | "type": "image/png",
32 | "purpose": "maskable"
33 | }
34 | ]
35 | }
36 |
--------------------------------------------------------------------------------
/windows/.gitignore:
--------------------------------------------------------------------------------
1 | flutter/ephemeral/
2 |
3 | # Visual Studio user-specific files.
4 | *.suo
5 | *.user
6 | *.userosscache
7 | *.sln.docstates
8 |
9 | # Visual Studio build-related files.
10 | x64/
11 | x86/
12 |
13 | # Visual Studio cache files
14 | # files ending in .cache can be ignored
15 | *.[Cc]ache
16 | # but keep track of directories ending in .cache
17 | !*.[Cc]ache/
18 |
--------------------------------------------------------------------------------
/windows/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | # Project-level configuration.
2 | cmake_minimum_required(VERSION 3.14)
3 | project(flutter_components LANGUAGES CXX)
4 |
5 | # The name of the executable created for the application. Change this to change
6 | # the on-disk name of your application.
7 | set(BINARY_NAME "flutter_components")
8 |
9 | # Explicitly opt in to modern CMake behaviors to avoid warnings with recent
10 | # versions of CMake.
11 | cmake_policy(VERSION 3.14...3.25)
12 |
13 | # Define build configuration option.
14 | get_property(IS_MULTICONFIG GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG)
15 | if(IS_MULTICONFIG)
16 | set(CMAKE_CONFIGURATION_TYPES "Debug;Profile;Release"
17 | CACHE STRING "" FORCE)
18 | else()
19 | if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
20 | set(CMAKE_BUILD_TYPE "Debug" CACHE
21 | STRING "Flutter build mode" FORCE)
22 | set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS
23 | "Debug" "Profile" "Release")
24 | endif()
25 | endif()
26 | # Define settings for the Profile build mode.
27 | set(CMAKE_EXE_LINKER_FLAGS_PROFILE "${CMAKE_EXE_LINKER_FLAGS_RELEASE}")
28 | set(CMAKE_SHARED_LINKER_FLAGS_PROFILE "${CMAKE_SHARED_LINKER_FLAGS_RELEASE}")
29 | set(CMAKE_C_FLAGS_PROFILE "${CMAKE_C_FLAGS_RELEASE}")
30 | set(CMAKE_CXX_FLAGS_PROFILE "${CMAKE_CXX_FLAGS_RELEASE}")
31 |
32 | # Use Unicode for all projects.
33 | add_definitions(-DUNICODE -D_UNICODE)
34 |
35 | # Compilation settings that should be applied to most targets.
36 | #
37 | # Be cautious about adding new options here, as plugins use this function by
38 | # default. In most cases, you should add new options to specific targets instead
39 | # of modifying this function.
40 | function(APPLY_STANDARD_SETTINGS TARGET)
41 | target_compile_features(${TARGET} PUBLIC cxx_std_17)
42 | target_compile_options(${TARGET} PRIVATE /W4 /WX /wd"4100")
43 | target_compile_options(${TARGET} PRIVATE /EHsc)
44 | target_compile_definitions(${TARGET} PRIVATE "_HAS_EXCEPTIONS=0")
45 | target_compile_definitions(${TARGET} PRIVATE "$<$:_DEBUG>")
46 | endfunction()
47 |
48 | # Flutter library and tool build rules.
49 | set(FLUTTER_MANAGED_DIR "${CMAKE_CURRENT_SOURCE_DIR}/flutter")
50 | add_subdirectory(${FLUTTER_MANAGED_DIR})
51 |
52 | # Application build; see runner/CMakeLists.txt.
53 | add_subdirectory("runner")
54 |
55 |
56 | # Generated plugin build rules, which manage building the plugins and adding
57 | # them to the application.
58 | include(flutter/generated_plugins.cmake)
59 |
60 |
61 | # === Installation ===
62 | # Support files are copied into place next to the executable, so that it can
63 | # run in place. This is done instead of making a separate bundle (as on Linux)
64 | # so that building and running from within Visual Studio will work.
65 | set(BUILD_BUNDLE_DIR "$")
66 | # Make the "install" step default, as it's required to run.
67 | set(CMAKE_VS_INCLUDE_INSTALL_TO_DEFAULT_BUILD 1)
68 | if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
69 | set(CMAKE_INSTALL_PREFIX "${BUILD_BUNDLE_DIR}" CACHE PATH "..." FORCE)
70 | endif()
71 |
72 | set(INSTALL_BUNDLE_DATA_DIR "${CMAKE_INSTALL_PREFIX}/data")
73 | set(INSTALL_BUNDLE_LIB_DIR "${CMAKE_INSTALL_PREFIX}")
74 |
75 | install(TARGETS ${BINARY_NAME} RUNTIME DESTINATION "${CMAKE_INSTALL_PREFIX}"
76 | COMPONENT Runtime)
77 |
78 | install(FILES "${FLUTTER_ICU_DATA_FILE}" DESTINATION "${INSTALL_BUNDLE_DATA_DIR}"
79 | COMPONENT Runtime)
80 |
81 | install(FILES "${FLUTTER_LIBRARY}" DESTINATION "${INSTALL_BUNDLE_LIB_DIR}"
82 | COMPONENT Runtime)
83 |
84 | if(PLUGIN_BUNDLED_LIBRARIES)
85 | install(FILES "${PLUGIN_BUNDLED_LIBRARIES}"
86 | DESTINATION "${INSTALL_BUNDLE_LIB_DIR}"
87 | COMPONENT Runtime)
88 | endif()
89 |
90 | # Copy the native assets provided by the build.dart from all packages.
91 | set(NATIVE_ASSETS_DIR "${PROJECT_BUILD_DIR}native_assets/windows/")
92 | install(DIRECTORY "${NATIVE_ASSETS_DIR}"
93 | DESTINATION "${INSTALL_BUNDLE_LIB_DIR}"
94 | COMPONENT Runtime)
95 |
96 | # Fully re-copy the assets directory on each build to avoid having stale files
97 | # from a previous install.
98 | set(FLUTTER_ASSET_DIR_NAME "flutter_assets")
99 | install(CODE "
100 | file(REMOVE_RECURSE \"${INSTALL_BUNDLE_DATA_DIR}/${FLUTTER_ASSET_DIR_NAME}\")
101 | " COMPONENT Runtime)
102 | install(DIRECTORY "${PROJECT_BUILD_DIR}/${FLUTTER_ASSET_DIR_NAME}"
103 | DESTINATION "${INSTALL_BUNDLE_DATA_DIR}" COMPONENT Runtime)
104 |
105 | # Install the AOT library on non-Debug builds only.
106 | install(FILES "${AOT_LIBRARY}" DESTINATION "${INSTALL_BUNDLE_DATA_DIR}"
107 | CONFIGURATIONS Profile;Release
108 | COMPONENT Runtime)
109 |
--------------------------------------------------------------------------------
/windows/flutter/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | # This file controls Flutter-level build steps. It should not be edited.
2 | cmake_minimum_required(VERSION 3.14)
3 |
4 | set(EPHEMERAL_DIR "${CMAKE_CURRENT_SOURCE_DIR}/ephemeral")
5 |
6 | # Configuration provided via flutter tool.
7 | include(${EPHEMERAL_DIR}/generated_config.cmake)
8 |
9 | # TODO: Move the rest of this into files in ephemeral. See
10 | # https://github.com/flutter/flutter/issues/57146.
11 | set(WRAPPER_ROOT "${EPHEMERAL_DIR}/cpp_client_wrapper")
12 |
13 | # Set fallback configurations for older versions of the flutter tool.
14 | if (NOT DEFINED FLUTTER_TARGET_PLATFORM)
15 | set(FLUTTER_TARGET_PLATFORM "windows-x64")
16 | endif()
17 |
18 | # === Flutter Library ===
19 | set(FLUTTER_LIBRARY "${EPHEMERAL_DIR}/flutter_windows.dll")
20 |
21 | # Published to parent scope for install step.
22 | set(FLUTTER_LIBRARY ${FLUTTER_LIBRARY} PARENT_SCOPE)
23 | set(FLUTTER_ICU_DATA_FILE "${EPHEMERAL_DIR}/icudtl.dat" PARENT_SCOPE)
24 | set(PROJECT_BUILD_DIR "${PROJECT_DIR}/build/" PARENT_SCOPE)
25 | set(AOT_LIBRARY "${PROJECT_DIR}/build/windows/app.so" PARENT_SCOPE)
26 |
27 | list(APPEND FLUTTER_LIBRARY_HEADERS
28 | "flutter_export.h"
29 | "flutter_windows.h"
30 | "flutter_messenger.h"
31 | "flutter_plugin_registrar.h"
32 | "flutter_texture_registrar.h"
33 | )
34 | list(TRANSFORM FLUTTER_LIBRARY_HEADERS PREPEND "${EPHEMERAL_DIR}/")
35 | add_library(flutter INTERFACE)
36 | target_include_directories(flutter INTERFACE
37 | "${EPHEMERAL_DIR}"
38 | )
39 | target_link_libraries(flutter INTERFACE "${FLUTTER_LIBRARY}.lib")
40 | add_dependencies(flutter flutter_assemble)
41 |
42 | # === Wrapper ===
43 | list(APPEND CPP_WRAPPER_SOURCES_CORE
44 | "core_implementations.cc"
45 | "standard_codec.cc"
46 | )
47 | list(TRANSFORM CPP_WRAPPER_SOURCES_CORE PREPEND "${WRAPPER_ROOT}/")
48 | list(APPEND CPP_WRAPPER_SOURCES_PLUGIN
49 | "plugin_registrar.cc"
50 | )
51 | list(TRANSFORM CPP_WRAPPER_SOURCES_PLUGIN PREPEND "${WRAPPER_ROOT}/")
52 | list(APPEND CPP_WRAPPER_SOURCES_APP
53 | "flutter_engine.cc"
54 | "flutter_view_controller.cc"
55 | )
56 | list(TRANSFORM CPP_WRAPPER_SOURCES_APP PREPEND "${WRAPPER_ROOT}/")
57 |
58 | # Wrapper sources needed for a plugin.
59 | add_library(flutter_wrapper_plugin STATIC
60 | ${CPP_WRAPPER_SOURCES_CORE}
61 | ${CPP_WRAPPER_SOURCES_PLUGIN}
62 | )
63 | apply_standard_settings(flutter_wrapper_plugin)
64 | set_target_properties(flutter_wrapper_plugin PROPERTIES
65 | POSITION_INDEPENDENT_CODE ON)
66 | set_target_properties(flutter_wrapper_plugin PROPERTIES
67 | CXX_VISIBILITY_PRESET hidden)
68 | target_link_libraries(flutter_wrapper_plugin PUBLIC flutter)
69 | target_include_directories(flutter_wrapper_plugin PUBLIC
70 | "${WRAPPER_ROOT}/include"
71 | )
72 | add_dependencies(flutter_wrapper_plugin flutter_assemble)
73 |
74 | # Wrapper sources needed for the runner.
75 | add_library(flutter_wrapper_app STATIC
76 | ${CPP_WRAPPER_SOURCES_CORE}
77 | ${CPP_WRAPPER_SOURCES_APP}
78 | )
79 | apply_standard_settings(flutter_wrapper_app)
80 | target_link_libraries(flutter_wrapper_app PUBLIC flutter)
81 | target_include_directories(flutter_wrapper_app PUBLIC
82 | "${WRAPPER_ROOT}/include"
83 | )
84 | add_dependencies(flutter_wrapper_app flutter_assemble)
85 |
86 | # === Flutter tool backend ===
87 | # _phony_ is a non-existent file to force this command to run every time,
88 | # since currently there's no way to get a full input/output list from the
89 | # flutter tool.
90 | set(PHONY_OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/_phony_")
91 | set_source_files_properties("${PHONY_OUTPUT}" PROPERTIES SYMBOLIC TRUE)
92 | add_custom_command(
93 | OUTPUT ${FLUTTER_LIBRARY} ${FLUTTER_LIBRARY_HEADERS}
94 | ${CPP_WRAPPER_SOURCES_CORE} ${CPP_WRAPPER_SOURCES_PLUGIN}
95 | ${CPP_WRAPPER_SOURCES_APP}
96 | ${PHONY_OUTPUT}
97 | COMMAND ${CMAKE_COMMAND} -E env
98 | ${FLUTTER_TOOL_ENVIRONMENT}
99 | "${FLUTTER_ROOT}/packages/flutter_tools/bin/tool_backend.bat"
100 | ${FLUTTER_TARGET_PLATFORM} $
101 | VERBATIM
102 | )
103 | add_custom_target(flutter_assemble DEPENDS
104 | "${FLUTTER_LIBRARY}"
105 | ${FLUTTER_LIBRARY_HEADERS}
106 | ${CPP_WRAPPER_SOURCES_CORE}
107 | ${CPP_WRAPPER_SOURCES_PLUGIN}
108 | ${CPP_WRAPPER_SOURCES_APP}
109 | )
110 |
--------------------------------------------------------------------------------
/windows/flutter/generated_plugin_registrant.cc:
--------------------------------------------------------------------------------
1 | //
2 | // Generated file. Do not edit.
3 | //
4 |
5 | // clang-format off
6 |
7 | #include "generated_plugin_registrant.h"
8 |
9 | #include
10 |
11 | void RegisterPlugins(flutter::PluginRegistry* registry) {
12 | AudioplayersWindowsPluginRegisterWithRegistrar(
13 | registry->GetRegistrarForPlugin("AudioplayersWindowsPlugin"));
14 | }
15 |
--------------------------------------------------------------------------------
/windows/flutter/generated_plugin_registrant.h:
--------------------------------------------------------------------------------
1 | //
2 | // Generated file. Do not edit.
3 | //
4 |
5 | // clang-format off
6 |
7 | #ifndef GENERATED_PLUGIN_REGISTRANT_
8 | #define GENERATED_PLUGIN_REGISTRANT_
9 |
10 | #include
11 |
12 | // Registers Flutter plugins.
13 | void RegisterPlugins(flutter::PluginRegistry* registry);
14 |
15 | #endif // GENERATED_PLUGIN_REGISTRANT_
16 |
--------------------------------------------------------------------------------
/windows/flutter/generated_plugins.cmake:
--------------------------------------------------------------------------------
1 | #
2 | # Generated file, do not edit.
3 | #
4 |
5 | list(APPEND FLUTTER_PLUGIN_LIST
6 | audioplayers_windows
7 | )
8 |
9 | list(APPEND FLUTTER_FFI_PLUGIN_LIST
10 | )
11 |
12 | set(PLUGIN_BUNDLED_LIBRARIES)
13 |
14 | foreach(plugin ${FLUTTER_PLUGIN_LIST})
15 | add_subdirectory(flutter/ephemeral/.plugin_symlinks/${plugin}/windows plugins/${plugin})
16 | target_link_libraries(${BINARY_NAME} PRIVATE ${plugin}_plugin)
17 | list(APPEND PLUGIN_BUNDLED_LIBRARIES $)
18 | list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${plugin}_bundled_libraries})
19 | endforeach(plugin)
20 |
21 | foreach(ffi_plugin ${FLUTTER_FFI_PLUGIN_LIST})
22 | add_subdirectory(flutter/ephemeral/.plugin_symlinks/${ffi_plugin}/windows plugins/${ffi_plugin})
23 | list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${ffi_plugin}_bundled_libraries})
24 | endforeach(ffi_plugin)
25 |
--------------------------------------------------------------------------------
/windows/runner/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | cmake_minimum_required(VERSION 3.14)
2 | project(runner LANGUAGES CXX)
3 |
4 | # Define the application target. To change its name, change BINARY_NAME in the
5 | # top-level CMakeLists.txt, not the value here, or `flutter run` will no longer
6 | # work.
7 | #
8 | # Any new source files that you add to the application should be added here.
9 | add_executable(${BINARY_NAME} WIN32
10 | "flutter_window.cpp"
11 | "main.cpp"
12 | "utils.cpp"
13 | "win32_window.cpp"
14 | "${FLUTTER_MANAGED_DIR}/generated_plugin_registrant.cc"
15 | "Runner.rc"
16 | "runner.exe.manifest"
17 | )
18 |
19 | # Apply the standard set of build settings. This can be removed for applications
20 | # that need different build settings.
21 | apply_standard_settings(${BINARY_NAME})
22 |
23 | # Add preprocessor definitions for the build version.
24 | target_compile_definitions(${BINARY_NAME} PRIVATE "FLUTTER_VERSION=\"${FLUTTER_VERSION}\"")
25 | target_compile_definitions(${BINARY_NAME} PRIVATE "FLUTTER_VERSION_MAJOR=${FLUTTER_VERSION_MAJOR}")
26 | target_compile_definitions(${BINARY_NAME} PRIVATE "FLUTTER_VERSION_MINOR=${FLUTTER_VERSION_MINOR}")
27 | target_compile_definitions(${BINARY_NAME} PRIVATE "FLUTTER_VERSION_PATCH=${FLUTTER_VERSION_PATCH}")
28 | target_compile_definitions(${BINARY_NAME} PRIVATE "FLUTTER_VERSION_BUILD=${FLUTTER_VERSION_BUILD}")
29 |
30 | # Disable Windows macros that collide with C++ standard library functions.
31 | target_compile_definitions(${BINARY_NAME} PRIVATE "NOMINMAX")
32 |
33 | # Add dependency libraries and include directories. Add any application-specific
34 | # dependencies here.
35 | target_link_libraries(${BINARY_NAME} PRIVATE flutter flutter_wrapper_app)
36 | target_link_libraries(${BINARY_NAME} PRIVATE "dwmapi.lib")
37 | target_include_directories(${BINARY_NAME} PRIVATE "${CMAKE_SOURCE_DIR}")
38 |
39 | # Run the Flutter tool portions of the build. This must not be removed.
40 | add_dependencies(${BINARY_NAME} flutter_assemble)
41 |
--------------------------------------------------------------------------------
/windows/runner/Runner.rc:
--------------------------------------------------------------------------------
1 | // Microsoft Visual C++ generated resource script.
2 | //
3 | #pragma code_page(65001)
4 | #include "resource.h"
5 |
6 | #define APSTUDIO_READONLY_SYMBOLS
7 | /////////////////////////////////////////////////////////////////////////////
8 | //
9 | // Generated from the TEXTINCLUDE 2 resource.
10 | //
11 | #include "winres.h"
12 |
13 | /////////////////////////////////////////////////////////////////////////////
14 | #undef APSTUDIO_READONLY_SYMBOLS
15 |
16 | /////////////////////////////////////////////////////////////////////////////
17 | // English (United States) resources
18 |
19 | #if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
20 | LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
21 |
22 | #ifdef APSTUDIO_INVOKED
23 | /////////////////////////////////////////////////////////////////////////////
24 | //
25 | // TEXTINCLUDE
26 | //
27 |
28 | 1 TEXTINCLUDE
29 | BEGIN
30 | "resource.h\0"
31 | END
32 |
33 | 2 TEXTINCLUDE
34 | BEGIN
35 | "#include ""winres.h""\r\n"
36 | "\0"
37 | END
38 |
39 | 3 TEXTINCLUDE
40 | BEGIN
41 | "\r\n"
42 | "\0"
43 | END
44 |
45 | #endif // APSTUDIO_INVOKED
46 |
47 |
48 | /////////////////////////////////////////////////////////////////////////////
49 | //
50 | // Icon
51 | //
52 |
53 | // Icon with lowest ID value placed first to ensure application icon
54 | // remains consistent on all systems.
55 | IDI_APP_ICON ICON "resources\\app_icon.ico"
56 |
57 |
58 | /////////////////////////////////////////////////////////////////////////////
59 | //
60 | // Version
61 | //
62 |
63 | #if defined(FLUTTER_VERSION_MAJOR) && defined(FLUTTER_VERSION_MINOR) && defined(FLUTTER_VERSION_PATCH) && defined(FLUTTER_VERSION_BUILD)
64 | #define VERSION_AS_NUMBER FLUTTER_VERSION_MAJOR,FLUTTER_VERSION_MINOR,FLUTTER_VERSION_PATCH,FLUTTER_VERSION_BUILD
65 | #else
66 | #define VERSION_AS_NUMBER 1,0,0,0
67 | #endif
68 |
69 | #if defined(FLUTTER_VERSION)
70 | #define VERSION_AS_STRING FLUTTER_VERSION
71 | #else
72 | #define VERSION_AS_STRING "1.0.0"
73 | #endif
74 |
75 | VS_VERSION_INFO VERSIONINFO
76 | FILEVERSION VERSION_AS_NUMBER
77 | PRODUCTVERSION VERSION_AS_NUMBER
78 | FILEFLAGSMASK VS_FFI_FILEFLAGSMASK
79 | #ifdef _DEBUG
80 | FILEFLAGS VS_FF_DEBUG
81 | #else
82 | FILEFLAGS 0x0L
83 | #endif
84 | FILEOS VOS__WINDOWS32
85 | FILETYPE VFT_APP
86 | FILESUBTYPE 0x0L
87 | BEGIN
88 | BLOCK "StringFileInfo"
89 | BEGIN
90 | BLOCK "040904e4"
91 | BEGIN
92 | VALUE "CompanyName", "com.example" "\0"
93 | VALUE "FileDescription", "flutter_components" "\0"
94 | VALUE "FileVersion", VERSION_AS_STRING "\0"
95 | VALUE "InternalName", "flutter_components" "\0"
96 | VALUE "LegalCopyright", "Copyright (C) 2024 com.example. All rights reserved." "\0"
97 | VALUE "OriginalFilename", "flutter_components.exe" "\0"
98 | VALUE "ProductName", "flutter_components" "\0"
99 | VALUE "ProductVersion", VERSION_AS_STRING "\0"
100 | END
101 | END
102 | BLOCK "VarFileInfo"
103 | BEGIN
104 | VALUE "Translation", 0x409, 1252
105 | END
106 | END
107 |
108 | #endif // English (United States) resources
109 | /////////////////////////////////////////////////////////////////////////////
110 |
111 |
112 |
113 | #ifndef APSTUDIO_INVOKED
114 | /////////////////////////////////////////////////////////////////////////////
115 | //
116 | // Generated from the TEXTINCLUDE 3 resource.
117 | //
118 |
119 |
120 | /////////////////////////////////////////////////////////////////////////////
121 | #endif // not APSTUDIO_INVOKED
122 |
--------------------------------------------------------------------------------
/windows/runner/flutter_window.cpp:
--------------------------------------------------------------------------------
1 | #include "flutter_window.h"
2 |
3 | #include
4 |
5 | #include "flutter/generated_plugin_registrant.h"
6 |
7 | FlutterWindow::FlutterWindow(const flutter::DartProject& project)
8 | : project_(project) {}
9 |
10 | FlutterWindow::~FlutterWindow() {}
11 |
12 | bool FlutterWindow::OnCreate() {
13 | if (!Win32Window::OnCreate()) {
14 | return false;
15 | }
16 |
17 | RECT frame = GetClientArea();
18 |
19 | // The size here must match the window dimensions to avoid unnecessary surface
20 | // creation / destruction in the startup path.
21 | flutter_controller_ = std::make_unique(
22 | frame.right - frame.left, frame.bottom - frame.top, project_);
23 | // Ensure that basic setup of the controller was successful.
24 | if (!flutter_controller_->engine() || !flutter_controller_->view()) {
25 | return false;
26 | }
27 | RegisterPlugins(flutter_controller_->engine());
28 | SetChildContent(flutter_controller_->view()->GetNativeWindow());
29 |
30 | flutter_controller_->engine()->SetNextFrameCallback([&]() {
31 | this->Show();
32 | });
33 |
34 | // Flutter can complete the first frame before the "show window" callback is
35 | // registered. The following call ensures a frame is pending to ensure the
36 | // window is shown. It is a no-op if the first frame hasn't completed yet.
37 | flutter_controller_->ForceRedraw();
38 |
39 | return true;
40 | }
41 |
42 | void FlutterWindow::OnDestroy() {
43 | if (flutter_controller_) {
44 | flutter_controller_ = nullptr;
45 | }
46 |
47 | Win32Window::OnDestroy();
48 | }
49 |
50 | LRESULT
51 | FlutterWindow::MessageHandler(HWND hwnd, UINT const message,
52 | WPARAM const wparam,
53 | LPARAM const lparam) noexcept {
54 | // Give Flutter, including plugins, an opportunity to handle window messages.
55 | if (flutter_controller_) {
56 | std::optional result =
57 | flutter_controller_->HandleTopLevelWindowProc(hwnd, message, wparam,
58 | lparam);
59 | if (result) {
60 | return *result;
61 | }
62 | }
63 |
64 | switch (message) {
65 | case WM_FONTCHANGE:
66 | flutter_controller_->engine()->ReloadSystemFonts();
67 | break;
68 | }
69 |
70 | return Win32Window::MessageHandler(hwnd, message, wparam, lparam);
71 | }
72 |
--------------------------------------------------------------------------------
/windows/runner/flutter_window.h:
--------------------------------------------------------------------------------
1 | #ifndef RUNNER_FLUTTER_WINDOW_H_
2 | #define RUNNER_FLUTTER_WINDOW_H_
3 |
4 | #include
5 | #include
6 |
7 | #include
8 |
9 | #include "win32_window.h"
10 |
11 | // A window that does nothing but host a Flutter view.
12 | class FlutterWindow : public Win32Window {
13 | public:
14 | // Creates a new FlutterWindow hosting a Flutter view running |project|.
15 | explicit FlutterWindow(const flutter::DartProject& project);
16 | virtual ~FlutterWindow();
17 |
18 | protected:
19 | // Win32Window:
20 | bool OnCreate() override;
21 | void OnDestroy() override;
22 | LRESULT MessageHandler(HWND window, UINT const message, WPARAM const wparam,
23 | LPARAM const lparam) noexcept override;
24 |
25 | private:
26 | // The project to run.
27 | flutter::DartProject project_;
28 |
29 | // The Flutter instance hosted by this window.
30 | std::unique_ptr flutter_controller_;
31 | };
32 |
33 | #endif // RUNNER_FLUTTER_WINDOW_H_
34 |
--------------------------------------------------------------------------------
/windows/runner/main.cpp:
--------------------------------------------------------------------------------
1 | #include
2 | #include
3 | #include
4 |
5 | #include "flutter_window.h"
6 | #include "utils.h"
7 |
8 | int APIENTRY wWinMain(_In_ HINSTANCE instance, _In_opt_ HINSTANCE prev,
9 | _In_ wchar_t *command_line, _In_ int show_command) {
10 | // Attach to console when present (e.g., 'flutter run') or create a
11 | // new console when running with a debugger.
12 | if (!::AttachConsole(ATTACH_PARENT_PROCESS) && ::IsDebuggerPresent()) {
13 | CreateAndAttachConsole();
14 | }
15 |
16 | // Initialize COM, so that it is available for use in the library and/or
17 | // plugins.
18 | ::CoInitializeEx(nullptr, COINIT_APARTMENTTHREADED);
19 |
20 | flutter::DartProject project(L"data");
21 |
22 | std::vector command_line_arguments =
23 | GetCommandLineArguments();
24 |
25 | project.set_dart_entrypoint_arguments(std::move(command_line_arguments));
26 |
27 | FlutterWindow window(project);
28 | Win32Window::Point origin(10, 10);
29 | Win32Window::Size size(1280, 720);
30 | if (!window.Create(L"flutter_components", 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/fahadazizz/Flutter_Components/91bdc750c9b089bf2b1bf4f9f7ca7c6b394bec81/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 | unsigned int target_length = ::WideCharToMultiByte(
49 | CP_UTF8, WC_ERR_INVALID_CHARS, utf16_string,
50 | -1, nullptr, 0, nullptr, nullptr)
51 | -1; // remove the trailing null character
52 | int input_length = (int)wcslen(utf16_string);
53 | std::string utf8_string;
54 | if (target_length == 0 || target_length > utf8_string.max_size()) {
55 | return utf8_string;
56 | }
57 | utf8_string.resize(target_length);
58 | int converted_length = ::WideCharToMultiByte(
59 | CP_UTF8, WC_ERR_INVALID_CHARS, utf16_string,
60 | input_length, utf8_string.data(), target_length, nullptr, nullptr);
61 | if (converted_length == 0) {
62 | return std::string();
63 | }
64 | return utf8_string;
65 | }
66 |
--------------------------------------------------------------------------------
/windows/runner/utils.h:
--------------------------------------------------------------------------------
1 | #ifndef RUNNER_UTILS_H_
2 | #define RUNNER_UTILS_H_
3 |
4 | #include
5 | #include
6 |
7 | // Creates a console for the process, and redirects stdout and stderr to
8 | // it for both the runner and the Flutter library.
9 | void CreateAndAttachConsole();
10 |
11 | // Takes a null-terminated wchar_t* encoded in UTF-16 and returns a std::string
12 | // encoded in UTF-8. Returns an empty std::string on failure.
13 | std::string Utf8FromUtf16(const wchar_t* utf16_string);
14 |
15 | // Gets the command line arguments passed in as a std::vector,
16 | // encoded in UTF-8. Returns an empty std::vector on failure.
17 | std::vector GetCommandLineArguments();
18 |
19 | #endif // RUNNER_UTILS_H_
20 |
--------------------------------------------------------------------------------
/windows/runner/win32_window.h:
--------------------------------------------------------------------------------
1 | #ifndef RUNNER_WIN32_WINDOW_H_
2 | #define RUNNER_WIN32_WINDOW_H_
3 |
4 | #include
5 |
6 | #include
7 | #include
8 | #include
9 |
10 | // A class abstraction for a high DPI-aware Win32 Window. Intended to be
11 | // inherited from by classes that wish to specialize with custom
12 | // rendering and input handling
13 | class Win32Window {
14 | public:
15 | struct Point {
16 | unsigned int x;
17 | unsigned int y;
18 | Point(unsigned int x, unsigned int y) : x(x), y(y) {}
19 | };
20 |
21 | struct Size {
22 | unsigned int width;
23 | unsigned int height;
24 | Size(unsigned int width, unsigned int height)
25 | : width(width), height(height) {}
26 | };
27 |
28 | Win32Window();
29 | virtual ~Win32Window();
30 |
31 | // Creates a win32 window with |title| that is positioned and sized using
32 | // |origin| and |size|. New windows are created on the default monitor. Window
33 | // sizes are specified to the OS in physical pixels, hence to ensure a
34 | // consistent size this function will scale the inputted width and height as
35 | // as appropriate for the default monitor. The window is invisible until
36 | // |Show| is called. Returns true if the window was created successfully.
37 | bool Create(const std::wstring& title, const Point& origin, const Size& size);
38 |
39 | // Show the current window. Returns true if the window was successfully shown.
40 | bool Show();
41 |
42 | // Release OS resources associated with window.
43 | void Destroy();
44 |
45 | // Inserts |content| into the window tree.
46 | void SetChildContent(HWND content);
47 |
48 | // Returns the backing Window handle to enable clients to set icon and other
49 | // window properties. Returns nullptr if the window has been destroyed.
50 | HWND GetHandle();
51 |
52 | // If true, closing this window will quit the application.
53 | void SetQuitOnClose(bool quit_on_close);
54 |
55 | // Return a RECT representing the bounds of the current client area.
56 | RECT GetClientArea();
57 |
58 | protected:
59 | // Processes and route salient window messages for mouse handling,
60 | // size change and DPI. Delegates handling of these to member overloads that
61 | // inheriting classes can handle.
62 | virtual LRESULT MessageHandler(HWND window,
63 | UINT const message,
64 | WPARAM const wparam,
65 | LPARAM const lparam) noexcept;
66 |
67 | // Called when CreateAndShow is called, allowing subclass window-related
68 | // setup. Subclasses should return false if setup fails.
69 | virtual bool OnCreate();
70 |
71 | // Called when Destroy is called.
72 | virtual void OnDestroy();
73 |
74 | private:
75 | friend class WindowClassRegistrar;
76 |
77 | // OS callback called by message pump. Handles the WM_NCCREATE message which
78 | // is passed when the non-client area is being created and enables automatic
79 | // non-client DPI scaling so that the non-client area automatically
80 | // responds to changes in DPI. All other messages are handled by
81 | // MessageHandler.
82 | static LRESULT CALLBACK WndProc(HWND const window,
83 | UINT const message,
84 | WPARAM const wparam,
85 | LPARAM const lparam) noexcept;
86 |
87 | // Retrieves a class instance pointer for |window|
88 | static Win32Window* GetThisFromHandle(HWND const window) noexcept;
89 |
90 | // Update the window frame's theme to match the system theme.
91 | static void UpdateTheme(HWND const window);
92 |
93 | bool quit_on_close_ = false;
94 |
95 | // window handle for top level window.
96 | HWND window_handle_ = nullptr;
97 |
98 | // window handle for hosted content.
99 | HWND child_content_ = nullptr;
100 | };
101 |
102 | #endif // RUNNER_WIN32_WINDOW_H_
103 |
--------------------------------------------------------------------------------