├── .github
├── CODEOWNERS
├── FUNDING.yml
└── dependabot.yml
├── .gitignore
├── .metadata
├── CODE_OF_CONDUCT.md
├── CONTRIBUTING.md
├── LICENSE
├── README.md
├── analysis_options.yaml
├── android
├── .gitignore
├── app
│ ├── build.gradle
│ └── src
│ │ ├── debug
│ │ └── AndroidManifest.xml
│ │ ├── main
│ │ ├── AndroidManifest.xml
│ │ ├── kotlin
│ │ │ └── dev
│ │ │ │ └── muhammadfiaz
│ │ │ │ └── quiz
│ │ │ │ └── quiz
│ │ │ │ └── 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
├── images
└── quiz
│ ├── Quiz_ic_list1.png
│ ├── empty_image_placeholder.jpg
│ ├── ic_background.png
│ ├── quiz_ic_facebook.svg
│ ├── quiz_ic_google.svg
│ ├── quiz_ic_grid.png
│ ├── quiz_ic_home.svg
│ ├── quiz_ic_list.png
│ ├── quiz_ic_list2.png
│ ├── quiz_ic_list3.png
│ ├── quiz_ic_list4.png
│ ├── quiz_ic_list5.png
│ ├── quiz_ic_mail.svg
│ ├── quiz_ic_quiz.svg
│ ├── quiz_ic_quiz1.png
│ ├── quiz_ic_quiz2.png
│ ├── quiz_ic_twitter.svg
│ ├── quiz_ic_user.svg
│ └── quiz_logo.jpg
├── ios
├── .gitignore
├── Flutter
│ ├── AppFrameworkInfo.plist
│ ├── Debug.xcconfig
│ └── Release.xcconfig
├── Podfile
├── 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
├── Screens
│ ├── quiz_all_list.dart
│ ├── quiz_card.dart
│ ├── quiz_create_password.dart
│ ├── quiz_dashboard.dart
│ ├── quiz_details.dart
│ ├── quiz_home.dart
│ ├── quiz_mobile_verify.dart
│ ├── quiz_new_list.dart
│ ├── quiz_profile.dart
│ ├── quiz_search.dart
│ ├── quiz_settings.dart
│ ├── quiz_sign_in.dart
│ ├── quiz_sign_up.dart
│ ├── quiz_splash_screen.dart
│ ├── quiz_verifcation.dart
│ ├── repo_button.dart
│ └── repo_screen.dart
├── generated_plugin_registrant.dart
├── main.dart
├── model
│ └── quiz_models.dart
├── onBoardingScreens
│ ├── components.dart
│ ├── model
│ │ └── items_model.dart
│ ├── utils
│ │ └── colors.dart
│ └── view
│ │ └── onBoardingScreen.dart
└── utils
│ ├── app_widget.dart
│ ├── codePicker
│ ├── country_code.dart
│ ├── country_code_picker.dart
│ ├── country_codes.dart
│ └── selection_dialog.dart
│ ├── percent_indicator
│ ├── circular_percent_indicator.dart
│ ├── linear_percent_indicator.dart
│ └── percent_indicator.dart
│ ├── quiz_card.dart
│ ├── quiz_card_detail.dart
│ ├── quiz_colors.dart
│ ├── quiz_constant.dart
│ ├── quiz_data_generator.dart
│ ├── quiz_images.dart
│ ├── quiz_strings.dart
│ └── quiz_widget.dart
├── linux
├── .gitignore
├── CMakeLists.txt
├── flutter
│ ├── CMakeLists.txt
│ ├── generated_plugin_registrant.cc
│ ├── generated_plugin_registrant.h
│ └── generated_plugins.cmake
├── main.cc
├── my_application.cc
└── my_application.h
├── macos
├── .gitignore
├── Flutter
│ ├── Flutter-Debug.xcconfig
│ ├── Flutter-Release.xcconfig
│ └── GeneratedPluginRegistrant.swift
├── Podfile
├── Runner.xcodeproj
│ ├── project.pbxproj
│ ├── project.xcworkspace
│ │ └── xcshareddata
│ │ │ └── IDEWorkspaceChecks.plist
│ └── xcshareddata
│ │ └── xcschemes
│ │ └── Runner.xcscheme
├── Runner.xcworkspace
│ ├── contents.xcworkspacedata
│ └── xcshareddata
│ │ └── IDEWorkspaceChecks.plist
├── Runner
│ ├── AppDelegate.swift
│ ├── Assets.xcassets
│ │ └── AppIcon.appiconset
│ │ │ ├── Contents.json
│ │ │ ├── app_icon_1024.png
│ │ │ ├── app_icon_128.png
│ │ │ ├── app_icon_16.png
│ │ │ ├── app_icon_256.png
│ │ │ ├── app_icon_32.png
│ │ │ ├── app_icon_512.png
│ │ │ └── app_icon_64.png
│ ├── Base.lproj
│ │ └── MainMenu.xib
│ ├── Configs
│ │ ├── AppInfo.xcconfig
│ │ ├── Debug.xcconfig
│ │ ├── Release.xcconfig
│ │ └── Warnings.xcconfig
│ ├── DebugProfile.entitlements
│ ├── Info.plist
│ ├── MainFlutterWindow.swift
│ └── Release.entitlements
└── RunnerTests
│ └── RunnerTests.swift
├── package-lock.json
├── 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
/.github/CODEOWNERS:
--------------------------------------------------------------------------------
1 | * @muhammad-fiaz
2 |
--------------------------------------------------------------------------------
/.github/FUNDING.yml:
--------------------------------------------------------------------------------
1 | # These are supported funding model platforms
2 | github: [muhammad-fiaz]
3 | patreon: muhammad_fiaz
4 | ko_fi: muhammadfiaz
5 | open_collective: muhammadfiaz
6 |
--------------------------------------------------------------------------------
/.github/dependabot.yml:
--------------------------------------------------------------------------------
1 | # To get started with Dependabot version updates, you'll need to specify which
2 | # package ecosystems to update and where the package manifests are located.
3 | # Please see the documentation for all configuration options:
4 | # https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates
5 |
6 | version: 2
7 | updates:
8 | - package-ecosystem: "pub" # See documentation for possible values
9 | directory: "/" # Location of package manifests
10 | schedule:
11 | interval: "daily"
12 |
--------------------------------------------------------------------------------
/.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: "ef1af02aead6fe2414f3aafa5a61087b610e1332"
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: ef1af02aead6fe2414f3aafa5a61087b610e1332
17 | base_revision: ef1af02aead6fe2414f3aafa5a61087b610e1332
18 | - platform: android
19 | create_revision: ef1af02aead6fe2414f3aafa5a61087b610e1332
20 | base_revision: ef1af02aead6fe2414f3aafa5a61087b610e1332
21 | - platform: ios
22 | create_revision: ef1af02aead6fe2414f3aafa5a61087b610e1332
23 | base_revision: ef1af02aead6fe2414f3aafa5a61087b610e1332
24 | - platform: linux
25 | create_revision: ef1af02aead6fe2414f3aafa5a61087b610e1332
26 | base_revision: ef1af02aead6fe2414f3aafa5a61087b610e1332
27 | - platform: macos
28 | create_revision: ef1af02aead6fe2414f3aafa5a61087b610e1332
29 | base_revision: ef1af02aead6fe2414f3aafa5a61087b610e1332
30 | - platform: web
31 | create_revision: ef1af02aead6fe2414f3aafa5a61087b610e1332
32 | base_revision: ef1af02aead6fe2414f3aafa5a61087b610e1332
33 | - platform: windows
34 | create_revision: ef1af02aead6fe2414f3aafa5a61087b610e1332
35 | base_revision: ef1af02aead6fe2414f3aafa5a61087b610e1332
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 |
--------------------------------------------------------------------------------
/CODE_OF_CONDUCT.md:
--------------------------------------------------------------------------------
1 | # Contributor Covenant Code of Conduct
2 |
3 | ## Our Pledge
4 |
5 | We as members, contributors, and leaders pledge to make participation in our
6 | community a harassment-free experience for everyone, regardless of age, body
7 | size, visible or invisible disability, ethnicity, sex characteristics, gender
8 | identity and expression, level of experience, education, socio-economic status,
9 | nationality, personal appearance, race, religion, or sexual identity
10 | and orientation.
11 |
12 | We pledge to act and interact in ways that contribute to an open, welcoming,
13 | diverse, inclusive, and healthy community.
14 |
15 | ## Our Standards
16 |
17 | Examples of behavior that contributes to a positive environment for our
18 | community include:
19 |
20 | * Demonstrating empathy and kindness toward other people
21 | * Being respectful of differing opinions, viewpoints, and experiences
22 | * Giving and gracefully accepting constructive feedback
23 | * Accepting responsibility and apologizing to those affected by our mistakes,
24 | and learning from the experience
25 | * Focusing on what is best not just for us as individuals, but for the
26 | overall community
27 |
28 | Examples of unacceptable behavior include:
29 |
30 | * The use of sexualized language or imagery, and sexual attention or
31 | advances of any kind
32 | * Trolling, insulting or derogatory comments, and personal or political attacks
33 | * Public or private harassment
34 | * Publishing others' private information, such as a physical or email
35 | address, without their explicit permission
36 | * Other conduct which could reasonably be considered inappropriate in a
37 | professional setting
38 |
39 | ## Enforcement Responsibilities
40 |
41 | Community leaders are responsible for clarifying and enforcing our standards of
42 | acceptable behavior and will take appropriate and fair corrective action in
43 | response to any behavior that they deem inappropriate, threatening, offensive,
44 | or harmful.
45 |
46 | Community leaders have the right and responsibility to remove, edit, or reject
47 | comments, commits, code, wiki edits, issues, and other contributions that are
48 | not aligned to this Code of Conduct, and will communicate reasons for moderation
49 | decisions when appropriate.
50 |
51 | ## Scope
52 |
53 | This Code of Conduct applies within all community spaces, and also applies when
54 | an individual is officially representing the community in public spaces.
55 | Examples of representing our community include using an official e-mail address,
56 | posting via an official social media account, or acting as an appointed
57 | representative at an online or offline event.
58 |
59 | ## Enforcement
60 |
61 | Instances of abusive, harassing, or otherwise unacceptable behavior may be
62 | reported to the community leaders responsible for enforcement at
63 | .
64 | All complaints will be reviewed and investigated promptly and fairly.
65 |
66 | All community leaders are obligated to respect the privacy and security of the
67 | reporter of any incident.
68 |
69 | ## Enforcement Guidelines
70 |
71 | Community leaders will follow these Community Impact Guidelines in determining
72 | the consequences for any action they deem in violation of this Code of Conduct:
73 |
74 | ### 1. Correction
75 |
76 | **Community Impact**: Use of inappropriate language or other behavior deemed
77 | unprofessional or unwelcome in the community.
78 |
79 | **Consequence**: A private, written warning from community leaders, providing
80 | clarity around the nature of the violation and an explanation of why the
81 | behavior was inappropriate. A public apology may be requested.
82 |
83 | ### 2. Warning
84 |
85 | **Community Impact**: A violation through a single incident or series
86 | of actions.
87 |
88 | **Consequence**: A warning with consequences for continued behavior. No
89 | interaction with the people involved, including unsolicited interaction with
90 | those enforcing the Code of Conduct, for a specified period of time. This
91 | includes avoiding interactions in community spaces as well as external channels
92 | like social media. Violating these terms may lead to a temporary or
93 | permanent ban.
94 |
95 | ### 3. Temporary Ban
96 |
97 | **Community Impact**: A serious violation of community standards, including
98 | sustained inappropriate behavior.
99 |
100 | **Consequence**: A temporary ban from any sort of interaction or public
101 | communication with the community for a specified period of time. No public or
102 | private interaction with the people involved, including unsolicited interaction
103 | with those enforcing the Code of Conduct, is allowed during this period.
104 | Violating these terms may lead to a permanent ban.
105 |
106 | ### 4. Permanent Ban
107 |
108 | **Community Impact**: Demonstrating a pattern of violation of community
109 | standards, including sustained inappropriate behavior, harassment of an
110 | individual, or aggression toward or disparagement of classes of individuals.
111 |
112 | **Consequence**: A permanent ban from any sort of public interaction within
113 | the community.
114 |
115 | ## Attribution
116 |
117 | This Code of Conduct is adapted from the [Contributor Covenant][homepage],
118 | version 2.0, available at
119 | https://www.contributor-covenant.org/version/2/0/code_of_conduct.html.
120 |
121 | Community Impact Guidelines were inspired by [Mozilla's code of conduct
122 | enforcement ladder](https://github.com/mozilla/diversity).
123 |
124 | [homepage]: https://www.contributor-covenant.org
125 |
126 | For answers to common questions about this code of conduct, see the FAQ at
127 | https://www.contributor-covenant.org/faq. Translations are available at
128 | https://www.contributor-covenant.org/translations.
129 |
--------------------------------------------------------------------------------
/CONTRIBUTING.md:
--------------------------------------------------------------------------------
1 | # Contributing to Quiz App
2 |
3 | Thank you for considering contributing to the Quiz App! Whether it's reporting a bug, suggesting an enhancement, or contributing code, your help is appreciated.
4 |
5 | ## How to Contribute
6 |
7 | 1. Fork the repository.
8 | 2. Clone your forked repository: `git clone https://github.com/muhammad-fiaz/QuizApp-Flutter.git`
9 | 3. Create a new branch for your changes: `git checkout -b feature/your-feature`
10 | 4. Make your changes and commit them: `git commit -m 'Add your changes'`
11 | 5. Push to the branch: `git push origin feature/your-feature`
12 | 6. Submit a pull request.
13 |
14 | ## Code Style
15 |
16 | Follow the existing code style and conventions in the project.
17 |
18 | ## Bug Reports and Feature Requests
19 |
20 | If you find a bug or have a feature request, please open an issue.
21 |
22 | Thank you for contributing!
23 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2024 Muhammad Fiaz
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 |
2 |
3 | # Quiz App using Flutter
4 |
5 | [](https://github.com/muhammad-fiaz/QuizApp-Flutter/blob/main/LICENSE)
6 | [](https://github.com/muhammad-fiaz/QuizApp-Flutter/stargazers)
7 | [](https://github.com/muhammad-fiaz/QuizApp-Flutter/network/members)
8 | [](https://github.com/muhammad-fiaz/QuizApp-Flutter/issues)
9 | [](https://github.com/muhammad-fiaz/QuizApp-Flutter/pulls)
10 | [](https://github.com/muhammad-fiaz/QuizApp-Flutter/graphs/contributors)
11 | [](https://github.com/muhammad-fiaz/QuizApp-Flutter/watchers)
12 | [](https://github.com/muhammad-fiaz/GpayApp-Flutter/commits/main)
13 |
14 |
18 |
19 | [](https://github.com/muhammad-fiaz)
20 |
21 |
22 |
23 |
24 | Thank you for checking out the Quiz App Demo! This Flutter project showcases a simple Quiz Application UI template developed with Flutter.
25 |
26 | # Screenshots
27 | 
28 |
29 | **Note:- This Flutter Template Contains a Content Filler for Demo Purposes**
30 |
31 | # Table of Contents
32 |
33 | - [Quiz App using Flutter](#quiz-app-using-flutter)
34 | - [Screenshots](#screenshots)
35 | - [Project Overview](#project-overview)
36 | - [Getting Started](#getting-started)
37 | - [Prerequisites](#prerequisites)
38 | - [Installation](#installation)
39 | - [Resources](#resources)
40 | - [Contributing](#contributing)
41 | - [Code of Conduct](#code-of-conduct)
42 | - [License](#license)
43 | - [Support](#support)
44 | - [Happy Coding](#happy-coding-%EF%B8%8F)
45 |
46 | ## Project Overview
47 |
48 | The Quiz App includes the following features:
49 | - User-friendly quiz interface.
50 | - Clean and responsive design.
51 | - Flutter-based mobile application.
52 | - Easy to customize and reuse components.
53 |
54 | ## Getting Started
55 |
56 | This project serves as a starting point for a Flutter application.
57 |
58 | ### Prerequisites
59 |
60 | Before you begin, ensure you have Flutter installed. For detailed instructions, refer to the [Flutter documentation](https://docs.flutter.dev/get-started/install).
61 |
62 | ### Installation
63 |
64 | 1. Clone the repository:
65 |
66 | ```bash
67 | git clone https://github.com/muhammad-fiaz/QuizApp-Flutter.git
68 | ```
69 |
70 | 2. Change to the project directory:
71 |
72 | ```bash
73 | cd QuizApp-Flutter
74 | ```
75 |
76 | 3. Install dependencies:
77 |
78 | ```bash
79 | flutter pub get
80 | ```
81 |
82 | 4. Run the app:
83 |
84 | ```bash
85 | flutter run
86 | ```
87 |
88 | ## Resources
89 |
90 | - [Lab: Write your first Flutter app](https://docs.flutter.dev/get-started/codelab)
91 | - [Cookbook: Useful Flutter samples](https://docs.flutter.dev/cookbook)
92 |
93 | For detailed information on Flutter development, refer to the [online documentation](https://docs.flutter.dev/), which includes tutorials, samples, guidance on mobile development, and a full API reference.
94 |
95 | Feel free to customize this README to include more specific details about your Quiz App.
96 |
97 |
98 | ## Contributing
99 | Contributions are welcomed! If you find ways to improve this demo or want to add features, please consider forking the repository and submitting a pull request. Before contributing, read the [Contributing Guidelines](CONTRIBUTING.md) for a smooth collaboration.
100 |
101 | ## Code of Conduct
102 |
103 | Please review our [Code of Conduct](CODE_OF_CONDUCT.md) to understand the standards of behavior we expect from contributors and users of this project.
104 |
105 | ## License
106 |
107 | This project is licensed under the [MIT License](./LICENSE). See [LICENSE](./LICENSE) for more details.
108 |
109 | ## Support
110 |
111 | If you like this template, please consider starring the repository. Your support is appreciated! 💙
112 |
113 | Also, if you'd like to offer more support, you can:
114 |
115 | - [Sponsor on GitHub](https://github.com/sponsors/muhammad-fiaz)
116 |
117 |
118 |
119 |
120 | ## Happy Coding ❤️
121 |
--------------------------------------------------------------------------------
/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 "dev.muhammadfiaz.quiz.quiz"
27 | compileSdkVersion 34
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 "dev.muhammadfiaz.quiz.quiz"
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 21
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 |
34 |
--------------------------------------------------------------------------------
/android/app/src/main/kotlin/dev/muhammadfiaz/quiz/quiz/MainActivity.kt:
--------------------------------------------------------------------------------
1 | package dev.muhammadfiaz.quiz.quiz
2 |
3 | import io.flutter.embedding.android.FlutterActivity
4 |
5 | class MainActivity: FlutterActivity() {
6 | }
7 |
--------------------------------------------------------------------------------
/android/app/src/main/res/drawable-v21/launch_background.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
12 |
13 |
--------------------------------------------------------------------------------
/android/app/src/main/res/drawable/launch_background.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
12 |
13 |
--------------------------------------------------------------------------------
/android/app/src/main/res/mipmap-hdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/muhammad-fiaz/QuizApp-Flutter/655a0c72af30840eacbcfc4a846f17a619c5eaef/android/app/src/main/res/mipmap-hdpi/ic_launcher.png
--------------------------------------------------------------------------------
/android/app/src/main/res/mipmap-mdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/muhammad-fiaz/QuizApp-Flutter/655a0c72af30840eacbcfc4a846f17a619c5eaef/android/app/src/main/res/mipmap-mdpi/ic_launcher.png
--------------------------------------------------------------------------------
/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/muhammad-fiaz/QuizApp-Flutter/655a0c72af30840eacbcfc4a846f17a619c5eaef/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/muhammad-fiaz/QuizApp-Flutter/655a0c72af30840eacbcfc4a846f17a619c5eaef/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/muhammad-fiaz/QuizApp-Flutter/655a0c72af30840eacbcfc4a846f17a619c5eaef/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 | buildscript {
2 | ext.kotlin_version = '1.7.10'
3 | repositories {
4 | google()
5 | mavenCentral()
6 | }
7 |
8 | dependencies {
9 | classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
10 | }
11 | }
12 |
13 | allprojects {
14 | repositories {
15 | google()
16 | mavenCentral()
17 | }
18 | }
19 |
20 | rootProject.buildDir = '../build'
21 | subprojects {
22 | project.buildDir = "${rootProject.buildDir}/${project.name}"
23 | }
24 | subprojects {
25 | project.evaluationDependsOn(':app')
26 | }
27 |
28 | tasks.register("clean", Delete) {
29 | delete rootProject.buildDir
30 | }
31 |
--------------------------------------------------------------------------------
/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.5-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 | plugins {
20 | id "dev.flutter.flutter-gradle-plugin" version "1.0.0" apply false
21 | }
22 | }
23 |
24 | plugins {
25 | id "dev.flutter.flutter-plugin-loader" version "1.0.0"
26 | id "com.android.application" version "7.3.0" apply false
27 | }
28 |
29 | include ":app"
30 |
--------------------------------------------------------------------------------
/images/quiz/Quiz_ic_list1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/muhammad-fiaz/QuizApp-Flutter/655a0c72af30840eacbcfc4a846f17a619c5eaef/images/quiz/Quiz_ic_list1.png
--------------------------------------------------------------------------------
/images/quiz/empty_image_placeholder.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/muhammad-fiaz/QuizApp-Flutter/655a0c72af30840eacbcfc4a846f17a619c5eaef/images/quiz/empty_image_placeholder.jpg
--------------------------------------------------------------------------------
/images/quiz/ic_background.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/muhammad-fiaz/QuizApp-Flutter/655a0c72af30840eacbcfc4a846f17a619c5eaef/images/quiz/ic_background.png
--------------------------------------------------------------------------------
/images/quiz/quiz_ic_facebook.svg:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/images/quiz/quiz_ic_google.svg:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/images/quiz/quiz_ic_grid.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/muhammad-fiaz/QuizApp-Flutter/655a0c72af30840eacbcfc4a846f17a619c5eaef/images/quiz/quiz_ic_grid.png
--------------------------------------------------------------------------------
/images/quiz/quiz_ic_home.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/images/quiz/quiz_ic_list.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/muhammad-fiaz/QuizApp-Flutter/655a0c72af30840eacbcfc4a846f17a619c5eaef/images/quiz/quiz_ic_list.png
--------------------------------------------------------------------------------
/images/quiz/quiz_ic_list2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/muhammad-fiaz/QuizApp-Flutter/655a0c72af30840eacbcfc4a846f17a619c5eaef/images/quiz/quiz_ic_list2.png
--------------------------------------------------------------------------------
/images/quiz/quiz_ic_list3.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/muhammad-fiaz/QuizApp-Flutter/655a0c72af30840eacbcfc4a846f17a619c5eaef/images/quiz/quiz_ic_list3.png
--------------------------------------------------------------------------------
/images/quiz/quiz_ic_list4.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/muhammad-fiaz/QuizApp-Flutter/655a0c72af30840eacbcfc4a846f17a619c5eaef/images/quiz/quiz_ic_list4.png
--------------------------------------------------------------------------------
/images/quiz/quiz_ic_list5.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/muhammad-fiaz/QuizApp-Flutter/655a0c72af30840eacbcfc4a846f17a619c5eaef/images/quiz/quiz_ic_list5.png
--------------------------------------------------------------------------------
/images/quiz/quiz_ic_mail.svg:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/images/quiz/quiz_ic_quiz.svg:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
--------------------------------------------------------------------------------
/images/quiz/quiz_ic_quiz1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/muhammad-fiaz/QuizApp-Flutter/655a0c72af30840eacbcfc4a846f17a619c5eaef/images/quiz/quiz_ic_quiz1.png
--------------------------------------------------------------------------------
/images/quiz/quiz_ic_quiz2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/muhammad-fiaz/QuizApp-Flutter/655a0c72af30840eacbcfc4a846f17a619c5eaef/images/quiz/quiz_ic_quiz2.png
--------------------------------------------------------------------------------
/images/quiz/quiz_ic_twitter.svg:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/images/quiz/quiz_ic_user.svg:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/images/quiz/quiz_logo.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/muhammad-fiaz/QuizApp-Flutter/655a0c72af30840eacbcfc4a846f17a619c5eaef/images/quiz/quiz_logo.jpg
--------------------------------------------------------------------------------
/ios/.gitignore:
--------------------------------------------------------------------------------
1 | **/dgph
2 | *.mode1v3
3 | *.mode2v3
4 | *.moved-aside
5 | *.pbxuser
6 | *.perspectivev3
7 | **/*sync/
8 | .sconsign.dblite
9 | .tags*
10 | **/.vagrant/
11 | **/DerivedData/
12 | Icon?
13 | **/Pods/
14 | **/.symlinks/
15 | profile
16 | xcuserdata
17 | **/.generated/
18 | Flutter/App.framework
19 | Flutter/Flutter.framework
20 | Flutter/Flutter.podspec
21 | Flutter/Generated.xcconfig
22 | Flutter/ephemeral/
23 | Flutter/app.flx
24 | Flutter/app.zip
25 | Flutter/flutter_assets/
26 | Flutter/flutter_export_environment.sh
27 | ServiceDefinitions.json
28 | Runner/GeneratedPluginRegistrant.*
29 |
30 | # Exceptions to above rules.
31 | !default.mode1v3
32 | !default.mode2v3
33 | !default.pbxuser
34 | !default.perspectivev3
35 |
--------------------------------------------------------------------------------
/ios/Flutter/AppFrameworkInfo.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | en
7 | CFBundleExecutable
8 | App
9 | CFBundleIdentifier
10 | io.flutter.flutter.app
11 | CFBundleInfoDictionaryVersion
12 | 6.0
13 | CFBundleName
14 | App
15 | CFBundlePackageType
16 | FMWK
17 | CFBundleShortVersionString
18 | 1.0
19 | CFBundleSignature
20 | ????
21 | CFBundleVersion
22 | 1.0
23 | MinimumOSVersion
24 | 12.0
25 |
26 |
27 |
--------------------------------------------------------------------------------
/ios/Flutter/Debug.xcconfig:
--------------------------------------------------------------------------------
1 | #include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"
2 | #include "Generated.xcconfig"
3 |
--------------------------------------------------------------------------------
/ios/Flutter/Release.xcconfig:
--------------------------------------------------------------------------------
1 | #include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"
2 | #include "Generated.xcconfig"
3 |
--------------------------------------------------------------------------------
/ios/Podfile:
--------------------------------------------------------------------------------
1 | # Uncomment this line to define a global platform for your project
2 | # platform :ios, '12.0'
3 |
4 | # CocoaPods analytics sends network stats synchronously affecting flutter build latency.
5 | ENV['COCOAPODS_DISABLE_STATS'] = 'true'
6 |
7 | project 'Runner', {
8 | 'Debug' => :debug,
9 | 'Profile' => :release,
10 | 'Release' => :release,
11 | }
12 |
13 | def flutter_root
14 | generated_xcode_build_settings_path = File.expand_path(File.join('..', 'Flutter', 'Generated.xcconfig'), __FILE__)
15 | unless File.exist?(generated_xcode_build_settings_path)
16 | raise "#{generated_xcode_build_settings_path} must exist. If you're running pod install manually, make sure flutter pub get is executed first"
17 | end
18 |
19 | File.foreach(generated_xcode_build_settings_path) do |line|
20 | matches = line.match(/FLUTTER_ROOT\=(.*)/)
21 | return matches[1].strip if matches
22 | end
23 | raise "FLUTTER_ROOT not found in #{generated_xcode_build_settings_path}. Try deleting Generated.xcconfig, then run flutter pub get"
24 | end
25 |
26 | require File.expand_path(File.join('packages', 'flutter_tools', 'bin', 'podhelper'), flutter_root)
27 |
28 | flutter_ios_podfile_setup
29 |
30 | target 'Runner' do
31 | use_frameworks!
32 | use_modular_headers!
33 |
34 | flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__))
35 | target 'RunnerTests' do
36 | inherit! :search_paths
37 | end
38 | end
39 |
40 | post_install do |installer|
41 | installer.pods_project.targets.each do |target|
42 | flutter_additional_ios_build_settings(target)
43 | end
44 | end
45 |
--------------------------------------------------------------------------------
/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/muhammad-fiaz/QuizApp-Flutter/655a0c72af30840eacbcfc4a846f17a619c5eaef/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/muhammad-fiaz/QuizApp-Flutter/655a0c72af30840eacbcfc4a846f17a619c5eaef/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/muhammad-fiaz/QuizApp-Flutter/655a0c72af30840eacbcfc4a846f17a619c5eaef/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/muhammad-fiaz/QuizApp-Flutter/655a0c72af30840eacbcfc4a846f17a619c5eaef/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/muhammad-fiaz/QuizApp-Flutter/655a0c72af30840eacbcfc4a846f17a619c5eaef/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/muhammad-fiaz/QuizApp-Flutter/655a0c72af30840eacbcfc4a846f17a619c5eaef/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/muhammad-fiaz/QuizApp-Flutter/655a0c72af30840eacbcfc4a846f17a619c5eaef/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/muhammad-fiaz/QuizApp-Flutter/655a0c72af30840eacbcfc4a846f17a619c5eaef/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/muhammad-fiaz/QuizApp-Flutter/655a0c72af30840eacbcfc4a846f17a619c5eaef/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/muhammad-fiaz/QuizApp-Flutter/655a0c72af30840eacbcfc4a846f17a619c5eaef/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/muhammad-fiaz/QuizApp-Flutter/655a0c72af30840eacbcfc4a846f17a619c5eaef/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/muhammad-fiaz/QuizApp-Flutter/655a0c72af30840eacbcfc4a846f17a619c5eaef/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/muhammad-fiaz/QuizApp-Flutter/655a0c72af30840eacbcfc4a846f17a619c5eaef/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/muhammad-fiaz/QuizApp-Flutter/655a0c72af30840eacbcfc4a846f17a619c5eaef/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/muhammad-fiaz/QuizApp-Flutter/655a0c72af30840eacbcfc4a846f17a619c5eaef/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/muhammad-fiaz/QuizApp-Flutter/655a0c72af30840eacbcfc4a846f17a619c5eaef/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/muhammad-fiaz/QuizApp-Flutter/655a0c72af30840eacbcfc4a846f17a619c5eaef/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/muhammad-fiaz/QuizApp-Flutter/655a0c72af30840eacbcfc4a846f17a619c5eaef/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 | Quiz
9 | CFBundleExecutable
10 | $(EXECUTABLE_NAME)
11 | CFBundleIdentifier
12 | $(PRODUCT_BUNDLE_IDENTIFIER)
13 | CFBundleInfoDictionaryVersion
14 | 6.0
15 | CFBundleName
16 | quiz
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/Screens/quiz_create_password.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 | import 'package:nb_utils/nb_utils.dart';
3 | import 'package:quiz/Screens/quiz_mobile_verify.dart';
4 | import 'package:quiz/utils/app_widget.dart';
5 | import 'package:quiz/utils/quiz_colors.dart';
6 | import 'package:quiz/utils/quiz_constant.dart';
7 | import 'package:quiz/utils/quiz_strings.dart';
8 | import 'package:quiz/utils/quiz_widget.dart';
9 |
10 | class QuizCreatePassword extends StatefulWidget {
11 | static String tag = '/QuizCreatePassword';
12 |
13 | const QuizCreatePassword({super.key});
14 |
15 | @override
16 | _QuizCreatePasswordState createState() => _QuizCreatePasswordState();
17 | }
18 |
19 | class _QuizCreatePasswordState extends State {
20 | var obscureText = true;
21 |
22 | @override
23 | void initState() {
24 | super.initState();
25 | setState(() {});
26 | }
27 |
28 | @override
29 | Widget build(BuildContext context) {
30 | changeStatusColor(quizappbackground);
31 |
32 | return Scaffold(
33 | appBar: AppBar(
34 | title: text(quizlblCreatepassword, fontSize: textSizeLargeMedium, fontFamily: fontMedium),
35 | leading:const Icon(
36 | Icons.arrow_back,
37 | color: quizcolorPrimary,
38 | size: 30,
39 | ).onTap(() {
40 | Navigator.of(context).pop();
41 | }),
42 | centerTitle: true,
43 | backgroundColor: quizappbackground,
44 | elevation: 0.0,
45 | ),
46 | body: SafeArea(
47 | child: SingleChildScrollView(
48 | child: Container(
49 | height: MediaQuery.of(context).size.height,
50 | color: quizappbackground,
51 | child: Column(
52 | children: [
53 | text(quizinfocreatepassword, textColor: quiztextColorSecondary, isLongText: true, isCentered: true).paddingOnly(left: 40, right: 40, top: 16),
54 | const SizedBox(height: 20),
55 | Container(
56 | margin:const EdgeInsets.all(24.0),
57 | decoration: boxDecoration(bgColor: quizwhite, color: quizwhite, showShadow: true, radius: 10),
58 | child: Column(
59 | children: [
60 | TextFormField(
61 | style:const TextStyle(fontSize: textSizeMedium, fontFamily: fontMedium),
62 | obscureText: obscureText,
63 | decoration: InputDecoration(
64 | contentPadding:const EdgeInsets.fromLTRB(16, 22, 16, 22),
65 | border: InputBorder.none,
66 | hintText: quizhintyourpassword,
67 | labelStyle: primaryTextStyle(size: 20, color: quiztextColorPrimary),
68 | suffix: text(obscureText ? "Show" : "Hide", textColor: quiztextColorSecondary, fontSize: textSizeNormal, fontFamily: fontMedium).onTap(() {
69 | setState(() {
70 | obscureText = !obscureText;
71 | });
72 | }),
73 | //suffixText: (obscureText ? "show" : "hide")
74 | ),
75 | ),
76 | ],
77 | ),
78 | ),
79 | const SizedBox(height: 20),
80 | Column(
81 | children: [
82 | text(quizlblalreadyhaveanaccount),
83 | text(quizlblsignin, textColor: quizcolorPrimary, textAllCaps: true),
84 | ],
85 | ).onTap(() {
86 | finish(context);
87 | }),
88 | const SizedBox(height: 20),
89 | Container(
90 | margin: const EdgeInsets.all(24.0),
91 | child: quizButton(
92 | textContent: quizlblcontinue,
93 | onPressed: () {
94 | setState(() {
95 | const QuizMobileVerify().launch(context);
96 | });
97 | },
98 | ),
99 | )
100 | ],
101 | ),
102 | ),
103 | ),
104 | ),
105 | );
106 | }
107 | }
108 |
--------------------------------------------------------------------------------
/lib/Screens/quiz_dashboard.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 | import 'package:flutter_svg/flutter_svg.dart';
3 | import 'package:quiz/Screens/quiz_all_list.dart';
4 | import 'package:quiz/Screens/quiz_home.dart';
5 | import 'package:quiz/Screens/quiz_profile.dart';
6 | import 'package:quiz/utils/app_widget.dart';
7 | import 'package:quiz/utils/quiz_colors.dart';
8 | import 'package:quiz/utils/quiz_images.dart';
9 |
10 | class QuizDashboard extends StatefulWidget {
11 | static String tag = '/QuizDashboard';
12 |
13 | const QuizDashboard({super.key});
14 |
15 | @override
16 | _QuizDashboardState createState() => _QuizDashboardState();
17 | }
18 |
19 | class _QuizDashboardState extends State {
20 | var selectedIndex = 0;
21 |
22 | var pages = [
23 | const QuizHome(),
24 | const QuizAllList(),
25 | const QuizProfile(),
26 | ];
27 |
28 | @override
29 | void initState() {
30 | super.initState();
31 | selectedIndex = 0;
32 | }
33 |
34 | void _onItemTapped(int index) {
35 | setState(() {
36 | selectedIndex = index;
37 | if (selectedIndex == 0) {
38 | } else if (selectedIndex == 1) {
39 | } else if (selectedIndex == 2) {}
40 | });
41 | }
42 |
43 | Widget quizItem(var pos, var icon, var title) {
44 | return GestureDetector(
45 | onTap: () {
46 | setState(() {
47 | _onItemTapped(pos);
48 | });
49 | },
50 | child: Container(
51 | height: 55,
52 | alignment: Alignment.center,
53 | child: Column(
54 | children: [
55 | SvgPicture.asset(
56 | icon,
57 | width: 20,
58 | height: 20,
59 | color: selectedIndex == pos ? quizcolorPrimary : quiziconcolor,
60 | ),
61 | text(
62 | title,
63 | textColor: selectedIndex == pos ? quizcolorPrimary : quiziconcolor,
64 | )
65 | ],
66 | ),
67 | ),
68 | );
69 | }
70 |
71 | @override
72 | Widget build(BuildContext context) {
73 | changeStatusColor(quizappbackground);
74 | return Scaffold(
75 | backgroundColor: quizappbackground,
76 | body: SafeArea(
77 | child: pages[selectedIndex],
78 | ),
79 | bottomNavigationBar: Container(
80 | //padding: EdgeInsets.all(20),
81 | decoration: BoxDecoration(
82 | color: quizwhite,
83 | border: Border.all(
84 | color: quizShadowColor,
85 | ),
86 | borderRadius: const BorderRadius.only(topLeft: Radius.circular(20), topRight: Radius.circular(20)), boxShadow: const [
87 | BoxShadow(
88 | color: quizShadowColor,
89 | blurRadius: 10,
90 | spreadRadius: 2,
91 | offset: Offset(0, 3.0),
92 | ),
93 | ],
94 | ),
95 | child: Padding(
96 | padding: const EdgeInsets.only(left: 0.0, right: 0, top: 8),
97 | child: Row(
98 | mainAxisAlignment: MainAxisAlignment.spaceAround,
99 | children: [
100 | quizItem(0, quizichomes, "Home"),
101 | quizItem(1, quizicquiz, "Quiz"),
102 | quizItem(2, quizicuser, "Profile"),
103 | ],
104 | ),
105 | ),
106 | ),
107 | );
108 | }
109 | }
110 |
--------------------------------------------------------------------------------
/lib/Screens/quiz_details.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 | import 'package:nb_utils/nb_utils.dart';
3 | import 'package:quiz/Screens/quiz_card.dart';
4 | import 'package:quiz/model/quiz_models.dart';
5 | import 'package:quiz/utils/app_widget.dart';
6 | import 'package:quiz/utils/quiz_colors.dart';
7 | import 'package:quiz/utils/quiz_constant.dart';
8 | import 'package:quiz/utils/quiz_data_generator.dart';
9 | import 'package:quiz/utils/quiz_strings.dart';
10 | import 'package:quiz/utils/quiz_widget.dart';
11 |
12 | class QuizDetails extends StatefulWidget {
13 | static String tag = '/QuizDetails';
14 |
15 | const QuizDetails({super.key});
16 |
17 | @override
18 | _QuizDetailsState createState() => _QuizDetailsState();
19 | }
20 |
21 | class _QuizDetailsState extends State {
22 | late List mList;
23 |
24 | @override
25 | void initState() {
26 | super.initState();
27 | mList = quizGetData();
28 | }
29 |
30 | @override
31 | Widget build(BuildContext context) {
32 | changeStatusColor(quizappbackground);
33 | return Scaffold(
34 | backgroundColor: quizappbackground,
35 | body: Column(
36 | children: [
37 | const quizTopBar(quizlblbiologybasics),
38 | Expanded(
39 | child: SingleChildScrollView(
40 | child: Column(
41 | children: [
42 | const SizedBox(
43 | height: 20,
44 | ),
45 | text(quizlblbiologyampscientificmethod, isLongText: true, fontFamily: fontBold, isCentered: true, fontSize: textSizeXLarge),
46 | text(quiztext4to8lesson, textColor: quiztextColorSecondary),
47 | const SizedBox(
48 | height: 10,
49 | ),
50 | ListView.builder(
51 | scrollDirection: Axis.vertical,
52 | itemCount: mList.length,
53 | shrinkWrap: true,
54 | physics:const NeverScrollableScrollPhysics(),
55 | itemBuilder: (context, index) {
56 | return quizList(mList[index], index);
57 | }),
58 | ],
59 | ),
60 | ),
61 | )
62 | ],
63 | ),
64 | );
65 | }
66 | }
67 |
68 | // ignore: must_be_immutable, camel_case_types
69 | class quizList extends StatelessWidget {
70 | late var width;
71 | late QuizTestModel model;
72 |
73 | quizList(this.model, int pos, {super.key});
74 |
75 | @override
76 | Widget build(BuildContext context) {
77 | width = MediaQuery.of(context).size.width;
78 | return Container(
79 | margin:const EdgeInsets.only(left: 16, bottom: 16, right: 16),
80 | decoration: boxDecoration(radius: 10, showShadow: true, bgColor: quizwhite),
81 | padding:const EdgeInsets.all(16),
82 | child: Column(
83 | crossAxisAlignment: CrossAxisAlignment.start,
84 | children: [
85 | Row(
86 | children: [
87 | Container(
88 | decoration:const BoxDecoration(shape: BoxShape.circle, color: quizcolorsetting),
89 | width: width / 6.5,
90 | height: width / 6.5,
91 | padding:const EdgeInsets.all(10),
92 | child: commonCacheImageWidget(
93 | model.image,
94 | ),
95 | ),
96 | const SizedBox(
97 | width: 16,
98 | ),
99 | Column(
100 | crossAxisAlignment: CrossAxisAlignment.start,
101 | children: [
102 | text(model.type, textColor: quiztextColorSecondary, fontSize: textSizeSMedium),
103 | text(
104 | model.heading,
105 | fontFamily: fontMedium,
106 | ),
107 | ],
108 | )
109 | ],
110 | ),
111 | const SizedBox(
112 | height: 16,
113 | ),
114 | text(model.description, textColor: quiztextColorSecondary),
115 | const SizedBox(
116 | height: 16,
117 | ),
118 | quizButton(
119 | textContent: quizlblbegin,
120 | onPressed: () {
121 | const QuizCards().launch(context);
122 | })
123 | ],
124 | ),
125 | );
126 | }
127 | }
128 |
--------------------------------------------------------------------------------
/lib/Screens/quiz_mobile_verify.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 | import 'package:nb_utils/nb_utils.dart';
3 | import 'package:quiz/Screens/quiz_dashboard.dart';
4 | import 'package:quiz/Screens/quiz_verifcation.dart';
5 | import 'package:quiz/utils/app_widget.dart';
6 | import 'package:quiz/utils/quiz_colors.dart';
7 | import 'package:quiz/utils/quiz_constant.dart';
8 | import 'package:quiz/utils/quiz_strings.dart';
9 | import 'package:quiz/utils/quiz_widget.dart';
10 | import 'package:quiz/utils/codePicker/country_code_picker.dart';
11 |
12 | class QuizMobileVerify extends StatefulWidget {
13 | static String tag = '/QuizMobileVerify';
14 |
15 | const QuizMobileVerify({super.key});
16 |
17 | @override
18 | _QuizMobileVerifyState createState() => _QuizMobileVerifyState();
19 | }
20 |
21 | class _QuizMobileVerifyState extends State {
22 | @override
23 | Widget build(BuildContext context) {
24 | changeStatusColor(quizappbackground);
25 |
26 | return Scaffold(
27 | appBar: AppBar(
28 | title: text(quizlblletstarted, fontSize: textSizeLargeMedium, fontFamily: fontMedium),
29 | leading:const Icon(
30 | Icons.arrow_back,
31 | color: quizcolorPrimary,
32 | size: 30,
33 | ).onTap(() {
34 | Navigator.of(context).pop();
35 | }),
36 | actions: [
37 | Padding(
38 | padding:const EdgeInsets.only(right: 16.0),
39 | child: GestureDetector(
40 | onTap: () {
41 | setState(() {
42 | const QuizDashboard().launch(context);
43 | });
44 | },
45 | child: text(quizlblskip, textColor: quiztextColorSecondary, fontSize: textSizeMedium, fontFamily: fontMedium).center())),
46 | ],
47 | centerTitle: true,
48 | backgroundColor: quizappbackground,
49 | elevation: 0.0,
50 | ),
51 | body: SafeArea(
52 | child: SingleChildScrollView(
53 | child: Container(
54 | height: MediaQuery.of(context).size.height,
55 | color: quizappbackground,
56 | child: Column(
57 | children: [
58 | const SizedBox(height: 20),
59 | text(quizinfoletstarted, textColor: quiztextColorSecondary, isLongText: true, isCentered: true).center(),
60 | const SizedBox(height: 20),
61 | Container(
62 | margin:const EdgeInsets.all(24.0),
63 | decoration: boxDecoration(bgColor: quizwhite, color: quizwhite, showShadow: true, radius: 10),
64 | child: Row(
65 | children: [
66 | const SizedBox(width: 5),
67 | const CountryCodePicker(onChanged: print, showFlag: true),
68 | Container(
69 | height: 30.0,
70 | width: 1.0,
71 | color: quizcolorPrimary,
72 | margin: const EdgeInsets.only(left: 10.0, right: 10.0),
73 | ),
74 | Expanded(
75 | child: TextFormField(
76 | keyboardType: TextInputType.number,
77 | maxLength: 10,
78 | style:const TextStyle(fontSize: textSizeLargeMedium, fontFamily: fontRegular),
79 | decoration:const InputDecoration(
80 | contentPadding: EdgeInsets.fromLTRB(16, 22, 16, 22),
81 | counterText: "",
82 | hintText: quizhintMobileNumber,
83 | hintStyle: TextStyle(color: quiztextColorPrimary, fontSize: textSizeMedium),
84 | border: InputBorder.none,
85 | ),
86 | ),
87 | )
88 | ],
89 | ),
90 | ),
91 | const SizedBox(height: 20),
92 | Container(
93 | child: Column(
94 | children: [
95 | text(quizlblalreadyhaveanaccount),
96 | text(quizlblsignin, textColor: quizcolorPrimary, textAllCaps: true),
97 | ],
98 | ).onTap(() {
99 | finish(context);
100 | }),
101 | ).onTap(() {
102 | Navigator.of(context).pop();
103 | }),
104 | const SizedBox(height: 20),
105 | Container(
106 | margin:const EdgeInsets.all(24.0),
107 | child: quizButton(
108 | textContent: quizlblcontinue,
109 | onPressed: () {
110 | setState(() {
111 | const QuizVerification().launch(context);
112 | });
113 | },
114 | ),
115 | )
116 | ],
117 | ),
118 | ),
119 | ),
120 | ),
121 | );
122 | }
123 | }
124 |
--------------------------------------------------------------------------------
/lib/Screens/quiz_search.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 | import 'package:quiz/Screens/repo_screen.dart';
3 | import 'package:quiz/model/quiz_models.dart';
4 | import 'package:quiz/utils/quiz_colors.dart';
5 | import 'package:quiz/utils/quiz_data_generator.dart';
6 |
7 | class QuizSearch extends StatefulWidget {
8 | static String tag = '/QuizSearch';
9 |
10 | const QuizSearch({super.key});
11 |
12 | @override
13 | _QuizSearchState createState() => _QuizSearchState();
14 | }
15 |
16 | class _QuizSearchState extends State {
17 | late List mListings;
18 | var searchCont = TextEditingController();
19 |
20 | @override
21 | void initState() {
22 | super.initState();
23 | mListings = getQuizData();
24 | }
25 |
26 | @override
27 | Widget build(BuildContext context) {
28 | return const Scaffold(
29 | backgroundColor: quizappbackground,
30 | body: RepoScreen(enableAppbar: true),
31 | );
32 | }
33 | }
34 |
--------------------------------------------------------------------------------
/lib/Screens/quiz_sign_in.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 | import 'package:nb_utils/nb_utils.dart';
3 | import 'package:quiz/Screens/quiz_dashboard.dart';
4 | import 'package:quiz/Screens/quiz_sign_up.dart';
5 | import 'package:quiz/utils/app_widget.dart';
6 | import 'package:quiz/utils/quiz_colors.dart';
7 | import 'package:quiz/utils/quiz_constant.dart';
8 | import 'package:quiz/utils/quiz_strings.dart';
9 | import 'package:quiz/utils/quiz_widget.dart';
10 |
11 | class QuizSignIn extends StatefulWidget {
12 | static String tag = '/QuizSignIn';
13 |
14 | const QuizSignIn({super.key});
15 |
16 | @override
17 | _QuizSignInState createState() => _QuizSignInState();
18 | }
19 |
20 | class _QuizSignInState extends State {
21 | @override
22 | Widget build(BuildContext context) {
23 | changeStatusColor(quizappbackground);
24 |
25 | return Scaffold(
26 | backgroundColor: quizappbackground,
27 | body: SafeArea(
28 | child: SingleChildScrollView(
29 | child: Container(
30 | height: MediaQuery.of(context).size.height,
31 | color: quizappbackground,
32 | child: Column(
33 | children: [
34 | const SizedBox(height: 16),
35 | text(quiztitlelogin, fontSize: textSizeNormal, fontFamily: fontBold),
36 | text(quizinfologin, textColor: quiztextColorSecondary, isLongText: true, isCentered: true).center(),
37 | Container(
38 | margin:const EdgeInsets.all(24.0),
39 | decoration: boxDecoration(bgColor: quizwhite, color: quizwhite, showShadow: true, radius: 10),
40 | child: Column(
41 | children: [
42 | quizEditTextStyle(quizhintyouremail, isPassword: false),
43 | quizDivider(),
44 | quizEditTextStyle(quizhintyourpassword),
45 | ],
46 | ),
47 | ),
48 | const SizedBox(height: 30),
49 | Column(
50 | children: [
51 | text(quizlbldonthaveanaccount),
52 | text(quizlblcreateaccount, textColor: quizcolorPrimary, fontFamily: fontSemibold),
53 | ],
54 | ).onTap(() {
55 | setState(() {
56 | const QuizSignUp().launch(context);
57 | });
58 | }),
59 | const SizedBox(
60 | height: 10,
61 | ),
62 | Container(
63 | margin:const EdgeInsets.all(24.0),
64 | child: quizButton(
65 | textContent: quizlblcontinue,
66 | onPressed: () {
67 | setState(() {
68 | const QuizDashboard().launch(context);
69 | });
70 | }))
71 | ],
72 | ),
73 | ),
74 | ),
75 | ),
76 | );
77 | }
78 | }
79 |
--------------------------------------------------------------------------------
/lib/Screens/quiz_sign_up.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 | import 'package:nb_utils/nb_utils.dart';
3 | import 'package:quiz/Screens/quiz_create_password.dart';
4 | import 'package:quiz/utils/app_widget.dart';
5 | import 'package:quiz/utils/quiz_colors.dart';
6 | import 'package:quiz/utils/quiz_constant.dart';
7 | import 'package:quiz/utils/quiz_strings.dart';
8 | import 'package:quiz/utils/quiz_widget.dart';
9 |
10 | class QuizSignUp extends StatefulWidget {
11 | static String tag = '/QuizSignUp';
12 |
13 | const QuizSignUp({super.key});
14 |
15 | @override
16 | _QuizSignUpState createState() => _QuizSignUpState();
17 | }
18 |
19 | class _QuizSignUpState extends State {
20 | @override
21 | Widget build(BuildContext context) {
22 | changeStatusColor(quizappbackground);
23 |
24 | return Scaffold(
25 | appBar: AppBar(
26 | title: text(quizlblcreateaccount, fontSize: textSizeLargeMedium, fontFamily: fontMedium),
27 | leading:const Icon(
28 | Icons.arrow_back,
29 | color: quizcolorPrimary,
30 | size: 30,
31 | ).onTap(() {
32 | Navigator.of(context).pop();
33 | }),
34 | centerTitle: true,
35 | backgroundColor: quizappbackground,
36 | elevation: 0.0,
37 | ),
38 | body: SafeArea(
39 | child: Container(
40 | height: MediaQuery.of(context).size.height,
41 | color: quizappbackground,
42 | child: SingleChildScrollView(
43 | child: Column(
44 | children: [
45 | const SizedBox(height: 20),
46 | text(quizinfosignup, textColor: quiztextColorSecondary, isLongText: true, isCentered: true).center(),
47 | Container(
48 | margin:const EdgeInsets.all(24.0),
49 | decoration: boxDecoration(bgColor: quizwhite, color: quizwhite, showShadow: true, radius: 10),
50 | child: quizEditTextStyle(quizhintyouremail, isPassword: false),
51 | ),
52 | const SizedBox(height: 20),
53 | Column(
54 | children: [
55 | text(quizlblalreadyhaveanaccount),
56 | text(quizlblsignin, textColor: quizcolorPrimary, textAllCaps: true),
57 | ],
58 | ).onTap(() {
59 | Navigator.of(context).pop();
60 | }),
61 | const SizedBox(height: 20),
62 | Container(
63 | margin:const EdgeInsets.all(24.0),
64 | child: quizButton(
65 | textContent: quizlblcontinue,
66 | onPressed: () {
67 | setState(() {
68 | const QuizCreatePassword().launch(context);
69 | });
70 | },
71 | ),
72 | )
73 | ],
74 | ),
75 | ),
76 | ),
77 | ),
78 | );
79 | }
80 | }
81 |
--------------------------------------------------------------------------------
/lib/Screens/quiz_splash_screen.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 | import 'package:quiz/Screens/quiz_sign_in.dart';
3 | import 'package:nb_utils/nb_utils.dart';
4 | import 'package:quiz/utils/app_widget.dart';
5 |
6 | import '../onBoardingScreens/view/onBoardingScreen.dart';
7 |
8 | class QuizSplashScreen extends StatefulWidget {
9 | const QuizSplashScreen({super.key});
10 |
11 | @override
12 | _QuizSplashScreenState createState() => _QuizSplashScreenState();
13 | }
14 |
15 | class _QuizSplashScreenState extends State {
16 | @override
17 | void initState() {
18 | super.initState();
19 | init();
20 | }
21 |
22 | void init() async {
23 | // Add logic to check if onboarding is complete
24 | SharedPreferences prefs = await SharedPreferences.getInstance();
25 | bool onboardingComplete = prefs.getBool('onboarding_complete') ?? false;
26 |
27 | if (onboardingComplete) {
28 | await 3.seconds.delay.then((value) => push(const QuizSignIn(), pageRouteAnimation: PageRouteAnimation.Slide, isNewTask: true));
29 | } else {
30 | await 3.seconds.delay.then((value) => push(const onBoardingScreenHome(), pageRouteAnimation: PageRouteAnimation.Slide, isNewTask: true));
31 | }
32 | }
33 |
34 | @override
35 | void setState(fn) {
36 | if (mounted) super.setState(fn);
37 | }
38 |
39 | @override
40 | Widget build(BuildContext context) {
41 | return Scaffold(
42 | body: Container(
43 | child: Column(
44 | crossAxisAlignment: CrossAxisAlignment.center,
45 | mainAxisAlignment: MainAxisAlignment.center,
46 | children: [
47 | commonCacheImageWidget("images/quiz/ic_background.png", height: 250, width: 250),
48 | ],
49 | ).withWidth(context.width()),
50 | ),
51 | );
52 | }
53 | }
54 |
--------------------------------------------------------------------------------
/lib/Screens/quiz_verifcation.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 | import 'package:nb_utils/nb_utils.dart';
3 | import 'package:quiz/Screens/repo_screen.dart';
4 | import 'package:quiz/utils/app_widget.dart';
5 | import 'package:quiz/utils/quiz_colors.dart';
6 | import 'package:quiz/utils/quiz_constant.dart';
7 | import 'package:quiz/utils/quiz_strings.dart';
8 | import 'package:quiz/utils/quiz_widget.dart';
9 |
10 | class QuizVerification extends StatefulWidget {
11 | static String tag = '/QuizMobileVerification';
12 |
13 | const QuizVerification({super.key});
14 |
15 | @override
16 | _QuizVerificationState createState() => _QuizVerificationState();
17 | }
18 |
19 | class _QuizVerificationState extends State {
20 | @override
21 | Widget build(BuildContext context) {
22 | changeStatusColor(quizappbackground);
23 |
24 | return Scaffold(
25 | appBar: AppBar(
26 | title: text(quiztitleVerification, fontSize: textSizeLargeMedium, fontFamily: fontMedium),
27 | leading:const Icon(
28 | Icons.arrow_back,
29 | color: quizcolorPrimary,
30 | size: 30,
31 | ).onTap(() {
32 | Navigator.of(context).pop();
33 | }),
34 | centerTitle: true,
35 | backgroundColor: quizappbackground,
36 | elevation: 0.0,
37 | ),
38 | body: SafeArea(
39 | child: SingleChildScrollView(
40 | child: Container(
41 | height: MediaQuery.of(context).size.height,
42 | color: quizappbackground,
43 | child: Column(
44 | children: [
45 | const SizedBox(height: 20),
46 | text(quizinfoVerification, textColor: quiztextColorSecondary, isLongText: true, isCentered: true).center(),
47 | const SizedBox(height: 20),
48 | const PinEntryTextField(fields: 4, fontSize: textSizeLargeMedium).center(),
49 | const SizedBox(height: 20),
50 | Column(
51 | children: [
52 | text(quizlbldidnotreceivecode),
53 | text(quizlblResend, textColor: quizcolorPrimary, textAllCaps: true),
54 | ],
55 | ).onTap(() {}),
56 | const SizedBox(height: 20),
57 | Container(
58 | margin:const EdgeInsets.all(24.0),
59 | child: quizButton(
60 | textContent: quizlblcontinue,
61 | onPressed: () {
62 | setState(() {
63 | const RepoScreen().launch(context);
64 | });
65 | },
66 | ),
67 | ),
68 | ],
69 | ),
70 | ),
71 | ),
72 | ),
73 | );
74 | }
75 | }
76 |
--------------------------------------------------------------------------------
/lib/Screens/repo_button.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 | import 'package:nb_utils/nb_utils.dart';
3 | import 'package:quiz/utils/quiz_colors.dart';
4 | import 'package:url_launcher/url_launcher.dart';
5 |
6 | class RepoButton extends StatelessWidget {
7 | const RepoButton({super.key});
8 |
9 | @override
10 | Widget build(BuildContext context) {
11 | return AppButton(
12 | text: 'Check out the Repo',
13 | color: quizcolorPrimary,
14 | textStyle: boldTextStyle(color: Colors.white),
15 | shapeBorder: RoundedRectangleBorder(borderRadius: radius(10)),
16 | onTap: () {
17 | launch("https://github.com/muhammad-fiaz/QuizApp-Flutter");
18 | },
19 | );
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/lib/Screens/repo_screen.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 | import 'package:nb_utils/nb_utils.dart';
3 | import 'package:quiz/Screens/repo_button.dart';
4 | import 'package:quiz/utils/app_widget.dart';
5 |
6 | class RepoScreen extends StatefulWidget {
7 | final bool? enableAppbar;
8 |
9 | const RepoScreen({super.key, this.enableAppbar = false});
10 |
11 | @override
12 | _RepoScreenState createState() => _RepoScreenState();
13 | }
14 |
15 | class _RepoScreenState extends State {
16 | @override
17 | void initState() {
18 | super.initState();
19 | init();
20 | }
21 |
22 | void init() async {
23 | //
24 | }
25 |
26 | @override
27 | void setState(fn) {
28 | if (mounted) super.setState(fn);
29 | }
30 |
31 | @override
32 | Widget build(BuildContext context) {
33 | return SafeArea(
34 | child: Scaffold(
35 | body: Stack(
36 | children: [
37 | const Icon(Icons.arrow_back, size: 24).paddingAll(16).onTap(() {
38 | finish(context);
39 | }).visible(widget.enableAppbar!),
40 | SizedBox(
41 | width: context.width(),
42 | child: Column(
43 | mainAxisAlignment: MainAxisAlignment.center,
44 | crossAxisAlignment: CrossAxisAlignment.center,
45 | children: [
46 | Container(
47 | decoration: boxDecorationDefault(shape: BoxShape.circle),
48 | child: commonCacheImageWidget(
49 | "images/quiz/ic_background.png",
50 | height: 180,
51 | ).cornerRadiusWithClipRRect(90)),
52 | 22.height,
53 | Text(
54 | 'This is UI is Still in Active Development.',
55 | style: boldTextStyle(size: 22),
56 | textAlign: TextAlign.center,
57 | ),
58 | 16.height,
59 | const RepoButton(),
60 | ],
61 | ),
62 | ).paddingAll(16),
63 | ],
64 | ),
65 | ),
66 | );
67 | }
68 | }
69 |
--------------------------------------------------------------------------------
/lib/generated_plugin_registrant.dart:
--------------------------------------------------------------------------------
1 | //
2 | // Generated file. Do not edit.
3 | //
4 |
5 | // ignore_for_file: directives_ordering
6 | // ignore_for_file: lines_longer_than_80_chars
7 |
8 | import 'package:connectivity_plus_web/connectivity_plus_web.dart';
9 | import 'package:fluttertoast/fluttertoast_web.dart';
10 | import 'package:shared_preferences_web/shared_preferences_web.dart';
11 | import 'package:url_launcher_web/url_launcher_web.dart';
12 |
13 | import 'package:flutter_web_plugins/flutter_web_plugins.dart';
14 |
15 | // ignore: public_member_api_docs
16 | void registerPlugins(Registrar registrar) {
17 | ConnectivityPlusPlugin.registerWith(registrar);
18 | FluttertoastWebPlugin.registerWith(registrar);
19 | SharedPreferencesPlugin.registerWith(registrar);
20 | UrlLauncherPlugin.registerWith(registrar);
21 | registrar.registerMessageHandler();
22 | }
23 |
--------------------------------------------------------------------------------
/lib/main.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 | import 'package:nb_utils/nb_utils.dart';
3 | import 'package:quiz/Screens/quiz_splash_screen.dart';
4 | /*
5 | MIT License
6 |
7 | Copyright (c) 2024 Muhammad Fiaz
8 |
9 | Permission is hereby granted, free of charge, to any person obtaining a copy
10 | of this software and associated documentation files (the "Software"), to deal
11 | in the Software without restriction, including without limitation the rights
12 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
13 | copies of the Software, and to permit persons to whom the Software is
14 | furnished to do so, subject to the following conditions:
15 |
16 | The above copyright notice and this permission notice shall be included in all
17 | copies or substantial portions of the Software.
18 |
19 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
20 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
21 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
22 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
23 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
24 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
25 | SOFTWARE.
26 |
27 | */
28 | void main() async {
29 | // await initialize();
30 | runApp(const MyApp());
31 | }
32 |
33 | class MyApp extends StatelessWidget {
34 | const MyApp({Key? key}) : super(key: key);
35 |
36 | // This widget is the root of your application.
37 | @override
38 | Widget build(BuildContext context) {
39 | return MaterialApp(
40 | title: 'Quiz App',
41 | home:const QuizSplashScreen(),
42 | debugShowCheckedModeBanner: false,
43 | navigatorKey: navigatorKey,
44 | );
45 | }
46 | }
47 |
--------------------------------------------------------------------------------
/lib/model/quiz_models.dart:
--------------------------------------------------------------------------------
1 | class NewQuizModel {
2 | var quizName = "";
3 | var totalQuiz = "";
4 | var quizImage = "";
5 | }
6 |
7 | class QuizTestModel {
8 | var heading = "";
9 | var image = "";
10 | var description = "";
11 | var type = "";
12 | var status = "";
13 | }
14 |
15 | class QuizRecentSearchDataModel {
16 | var name = "";
17 | }
18 |
19 | class QuizBadgesModel {
20 | var title = "";
21 | var subtitle = "";
22 | var img = "";
23 | }
24 |
25 | class QuizScoresModel {
26 | var title = "";
27 | var totalQuiz = "";
28 | var img = "";
29 | var scores = "";
30 | }
31 |
32 | class QuizContactUsModel {
33 | var title = "";
34 | var subtitle = "";
35 | }
36 |
--------------------------------------------------------------------------------
/lib/onBoardingScreens/components.dart:
--------------------------------------------------------------------------------
1 | /*
2 | MIT License
3 |
4 | Copyright (c) 2024 Muhammad Fiaz
5 |
6 | Permission is hereby granted, free of charge, to any person obtaining a copy
7 | of this software and associated documentation files (the "Software"), to deal
8 | in the Software without restriction, including without limitation the rights
9 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 | copies of the Software, and to permit persons to whom the Software is
11 | furnished to do so, subject to the following conditions:
12 |
13 | The above copyright notice and this permission notice shall be included in all
14 | copies or substantial portions of the Software.
15 |
16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22 | SOFTWARE.
23 |
24 | */
25 | import 'package:flutter/material.dart';
26 | import 'package:quiz/onBoardingScreens/utils/colors.dart';
27 | import 'package:shared_preferences/shared_preferences.dart';
28 |
29 | import '../Screens/quiz_sign_in.dart';
30 |
31 |
32 |
33 | class GetStartBtn extends StatelessWidget {
34 | const GetStartBtn({
35 | Key? key,
36 | required this.size,
37 | required this.textTheme,
38 | }) : super(key: key);
39 |
40 | final Size size;
41 | final TextTheme textTheme;
42 |
43 | @override
44 | Widget build(BuildContext context) {
45 | return GestureDetector(
46 | onTap: () async {
47 | // Get the SharedPreferences instance
48 | SharedPreferences prefs = await SharedPreferences.getInstance();
49 |
50 | // Set the onboarding complete flag to true
51 | await prefs.setBool('onboarding_complete', true);
52 |
53 | // Navigate to the home page
54 | Navigator.pushReplacement(
55 | context,
56 | MaterialPageRoute(builder: (context) => QuizSignIn()),
57 | );
58 | },
59 | child: Container(
60 | margin: const EdgeInsets.only(top: 60),
61 | width: size.width / 1.5,
62 | height: size.height / 13,
63 | decoration: BoxDecoration(
64 | color: MyColors.btnColor, borderRadius: BorderRadius.circular(15)),
65 | child: Center(
66 | child: Text("Get Started now", style: textTheme.headline4),
67 | ),
68 | ),
69 | );
70 | }
71 | }
72 |
73 |
74 | class SkipBtn extends StatelessWidget {
75 | const SkipBtn({
76 | Key? key,
77 | required this.size,
78 | required this.textTheme,
79 | required this.onTap,
80 | }) : super(key: key);
81 |
82 | final Size size;
83 | final TextTheme textTheme;
84 | final VoidCallback onTap;
85 |
86 | @override
87 | Widget build(BuildContext context) {
88 | return Container(
89 | margin: const EdgeInsets.only(top: 60),
90 | width: size.width / 1.5,
91 | height: size.height / 13,
92 | decoration: BoxDecoration(
93 | border: Border.all(
94 | color: MyColors.btnBorderColor,
95 | width: 2,
96 | ),
97 | borderRadius: BorderRadius.circular(15)),
98 | child: InkWell(
99 | borderRadius: BorderRadius.circular(15.0),
100 | onTap: onTap,
101 | splashColor: MyColors.btnBorderColor,
102 | child: Center(
103 | child: Text("Skip", style: textTheme.headline3),
104 | ),
105 | ),
106 | );
107 | }
108 | }
109 |
--------------------------------------------------------------------------------
/lib/onBoardingScreens/model/items_model.dart:
--------------------------------------------------------------------------------
1 |
2 |
3 | class Chat {
4 | final String title;
5 | final String subtitle;
6 |
7 | Chat({
8 | required this.title,
9 | required this.subtitle,
10 | });
11 | }
12 |
13 | class Items {
14 | final String img;
15 | final String title;
16 | final String subTitle;
17 | final Chat chat;
18 |
19 | Items({
20 | required this.img,
21 | required this.title,
22 | required this.subTitle,
23 | required this.chat,
24 | });
25 | }
26 |
27 | // onBoardingScreens Intro Contents for Quiz App
28 | List listOfItems = [
29 | Items(
30 | img: "images/quiz/quiz_logo.jpg",
31 | title: "Challenge your friends",
32 | subTitle:
33 | "Engage in quiz challenges with your friends\nand family using our app.",
34 | chat: Chat(
35 | title: "Quiz Challenges",
36 | subtitle: "Challenge your best friends to quiz battles.",
37 | ),
38 | ),
39 | Items(
40 | img: "images/quiz/quiz_logo.jpg",
41 | title: "Join exciting quiz groups",
42 | subTitle:
43 | "Find and join groups that share your quiz\ninterests and participate together.",
44 | chat: Chat(
45 | title: "Quiz Groups",
46 | subtitle: "Join groups with quiz enthusiasts.",
47 | ),
48 | ),
49 | Items(
50 | img: "images/quiz/quiz_logo.jpg",
51 | title: "Discover quiz enthusiasts",
52 | subTitle:
53 | "Connect with new people who share your\npassion for quizzes around the world.",
54 | chat: Chat(
55 | title: "Quiz Connections",
56 | subtitle: "Discover and chat with fellow quiz enthusiasts.",
57 | ),
58 | ),
59 | ];
60 |
61 |
--------------------------------------------------------------------------------
/lib/onBoardingScreens/utils/colors.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 |
3 | class MyColors{
4 | static const Color titleTextColor = Color(0xFF504e9c);
5 | static const Color btnColor = Color(0xFF4786ec);
6 | static const Color btnBorderColor = Color.fromARGB(255, 183, 181, 252);
7 | static const Color subTitleTextColor = Color(0xFF9593a8);
8 | }
--------------------------------------------------------------------------------
/lib/utils/app_widget.dart:
--------------------------------------------------------------------------------
1 | import 'package:cached_network_image/cached_network_image.dart';
2 | import 'package:flutter/material.dart';
3 | import 'package:html/parser.dart';
4 | import 'package:nb_utils/nb_utils.dart';
5 |
6 | Widget text(
7 | String? text, {
8 | var fontSize = 18.0,
9 | Color? textColor,
10 | var fontFamily,
11 | var isCentered = false,
12 | var maxLine = 1,
13 | var latterSpacing = 0.5,
14 | bool textAllCaps = false,
15 | var isLongText = false,
16 | bool lineThrough = false,
17 | }) {
18 | return Text(
19 | textAllCaps ? text!.toUpperCase() : text!,
20 | textAlign: isCentered ? TextAlign.center : TextAlign.start,
21 | maxLines: isLongText ? null : maxLine,
22 | overflow: TextOverflow.ellipsis,
23 | style: TextStyle(
24 | fontFamily: fontFamily,
25 | fontSize: fontSize,
26 | color: textColor ?? textSecondaryColor,
27 | height: 1.5,
28 | letterSpacing: latterSpacing,
29 | decoration: lineThrough ? TextDecoration.lineThrough : TextDecoration.none,
30 | ),
31 | );
32 | }
33 |
34 | BoxDecoration boxDecoration({double radius = 2, Color color = Colors.transparent, Color? bgColor, var showShadow = false}) {
35 | return BoxDecoration(
36 | color: bgColor,
37 | boxShadow: showShadow ? defaultBoxShadow(shadowColor: shadowColorGlobal) : [ const BoxShadow(color: Colors.transparent)],
38 | border: Border.all(color: color),
39 | borderRadius: BorderRadius.all(Radius.circular(radius)),
40 | );
41 | }
42 |
43 | void changeStatusColor(Color color) async {
44 | setStatusBarColor(color);
45 | }
46 |
47 | Widget commonCacheImageWidget(String? url, {double? height, double? width, BoxFit? fit}) {
48 | if (url.validate().startsWith('http')) {
49 | if (isMobile) {
50 | return CachedNetworkImage(
51 | placeholder: placeholderWidgetFn() as Widget Function(BuildContext, String)?,
52 | imageUrl: '$url',
53 | height: height,
54 | width: width,
55 | fit: fit ?? BoxFit.cover,
56 | errorWidget: (_, __, ___) {
57 | return SizedBox(height: height, width: width);
58 | },
59 | );
60 | } else {
61 | return Image.network(url!, height: height, width: width, fit: fit ?? BoxFit.cover);
62 | }
63 | } else {
64 | return Image.asset(url!, height: height, width: width, fit: fit ?? BoxFit.cover);
65 | }
66 | }
67 |
68 | class CustomTheme extends StatelessWidget {
69 | final Widget? child;
70 |
71 | const CustomTheme({super.key, required this.child});
72 |
73 | @override
74 | Widget build(BuildContext context) {
75 | return Theme(
76 | data: ThemeData.light(),
77 | child: child!,
78 | );
79 | }
80 | }
81 |
82 | Widget? Function(BuildContext, String) placeholderWidgetFn() => (_, s) => placeholderWidget();
83 |
84 | Widget placeholderWidget() => Image.asset('images/quiz/empty_image_placeholder.jpg', fit: BoxFit.cover);
85 |
86 | String parseHtmlString(String? htmlString) {
87 | return parse(parse(htmlString).body!.text).documentElement!.text;
88 | }
89 |
--------------------------------------------------------------------------------
/lib/utils/codePicker/country_code.dart:
--------------------------------------------------------------------------------
1 | mixin ToAlias {}
2 |
3 | @deprecated
4 | class CElement = CountryCode with ToAlias;
5 |
6 | /// Country element. This is the element that contains all the information
7 | class CountryCode {
8 | /// the name of the country
9 | String? name;
10 |
11 | /// the flag of the country
12 | String? flagUri;
13 |
14 | /// the country code (IT,AF..)
15 | String? code;
16 |
17 | /// the dial code (+39,+93..)
18 | String? dialCode;
19 |
20 | CountryCode({this.name, this.flagUri, this.code, this.dialCode});
21 |
22 | @override
23 | String toString() => "$dialCode";
24 |
25 | String toLongString() => "$name ($code)";
26 |
27 | String toCountryCodeString() => "$code $dialCode";
28 |
29 | String toCountryStringOnly() => '$name';
30 | }
31 |
--------------------------------------------------------------------------------
/lib/utils/codePicker/selection_dialog.dart:
--------------------------------------------------------------------------------
1 | import 'package:cached_network_image/cached_network_image.dart';
2 | import 'package:flutter/material.dart';
3 | import 'package:nb_utils/nb_utils.dart';
4 | import 'package:quiz/utils/app_widget.dart';
5 |
6 | import '../../../main.dart';
7 | import 'country_code.dart';
8 |
9 | /// selection dialog used for selection of the country code
10 | class SelectionDialog extends StatefulWidget {
11 | final List elements;
12 | final bool? showCountryOnly;
13 | final InputDecoration searchDecoration;
14 | final TextStyle? searchStyle;
15 | final WidgetBuilder? emptySearchBuilder;
16 | final bool? showFlag;
17 |
18 | /// elements passed as favorite
19 | final List favoriteElements;
20 |
21 | SelectionDialog(this.elements, this.favoriteElements,
22 | {Key? key, this.showCountryOnly, this.emptySearchBuilder, InputDecoration searchDecoration = const InputDecoration(), this.searchStyle, this.showFlag})
23 | : searchDecoration = searchDecoration.copyWith(prefixIcon:const Icon(Icons.search)),
24 | super(key: key);
25 |
26 | @override
27 | State createState() => _SelectionDialogState();
28 | }
29 |
30 | class _SelectionDialogState extends State {
31 | /// this is useful for filtering purpose
32 | late List filteredElements;
33 |
34 | @override
35 | Widget build(BuildContext context) => CustomTheme(
36 | child: SimpleDialog(
37 | title: Column(
38 | crossAxisAlignment: CrossAxisAlignment.start,
39 | children: [
40 | text("Select Country Code", textColor: textPrimaryColor, fontSize: 16.0, fontFamily: "Semibold"),
41 | const SizedBox(height: 8),
42 | TextField(
43 | style: widget.searchStyle,
44 | decoration: InputDecoration(
45 | filled: true,
46 | hintText: "Search Country",
47 | hintStyle: secondaryTextStyle(),
48 | border: InputBorder.none,
49 | ),
50 | onChanged: _filterElements,
51 | )
52 | ],
53 | ),
54 | children: [
55 | Container(
56 | margin:const EdgeInsets.only(top: 16),
57 | width: MediaQuery.of(context).size.width,
58 | height: MediaQuery.of(context).size.height,
59 | child: ListView(
60 | children: [
61 | widget.favoriteElements.isEmpty
62 | ? const DecoratedBox(decoration: BoxDecoration())
63 | : Column(
64 | crossAxisAlignment: CrossAxisAlignment.start,
65 | children: [...widget.favoriteElements
66 | .map(
67 | (f) => SimpleDialogOption(
68 | child: _buildOption(f),
69 | onPressed: () {
70 | _selectItem(f);
71 | },
72 | ),
73 | )
74 | .toList(), const Divider()]
75 |
76 | ), ...filteredElements.isEmpty
77 | ? [_buildEmptySearchWidget(context)]
78 | : filteredElements.map((e) => SimpleDialogOption(
79 | key: Key(e.toLongString()),
80 | child: _buildOption(e),
81 | onPressed: () {
82 | _selectItem(e);
83 | },
84 | )),
85 | ])),
86 | ],
87 | ),
88 | );
89 |
90 | Widget _buildOption(CountryCode e) {
91 | return SizedBox(
92 | width: 400,
93 | child: Flex(
94 | direction: Axis.horizontal,
95 | children: [
96 | widget.showFlag!
97 | ? Flexible(
98 | child: Padding(
99 | padding: const EdgeInsets.only(right: 16.0),
100 | child: CachedNetworkImage(
101 | placeholder: placeholderWidgetFn() as Widget Function(BuildContext, String)?,
102 | imageUrl: e.flagUri!,
103 | width: 25.0,
104 | ),
105 | ),
106 | )
107 | : Container(),
108 | Expanded(
109 | flex: 4,
110 | child: Row(
111 | mainAxisAlignment: MainAxisAlignment.spaceBetween,
112 | children: [
113 | Expanded(child: text(e.toLongString(), fontSize: 14.0, textColor: textPrimaryColor)),
114 | text(e.dialCode, fontSize: 14.0, textColor: textPrimaryColor, fontFamily: "SemiBold"),
115 | ],
116 | ),
117 | ),
118 | ],
119 | ),
120 | );
121 | }
122 |
123 | Widget _buildEmptySearchWidget(BuildContext context) {
124 | if (widget.emptySearchBuilder != null) {
125 | return widget.emptySearchBuilder!(context);
126 | }
127 |
128 | return const Center(child: Text('No Country Found'));
129 | }
130 |
131 | @override
132 | void initState() {
133 | filteredElements = widget.elements;
134 | super.initState();
135 | }
136 |
137 | void _filterElements(String s) {
138 | s = s.toUpperCase();
139 | setState(() {
140 | filteredElements = widget.elements.where((e) => e.code!.contains(s) || e.dialCode!.contains(s) || e.name!.toUpperCase().contains(s)).toList();
141 | });
142 | }
143 |
144 | void _selectItem(CountryCode e) {
145 | Navigator.pop(context, e);
146 | }
147 | }
148 |
--------------------------------------------------------------------------------
/lib/utils/percent_indicator/percent_indicator.dart:
--------------------------------------------------------------------------------
1 | library percent_indicator;
2 |
3 | export 'circular_percent_indicator.dart';
4 | export 'linear_percent_indicator.dart';
5 |
--------------------------------------------------------------------------------
/lib/utils/quiz_card.dart:
--------------------------------------------------------------------------------
1 | class Quiz {
2 | late String option1;
3 |
4 | late String option2;
5 |
6 | late String option3;
7 |
8 | late String option4;
9 |
10 | late String cardImage;
11 | double? topMargin;
12 |
13 | Quiz( String imagePath, String o1, String o2, String o3, String o4, double marginTop) {
14 | option1 = o1;
15 | option2 = o2;
16 | option3 = o3;
17 | option4 = o4;
18 | cardImage = imagePath;
19 | topMargin = marginTop;
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/lib/utils/quiz_card_detail.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 |
3 | // ignore: must_be_immutable
4 | class QuizCardDetails extends StatefulWidget {
5 | int index;
6 | String imageAddress;
7 | String? placeDetails;
8 |
9 | QuizCardDetails(this.imageAddress, this.index, {super.key});
10 |
11 | @override
12 | State createState() => QuizCardDetailsState(imageAddress, index);
13 | }
14 |
15 | class QuizCardDetailsState extends State {
16 | int index;
17 | String imageAddress;
18 | late String placeDetails;
19 |
20 | QuizCardDetailsState(this.imageAddress, this.index);
21 |
22 | @override
23 | void initState() {
24 | super.initState();
25 | setState(() {
26 | getData(index);
27 | });
28 | }
29 |
30 | getData(value) {
31 | switch (value) {
32 | case 0:
33 | placeDetails =
34 | 'Mussoorie, located around an hour from Derahdun in Uttarakhand, is a popular weekend destination for north Indians, as well as honeymooners. One of the reasons for Mussoories popularity is that it has a lot of facilities developed especially for tourists. Take a cable car to Gun Hill, enjoy a beautiful nature walk along Camels Back Road, have a picnic at Kempty Falls, or ride a horse up to Lal Tibba (the highest peak in Mussoorie). Mussoorie also offers a superb view of the Himalayas.';
35 | break;
36 |
37 | case 1:
38 | placeDetails =
39 | "Manali, in Himachal Pradesh, is one of the top adventure travel destinations in India.Manali, with its soothing backdrop of the Himalayas, offers a blend of tranquility and adventure that makes it one of northern India's most popular destinations. Although it's a popular place to go off on treks, you can do as little or as much as you want there. Located in the Kullu Valley of Himachal Pradesh, it's bordered by cool pine forest and the raging Beas River, which give it a special energy.";
40 | break;
41 |
42 | case 2:
43 | placeDetails =
44 | "Sikkim's capital, Gangtok, sits along a cloudy mountain ridge about 5,500 feet above sea level. Sikkim only became part of India in 1975. Before that, it was a small independent Buddhist kingdom with its own monarchy after the end of British rule. Gangtok is a popular base for travel throughout the state, particularly with trekkers. It's a well-organized and clean city with strict littering, traffic and tobacco laws. Attractions include monasteries, viewpoints, a cable car, and a zoo that houses rare animals rescued from traders and poachers.";
45 | break;
46 |
47 | case 3:
48 | placeDetails =
49 | "Darjeeling is also famous for its lush tea gardens. In addition, it's blessed with a stunning view of Mount Kanchenjunga, the world's third highest peak. Some of Darjeeling's most popular attractions include historic toy train, monasteries, botanical gardens, a zoo, and the Darjeeling-Rangeet Valley Passenger Ropeway (the longest aerial tramway in Asia). Darjeeling is a great place to walk around and explore the tea estates, villages, and markets. ";
50 | break;
51 |
52 | case 4:
53 | placeDetails =
54 | "The hill station of Nainital, in the Kumaon region of Uttarakhand, was a popular summer retreat for the British during the time they ruled India. It features the serene, emerald-colored Naini Lake and an action-filled strip called The Mall, lined with restaurants, shops, hotels, and markets. Enjoy one of the many forest walks, explore the surrounding area on horseback, or relax on a boat in the lake.";
55 | break;
56 | }
57 | }
58 |
59 | @override
60 | Widget build(BuildContext context) {
61 | return Scaffold(
62 | body: ListView(
63 | children: [
64 | Stack(
65 | children: [
66 | const SizedBox(
67 | height: 800.0,
68 | width: double.infinity,
69 | ),
70 | Container(
71 | padding: const EdgeInsets.all(10.0),
72 | height: 500.0,
73 | width: double.infinity,
74 | decoration: BoxDecoration(
75 | borderRadius:const BorderRadius.only(
76 | bottomLeft: Radius.circular(20.0),
77 | bottomRight: Radius.circular(20.0),
78 | ),
79 | image: DecorationImage(
80 | image: NetworkImage(imageAddress),
81 | fit: BoxFit.fill,
82 | )),
83 | ),
84 | Positioned(
85 | top: 420.0,
86 | left: 10.0,
87 | right: 10.0,
88 | child: Material(
89 | elevation: 10.0,
90 | borderRadius: BorderRadius.circular(20.0),
91 | child: Container(
92 | height: 380.0,
93 | decoration:const BoxDecoration(
94 | //borderRadius: BorderRadius.circular(20.0)
95 | ),
96 | padding:const EdgeInsets.only(
97 | left: 20.0,
98 | right: 10.0,
99 | top: 20.0,
100 | ),
101 | child: Text(
102 | placeDetails,
103 | textAlign: TextAlign.left,
104 | style: const TextStyle(fontSize: 20.0, fontStyle: FontStyle.italic),
105 | ),
106 | ),
107 | ),
108 | )
109 | ],
110 | ),
111 | ],
112 | ),
113 | );
114 | }
115 |
116 | }
117 |
--------------------------------------------------------------------------------
/lib/utils/quiz_colors.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 |
3 | const t8colorPrimary = Color(0xFF5362FB);
4 | const t8colorPrimaryDark = Color(0xFF3D50FC);
5 | const t8colorAccent = Color(0xFF22D8CD);
6 |
7 | const t8colorred = Color(0xFFF12727);
8 | const t8textColorPrimary = Color(0xFF333333);
9 | const t8textColorSecondary = Color(0xFF918F8F);
10 |
11 | const t8appbackground = Color(0xFFf3f5f9);
12 | const t8viewcolor = Color(0xFFDADADA);
13 |
14 | const t8white = Color(0xFFffffff);
15 |
16 | const t8iconcolor = Color(0xFF747474);
17 | const t8colorgreen = Color(0xFF8BC34A);
18 | const t8editbackground = Color(0xFFF5F4F4);
19 | const t8lightgray = Color(0xFFCECACA);
20 | const t8colorsdots = Color(0xFF009688);
21 |
22 | const t8green = Color(0xFF00FF00);
23 | const t8red = Color(0xFFFF0000);
24 | const t8colorsetting = Color(0xFFACB5FD);
25 | const t8colormessage = Color(0xFF5362FB);
26 | const t8colormail = Color(0xFF62D3AB);
27 | const t8colorfacebook = Color(0xFF4872FB);
28 | const t8colortwitter = Color(0xFF2CB6F8);
29 | const t8colortransparent = Color(0xFF00FFFFFF);
30 | const t8ShadowColor = Color(0X95E9EBF0);
31 | const t8formgoogle = Color(0xFFF13B19);
32 |
33 | const quizcolorPrimary = Color(0xFF5362FB);
34 | const quizcolorPrimaryDark = Color(0xFF3D50FC);
35 | const quizcolorAccent = Color(0xFF22D8CD);
36 |
37 | const quizcolorred = Color(0xFFF12727);
38 | const quiztextColorPrimary = Color(0xFF333333);
39 | const quiztextColorSecondary = Color(0xFF918F8F);
40 |
41 | const quizappbackground = Color(0xFFf3f5f9);
42 | const quizviewcolor = Color(0xFFDADADA);
43 |
44 | const quizwhite = Color(0xFFffffff);
45 |
46 | const quiziconcolor = Color(0xFF747474);
47 | const quizcolorgreen = Color(0xFF8BC34A);
48 | const quizeditbackground = Color(0xFFF5F4F4);
49 | const quizlightgray = Color(0xFFCECACA);
50 | const quizcolorsdots = Color(0xFF009688);
51 |
52 | const quizgreen = Color(0xFF00FF00);
53 | const quizred = Color(0xFFFF0000);
54 | const quizcolorsetting = Color(0xFFACB5FD);
55 | const quizcolormessage = Color(0xFF5362FB);
56 | const quizcolormail = Color(0xFF62D3AB);
57 | const quizcolorfacebook = Color(0xFF4872FB);
58 | const quizcolortwitter = Color(0xFF2CB6F8);
59 | const quizcolortransparent = Color(0xFF00FFFFFF);
60 | const quizShadowColor = Color(0X95E9EBF0);
61 | const quizformgoogle = Color(0xFFF13B19);
62 |
--------------------------------------------------------------------------------
/lib/utils/quiz_constant.dart:
--------------------------------------------------------------------------------
1 | /*fonts*/
2 | const fontRegular = 'Regular';
3 | const fontMedium = 'Medium';
4 | const fontSemibold = 'Semibold';
5 | const fontBold = 'Bold';
6 | /* font sizes*/
7 | const textSizeSmall = 12.0;
8 | const textSizeSMedium = 14.0;
9 | const textSizeMedium = 16.0;
10 | const textSizeLargeMedium = 18.0;
11 | const textSizeNormal = 20.0;
12 | const textSizeLarge = 24.0;
13 | const textSizeXLarge = 28.0;
14 | const textSizeXXLarge = 30.0;
15 |
16 | const spacingmiddle = 10.0;
17 | const spacingstandardnew = 16.0;
18 |
19 | const baseUrl = 'https://github.com/muhammad-fiaz/QuizApp-Flutter';
20 |
--------------------------------------------------------------------------------
/lib/utils/quiz_data_generator.dart:
--------------------------------------------------------------------------------
1 | import 'package:quiz/model/quiz_models.dart';
2 | import 'package:quiz/utils/quiz_images.dart';
3 |
4 | List getQuizData() {
5 | List list = [];
6 | NewQuizModel model1 = NewQuizModel();
7 | model1.quizName = "Biology & The \nScientific Method";
8 | model1.totalQuiz = "15 Quiz";
9 | model1.quizImage = quizicstudy1;
10 |
11 | NewQuizModel model2 = NewQuizModel();
12 | model2.quizName = "Geography Basics \nMethods";
13 | model2.totalQuiz = "5 Quiz";
14 | model2.quizImage = quizicstudy2;
15 |
16 | NewQuizModel model3 = NewQuizModel();
17 | model3.quizName = "Java Basics \nOOPs Concept";
18 | model3.totalQuiz = "10 Quiz";
19 | model3.quizImage = quiziccourse3;
20 |
21 | NewQuizModel model4 = NewQuizModel();
22 | model4.quizName = "Art and \nPainting Basic";
23 | model4.totalQuiz = "10 Quiz";
24 | model4.quizImage = quiziccourse1;
25 |
26 | NewQuizModel model5 = NewQuizModel();
27 | model5.quizName = "Communication Basic";
28 | model5.totalQuiz = "10 Quiz";
29 | model5.quizImage = quiziccommunication;
30 |
31 | NewQuizModel model6 = NewQuizModel();
32 | model6.quizName = "Investment and \nTypes";
33 | model6.totalQuiz = "10 Quiz";
34 | model6.quizImage = quiziccourse2;
35 |
36 | list.add(model1);
37 | list.add(model3);
38 | list.add(model6);
39 | list.add(model4);
40 | list.add(model5);
41 | list.add(model2);
42 |
43 | return list;
44 | }
45 |
46 | List quizGetData() {
47 | List list = [];
48 | QuizTestModel model1 = QuizTestModel();
49 | model1.heading = "The Scientific Method";
50 | model1.image = quizicquiz1;
51 | model1.type = "Quiz 1";
52 | model1.description = "Let's put your memory on our first topic to test.";
53 | model1.status = "true";
54 |
55 | QuizTestModel model2 = QuizTestModel();
56 | model2.heading = "Introduction to Biology";
57 | model2.image = quizicquiz2;
58 | model2.type = "Flashcards";
59 | model2.description = "Complete the above test to unlock this one.";
60 | model2.status = "false";
61 |
62 | QuizTestModel model3 = QuizTestModel();
63 | model3.heading = "Controlled Experiments";
64 | model3.image = quizicquiz1;
65 | model3.type = "Quiz 2";
66 | model3.description = "Let's put your memory on our first topic to test.";
67 | model3.status = "false";
68 |
69 | list.add(model1);
70 | list.add(model2);
71 | list.add(model3);
72 |
73 | return list;
74 | }
75 |
76 | List quizBadgesData() {
77 | List list = [];
78 | QuizBadgesModel model1 = QuizBadgesModel();
79 | model1.title = "Achiever";
80 | model1.subtitle = "Complete an exercise";
81 | model1.img = quiziclist2;
82 |
83 | QuizBadgesModel model2 = QuizBadgesModel();
84 | model2.title = "Perectionistf";
85 | model2.subtitle = "Finish All lesson of chapter";
86 | model2.img = quiziclist5;
87 |
88 | QuizBadgesModel model3 = QuizBadgesModel();
89 | model3.title = "Scholar";
90 | model3.subtitle = "Study two Cources";
91 | model3.img = quiziclist3;
92 |
93 | QuizBadgesModel model4 = QuizBadgesModel();
94 | model4.title = "Champion";
95 | model4.subtitle = "Finish #1 in Scoreboard";
96 | model4.img = quiziclist4;
97 |
98 | QuizBadgesModel model5 = QuizBadgesModel();
99 | model5.title = "Focused";
100 | model5.subtitle = "Study every day for 30 days";
101 | model5.img = quiziclist5;
102 |
103 | list.add(model1);
104 | list.add(model2);
105 | list.add(model3);
106 | list.add(model4);
107 | list.add(model5);
108 |
109 | return list;
110 | }
111 |
112 | List quizScoresData() {
113 | List list = [];
114 | QuizScoresModel model1 = QuizScoresModel();
115 | model1.title = "Biology Basics";
116 | model1.totalQuiz = "20 Quiz";
117 | model1.img = quiziccourse1;
118 | model1.scores = "30/50";
119 |
120 | QuizScoresModel model2 = QuizScoresModel();
121 | model2.title = "Java Basics";
122 | model2.totalQuiz = "30 Quiz";
123 | model2.img = quiziccourse2;
124 | model2.scores = "30/50";
125 |
126 | QuizScoresModel model3 = QuizScoresModel();
127 | model3.title = "Art & Painting Basics";
128 | model3.totalQuiz = "10 Quiz";
129 | model3.img = quiziccourse3;
130 | model3.scores = "10/50";
131 |
132 | list.add(model1);
133 | list.add(model2);
134 | list.add(model3);
135 |
136 | return list;
137 | }
138 |
139 | List quizContactUsData() {
140 | List list = [];
141 | QuizContactUsModel model1 = QuizContactUsModel();
142 | model1.title = "Call Request";
143 | model1.subtitle = "+00 356 646 234";
144 |
145 | QuizContactUsModel model2 = QuizContactUsModel();
146 | model2.title = "Email";
147 | model2.subtitle = "Response within 24 business hours";
148 |
149 | list.add(model1);
150 | list.add(model2);
151 |
152 | return list;
153 | }
154 |
--------------------------------------------------------------------------------
/lib/utils/quiz_images.dart:
--------------------------------------------------------------------------------
1 | const url="https://github.com/muhammad-fiaz/QuizApp-Flutter/assets/75434191/06e28a7a-6239-4a3f-af88-4a49b272ce9e";
2 |
3 | const quiziccommunication = url;
4 | const quiziccommunication2 = url;
5 | const quiziccourse1 = url;
6 | const quiziccourse2 = url;
7 | const quiziccourse3 = url;
8 | const quizicinfo = url;
9 | const quizicjava = url;
10 | const quizicmarketing = url;
11 | const quizicnotification = url;
12 | const quizicstudy1 = url;
13 | const quizicstudy2 = url;
14 | const quizicquiz1 = "images/quiz/quiz_ic_quiz1.png";
15 | const quizicquiz2 = "images/quiz/quiz_ic_quiz2.png";
16 | const quizicquiz = "images/quiz/quiz_ic_quiz.svg";
17 | const quizichomes = "images/quiz/quiz_ic_home.svg";
18 | const quizicuser = "images/quiz/quiz_ic_user.svg";
19 | const quizicfacebook = "images/quiz/quiz_ic_facebook.svg";
20 | const quizicgoogle = "images/quiz/quiz_ic_google.svg";
21 | const quizicmail = "images/quiz/quiz_ic_mail.svg";
22 | const quizictwitter = "images/quiz/quiz_ic_twitter.svg";
23 |
24 | const quizicGrid = "images/quiz/quiz_ic_grid.png";
25 | const quizicList = "images/quiz/quiz_ic_list.png";
26 | const quizimgPeople1 = url;
27 | const quizimgPeople2 = url;
28 |
29 | const quiziclist1 = "images/quiz/quiz_ic_list1.png";
30 | const quiziclist2 = "images/quiz/quiz_ic_list2.png";
31 | const quiziclist3 = "images/quiz/quiz_ic_list3.png";
32 | const quiziclist4 = "images/quiz/quiz_ic_list4.png";
33 | const quiziclist5 = "images/quiz/quiz_ic_list5.png";
34 |
--------------------------------------------------------------------------------
/lib/utils/quiz_strings.dart:
--------------------------------------------------------------------------------
1 | const quizlblcontinue = "CONTINUE";
2 | const quizhintyourpassword = "Your Password";
3 | const quizhintyouremail = "Your Email";
4 | const quizinfologin = "Enter your login details to \n access your account";
5 | const quizinfosignup = "Start by entering your email \n address below.";
6 | const quizlblforgot = "Forgot";
7 | const quizlblshow = "Show";
8 | const quizlblallow = "Allow";
9 | const quiztitlelogin = "Log In";
10 | const quizlbldonthaveanaccount = "Don't have an account?";
11 | const quizlblcreateaccount = "CREATE ACCOUNT";
12 | const quiztitleCreateaccount = "Create Account";
13 | const quizinfocreatepassword = "Your password must have at \n least one symbol & 8 or \n more characters.";
14 | const quizlblalreadyhaveanaccount = "Already have an account?";
15 | const quizlblsignin = "Sign In";
16 | const quizlblskip = "SKIP";
17 | const quizlblletstarted = "Let's Get Started";
18 | const quizinfoletstarted = "Enter your mobile number to \n enable 2- step verification ";
19 | const quizhintMobileNumber = "Mobile Number";
20 | const quizlblCreatepassword = "Create Password";
21 | const quiztitleVerification = "Verification";
22 | const quizlbldidnotreceivecode = "I didn't recevice a code";
23 | const quizlblResend = "Resend";
24 | const quizinfoVerification = "we texted you a code to verify \n your phone number";
25 | const quizlblnotifications = "Notifications";
26 | const quizinfonotification = "Stay notified about new course \n updates, scoreboard states and \n new friend follows.";
27 | const quizlblnewquiz = "New Quiz";
28 | const quizlblviewall = "View all";
29 | const quizlblsearch = "Search";
30 | const quizlblwhatwouldyouliketolearnntodaysearchbelow = "What would you like to learn \n today? Search below.";
31 | const quizlblhiantonio = "Hi, User!";
32 | const quiztitlenewaccount = "New Account";
33 | const quiztitlebottomnavigation = "Bottom Navigation";
34 |
35 | const quizlblbiologybasics = "Biology basics";
36 | const quizlblbiologyampscientificmethod = "Biology & The \n Scientific Method";
37 | const quiztext4to8lesson = "4 to 8 lesson";
38 | const quizlblbegin = "Begin";
39 |
40 | const quizlblsetting = "Settings";
41 | const quizlbleditprofile = "Edit Profile";
42 | const quizusername = "User Name";
43 | const quizlblemail = "Email";
44 | const quizemail = "example@gmail.com";
45 | const quizlblpassword = "Password";
46 | const quizsubinfopassword = "updated 2 week ago";
47 | const quizlblscoreboard = "Scoreboard";
48 | const quizlblnewcourse = "New Courses";
49 | const quizlblstudyreminder = "Study Reminder";
50 | const quizlblhelp = "Help Center";
51 | const quizlblprivacy = "Privacy & Terms";
52 | const quizlblcontactus = "Contact Us";
53 | const quizlbllogout = "Log out";
54 |
55 | const quizlbl = "User Name";
56 | const quizlblXp = "1,53,675 XP";
57 |
58 | const quizlblEditProfile = "Edit Profile";
59 | const quizhintFirstname = "Your First Name";
60 | const quizhintLastname = "Your Last Name";
61 | const quizhintMobileno = "Your Mobile Number";
62 | const quizSaveProfile = "SAVE PROFILE";
63 | const quizlblUpdateemail = "Update Email";
64 | const quizinfoUpdateemail = "Enter your new email \n address below";
65 | const quizlblemailVerify = "we will send an email to verify \n your email address";
66 | const quizlblsave = "SAVE";
67 | const quizlblChangepassword = "Change Password";
68 | const quizhintOldPassword = "Old Password";
69 | const quizhintnewPassword = "New Password";
70 | const quizhintconfirmpassword = "Confirm Password";
71 | const quizlblHelpCenter = "Help Center";
72 | const quizhintDescription = "Description";
73 | const quizlblContactus = "Contact Us";
74 | const quizlblBadges = "BADGES";
75 | const quizlblScores = "SCORES";
76 | const quizlblAll = "ALL";
77 | const quizlblCompleted = "COMPLETED";
78 | const quizlblSubmit = "SUBMIT";
79 | const quizSuccessfullySaveProfile = "Successfully Save Profile";
80 | const quizSuccessfullyEmailUpdated = "Successfully Email Updated";
81 | const quizPasswordUpdated = "Password Updated";
82 | const quizThankyouSuccessfullyAdded = "Thank you Successfully Added";
83 | const quizSubmitted = "Submitted";
84 |
--------------------------------------------------------------------------------
/linux/.gitignore:
--------------------------------------------------------------------------------
1 | flutter/ephemeral
2 |
--------------------------------------------------------------------------------
/linux/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | # Project-level configuration.
2 | cmake_minimum_required(VERSION 3.10)
3 | project(runner LANGUAGES CXX)
4 |
5 | # The name of the executable created for the application. Change this to change
6 | # the on-disk name of your application.
7 | set(BINARY_NAME "quiz")
8 | # The unique GTK application identifier for this application. See:
9 | # https://wiki.gnome.org/HowDoI/ChooseApplicationID
10 | set(APPLICATION_ID "dev.muhammadfiaz.quiz.quiz")
11 |
12 | # Explicitly opt in to modern CMake behaviors to avoid warnings with recent
13 | # versions of CMake.
14 | cmake_policy(SET CMP0063 NEW)
15 |
16 | # Load bundled libraries from the lib/ directory relative to the binary.
17 | set(CMAKE_INSTALL_RPATH "$ORIGIN/lib")
18 |
19 | # Root filesystem for cross-building.
20 | if(FLUTTER_TARGET_PLATFORM_SYSROOT)
21 | set(CMAKE_SYSROOT ${FLUTTER_TARGET_PLATFORM_SYSROOT})
22 | set(CMAKE_FIND_ROOT_PATH ${CMAKE_SYSROOT})
23 | set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
24 | set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY)
25 | set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
26 | set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
27 | endif()
28 |
29 | # Define build configuration options.
30 | if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
31 | set(CMAKE_BUILD_TYPE "Debug" CACHE
32 | STRING "Flutter build mode" FORCE)
33 | set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS
34 | "Debug" "Profile" "Release")
35 | endif()
36 |
37 | # Compilation settings that should be applied to most targets.
38 | #
39 | # Be cautious about adding new options here, as plugins use this function by
40 | # default. In most cases, you should add new options to specific targets instead
41 | # of modifying this function.
42 | function(APPLY_STANDARD_SETTINGS TARGET)
43 | target_compile_features(${TARGET} PUBLIC cxx_std_14)
44 | target_compile_options(${TARGET} PRIVATE -Wall -Werror)
45 | target_compile_options(${TARGET} PRIVATE "$<$>:-O3>")
46 | target_compile_definitions(${TARGET} PRIVATE "$<$>:NDEBUG>")
47 | endfunction()
48 |
49 | # Flutter library and tool build rules.
50 | set(FLUTTER_MANAGED_DIR "${CMAKE_CURRENT_SOURCE_DIR}/flutter")
51 | add_subdirectory(${FLUTTER_MANAGED_DIR})
52 |
53 | # System-level dependencies.
54 | find_package(PkgConfig REQUIRED)
55 | pkg_check_modules(GTK REQUIRED IMPORTED_TARGET gtk+-3.0)
56 |
57 | add_definitions(-DAPPLICATION_ID="${APPLICATION_ID}")
58 |
59 | # Define the application target. To change its name, change BINARY_NAME above,
60 | # not the value here, or `flutter run` will no longer work.
61 | #
62 | # Any new source files that you add to the application should be added here.
63 | add_executable(${BINARY_NAME}
64 | "main.cc"
65 | "my_application.cc"
66 | "${FLUTTER_MANAGED_DIR}/generated_plugin_registrant.cc"
67 | )
68 |
69 | # Apply the standard set of build settings. This can be removed for applications
70 | # that need different build settings.
71 | apply_standard_settings(${BINARY_NAME})
72 |
73 | # Add dependency libraries. Add any application-specific dependencies here.
74 | target_link_libraries(${BINARY_NAME} PRIVATE flutter)
75 | target_link_libraries(${BINARY_NAME} PRIVATE PkgConfig::GTK)
76 |
77 | # Run the Flutter tool portions of the build. This must not be removed.
78 | add_dependencies(${BINARY_NAME} flutter_assemble)
79 |
80 | # Only the install-generated bundle's copy of the executable will launch
81 | # correctly, since the resources must in the right relative locations. To avoid
82 | # people trying to run the unbundled copy, put it in a subdirectory instead of
83 | # the default top-level location.
84 | set_target_properties(${BINARY_NAME}
85 | PROPERTIES
86 | RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/intermediates_do_not_run"
87 | )
88 |
89 |
90 | # Generated plugin build rules, which manage building the plugins and adding
91 | # them to the application.
92 | include(flutter/generated_plugins.cmake)
93 |
94 |
95 | # === Installation ===
96 | # By default, "installing" just makes a relocatable bundle in the build
97 | # directory.
98 | set(BUILD_BUNDLE_DIR "${PROJECT_BINARY_DIR}/bundle")
99 | if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
100 | set(CMAKE_INSTALL_PREFIX "${BUILD_BUNDLE_DIR}" CACHE PATH "..." FORCE)
101 | endif()
102 |
103 | # Start with a clean build bundle directory every time.
104 | install(CODE "
105 | file(REMOVE_RECURSE \"${BUILD_BUNDLE_DIR}/\")
106 | " COMPONENT Runtime)
107 |
108 | set(INSTALL_BUNDLE_DATA_DIR "${CMAKE_INSTALL_PREFIX}/data")
109 | set(INSTALL_BUNDLE_LIB_DIR "${CMAKE_INSTALL_PREFIX}/lib")
110 |
111 | install(TARGETS ${BINARY_NAME} RUNTIME DESTINATION "${CMAKE_INSTALL_PREFIX}"
112 | COMPONENT Runtime)
113 |
114 | install(FILES "${FLUTTER_ICU_DATA_FILE}" DESTINATION "${INSTALL_BUNDLE_DATA_DIR}"
115 | COMPONENT Runtime)
116 |
117 | install(FILES "${FLUTTER_LIBRARY}" DESTINATION "${INSTALL_BUNDLE_LIB_DIR}"
118 | COMPONENT Runtime)
119 |
120 | foreach(bundled_library ${PLUGIN_BUNDLED_LIBRARIES})
121 | install(FILES "${bundled_library}"
122 | DESTINATION "${INSTALL_BUNDLE_LIB_DIR}"
123 | COMPONENT Runtime)
124 | endforeach(bundled_library)
125 |
126 | # Copy the native assets provided by the build.dart from all packages.
127 | set(NATIVE_ASSETS_DIR "${PROJECT_BUILD_DIR}native_assets/linux/")
128 | install(DIRECTORY "${NATIVE_ASSETS_DIR}"
129 | DESTINATION "${INSTALL_BUNDLE_LIB_DIR}"
130 | COMPONENT Runtime)
131 |
132 | # Fully re-copy the assets directory on each build to avoid having stale files
133 | # from a previous install.
134 | set(FLUTTER_ASSET_DIR_NAME "flutter_assets")
135 | install(CODE "
136 | file(REMOVE_RECURSE \"${INSTALL_BUNDLE_DATA_DIR}/${FLUTTER_ASSET_DIR_NAME}\")
137 | " COMPONENT Runtime)
138 | install(DIRECTORY "${PROJECT_BUILD_DIR}/${FLUTTER_ASSET_DIR_NAME}"
139 | DESTINATION "${INSTALL_BUNDLE_DATA_DIR}" COMPONENT Runtime)
140 |
141 | # Install the AOT library on non-Debug builds only.
142 | if(NOT CMAKE_BUILD_TYPE MATCHES "Debug")
143 | install(FILES "${AOT_LIBRARY}" DESTINATION "${INSTALL_BUNDLE_LIB_DIR}"
144 | COMPONENT Runtime)
145 | endif()
146 |
--------------------------------------------------------------------------------
/linux/flutter/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | # This file controls Flutter-level build steps. It should not be edited.
2 | cmake_minimum_required(VERSION 3.10)
3 |
4 | set(EPHEMERAL_DIR "${CMAKE_CURRENT_SOURCE_DIR}/ephemeral")
5 |
6 | # Configuration provided via flutter tool.
7 | include(${EPHEMERAL_DIR}/generated_config.cmake)
8 |
9 | # TODO: Move the rest of this into files in ephemeral. See
10 | # https://github.com/flutter/flutter/issues/57146.
11 |
12 | # Serves the same purpose as list(TRANSFORM ... PREPEND ...),
13 | # which isn't available in 3.10.
14 | function(list_prepend LIST_NAME PREFIX)
15 | set(NEW_LIST "")
16 | foreach(element ${${LIST_NAME}})
17 | list(APPEND NEW_LIST "${PREFIX}${element}")
18 | endforeach(element)
19 | set(${LIST_NAME} "${NEW_LIST}" PARENT_SCOPE)
20 | endfunction()
21 |
22 | # === Flutter Library ===
23 | # System-level dependencies.
24 | find_package(PkgConfig REQUIRED)
25 | pkg_check_modules(GTK REQUIRED IMPORTED_TARGET gtk+-3.0)
26 | pkg_check_modules(GLIB REQUIRED IMPORTED_TARGET glib-2.0)
27 | pkg_check_modules(GIO REQUIRED IMPORTED_TARGET gio-2.0)
28 |
29 | set(FLUTTER_LIBRARY "${EPHEMERAL_DIR}/libflutter_linux_gtk.so")
30 |
31 | # Published to parent scope for install step.
32 | set(FLUTTER_LIBRARY ${FLUTTER_LIBRARY} PARENT_SCOPE)
33 | set(FLUTTER_ICU_DATA_FILE "${EPHEMERAL_DIR}/icudtl.dat" PARENT_SCOPE)
34 | set(PROJECT_BUILD_DIR "${PROJECT_DIR}/build/" PARENT_SCOPE)
35 | set(AOT_LIBRARY "${PROJECT_DIR}/build/lib/libapp.so" PARENT_SCOPE)
36 |
37 | list(APPEND FLUTTER_LIBRARY_HEADERS
38 | "fl_basic_message_channel.h"
39 | "fl_binary_codec.h"
40 | "fl_binary_messenger.h"
41 | "fl_dart_project.h"
42 | "fl_engine.h"
43 | "fl_json_message_codec.h"
44 | "fl_json_method_codec.h"
45 | "fl_message_codec.h"
46 | "fl_method_call.h"
47 | "fl_method_channel.h"
48 | "fl_method_codec.h"
49 | "fl_method_response.h"
50 | "fl_plugin_registrar.h"
51 | "fl_plugin_registry.h"
52 | "fl_standard_message_codec.h"
53 | "fl_standard_method_codec.h"
54 | "fl_string_codec.h"
55 | "fl_value.h"
56 | "fl_view.h"
57 | "flutter_linux.h"
58 | )
59 | list_prepend(FLUTTER_LIBRARY_HEADERS "${EPHEMERAL_DIR}/flutter_linux/")
60 | add_library(flutter INTERFACE)
61 | target_include_directories(flutter INTERFACE
62 | "${EPHEMERAL_DIR}"
63 | )
64 | target_link_libraries(flutter INTERFACE "${FLUTTER_LIBRARY}")
65 | target_link_libraries(flutter INTERFACE
66 | PkgConfig::GTK
67 | PkgConfig::GLIB
68 | PkgConfig::GIO
69 | )
70 | add_dependencies(flutter flutter_assemble)
71 |
72 | # === Flutter tool backend ===
73 | # _phony_ is a non-existent file to force this command to run every time,
74 | # since currently there's no way to get a full input/output list from the
75 | # flutter tool.
76 | add_custom_command(
77 | OUTPUT ${FLUTTER_LIBRARY} ${FLUTTER_LIBRARY_HEADERS}
78 | ${CMAKE_CURRENT_BINARY_DIR}/_phony_
79 | COMMAND ${CMAKE_COMMAND} -E env
80 | ${FLUTTER_TOOL_ENVIRONMENT}
81 | "${FLUTTER_ROOT}/packages/flutter_tools/bin/tool_backend.sh"
82 | ${FLUTTER_TARGET_PLATFORM} ${CMAKE_BUILD_TYPE}
83 | VERBATIM
84 | )
85 | add_custom_target(flutter_assemble DEPENDS
86 | "${FLUTTER_LIBRARY}"
87 | ${FLUTTER_LIBRARY_HEADERS}
88 | )
89 |
--------------------------------------------------------------------------------
/linux/flutter/generated_plugin_registrant.cc:
--------------------------------------------------------------------------------
1 | //
2 | // Generated file. Do not edit.
3 | //
4 |
5 | // clang-format off
6 |
7 | #include "generated_plugin_registrant.h"
8 |
9 | #include
10 | #include
11 |
12 | void fl_register_plugins(FlPluginRegistry* registry) {
13 | g_autoptr(FlPluginRegistrar) nb_utils_registrar =
14 | fl_plugin_registry_get_registrar_for_plugin(registry, "nb_utils_plugin");
15 | nb_utils_plugin_register_with_registrar(nb_utils_registrar);
16 | g_autoptr(FlPluginRegistrar) url_launcher_linux_registrar =
17 | fl_plugin_registry_get_registrar_for_plugin(registry, "UrlLauncherPlugin");
18 | url_launcher_plugin_register_with_registrar(url_launcher_linux_registrar);
19 | }
20 |
--------------------------------------------------------------------------------
/linux/flutter/generated_plugin_registrant.h:
--------------------------------------------------------------------------------
1 | //
2 | // Generated file. Do not edit.
3 | //
4 |
5 | // clang-format off
6 |
7 | #ifndef GENERATED_PLUGIN_REGISTRANT_
8 | #define GENERATED_PLUGIN_REGISTRANT_
9 |
10 | #include
11 |
12 | // Registers Flutter plugins.
13 | void fl_register_plugins(FlPluginRegistry* registry);
14 |
15 | #endif // GENERATED_PLUGIN_REGISTRANT_
16 |
--------------------------------------------------------------------------------
/linux/flutter/generated_plugins.cmake:
--------------------------------------------------------------------------------
1 | #
2 | # Generated file, do not edit.
3 | #
4 |
5 | list(APPEND FLUTTER_PLUGIN_LIST
6 | nb_utils
7 | url_launcher_linux
8 | )
9 |
10 | list(APPEND FLUTTER_FFI_PLUGIN_LIST
11 | )
12 |
13 | set(PLUGIN_BUNDLED_LIBRARIES)
14 |
15 | foreach(plugin ${FLUTTER_PLUGIN_LIST})
16 | add_subdirectory(flutter/ephemeral/.plugin_symlinks/${plugin}/linux plugins/${plugin})
17 | target_link_libraries(${BINARY_NAME} PRIVATE ${plugin}_plugin)
18 | list(APPEND PLUGIN_BUNDLED_LIBRARIES $)
19 | list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${plugin}_bundled_libraries})
20 | endforeach(plugin)
21 |
22 | foreach(ffi_plugin ${FLUTTER_FFI_PLUGIN_LIST})
23 | add_subdirectory(flutter/ephemeral/.plugin_symlinks/${ffi_plugin}/linux plugins/${ffi_plugin})
24 | list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${ffi_plugin}_bundled_libraries})
25 | endforeach(ffi_plugin)
26 |
--------------------------------------------------------------------------------
/linux/main.cc:
--------------------------------------------------------------------------------
1 | #include "my_application.h"
2 |
3 | int main(int argc, char** argv) {
4 | g_autoptr(MyApplication) app = my_application_new();
5 | return g_application_run(G_APPLICATION(app), argc, argv);
6 | }
7 |
--------------------------------------------------------------------------------
/linux/my_application.cc:
--------------------------------------------------------------------------------
1 | #include "my_application.h"
2 |
3 | #include
4 | #ifdef GDK_WINDOWING_X11
5 | #include
6 | #endif
7 |
8 | #include "flutter/generated_plugin_registrant.h"
9 |
10 | struct _MyApplication {
11 | GtkApplication parent_instance;
12 | char** dart_entrypoint_arguments;
13 | };
14 |
15 | G_DEFINE_TYPE(MyApplication, my_application, GTK_TYPE_APPLICATION)
16 |
17 | // Implements GApplication::activate.
18 | static void my_application_activate(GApplication* application) {
19 | MyApplication* self = MY_APPLICATION(application);
20 | GtkWindow* window =
21 | GTK_WINDOW(gtk_application_window_new(GTK_APPLICATION(application)));
22 |
23 | // Use a header bar when running in GNOME as this is the common style used
24 | // by applications and is the setup most users will be using (e.g. Ubuntu
25 | // desktop).
26 | // If running on X and not using GNOME then just use a traditional title bar
27 | // in case the window manager does more exotic layout, e.g. tiling.
28 | // If running on Wayland assume the header bar will work (may need changing
29 | // if future cases occur).
30 | gboolean use_header_bar = TRUE;
31 | #ifdef GDK_WINDOWING_X11
32 | GdkScreen* screen = gtk_window_get_screen(window);
33 | if (GDK_IS_X11_SCREEN(screen)) {
34 | const gchar* wm_name = gdk_x11_screen_get_window_manager_name(screen);
35 | if (g_strcmp0(wm_name, "GNOME Shell") != 0) {
36 | use_header_bar = FALSE;
37 | }
38 | }
39 | #endif
40 | if (use_header_bar) {
41 | GtkHeaderBar* header_bar = GTK_HEADER_BAR(gtk_header_bar_new());
42 | gtk_widget_show(GTK_WIDGET(header_bar));
43 | gtk_header_bar_set_title(header_bar, "quiz");
44 | gtk_header_bar_set_show_close_button(header_bar, TRUE);
45 | gtk_window_set_titlebar(window, GTK_WIDGET(header_bar));
46 | } else {
47 | gtk_window_set_title(window, "quiz");
48 | }
49 |
50 | gtk_window_set_default_size(window, 1280, 720);
51 | gtk_widget_show(GTK_WIDGET(window));
52 |
53 | g_autoptr(FlDartProject) project = fl_dart_project_new();
54 | fl_dart_project_set_dart_entrypoint_arguments(project, self->dart_entrypoint_arguments);
55 |
56 | FlView* view = fl_view_new(project);
57 | gtk_widget_show(GTK_WIDGET(view));
58 | gtk_container_add(GTK_CONTAINER(window), GTK_WIDGET(view));
59 |
60 | fl_register_plugins(FL_PLUGIN_REGISTRY(view));
61 |
62 | gtk_widget_grab_focus(GTK_WIDGET(view));
63 | }
64 |
65 | // Implements GApplication::local_command_line.
66 | static gboolean my_application_local_command_line(GApplication* application, gchar*** arguments, int* exit_status) {
67 | MyApplication* self = MY_APPLICATION(application);
68 | // Strip out the first argument as it is the binary name.
69 | self->dart_entrypoint_arguments = g_strdupv(*arguments + 1);
70 |
71 | g_autoptr(GError) error = nullptr;
72 | if (!g_application_register(application, nullptr, &error)) {
73 | g_warning("Failed to register: %s", error->message);
74 | *exit_status = 1;
75 | return TRUE;
76 | }
77 |
78 | g_application_activate(application);
79 | *exit_status = 0;
80 |
81 | return TRUE;
82 | }
83 |
84 | // Implements GObject::dispose.
85 | static void my_application_dispose(GObject* object) {
86 | MyApplication* self = MY_APPLICATION(object);
87 | g_clear_pointer(&self->dart_entrypoint_arguments, g_strfreev);
88 | G_OBJECT_CLASS(my_application_parent_class)->dispose(object);
89 | }
90 |
91 | static void my_application_class_init(MyApplicationClass* klass) {
92 | G_APPLICATION_CLASS(klass)->activate = my_application_activate;
93 | G_APPLICATION_CLASS(klass)->local_command_line = my_application_local_command_line;
94 | G_OBJECT_CLASS(klass)->dispose = my_application_dispose;
95 | }
96 |
97 | static void my_application_init(MyApplication* self) {}
98 |
99 | MyApplication* my_application_new() {
100 | return MY_APPLICATION(g_object_new(my_application_get_type(),
101 | "application-id", APPLICATION_ID,
102 | "flags", G_APPLICATION_NON_UNIQUE,
103 | nullptr));
104 | }
105 |
--------------------------------------------------------------------------------
/linux/my_application.h:
--------------------------------------------------------------------------------
1 | #ifndef FLUTTER_MY_APPLICATION_H_
2 | #define FLUTTER_MY_APPLICATION_H_
3 |
4 | #include
5 |
6 | G_DECLARE_FINAL_TYPE(MyApplication, my_application, MY, APPLICATION,
7 | GtkApplication)
8 |
9 | /**
10 | * my_application_new:
11 | *
12 | * Creates a new Flutter-based application.
13 | *
14 | * Returns: a new #MyApplication.
15 | */
16 | MyApplication* my_application_new();
17 |
18 | #endif // FLUTTER_MY_APPLICATION_H_
19 |
--------------------------------------------------------------------------------
/macos/.gitignore:
--------------------------------------------------------------------------------
1 | # Flutter-related
2 | **/Flutter/ephemeral/
3 | **/Pods/
4 |
5 | # Xcode-related
6 | **/dgph
7 | **/xcuserdata/
8 |
--------------------------------------------------------------------------------
/macos/Flutter/Flutter-Debug.xcconfig:
--------------------------------------------------------------------------------
1 | #include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"
2 | #include "ephemeral/Flutter-Generated.xcconfig"
3 |
--------------------------------------------------------------------------------
/macos/Flutter/Flutter-Release.xcconfig:
--------------------------------------------------------------------------------
1 | #include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"
2 | #include "ephemeral/Flutter-Generated.xcconfig"
3 |
--------------------------------------------------------------------------------
/macos/Flutter/GeneratedPluginRegistrant.swift:
--------------------------------------------------------------------------------
1 | //
2 | // Generated file. Do not edit.
3 | //
4 |
5 | import FlutterMacOS
6 | import Foundation
7 |
8 | import connectivity_plus
9 | import nb_utils
10 | import path_provider_foundation
11 | import shared_preferences_foundation
12 | import sqflite
13 | import url_launcher_macos
14 |
15 | func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) {
16 | ConnectivityPlugin.register(with: registry.registrar(forPlugin: "ConnectivityPlugin"))
17 | NbUtilsPlugin.register(with: registry.registrar(forPlugin: "NbUtilsPlugin"))
18 | PathProviderPlugin.register(with: registry.registrar(forPlugin: "PathProviderPlugin"))
19 | SharedPreferencesPlugin.register(with: registry.registrar(forPlugin: "SharedPreferencesPlugin"))
20 | SqflitePlugin.register(with: registry.registrar(forPlugin: "SqflitePlugin"))
21 | UrlLauncherPlugin.register(with: registry.registrar(forPlugin: "UrlLauncherPlugin"))
22 | }
23 |
--------------------------------------------------------------------------------
/macos/Podfile:
--------------------------------------------------------------------------------
1 | platform :osx, '10.14'
2 |
3 | # CocoaPods analytics sends network stats synchronously affecting flutter build latency.
4 | ENV['COCOAPODS_DISABLE_STATS'] = 'true'
5 |
6 | project 'Runner', {
7 | 'Debug' => :debug,
8 | 'Profile' => :release,
9 | 'Release' => :release,
10 | }
11 |
12 | def flutter_root
13 | generated_xcode_build_settings_path = File.expand_path(File.join('..', 'Flutter', 'ephemeral', 'Flutter-Generated.xcconfig'), __FILE__)
14 | unless File.exist?(generated_xcode_build_settings_path)
15 | raise "#{generated_xcode_build_settings_path} must exist. If you're running pod install manually, make sure \"flutter pub get\" is executed first"
16 | end
17 |
18 | File.foreach(generated_xcode_build_settings_path) do |line|
19 | matches = line.match(/FLUTTER_ROOT\=(.*)/)
20 | return matches[1].strip if matches
21 | end
22 | raise "FLUTTER_ROOT not found in #{generated_xcode_build_settings_path}. Try deleting Flutter-Generated.xcconfig, then run \"flutter pub get\""
23 | end
24 |
25 | require File.expand_path(File.join('packages', 'flutter_tools', 'bin', 'podhelper'), flutter_root)
26 |
27 | flutter_macos_podfile_setup
28 |
29 | target 'Runner' do
30 | use_frameworks!
31 | use_modular_headers!
32 |
33 | flutter_install_all_macos_pods File.dirname(File.realpath(__FILE__))
34 | target 'RunnerTests' do
35 | inherit! :search_paths
36 | end
37 | end
38 |
39 | post_install do |installer|
40 | installer.pods_project.targets.each do |target|
41 | flutter_additional_macos_build_settings(target)
42 | end
43 | end
44 |
--------------------------------------------------------------------------------
/macos/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | IDEDidComputeMac32BitWarning
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/macos/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme:
--------------------------------------------------------------------------------
1 |
2 |
5 |
8 |
9 |
15 |
21 |
22 |
23 |
24 |
25 |
30 |
31 |
37 |
38 |
39 |
40 |
43 |
49 |
50 |
51 |
52 |
53 |
63 |
65 |
71 |
72 |
73 |
74 |
80 |
82 |
88 |
89 |
90 |
91 |
93 |
94 |
97 |
98 |
99 |
--------------------------------------------------------------------------------
/macos/Runner.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/macos/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | IDEDidComputeMac32BitWarning
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/macos/Runner/AppDelegate.swift:
--------------------------------------------------------------------------------
1 | import Cocoa
2 | import FlutterMacOS
3 |
4 | @NSApplicationMain
5 | class AppDelegate: FlutterAppDelegate {
6 | override func applicationShouldTerminateAfterLastWindowClosed(_ sender: NSApplication) -> Bool {
7 | return true
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/macos/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "size" : "16x16",
5 | "idiom" : "mac",
6 | "filename" : "app_icon_16.png",
7 | "scale" : "1x"
8 | },
9 | {
10 | "size" : "16x16",
11 | "idiom" : "mac",
12 | "filename" : "app_icon_32.png",
13 | "scale" : "2x"
14 | },
15 | {
16 | "size" : "32x32",
17 | "idiom" : "mac",
18 | "filename" : "app_icon_32.png",
19 | "scale" : "1x"
20 | },
21 | {
22 | "size" : "32x32",
23 | "idiom" : "mac",
24 | "filename" : "app_icon_64.png",
25 | "scale" : "2x"
26 | },
27 | {
28 | "size" : "128x128",
29 | "idiom" : "mac",
30 | "filename" : "app_icon_128.png",
31 | "scale" : "1x"
32 | },
33 | {
34 | "size" : "128x128",
35 | "idiom" : "mac",
36 | "filename" : "app_icon_256.png",
37 | "scale" : "2x"
38 | },
39 | {
40 | "size" : "256x256",
41 | "idiom" : "mac",
42 | "filename" : "app_icon_256.png",
43 | "scale" : "1x"
44 | },
45 | {
46 | "size" : "256x256",
47 | "idiom" : "mac",
48 | "filename" : "app_icon_512.png",
49 | "scale" : "2x"
50 | },
51 | {
52 | "size" : "512x512",
53 | "idiom" : "mac",
54 | "filename" : "app_icon_512.png",
55 | "scale" : "1x"
56 | },
57 | {
58 | "size" : "512x512",
59 | "idiom" : "mac",
60 | "filename" : "app_icon_1024.png",
61 | "scale" : "2x"
62 | }
63 | ],
64 | "info" : {
65 | "version" : 1,
66 | "author" : "xcode"
67 | }
68 | }
69 |
--------------------------------------------------------------------------------
/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_1024.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/muhammad-fiaz/QuizApp-Flutter/655a0c72af30840eacbcfc4a846f17a619c5eaef/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_1024.png
--------------------------------------------------------------------------------
/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_128.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/muhammad-fiaz/QuizApp-Flutter/655a0c72af30840eacbcfc4a846f17a619c5eaef/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_128.png
--------------------------------------------------------------------------------
/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_16.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/muhammad-fiaz/QuizApp-Flutter/655a0c72af30840eacbcfc4a846f17a619c5eaef/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_16.png
--------------------------------------------------------------------------------
/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_256.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/muhammad-fiaz/QuizApp-Flutter/655a0c72af30840eacbcfc4a846f17a619c5eaef/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_256.png
--------------------------------------------------------------------------------
/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_32.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/muhammad-fiaz/QuizApp-Flutter/655a0c72af30840eacbcfc4a846f17a619c5eaef/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_32.png
--------------------------------------------------------------------------------
/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_512.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/muhammad-fiaz/QuizApp-Flutter/655a0c72af30840eacbcfc4a846f17a619c5eaef/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_512.png
--------------------------------------------------------------------------------
/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_64.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/muhammad-fiaz/QuizApp-Flutter/655a0c72af30840eacbcfc4a846f17a619c5eaef/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_64.png
--------------------------------------------------------------------------------
/macos/Runner/Configs/AppInfo.xcconfig:
--------------------------------------------------------------------------------
1 | // Application-level settings for the Runner target.
2 | //
3 | // This may be replaced with something auto-generated from metadata (e.g., pubspec.yaml) in the
4 | // future. If not, the values below would default to using the project name when this becomes a
5 | // 'flutter create' template.
6 |
7 | // The application's name. By default this is also the title of the Flutter window.
8 | PRODUCT_NAME = quiz
9 |
10 | // The application's bundle identifier
11 | PRODUCT_BUNDLE_IDENTIFIER = dev.muhammadfiaz.quiz.quiz
12 |
13 | // The copyright displayed in application information
14 | PRODUCT_COPYRIGHT = Copyright © 2024 dev.muhammadfiaz.quiz. All rights reserved.
15 |
--------------------------------------------------------------------------------
/macos/Runner/Configs/Debug.xcconfig:
--------------------------------------------------------------------------------
1 | #include "../../Flutter/Flutter-Debug.xcconfig"
2 | #include "Warnings.xcconfig"
3 |
--------------------------------------------------------------------------------
/macos/Runner/Configs/Release.xcconfig:
--------------------------------------------------------------------------------
1 | #include "../../Flutter/Flutter-Release.xcconfig"
2 | #include "Warnings.xcconfig"
3 |
--------------------------------------------------------------------------------
/macos/Runner/Configs/Warnings.xcconfig:
--------------------------------------------------------------------------------
1 | WARNING_CFLAGS = -Wall -Wconditional-uninitialized -Wnullable-to-nonnull-conversion -Wmissing-method-return-type -Woverlength-strings
2 | GCC_WARN_UNDECLARED_SELECTOR = YES
3 | CLANG_UNDEFINED_BEHAVIOR_SANITIZER_NULLABILITY = YES
4 | CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE
5 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES
6 | CLANG_WARN_PRAGMA_PACK = YES
7 | CLANG_WARN_STRICT_PROTOTYPES = YES
8 | CLANG_WARN_COMMA = YES
9 | GCC_WARN_STRICT_SELECTOR_MATCH = YES
10 | CLANG_WARN_OBJC_REPEATED_USE_OF_WEAK = YES
11 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES
12 | GCC_WARN_SHADOW = YES
13 | CLANG_WARN_UNREACHABLE_CODE = YES
14 |
--------------------------------------------------------------------------------
/macos/Runner/DebugProfile.entitlements:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | com.apple.security.app-sandbox
6 |
7 | com.apple.security.cs.allow-jit
8 |
9 | com.apple.security.network.server
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/macos/Runner/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | $(DEVELOPMENT_LANGUAGE)
7 | CFBundleExecutable
8 | $(EXECUTABLE_NAME)
9 | CFBundleIconFile
10 |
11 | CFBundleIdentifier
12 | $(PRODUCT_BUNDLE_IDENTIFIER)
13 | CFBundleInfoDictionaryVersion
14 | 6.0
15 | CFBundleName
16 | $(PRODUCT_NAME)
17 | CFBundlePackageType
18 | APPL
19 | CFBundleShortVersionString
20 | $(FLUTTER_BUILD_NAME)
21 | CFBundleVersion
22 | $(FLUTTER_BUILD_NUMBER)
23 | LSMinimumSystemVersion
24 | $(MACOSX_DEPLOYMENT_TARGET)
25 | NSHumanReadableCopyright
26 | $(PRODUCT_COPYRIGHT)
27 | NSMainNibFile
28 | MainMenu
29 | NSPrincipalClass
30 | NSApplication
31 |
32 |
33 |
--------------------------------------------------------------------------------
/macos/Runner/MainFlutterWindow.swift:
--------------------------------------------------------------------------------
1 | import Cocoa
2 | import FlutterMacOS
3 |
4 | class MainFlutterWindow: NSWindow {
5 | override func awakeFromNib() {
6 | let flutterViewController = FlutterViewController()
7 | let windowFrame = self.frame
8 | self.contentViewController = flutterViewController
9 | self.setFrame(windowFrame, display: true)
10 |
11 | RegisterGeneratedPlugins(registry: flutterViewController)
12 |
13 | super.awakeFromNib()
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/macos/Runner/Release.entitlements:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | com.apple.security.app-sandbox
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/macos/RunnerTests/RunnerTests.swift:
--------------------------------------------------------------------------------
1 | import FlutterMacOS
2 | import Cocoa
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 |
--------------------------------------------------------------------------------
/package-lock.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "QuizApp-Flutter",
3 | "lockfileVersion": 3,
4 | "requires": true,
5 | "packages": {}
6 | }
7 |
--------------------------------------------------------------------------------
/pubspec.yaml:
--------------------------------------------------------------------------------
1 | name: quiz
2 | description: "A Quiz app using Flutter"
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.2.4 <4.0.0'
23 |
24 | # Dependencies specify other packages that your package needs in order to work.
25 | # To automatically upgrade your package dependencies to the latest versions
26 | # consider running `flutter pub upgrade --major-versions`. Alternatively,
27 | # dependencies can be manually updated by changing the version numbers below to
28 | # the latest version available on pub.dev. To see which dependencies have newer
29 | # versions available, run `flutter pub outdated`.
30 | dependencies:
31 | flutter:
32 | sdk: flutter
33 |
34 | animate_do: ^2.0.0
35 | smooth_page_indicator: ^1.1.0
36 | nb_utils: ^6.1.0
37 | dots_indicator: ^2.0.0
38 | flutter_svg: 2.0.10+1
39 | url_launcher: ^6.0.12
40 | cached_network_image: ^3.1.0
41 | flutter_staggered_grid_view: ^0.4.1
42 | html: ^0.15.0
43 | intl: ^0.17.0
44 | cupertino_icons: ^1.0.2
45 | connectivity_plus_web: ^1.2.5
46 | path_provider_windows: ^2.2.1
47 | shared_preferences_windows: ^2.3.2
48 |
49 | dev_dependencies:
50 | flutter_test:
51 | sdk: flutter
52 |
53 | # The "flutter_lints" package below contains a set of recommended lints to
54 | # encourage good coding practices. The lint set provided by the package is
55 | # activated in the `analysis_options.yaml` file located at the root of your
56 | # package. See that file for information about deactivating specific lint
57 | # rules and activating additional ones.
58 | flutter_lints: ^2.0.0
59 |
60 | # For information on the generic Dart part of this file, see the
61 | # following page: https://dart.dev/tools/pub/pubspec
62 |
63 | # The following section is specific to Flutter packages.
64 | flutter:
65 |
66 | # The following line ensures that the Material Icons font is
67 | # included with your application, so that you can use the icons in
68 | # the material Icons class.
69 | uses-material-design: true
70 |
71 | # To add assets to your application, add an assets section, like this:
72 | assets:
73 | - images/quiz/
74 | - images/quiz/quiz_logo.jpg
75 |
76 |
77 | # An image asset can refer to one or more resolution-specific "variants", see
78 | # https://flutter.dev/assets-and-images/#resolution-aware
79 |
80 | # For details regarding adding assets from package dependencies, see
81 | # https://flutter.dev/assets-and-images/#from-packages
82 |
83 | # To add custom fonts to your application, add a fonts section here,
84 | # in this "flutter" section. Each entry in this list should have a
85 | # "family" key with the font family name, and a "fonts" key with a
86 | # list giving the asset and other descriptors for the font. For
87 | # example:
88 | # fonts:
89 | # - family: Schyler
90 | # fonts:
91 | # - asset: fonts/Schyler-Regular.ttf
92 | # - asset: fonts/Schyler-Italic.ttf
93 | # style: italic
94 | # - family: Trajan Pro
95 | # fonts:
96 | # - asset: fonts/TrajanPro.ttf
97 | # - asset: fonts/TrajanPro_Bold.ttf
98 | # weight: 700
99 | #
100 | # For details regarding fonts from package dependencies,
101 | # see https://flutter.dev/custom-fonts/#from-packages
102 |
--------------------------------------------------------------------------------
/test/widget_test.dart:
--------------------------------------------------------------------------------
1 | // This is a basic Flutter widget test.
2 | //
3 | // To perform an interaction with a widget in your test, use the WidgetTester
4 | // utility in the flutter_test package. For example, you can send tap and scroll
5 | // gestures. You can also use WidgetTester to find child widgets in the widget
6 | // tree, read text, and verify that the values of widget properties are correct.
7 |
8 | import 'package:flutter/material.dart';
9 | import 'package:flutter_test/flutter_test.dart';
10 |
11 | import 'package:quiz/main.dart';
12 |
13 | void main() {
14 | testWidgets('Counter increments smoke test', (WidgetTester tester) async {
15 | // Build our app and trigger a frame.
16 | await tester.pumpWidget(const MyApp());
17 |
18 | // Verify that our counter starts at 0.
19 | expect(find.text('0'), findsOneWidget);
20 | expect(find.text('1'), findsNothing);
21 |
22 | // Tap the '+' icon and trigger a frame.
23 | await tester.tap(find.byIcon(Icons.add));
24 | await tester.pump();
25 |
26 | // Verify that our counter has incremented.
27 | expect(find.text('0'), findsNothing);
28 | expect(find.text('1'), findsOneWidget);
29 | });
30 | }
31 |
--------------------------------------------------------------------------------
/web/favicon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/muhammad-fiaz/QuizApp-Flutter/655a0c72af30840eacbcfc4a846f17a619c5eaef/web/favicon.png
--------------------------------------------------------------------------------
/web/icons/Icon-192.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/muhammad-fiaz/QuizApp-Flutter/655a0c72af30840eacbcfc4a846f17a619c5eaef/web/icons/Icon-192.png
--------------------------------------------------------------------------------
/web/icons/Icon-512.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/muhammad-fiaz/QuizApp-Flutter/655a0c72af30840eacbcfc4a846f17a619c5eaef/web/icons/Icon-512.png
--------------------------------------------------------------------------------
/web/icons/Icon-maskable-192.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/muhammad-fiaz/QuizApp-Flutter/655a0c72af30840eacbcfc4a846f17a619c5eaef/web/icons/Icon-maskable-192.png
--------------------------------------------------------------------------------
/web/icons/Icon-maskable-512.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/muhammad-fiaz/QuizApp-Flutter/655a0c72af30840eacbcfc4a846f17a619c5eaef/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 | quiz
33 |
34 |
35 |
39 |
40 |
41 |
42 |
43 |
58 |
59 |
60 |
--------------------------------------------------------------------------------
/web/manifest.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "quiz",
3 | "short_name": "quiz",
4 | "start_url": ".",
5 | "display": "standalone",
6 | "background_color": "#0175C2",
7 | "theme_color": "#0175C2",
8 | "description": "A Quiz app using Flutter",
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(quiz 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 "quiz")
8 |
9 | # Explicitly opt in to modern CMake behaviors to avoid warnings with recent
10 | # versions of CMake.
11 | cmake_policy(VERSION 3.14...3.25)
12 |
13 | # Define build configuration option.
14 | get_property(IS_MULTICONFIG GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG)
15 | if(IS_MULTICONFIG)
16 | set(CMAKE_CONFIGURATION_TYPES "Debug;Profile;Release"
17 | CACHE STRING "" FORCE)
18 | else()
19 | if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
20 | set(CMAKE_BUILD_TYPE "Debug" CACHE
21 | STRING "Flutter build mode" FORCE)
22 | set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS
23 | "Debug" "Profile" "Release")
24 | endif()
25 | endif()
26 | # Define settings for the Profile build mode.
27 | set(CMAKE_EXE_LINKER_FLAGS_PROFILE "${CMAKE_EXE_LINKER_FLAGS_RELEASE}")
28 | set(CMAKE_SHARED_LINKER_FLAGS_PROFILE "${CMAKE_SHARED_LINKER_FLAGS_RELEASE}")
29 | set(CMAKE_C_FLAGS_PROFILE "${CMAKE_C_FLAGS_RELEASE}")
30 | set(CMAKE_CXX_FLAGS_PROFILE "${CMAKE_CXX_FLAGS_RELEASE}")
31 |
32 | # Use Unicode for all projects.
33 | add_definitions(-DUNICODE -D_UNICODE)
34 |
35 | # Compilation settings that should be applied to most targets.
36 | #
37 | # Be cautious about adding new options here, as plugins use this function by
38 | # default. In most cases, you should add new options to specific targets instead
39 | # of modifying this function.
40 | function(APPLY_STANDARD_SETTINGS TARGET)
41 | target_compile_features(${TARGET} PUBLIC cxx_std_17)
42 | target_compile_options(${TARGET} PRIVATE /W4 /WX /wd"4100")
43 | target_compile_options(${TARGET} PRIVATE /EHsc)
44 | target_compile_definitions(${TARGET} PRIVATE "_HAS_EXCEPTIONS=0")
45 | target_compile_definitions(${TARGET} PRIVATE "$<$:_DEBUG>")
46 | endfunction()
47 |
48 | # Flutter library and tool build rules.
49 | set(FLUTTER_MANAGED_DIR "${CMAKE_CURRENT_SOURCE_DIR}/flutter")
50 | add_subdirectory(${FLUTTER_MANAGED_DIR})
51 |
52 | # Application build; see runner/CMakeLists.txt.
53 | add_subdirectory("runner")
54 |
55 |
56 | # Generated plugin build rules, which manage building the plugins and adding
57 | # them to the application.
58 | include(flutter/generated_plugins.cmake)
59 |
60 |
61 | # === Installation ===
62 | # Support files are copied into place next to the executable, so that it can
63 | # run in place. This is done instead of making a separate bundle (as on Linux)
64 | # so that building and running from within Visual Studio will work.
65 | set(BUILD_BUNDLE_DIR "$")
66 | # Make the "install" step default, as it's required to run.
67 | set(CMAKE_VS_INCLUDE_INSTALL_TO_DEFAULT_BUILD 1)
68 | if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
69 | set(CMAKE_INSTALL_PREFIX "${BUILD_BUNDLE_DIR}" CACHE PATH "..." FORCE)
70 | endif()
71 |
72 | set(INSTALL_BUNDLE_DATA_DIR "${CMAKE_INSTALL_PREFIX}/data")
73 | set(INSTALL_BUNDLE_LIB_DIR "${CMAKE_INSTALL_PREFIX}")
74 |
75 | install(TARGETS ${BINARY_NAME} RUNTIME DESTINATION "${CMAKE_INSTALL_PREFIX}"
76 | COMPONENT Runtime)
77 |
78 | install(FILES "${FLUTTER_ICU_DATA_FILE}" DESTINATION "${INSTALL_BUNDLE_DATA_DIR}"
79 | COMPONENT Runtime)
80 |
81 | install(FILES "${FLUTTER_LIBRARY}" DESTINATION "${INSTALL_BUNDLE_LIB_DIR}"
82 | COMPONENT Runtime)
83 |
84 | if(PLUGIN_BUNDLED_LIBRARIES)
85 | install(FILES "${PLUGIN_BUNDLED_LIBRARIES}"
86 | DESTINATION "${INSTALL_BUNDLE_LIB_DIR}"
87 | COMPONENT Runtime)
88 | endif()
89 |
90 | # Copy the native assets provided by the build.dart from all packages.
91 | set(NATIVE_ASSETS_DIR "${PROJECT_BUILD_DIR}native_assets/windows/")
92 | install(DIRECTORY "${NATIVE_ASSETS_DIR}"
93 | DESTINATION "${INSTALL_BUNDLE_LIB_DIR}"
94 | COMPONENT Runtime)
95 |
96 | # Fully re-copy the assets directory on each build to avoid having stale files
97 | # from a previous install.
98 | set(FLUTTER_ASSET_DIR_NAME "flutter_assets")
99 | install(CODE "
100 | file(REMOVE_RECURSE \"${INSTALL_BUNDLE_DATA_DIR}/${FLUTTER_ASSET_DIR_NAME}\")
101 | " COMPONENT Runtime)
102 | install(DIRECTORY "${PROJECT_BUILD_DIR}/${FLUTTER_ASSET_DIR_NAME}"
103 | DESTINATION "${INSTALL_BUNDLE_DATA_DIR}" COMPONENT Runtime)
104 |
105 | # Install the AOT library on non-Debug builds only.
106 | install(FILES "${AOT_LIBRARY}" DESTINATION "${INSTALL_BUNDLE_DATA_DIR}"
107 | CONFIGURATIONS Profile;Release
108 | COMPONENT Runtime)
109 |
--------------------------------------------------------------------------------
/windows/flutter/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | # This file controls Flutter-level build steps. It should not be edited.
2 | cmake_minimum_required(VERSION 3.14)
3 |
4 | set(EPHEMERAL_DIR "${CMAKE_CURRENT_SOURCE_DIR}/ephemeral")
5 |
6 | # Configuration provided via flutter tool.
7 | include(${EPHEMERAL_DIR}/generated_config.cmake)
8 |
9 | # TODO: Move the rest of this into files in ephemeral. See
10 | # https://github.com/flutter/flutter/issues/57146.
11 | set(WRAPPER_ROOT "${EPHEMERAL_DIR}/cpp_client_wrapper")
12 |
13 | # Set fallback configurations for older versions of the flutter tool.
14 | if (NOT DEFINED FLUTTER_TARGET_PLATFORM)
15 | set(FLUTTER_TARGET_PLATFORM "windows-x64")
16 | endif()
17 |
18 | # === Flutter Library ===
19 | set(FLUTTER_LIBRARY "${EPHEMERAL_DIR}/flutter_windows.dll")
20 |
21 | # Published to parent scope for install step.
22 | set(FLUTTER_LIBRARY ${FLUTTER_LIBRARY} PARENT_SCOPE)
23 | set(FLUTTER_ICU_DATA_FILE "${EPHEMERAL_DIR}/icudtl.dat" PARENT_SCOPE)
24 | set(PROJECT_BUILD_DIR "${PROJECT_DIR}/build/" PARENT_SCOPE)
25 | set(AOT_LIBRARY "${PROJECT_DIR}/build/windows/app.so" PARENT_SCOPE)
26 |
27 | list(APPEND FLUTTER_LIBRARY_HEADERS
28 | "flutter_export.h"
29 | "flutter_windows.h"
30 | "flutter_messenger.h"
31 | "flutter_plugin_registrar.h"
32 | "flutter_texture_registrar.h"
33 | )
34 | list(TRANSFORM FLUTTER_LIBRARY_HEADERS PREPEND "${EPHEMERAL_DIR}/")
35 | add_library(flutter INTERFACE)
36 | target_include_directories(flutter INTERFACE
37 | "${EPHEMERAL_DIR}"
38 | )
39 | target_link_libraries(flutter INTERFACE "${FLUTTER_LIBRARY}.lib")
40 | add_dependencies(flutter flutter_assemble)
41 |
42 | # === Wrapper ===
43 | list(APPEND CPP_WRAPPER_SOURCES_CORE
44 | "core_implementations.cc"
45 | "standard_codec.cc"
46 | )
47 | list(TRANSFORM CPP_WRAPPER_SOURCES_CORE PREPEND "${WRAPPER_ROOT}/")
48 | list(APPEND CPP_WRAPPER_SOURCES_PLUGIN
49 | "plugin_registrar.cc"
50 | )
51 | list(TRANSFORM CPP_WRAPPER_SOURCES_PLUGIN PREPEND "${WRAPPER_ROOT}/")
52 | list(APPEND CPP_WRAPPER_SOURCES_APP
53 | "flutter_engine.cc"
54 | "flutter_view_controller.cc"
55 | )
56 | list(TRANSFORM CPP_WRAPPER_SOURCES_APP PREPEND "${WRAPPER_ROOT}/")
57 |
58 | # Wrapper sources needed for a plugin.
59 | add_library(flutter_wrapper_plugin STATIC
60 | ${CPP_WRAPPER_SOURCES_CORE}
61 | ${CPP_WRAPPER_SOURCES_PLUGIN}
62 | )
63 | apply_standard_settings(flutter_wrapper_plugin)
64 | set_target_properties(flutter_wrapper_plugin PROPERTIES
65 | POSITION_INDEPENDENT_CODE ON)
66 | set_target_properties(flutter_wrapper_plugin PROPERTIES
67 | CXX_VISIBILITY_PRESET hidden)
68 | target_link_libraries(flutter_wrapper_plugin PUBLIC flutter)
69 | target_include_directories(flutter_wrapper_plugin PUBLIC
70 | "${WRAPPER_ROOT}/include"
71 | )
72 | add_dependencies(flutter_wrapper_plugin flutter_assemble)
73 |
74 | # Wrapper sources needed for the runner.
75 | add_library(flutter_wrapper_app STATIC
76 | ${CPP_WRAPPER_SOURCES_CORE}
77 | ${CPP_WRAPPER_SOURCES_APP}
78 | )
79 | apply_standard_settings(flutter_wrapper_app)
80 | target_link_libraries(flutter_wrapper_app PUBLIC flutter)
81 | target_include_directories(flutter_wrapper_app PUBLIC
82 | "${WRAPPER_ROOT}/include"
83 | )
84 | add_dependencies(flutter_wrapper_app flutter_assemble)
85 |
86 | # === Flutter tool backend ===
87 | # _phony_ is a non-existent file to force this command to run every time,
88 | # since currently there's no way to get a full input/output list from the
89 | # flutter tool.
90 | set(PHONY_OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/_phony_")
91 | set_source_files_properties("${PHONY_OUTPUT}" PROPERTIES SYMBOLIC TRUE)
92 | add_custom_command(
93 | OUTPUT ${FLUTTER_LIBRARY} ${FLUTTER_LIBRARY_HEADERS}
94 | ${CPP_WRAPPER_SOURCES_CORE} ${CPP_WRAPPER_SOURCES_PLUGIN}
95 | ${CPP_WRAPPER_SOURCES_APP}
96 | ${PHONY_OUTPUT}
97 | COMMAND ${CMAKE_COMMAND} -E env
98 | ${FLUTTER_TOOL_ENVIRONMENT}
99 | "${FLUTTER_ROOT}/packages/flutter_tools/bin/tool_backend.bat"
100 | ${FLUTTER_TARGET_PLATFORM} $
101 | VERBATIM
102 | )
103 | add_custom_target(flutter_assemble DEPENDS
104 | "${FLUTTER_LIBRARY}"
105 | ${FLUTTER_LIBRARY_HEADERS}
106 | ${CPP_WRAPPER_SOURCES_CORE}
107 | ${CPP_WRAPPER_SOURCES_PLUGIN}
108 | ${CPP_WRAPPER_SOURCES_APP}
109 | )
110 |
--------------------------------------------------------------------------------
/windows/flutter/generated_plugin_registrant.cc:
--------------------------------------------------------------------------------
1 | //
2 | // Generated file. Do not edit.
3 | //
4 |
5 | // clang-format off
6 |
7 | #include "generated_plugin_registrant.h"
8 |
9 | #include
10 | #include
11 | #include
12 |
13 | void RegisterPlugins(flutter::PluginRegistry* registry) {
14 | ConnectivityPlusWindowsPluginRegisterWithRegistrar(
15 | registry->GetRegistrarForPlugin("ConnectivityPlusWindowsPlugin"));
16 | NbUtilsPluginRegisterWithRegistrar(
17 | registry->GetRegistrarForPlugin("NbUtilsPlugin"));
18 | UrlLauncherWindowsRegisterWithRegistrar(
19 | registry->GetRegistrarForPlugin("UrlLauncherWindows"));
20 | }
21 |
--------------------------------------------------------------------------------
/windows/flutter/generated_plugin_registrant.h:
--------------------------------------------------------------------------------
1 | //
2 | // Generated file. Do not edit.
3 | //
4 |
5 | // clang-format off
6 |
7 | #ifndef GENERATED_PLUGIN_REGISTRANT_
8 | #define GENERATED_PLUGIN_REGISTRANT_
9 |
10 | #include
11 |
12 | // Registers Flutter plugins.
13 | void RegisterPlugins(flutter::PluginRegistry* registry);
14 |
15 | #endif // GENERATED_PLUGIN_REGISTRANT_
16 |
--------------------------------------------------------------------------------
/windows/flutter/generated_plugins.cmake:
--------------------------------------------------------------------------------
1 | #
2 | # Generated file, do not edit.
3 | #
4 |
5 | list(APPEND FLUTTER_PLUGIN_LIST
6 | connectivity_plus
7 | nb_utils
8 | url_launcher_windows
9 | )
10 |
11 | list(APPEND FLUTTER_FFI_PLUGIN_LIST
12 | )
13 |
14 | set(PLUGIN_BUNDLED_LIBRARIES)
15 |
16 | foreach(plugin ${FLUTTER_PLUGIN_LIST})
17 | add_subdirectory(flutter/ephemeral/.plugin_symlinks/${plugin}/windows plugins/${plugin})
18 | target_link_libraries(${BINARY_NAME} PRIVATE ${plugin}_plugin)
19 | list(APPEND PLUGIN_BUNDLED_LIBRARIES $)
20 | list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${plugin}_bundled_libraries})
21 | endforeach(plugin)
22 |
23 | foreach(ffi_plugin ${FLUTTER_FFI_PLUGIN_LIST})
24 | add_subdirectory(flutter/ephemeral/.plugin_symlinks/${ffi_plugin}/windows plugins/${ffi_plugin})
25 | list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${ffi_plugin}_bundled_libraries})
26 | endforeach(ffi_plugin)
27 |
--------------------------------------------------------------------------------
/windows/runner/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | cmake_minimum_required(VERSION 3.14)
2 | project(runner LANGUAGES CXX)
3 |
4 | # Define the application target. To change its name, change BINARY_NAME in the
5 | # top-level CMakeLists.txt, not the value here, or `flutter run` will no longer
6 | # work.
7 | #
8 | # Any new source files that you add to the application should be added here.
9 | add_executable(${BINARY_NAME} WIN32
10 | "flutter_window.cpp"
11 | "main.cpp"
12 | "utils.cpp"
13 | "win32_window.cpp"
14 | "${FLUTTER_MANAGED_DIR}/generated_plugin_registrant.cc"
15 | "Runner.rc"
16 | "runner.exe.manifest"
17 | )
18 |
19 | # Apply the standard set of build settings. This can be removed for applications
20 | # that need different build settings.
21 | apply_standard_settings(${BINARY_NAME})
22 |
23 | # Add preprocessor definitions for the build version.
24 | target_compile_definitions(${BINARY_NAME} PRIVATE "FLUTTER_VERSION=\"${FLUTTER_VERSION}\"")
25 | target_compile_definitions(${BINARY_NAME} PRIVATE "FLUTTER_VERSION_MAJOR=${FLUTTER_VERSION_MAJOR}")
26 | target_compile_definitions(${BINARY_NAME} PRIVATE "FLUTTER_VERSION_MINOR=${FLUTTER_VERSION_MINOR}")
27 | target_compile_definitions(${BINARY_NAME} PRIVATE "FLUTTER_VERSION_PATCH=${FLUTTER_VERSION_PATCH}")
28 | target_compile_definitions(${BINARY_NAME} PRIVATE "FLUTTER_VERSION_BUILD=${FLUTTER_VERSION_BUILD}")
29 |
30 | # Disable Windows macros that collide with C++ standard library functions.
31 | target_compile_definitions(${BINARY_NAME} PRIVATE "NOMINMAX")
32 |
33 | # Add dependency libraries and include directories. Add any application-specific
34 | # dependencies here.
35 | target_link_libraries(${BINARY_NAME} PRIVATE flutter flutter_wrapper_app)
36 | target_link_libraries(${BINARY_NAME} PRIVATE "dwmapi.lib")
37 | target_include_directories(${BINARY_NAME} PRIVATE "${CMAKE_SOURCE_DIR}")
38 |
39 | # Run the Flutter tool portions of the build. This must not be removed.
40 | add_dependencies(${BINARY_NAME} flutter_assemble)
41 |
--------------------------------------------------------------------------------
/windows/runner/Runner.rc:
--------------------------------------------------------------------------------
1 | // Microsoft Visual C++ generated resource script.
2 | //
3 | #pragma code_page(65001)
4 | #include "resource.h"
5 |
6 | #define APSTUDIO_READONLY_SYMBOLS
7 | /////////////////////////////////////////////////////////////////////////////
8 | //
9 | // Generated from the TEXTINCLUDE 2 resource.
10 | //
11 | #include "winres.h"
12 |
13 | /////////////////////////////////////////////////////////////////////////////
14 | #undef APSTUDIO_READONLY_SYMBOLS
15 |
16 | /////////////////////////////////////////////////////////////////////////////
17 | // English (United States) resources
18 |
19 | #if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
20 | LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
21 |
22 | #ifdef APSTUDIO_INVOKED
23 | /////////////////////////////////////////////////////////////////////////////
24 | //
25 | // TEXTINCLUDE
26 | //
27 |
28 | 1 TEXTINCLUDE
29 | BEGIN
30 | "resource.h\0"
31 | END
32 |
33 | 2 TEXTINCLUDE
34 | BEGIN
35 | "#include ""winres.h""\r\n"
36 | "\0"
37 | END
38 |
39 | 3 TEXTINCLUDE
40 | BEGIN
41 | "\r\n"
42 | "\0"
43 | END
44 |
45 | #endif // APSTUDIO_INVOKED
46 |
47 |
48 | /////////////////////////////////////////////////////////////////////////////
49 | //
50 | // Icon
51 | //
52 |
53 | // Icon with lowest ID value placed first to ensure application icon
54 | // remains consistent on all systems.
55 | IDI_APP_ICON ICON "resources\\app_icon.ico"
56 |
57 |
58 | /////////////////////////////////////////////////////////////////////////////
59 | //
60 | // Version
61 | //
62 |
63 | #if defined(FLUTTER_VERSION_MAJOR) && defined(FLUTTER_VERSION_MINOR) && defined(FLUTTER_VERSION_PATCH) && defined(FLUTTER_VERSION_BUILD)
64 | #define VERSION_AS_NUMBER FLUTTER_VERSION_MAJOR,FLUTTER_VERSION_MINOR,FLUTTER_VERSION_PATCH,FLUTTER_VERSION_BUILD
65 | #else
66 | #define VERSION_AS_NUMBER 1,0,0,0
67 | #endif
68 |
69 | #if defined(FLUTTER_VERSION)
70 | #define VERSION_AS_STRING FLUTTER_VERSION
71 | #else
72 | #define VERSION_AS_STRING "1.0.0"
73 | #endif
74 |
75 | VS_VERSION_INFO VERSIONINFO
76 | FILEVERSION VERSION_AS_NUMBER
77 | PRODUCTVERSION VERSION_AS_NUMBER
78 | FILEFLAGSMASK VS_FFI_FILEFLAGSMASK
79 | #ifdef _DEBUG
80 | FILEFLAGS VS_FF_DEBUG
81 | #else
82 | FILEFLAGS 0x0L
83 | #endif
84 | FILEOS VOS__WINDOWS32
85 | FILETYPE VFT_APP
86 | FILESUBTYPE 0x0L
87 | BEGIN
88 | BLOCK "StringFileInfo"
89 | BEGIN
90 | BLOCK "040904e4"
91 | BEGIN
92 | VALUE "CompanyName", "dev.muhammadfiaz.quiz" "\0"
93 | VALUE "FileDescription", "quiz" "\0"
94 | VALUE "FileVersion", VERSION_AS_STRING "\0"
95 | VALUE "InternalName", "quiz" "\0"
96 | VALUE "LegalCopyright", "Copyright (C) 2024 dev.muhammadfiaz.quiz. All rights reserved." "\0"
97 | VALUE "OriginalFilename", "quiz.exe" "\0"
98 | VALUE "ProductName", "quiz" "\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"quiz", 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/muhammad-fiaz/QuizApp-Flutter/655a0c72af30840eacbcfc4a846f17a619c5eaef/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.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 |
--------------------------------------------------------------------------------