├── .gitignore
├── .metadata
├── README.md
├── analysis_options.yaml
├── android
├── .gitignore
├── app
│ ├── build.gradle
│ └── src
│ │ ├── debug
│ │ └── AndroidManifest.xml
│ │ ├── main
│ │ ├── AndroidManifest.xml
│ │ ├── kotlin
│ │ │ └── com
│ │ │ │ └── example
│ │ │ │ └── responsive_dash_board
│ │ │ │ └── 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
├── fonts
│ └── Montserrat-Regular.ttf
└── images
│ ├── Frame.svg
│ ├── Frame1.svg
│ ├── Frame3.svg
│ ├── Mask_group.svg
│ ├── balance.svg
│ ├── dashboard.svg
│ ├── expenses.svg
│ ├── frameArrowDown.svg
│ ├── gallery.svg
│ ├── income.svg
│ ├── logout.svg
│ ├── mask_group.png
│ ├── myInvestments.svg
│ ├── myTransaction.svg
│ ├── settingSystem.svg
│ ├── statistics.svg
│ └── wallet.svg
├── 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
├── main.dart
├── models
│ ├── all_expenses_item_model.dart
│ ├── drawer_item_model.dart
│ ├── income_details_model.dart
│ ├── transation_model.dart
│ └── user_info_model.dart
├── utils
│ ├── app_images.dart
│ ├── app_styles.dart
│ └── size_config.dart
└── views
│ ├── dashboard_tablet_layout.dart
│ ├── dashboard_view.dart
│ └── widgets
│ ├── active_and_inactive_all_expenses_item.dart
│ ├── active_and_inactive_item.dart
│ ├── adaptive_layout_widget.dart
│ ├── all_expenses.dart
│ ├── all_expenses_header.dart
│ ├── all_expenses_item.dart
│ ├── all_expenses_item_header.dart
│ ├── all_expenses_item_list_view.dart
│ ├── all_expenses_widget.dart
│ ├── custom_background_container.dart
│ ├── custom_button.dart
│ ├── custom_dot.dart
│ ├── custom_drawer.dart
│ ├── custom_expenses_date_widget.dart
│ ├── custom_text_field.dart
│ ├── dashboard_desktop_layout.dart
│ ├── dashboard_mobile_layout.dart
│ ├── dots_indicator.dart
│ ├── drawer_item.dart
│ ├── drawer_item_list_view.dart
│ ├── income_chart.dart
│ ├── income_chart_less_width.dart
│ ├── income_details.dart
│ ├── income_items_details.dart
│ ├── income_section.dart
│ ├── income_section_body.dart
│ ├── income_section_header.dart
│ ├── latest_transaction_list_view.dart
│ ├── latest_transaction_widget.dart
│ ├── my_card.dart
│ ├── my_cards_and_transaction_section.dart
│ ├── my_cards_page_view.dart
│ ├── my_cards_section.dart
│ ├── quick_invoice.dart
│ ├── quick_invoice_form.dart
│ ├── quick_invoice_header.dart
│ ├── title_text_field.dart
│ ├── transaction_history.dart
│ ├── transaction_history_list_view.dart
│ ├── transaction_item.dart
│ └── user_info_list_tile.dart
├── pubspec.lock
├── pubspec.yaml
├── test
└── widget_test.dart
├── web
├── favicon.png
├── icons
│ ├── Icon-192.png
│ ├── Icon-512.png
│ ├── Icon-maskable-192.png
│ └── Icon-maskable-512.png
├── index.html
└── manifest.json
└── windows
├── .gitignore
├── CMakeLists.txt
├── flutter
├── CMakeLists.txt
├── generated_plugin_registrant.cc
├── generated_plugin_registrant.h
└── generated_plugins.cmake
└── runner
├── CMakeLists.txt
├── Runner.rc
├── flutter_window.cpp
├── flutter_window.h
├── main.cpp
├── resource.h
├── resources
└── app_icon.ico
├── runner.exe.manifest
├── utils.cpp
├── utils.h
├── win32_window.cpp
└── win32_window.h
/.gitignore:
--------------------------------------------------------------------------------
1 | # Miscellaneous
2 | *.class
3 | *.log
4 | *.pyc
5 | *.swp
6 | .DS_Store
7 | .atom/
8 | .buildlog/
9 | .history
10 | .svn/
11 | migrate_working_dir/
12 |
13 | # IntelliJ related
14 | *.iml
15 | *.ipr
16 | *.iws
17 | .idea/
18 |
19 | # The .vscode folder contains launch configuration and tasks you configure in
20 | # VS Code which you may wish to be included in version control, so this line
21 | # is commented out by default.
22 | #.vscode/
23 |
24 | # Flutter/Dart/Pub related
25 | **/doc/api/
26 | **/ios/Flutter/.last_build_id
27 | .dart_tool/
28 | .flutter-plugins
29 | .flutter-plugins-dependencies
30 | .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: "7482962148e8d758338d8a28f589f317e1e42ba4"
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: 7482962148e8d758338d8a28f589f317e1e42ba4
17 | base_revision: 7482962148e8d758338d8a28f589f317e1e42ba4
18 | - platform: android
19 | create_revision: 7482962148e8d758338d8a28f589f317e1e42ba4
20 | base_revision: 7482962148e8d758338d8a28f589f317e1e42ba4
21 | - platform: ios
22 | create_revision: 7482962148e8d758338d8a28f589f317e1e42ba4
23 | base_revision: 7482962148e8d758338d8a28f589f317e1e42ba4
24 | - platform: linux
25 | create_revision: 7482962148e8d758338d8a28f589f317e1e42ba4
26 | base_revision: 7482962148e8d758338d8a28f589f317e1e42ba4
27 | - platform: macos
28 | create_revision: 7482962148e8d758338d8a28f589f317e1e42ba4
29 | base_revision: 7482962148e8d758338d8a28f589f317e1e42ba4
30 | - platform: web
31 | create_revision: 7482962148e8d758338d8a28f589f317e1e42ba4
32 | base_revision: 7482962148e8d758338d8a28f589f317e1e42ba4
33 | - platform: windows
34 | create_revision: 7482962148e8d758338d8a28f589f317e1e42ba4
35 | base_revision: 7482962148e8d758338d8a28f589f317e1e42ba4
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 | # responsive_dash_board
2 |
3 | A new Flutter project.
4 |
5 | ## Getting Started
6 |
7 | This project is a starting point for a Flutter application.
8 |
9 | A few resources to get you started if this is your first Flutter project:
10 |
11 | - [Lab: Write your first Flutter app](https://docs.flutter.dev/get-started/codelab)
12 | - [Cookbook: Useful Flutter samples](https://docs.flutter.dev/cookbook)
13 |
14 | For help getting started with Flutter development, view the
15 | [online documentation](https://docs.flutter.dev/), which offers tutorials,
16 | samples, guidance on mobile development, and a full API reference.
17 |
--------------------------------------------------------------------------------
/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 | id "dev.flutter.flutter-gradle-plugin"
5 | }
6 |
7 | def localProperties = new Properties()
8 | def localPropertiesFile = rootProject.file('local.properties')
9 | if (localPropertiesFile.exists()) {
10 | localPropertiesFile.withReader('UTF-8') { reader ->
11 | localProperties.load(reader)
12 | }
13 | }
14 |
15 | def flutterVersionCode = localProperties.getProperty('flutter.versionCode')
16 | if (flutterVersionCode == null) {
17 | flutterVersionCode = '1'
18 | }
19 |
20 | def flutterVersionName = localProperties.getProperty('flutter.versionName')
21 | if (flutterVersionName == null) {
22 | flutterVersionName = '1.0'
23 | }
24 |
25 | android {
26 | namespace "com.example.responsive_dash_board"
27 | compileSdk flutter.compileSdkVersion
28 | ndkVersion flutter.ndkVersion
29 |
30 | compileOptions {
31 | sourceCompatibility JavaVersion.VERSION_1_8
32 | targetCompatibility JavaVersion.VERSION_1_8
33 | }
34 |
35 | kotlinOptions {
36 | jvmTarget = '1.8'
37 | }
38 |
39 | sourceSets {
40 | main.java.srcDirs += 'src/main/kotlin'
41 | }
42 |
43 | defaultConfig {
44 | // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
45 | applicationId "com.example.responsive_dash_board"
46 | // You can update the following values to match your application needs.
47 | // For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-gradle-build-configuration.
48 | minSdkVersion flutter.minSdkVersion
49 | targetSdkVersion flutter.targetSdkVersion
50 | versionCode flutterVersionCode.toInteger()
51 | versionName flutterVersionName
52 | }
53 |
54 | buildTypes {
55 | release {
56 | // TODO: Add your own signing config for the release build.
57 | // Signing with the debug keys for now, so `flutter run --release` works.
58 | signingConfig signingConfigs.debug
59 | }
60 | }
61 | }
62 |
63 | flutter {
64 | source '../..'
65 | }
66 |
67 | dependencies {}
68 |
--------------------------------------------------------------------------------
/android/app/src/debug/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/android/app/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
14 |
18 |
22 |
23 |
24 |
25 |
26 |
27 |
29 |
32 |
33 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
--------------------------------------------------------------------------------
/android/app/src/main/kotlin/com/example/responsive_dash_board/MainActivity.kt:
--------------------------------------------------------------------------------
1 | package com.example.responsive_dash_board
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/FlutterSmith/responsive_dash_board/6f973aca5b8ec8304c3a2927c6172fb9bf3fe927/android/app/src/main/res/mipmap-hdpi/ic_launcher.png
--------------------------------------------------------------------------------
/android/app/src/main/res/mipmap-mdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FlutterSmith/responsive_dash_board/6f973aca5b8ec8304c3a2927c6172fb9bf3fe927/android/app/src/main/res/mipmap-mdpi/ic_launcher.png
--------------------------------------------------------------------------------
/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FlutterSmith/responsive_dash_board/6f973aca5b8ec8304c3a2927c6172fb9bf3fe927/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FlutterSmith/responsive_dash_board/6f973aca5b8ec8304c3a2927c6172fb9bf3fe927/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FlutterSmith/responsive_dash_board/6f973aca5b8ec8304c3a2927c6172fb9bf3fe927/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
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 | settings.ext.flutterSdkPath = flutterSdkPath()
10 |
11 | includeBuild("${settings.ext.flutterSdkPath}/packages/flutter_tools/gradle")
12 |
13 | repositories {
14 | google()
15 | mavenCentral()
16 | gradlePluginPortal()
17 | }
18 | }
19 |
20 | plugins {
21 | id "dev.flutter.flutter-plugin-loader" version "1.0.0"
22 | id "com.android.application" version "7.3.0" apply false
23 | id "org.jetbrains.kotlin.android" version "1.7.10" apply false
24 | }
25 |
26 | include ":app"
27 |
--------------------------------------------------------------------------------
/assets/fonts/Montserrat-Regular.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FlutterSmith/responsive_dash_board/6f973aca5b8ec8304c3a2927c6172fb9bf3fe927/assets/fonts/Montserrat-Regular.ttf
--------------------------------------------------------------------------------
/assets/images/Frame.svg:
--------------------------------------------------------------------------------
1 |
20 |
--------------------------------------------------------------------------------
/assets/images/Frame1.svg:
--------------------------------------------------------------------------------
1 |
20 |
--------------------------------------------------------------------------------
/assets/images/Frame3.svg:
--------------------------------------------------------------------------------
1 |
20 |
--------------------------------------------------------------------------------
/assets/images/Mask_group.svg:
--------------------------------------------------------------------------------
1 |
39 |
--------------------------------------------------------------------------------
/assets/images/balance.svg:
--------------------------------------------------------------------------------
1 |
8 | ""
--------------------------------------------------------------------------------
/assets/images/dashboard.svg:
--------------------------------------------------------------------------------
1 |
7 |
--------------------------------------------------------------------------------
/assets/images/expenses.svg:
--------------------------------------------------------------------------------
1 |
9 |
--------------------------------------------------------------------------------
/assets/images/frameArrowDown.svg:
--------------------------------------------------------------------------------
1 |
7 |
--------------------------------------------------------------------------------
/assets/images/gallery.svg:
--------------------------------------------------------------------------------
1 |
6 |
--------------------------------------------------------------------------------
/assets/images/income.svg:
--------------------------------------------------------------------------------
1 |
9 |
--------------------------------------------------------------------------------
/assets/images/logout.svg:
--------------------------------------------------------------------------------
1 |
8 |
--------------------------------------------------------------------------------
/assets/images/mask_group.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FlutterSmith/responsive_dash_board/6f973aca5b8ec8304c3a2927c6172fb9bf3fe927/assets/images/mask_group.png
--------------------------------------------------------------------------------
/assets/images/myInvestments.svg:
--------------------------------------------------------------------------------
1 |
6 |
--------------------------------------------------------------------------------
/assets/images/myTransaction.svg:
--------------------------------------------------------------------------------
1 |
9 |
--------------------------------------------------------------------------------
/assets/images/settingSystem.svg:
--------------------------------------------------------------------------------
1 |
5 |
--------------------------------------------------------------------------------
/assets/images/statistics.svg:
--------------------------------------------------------------------------------
1 |
5 |
--------------------------------------------------------------------------------
/assets/images/wallet.svg:
--------------------------------------------------------------------------------
1 |
6 |
--------------------------------------------------------------------------------
/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 UIKit
2 | import Flutter
3 |
4 | @UIApplicationMain
5 | @objc class AppDelegate: FlutterAppDelegate {
6 | override func application(
7 | _ application: UIApplication,
8 | didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?
9 | ) -> Bool {
10 | GeneratedPluginRegistrant.register(with: self)
11 | return super.application(application, didFinishLaunchingWithOptions: launchOptions)
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "size" : "20x20",
5 | "idiom" : "iphone",
6 | "filename" : "Icon-App-20x20@2x.png",
7 | "scale" : "2x"
8 | },
9 | {
10 | "size" : "20x20",
11 | "idiom" : "iphone",
12 | "filename" : "Icon-App-20x20@3x.png",
13 | "scale" : "3x"
14 | },
15 | {
16 | "size" : "29x29",
17 | "idiom" : "iphone",
18 | "filename" : "Icon-App-29x29@1x.png",
19 | "scale" : "1x"
20 | },
21 | {
22 | "size" : "29x29",
23 | "idiom" : "iphone",
24 | "filename" : "Icon-App-29x29@2x.png",
25 | "scale" : "2x"
26 | },
27 | {
28 | "size" : "29x29",
29 | "idiom" : "iphone",
30 | "filename" : "Icon-App-29x29@3x.png",
31 | "scale" : "3x"
32 | },
33 | {
34 | "size" : "40x40",
35 | "idiom" : "iphone",
36 | "filename" : "Icon-App-40x40@2x.png",
37 | "scale" : "2x"
38 | },
39 | {
40 | "size" : "40x40",
41 | "idiom" : "iphone",
42 | "filename" : "Icon-App-40x40@3x.png",
43 | "scale" : "3x"
44 | },
45 | {
46 | "size" : "60x60",
47 | "idiom" : "iphone",
48 | "filename" : "Icon-App-60x60@2x.png",
49 | "scale" : "2x"
50 | },
51 | {
52 | "size" : "60x60",
53 | "idiom" : "iphone",
54 | "filename" : "Icon-App-60x60@3x.png",
55 | "scale" : "3x"
56 | },
57 | {
58 | "size" : "20x20",
59 | "idiom" : "ipad",
60 | "filename" : "Icon-App-20x20@1x.png",
61 | "scale" : "1x"
62 | },
63 | {
64 | "size" : "20x20",
65 | "idiom" : "ipad",
66 | "filename" : "Icon-App-20x20@2x.png",
67 | "scale" : "2x"
68 | },
69 | {
70 | "size" : "29x29",
71 | "idiom" : "ipad",
72 | "filename" : "Icon-App-29x29@1x.png",
73 | "scale" : "1x"
74 | },
75 | {
76 | "size" : "29x29",
77 | "idiom" : "ipad",
78 | "filename" : "Icon-App-29x29@2x.png",
79 | "scale" : "2x"
80 | },
81 | {
82 | "size" : "40x40",
83 | "idiom" : "ipad",
84 | "filename" : "Icon-App-40x40@1x.png",
85 | "scale" : "1x"
86 | },
87 | {
88 | "size" : "40x40",
89 | "idiom" : "ipad",
90 | "filename" : "Icon-App-40x40@2x.png",
91 | "scale" : "2x"
92 | },
93 | {
94 | "size" : "76x76",
95 | "idiom" : "ipad",
96 | "filename" : "Icon-App-76x76@1x.png",
97 | "scale" : "1x"
98 | },
99 | {
100 | "size" : "76x76",
101 | "idiom" : "ipad",
102 | "filename" : "Icon-App-76x76@2x.png",
103 | "scale" : "2x"
104 | },
105 | {
106 | "size" : "83.5x83.5",
107 | "idiom" : "ipad",
108 | "filename" : "Icon-App-83.5x83.5@2x.png",
109 | "scale" : "2x"
110 | },
111 | {
112 | "size" : "1024x1024",
113 | "idiom" : "ios-marketing",
114 | "filename" : "Icon-App-1024x1024@1x.png",
115 | "scale" : "1x"
116 | }
117 | ],
118 | "info" : {
119 | "version" : 1,
120 | "author" : "xcode"
121 | }
122 | }
123 |
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FlutterSmith/responsive_dash_board/6f973aca5b8ec8304c3a2927c6172fb9bf3fe927/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/FlutterSmith/responsive_dash_board/6f973aca5b8ec8304c3a2927c6172fb9bf3fe927/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/FlutterSmith/responsive_dash_board/6f973aca5b8ec8304c3a2927c6172fb9bf3fe927/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/FlutterSmith/responsive_dash_board/6f973aca5b8ec8304c3a2927c6172fb9bf3fe927/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/FlutterSmith/responsive_dash_board/6f973aca5b8ec8304c3a2927c6172fb9bf3fe927/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/FlutterSmith/responsive_dash_board/6f973aca5b8ec8304c3a2927c6172fb9bf3fe927/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/FlutterSmith/responsive_dash_board/6f973aca5b8ec8304c3a2927c6172fb9bf3fe927/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/FlutterSmith/responsive_dash_board/6f973aca5b8ec8304c3a2927c6172fb9bf3fe927/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/FlutterSmith/responsive_dash_board/6f973aca5b8ec8304c3a2927c6172fb9bf3fe927/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/FlutterSmith/responsive_dash_board/6f973aca5b8ec8304c3a2927c6172fb9bf3fe927/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/FlutterSmith/responsive_dash_board/6f973aca5b8ec8304c3a2927c6172fb9bf3fe927/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/FlutterSmith/responsive_dash_board/6f973aca5b8ec8304c3a2927c6172fb9bf3fe927/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/FlutterSmith/responsive_dash_board/6f973aca5b8ec8304c3a2927c6172fb9bf3fe927/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/FlutterSmith/responsive_dash_board/6f973aca5b8ec8304c3a2927c6172fb9bf3fe927/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/FlutterSmith/responsive_dash_board/6f973aca5b8ec8304c3a2927c6172fb9bf3fe927/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/FlutterSmith/responsive_dash_board/6f973aca5b8ec8304c3a2927c6172fb9bf3fe927/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FlutterSmith/responsive_dash_board/6f973aca5b8ec8304c3a2927c6172fb9bf3fe927/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FlutterSmith/responsive_dash_board/6f973aca5b8ec8304c3a2927c6172fb9bf3fe927/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 | Responsive Dash Board
9 | CFBundleExecutable
10 | $(EXECUTABLE_NAME)
11 | CFBundleIdentifier
12 | $(PRODUCT_BUNDLE_IDENTIFIER)
13 | CFBundleInfoDictionaryVersion
14 | 6.0
15 | CFBundleName
16 | responsive_dash_board
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/main.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 | import 'package:responsive_dash_board/views/dashboard_view.dart';
3 |
4 | void main() {
5 | runApp(const ResponsiveDashBoard());
6 | }
7 |
8 | class ResponsiveDashBoard extends StatelessWidget {
9 | const ResponsiveDashBoard({super.key});
10 |
11 | @override
12 | Widget build(BuildContext context) {
13 | return const MaterialApp(
14 | debugShowCheckedModeBanner: false,
15 | title: 'Responsive Dash Board',
16 | home: DashBoardView(),
17 | );
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/lib/models/all_expenses_item_model.dart:
--------------------------------------------------------------------------------
1 | class AllExpensesItemModel {
2 | final String image;
3 | final String title;
4 | final String subtitle;
5 | final String price;
6 |
7 | const AllExpensesItemModel(
8 | {required this.image,
9 | required this.title,
10 | required this.subtitle,
11 | required this.price});
12 | }
13 |
--------------------------------------------------------------------------------
/lib/models/drawer_item_model.dart:
--------------------------------------------------------------------------------
1 | class DrawerItemModel {
2 | final String title;
3 | final String image;
4 |
5 | const DrawerItemModel({required this.title, required this.image});
6 | }
7 |
--------------------------------------------------------------------------------
/lib/models/income_details_model.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 |
3 | class IncomeDetailsModel {
4 | final Color color;
5 | final String title;
6 | final String value;
7 |
8 | const IncomeDetailsModel(
9 | {required this.color, required this.title, required this.value});
10 | }
11 |
--------------------------------------------------------------------------------
/lib/models/transation_model.dart:
--------------------------------------------------------------------------------
1 | class TransactionModel {
2 | final String title;
3 | final String amount;
4 | final String date;
5 | final bool isWithdrawal;
6 |
7 | const TransactionModel(
8 | {required this.title,
9 | required this.amount,
10 | required this.date,
11 | required this.isWithdrawal});
12 | }
13 |
--------------------------------------------------------------------------------
/lib/models/user_info_model.dart:
--------------------------------------------------------------------------------
1 | class UserInfoModel {
2 | final String title;
3 | final String subtitle;
4 | final String image;
5 |
6 | const UserInfoModel(
7 | {required this.title, required this.subtitle, required this.image});
8 | }
9 |
--------------------------------------------------------------------------------
/lib/utils/app_images.dart:
--------------------------------------------------------------------------------
1 | class Assets {
2 | Assets._();
3 |
4 | /// Assets for imagesBalance
5 | /// assets/images/balance.svg
6 | static const String imagesBalance = "assets/images/balance.svg";
7 |
8 | /// Assets for imagesDashboard
9 | /// assets/images/dashboard.svg
10 | static const String imagesDashboard = "assets/images/dashboard.svg";
11 |
12 | /// Assets for imagesExpenses
13 | /// assets/images/expenses.svg
14 | static const String imagesExpenses = "assets/images/expenses.svg";
15 |
16 | /// Assets for imagesFrame
17 | /// assets/images/Frame.svg
18 | static const String imagesFrame = "assets/images/Frame.svg";
19 |
20 | /// Assets for imagesFrame1
21 | /// assets/images/Frame1.svg
22 | static const String imagesFrame1 = "assets/images/Frame1.svg";
23 |
24 | /// Assets for imagesFrame3
25 | /// assets/images/Frame3.svg
26 | static const String imagesFrame3 = "assets/images/Frame3.svg";
27 |
28 | /// Assets for imagesFrameArrowDown
29 | /// assets/images/frameArrowDown.svg
30 | static const String imagesFrameArrowDown = "assets/images/frameArrowDown.svg";
31 |
32 | /// Assets for imagesGallery
33 | /// assets/images/gallery.svg
34 | static const String imagesGallery = "assets/images/gallery.svg";
35 |
36 | /// Assets for imagesIncome
37 | /// assets/images/income.svg
38 | static const String imagesIncome = "assets/images/income.svg";
39 |
40 | /// Assets for imagesLogout
41 | /// assets/images/logout.svg
42 | static const String imagesLogout = "assets/images/logout.svg";
43 |
44 | /// Assets for imagesMaskGroup
45 | /// assets/images/Mask_group.svg
46 | static const String imagesMaskGroup = "assets/images/Mask_group.svg";
47 |
48 | /// Assets for imagesMaskGroup
49 | /// assets/images/mask_group.png
50 | static const String imagesMaskGroup1 = "assets/images/mask_group.png";
51 |
52 | /// Assets for imagesMyInvestments
53 | /// assets/images/myInvestments.svg
54 | static const String imagesMyInvestments = "assets/images/myInvestments.svg";
55 |
56 | /// Assets for imagesMyTransaction
57 | /// assets/images/myTransaction.svg
58 | static const String imagesMyTransaction = "assets/images/myTransaction.svg";
59 |
60 | /// Assets for imagesSettingSystem
61 | /// assets/images/settingSystem.svg
62 | static const String imagesSettingSystem = "assets/images/settingSystem.svg";
63 |
64 | /// Assets for imagesStatistics
65 | /// assets/images/statistics.svg
66 | static const String imagesStatistics = "assets/images/statistics.svg";
67 |
68 | /// Assets for imagesWallet
69 | /// assets/images/wallet.svg
70 | static const String imagesWallet = "assets/images/wallet.svg";
71 | }
72 |
73 |
--------------------------------------------------------------------------------
/lib/utils/app_styles.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/foundation.dart';
2 | import 'package:flutter/material.dart';
3 | import 'package:responsive_dash_board/utils/size_config.dart';
4 |
5 | // abstract class AppStyles {
6 | // static TextStyle styleSimiBold24 = TextStyle(
7 | // fontSize: getResponsiveFontSize(fontSize: 24),
8 | // fontWeight: FontWeight.w600,
9 | // fontFamily: 'Montserrat',
10 | // color: const Color(0xff4eb7f2),
11 | // );
12 | // static TextStyle styleSimiBold20 = TextStyle(
13 | // fontSize: getResponsiveFontSize(fontSize: 20),
14 | // fontWeight: FontWeight.w600,
15 | // fontFamily: 'Montserrat',
16 | // color: const Color(0xff064061),
17 | // );
18 | // static TextStyle styleMedium20 = TextStyle(
19 | // fontSize: getResponsiveFontSize(fontSize: 20),
20 | // fontWeight: FontWeight.w500,
21 | // fontFamily: 'Montserrat',
22 | // color: const Color(0xffFFFFFF),
23 | // );
24 | // static TextStyle styleSimiBold18 = TextStyle(
25 | // fontSize: getResponsiveFontSize(fontSize: 18),
26 | // fontWeight: FontWeight.w600,
27 | // fontFamily: 'Montserrat',
28 | // color: const Color(0xff4eb7f2),
29 | // );
30 |
31 | // static TextStyle styleRegular16 = TextStyle(
32 | // fontSize: getResponsiveFontSize(fontSize: 16),
33 | // fontWeight: FontWeight.w400,
34 | // fontFamily: 'Montserrat',
35 | // color: const Color(0xff064061),
36 | // );
37 | // static TextStyle styleMedium16 = TextStyle(
38 | // fontSize: getResponsiveFontSize(fontSize: 16),
39 | // fontWeight: FontWeight.w500,
40 | // fontFamily: 'Montserrat',
41 | // color: const Color(0xff064061),
42 | // );
43 | // static TextStyle styleSimiBold16 = TextStyle(
44 | // fontSize: getResponsiveFontSize(fontSize: 16),
45 | // fontWeight: FontWeight.w600,
46 | // fontFamily: 'Montserrat',
47 | // color: const Color(0xff4eb7f2),
48 | // );
49 | // static TextStyle styleBold16 = TextStyle(
50 | // fontSize: getResponsiveFontSize(fontSize: 16),
51 | // fontWeight: FontWeight.w700,
52 | // fontFamily: 'Montserrat',
53 | // color: const Color(0xff064061),
54 | // );
55 | // static TextStyle styleRegular14 = TextStyle(
56 | // fontSize: getResponsiveFontSize(fontSize: 14),
57 | // fontWeight: FontWeight.w400,
58 | // fontFamily: 'Montserrat',
59 | // color: const Color(0xff064061),
60 | // );
61 |
62 | // static TextStyle styleRegular12 = TextStyle(
63 | // fontSize: getResponsiveFontSize(fontSize: 12),
64 | // fontWeight: FontWeight.w400,
65 | // fontFamily: 'Montserrat',
66 | // color: const Color(0xffAAAAAA),
67 | // );
68 | // }
69 |
70 | // ScaleFactor with context
71 | // Responsive Font Size
72 | // (min, max) font Size
73 |
74 | double getResponsiveFontSize(BuildContext context, {required double fontSize}) {
75 | double scaleFactor = getScaleFactor(context);
76 | double responsiveFontSize = fontSize * scaleFactor;
77 |
78 | double lowerLimit = fontSize * 0.7;
79 | double upperLimit = fontSize * 1.2;
80 | return responsiveFontSize.clamp(lowerLimit, upperLimit);
81 | }
82 |
83 | double getScaleFactor(context) {
84 | double width = MediaQuery.sizeOf(context).width;
85 |
86 | if (width < SizeConfig.tablet) {
87 | return width / 550;
88 | } else if (width < SizeConfig.desktop) {
89 | return width / 1000;
90 | } else {
91 | return width / 2000;
92 | }
93 | }
94 |
95 | // with no context
96 | // double getResponsiveFontSize({required double fontSize}) {
97 | // double scaleFactor = getScaleFactor();
98 | // double responsiveFontSize = fontSize * scaleFactor;
99 |
100 | // double lowerLimit = fontSize * 0.8;
101 | // double upperLimit = fontSize * 1.2;
102 | // return responsiveFontSize.clamp(lowerLimit, upperLimit);
103 | // }
104 |
105 | // double getScaleFactor() {
106 | // var dispatcher = PlatformDispatcher.instance;
107 | // var physicalWidth = dispatcher.views.first.physicalSize.width;
108 | // var deviceRatio = dispatcher.views.first.devicePixelRatio;
109 | // double width = physicalWidth / deviceRatio;
110 |
111 | // if (width < SizeConfig.tablet) {
112 | // return width / 550;
113 | // } else if (width < SizeConfig.desktop) {
114 | // return width / 1000;
115 | // } else {
116 | // return width / 1920;
117 | // }
118 | // }
119 |
120 | abstract class AppStyles {
121 | static TextStyle styleSimiBold24(context) {
122 | return TextStyle(
123 | fontSize: getResponsiveFontSize(context, fontSize: 24),
124 | fontWeight: FontWeight.w600,
125 | fontFamily: 'Montserrat',
126 | color: const Color(0xff4eb7f2),
127 | );
128 | }
129 |
130 | static TextStyle styleSimiBold20(BuildContext context) {
131 | return TextStyle(
132 | fontSize: getResponsiveFontSize(context, fontSize: 20),
133 | fontWeight: FontWeight.w600,
134 | fontFamily: 'Montserrat',
135 | color: const Color(0xff064061),
136 | );
137 | }
138 |
139 | static TextStyle styleMedium20(BuildContext context) {
140 | return TextStyle(
141 | fontSize: getResponsiveFontSize(context, fontSize: 20),
142 | fontWeight: FontWeight.w500,
143 | fontFamily: 'Montserrat',
144 | color: const Color(0xffFFFFFF),
145 | );
146 | }
147 |
148 | static TextStyle styleSimiBold18(BuildContext context) {
149 | return TextStyle(
150 | fontSize: getResponsiveFontSize(context, fontSize: 18),
151 | fontWeight: FontWeight.w600,
152 | fontFamily: 'Montserrat',
153 | color: const Color(0xff4eb7f2),
154 | );
155 | }
156 |
157 | static TextStyle styleRegular16(BuildContext context) {
158 | return TextStyle(
159 | fontSize: getResponsiveFontSize(context, fontSize: 16),
160 | fontWeight: FontWeight.w400,
161 | fontFamily: 'Montserrat',
162 | color: const Color(0xff064061),
163 | );
164 | }
165 |
166 | static TextStyle styleMedium16(BuildContext context) {
167 | return TextStyle(
168 | fontSize: getResponsiveFontSize(context, fontSize: 16),
169 | fontWeight: FontWeight.w500,
170 | fontFamily: 'Montserrat',
171 | color: const Color(0xff064061),
172 | );
173 | }
174 |
175 | static TextStyle styleSimiBold16(BuildContext context) {
176 | return TextStyle(
177 | fontSize: getResponsiveFontSize(context, fontSize: 16),
178 | fontWeight: FontWeight.w600,
179 | fontFamily: 'Montserrat',
180 | color: const Color(0xff4eb7f2),
181 | );
182 | }
183 |
184 | static TextStyle styleBold16(BuildContext context) {
185 | return TextStyle(
186 | fontSize: getResponsiveFontSize(context, fontSize: 16),
187 | fontWeight: FontWeight.w700,
188 | fontFamily: 'Montserrat',
189 | color: const Color(0xff064061),
190 | );
191 | }
192 |
193 | static TextStyle styleRegular14(BuildContext context) {
194 | return TextStyle(
195 | fontSize: getResponsiveFontSize(context, fontSize: 14),
196 | fontWeight: FontWeight.w400,
197 | fontFamily: 'Montserrat',
198 | color: const Color(0xff064061),
199 | );
200 | }
201 |
202 | static TextStyle styleRegular12(BuildContext context) {
203 | return TextStyle(
204 | fontSize: getResponsiveFontSize(context, fontSize: 12),
205 | fontWeight: FontWeight.w400,
206 | fontFamily: 'Montserrat',
207 | color: const Color(0xffAAAAAA),
208 | );
209 | }
210 | }
211 |
--------------------------------------------------------------------------------
/lib/utils/size_config.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 |
3 | class SizeConfig {
4 | static const double desktop = 1200;
5 | static const double tablet = 800;
6 | static const double mobile = 480;
7 |
8 | static late double width;
9 | static late double height;
10 |
11 | static init(BuildContext context) {
12 | width = MediaQuery.of(context).size.width;
13 | height = MediaQuery.of(context).size.height;
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/lib/views/dashboard_tablet_layout.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 | import 'package:responsive_dash_board/views/widgets/custom_drawer.dart';
3 | import 'package:responsive_dash_board/views/widgets/dashboard_mobile_layout.dart';
4 |
5 | class DashboardTabletLayout extends StatelessWidget {
6 | const DashboardTabletLayout({super.key});
7 |
8 | @override
9 | Widget build(BuildContext context) {
10 | return const Row(
11 | children: [
12 | SizedBox(
13 | height: 40,
14 | ),
15 | Expanded(
16 | flex: 2,
17 | child: CustomDrawer(),
18 | ),
19 | SizedBox(
20 | width: 32,
21 | ),
22 | Expanded(
23 | flex: 5,
24 | child: Padding(
25 | padding: EdgeInsets.only(top: 10.0),
26 | child: DashboardMobileLayout(),
27 | ),
28 | ),
29 | SizedBox(
30 | width: 32,
31 | ),
32 | ],
33 | );
34 | }
35 | }
36 |
--------------------------------------------------------------------------------
/lib/views/dashboard_view.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 | import 'package:responsive_dash_board/utils/size_config.dart';
3 | import 'package:responsive_dash_board/views/dashboard_tablet_layout.dart';
4 | import 'package:responsive_dash_board/views/widgets/adaptive_layout_widget.dart';
5 | import 'package:responsive_dash_board/views/widgets/custom_drawer.dart';
6 | import 'package:responsive_dash_board/views/widgets/dashboard_desktop_layout.dart';
7 | import 'package:responsive_dash_board/views/widgets/dashboard_mobile_layout.dart';
8 |
9 | class DashBoardView extends StatefulWidget {
10 | const DashBoardView({super.key});
11 |
12 | @override
13 | State createState() => _DashBoardViewState();
14 | }
15 |
16 | class _DashBoardViewState extends State {
17 | final GlobalKey scaffoldKey = GlobalKey();
18 |
19 | @override
20 | Widget build(BuildContext context) {
21 | SizeConfig.init(context);
22 | return Scaffold(
23 | key: scaffoldKey,
24 | appBar: SizeConfig.width < SizeConfig.tablet
25 | ? AppBar(
26 | backgroundColor: const Color(0xffF7F9FA),
27 | elevation: 0,
28 | leading: IconButton(
29 | onPressed: () {
30 | scaffoldKey.currentState!.openDrawer();
31 | },
32 | icon: const Icon(Icons.menu),
33 | ),
34 | )
35 | : null,
36 | drawer:
37 | SizeConfig.width < SizeConfig.tablet ? const CustomDrawer() : null,
38 | backgroundColor: const Color(0xffF7F9FA),
39 | body: AdaptiveLayout(
40 | mobileLayout: (context) => const DashboardMobileLayout(),
41 | tabletLayout: (context) => const DashboardTabletLayout(),
42 | desktopLayout: (context) => const DashboardDesktopLayout(),
43 | ),
44 | );
45 | }
46 | }
47 |
--------------------------------------------------------------------------------
/lib/views/widgets/active_and_inactive_all_expenses_item.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 | import 'package:responsive_dash_board/models/all_expenses_item_model.dart';
3 | import 'package:responsive_dash_board/utils/app_styles.dart';
4 | import 'package:responsive_dash_board/views/widgets/all_expenses_item_header.dart';
5 |
6 | class InActiveAllExpensesItem extends StatelessWidget {
7 | const InActiveAllExpensesItem({
8 | super.key,
9 | required this.itemModel,
10 | });
11 |
12 | final AllExpensesItemModel itemModel;
13 |
14 | @override
15 | Widget build(BuildContext context) {
16 | return Container(
17 | padding: const EdgeInsets.symmetric(horizontal: 20, vertical: 16),
18 | decoration: ShapeDecoration(
19 | color: Colors.white,
20 | shape: RoundedRectangleBorder(
21 | side: const BorderSide(width: 1, color: Color(0xFFF1F1F1)),
22 | borderRadius: BorderRadius.circular(12),
23 | ),
24 | ),
25 | child: Column(
26 | crossAxisAlignment: CrossAxisAlignment.start,
27 | children: [
28 | AllExpensesItemHeader(
29 | image: itemModel.image,
30 | ),
31 | const SizedBox(
32 | height: 34,
33 | ),
34 | FittedBox(
35 | fit: BoxFit.scaleDown,
36 | child: Text(
37 | itemModel.title,
38 | style: AppStyles.styleSimiBold16(context).copyWith(
39 | color: const Color(0xff064061),
40 | ),
41 | ),
42 | ),
43 | const SizedBox(
44 | height: 8,
45 | ),
46 | FittedBox(
47 | fit: BoxFit.scaleDown,
48 | child: Text(
49 | itemModel.subtitle,
50 | style: AppStyles.styleRegular14(context).copyWith(
51 | color: const Color(0xffAAAAAA),
52 | ),
53 | ),
54 | ),
55 | const SizedBox(
56 | height: 16,
57 | ),
58 | FittedBox(
59 | fit: BoxFit.scaleDown,
60 | child: Text(
61 | itemModel.price,
62 | style: AppStyles.styleSimiBold24(context).copyWith(
63 | color: const Color(0xFF4DB7F2),
64 | ),
65 | ),
66 | ),
67 | const SizedBox(
68 | height: 16,
69 | ),
70 | ],
71 | ),
72 | );
73 | }
74 | }
75 |
76 | class ActiveAllExpensesItem extends StatelessWidget {
77 | const ActiveAllExpensesItem({
78 | super.key,
79 | required this.itemModel,
80 | });
81 |
82 | final AllExpensesItemModel itemModel;
83 |
84 | @override
85 | Widget build(BuildContext context) {
86 | return Container(
87 | padding: const EdgeInsets.symmetric(horizontal: 20, vertical: 16),
88 | decoration: ShapeDecoration(
89 | color: const Color(0xFF4DB7F2),
90 | shape: RoundedRectangleBorder(
91 | side: const BorderSide(width: 1, color: Color(0xFF4DB7F2)),
92 | borderRadius: BorderRadius.circular(12),
93 | ),
94 | ),
95 | child: Column(
96 | crossAxisAlignment: CrossAxisAlignment.start,
97 | children: [
98 | AllExpensesItemHeader(
99 | imageBackGround: Colors.white.withOpacity(0.10000000149011612),
100 | imageColor: Colors.white,
101 | image: itemModel.image,
102 | ),
103 | const SizedBox(
104 | height: 34,
105 | ),
106 | FittedBox(
107 | fit: BoxFit.scaleDown,
108 | child: Text(
109 | itemModel.title,
110 | style: AppStyles.styleSimiBold16(context).copyWith(
111 | color: Colors.white,
112 | ),
113 | ),
114 | ),
115 | const SizedBox(
116 | height: 8,
117 | ),
118 | FittedBox(
119 | fit: BoxFit.scaleDown,
120 | child: Text(
121 | itemModel.subtitle,
122 | style: AppStyles.styleRegular14(context).copyWith(
123 | color: const Color(0xFFFAFAFA),
124 | ),
125 | ),
126 | ),
127 | const SizedBox(
128 | height: 16,
129 | ),
130 | FittedBox(
131 | fit: BoxFit.scaleDown,
132 | child: Text(
133 | itemModel.price,
134 | style: AppStyles.styleSimiBold24(context).copyWith(
135 | color: Colors.white,
136 | ),
137 | ),
138 | ),
139 | const SizedBox(
140 | height: 16,
141 | ),
142 | ],
143 | ),
144 | );
145 | }
146 | }
147 |
--------------------------------------------------------------------------------
/lib/views/widgets/active_and_inactive_item.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 | import 'package:flutter_svg/svg.dart';
3 | import 'package:responsive_dash_board/models/drawer_item_model.dart';
4 | import 'package:responsive_dash_board/utils/app_styles.dart';
5 |
6 | class InActiveDrawerItem extends StatelessWidget {
7 | const InActiveDrawerItem({
8 | super.key,
9 | required this.drawerItemModel,
10 | });
11 |
12 | final DrawerItemModel drawerItemModel;
13 |
14 | @override
15 | Widget build(BuildContext context) {
16 | return AnimatedSwitcher(
17 | duration: const Duration(milliseconds: 300),
18 | child: ListTile(
19 | leading: SvgPicture.asset(drawerItemModel.image),
20 | title: FittedBox(
21 | alignment: AlignmentDirectional.centerStart,
22 | fit: BoxFit.scaleDown,
23 | child: Text(
24 | drawerItemModel.title,
25 | style: AppStyles.styleRegular16(context),
26 | ),
27 | ),
28 | ),
29 | );
30 | }
31 | }
32 |
33 | class ActiveDrawerItem extends StatelessWidget {
34 | const ActiveDrawerItem({
35 | super.key,
36 | required this.drawerItemModel,
37 | });
38 |
39 | final DrawerItemModel drawerItemModel;
40 |
41 | @override
42 | Widget build(BuildContext context) {
43 | return ListTile(
44 | leading: SvgPicture.asset(drawerItemModel.image),
45 | title: FittedBox(
46 | alignment: AlignmentDirectional.centerStart,
47 | fit: BoxFit.scaleDown,
48 | child: Text(
49 | drawerItemModel.title,
50 | style: AppStyles.styleBold16(context)
51 | .copyWith(color: const Color(0xff4EB7F2)),
52 | ),
53 | ),
54 | trailing: Container(
55 | width: 3,
56 | decoration: const BoxDecoration(
57 | color: Color(0xff4EB7F2),
58 | ),
59 | ),
60 | );
61 | }
62 | }
63 |
--------------------------------------------------------------------------------
/lib/views/widgets/adaptive_layout_widget.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 |
3 | class AdaptiveLayout extends StatelessWidget {
4 | const AdaptiveLayout({
5 | super.key,
6 | required this.mobileLayout,
7 | required this.tabletLayout,
8 | required this.desktopLayout,
9 | });
10 |
11 | final WidgetBuilder mobileLayout;
12 | final WidgetBuilder tabletLayout;
13 | final WidgetBuilder desktopLayout;
14 |
15 | @override
16 | Widget build(BuildContext context) {
17 | return LayoutBuilder(builder: (context, constraints) {
18 | if (constraints.maxWidth < 800) {
19 | return mobileLayout(context);
20 | } else if (constraints.maxWidth < 1200) {
21 | return tabletLayout(context);
22 | } else {
23 | return desktopLayout(context);
24 | }
25 | });
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/lib/views/widgets/all_expenses.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 | import 'package:responsive_dash_board/views/widgets/all_expenses_header.dart';
3 | import 'package:responsive_dash_board/views/widgets/all_expenses_item_list_view.dart';
4 | import 'package:responsive_dash_board/views/widgets/custom_background_container.dart';
5 |
6 | class AllExpensesSection extends StatelessWidget {
7 | const AllExpensesSection({super.key});
8 |
9 | @override
10 | Widget build(BuildContext context) {
11 | return const CustomBackgroundContainer(
12 | padding: 20,
13 | child: Column(
14 | children: [
15 | AllExpensesHeader(),
16 | SizedBox(
17 | height: 16,
18 | ),
19 | AllExpensesItemListView(),
20 | ],
21 | ),
22 | );
23 | }
24 | }
25 |
--------------------------------------------------------------------------------
/lib/views/widgets/all_expenses_header.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 | import 'package:flutter/widgets.dart';
3 | import 'package:responsive_dash_board/utils/app_styles.dart';
4 | import 'package:responsive_dash_board/views/widgets/custom_expenses_date_widget.dart';
5 |
6 | class AllExpensesHeader extends StatelessWidget {
7 | const AllExpensesHeader({super.key});
8 |
9 | @override
10 | Widget build(BuildContext context) {
11 | return Row(
12 | children: [
13 | Text(
14 | 'All Expenses',
15 | style: AppStyles.styleSimiBold20(context),
16 | ),
17 | Expanded(child: SizedBox()),
18 | CustomExpensesDateWidget(),
19 | ],
20 | );
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/lib/views/widgets/all_expenses_item.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 | import 'package:responsive_dash_board/models/all_expenses_item_model.dart';
3 | import 'package:responsive_dash_board/views/widgets/active_and_inactive_all_expenses_item.dart';
4 |
5 | class AllExpensesItem extends StatelessWidget {
6 | const AllExpensesItem(
7 | {super.key, required this.itemModel, required this.isSelected});
8 |
9 | final AllExpensesItemModel itemModel;
10 | final bool isSelected;
11 |
12 | @override
13 | Widget build(BuildContext context) {
14 | return AnimatedCrossFade(
15 | crossFadeState:
16 | isSelected ? CrossFadeState.showFirst : CrossFadeState.showSecond,
17 | duration: const Duration(milliseconds: 550),
18 | firstChild: ActiveAllExpensesItem(itemModel: itemModel),
19 | secondChild: InActiveAllExpensesItem(itemModel: itemModel),
20 | );
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/lib/views/widgets/all_expenses_item_header.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 | import 'package:flutter_svg/svg.dart';
3 |
4 | class AllExpensesItemHeader extends StatelessWidget {
5 | const AllExpensesItemHeader(
6 | {super.key, required this.image, this.imageBackGround, this.imageColor});
7 | final String image;
8 | final Color? imageBackGround, imageColor;
9 |
10 | @override
11 | Widget build(BuildContext context) {
12 | return Row(
13 | children: [
14 | Flexible(
15 | child: ConstrainedBox(
16 | constraints: const BoxConstraints(maxHeight: 60, maxWidth: 60 ),
17 | child: AspectRatio(
18 | aspectRatio: 1,
19 | child: Container(
20 | decoration: ShapeDecoration(
21 | color: imageBackGround ?? const Color(0xFFFAFAFA),
22 | shape: const OvalBorder(),
23 | ),
24 | child: Center(
25 | child: SvgPicture.asset(
26 | image,
27 | colorFilter: ColorFilter.mode(
28 | imageColor ?? const Color(0xFF4EB7F2), BlendMode.srcIn),
29 | )),
30 | ),
31 | ),
32 | ),
33 | ),
34 | const Expanded(child: SizedBox()),
35 | Transform.rotate(
36 | angle: 180 * 3.14 / 180,
37 | child: Icon(
38 | Icons.arrow_back_ios_new_outlined,
39 | color: imageColor == null ? const Color(0xFF064061) : Colors.white,
40 | ),
41 | ),
42 | ],
43 | );
44 | }
45 | }
46 |
--------------------------------------------------------------------------------
/lib/views/widgets/all_expenses_item_list_view.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 | import 'package:responsive_dash_board/models/all_expenses_item_model.dart';
3 | import 'package:responsive_dash_board/utils/app_images.dart';
4 | import 'package:responsive_dash_board/views/widgets/all_expenses_item.dart';
5 |
6 | class AllExpensesItemListView extends StatefulWidget {
7 | const AllExpensesItemListView({super.key});
8 |
9 | @override
10 | State createState() =>
11 | _AllExpensesItemListViewState();
12 | }
13 |
14 | class _AllExpensesItemListViewState extends State {
15 | final items = [
16 | const AllExpensesItemModel(
17 | image: Assets.imagesBalance,
18 | title: 'Balance',
19 | subtitle: 'April 2022',
20 | price: r'$20,200',
21 | ),
22 | const AllExpensesItemModel(
23 | image: Assets.imagesIncome,
24 | title: 'Income',
25 | subtitle: 'April 2024',
26 | price: r'$20,200'),
27 | const AllExpensesItemModel(
28 | image: Assets.imagesExpenses,
29 | title: 'Expenses',
30 | subtitle: 'April 2024',
31 | price: r'$20,200'),
32 | ];
33 |
34 | int selectedIndex = 0;
35 |
36 | @override
37 | Widget build(BuildContext context) {
38 | return Row(
39 | children: [
40 | Expanded(
41 | child: GestureDetector(
42 | onTap: () {
43 | updateIndex(0);
44 | },
45 | child: AllExpensesItem(
46 | isSelected: selectedIndex == selectedIndex,
47 | itemModel: items[0]),
48 | ),
49 | ),
50 | const SizedBox(
51 | width: 8,
52 | ),
53 | Expanded(
54 | child: GestureDetector(
55 | onTap: () {
56 | updateIndex(1);
57 | },
58 | child: AllExpensesItem(
59 | isSelected: selectedIndex == 1, itemModel: items[1]),
60 | ),
61 | ),
62 | const SizedBox(
63 | width: 8,
64 | ),
65 | Expanded(
66 | child: GestureDetector(
67 | onTap: () {
68 | updateIndex(2);
69 | },
70 | child: AllExpensesItem(
71 | isSelected: selectedIndex == 2, itemModel: items[2]),
72 | ),
73 | ),
74 | ],
75 | );
76 | // return Row(
77 | // children: items.asMap().entries.map((e) {
78 | // int index = e.key;
79 | // var item = e.value;
80 |
81 | // return Expanded(
82 | // child: GestureDetector(
83 | // onTap: () {
84 | // updateIndex(index);
85 | // },
86 | // child: Padding(
87 | // padding: EdgeInsets.symmetric(horizontal: index == 1 ? 12.0 : 0),
88 | // child: AllExpensesItem(
89 | // isSelected: selectedIndex == index, itemModel: item),
90 | // ),
91 | // ),
92 | // );
93 | // }).toList());
94 | }
95 |
96 | void updateIndex(int index) {
97 | setState(() {
98 | selectedIndex = index;
99 | });
100 | }
101 | }
102 |
--------------------------------------------------------------------------------
/lib/views/widgets/all_expenses_widget.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 | import 'package:responsive_dash_board/views/widgets/all_expenses.dart';
3 | import 'package:responsive_dash_board/views/widgets/quick_invoice.dart';
4 |
5 | class AllExpensesAndQuickInvoiceWidget extends StatelessWidget {
6 | const AllExpensesAndQuickInvoiceWidget({
7 | super.key,
8 | });
9 |
10 | @override
11 | Widget build(BuildContext context) {
12 | return const Column(
13 | children: [
14 | AllExpensesSection(),
15 | SizedBox(
16 | height: 24,
17 | ),
18 | QuickInvoice(),
19 | ],
20 | );
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/lib/views/widgets/custom_background_container.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 |
3 | class CustomBackgroundContainer extends StatelessWidget {
4 | const CustomBackgroundContainer({
5 | super.key,
6 | required this.child,
7 | this.padding,
8 | });
9 |
10 | final Widget child;
11 | final double? padding;
12 |
13 | @override
14 | Widget build(BuildContext context) {
15 | return Container(
16 | padding: EdgeInsets.all(padding ?? 20),
17 | decoration: ShapeDecoration(
18 | color: Colors.white,
19 | shape: RoundedRectangleBorder(
20 | borderRadius: BorderRadius.circular(12),
21 | ),
22 | ),
23 | child: child,
24 | );
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/lib/views/widgets/custom_button.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 | import 'package:responsive_dash_board/utils/app_styles.dart';
3 |
4 | class CustomButton extends StatelessWidget {
5 | const CustomButton({super.key, required this.text, required this.backgroundColor, required this.textColor});
6 | final String text;
7 | final Color backgroundColor;
8 | final Color textColor;
9 |
10 | @override
11 | Widget build(BuildContext context) {
12 | return SizedBox(
13 | height: 62,
14 | child: ElevatedButton(
15 | style: ElevatedButton.styleFrom(
16 | backgroundColor: backgroundColor,
17 | shape: RoundedRectangleBorder(
18 | borderRadius: BorderRadius.circular(12),
19 | ),
20 | elevation: 0,
21 | ),
22 | onPressed: () {},
23 | child: Text(
24 | text,
25 | style: AppStyles.styleSimiBold18(context).copyWith(
26 | color: textColor,
27 | ),
28 | ),
29 | ),
30 | );
31 | }
32 | }
33 |
--------------------------------------------------------------------------------
/lib/views/widgets/custom_dot.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 |
3 | class CustomDotIndicator extends StatelessWidget {
4 | const CustomDotIndicator({super.key, required this.isActive});
5 |
6 | final bool isActive;
7 |
8 | @override
9 | Widget build(BuildContext context) {
10 | return AnimatedContainer(
11 | duration: const Duration(milliseconds: 500),
12 | width: isActive ? 32 : 8,
13 | height: 8,
14 | decoration: ShapeDecoration(
15 | color: isActive ? const Color(0xff4EB7F2) : const Color(0xffE8E8E8),
16 | shape: RoundedRectangleBorder(
17 | borderRadius: BorderRadius.circular(12),
18 | )));
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/lib/views/widgets/custom_drawer.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/cupertino.dart';
2 | import 'package:flutter/material.dart';
3 | import 'package:flutter/widgets.dart';
4 | import 'package:responsive_dash_board/models/drawer_item_model.dart';
5 | import 'package:responsive_dash_board/models/user_info_model.dart';
6 | import 'package:responsive_dash_board/utils/app_images.dart';
7 | import 'package:responsive_dash_board/views/widgets/active_and_inactive_item.dart';
8 | import 'package:responsive_dash_board/views/widgets/drawer_item_list_view.dart';
9 | import 'package:responsive_dash_board/views/widgets/user_info_list_tile.dart';
10 |
11 | class CustomDrawer extends StatelessWidget {
12 | const CustomDrawer({super.key});
13 |
14 | @override
15 | Widget build(BuildContext context) {
16 | return Container(
17 | width: MediaQuery.sizeOf(context).width * 0.5,
18 | color: const Color(0xFFFFFFFF),
19 | child: const CustomScrollView(
20 | slivers: [
21 | SliverToBoxAdapter(
22 | child: UserInfoListTile(
23 | userInfoModel: UserInfoModel(
24 | title: 'Ahmed Hamdy',
25 | subtitle: 'Software Engineer',
26 | image: Assets.imagesFrame),
27 | ),
28 | ),
29 | SliverToBoxAdapter(
30 | child: SizedBox(
31 | height: 8,
32 | ),
33 | ),
34 | DrawerItemListView(),
35 | SliverFillRemaining(
36 | hasScrollBody: false,
37 | child: Column(
38 | children: [
39 | Expanded(
40 | child: SizedBox(
41 | height: 20,
42 | )),
43 | InActiveDrawerItem(
44 | drawerItemModel: DrawerItemModel(
45 | title: 'Setting system',
46 | image: Assets.imagesSettingSystem,
47 | ),
48 | ),
49 | InActiveDrawerItem(
50 | drawerItemModel: DrawerItemModel(
51 | title: 'Logout account',
52 | image: Assets.imagesLogout,
53 | ),
54 | ),
55 | SizedBox(
56 | height: 48,
57 | ),
58 | ],
59 | ),
60 | ),
61 | ],
62 | ),
63 | );
64 | }
65 | }
66 |
--------------------------------------------------------------------------------
/lib/views/widgets/custom_expenses_date_widget.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 | import 'package:responsive_dash_board/utils/app_styles.dart';
3 |
4 | class CustomExpensesDateWidget extends StatelessWidget {
5 | const CustomExpensesDateWidget({
6 | super.key,
7 | });
8 |
9 | @override
10 | Widget build(BuildContext context) {
11 | return Container(
12 | padding: const EdgeInsets.all(12),
13 | decoration: ShapeDecoration(
14 | color: Colors.white,
15 | shape: RoundedRectangleBorder(
16 | side: const BorderSide(width: 1, color: Color(0xFFF1F1F1)),
17 | borderRadius: BorderRadius.circular(12),
18 | ),
19 | ),
20 | child: Row(
21 | children: [
22 | Text(
23 | 'Monthly',
24 | style: AppStyles.styleMedium16(context),
25 | ),
26 | const SizedBox(
27 | width: 18,
28 | ),
29 | Transform.rotate(
30 | angle: -90 * 3.14 / 180,
31 | child: const Icon(
32 | Icons.arrow_back_ios_new_outlined,
33 | color: Color(0xFF064061),
34 | ),
35 | ),
36 | ],
37 | ),
38 | );
39 | }
40 | }
41 |
--------------------------------------------------------------------------------
/lib/views/widgets/custom_text_field.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 | import 'package:responsive_dash_board/utils/app_styles.dart';
3 |
4 | class CustomTextField extends StatelessWidget {
5 | const CustomTextField({super.key, required this.hint});
6 | final String hint;
7 |
8 | @override
9 | Widget build(BuildContext context) {
10 | return TextField(
11 | decoration: InputDecoration(
12 | fillColor: const Color(0xFFFAFAFA),
13 | filled: true,
14 | hintText: hint,
15 | hintStyle: AppStyles.styleRegular16(context)
16 | .copyWith(color: const Color(0xFFAAAAAA)),
17 | border: buildBorder(),
18 | enabledBorder: buildBorder(),
19 | focusedBorder: buildBorder(),
20 | ),
21 | );
22 | }
23 |
24 | OutlineInputBorder buildBorder() {
25 | return OutlineInputBorder(
26 | borderSide: const BorderSide(
27 | color: Color(0xFFFAFAFA),
28 | ),
29 | borderRadius: BorderRadius.circular(12),
30 | );
31 | }
32 | }
33 |
--------------------------------------------------------------------------------
/lib/views/widgets/dashboard_desktop_layout.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 | import 'package:responsive_dash_board/views/widgets/all_expenses_widget.dart';
3 | import 'package:responsive_dash_board/views/widgets/custom_drawer.dart';
4 | import 'package:responsive_dash_board/views/widgets/income_section.dart';
5 | import 'package:responsive_dash_board/views/widgets/my_cards_and_transaction_section.dart';
6 |
7 | class DashboardDesktopLayout extends StatelessWidget {
8 | const DashboardDesktopLayout({super.key});
9 |
10 | @override
11 | Widget build(BuildContext context) {
12 | return const Row(
13 | children: [
14 | SizedBox(
15 | height: 40,
16 | ),
17 | Expanded(
18 | flex: 2,
19 | child: CustomDrawer(),
20 | ),
21 | SizedBox(
22 | width: 32,
23 | ),
24 | Expanded(
25 | flex: 6,
26 | child: CustomScrollView(
27 | physics: BouncingScrollPhysics(),
28 | slivers: [
29 | SliverFillRemaining(
30 | hasScrollBody: false,
31 | child: Row(
32 | children: [
33 | Expanded(
34 | flex: 5,
35 | child: Padding(
36 | padding: EdgeInsets.only(top: 10.0),
37 | child: AllExpensesAndQuickInvoiceWidget(),
38 | ),
39 | ),
40 | SizedBox(
41 | width: 24,
42 | ),
43 | Expanded(
44 | flex: 3,
45 | child: Column(
46 | children: [
47 | SizedBox(
48 | height: 10,
49 | ),
50 | MyCardsAndTransactionSection(),
51 | Expanded(
52 | child: InComeSection(),
53 | ),
54 | ],
55 | ),
56 | ),
57 | ],
58 | ),
59 | ),
60 | ],
61 | ),
62 | ),
63 | ],
64 | );
65 | }
66 | }
67 |
--------------------------------------------------------------------------------
/lib/views/widgets/dashboard_mobile_layout.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/gestures.dart';
2 | import 'package:flutter/material.dart';
3 | import 'package:responsive_dash_board/views/widgets/all_expenses_widget.dart';
4 | import 'package:responsive_dash_board/views/widgets/income_section.dart';
5 | import 'package:responsive_dash_board/views/widgets/my_cards_and_transaction_section.dart';
6 |
7 | class DashboardMobileLayout extends StatelessWidget {
8 | const DashboardMobileLayout({
9 | super.key,
10 | });
11 |
12 | @override
13 | Widget build(BuildContext context) {
14 | return ScrollConfiguration(
15 | behavior: const ScrollBehavior().copyWith(
16 | dragDevices: {
17 | PointerDeviceKind.touch,
18 | PointerDeviceKind.mouse,
19 | },
20 | ),
21 | child: const SingleChildScrollView(
22 | child: Column(
23 | children: [
24 | AllExpensesAndQuickInvoiceWidget(),
25 | SizedBox(
26 | height: 24,
27 | ),
28 | MyCardsAndTransactionSection(),
29 | SizedBox(
30 | height: 24,
31 | ),
32 | InComeSection(),
33 | ],
34 | ),
35 | ),
36 | );
37 | }
38 | }
39 |
--------------------------------------------------------------------------------
/lib/views/widgets/dots_indicator.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 | import 'package:responsive_dash_board/views/widgets/custom_dot.dart';
3 |
4 | class DotsIndicator extends StatelessWidget {
5 | const DotsIndicator({super.key, required this.currentPageIndex});
6 |
7 | final int currentPageIndex;
8 |
9 | @override
10 | Widget build(BuildContext context) {
11 | return Row(
12 | children: List.generate(
13 | 3,
14 | (index) => Padding(
15 | padding: const EdgeInsets.only(right: 6),
16 | child: CustomDotIndicator(isActive: index == currentPageIndex),
17 | )),
18 | );
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/lib/views/widgets/drawer_item.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 | import 'package:responsive_dash_board/models/drawer_item_model.dart';
3 | import 'package:responsive_dash_board/views/widgets/active_and_inactive_item.dart';
4 |
5 | class DrawerItem extends StatelessWidget {
6 | const DrawerItem(
7 | {super.key, required this.drawerItemModel, required this.isSelected});
8 |
9 | final DrawerItemModel drawerItemModel;
10 | final bool isSelected;
11 |
12 | @override
13 | Widget build(BuildContext context) {
14 | return isSelected
15 | ? ActiveDrawerItem(drawerItemModel: drawerItemModel)
16 | : InActiveDrawerItem(drawerItemModel: drawerItemModel);
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/lib/views/widgets/drawer_item_list_view.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 | import 'package:responsive_dash_board/models/drawer_item_model.dart';
3 | import 'package:responsive_dash_board/utils/app_images.dart';
4 | import 'package:responsive_dash_board/views/widgets/drawer_item.dart';
5 |
6 | class DrawerItemListView extends StatefulWidget {
7 | const DrawerItemListView({
8 | super.key,
9 | });
10 |
11 | @override
12 | State createState() => _DrawerItemListViewState();
13 | }
14 |
15 | class _DrawerItemListViewState extends State {
16 | int selectedIndex = 0;
17 | final List drawerItems = [
18 | const DrawerItemModel(title: 'Dashboard', image: Assets.imagesDashboard),
19 | const DrawerItemModel(
20 | title: 'My Transaction', image: Assets.imagesMyTransaction),
21 | const DrawerItemModel(title: 'Statistics', image: Assets.imagesStatistics),
22 | const DrawerItemModel(title: 'Wallet Account', image: Assets.imagesWallet),
23 | const DrawerItemModel(
24 | title: 'My Investments', image: Assets.imagesMyInvestments),
25 | ];
26 | @override
27 | Widget build(BuildContext context) {
28 | return SliverList.builder(
29 |
30 | itemCount: drawerItems.length,
31 | itemBuilder: (context, index) {
32 | return GestureDetector(
33 | onTap: () {
34 | if (selectedIndex != index) {
35 | setState(() {
36 | selectedIndex = index;
37 | });
38 | }
39 | },
40 | child: Padding(
41 | padding: const EdgeInsets.only(top: 20),
42 | child: DrawerItem(
43 | drawerItemModel: drawerItems[index],
44 | isSelected: selectedIndex == index),
45 | ),
46 | );
47 | });
48 | }
49 | }
50 |
--------------------------------------------------------------------------------
/lib/views/widgets/income_chart.dart:
--------------------------------------------------------------------------------
1 | import 'package:fl_chart/fl_chart.dart';
2 | import 'package:flutter/material.dart';
3 | import 'package:responsive_dash_board/utils/app_styles.dart';
4 |
5 | class IncomeChart extends StatefulWidget {
6 | const IncomeChart({super.key});
7 |
8 | @override
9 | State createState() => _IncomeChartState();
10 | }
11 |
12 | class _IncomeChartState extends State {
13 | int activeIndex = -1;
14 | @override
15 | Widget build(BuildContext context) {
16 | return AspectRatio(aspectRatio: 1, child: PieChart(getChartData()));
17 | }
18 |
19 | PieChartData getChartData() {
20 | return PieChartData(
21 | pieTouchData: PieTouchData(
22 | enabled: true,
23 | touchCallback: (FlTouchEvent event, pieTouchResponse) {
24 | activeIndex =
25 | pieTouchResponse?.touchedSection?.touchedSectionIndex ?? -1;
26 | setState(() {});
27 | },
28 | ),
29 | sectionsSpace: 0,
30 | sections: [
31 | PieChartSectionData(
32 | titlePositionPercentageOffset: activeIndex == 0 ? -0.8 : null,
33 | showTitle: activeIndex == 0 ? true : false,
34 | color: const Color(0xFF208BC7),
35 | value: 40,
36 | title: '%40',
37 | radius: activeIndex == 0 ? 30 : 10,
38 | titleStyle: AppStyles.styleRegular16(context)
39 | .copyWith(color: activeIndex == 0 ? null : Colors.white),
40 | ),
41 | PieChartSectionData(
42 | titlePositionPercentageOffset: activeIndex == 1 ? -0.8 : null,
43 | showTitle: activeIndex == 1 ? true : false,
44 | color: const Color(0xFF4DB7F2),
45 | value: 25,
46 | title: '25%',
47 | radius: activeIndex == 1 ? 30 : 10,
48 | titleStyle: AppStyles.styleRegular16(context)
49 | .copyWith(color: activeIndex == 1 ? null : Colors.white),
50 | ),
51 | PieChartSectionData(
52 | titlePositionPercentageOffset: activeIndex == 2 ? -0.8 : null,
53 | showTitle: activeIndex == 2 ? true : false,
54 | color: const Color(0xFF064060),
55 | value: 20,
56 | title: '20%',
57 | radius: activeIndex == 2 ? 30 : 10,
58 | titleStyle: AppStyles.styleRegular16(context)
59 | .copyWith(color: activeIndex == 2 ? null : Colors.white),
60 | ),
61 | PieChartSectionData(
62 | titlePositionPercentageOffset: activeIndex == 3 ? -0.8 : null,
63 | showTitle: activeIndex == 3 ? true : false,
64 | color: const Color(0xFFE2DECD),
65 | value: 22,
66 | title: '22%',
67 | radius: activeIndex == 3 ? 30 : 10,
68 | titleStyle: AppStyles.styleRegular16(context)
69 | .copyWith(color: activeIndex == 3 ? null : Colors.white),
70 | ),
71 | ]);
72 | }
73 | }
74 |
--------------------------------------------------------------------------------
/lib/views/widgets/income_chart_less_width.dart:
--------------------------------------------------------------------------------
1 | import 'package:fl_chart/fl_chart.dart';
2 | import 'package:flutter/material.dart';
3 | import 'package:responsive_dash_board/utils/app_styles.dart';
4 |
5 | class IncomeChartLessWidth extends StatefulWidget {
6 | const IncomeChartLessWidth({super.key});
7 |
8 | @override
9 | State createState() => _IncomeChartLessWidthState();
10 | }
11 |
12 | class _IncomeChartLessWidthState extends State {
13 | int activeIndex = -1;
14 | @override
15 | Widget build(BuildContext context) {
16 | return AspectRatio(aspectRatio: 1, child: PieChart(getChartData()));
17 | }
18 |
19 | PieChartData getChartData() {
20 | return PieChartData(
21 | pieTouchData: PieTouchData(
22 | enabled: true,
23 | touchCallback: (FlTouchEvent event, pieTouchResponse) {
24 | activeIndex =
25 | pieTouchResponse?.touchedSection?.touchedSectionIndex ?? -1;
26 | setState(() {});
27 | },
28 | ),
29 | sectionsSpace: 0,
30 | sections: [
31 | PieChartSectionData(
32 | titlePositionPercentageOffset: activeIndex == 0 ? -1 : null,
33 | value: 40,
34 | color: const Color(0xFF208BC7),
35 | title: activeIndex == 0 ? 'Design service' : '40%',
36 | radius: activeIndex == 0 ? 45 : 25,
37 | titleStyle: AppStyles.styleRegular16(context)
38 | .copyWith(color: activeIndex == 0 ? null : Colors.white),
39 | ),
40 | PieChartSectionData(
41 | titlePositionPercentageOffset: activeIndex == 1 ? -1 : null,
42 | value: 25,
43 | color: const Color(0xFF4DB7F2),
44 | title: activeIndex == 1 ? 'Design product' : '25%',
45 | radius: activeIndex == 1 ? 45 : 25,
46 | titleStyle: AppStyles.styleRegular16(context)
47 | .copyWith(color: activeIndex == 1 ? null : Colors.white),
48 | ),
49 | PieChartSectionData(
50 | titlePositionPercentageOffset: activeIndex == 2 ? -1 : null,
51 | value: 20,
52 | color: const Color(0xFF064060),
53 | title: activeIndex == 2 ? 'Product royalti' : '20%',
54 | radius: activeIndex == 2 ? 45 : 25,
55 | titleStyle: AppStyles.styleRegular16(context)
56 | .copyWith(color: activeIndex == 2 ? null : Colors.white),
57 | ),
58 | PieChartSectionData(
59 | titlePositionPercentageOffset: activeIndex == 3 ? -1 : null,
60 | value: 22,
61 | color: const Color(0xFFE2DECD),
62 | title: activeIndex == 3 ? 'other' : '22%',
63 | radius: activeIndex == 3 ? 45 : 25,
64 | titleStyle: AppStyles.styleRegular16(context)
65 | .copyWith(color: activeIndex == 3 ? null : Colors.white),
66 | ),
67 | ]);
68 | }
69 | }
70 |
--------------------------------------------------------------------------------
/lib/views/widgets/income_details.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 | import 'package:responsive_dash_board/models/income_details_model.dart';
3 | import 'package:responsive_dash_board/views/widgets/income_items_details.dart';
4 |
5 | class IncomeDetails extends StatelessWidget {
6 | const IncomeDetails({
7 | super.key,
8 | });
9 |
10 | static const items = [
11 | IncomeDetailsModel(
12 | title: 'Design service',
13 | value: '40%',
14 | color: Color(0xFF208BC7),
15 | ),
16 | IncomeDetailsModel(
17 | title: 'Design product',
18 | value: '25%',
19 | color: Color(0xFF4EB7F2),
20 | ),
21 | IncomeDetailsModel(
22 | title: 'Product Royalti',
23 | value: '22%',
24 | color: Color(0xFF064060),
25 | ),
26 | IncomeDetailsModel(
27 | title: 'other',
28 | value: '20%',
29 | color: Color(0xFFE2DECD),
30 | ),
31 | ];
32 | @override
33 | Widget build(BuildContext context) {
34 | return Column(
35 | children:
36 | items.map((e) => ItemDetails(incomeDetailsModel: e)).toList());
37 | }
38 | }
39 |
--------------------------------------------------------------------------------
/lib/views/widgets/income_items_details.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 | import 'package:responsive_dash_board/models/income_details_model.dart';
3 | import 'package:responsive_dash_board/utils/app_styles.dart';
4 |
5 | class ItemDetails extends StatelessWidget {
6 | const ItemDetails({
7 | super.key,
8 | required this.incomeDetailsModel,
9 | });
10 | final IncomeDetailsModel incomeDetailsModel;
11 |
12 | @override
13 | Widget build(BuildContext context) {
14 | return ListTile(
15 | leading: Container(
16 | width: 12,
17 | height: 12,
18 | decoration: ShapeDecoration(
19 | color: incomeDetailsModel.color,
20 | shape: const OvalBorder(),
21 | ),
22 | ),
23 | title: Text(
24 | incomeDetailsModel.title,
25 | style:
26 | AppStyles.styleRegular16(context).copyWith(color: const Color(0xFF064060)),
27 | ),
28 | trailing: Text(
29 | incomeDetailsModel.value,
30 | style: AppStyles.styleMedium16(context).copyWith(color: const Color(0xFF208CC8)),
31 | ),
32 | );
33 | }
34 | }
35 |
--------------------------------------------------------------------------------
/lib/views/widgets/income_section.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 | import 'package:responsive_dash_board/views/widgets/custom_background_container.dart';
3 |
4 | import 'package:responsive_dash_board/views/widgets/income_section_body.dart';
5 | import 'package:responsive_dash_board/views/widgets/income_section_header.dart';
6 |
7 | class InComeSection extends StatelessWidget {
8 | const InComeSection({super.key});
9 |
10 | @override
11 | Widget build(BuildContext context) {
12 | return const CustomBackgroundContainer(
13 | child: Column(
14 | children: [
15 | IncomeSectionHeader(),
16 | IncomeSectionBody(),
17 | ],
18 | ),
19 | );
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/lib/views/widgets/income_section_body.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 | import 'package:responsive_dash_board/utils/size_config.dart';
3 | import 'package:responsive_dash_board/views/widgets/income_chart.dart';
4 | import 'package:responsive_dash_board/views/widgets/income_chart_less_width.dart';
5 | import 'package:responsive_dash_board/views/widgets/income_details.dart';
6 |
7 | class IncomeSectionBody extends StatelessWidget {
8 | const IncomeSectionBody({
9 | super.key,
10 | });
11 |
12 | @override
13 | Widget build(BuildContext context) {
14 | double width = MediaQuery.sizeOf(context).width;
15 | return width >= SizeConfig.desktop && width < 1750
16 | ? const Expanded(
17 | child: Padding(
18 | padding: EdgeInsets.all(32.0),
19 | child: IncomeChartLessWidth(),
20 | ),
21 | )
22 | : const Row(
23 | mainAxisAlignment: MainAxisAlignment.spaceBetween,
24 | crossAxisAlignment: CrossAxisAlignment.center,
25 | children: [
26 | Expanded(
27 | child: Padding(
28 | padding: EdgeInsets.all(16.0),
29 | child: IncomeChart(),
30 | ),
31 | ),
32 | Expanded(
33 | child: IncomeDetails(),
34 | ),
35 | ],
36 | );
37 | }
38 | }
39 |
--------------------------------------------------------------------------------
/lib/views/widgets/income_section_header.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 | import 'package:responsive_dash_board/utils/app_styles.dart';
3 |
4 | class IncomeSectionHeader extends StatelessWidget {
5 | const IncomeSectionHeader({
6 | super.key,
7 | });
8 |
9 | @override
10 | Widget build(BuildContext context) {
11 | return Row(
12 | children: [
13 | Text(
14 | 'Income',
15 | style: AppStyles.styleSimiBold20(context),
16 | ),
17 | const Expanded(child: SizedBox()),
18 | Text(
19 | 'Monthly',
20 | style: AppStyles.styleMedium16(context),
21 | ),
22 | const SizedBox(
23 | width: 18,
24 | ),
25 | Transform.rotate(
26 | angle: -90 * 3.14 / 180,
27 | child: const Icon(
28 | Icons.arrow_back_ios_new_outlined,
29 | color: Color(0xFF064061),
30 | ),
31 | ),
32 | ],
33 | );
34 | }
35 | }
36 |
--------------------------------------------------------------------------------
/lib/views/widgets/latest_transaction_list_view.dart:
--------------------------------------------------------------------------------
1 | import 'dart:ui';
2 |
3 | import 'package:flutter/material.dart';
4 | import 'package:responsive_dash_board/models/user_info_model.dart';
5 | import 'package:responsive_dash_board/utils/app_images.dart';
6 | import 'package:responsive_dash_board/views/widgets/user_info_list_tile.dart';
7 |
8 | class LatestTransactionListView extends StatelessWidget {
9 | const LatestTransactionListView({super.key});
10 |
11 | static const items = [
12 | UserInfoModel(
13 | title: 'Madrani Andi',
14 | subtitle: 'Madraniadi20@gmail.com',
15 | image: Assets.imagesFrame1),
16 | UserInfoModel(
17 | title: 'Josua Nunito',
18 | subtitle: 'JosuaNunito1001@gmail.com',
19 | image: Assets.imagesFrame1),
20 | UserInfoModel(
21 | title: 'Joelvis Pimentel',
22 | subtitle: 'Joelvis_pime220@gmail.com',
23 | image: Assets.imagesFrame1),
24 | UserInfoModel(
25 | title: 'Joelvis Pimentel',
26 | subtitle: 'Joelvis_pime220@gmail.com',
27 | image: Assets.imagesFrame1),
28 | UserInfoModel(
29 | title: 'Joelvis Pimentel',
30 | subtitle: 'Joelvis_pime220@gmail.com',
31 | image: Assets.imagesFrame1)
32 | ];
33 |
34 | @override
35 | Widget build(BuildContext context) {
36 | return ScrollConfiguration(
37 | behavior: const ScrollBehavior().copyWith(
38 | dragDevices: {
39 | PointerDeviceKind.touch,
40 | PointerDeviceKind.mouse,
41 | },
42 | ),
43 | child: SingleChildScrollView(
44 | scrollDirection: Axis.horizontal,
45 | physics: const BouncingScrollPhysics(),
46 | child: Row(
47 | children: items
48 | .map((e) =>
49 | IntrinsicWidth(child: UserInfoListTile(userInfoModel: e)))
50 | .toList()),
51 | ),
52 | );
53 |
54 | // replace widget for Row & ChildScrollView Widget
55 | // SizedBox(
56 | // height: 100,
57 | // child: ListView.builder(
58 | // scrollDirection: Axis.horizontal,
59 | // itemCount: items.length,
60 | // itemBuilder: (context, index) {
61 | // return IntrinsicWidth(
62 | // child: UserInfoListTile(userInfoModel: items[index]));
63 | // },
64 | // ),
65 | // );
66 | }
67 | }
68 |
--------------------------------------------------------------------------------
/lib/views/widgets/latest_transaction_widget.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 | import 'package:responsive_dash_board/utils/app_styles.dart';
3 | import 'package:responsive_dash_board/views/widgets/latest_transaction_list_view.dart';
4 |
5 | class LatestTransactionWidget extends StatelessWidget {
6 | const LatestTransactionWidget({super.key});
7 |
8 | @override
9 | Widget build(BuildContext context) {
10 | return Column(
11 | crossAxisAlignment: CrossAxisAlignment.start,
12 | children: [
13 | Text(
14 | 'Latest Transaction',
15 | style: AppStyles.styleSimiBold16(context).copyWith(
16 | color: const Color(0xff064061),
17 | ),
18 | ),
19 | const SizedBox(
20 | height: 12,
21 | ),
22 | const LatestTransactionListView(),
23 | ],
24 | );
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/lib/views/widgets/my_card.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 | import 'package:flutter_svg/svg.dart';
3 | import 'package:responsive_dash_board/utils/app_images.dart';
4 | import 'package:responsive_dash_board/utils/app_styles.dart';
5 |
6 | class MyCardWidget extends StatelessWidget {
7 | const MyCardWidget({super.key});
8 |
9 | @override
10 | Widget build(BuildContext context) {
11 | return AspectRatio(
12 | aspectRatio: 420 / 215,
13 | child: Container(
14 | decoration: ShapeDecoration(
15 | image: const DecorationImage(
16 | fit: BoxFit.fill, image: AssetImage(Assets.imagesMaskGroup1)),
17 | color: const Color(0xFF4EB7F2),
18 | shape: RoundedRectangleBorder(
19 | borderRadius: BorderRadius.circular(12),
20 | ),
21 | ),
22 | child: Column(
23 | crossAxisAlignment: CrossAxisAlignment.end,
24 | children: [
25 | ListTile(
26 | contentPadding: const EdgeInsets.only(
27 | right: 42,
28 | left: 31,
29 | top: 12,
30 | ),
31 | title: Text(
32 | 'Name card',
33 | style: AppStyles.styleRegular16(context)
34 | .copyWith(color: Colors.white),
35 | ),
36 | subtitle: Text(
37 | 'Ahmed Hamdy',
38 | style: AppStyles.styleSimiBold20(context)
39 | .copyWith(color: Colors.white),
40 | ),
41 | trailing: SvgPicture.asset(Assets.imagesGallery),
42 | ),
43 | const Expanded(
44 | child: SizedBox(),
45 | ),
46 | Padding(
47 | padding: const EdgeInsets.only(right: 20),
48 | child: Column(
49 | crossAxisAlignment: CrossAxisAlignment.end,
50 | children: [
51 | Text(
52 | '0918 8124 0042 8129',
53 | style: AppStyles.styleSimiBold24(context)
54 | .copyWith(color: Colors.white),
55 | ),
56 | const SizedBox(
57 | height: 8,
58 | ),
59 | Row(
60 | mainAxisAlignment: MainAxisAlignment.end,
61 | children: [
62 | Text(
63 | '12/20',
64 | style: AppStyles.styleRegular16(context)
65 | .copyWith(color: Colors.white),
66 | ),
67 | const SizedBox(
68 | width: 6,
69 | ),
70 | Text(
71 | '-',
72 | style: AppStyles.styleRegular16(context)
73 | .copyWith(color: Colors.white),
74 | ),
75 | const SizedBox(
76 | width: 6,
77 | ),
78 | Text(
79 | '134',
80 | style: AppStyles.styleRegular16(context)
81 | .copyWith(color: Colors.white),
82 | ),
83 | ],
84 | ),
85 | ],
86 | ),
87 | ),
88 | const Flexible(
89 | child: SizedBox(
90 | height: 20,
91 | ),
92 | ),
93 | ],
94 | ),
95 | ),
96 | );
97 | }
98 | }
99 |
--------------------------------------------------------------------------------
/lib/views/widgets/my_cards_and_transaction_section.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 | import 'package:responsive_dash_board/views/widgets/custom_background_container.dart';
3 | import 'package:responsive_dash_board/views/widgets/my_cards_section.dart';
4 | import 'package:responsive_dash_board/views/widgets/transaction_history.dart';
5 |
6 | class MyCardsAndTransactionSection extends StatelessWidget {
7 | const MyCardsAndTransactionSection({super.key});
8 |
9 | @override
10 | Widget build(BuildContext context) {
11 | return const CustomBackgroundContainer(
12 | child: Column(
13 | children: [
14 | MyCardSection(),
15 | Divider(
16 | height: 40,
17 | color: Color(0xFFF1F1F1),
18 | ),
19 | TransactionHistory(),
20 | ],
21 | ));
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/lib/views/widgets/my_cards_page_view.dart:
--------------------------------------------------------------------------------
1 | import 'package:expandable_page_view/expandable_page_view.dart';
2 | import 'package:flutter/material.dart';
3 | import 'package:responsive_dash_board/views/widgets/my_card.dart';
4 |
5 | class MyCardsPageView extends StatelessWidget {
6 | const MyCardsPageView({super.key, required this.pageController});
7 |
8 | final PageController pageController;
9 |
10 | @override
11 | Widget build(BuildContext context) {
12 | return ExpandablePageView(
13 | scrollDirection: Axis.horizontal,
14 | controller: pageController,
15 | children: List.generate(
16 | 3,
17 | (index) => const MyCardWidget(),
18 | ),
19 | );
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/lib/views/widgets/my_cards_section.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 | import 'package:responsive_dash_board/utils/app_styles.dart';
3 | import 'package:responsive_dash_board/views/widgets/dots_indicator.dart';
4 | import 'package:responsive_dash_board/views/widgets/my_cards_page_view.dart';
5 |
6 | class MyCardSection extends StatefulWidget {
7 | const MyCardSection({super.key});
8 |
9 | @override
10 | State createState() => _MyCardSectionState();
11 | }
12 |
13 | class _MyCardSectionState extends State {
14 | late PageController pageController;
15 | int currentPageIndex = 0;
16 |
17 | @override
18 | void initState() {
19 | pageController = PageController();
20 |
21 | pageController.addListener(() {
22 | currentPageIndex = pageController.page!.round();
23 |
24 | setState(() {});
25 | });
26 | super.initState();
27 | }
28 |
29 | @override
30 | Widget build(BuildContext context) {
31 | return Column(
32 | crossAxisAlignment: CrossAxisAlignment.start,
33 | children: [
34 | const SizedBox(
35 | height: 20,
36 | ),
37 | Text(
38 | 'My card',
39 | style: AppStyles.styleSimiBold20(context).copyWith(
40 | color: const Color(0xff064061),
41 | ),
42 | ),
43 | const SizedBox(
44 | height: 20,
45 | ),
46 | MyCardsPageView(
47 | pageController: pageController,
48 | ),
49 | const SizedBox(
50 | height: 19,
51 | ),
52 | DotsIndicator(
53 | currentPageIndex: currentPageIndex,
54 | ),
55 | ],
56 | );
57 | }
58 | }
59 |
--------------------------------------------------------------------------------
/lib/views/widgets/quick_invoice.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 | import 'package:responsive_dash_board/views/widgets/custom_background_container.dart';
3 | import 'package:responsive_dash_board/views/widgets/latest_transaction_widget.dart';
4 | import 'package:responsive_dash_board/views/widgets/quick_invoice_form.dart';
5 | import 'package:responsive_dash_board/views/widgets/quick_invoice_header.dart';
6 |
7 | class QuickInvoice extends StatelessWidget {
8 | const QuickInvoice({super.key});
9 |
10 | @override
11 | Widget build(BuildContext context) {
12 | return const CustomBackgroundContainer(
13 | child: Column(
14 | crossAxisAlignment: CrossAxisAlignment.start,
15 | children: [
16 | QuickInvoiceHeader(),
17 | SizedBox(height: 24),
18 | LatestTransactionWidget(),
19 | Divider(
20 | color: Color(0xffF1F1F1),
21 | height: 48,
22 | ),
23 | QuickInvoiceForm(),
24 | ],
25 | ),
26 | );
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/lib/views/widgets/quick_invoice_form.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 | import 'package:responsive_dash_board/views/widgets/custom_button.dart';
3 | import 'package:responsive_dash_board/views/widgets/title_text_field.dart';
4 |
5 | class QuickInvoiceForm extends StatelessWidget {
6 | const QuickInvoiceForm({super.key});
7 |
8 | @override
9 | Widget build(BuildContext context) {
10 | return const Column(
11 | children: [
12 | Row(
13 | mainAxisAlignment: MainAxisAlignment.spaceBetween,
14 | children: [
15 | Expanded(
16 | child: TitleTextField(
17 | title: 'Customer name', hint: 'Type Customer name')),
18 | SizedBox(
19 | width: 16,
20 | ),
21 | Expanded(
22 | child: TitleTextField(
23 | title: 'Customer Email', hint: 'Type Customer Email'),
24 | ),
25 | ],
26 | ),
27 | SizedBox(
28 | height: 24,
29 | ),
30 | Row(
31 | mainAxisAlignment: MainAxisAlignment.spaceBetween,
32 | children: [
33 | Expanded(
34 | child: TitleTextField(
35 | title: 'item name', hint: 'Type Customer name')),
36 | SizedBox(
37 | width: 16,
38 | ),
39 | Expanded(
40 | child: TitleTextField(title: 'item mount', hint: 'USD'),
41 | ),
42 | ],
43 | ),
44 | SizedBox(
45 | height: 24,
46 | ),
47 | Row(
48 | children: [
49 | Expanded(
50 | child: CustomButton(
51 | textColor: Color(
52 | 0xff4EB7F2,
53 | ),
54 | text: 'Add more details',
55 | backgroundColor: Color(0xFFFFFFFF),
56 | ),
57 | ),
58 | Expanded(
59 | child: CustomButton(
60 | textColor: Color(
61 | 0xFFFFFFFF,
62 | ),
63 | text: 'Send Money',
64 | backgroundColor: Color(0xff4EB7F2),
65 | ),
66 | ),
67 | ],
68 | ),
69 | ],
70 | );
71 | }
72 | }
73 |
--------------------------------------------------------------------------------
/lib/views/widgets/quick_invoice_header.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 | import 'package:responsive_dash_board/utils/app_styles.dart';
3 |
4 | class QuickInvoiceHeader extends StatelessWidget {
5 | const QuickInvoiceHeader({super.key});
6 |
7 | @override
8 | Widget build(BuildContext context) {
9 | return Row(
10 | children: [
11 | Text('Quick Invoice', style: AppStyles.styleSimiBold20(context)),
12 | const Expanded(
13 | child: SizedBox(),
14 | ),
15 | Container(
16 | width: 48,
17 | height: 48,
18 | decoration: const ShapeDecoration(
19 | color: Color(0xFFFAFAFA),
20 | shape: OvalBorder(),
21 | ),
22 | child: const Icon(
23 | Icons.add,
24 | color: Color(0xff4EB7F2),
25 | ),
26 | )
27 | ],
28 | );
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/lib/views/widgets/title_text_field.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 | import 'package:responsive_dash_board/utils/app_styles.dart';
3 | import 'package:responsive_dash_board/views/widgets/custom_text_field.dart';
4 |
5 | class TitleTextField extends StatelessWidget {
6 | const TitleTextField({super.key, required this.title, required this.hint});
7 |
8 | final String title;
9 | final String hint;
10 |
11 | @override
12 | Widget build(BuildContext context) {
13 | return Column(
14 | crossAxisAlignment: CrossAxisAlignment.start,
15 | children: [
16 | Text(
17 | title,
18 | style: AppStyles.styleSimiBold16(context).copyWith(
19 | color: const Color(0xff064061),
20 | ),
21 | ),
22 | const SizedBox(height: 12),
23 | CustomTextField(hint: hint),
24 | ],
25 | );
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/lib/views/widgets/transaction_history.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 | import 'package:responsive_dash_board/utils/app_styles.dart';
3 | import 'package:responsive_dash_board/views/widgets/transaction_history_list_view.dart';
4 |
5 | class TransactionHistory extends StatelessWidget {
6 | const TransactionHistory({super.key});
7 |
8 | @override
9 | Widget build(BuildContext context) {
10 | return Column(
11 | crossAxisAlignment: CrossAxisAlignment.start,
12 | children: [
13 | const TransactionHistoryHeader(),
14 | const SizedBox(
15 | height: 20,
16 | ),
17 | Text(
18 | '13 April 2024',
19 | style: AppStyles.styleMedium16(context).copyWith(
20 | color: const Color(0xFFAAAAAA),
21 | ),
22 | ),
23 | const SizedBox(
24 | height: 16,
25 | ),
26 | const TransactionHistoryListView(),
27 | ],
28 | );
29 | }
30 | }
31 |
32 | class TransactionHistoryHeader extends StatelessWidget {
33 | const TransactionHistoryHeader({
34 | super.key,
35 | });
36 |
37 | @override
38 | Widget build(BuildContext context) {
39 | return Row(
40 | mainAxisAlignment: MainAxisAlignment.spaceBetween,
41 | children: [
42 | Text('Transaction History', style: AppStyles.styleSimiBold20(context)),
43 | Text('See all',
44 | style: AppStyles.styleMedium16(context)
45 | .copyWith(color: const Color(0xff4EB7F2))),
46 | ],
47 | );
48 | }
49 | }
50 |
--------------------------------------------------------------------------------
/lib/views/widgets/transaction_history_list_view.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 | import 'package:responsive_dash_board/models/transation_model.dart';
3 | import 'package:responsive_dash_board/views/widgets/transaction_item.dart';
4 |
5 | class TransactionHistoryListView extends StatelessWidget {
6 | const TransactionHistoryListView({super.key});
7 |
8 | static const items = [
9 | TransactionModel(
10 | title: 'Monthly Subscription',
11 | amount: r'$2,000',
12 | date: '13 Apr, 2022 ',
13 | isWithdrawal: true),
14 | TransactionModel(
15 | title: 'Juni Mobile App project',
16 | amount: r'$20,000',
17 | date: '13 Apr, 2022 ',
18 | isWithdrawal: false),
19 | TransactionModel(
20 | title: 'Cash Withdrawal',
21 | amount: r'$21,000',
22 | date: '13 Apr, 2022 ',
23 | isWithdrawal: true),
24 | ];
25 |
26 | @override
27 | Widget build(BuildContext context) {
28 | return Column(
29 | children: items
30 | .map((e) => TransactionItem(
31 | transactionModel: e,
32 | ))
33 | .toList(),
34 | );
35 | }
36 | }
37 |
--------------------------------------------------------------------------------
/lib/views/widgets/transaction_item.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 | import 'package:responsive_dash_board/models/transation_model.dart';
3 | import 'package:responsive_dash_board/utils/app_styles.dart';
4 |
5 | class TransactionItem extends StatelessWidget {
6 | const TransactionItem({super.key, required this.transactionModel});
7 |
8 | final TransactionModel transactionModel;
9 |
10 | @override
11 | Widget build(BuildContext context) {
12 | return Card(
13 | color: const Color(0xffFAFAFA),
14 | elevation: 0,
15 | shape: RoundedRectangleBorder(
16 | borderRadius: BorderRadius.circular(12),
17 | ),
18 | child: ListTile(
19 | title: Text(
20 | transactionModel.title,
21 | style: AppStyles.styleSimiBold16(context).copyWith(
22 | color: const Color(0xFF064060),
23 | ),
24 | ),
25 | subtitle: Text(
26 | transactionModel.date,
27 | style: AppStyles.styleRegular16(context).copyWith(
28 | color: const Color(0xFFAAAAAA),
29 | ),
30 | ),
31 | trailing: Text(transactionModel.amount,
32 | style: AppStyles.styleSimiBold16(context).copyWith(
33 | color: transactionModel.isWithdrawal
34 | ? const Color(0xFFF3735E)
35 | : const Color(0xFF7CD87A),
36 | )),
37 | ),
38 | );
39 | }
40 | }
41 |
--------------------------------------------------------------------------------
/lib/views/widgets/user_info_list_tile.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 | import 'package:flutter_svg/flutter_svg.dart';
3 | import 'package:responsive_dash_board/models/user_info_model.dart';
4 | import 'package:responsive_dash_board/utils/app_styles.dart';
5 |
6 | class UserInfoListTile extends StatelessWidget {
7 | const UserInfoListTile({
8 | super.key,
9 | required this.userInfoModel,
10 | });
11 |
12 | final UserInfoModel userInfoModel;
13 |
14 | @override
15 | Widget build(BuildContext context) {
16 | return Card(
17 | elevation: 0,
18 | margin: const EdgeInsets.all(16),
19 | color: const Color(0xffFAFAFA),
20 | child: Center(
21 | child: ListTile(
22 | leading: SvgPicture.asset(userInfoModel.image),
23 | title: FittedBox(
24 | alignment: AlignmentDirectional.centerStart,
25 | fit: BoxFit.scaleDown,
26 | child: Text(
27 | userInfoModel.title,
28 | style: AppStyles.styleSimiBold16(context)
29 | .copyWith(color: const Color(0xff064061)),
30 | ),
31 | ),
32 | subtitle: Text(userInfoModel.subtitle,
33 | style: AppStyles.styleRegular12((context))),
34 | ),
35 | ),
36 | );
37 | }
38 | }
39 |
--------------------------------------------------------------------------------
/pubspec.lock:
--------------------------------------------------------------------------------
1 | # Generated by pub
2 | # See https://dart.dev/tools/pub/glossary#lockfile
3 | packages:
4 | args:
5 | dependency: transitive
6 | description:
7 | name: args
8 | sha256: "7cf60b9f0cc88203c5a190b4cd62a99feea42759a7fa695010eb5de1c0b2252a"
9 | url: "https://pub.dev"
10 | source: hosted
11 | version: "2.5.0"
12 | async:
13 | dependency: transitive
14 | description:
15 | name: async
16 | sha256: "947bfcf187f74dbc5e146c9eb9c0f10c9f8b30743e341481c1e2ed3ecc18c20c"
17 | url: "https://pub.dev"
18 | source: hosted
19 | version: "2.11.0"
20 | boolean_selector:
21 | dependency: transitive
22 | description:
23 | name: boolean_selector
24 | sha256: "6cfb5af12253eaf2b368f07bacc5a80d1301a071c73360d746b7f2e32d762c66"
25 | url: "https://pub.dev"
26 | source: hosted
27 | version: "2.1.1"
28 | characters:
29 | dependency: transitive
30 | description:
31 | name: characters
32 | sha256: "04a925763edad70e8443c99234dc3328f442e811f1d8fd1a72f1c8ad0f69a605"
33 | url: "https://pub.dev"
34 | source: hosted
35 | version: "1.3.0"
36 | clock:
37 | dependency: transitive
38 | description:
39 | name: clock
40 | sha256: cb6d7f03e1de671e34607e909a7213e31d7752be4fb66a86d29fe1eb14bfb5cf
41 | url: "https://pub.dev"
42 | source: hosted
43 | version: "1.1.1"
44 | collection:
45 | dependency: transitive
46 | description:
47 | name: collection
48 | sha256: ee67cb0715911d28db6bf4af1026078bd6f0128b07a5f66fb2ed94ec6783c09a
49 | url: "https://pub.dev"
50 | source: hosted
51 | version: "1.18.0"
52 | cupertino_icons:
53 | dependency: "direct main"
54 | description:
55 | name: cupertino_icons
56 | sha256: ba631d1c7f7bef6b729a622b7b752645a2d076dba9976925b8f25725a30e1ee6
57 | url: "https://pub.dev"
58 | source: hosted
59 | version: "1.0.8"
60 | equatable:
61 | dependency: transitive
62 | description:
63 | name: equatable
64 | sha256: c2b87cb7756efdf69892005af546c56c0b5037f54d2a88269b4f347a505e3ca2
65 | url: "https://pub.dev"
66 | source: hosted
67 | version: "2.0.5"
68 | expandable_page_view:
69 | dependency: "direct main"
70 | description:
71 | name: expandable_page_view
72 | sha256: "210dc6961cfc29f7ed42867824eb699c9a4b9b198a7c04b8bdc1c05844969dc6"
73 | url: "https://pub.dev"
74 | source: hosted
75 | version: "1.0.17"
76 | fake_async:
77 | dependency: transitive
78 | description:
79 | name: fake_async
80 | sha256: "511392330127add0b769b75a987850d136345d9227c6b94c96a04cf4a391bf78"
81 | url: "https://pub.dev"
82 | source: hosted
83 | version: "1.3.1"
84 | fl_chart:
85 | dependency: "direct main"
86 | description:
87 | name: fl_chart
88 | sha256: d0f0d49112f2f4b192481c16d05b6418bd7820e021e265a3c22db98acf7ed7fb
89 | url: "https://pub.dev"
90 | source: hosted
91 | version: "0.68.0"
92 | flutter:
93 | dependency: "direct main"
94 | description: flutter
95 | source: sdk
96 | version: "0.0.0"
97 | flutter_lints:
98 | dependency: "direct dev"
99 | description:
100 | name: flutter_lints
101 | sha256: "9e8c3858111da373efc5aa341de011d9bd23e2c5c5e0c62bccf32438e192d7b1"
102 | url: "https://pub.dev"
103 | source: hosted
104 | version: "3.0.2"
105 | flutter_svg:
106 | dependency: "direct main"
107 | description:
108 | name: flutter_svg
109 | sha256: "7b4ca6cf3304575fe9c8ec64813c8d02ee41d2afe60bcfe0678bcb5375d596a2"
110 | url: "https://pub.dev"
111 | source: hosted
112 | version: "2.0.10+1"
113 | flutter_test:
114 | dependency: "direct dev"
115 | description: flutter
116 | source: sdk
117 | version: "0.0.0"
118 | http:
119 | dependency: transitive
120 | description:
121 | name: http
122 | sha256: "761a297c042deedc1ffbb156d6e2af13886bb305c2a343a4d972504cd67dd938"
123 | url: "https://pub.dev"
124 | source: hosted
125 | version: "1.2.1"
126 | http_parser:
127 | dependency: transitive
128 | description:
129 | name: http_parser
130 | sha256: "2aa08ce0341cc9b354a498388e30986515406668dbcc4f7c950c3e715496693b"
131 | url: "https://pub.dev"
132 | source: hosted
133 | version: "4.0.2"
134 | leak_tracker:
135 | dependency: transitive
136 | description:
137 | name: leak_tracker
138 | sha256: "7f0df31977cb2c0b88585095d168e689669a2cc9b97c309665e3386f3e9d341a"
139 | url: "https://pub.dev"
140 | source: hosted
141 | version: "10.0.4"
142 | leak_tracker_flutter_testing:
143 | dependency: transitive
144 | description:
145 | name: leak_tracker_flutter_testing
146 | sha256: "06e98f569d004c1315b991ded39924b21af84cf14cc94791b8aea337d25b57f8"
147 | url: "https://pub.dev"
148 | source: hosted
149 | version: "3.0.3"
150 | leak_tracker_testing:
151 | dependency: transitive
152 | description:
153 | name: leak_tracker_testing
154 | sha256: "6ba465d5d76e67ddf503e1161d1f4a6bc42306f9d66ca1e8f079a47290fb06d3"
155 | url: "https://pub.dev"
156 | source: hosted
157 | version: "3.0.1"
158 | lints:
159 | dependency: transitive
160 | description:
161 | name: lints
162 | sha256: cbf8d4b858bb0134ef3ef87841abdf8d63bfc255c266b7bf6b39daa1085c4290
163 | url: "https://pub.dev"
164 | source: hosted
165 | version: "3.0.0"
166 | matcher:
167 | dependency: transitive
168 | description:
169 | name: matcher
170 | sha256: d2323aa2060500f906aa31a895b4030b6da3ebdcc5619d14ce1aada65cd161cb
171 | url: "https://pub.dev"
172 | source: hosted
173 | version: "0.12.16+1"
174 | material_color_utilities:
175 | dependency: transitive
176 | description:
177 | name: material_color_utilities
178 | sha256: "0e0a020085b65b6083975e499759762399b4475f766c21668c4ecca34ea74e5a"
179 | url: "https://pub.dev"
180 | source: hosted
181 | version: "0.8.0"
182 | meta:
183 | dependency: transitive
184 | description:
185 | name: meta
186 | sha256: "7687075e408b093f36e6bbf6c91878cc0d4cd10f409506f7bc996f68220b9136"
187 | url: "https://pub.dev"
188 | source: hosted
189 | version: "1.12.0"
190 | path:
191 | dependency: transitive
192 | description:
193 | name: path
194 | sha256: "087ce49c3f0dc39180befefc60fdb4acd8f8620e5682fe2476afd0b3688bb4af"
195 | url: "https://pub.dev"
196 | source: hosted
197 | version: "1.9.0"
198 | path_parsing:
199 | dependency: transitive
200 | description:
201 | name: path_parsing
202 | sha256: e3e67b1629e6f7e8100b367d3db6ba6af4b1f0bb80f64db18ef1fbabd2fa9ccf
203 | url: "https://pub.dev"
204 | source: hosted
205 | version: "1.0.1"
206 | petitparser:
207 | dependency: transitive
208 | description:
209 | name: petitparser
210 | sha256: c15605cd28af66339f8eb6fbe0e541bfe2d1b72d5825efc6598f3e0a31b9ad27
211 | url: "https://pub.dev"
212 | source: hosted
213 | version: "6.0.2"
214 | sky_engine:
215 | dependency: transitive
216 | description: flutter
217 | source: sdk
218 | version: "0.0.99"
219 | source_span:
220 | dependency: transitive
221 | description:
222 | name: source_span
223 | sha256: "53e943d4206a5e30df338fd4c6e7a077e02254531b138a15aec3bd143c1a8b3c"
224 | url: "https://pub.dev"
225 | source: hosted
226 | version: "1.10.0"
227 | stack_trace:
228 | dependency: transitive
229 | description:
230 | name: stack_trace
231 | sha256: "73713990125a6d93122541237550ee3352a2d84baad52d375a4cad2eb9b7ce0b"
232 | url: "https://pub.dev"
233 | source: hosted
234 | version: "1.11.1"
235 | stream_channel:
236 | dependency: transitive
237 | description:
238 | name: stream_channel
239 | sha256: ba2aa5d8cc609d96bbb2899c28934f9e1af5cddbd60a827822ea467161eb54e7
240 | url: "https://pub.dev"
241 | source: hosted
242 | version: "2.1.2"
243 | string_scanner:
244 | dependency: transitive
245 | description:
246 | name: string_scanner
247 | sha256: "556692adab6cfa87322a115640c11f13cb77b3f076ddcc5d6ae3c20242bedcde"
248 | url: "https://pub.dev"
249 | source: hosted
250 | version: "1.2.0"
251 | term_glyph:
252 | dependency: transitive
253 | description:
254 | name: term_glyph
255 | sha256: a29248a84fbb7c79282b40b8c72a1209db169a2e0542bce341da992fe1bc7e84
256 | url: "https://pub.dev"
257 | source: hosted
258 | version: "1.2.1"
259 | test_api:
260 | dependency: transitive
261 | description:
262 | name: test_api
263 | sha256: "9955ae474176f7ac8ee4e989dadfb411a58c30415bcfb648fa04b2b8a03afa7f"
264 | url: "https://pub.dev"
265 | source: hosted
266 | version: "0.7.0"
267 | typed_data:
268 | dependency: transitive
269 | description:
270 | name: typed_data
271 | sha256: facc8d6582f16042dd49f2463ff1bd6e2c9ef9f3d5da3d9b087e244a7b564b3c
272 | url: "https://pub.dev"
273 | source: hosted
274 | version: "1.3.2"
275 | vector_graphics:
276 | dependency: transitive
277 | description:
278 | name: vector_graphics
279 | sha256: "32c3c684e02f9bc0afb0ae0aa653337a2fe022e8ab064bcd7ffda27a74e288e3"
280 | url: "https://pub.dev"
281 | source: hosted
282 | version: "1.1.11+1"
283 | vector_graphics_codec:
284 | dependency: transitive
285 | description:
286 | name: vector_graphics_codec
287 | sha256: c86987475f162fadff579e7320c7ddda04cd2fdeffbe1129227a85d9ac9e03da
288 | url: "https://pub.dev"
289 | source: hosted
290 | version: "1.1.11+1"
291 | vector_graphics_compiler:
292 | dependency: transitive
293 | description:
294 | name: vector_graphics_compiler
295 | sha256: "12faff3f73b1741a36ca7e31b292ddeb629af819ca9efe9953b70bd63fc8cd81"
296 | url: "https://pub.dev"
297 | source: hosted
298 | version: "1.1.11+1"
299 | vector_math:
300 | dependency: transitive
301 | description:
302 | name: vector_math
303 | sha256: "80b3257d1492ce4d091729e3a67a60407d227c27241d6927be0130c98e741803"
304 | url: "https://pub.dev"
305 | source: hosted
306 | version: "2.1.4"
307 | vm_service:
308 | dependency: transitive
309 | description:
310 | name: vm_service
311 | sha256: "3923c89304b715fb1eb6423f017651664a03bf5f4b29983627c4da791f74a4ec"
312 | url: "https://pub.dev"
313 | source: hosted
314 | version: "14.2.1"
315 | web:
316 | dependency: transitive
317 | description:
318 | name: web
319 | sha256: "97da13628db363c635202ad97068d47c5b8aa555808e7a9411963c533b449b27"
320 | url: "https://pub.dev"
321 | source: hosted
322 | version: "0.5.1"
323 | xml:
324 | dependency: transitive
325 | description:
326 | name: xml
327 | sha256: b015a8ad1c488f66851d762d3090a21c600e479dc75e68328c52774040cf9226
328 | url: "https://pub.dev"
329 | source: hosted
330 | version: "6.5.0"
331 | sdks:
332 | dart: ">=3.3.0 <4.0.0"
333 | flutter: ">=3.18.0-18.0.pre.54"
334 |
--------------------------------------------------------------------------------
/pubspec.yaml:
--------------------------------------------------------------------------------
1 | name: responsive_dash_board
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.3.0 <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 | cupertino_icons: ^1.0.6
32 | expandable_page_view: ^1.0.17
33 | fl_chart: ^0.68.0
34 | flutter:
35 | sdk: flutter
36 | flutter_svg: ^2.0.10+1
37 |
38 | dev_dependencies:
39 | flutter_lints: ^3.0.0
40 | flutter_test:
41 | sdk: flutter
42 |
43 | # For information on the generic Dart part of this file, see the
44 | # following page: https://dart.dev/tools/pub/pubspec
45 | # The following section is specific to Flutter packages.
46 | flutter:
47 |
48 | # The following line ensures that the Material Icons font is
49 | # included with your application, so that you can use the icons in
50 | # the material Icons class.
51 | uses-material-design: true
52 |
53 | # To add assets to your application, add an assets section, like this:
54 | assets:
55 | - assets/images/
56 |
57 | # An image asset can refer to one or more resolution-specific "variants", see
58 | # https://flutter.dev/assets-and-images/#resolution-aware
59 | # For details regarding adding assets from package dependencies, see
60 | # https://flutter.dev/assets-and-images/#from-packages
61 | # To add custom fonts to your application, add a fonts section here,
62 | # in this "flutter" section. Each entry in this list should have a
63 | # "family" key with the font family name, and a "fonts" key with a
64 | # list giving the asset and other descriptors for the font. For
65 | # example:
66 | fonts:
67 | - family: Montserrat
68 | fonts:
69 | - asset: assets/fonts/Montserrat-Regular.ttf
70 | # - asset: fonts/Schyler-Italic.ttf
71 | # style: italic
72 | # - family: Trajan Pro
73 | # fonts:
74 | # - asset: fonts/TrajanPro.ttf
75 | # - asset: fonts/TrajanPro_Bold.ttf
76 | # weight: 700
77 | #
78 | # For details regarding fonts from package dependencies,
79 | # see https://flutter.dev/custom-fonts/#from-packages
80 | flutter_assets:
81 | assets_path: assets/images
82 | output_path: lib/utils
83 | filename: app_images.dart
84 | field_prefix: null
85 |
--------------------------------------------------------------------------------
/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:responsive_dash_board/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 ResponsiveDashBoard());
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/FlutterSmith/responsive_dash_board/6f973aca5b8ec8304c3a2927c6172fb9bf3fe927/web/favicon.png
--------------------------------------------------------------------------------
/web/icons/Icon-192.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FlutterSmith/responsive_dash_board/6f973aca5b8ec8304c3a2927c6172fb9bf3fe927/web/icons/Icon-192.png
--------------------------------------------------------------------------------
/web/icons/Icon-512.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FlutterSmith/responsive_dash_board/6f973aca5b8ec8304c3a2927c6172fb9bf3fe927/web/icons/Icon-512.png
--------------------------------------------------------------------------------
/web/icons/Icon-maskable-192.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FlutterSmith/responsive_dash_board/6f973aca5b8ec8304c3a2927c6172fb9bf3fe927/web/icons/Icon-maskable-192.png
--------------------------------------------------------------------------------
/web/icons/Icon-maskable-512.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FlutterSmith/responsive_dash_board/6f973aca5b8ec8304c3a2927c6172fb9bf3fe927/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 | responsive_dash_board
33 |
34 |
35 |
39 |
40 |
41 |
42 |
43 |
58 |
59 |
60 |
--------------------------------------------------------------------------------
/web/manifest.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "responsive_dash_board",
3 | "short_name": "responsive_dash_board",
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(responsive_dash_board 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 "responsive_dash_board")
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 |
10 | void RegisterPlugins(flutter::PluginRegistry* registry) {
11 | }
12 |
--------------------------------------------------------------------------------
/windows/flutter/generated_plugin_registrant.h:
--------------------------------------------------------------------------------
1 | //
2 | // Generated file. Do not edit.
3 | //
4 |
5 | // clang-format off
6 |
7 | #ifndef GENERATED_PLUGIN_REGISTRANT_
8 | #define GENERATED_PLUGIN_REGISTRANT_
9 |
10 | #include
11 |
12 | // Registers Flutter plugins.
13 | void RegisterPlugins(flutter::PluginRegistry* registry);
14 |
15 | #endif // GENERATED_PLUGIN_REGISTRANT_
16 |
--------------------------------------------------------------------------------
/windows/flutter/generated_plugins.cmake:
--------------------------------------------------------------------------------
1 | #
2 | # Generated file, do not edit.
3 | #
4 |
5 | list(APPEND FLUTTER_PLUGIN_LIST
6 | )
7 |
8 | list(APPEND FLUTTER_FFI_PLUGIN_LIST
9 | )
10 |
11 | set(PLUGIN_BUNDLED_LIBRARIES)
12 |
13 | foreach(plugin ${FLUTTER_PLUGIN_LIST})
14 | add_subdirectory(flutter/ephemeral/.plugin_symlinks/${plugin}/windows plugins/${plugin})
15 | target_link_libraries(${BINARY_NAME} PRIVATE ${plugin}_plugin)
16 | list(APPEND PLUGIN_BUNDLED_LIBRARIES $)
17 | list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${plugin}_bundled_libraries})
18 | endforeach(plugin)
19 |
20 | foreach(ffi_plugin ${FLUTTER_FFI_PLUGIN_LIST})
21 | add_subdirectory(flutter/ephemeral/.plugin_symlinks/${ffi_plugin}/windows plugins/${ffi_plugin})
22 | list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${ffi_plugin}_bundled_libraries})
23 | endforeach(ffi_plugin)
24 |
--------------------------------------------------------------------------------
/windows/runner/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | cmake_minimum_required(VERSION 3.14)
2 | project(runner LANGUAGES CXX)
3 |
4 | # 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", "responsive_dash_board" "\0"
94 | VALUE "FileVersion", VERSION_AS_STRING "\0"
95 | VALUE "InternalName", "responsive_dash_board" "\0"
96 | VALUE "LegalCopyright", "Copyright (C) 2024 com.example. All rights reserved." "\0"
97 | VALUE "OriginalFilename", "responsive_dash_board.exe" "\0"
98 | VALUE "ProductName", "responsive_dash_board" "\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"responsive_dash_board", 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/FlutterSmith/responsive_dash_board/6f973aca5b8ec8304c3a2927c6172fb9bf3fe927/windows/runner/resources/app_icon.ico
--------------------------------------------------------------------------------
/windows/runner/runner.exe.manifest:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | PerMonitorV2
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
--------------------------------------------------------------------------------
/windows/runner/utils.cpp:
--------------------------------------------------------------------------------
1 | #include "utils.h"
2 |
3 | #include
4 | #include
5 | #include
6 | #include
7 |
8 | #include
9 |
10 | void CreateAndAttachConsole() {
11 | if (::AllocConsole()) {
12 | FILE *unused;
13 | if (freopen_s(&unused, "CONOUT$", "w", stdout)) {
14 | _dup2(_fileno(stdout), 1);
15 | }
16 | if (freopen_s(&unused, "CONOUT$", "w", stderr)) {
17 | _dup2(_fileno(stdout), 2);
18 | }
19 | std::ios::sync_with_stdio();
20 | FlutterDesktopResyncOutputStreams();
21 | }
22 | }
23 |
24 | std::vector GetCommandLineArguments() {
25 | // Convert the UTF-16 command line arguments to UTF-8 for the Engine to use.
26 | int argc;
27 | wchar_t** argv = ::CommandLineToArgvW(::GetCommandLineW(), &argc);
28 | if (argv == nullptr) {
29 | return std::vector();
30 | }
31 |
32 | std::vector command_line_arguments;
33 |
34 | // Skip the first argument as it's the binary name.
35 | for (int i = 1; i < argc; i++) {
36 | command_line_arguments.push_back(Utf8FromUtf16(argv[i]));
37 | }
38 |
39 | ::LocalFree(argv);
40 |
41 | return command_line_arguments;
42 | }
43 |
44 | std::string Utf8FromUtf16(const wchar_t* utf16_string) {
45 | if (utf16_string == nullptr) {
46 | return std::string();
47 | }
48 | int target_length = ::WideCharToMultiByte(
49 | CP_UTF8, WC_ERR_INVALID_CHARS, utf16_string,
50 | -1, nullptr, 0, nullptr, nullptr)
51 | -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.cpp:
--------------------------------------------------------------------------------
1 | #include "win32_window.h"
2 |
3 | #include
4 | #include
5 |
6 | #include "resource.h"
7 |
8 | namespace {
9 |
10 | /// Window attribute that enables dark mode window decorations.
11 | ///
12 | /// Redefined in case the developer's machine has a Windows SDK older than
13 | /// version 10.0.22000.0.
14 | /// See: https://docs.microsoft.com/windows/win32/api/dwmapi/ne-dwmapi-dwmwindowattribute
15 | #ifndef DWMWA_USE_IMMERSIVE_DARK_MODE
16 | #define DWMWA_USE_IMMERSIVE_DARK_MODE 20
17 | #endif
18 |
19 | constexpr const wchar_t kWindowClassName[] = L"FLUTTER_RUNNER_WIN32_WINDOW";
20 |
21 | /// Registry key for app theme preference.
22 | ///
23 | /// A value of 0 indicates apps should use dark mode. A non-zero or missing
24 | /// value indicates apps should use light mode.
25 | constexpr const wchar_t kGetPreferredBrightnessRegKey[] =
26 | L"Software\\Microsoft\\Windows\\CurrentVersion\\Themes\\Personalize";
27 | constexpr const wchar_t kGetPreferredBrightnessRegValue[] = L"AppsUseLightTheme";
28 |
29 | // The number of Win32Window objects that currently exist.
30 | static int g_active_window_count = 0;
31 |
32 | using EnableNonClientDpiScaling = BOOL __stdcall(HWND hwnd);
33 |
34 | // Scale helper to convert logical scaler values to physical using passed in
35 | // scale factor
36 | int Scale(int source, double scale_factor) {
37 | return static_cast(source * scale_factor);
38 | }
39 |
40 | // Dynamically loads the |EnableNonClientDpiScaling| from the User32 module.
41 | // This API is only needed for PerMonitor V1 awareness mode.
42 | void EnableFullDpiSupportIfAvailable(HWND hwnd) {
43 | HMODULE user32_module = LoadLibraryA("User32.dll");
44 | if (!user32_module) {
45 | return;
46 | }
47 | auto enable_non_client_dpi_scaling =
48 | reinterpret_cast(
49 | GetProcAddress(user32_module, "EnableNonClientDpiScaling"));
50 | if (enable_non_client_dpi_scaling != nullptr) {
51 | enable_non_client_dpi_scaling(hwnd);
52 | }
53 | FreeLibrary(user32_module);
54 | }
55 |
56 | } // namespace
57 |
58 | // Manages the Win32Window's window class registration.
59 | class WindowClassRegistrar {
60 | public:
61 | ~WindowClassRegistrar() = default;
62 |
63 | // Returns the singleton registrar instance.
64 | static WindowClassRegistrar* GetInstance() {
65 | if (!instance_) {
66 | instance_ = new WindowClassRegistrar();
67 | }
68 | return instance_;
69 | }
70 |
71 | // Returns the name of the window class, registering the class if it hasn't
72 | // previously been registered.
73 | const wchar_t* GetWindowClass();
74 |
75 | // Unregisters the window class. Should only be called if there are no
76 | // instances of the window.
77 | void UnregisterWindowClass();
78 |
79 | private:
80 | WindowClassRegistrar() = default;
81 |
82 | static WindowClassRegistrar* instance_;
83 |
84 | bool class_registered_ = false;
85 | };
86 |
87 | WindowClassRegistrar* WindowClassRegistrar::instance_ = nullptr;
88 |
89 | const wchar_t* WindowClassRegistrar::GetWindowClass() {
90 | if (!class_registered_) {
91 | WNDCLASS window_class{};
92 | window_class.hCursor = LoadCursor(nullptr, IDC_ARROW);
93 | window_class.lpszClassName = kWindowClassName;
94 | window_class.style = CS_HREDRAW | CS_VREDRAW;
95 | window_class.cbClsExtra = 0;
96 | window_class.cbWndExtra = 0;
97 | window_class.hInstance = GetModuleHandle(nullptr);
98 | window_class.hIcon =
99 | LoadIcon(window_class.hInstance, MAKEINTRESOURCE(IDI_APP_ICON));
100 | window_class.hbrBackground = 0;
101 | window_class.lpszMenuName = nullptr;
102 | window_class.lpfnWndProc = Win32Window::WndProc;
103 | RegisterClass(&window_class);
104 | class_registered_ = true;
105 | }
106 | return kWindowClassName;
107 | }
108 |
109 | void WindowClassRegistrar::UnregisterWindowClass() {
110 | UnregisterClass(kWindowClassName, nullptr);
111 | class_registered_ = false;
112 | }
113 |
114 | Win32Window::Win32Window() {
115 | ++g_active_window_count;
116 | }
117 |
118 | Win32Window::~Win32Window() {
119 | --g_active_window_count;
120 | Destroy();
121 | }
122 |
123 | bool Win32Window::Create(const std::wstring& title,
124 | const Point& origin,
125 | const Size& size) {
126 | Destroy();
127 |
128 | const wchar_t* window_class =
129 | WindowClassRegistrar::GetInstance()->GetWindowClass();
130 |
131 | const POINT target_point = {static_cast(origin.x),
132 | static_cast(origin.y)};
133 | HMONITOR monitor = MonitorFromPoint(target_point, MONITOR_DEFAULTTONEAREST);
134 | UINT dpi = FlutterDesktopGetDpiForMonitor(monitor);
135 | double scale_factor = dpi / 96.0;
136 |
137 | HWND window = CreateWindow(
138 | window_class, title.c_str(), WS_OVERLAPPEDWINDOW,
139 | Scale(origin.x, scale_factor), Scale(origin.y, scale_factor),
140 | Scale(size.width, scale_factor), Scale(size.height, scale_factor),
141 | nullptr, nullptr, GetModuleHandle(nullptr), this);
142 |
143 | if (!window) {
144 | return false;
145 | }
146 |
147 | UpdateTheme(window);
148 |
149 | return OnCreate();
150 | }
151 |
152 | bool Win32Window::Show() {
153 | return ShowWindow(window_handle_, SW_SHOWNORMAL);
154 | }
155 |
156 | // static
157 | LRESULT CALLBACK Win32Window::WndProc(HWND const window,
158 | UINT const message,
159 | WPARAM const wparam,
160 | LPARAM const lparam) noexcept {
161 | if (message == WM_NCCREATE) {
162 | auto window_struct = reinterpret_cast(lparam);
163 | SetWindowLongPtr(window, GWLP_USERDATA,
164 | reinterpret_cast(window_struct->lpCreateParams));
165 |
166 | auto that = static_cast(window_struct->lpCreateParams);
167 | EnableFullDpiSupportIfAvailable(window);
168 | that->window_handle_ = window;
169 | } else if (Win32Window* that = GetThisFromHandle(window)) {
170 | return that->MessageHandler(window, message, wparam, lparam);
171 | }
172 |
173 | return DefWindowProc(window, message, wparam, lparam);
174 | }
175 |
176 | LRESULT
177 | Win32Window::MessageHandler(HWND hwnd,
178 | UINT const message,
179 | WPARAM const wparam,
180 | LPARAM const lparam) noexcept {
181 | switch (message) {
182 | case WM_DESTROY:
183 | window_handle_ = nullptr;
184 | Destroy();
185 | if (quit_on_close_) {
186 | PostQuitMessage(0);
187 | }
188 | return 0;
189 |
190 | case WM_DPICHANGED: {
191 | auto newRectSize = reinterpret_cast(lparam);
192 | LONG newWidth = newRectSize->right - newRectSize->left;
193 | LONG newHeight = newRectSize->bottom - newRectSize->top;
194 |
195 | SetWindowPos(hwnd, nullptr, newRectSize->left, newRectSize->top, newWidth,
196 | newHeight, SWP_NOZORDER | SWP_NOACTIVATE);
197 |
198 | return 0;
199 | }
200 | case WM_SIZE: {
201 | RECT rect = GetClientArea();
202 | if (child_content_ != nullptr) {
203 | // Size and position the child window.
204 | MoveWindow(child_content_, rect.left, rect.top, rect.right - rect.left,
205 | rect.bottom - rect.top, TRUE);
206 | }
207 | return 0;
208 | }
209 |
210 | case WM_ACTIVATE:
211 | if (child_content_ != nullptr) {
212 | SetFocus(child_content_);
213 | }
214 | return 0;
215 |
216 | case WM_DWMCOLORIZATIONCOLORCHANGED:
217 | UpdateTheme(hwnd);
218 | return 0;
219 | }
220 |
221 | return DefWindowProc(window_handle_, message, wparam, lparam);
222 | }
223 |
224 | void Win32Window::Destroy() {
225 | OnDestroy();
226 |
227 | if (window_handle_) {
228 | DestroyWindow(window_handle_);
229 | window_handle_ = nullptr;
230 | }
231 | if (g_active_window_count == 0) {
232 | WindowClassRegistrar::GetInstance()->UnregisterWindowClass();
233 | }
234 | }
235 |
236 | Win32Window* Win32Window::GetThisFromHandle(HWND const window) noexcept {
237 | return reinterpret_cast(
238 | GetWindowLongPtr(window, GWLP_USERDATA));
239 | }
240 |
241 | void Win32Window::SetChildContent(HWND content) {
242 | child_content_ = content;
243 | SetParent(content, window_handle_);
244 | RECT frame = GetClientArea();
245 |
246 | MoveWindow(content, frame.left, frame.top, frame.right - frame.left,
247 | frame.bottom - frame.top, true);
248 |
249 | SetFocus(child_content_);
250 | }
251 |
252 | RECT Win32Window::GetClientArea() {
253 | RECT frame;
254 | GetClientRect(window_handle_, &frame);
255 | return frame;
256 | }
257 |
258 | HWND Win32Window::GetHandle() {
259 | return window_handle_;
260 | }
261 |
262 | void Win32Window::SetQuitOnClose(bool quit_on_close) {
263 | quit_on_close_ = quit_on_close;
264 | }
265 |
266 | bool Win32Window::OnCreate() {
267 | // No-op; provided for subclasses.
268 | return true;
269 | }
270 |
271 | void Win32Window::OnDestroy() {
272 | // No-op; provided for subclasses.
273 | }
274 |
275 | void Win32Window::UpdateTheme(HWND const window) {
276 | DWORD light_mode;
277 | DWORD light_mode_size = sizeof(light_mode);
278 | LSTATUS result = RegGetValue(HKEY_CURRENT_USER, kGetPreferredBrightnessRegKey,
279 | kGetPreferredBrightnessRegValue,
280 | RRF_RT_REG_DWORD, nullptr, &light_mode,
281 | &light_mode_size);
282 |
283 | if (result == ERROR_SUCCESS) {
284 | BOOL enable_dark_mode = light_mode == 0;
285 | DwmSetWindowAttribute(window, DWMWA_USE_IMMERSIVE_DARK_MODE,
286 | &enable_dark_mode, sizeof(enable_dark_mode));
287 | }
288 | }
289 |
--------------------------------------------------------------------------------
/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 |
--------------------------------------------------------------------------------