├── .gitignore
├── .idea
├── FlutterCourse.iml
├── libraries
│ └── Dart_SDK.xml
├── misc.xml
├── modules.xml
└── vcs.xml
├── Ai pics
├── Labels1.png
├── Labels2.png
├── Text1.png
├── Text2.png
├── barcodes4.png
├── bsrcode1.png
├── bsrcode2.png
├── bsrcode3.png
├── bsrcode4.png
├── face1.png
├── face2.png
├── face3.png
├── face4.png
└── text3.jpg
├── README.md
├── analysis_options.yaml
├── android
├── .gitignore
├── app
│ ├── build.gradle
│ ├── google-services.json
│ └── src
│ │ ├── debug
│ │ └── AndroidManifest.xml
│ │ ├── main
│ │ ├── AndroidManifest.xml
│ │ ├── kotlin
│ │ │ └── com
│ │ │ │ └── example
│ │ │ │ └── courses_codes
│ │ │ │ └── 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
├── courses_codes_android.iml
├── gradle.properties
├── gradle
│ └── wrapper
│ │ └── gradle-wrapper.properties
└── settings.gradle
├── asset
└── road.jpeg
├── assets
├── flutter.jpeg
├── fonts
│ ├── Agbalumo
│ │ └── Agbalumo-Regular.ttf
│ ├── Eczar
│ │ ├── Eczar-Bold.ttf
│ │ └── Eczar-ExtraBold.ttf
│ ├── Merriweather
│ │ ├── Merriweather-Light.ttf
│ │ └── Merriweather-Regular.ttf
│ ├── Satisfy
│ │ └── Satisfy-Regular.ttf
│ └── ZenDots
│ │ └── ZenDots-Regular.ttf
├── gift.png
└── ml
│ └── imageClassification.tflite
├── courses_codes.iml
├── indexes
├── AUE
│ └── Index
│ │ ├── chroma-collections.parquet
│ │ ├── chroma-embeddings.parquet
│ │ └── index
│ │ ├── id_to_uuid_2ee7bd3f-ae2c-4c82-87a6-9814258ff858.pkl
│ │ ├── index_2ee7bd3f-ae2c-4c82-87a6-9814258ff858.bin
│ │ ├── index_metadata_2ee7bd3f-ae2c-4c82-87a6-9814258ff858.pkl
│ │ └── uuid_to_id_2ee7bd3f-ae2c-4c82-87a6-9814258ff858.pkl
├── JIB
│ └── Index
│ │ ├── chroma-collections.parquet
│ │ ├── chroma-embeddings.parquet
│ │ └── index
│ │ ├── id_to_uuid_47da200f-7132-4340-bd99-38b7b8fa3ef7.pkl
│ │ ├── index_47da200f-7132-4340-bd99-38b7b8fa3ef7.bin
│ │ ├── index_metadata_47da200f-7132-4340-bd99-38b7b8fa3ef7.pkl
│ │ └── uuid_to_id_47da200f-7132-4340-bd99-38b7b8fa3ef7.pkl
└── Taqa
│ └── Index
│ ├── chroma-collections.parquet
│ ├── chroma-embeddings.parquet
│ └── index
│ ├── id_to_uuid_63889d27-1700-4b3f-8d29-f1fe5bdf4c66.pkl
│ ├── index_63889d27-1700-4b3f-8d29-f1fe5bdf4c66.bin
│ ├── index_metadata_63889d27-1700-4b3f-8d29-f1fe5bdf4c66.pkl
│ └── uuid_to_id_63889d27-1700-4b3f-8d29-f1fe5bdf4c66.pkl
├── 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
├── lib
├── 1-FlutterBasic101
│ ├── 1-BasicWidgets.dart
│ ├── 2-LayoutWidgets.dart
│ ├── 3-UnderstandingFlutter.dart
│ └── 4-InteractiveWidgets.dart
├── 2-MaterilDesing&Themimng
│ ├── ComponentBottomAppBar.dart
│ ├── ComponentTheming.dart
│ ├── ComponentsBottomNavigation.dart
│ ├── DarkTheme.dart
│ ├── FormScreen.dart
│ └── TextTheming.dart
├── 3-Asynchronous Networking Programming
│ ├── 1-UserApi.dart
│ ├── 2-UserListScreen.dart
│ ├── 3-RoutingScreens.dart
│ ├── 4-AddUserScreen.dart
│ ├── User.dart
│ └── UserScreens
│ │ └── AddUserScreen.dart
├── 4-ReactiveProgramming
│ ├── 5-ReactiveProgrammingFlutter.dart
│ └── ReactiveProgrammingDart.dart
├── 5-StateManagment
│ ├── BlocStateManagment
│ │ ├── UI
│ │ │ └── UserUIScreen.dart
│ │ ├── bloc
│ │ │ ├── user_bloc.dart
│ │ │ ├── user_events.dart
│ │ │ └── user_state.dart
│ │ ├── data
│ │ │ └── UserProvider.dart
│ │ └── main.dart
│ └── ProviderStateManagment
│ │ ├── UI
│ │ └── UserListScreen.dart
│ │ ├── data
│ │ └── UserApi.dart
│ │ ├── main.dart
│ │ └── provider
│ │ └── UserProvider.dart
├── 6-FlutterAndAI
│ ├── CV
│ │ ├── BarcodeScreen.dart
│ │ ├── FaceDetectionScreen.dart
│ │ ├── ImageLabellingScreen.dart
│ │ ├── PeopleCounter.dart
│ │ └── TextRecognitionScreen.dart
│ ├── NLP
│ │ ├── WikipediaTraslator.dart
│ │ ├── language_identifier_view.dart
│ │ └── language_translator_view.dart
│ └── mainAi.dart
├── Firebase
│ ├── Art.dart
│ ├── ArtDetails.dart
│ └── ArtGallaryList.dart
├── FlutterCourse.code-workspace
├── main.dart
└── templates
│ ├── 1-FlutterBasic101
│ ├── FlutterStarterCode.dart
│ ├── FlutterStarterLayout.dart
│ ├── StateFullTemplate.dart
│ └── UnderstandingFlutterTemplate.dart
│ ├── 2-MaterialDesign&Theming
│ ├── DarkThemeTemplate.dart
│ ├── FormsTemplate.dart
│ └── MaterialStarterCode.dart
│ ├── 3-Asynchronous Networking Programming
│ ├── AddUserScreenTemplate.dart
│ ├── RoutingTemplate.dart
│ └── SimpleStarterCode.dart
│ ├── 4-ReactiveProgramming
│ └── ReactiveProgrammingTemplate.dart
│ └── templatesLabs
│ ├── Lab1
│ ├── Lab1Template.dart
│ ├── MaterialDesignCompnenetTeamplate.dart
│ └── SunflowerScreen.dart
│ ├── Lab2
│ └── SunflowerScreen.dart
│ ├── Lab3
│ └── Lab3Template.dart
│ ├── Lab4
│ ├── AddPostScreenTemplate.dart
│ └── PostsListScreenTemplate.dart
│ ├── Lab5
│ ├── Todo.dart
│ ├── TodoScreen.dart
│ └── bloc
│ │ ├── api_bloc.dart
│ │ ├── api_events.dart
│ │ └── api_states.dart
│ ├── Lab6
│ ├── AddTodo.dart
│ └── ReactiveProgrammingLab.dart
│ └── old
│ ├── AddUserScreenTemplate.dart
│ ├── FirebaseTemplate.dart
│ ├── StyleTemplate.dart
│ └── UserListTemplate.dart
├── pubspec.yaml
└── web
├── favicon.png
├── icons
├── Icon-192.png
├── Icon-512.png
├── Icon-maskable-192.png
└── Icon-maskable-512.png
├── index.html
└── manifest.json
/.gitignore:
--------------------------------------------------------------------------------
1 |
2 | # Miscellaneous
3 | *.class
4 | *.lock
5 | *.log
6 | *.pyc
7 | *.swp
8 | .DS_Store
9 | .atom/
10 | .buildlog/
11 | .history
12 | .svn/
13 |
14 | # IntelliJ related
15 | *.iml
16 | *.ipr
17 | *.iws
18 | .idea/
19 |
20 |
21 | # Visual Studio Code related
22 | .classpath
23 | .project
24 | .settings/
25 | .vscode/
26 |
27 | # Flutter repo-specific
28 | /bin/cache/
29 | /bin/internal/bootstrap.bat
30 | /bin/internal/bootstrap.sh
31 | /bin/mingit/
32 | /dev/benchmarks/mega_gallery/
33 | /dev/bots/.recipe_deps
34 | /dev/bots/android_tools/
35 | /dev/devicelab/ABresults*.json
36 | /dev/docs/doc/
37 | /dev/docs/flutter.docs.zip
38 | /dev/docs/lib/
39 | /dev/docs/pubspec.yaml
40 | /dev/integration_tests/**/xcuserdata
41 | /dev/integration_tests/**/Pods
42 | /packages/flutter/coverage/
43 | version
44 | analysis_benchmark.json
45 |
46 | # packages file containing multi-root paths
47 | .packages.generated
48 |
49 | # Flutter/Dart/Pub related
50 | **/doc/api/
51 | .dart_tool/
52 | .flutter-plugins
53 | .flutter-plugins-dependencies
54 | **/generated_plugin_registrant.dart
55 | .packages
56 | .pub-cache/
57 | .pub/
58 | build/
59 | flutter_*.png
60 | linked_*.ds
61 | unlinked.ds
62 | unlinked_spec.ds
63 |
64 | # Android related
65 | **/android/**/gradle-wrapper.jar
66 | **/android/.gradle
67 | **/android/captures/
68 | **/android/gradlew
69 | **/android/gradlew.bat
70 | **/android/local.properties
71 | **/android/**/GeneratedPluginRegistrant.java
72 | **/android/key.properties
73 | *.jks
74 |
75 | # iOS/XCode related
76 | **/ios/**/*.mode1v3
77 | **/ios/**/*.mode2v3
78 | **/ios/**/*.moved-aside
79 | **/ios/**/*.pbxuser
80 | **/ios/**/*.perspectivev3
81 | **/ios/**/*sync/
82 | **/ios/**/.sconsign.dblite
83 | **/ios/**/.tags*
84 | **/ios/**/.vagrant/
85 | **/ios/**/DerivedData/
86 | **/ios/**/Icon?
87 | **/ios/**/Pods/
88 | **/ios/**/.symlinks/
89 | **/ios/**/profile
90 | **/ios/**/xcuserdata
91 | **/ios/.generated/
92 | **/ios/Flutter/.last_build_id
93 | **/ios/Flutter/App.framework
94 | **/ios/Flutter/Flutter.framework
95 | **/ios/Flutter/Flutter.podspec
96 | **/ios/Flutter/Generated.xcconfig
97 | **/ios/Flutter/ephemeral
98 | **/ios/Flutter/app.flx
99 | **/ios/Flutter/app.zip
100 | **/ios/Flutter/flutter_assets/
101 | **/ios/Flutter/flutter_export_environment.sh
102 | **/ios/ServiceDefinitions.json
103 | **/ios/Runner/GeneratedPluginRegistrant.*
104 |
105 | # macOS
106 | **/macos/Flutter/GeneratedPluginRegistrant.swift
107 |
108 | # Coverage
109 | coverage/
110 |
111 | # Symbols
112 | app.*.symbols
113 |
114 | # Exceptions to above rules.
115 | !**/ios/**/default.mode1v3
116 | !**/ios/**/default.mode2v3
117 | !**/ios/**/default.pbxuser
118 | !**/ios/**/default.perspectivev3
119 | !/packages/flutter_tools/test/data/dart_dependencies_test/**/.packages
120 | !/dev/ci/**/Gemfile.lock
121 |
122 | /lib/Labs/
123 |
124 | /lib/templates/templatesLabs/Lab5-copy/
125 |
--------------------------------------------------------------------------------
/.idea/FlutterCourse.iml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
--------------------------------------------------------------------------------
/.idea/libraries/Dart_SDK.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
--------------------------------------------------------------------------------
/.idea/misc.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/.idea/modules.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/.idea/vcs.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/Ai pics/Labels1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MuwaffaqImam/FlutterCourseInnopolis/abbca9551ffd3a77b07f98ea50c761dba36420ff/Ai pics/Labels1.png
--------------------------------------------------------------------------------
/Ai pics/Labels2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MuwaffaqImam/FlutterCourseInnopolis/abbca9551ffd3a77b07f98ea50c761dba36420ff/Ai pics/Labels2.png
--------------------------------------------------------------------------------
/Ai pics/Text1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MuwaffaqImam/FlutterCourseInnopolis/abbca9551ffd3a77b07f98ea50c761dba36420ff/Ai pics/Text1.png
--------------------------------------------------------------------------------
/Ai pics/Text2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MuwaffaqImam/FlutterCourseInnopolis/abbca9551ffd3a77b07f98ea50c761dba36420ff/Ai pics/Text2.png
--------------------------------------------------------------------------------
/Ai pics/barcodes4.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MuwaffaqImam/FlutterCourseInnopolis/abbca9551ffd3a77b07f98ea50c761dba36420ff/Ai pics/barcodes4.png
--------------------------------------------------------------------------------
/Ai pics/bsrcode1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MuwaffaqImam/FlutterCourseInnopolis/abbca9551ffd3a77b07f98ea50c761dba36420ff/Ai pics/bsrcode1.png
--------------------------------------------------------------------------------
/Ai pics/bsrcode2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MuwaffaqImam/FlutterCourseInnopolis/abbca9551ffd3a77b07f98ea50c761dba36420ff/Ai pics/bsrcode2.png
--------------------------------------------------------------------------------
/Ai pics/bsrcode3.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MuwaffaqImam/FlutterCourseInnopolis/abbca9551ffd3a77b07f98ea50c761dba36420ff/Ai pics/bsrcode3.png
--------------------------------------------------------------------------------
/Ai pics/bsrcode4.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MuwaffaqImam/FlutterCourseInnopolis/abbca9551ffd3a77b07f98ea50c761dba36420ff/Ai pics/bsrcode4.png
--------------------------------------------------------------------------------
/Ai pics/face1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MuwaffaqImam/FlutterCourseInnopolis/abbca9551ffd3a77b07f98ea50c761dba36420ff/Ai pics/face1.png
--------------------------------------------------------------------------------
/Ai pics/face2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MuwaffaqImam/FlutterCourseInnopolis/abbca9551ffd3a77b07f98ea50c761dba36420ff/Ai pics/face2.png
--------------------------------------------------------------------------------
/Ai pics/face3.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MuwaffaqImam/FlutterCourseInnopolis/abbca9551ffd3a77b07f98ea50c761dba36420ff/Ai pics/face3.png
--------------------------------------------------------------------------------
/Ai pics/face4.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MuwaffaqImam/FlutterCourseInnopolis/abbca9551ffd3a77b07f98ea50c761dba36420ff/Ai pics/face4.png
--------------------------------------------------------------------------------
/Ai pics/text3.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MuwaffaqImam/FlutterCourseInnopolis/abbca9551ffd3a77b07f98ea50c761dba36420ff/Ai pics/text3.jpg
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # courses_codes
2 |
3 | A new Flutter project.
4 |
5 | ## Getting Started
6 |
7 | This project is a starting point for a Flutter application.
8 |
9 | A few resources to get you started if this is your first Flutter project:
10 |
11 | - [Lab: Write your first Flutter app](https://flutter.dev/docs/get-started/codelab)
12 | - [Cookbook: Useful Flutter samples](https://flutter.dev/docs/cookbook)
13 |
14 | For help getting started with Flutter, view our
15 | [online documentation](https://flutter.dev/docs), which offers tutorials,
16 | samples, guidance on mobile development, and a full API reference.
17 |
--------------------------------------------------------------------------------
/analysis_options.yaml:
--------------------------------------------------------------------------------
1 | # This file configures the analyzer, which statically analyzes Dart code to
2 | # check for errors, warnings, and lints.
3 | #
4 | # The issues identified by the analyzer are surfaced in the UI of Dart-enabled
5 | # IDEs (https://dart.dev/tools#ides-and-editors). The analyzer can also be
6 | # invoked from the command line by running `flutter analyze`.
7 |
8 | # The following line activates a set of recommended lints for Flutter apps,
9 | # packages, and plugins designed to encourage good coding practices.
10 | include: package:flutter_lints/flutter.yaml
11 |
12 | linter:
13 | # The lint rules applied to this project can be customized in the
14 | # section below to disable rules from the `package:flutter_lints/flutter.yaml`
15 | # included above or to enable additional rules. A list of all available liBlocStateManagmentTemplatesnts
16 | # and their documentation is published at
17 | # https://dart-lang.github.io/linter/lints/index.html.
18 | #
19 | # Instead of disabling a lint rule for the entire project in the
20 | # section below, it can also be suppressed for a single line of code
21 | # or a specific dart file by using the `// ignore: name_of_lint` and
22 | # `// ignore_for_file: name_of_lint` syntax on the line or in the file
23 | # producing the lint.
24 | rules:
25 | ignore_for_file: all
26 | # avoid_print: false # Uncomment to disable the `avoid_print` rule
27 | # prefer_single_quotes: true # Uncomment to enable the `prefer_single_quotes` rule
28 |
29 | # Additional information about this file can be found at
30 | # https://dart.dev/guides/language/analysis-options
31 |
--------------------------------------------------------------------------------
/android/.gitignore:
--------------------------------------------------------------------------------
1 | gradle-wrapper.jar
2 | /.gradle
3 | /captures/
4 | /gradlew
5 | /gradlew.bat
6 | /local.properties
7 | GeneratedPluginRegistrant.java
8 |
9 | # Remember to never publicly share your keystore.
10 | # See https://flutter.dev/docs/deployment/android#reference-the-keystore-from-the-app
11 | key.properties
12 | **/*.keystore
13 | **/*.jks
14 |
--------------------------------------------------------------------------------
/android/app/build.gradle:
--------------------------------------------------------------------------------
1 | def localProperties = new Properties()
2 | def localPropertiesFile = rootProject.file('local.properties')
3 | if (localPropertiesFile.exists()) {
4 | localPropertiesFile.withReader('UTF-8') { reader ->
5 | localProperties.load(reader)
6 | }
7 | }
8 |
9 | def flutterRoot = localProperties.getProperty('flutter.sdk')
10 | if (flutterRoot == null) {
11 | throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.")
12 | }
13 |
14 | def flutterVersionCode = localProperties.getProperty('flutter.versionCode')
15 | if (flutterVersionCode == null) {
16 | flutterVersionCode = '1'
17 | }
18 |
19 | def flutterVersionName = localProperties.getProperty('flutter.versionName')
20 | if (flutterVersionName == null) {
21 | flutterVersionName = '1.0'
22 | }
23 |
24 | apply plugin: 'com.android.application'
25 | apply plugin: 'kotlin-android'
26 | apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
27 | apply plugin: 'com.google.gms.google-services'
28 |
29 | android {
30 | compileSdkVersion flutter.compileSdkVersion
31 |
32 | compileOptions {
33 | sourceCompatibility JavaVersion.VERSION_1_8
34 | targetCompatibility JavaVersion.VERSION_1_8
35 | }
36 |
37 | kotlinOptions {
38 | jvmTarget = '1.8'
39 | }
40 |
41 | sourceSets {
42 | main.java.srcDirs += 'src/main/kotlin'
43 | }
44 |
45 | defaultConfig {
46 | // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
47 | applicationId "com.example.courses_codes"
48 | minSdkVersion 21
49 | targetSdkVersion 33
50 | versionCode flutterVersionCode.toInteger()
51 | versionName flutterVersionName
52 | multiDexEnabled true
53 |
54 | }
55 |
56 | buildTypes {
57 | release {
58 | // TODO: Add your own signing config for the release build.
59 | // Signing with the debug keys for now, so `flutter run --release` works.
60 | signingConfig signingConfigs.debug
61 | }
62 | }
63 | }
64 |
65 | flutter {
66 | source '../..'
67 | }
68 |
69 | dependencies {
70 | implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
71 | implementation 'com.android.support:multidex:1.0.3'
72 |
73 | }
74 |
--------------------------------------------------------------------------------
/android/app/google-services.json:
--------------------------------------------------------------------------------
1 | {
2 | "project_info": {
3 | "project_number": "35150381585",
4 | "project_id": "artgallery-fluttercourse",
5 | "storage_bucket": "artgallery-fluttercourse.appspot.com"
6 | },
7 | "client": [
8 | {
9 | "client_info": {
10 | "mobilesdk_app_id": "1:35150381585:android:e935081455375c793f67b0",
11 | "android_client_info": {
12 | "package_name": "com.example.courses_codes"
13 | }
14 | },
15 | "oauth_client": [
16 | {
17 | "client_id": "35150381585-66n25jhvsc44fisuto1hkb9cn72avcq6.apps.googleusercontent.com",
18 | "client_type": 3
19 | }
20 | ],
21 | "api_key": [
22 | {
23 | "current_key": "AIzaSyBQAePB1LteqdZZmSd0VHRvj8Q9sP1bKiA"
24 | }
25 | ],
26 | "services": {
27 | "appinvite_service": {
28 | "other_platform_oauth_client": [
29 | {
30 | "client_id": "35150381585-66n25jhvsc44fisuto1hkb9cn72avcq6.apps.googleusercontent.com",
31 | "client_type": 3
32 | }
33 | ]
34 | }
35 | }
36 | }
37 | ],
38 | "configuration_version": "1"
39 | }
--------------------------------------------------------------------------------
/android/app/src/debug/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
3 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/android/app/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
3 |
4 |
5 |
6 |
7 |
12 |
20 |
24 |
28 |
29 |
30 |
31 |
32 |
33 |
35 |
38 |
39 |
40 |
--------------------------------------------------------------------------------
/android/app/src/main/kotlin/com/example/courses_codes/MainActivity.kt:
--------------------------------------------------------------------------------
1 | package com.example.courses_codes
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/MuwaffaqImam/FlutterCourseInnopolis/abbca9551ffd3a77b07f98ea50c761dba36420ff/android/app/src/main/res/mipmap-hdpi/ic_launcher.png
--------------------------------------------------------------------------------
/android/app/src/main/res/mipmap-mdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MuwaffaqImam/FlutterCourseInnopolis/abbca9551ffd3a77b07f98ea50c761dba36420ff/android/app/src/main/res/mipmap-mdpi/ic_launcher.png
--------------------------------------------------------------------------------
/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MuwaffaqImam/FlutterCourseInnopolis/abbca9551ffd3a77b07f98ea50c761dba36420ff/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MuwaffaqImam/FlutterCourseInnopolis/abbca9551ffd3a77b07f98ea50c761dba36420ff/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MuwaffaqImam/FlutterCourseInnopolis/abbca9551ffd3a77b07f98ea50c761dba36420ff/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/android/app/src/main/res/values-night/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
9 |
15 |
18 |
19 |
--------------------------------------------------------------------------------
/android/app/src/main/res/values/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
9 |
15 |
18 |
19 |
--------------------------------------------------------------------------------
/android/app/src/profile/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
3 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/android/build.gradle:
--------------------------------------------------------------------------------
1 | buildscript {
2 | ext.kotlin_version = '1.6.10'
3 | repositories {
4 | google()
5 | mavenCentral()
6 | }
7 |
8 | dependencies {
9 | classpath 'com.google.gms:google-services:4.3.8'
10 | classpath 'com.android.tools.build:gradle:4.1.0'
11 | classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
12 | }
13 | }
14 |
15 | allprojects {
16 | repositories {
17 | google()
18 | mavenCentral()
19 | }
20 | }
21 |
22 | rootProject.buildDir = '../build'
23 | subprojects {
24 | project.buildDir = "${rootProject.buildDir}/${project.name}"
25 | }
26 | subprojects {
27 | project.evaluationDependsOn(':app')
28 | }
29 |
30 | task clean(type: Delete) {
31 | delete rootProject.buildDir
32 | }
33 |
--------------------------------------------------------------------------------
/android/courses_codes_android.iml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
--------------------------------------------------------------------------------
/android/gradle.properties:
--------------------------------------------------------------------------------
1 | org.gradle.jvmargs=-Xmx1536M
2 | android.useAndroidX=true
3 | android.enableJetifier=true
4 |
--------------------------------------------------------------------------------
/android/gradle/wrapper/gradle-wrapper.properties:
--------------------------------------------------------------------------------
1 | distributionBase=GRADLE_USER_HOME
2 | distributionPath=wrapper/dists
3 | distributionUrl=https\://services.gradle.org/distributions/gradle-7.4.2-bin.zip
4 | zipStoreBase=GRADLE_USER_HOME
5 | zipStorePath=wrapper/dists
6 |
--------------------------------------------------------------------------------
/android/settings.gradle:
--------------------------------------------------------------------------------
1 | include ':app'
2 |
3 | def localPropertiesFile = new File(rootProject.projectDir, "local.properties")
4 | def properties = new Properties()
5 |
6 | assert localPropertiesFile.exists()
7 | localPropertiesFile.withReader("UTF-8") { reader -> properties.load(reader) }
8 |
9 | def flutterSdkPath = properties.getProperty("flutter.sdk")
10 | assert flutterSdkPath != null, "flutter.sdk not set in local.properties"
11 | apply from: "$flutterSdkPath/packages/flutter_tools/gradle/app_plugin_loader.gradle"
12 |
--------------------------------------------------------------------------------
/asset/road.jpeg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MuwaffaqImam/FlutterCourseInnopolis/abbca9551ffd3a77b07f98ea50c761dba36420ff/asset/road.jpeg
--------------------------------------------------------------------------------
/assets/flutter.jpeg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MuwaffaqImam/FlutterCourseInnopolis/abbca9551ffd3a77b07f98ea50c761dba36420ff/assets/flutter.jpeg
--------------------------------------------------------------------------------
/assets/fonts/Agbalumo/Agbalumo-Regular.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MuwaffaqImam/FlutterCourseInnopolis/abbca9551ffd3a77b07f98ea50c761dba36420ff/assets/fonts/Agbalumo/Agbalumo-Regular.ttf
--------------------------------------------------------------------------------
/assets/fonts/Eczar/Eczar-Bold.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MuwaffaqImam/FlutterCourseInnopolis/abbca9551ffd3a77b07f98ea50c761dba36420ff/assets/fonts/Eczar/Eczar-Bold.ttf
--------------------------------------------------------------------------------
/assets/fonts/Eczar/Eczar-ExtraBold.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MuwaffaqImam/FlutterCourseInnopolis/abbca9551ffd3a77b07f98ea50c761dba36420ff/assets/fonts/Eczar/Eczar-ExtraBold.ttf
--------------------------------------------------------------------------------
/assets/fonts/Merriweather/Merriweather-Light.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MuwaffaqImam/FlutterCourseInnopolis/abbca9551ffd3a77b07f98ea50c761dba36420ff/assets/fonts/Merriweather/Merriweather-Light.ttf
--------------------------------------------------------------------------------
/assets/fonts/Merriweather/Merriweather-Regular.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MuwaffaqImam/FlutterCourseInnopolis/abbca9551ffd3a77b07f98ea50c761dba36420ff/assets/fonts/Merriweather/Merriweather-Regular.ttf
--------------------------------------------------------------------------------
/assets/fonts/Satisfy/Satisfy-Regular.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MuwaffaqImam/FlutterCourseInnopolis/abbca9551ffd3a77b07f98ea50c761dba36420ff/assets/fonts/Satisfy/Satisfy-Regular.ttf
--------------------------------------------------------------------------------
/assets/fonts/ZenDots/ZenDots-Regular.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MuwaffaqImam/FlutterCourseInnopolis/abbca9551ffd3a77b07f98ea50c761dba36420ff/assets/fonts/ZenDots/ZenDots-Regular.ttf
--------------------------------------------------------------------------------
/assets/gift.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MuwaffaqImam/FlutterCourseInnopolis/abbca9551ffd3a77b07f98ea50c761dba36420ff/assets/gift.png
--------------------------------------------------------------------------------
/assets/ml/imageClassification.tflite:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MuwaffaqImam/FlutterCourseInnopolis/abbca9551ffd3a77b07f98ea50c761dba36420ff/assets/ml/imageClassification.tflite
--------------------------------------------------------------------------------
/courses_codes.iml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
--------------------------------------------------------------------------------
/indexes/AUE/Index/chroma-collections.parquet:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MuwaffaqImam/FlutterCourseInnopolis/abbca9551ffd3a77b07f98ea50c761dba36420ff/indexes/AUE/Index/chroma-collections.parquet
--------------------------------------------------------------------------------
/indexes/AUE/Index/chroma-embeddings.parquet:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MuwaffaqImam/FlutterCourseInnopolis/abbca9551ffd3a77b07f98ea50c761dba36420ff/indexes/AUE/Index/chroma-embeddings.parquet
--------------------------------------------------------------------------------
/indexes/AUE/Index/index/id_to_uuid_2ee7bd3f-ae2c-4c82-87a6-9814258ff858.pkl:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MuwaffaqImam/FlutterCourseInnopolis/abbca9551ffd3a77b07f98ea50c761dba36420ff/indexes/AUE/Index/index/id_to_uuid_2ee7bd3f-ae2c-4c82-87a6-9814258ff858.pkl
--------------------------------------------------------------------------------
/indexes/AUE/Index/index/index_2ee7bd3f-ae2c-4c82-87a6-9814258ff858.bin:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MuwaffaqImam/FlutterCourseInnopolis/abbca9551ffd3a77b07f98ea50c761dba36420ff/indexes/AUE/Index/index/index_2ee7bd3f-ae2c-4c82-87a6-9814258ff858.bin
--------------------------------------------------------------------------------
/indexes/AUE/Index/index/index_metadata_2ee7bd3f-ae2c-4c82-87a6-9814258ff858.pkl:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MuwaffaqImam/FlutterCourseInnopolis/abbca9551ffd3a77b07f98ea50c761dba36420ff/indexes/AUE/Index/index/index_metadata_2ee7bd3f-ae2c-4c82-87a6-9814258ff858.pkl
--------------------------------------------------------------------------------
/indexes/AUE/Index/index/uuid_to_id_2ee7bd3f-ae2c-4c82-87a6-9814258ff858.pkl:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MuwaffaqImam/FlutterCourseInnopolis/abbca9551ffd3a77b07f98ea50c761dba36420ff/indexes/AUE/Index/index/uuid_to_id_2ee7bd3f-ae2c-4c82-87a6-9814258ff858.pkl
--------------------------------------------------------------------------------
/indexes/JIB/Index/chroma-collections.parquet:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MuwaffaqImam/FlutterCourseInnopolis/abbca9551ffd3a77b07f98ea50c761dba36420ff/indexes/JIB/Index/chroma-collections.parquet
--------------------------------------------------------------------------------
/indexes/JIB/Index/chroma-embeddings.parquet:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MuwaffaqImam/FlutterCourseInnopolis/abbca9551ffd3a77b07f98ea50c761dba36420ff/indexes/JIB/Index/chroma-embeddings.parquet
--------------------------------------------------------------------------------
/indexes/JIB/Index/index/id_to_uuid_47da200f-7132-4340-bd99-38b7b8fa3ef7.pkl:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MuwaffaqImam/FlutterCourseInnopolis/abbca9551ffd3a77b07f98ea50c761dba36420ff/indexes/JIB/Index/index/id_to_uuid_47da200f-7132-4340-bd99-38b7b8fa3ef7.pkl
--------------------------------------------------------------------------------
/indexes/JIB/Index/index/index_47da200f-7132-4340-bd99-38b7b8fa3ef7.bin:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MuwaffaqImam/FlutterCourseInnopolis/abbca9551ffd3a77b07f98ea50c761dba36420ff/indexes/JIB/Index/index/index_47da200f-7132-4340-bd99-38b7b8fa3ef7.bin
--------------------------------------------------------------------------------
/indexes/JIB/Index/index/index_metadata_47da200f-7132-4340-bd99-38b7b8fa3ef7.pkl:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MuwaffaqImam/FlutterCourseInnopolis/abbca9551ffd3a77b07f98ea50c761dba36420ff/indexes/JIB/Index/index/index_metadata_47da200f-7132-4340-bd99-38b7b8fa3ef7.pkl
--------------------------------------------------------------------------------
/indexes/JIB/Index/index/uuid_to_id_47da200f-7132-4340-bd99-38b7b8fa3ef7.pkl:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MuwaffaqImam/FlutterCourseInnopolis/abbca9551ffd3a77b07f98ea50c761dba36420ff/indexes/JIB/Index/index/uuid_to_id_47da200f-7132-4340-bd99-38b7b8fa3ef7.pkl
--------------------------------------------------------------------------------
/indexes/Taqa/Index/chroma-collections.parquet:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MuwaffaqImam/FlutterCourseInnopolis/abbca9551ffd3a77b07f98ea50c761dba36420ff/indexes/Taqa/Index/chroma-collections.parquet
--------------------------------------------------------------------------------
/indexes/Taqa/Index/chroma-embeddings.parquet:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MuwaffaqImam/FlutterCourseInnopolis/abbca9551ffd3a77b07f98ea50c761dba36420ff/indexes/Taqa/Index/chroma-embeddings.parquet
--------------------------------------------------------------------------------
/indexes/Taqa/Index/index/id_to_uuid_63889d27-1700-4b3f-8d29-f1fe5bdf4c66.pkl:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MuwaffaqImam/FlutterCourseInnopolis/abbca9551ffd3a77b07f98ea50c761dba36420ff/indexes/Taqa/Index/index/id_to_uuid_63889d27-1700-4b3f-8d29-f1fe5bdf4c66.pkl
--------------------------------------------------------------------------------
/indexes/Taqa/Index/index/index_63889d27-1700-4b3f-8d29-f1fe5bdf4c66.bin:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MuwaffaqImam/FlutterCourseInnopolis/abbca9551ffd3a77b07f98ea50c761dba36420ff/indexes/Taqa/Index/index/index_63889d27-1700-4b3f-8d29-f1fe5bdf4c66.bin
--------------------------------------------------------------------------------
/indexes/Taqa/Index/index/index_metadata_63889d27-1700-4b3f-8d29-f1fe5bdf4c66.pkl:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MuwaffaqImam/FlutterCourseInnopolis/abbca9551ffd3a77b07f98ea50c761dba36420ff/indexes/Taqa/Index/index/index_metadata_63889d27-1700-4b3f-8d29-f1fe5bdf4c66.pkl
--------------------------------------------------------------------------------
/indexes/Taqa/Index/index/uuid_to_id_63889d27-1700-4b3f-8d29-f1fe5bdf4c66.pkl:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MuwaffaqImam/FlutterCourseInnopolis/abbca9551ffd3a77b07f98ea50c761dba36420ff/indexes/Taqa/Index/index/uuid_to_id_63889d27-1700-4b3f-8d29-f1fe5bdf4c66.pkl
--------------------------------------------------------------------------------
/ios/.gitignore:
--------------------------------------------------------------------------------
1 | **/dgph
2 | *.mode1v3
3 | *.mode2v3
4 | *.moved-aside
5 | *.pbxuser
6 | *.perspectivev3
7 | **/*sync/
8 | .sconsign.dblite
9 | .tags*
10 | **/.vagrant/
11 | **/DerivedData/
12 | Icon?
13 | **/Pods/
14 | **/.symlinks/
15 | profile
16 | xcuserdata
17 | **/.generated/
18 | Flutter/App.framework
19 | Flutter/Flutter.framework
20 | Flutter/Flutter.podspec
21 | Flutter/Generated.xcconfig
22 | Flutter/ephemeral/
23 | Flutter/app.flx
24 | Flutter/app.zip
25 | Flutter/flutter_assets/
26 | Flutter/flutter_export_environment.sh
27 | ServiceDefinitions.json
28 | Runner/GeneratedPluginRegistrant.*
29 |
30 | # Exceptions to above rules.
31 | !default.mode1v3
32 | !default.mode2v3
33 | !default.pbxuser
34 | !default.perspectivev3
35 |
--------------------------------------------------------------------------------
/ios/Flutter/AppFrameworkInfo.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | en
7 | CFBundleExecutable
8 | App
9 | CFBundleIdentifier
10 | io.flutter.flutter.app
11 | CFBundleInfoDictionaryVersion
12 | 6.0
13 | CFBundleName
14 | App
15 | CFBundlePackageType
16 | FMWK
17 | CFBundleShortVersionString
18 | 1.0
19 | CFBundleSignature
20 | ????
21 | CFBundleVersion
22 | 1.0
23 | MinimumOSVersion
24 | 9.0
25 |
26 |
27 |
--------------------------------------------------------------------------------
/ios/Flutter/Debug.xcconfig:
--------------------------------------------------------------------------------
1 | #include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"
2 | #include "Generated.xcconfig"
3 |
--------------------------------------------------------------------------------
/ios/Flutter/Release.xcconfig:
--------------------------------------------------------------------------------
1 | #include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"
2 | #include "Generated.xcconfig"
3 |
--------------------------------------------------------------------------------
/ios/Podfile:
--------------------------------------------------------------------------------
1 | # Uncomment this line to define a global platform for your project
2 | # platform :ios, '9.0'
3 |
4 | # CocoaPods analytics sends network stats synchronously affecting flutter build latency.
5 | ENV['COCOAPODS_DISABLE_STATS'] = 'true'
6 |
7 | project 'Runner', {
8 | 'Debug' => :debug,
9 | 'Profile' => :release,
10 | 'Release' => :release,
11 | }
12 |
13 | def flutter_root
14 | generated_xcode_build_settings_path = File.expand_path(File.join('..', 'Flutter', 'Generated.xcconfig'), __FILE__)
15 | unless File.exist?(generated_xcode_build_settings_path)
16 | raise "#{generated_xcode_build_settings_path} must exist. If you're running pod install manually, make sure flutter pub get is executed first"
17 | end
18 |
19 | File.foreach(generated_xcode_build_settings_path) do |line|
20 | matches = line.match(/FLUTTER_ROOT\=(.*)/)
21 | return matches[1].strip if matches
22 | end
23 | raise "FLUTTER_ROOT not found in #{generated_xcode_build_settings_path}. Try deleting Generated.xcconfig, then run flutter pub get"
24 | end
25 |
26 | require File.expand_path(File.join('packages', 'flutter_tools', 'bin', 'podhelper'), flutter_root)
27 |
28 | flutter_ios_podfile_setup
29 |
30 | target 'Runner' do
31 | use_frameworks!
32 | use_modular_headers!
33 |
34 | flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__))
35 | end
36 |
37 | post_install do |installer|
38 | installer.pods_project.targets.each do |target|
39 | flutter_additional_ios_build_settings(target)
40 | end
41 | end
42 |
--------------------------------------------------------------------------------
/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | IDEDidComputeMac32BitWarning
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | PreviewsEnabled
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme:
--------------------------------------------------------------------------------
1 |
2 |
5 |
8 |
9 |
15 |
21 |
22 |
23 |
24 |
25 |
30 |
31 |
37 |
38 |
39 |
40 |
41 |
42 |
52 |
54 |
60 |
61 |
62 |
63 |
69 |
71 |
77 |
78 |
79 |
80 |
82 |
83 |
86 |
87 |
88 |
--------------------------------------------------------------------------------
/ios/Runner.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | IDEDidComputeMac32BitWarning
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | PreviewsEnabled
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/ios/Runner/AppDelegate.swift:
--------------------------------------------------------------------------------
1 | import UIKit
2 | import Flutter
3 |
4 | @UIApplicationMain
5 | @objc class AppDelegate: FlutterAppDelegate {
6 | override func application(
7 | _ application: UIApplication,
8 | didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?
9 | ) -> Bool {
10 | GeneratedPluginRegistrant.register(with: self)
11 | return super.application(application, didFinishLaunchingWithOptions: launchOptions)
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/AppIcon.appiconset/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/MuwaffaqImam/FlutterCourseInnopolis/abbca9551ffd3a77b07f98ea50c761dba36420ff/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/MuwaffaqImam/FlutterCourseInnopolis/abbca9551ffd3a77b07f98ea50c761dba36420ff/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/MuwaffaqImam/FlutterCourseInnopolis/abbca9551ffd3a77b07f98ea50c761dba36420ff/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/MuwaffaqImam/FlutterCourseInnopolis/abbca9551ffd3a77b07f98ea50c761dba36420ff/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/MuwaffaqImam/FlutterCourseInnopolis/abbca9551ffd3a77b07f98ea50c761dba36420ff/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/MuwaffaqImam/FlutterCourseInnopolis/abbca9551ffd3a77b07f98ea50c761dba36420ff/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/MuwaffaqImam/FlutterCourseInnopolis/abbca9551ffd3a77b07f98ea50c761dba36420ff/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/MuwaffaqImam/FlutterCourseInnopolis/abbca9551ffd3a77b07f98ea50c761dba36420ff/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/MuwaffaqImam/FlutterCourseInnopolis/abbca9551ffd3a77b07f98ea50c761dba36420ff/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/MuwaffaqImam/FlutterCourseInnopolis/abbca9551ffd3a77b07f98ea50c761dba36420ff/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/MuwaffaqImam/FlutterCourseInnopolis/abbca9551ffd3a77b07f98ea50c761dba36420ff/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/MuwaffaqImam/FlutterCourseInnopolis/abbca9551ffd3a77b07f98ea50c761dba36420ff/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/MuwaffaqImam/FlutterCourseInnopolis/abbca9551ffd3a77b07f98ea50c761dba36420ff/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/MuwaffaqImam/FlutterCourseInnopolis/abbca9551ffd3a77b07f98ea50c761dba36420ff/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/MuwaffaqImam/FlutterCourseInnopolis/abbca9551ffd3a77b07f98ea50c761dba36420ff/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/MuwaffaqImam/FlutterCourseInnopolis/abbca9551ffd3a77b07f98ea50c761dba36420ff/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MuwaffaqImam/FlutterCourseInnopolis/abbca9551ffd3a77b07f98ea50c761dba36420ff/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MuwaffaqImam/FlutterCourseInnopolis/abbca9551ffd3a77b07f98ea50c761dba36420ff/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 | NSPhotoLibraryUsageDescription
8 | describe why your app needs permission for the photo library.
9 | CFBundleDisplayName
10 | Courses Codes
11 | CFBundleExecutable
12 | $(EXECUTABLE_NAME)
13 | CFBundleIdentifier
14 | $(PRODUCT_BUNDLE_IDENTIFIER)
15 | CFBundleInfoDictionaryVersion
16 | 6.0
17 | CFBundleName
18 | courses_codes
19 | CFBundlePackageType
20 | APPL
21 | CFBundleShortVersionString
22 | $(FLUTTER_BUILD_NAME)
23 | CFBundleSignature
24 | ????
25 | CFBundleVersion
26 | $(FLUTTER_BUILD_NUMBER)
27 | LSRequiresIPhoneOS
28 |
29 | UILaunchStoryboardName
30 | LaunchScreen
31 | UIMainStoryboardFile
32 | Main
33 | UISupportedInterfaceOrientations
34 |
35 | UIInterfaceOrientationPortrait
36 | UIInterfaceOrientationLandscapeLeft
37 | UIInterfaceOrientationLandscapeRight
38 |
39 | UISupportedInterfaceOrientations~ipad
40 |
41 | UIInterfaceOrientationPortrait
42 | UIInterfaceOrientationPortraitUpsideDown
43 | UIInterfaceOrientationLandscapeLeft
44 | UIInterfaceOrientationLandscapeRight
45 |
46 | UIViewControllerBasedStatusBarAppearance
47 |
48 |
49 |
50 |
--------------------------------------------------------------------------------
/ios/Runner/Runner-Bridging-Header.h:
--------------------------------------------------------------------------------
1 | #import "GeneratedPluginRegistrant.h"
2 |
--------------------------------------------------------------------------------
/lib/1-FlutterBasic101/1-BasicWidgets.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 |
3 | void main() => runApp(MyApp());
4 |
5 | /// this is your APP Main screen configuration
6 | // ignore: prefer_const_constructors
7 | class MyApp extends StatelessWidget {
8 | const MyApp({Key? key}) : super(key: key);
9 |
10 | @override
11 | Widget build(BuildContext context) {
12 | return MaterialApp(
13 | home: MyHomePage(),
14 | );
15 | }
16 | }
17 |
18 | /// this is a template to start building a UI
19 | /// to start adding any UI you want change what comes after the [ body: ] tag below
20 | class MyHomePage extends StatelessWidget {
21 | const MyHomePage({Key? key}) : super(key: key);
22 |
23 | @override
24 | Widget build(BuildContext context) {
25 | return Scaffold(
26 | backgroundColor: const Color(0xfff4f4f4),
27 | /*******************--[focus here 🧐]--*******************/
28 | appBar: AppBar(
29 | leading: const Icon(Icons.android_sharp),
30 | title: const Text('App Title'),
31 | backgroundColor: Colors.teal,
32 | elevation: 4,
33 | ),
34 | body: Column(
35 | children: [
36 | myWidget(),
37 | textWidgetQuiz(),
38 | iconQuizSolution(),
39 | elevatedButtonQuiz(),
40 | iconButton(),
41 | ],
42 | ),
43 | /*******************--[focus here 🧐]--*******************/
44 | );
45 | }
46 |
47 | Widget myWidget() {
48 | return Container(
49 | padding: EdgeInsets.all(20),
50 | child:
51 | /*******************--[focus here 🧐]--*******************/
52 | Text("Hello iOS, I am Flutter")
53 | /*******************--[focus here 🧐]--*******************/
54 | );
55 | }
56 |
57 | IconButton iconButton() {
58 | return IconButton(
59 | onPressed: () {},
60 | icon: Icon(Icons.add),
61 | color: Colors.redAccent,
62 | iconSize: 50,
63 | splashColor: Colors.yellowAccent,
64 | );
65 | }
66 |
67 | Image imageQuiz() {
68 | return Image.network(
69 | 'https://i1.rgstatic.net/ii/institution.image/AS%3A294232846815242%401447161985730_l',
70 | height: 600,
71 | width: 400,
72 | fit: BoxFit.cover,
73 | );
74 | }
75 |
76 | ElevatedButton elevatedButtonQuiz() {
77 | return ElevatedButton(
78 | onPressed: () {},
79 | child: Text(
80 | "Press me",
81 | style: TextStyle(
82 | fontSize: 18, fontFamily: "casual", color: Colors.yellowAccent),
83 | ),
84 | style: ElevatedButton.styleFrom(
85 | elevation: 6,
86 | shape: StadiumBorder(),
87 | padding: EdgeInsets.only(right: 100, left: 100),
88 | ),
89 | );
90 | }
91 |
92 | Icon iconQuizSolution() {
93 | return Icon(
94 | Icons.whatshot,
95 | size: 200,
96 | color: Colors.deepOrange,
97 | );
98 | }
99 |
100 | Text textWidgetQuiz() {
101 | return const Text(
102 | 'Your first Widget',
103 | textAlign: TextAlign.center,
104 | style: TextStyle(
105 | color: Colors.teal,
106 | fontFamily: "casual",
107 | fontSize: 40,
108 | fontWeight: FontWeight.w700,
109 | backgroundColor: Colors.yellowAccent,
110 | letterSpacing: 4,
111 | fontStyle: FontStyle.italic),
112 | );
113 | }
114 | }
115 |
--------------------------------------------------------------------------------
/lib/1-FlutterBasic101/3-UnderstandingFlutter.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 |
3 | void main() => runApp(MyApp());
4 |
5 | class MyApp extends StatelessWidget {
6 | const MyApp({Key? key}) : super(key: key);
7 |
8 | @override
9 | Widget build(BuildContext context) {
10 | return MaterialApp(
11 | theme: ThemeData(
12 | colorScheme: ColorScheme.fromSwatch(
13 | primarySwatch: Colors.red, accentColor: Colors.indigo)),
14 | home: MyHomePage(),
15 | );
16 | }
17 | }
18 |
19 | class MyHomePage extends StatelessWidget {
20 | const MyHomePage({Key? key}) : super(key: key);
21 |
22 | @override
23 | Widget build(BuildContext context) {
24 | return Scaffold(
25 | appBar: AppBar(),
26 | floatingActionButton: FloatingActionButton(
27 | onPressed: () {},
28 | ),
29 | body: Column(
30 | children: [
31 | FlutterLogo(
32 | size: 200,
33 | style: FlutterLogoStyle.horizontal,
34 | ),
35 | ElevatedButton(onPressed: () {}, child: Text('Press me'))
36 | ],
37 | ),
38 | );
39 | }
40 | }
41 |
--------------------------------------------------------------------------------
/lib/1-FlutterBasic101/4-InteractiveWidgets.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 |
3 | void main() => runApp(MyApp());
4 |
5 |
6 | class MyApp extends StatelessWidget {
7 | MyApp({Key? key}) : super(key: key);
8 |
9 | @override
10 | Widget build(BuildContext context) {
11 | return MaterialApp(
12 | theme: ThemeData(
13 | colorScheme: ColorScheme.fromSwatch(
14 | primarySwatch: Colors.red,
15 | accentColor: Colors.lightBlue,
16 | )),
17 | home: MyHomePage(),
18 | );
19 | }
20 | }
21 |
22 | class MyHomePage extends StatefulWidget {
23 | MyHomePage({Key? key}) : super(key: key);
24 |
25 | @override
26 | State createState() => _MyHomePageState();
27 | }
28 |
29 | class _MyHomePageState extends State {
30 | double size = 0;
31 | int counter = 0;
32 |
33 | @override
34 | Widget build(BuildContext context) {
35 | return Scaffold(
36 | appBar: AppBar(
37 | leading: const Icon(Icons.android_sharp),
38 | title: const Text('Flutter course'),
39 | elevation: 4,
40 | ),
41 | body: counterQuiz()
42 | );
43 | }
44 |
45 | Center counterApp() {
46 | return Center(
47 | child: Row(
48 | mainAxisAlignment: MainAxisAlignment.center,
49 | children: [
50 | ElevatedButton(
51 | onPressed: () {
52 | setState(() {
53 | counter += 1;
54 | });
55 | },
56 | child: Icon(
57 | Icons.add,
58 | ),
59 | ),
60 | Padding(
61 | padding: const EdgeInsets.all(20.0),
62 | child:
63 | Text('$counter',
64 | style: TextStyle(
65 | fontSize: 50,
66 | color: counter >= 10
67 | ? Colors.red
68 | : Colors.black),
69 | ),
70 | ),
71 | ElevatedButton(
72 | onPressed: () {
73 | setState(() {
74 | counter -= 1;
75 | });
76 | },
77 | child: Icon(
78 | Icons.remove,
79 | ),
80 | ),
81 | ],
82 | ),
83 | );
84 | }
85 |
86 |
87 | Center counterQuiz() {
88 | return Center(
89 | child: Row(
90 | mainAxisAlignment: MainAxisAlignment.center,
91 | children: [
92 | InkWell(onTap: (){
93 | setState(() {
94 | counter += 1;
95 | });
96 | },child: Icon(Icons.thumb_up,size: 100,color: Colors.blue,)),
97 | Padding(
98 | padding: const EdgeInsets.all(20.0),
99 | child: Text(
100 | '$counter',
101 | style: TextStyle(
102 | fontSize: 50,
103 | color: counter >= 10 ? Colors.red : Colors.black),
104 | ),
105 | ),
106 | InkWell(onTap: (){
107 | setState(() {
108 | counter -= 1;
109 | });
110 | },child: Icon(Icons.thumb_down,size: 100, color: Colors.red,)),
111 | ],
112 | ),
113 | );
114 | }
115 |
116 |
117 | Column animatedContainer() {
118 | return Column(
119 | children: [
120 | AnimatedContainer(
121 | margin: EdgeInsets.all(16),
122 | color: size > 120 ? Colors.red : Colors.lightBlue,
123 | width: 100 + size,
124 | height: 100 + size,
125 | duration: Duration(milliseconds: 450),
126 | ),
127 | Center(
128 | child: Row(
129 | mainAxisAlignment: MainAxisAlignment.center,
130 | children: [
131 | ElevatedButton(
132 | onPressed: () {
133 | setState(() {
134 | size += 5;
135 | });
136 | },
137 | child: Icon(
138 | Icons.add,
139 | ),
140 | ),
141 | SizedBox(
142 | width: 20,
143 | ),
144 | ElevatedButton(
145 | onPressed: () {
146 | setState(() {
147 | size -= 5;
148 | });
149 | },
150 | child: Icon(
151 | Icons.remove,
152 | ),
153 | ),
154 | ],
155 | ),
156 | )
157 | ],
158 | );
159 | }
160 |
161 |
162 | }
163 |
--------------------------------------------------------------------------------
/lib/2-MaterilDesing&Themimng/ComponentTheming.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 | void main() => runApp(MyApp());
3 |
4 | /// this is your APP Main screen configuration
5 | class MyApp extends StatelessWidget {
6 | MyApp({Key? key}) : super(key: key);
7 |
8 | @override
9 | Widget build(BuildContext context) {
10 | return MaterialApp(
11 | theme: ThemeData(
12 | scaffoldBackgroundColor: Colors.black,
13 | appBarTheme: AppBarTheme(color: Colors.amber, elevation: 0),
14 | fontFamily: 'Eczar',
15 | cardTheme: CardTheme(
16 | elevation: 7,
17 | shape: BeveledRectangleBorder(
18 | borderRadius: BorderRadius.circular(20))),
19 | iconTheme: IconThemeData(color: Colors.redAccent, size: 100),
20 | elevatedButtonTheme: ElevatedButtonThemeData(
21 | style: ElevatedButton.styleFrom(
22 | backgroundColor: Colors.indigo, foregroundColor: Colors.amberAccent)),
23 | textTheme: TextTheme(
24 | headline6: MyTextStyles.headline6,
25 | headline5: MyTextStyles.headline5,
26 | )),
27 | home: MyHomePage(),
28 | );
29 | }
30 | }
31 |
32 | /// this is a template to start building a UI
33 | /// to start adding any UI you want change what comes after the [ body: ] tag below
34 | class MyHomePage extends StatelessWidget {
35 | MyHomePage({Key? key}) : super(key: key);
36 |
37 | @override
38 | Widget build(BuildContext context) {
39 | return Scaffold(
40 | appBar: AppBar(),
41 | body: myWidget(context)
42 | );
43 | }
44 |
45 | Widget myWidget(context) {
46 | return Container(
47 | padding: EdgeInsets.all(20),
48 | child: Column(
49 | children: [
50 | Text('Headline1', style: Theme.of(context).textTheme.headline6),
51 | SizedBox(height: 16),
52 | Card(child: SizedBox(height: 200, width: 200),),
53 | SizedBox(height: 16),
54 | Icon(Icons.bookmark,),
55 | SizedBox(height: 26),
56 | ElevatedButton(
57 | onPressed: () {}, child: Text('Press me'.toUpperCase())),
58 | ],
59 | ),
60 | );
61 | }
62 | }
63 |
64 | class MyTextStyles {
65 | static final String eczar = "Eczar";
66 | static final String merriweather = "Merriweather";
67 |
68 | static TextStyle headline6 = TextStyle(
69 | color: Colors.white,
70 | fontFamily: eczar,
71 | fontSize: 20.0,
72 | fontWeight: FontWeight.w900,
73 | );
74 | static TextStyle headline5 = TextStyle(
75 | color: Colors.red,
76 | fontFamily: eczar,
77 | fontSize: 24.0,
78 | fontWeight: FontWeight.w700,
79 | );
80 |
81 | static TextStyle button = TextStyle(
82 | color: Colors.red,
83 | fontFamily: merriweather,
84 | fontSize: 18.0,
85 | fontWeight: FontWeight.w300,
86 | );
87 | }
88 |
--------------------------------------------------------------------------------
/lib/2-MaterilDesing&Themimng/ComponentsBottomNavigation.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 |
3 | void main() => runApp(MyApp());
4 |
5 | class MyApp extends StatelessWidget {
6 | MyApp({Key? key}) : super(key: key);
7 |
8 | @override
9 | Widget build(BuildContext context) {
10 | return MaterialApp(
11 | theme: ThemeData(
12 | colorScheme: ColorScheme.fromSwatch(
13 | primarySwatch: Colors.red,
14 | accentColor: Colors.lightBlue,
15 | )),
16 | home: MyHomePage(),
17 | );
18 | }
19 | }
20 |
21 | class MyHomePage extends StatefulWidget {
22 | @override
23 | State createState() => _MyHomePageState();
24 | }
25 |
26 | class _MyHomePageState extends State {
27 | int currentIndex = 0;
28 |
29 | @override
30 | Widget build(BuildContext context) {
31 | return Scaffold(
32 | appBar: AppBar(
33 | title: const Text('Material Design'),
34 | ),
35 | body: buildBody(),
36 | bottomNavigationBar: buildBottomNavigationBar(),
37 | drawer: buildDrawer(),
38 | );
39 | }
40 |
41 | Drawer buildDrawer() {
42 | return Drawer(
43 | child: ListView(
44 | padding: EdgeInsets.zero,
45 | children: const [
46 | DrawerHeader(
47 | child: FlutterLogo(
48 | style: FlutterLogoStyle.horizontal,
49 | )),
50 | ListTile(
51 | leading: Icon(Icons.home),
52 | title: Text('Home screen'),
53 | ),
54 | Divider(),
55 | ListTile(
56 | leading: Icon(Icons.account_circle),
57 | title: Text('Login Screen'),
58 | ),
59 | Divider(),
60 | ListTile(
61 | leading: Icon(Icons.settings),
62 | title: Text('Settings screen'),
63 | ),
64 | ],
65 | ),
66 | );
67 | }
68 |
69 | BottomNavigationBar buildBottomNavigationBar() {
70 | return BottomNavigationBar(
71 | type: BottomNavigationBarType.shifting,
72 | items: const [
73 | BottomNavigationBarItem(
74 | icon: Icon(Icons.home),
75 | label: 'Home',
76 | backgroundColor: Colors.red,
77 | ),
78 | BottomNavigationBarItem(
79 | icon: Icon(Icons.shopping_cart),
80 | label: 'Business',
81 | backgroundColor: Colors.green,
82 | ),
83 | BottomNavigationBarItem(
84 | icon: Icon(Icons.notifications),
85 | label: 'School',
86 | backgroundColor: Colors.purple,
87 | ),
88 | BottomNavigationBarItem(
89 | icon: Icon(Icons.settings),
90 | label: 'Settings',
91 | backgroundColor: Colors.pink,
92 | ),
93 | ],
94 | currentIndex: currentIndex,
95 | selectedItemColor: Colors.black,
96 | onTap: (indexTapped) {
97 | setState(() {
98 | currentIndex = indexTapped;
99 | });
100 | },
101 | );
102 | }
103 |
104 | Widget buildBody() {
105 | switch (currentIndex) {
106 | case 0:return Center(child: Column(mainAxisAlignment: MainAxisAlignment.center, children: [Icon(Icons.home, size: 200,), Text('screen $currentIndex'),],));
107 | case 1:return Center(child: Column(mainAxisAlignment: MainAxisAlignment.center, children: [Icon(Icons.shopping_cart, size: 200,), Text('screen $currentIndex'),],));
108 | case 2:return Center(child: Column(mainAxisAlignment: MainAxisAlignment.center, children: [Icon(Icons.notifications, size: 200,), Text('screen $currentIndex'),],));
109 | default:return Center(child: Column(mainAxisAlignment: MainAxisAlignment.center, children: [Icon(Icons.settings, size: 200,), Text('screen $currentIndex'),],));
110 |
111 | }
112 | }
113 | }
114 |
--------------------------------------------------------------------------------
/lib/2-MaterilDesing&Themimng/DarkTheme.dart:
--------------------------------------------------------------------------------
1 | import 'package:adaptive_theme/adaptive_theme.dart';
2 | import 'package:flutter/material.dart';
3 |
4 | void main() => runApp(MyApp());
5 |
6 | /// this is your APP Main screen configuration
7 | class MyApp extends StatelessWidget {
8 | MyApp({Key? key}) : super(key: key);
9 |
10 | @override
11 | Widget build(BuildContext context) {
12 | return AdaptiveTheme(
13 | builder: (ThemeData light, ThemeData dark) {
14 | return MaterialApp(
15 | home: MyHomePage(),
16 | theme: light,
17 | darkTheme: dark,
18 | );
19 | },
20 | initial: AdaptiveThemeMode.dark,
21 | dark: ThemeData(
22 | fontFamily: "Eczar",
23 | scaffoldBackgroundColor: Color(0xFF303030),
24 | bottomAppBarTheme: BottomAppBarTheme(color: Colors.black),
25 | appBarTheme: AppBarTheme(backgroundColor: Colors.black),
26 | iconTheme: IconThemeData(color: Colors.amberAccent),
27 | elevatedButtonTheme: ElevatedButtonThemeData(
28 | style: ElevatedButton.styleFrom(backgroundColor: Colors.green))),
29 | light: ThemeData(
30 | fontFamily: "Merriweather",
31 | bottomAppBarTheme: BottomAppBarTheme(color: Colors.blue),
32 | ));
33 | }
34 | }
35 |
36 | class MyHomePage extends StatefulWidget {
37 | MyHomePage({Key? key}) : super(key: key);
38 |
39 | @override
40 | State createState() => _MyHomePageState();
41 | }
42 |
43 | class _MyHomePageState extends State {
44 | @override
45 | Widget build(BuildContext context) {
46 | return Scaffold(
47 | floatingActionButtonLocation: FloatingActionButtonLocation.centerDocked,
48 | floatingActionButton: FloatingActionButton(
49 | onPressed: () {},
50 | child: Icon(
51 | Icons.edit,
52 | color: Colors.amber,
53 | )),
54 | bottomNavigationBar: BottomAppBar(
55 | shape: CircularNotchedRectangle(),
56 | child: SizedBox(height: 56),
57 | ),
58 | appBar: AppBar(
59 | title: const Text('App Title'),
60 | elevation: 4,
61 | ),
62 | body: Center(
63 | child: Column(
64 | mainAxisAlignment: MainAxisAlignment.center,
65 | children: [
66 | Icon(
67 | Icons.refresh,
68 | size: 200,
69 | ),
70 | ElevatedButton(
71 | onPressed: () {
72 | AdaptiveTheme.of(context).toggleThemeMode();
73 | },
74 | child: Text("Toggel Theme"))
75 | ],
76 | ),
77 | ));
78 | }
79 | }
80 |
--------------------------------------------------------------------------------
/lib/2-MaterilDesing&Themimng/TextTheming.dart:
--------------------------------------------------------------------------------
1 |
2 | import 'package:flutter/material.dart';
3 | void main() => runApp(MyApp());
4 |
5 | /// this is your APP Main screen configuration
6 | class MyApp extends StatelessWidget {
7 | MyApp({Key? key}) : super(key: key);
8 |
9 | @override
10 | Widget build(BuildContext context) {
11 | return MaterialApp(
12 | theme: ThemeData(
13 | textTheme: TextTheme(
14 | headline1: MyTextStyles.headline1,
15 | headline2: MyTextStyles.headline2,
16 | headline3: MyTextStyles.headline3,
17 | headline4: MyTextStyles.headline4,
18 | headline5: MyTextStyles.headline5,
19 | headline6: MyTextStyles.headline6,
20 | subtitle1: MyTextStyles.subtitle,
21 | bodyText1: MyTextStyles.body,
22 | button: MyTextStyles.button,
23 | caption: MyTextStyles.caption,
24 | overline: MyTextStyles.button,
25 | )),
26 | home: MyHomePage(),
27 | );
28 | }
29 | }
30 |
31 | /// this is a template to start building a UI
32 | /// to start adding any UI you want change what comes after the [ body: ] tag below
33 | class MyHomePage extends StatelessWidget {
34 | MyHomePage({Key? key}) : super(key: key);
35 |
36 | @override
37 | Widget build(BuildContext context) {
38 | return Scaffold(
39 | appBar: AppBar(),
40 | body: myWidget(context)
41 | );
42 | }
43 |
44 | Widget myWidget(context) {
45 | return Container(
46 | padding: EdgeInsets.all(20),
47 | child: ListView(
48 | children: [
49 | Text('Headline1', style: Theme.of(context).textTheme.headline1),
50 | Text('Headline2', style: Theme.of(context).textTheme.headline2),
51 | Text('Headline3', style: Theme.of(context).textTheme.headline3),
52 | Text('Headline4', style: Theme.of(context).textTheme.headline4),
53 | Text('Headline5', style: Theme.of(context).textTheme.headline5),
54 | Text('Headline6', style: Theme.of(context).textTheme.headline6),
55 | Text('Subtitle', style: Theme.of(context).textTheme.subtitle1),
56 | Text('Body', style: Theme.of(context).textTheme.bodyText2),
57 | TextButton(onPressed: () { }, child: Text('button', style: Theme.of(context).textTheme.button)),
58 | Text('Caption', style: Theme.of(context).textTheme.caption),
59 | Text('Overline', style: Theme.of(context).textTheme.overline),
60 |
61 | ],
62 | ),
63 | );
64 | }
65 | }
66 |
67 | class MyTextStyles {
68 | static final String eczar = "Eczar";
69 | static final String merriweather = "Merriweather";
70 |
71 |
72 | static TextStyle headline1 = TextStyle(
73 | color: Colors.amber,
74 | fontFamily: eczar,
75 | fontSize: 96.0,
76 | fontWeight: FontWeight.w700,
77 | );
78 |
79 |
80 | static TextStyle headline2 = TextStyle(
81 | color: Colors.green,
82 | fontFamily: eczar,
83 | fontSize: 60.0,
84 | fontWeight: FontWeight.w700,
85 | );
86 |
87 | static TextStyle headline3 = TextStyle(
88 | color: Colors.indigo,
89 | fontFamily: eczar,
90 | fontSize: 48.0,
91 | fontWeight: FontWeight.w700,
92 | );
93 |
94 | static TextStyle headline4 = TextStyle(
95 | color: Colors.green,
96 | fontFamily: eczar,
97 | fontSize: 32.0,
98 | fontWeight: FontWeight.w700,
99 | );
100 |
101 | static TextStyle headline5 = TextStyle(
102 | color: Colors.red,
103 | fontFamily: eczar,
104 | fontSize: 24.0,
105 | fontWeight: FontWeight.w700,
106 | );
107 |
108 |
109 | static TextStyle headline6 = TextStyle(
110 | color: Colors.pink,
111 | fontFamily: merriweather,
112 | fontSize: 20.0,
113 | fontWeight: FontWeight.w900,
114 | );
115 |
116 |
117 | static TextStyle subtitle = TextStyle(
118 | fontFamily: merriweather,
119 | fontSize: 16.0,
120 | fontWeight: FontWeight.w300,
121 | );
122 |
123 | static TextStyle body = TextStyle(
124 | fontFamily: merriweather,
125 | fontSize: 14.0,
126 | fontWeight: FontWeight.w300,
127 | );
128 |
129 |
130 | static TextStyle button = TextStyle(
131 | color: Colors.blueAccent,
132 | fontFamily: merriweather,
133 | fontSize: 12.0,
134 | fontWeight: FontWeight.w300,
135 | );
136 |
137 |
138 | static TextStyle caption = TextStyle(
139 | color: Colors.deepPurpleAccent,
140 | fontFamily: merriweather,
141 | fontSize: 12.0,
142 | fontWeight: FontWeight.w300,
143 | );
144 |
145 | static TextStyle overline = TextStyle(
146 | color: Colors.teal,
147 | fontFamily: merriweather,
148 | fontSize: 10.0,
149 | fontWeight: FontWeight.w300,
150 | );
151 |
152 |
153 |
154 |
155 |
156 | }
157 |
--------------------------------------------------------------------------------
/lib/3-Asynchronous Networking Programming/1-UserApi.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 | import 'package:http/http.dart' as http;
3 |
4 | import 'User.dart';
5 |
6 | void main() => runApp(MyApp());
7 |
8 | class MyApp extends StatelessWidget {
9 | MyApp({Key? key}) : super(key: key);
10 |
11 | @override
12 | Widget build(BuildContext context) {
13 | return MaterialApp(
14 | home: MyHomePage(),
15 | );
16 | }
17 | }
18 |
19 | class MyHomePage extends StatelessWidget {
20 | MyHomePage({Key? key}) : super(key: key);
21 |
22 | @override
23 | Widget build(BuildContext context) {
24 | return Scaffold(
25 | appBar: AppBar(
26 | title: const Text('App Title'),
27 | backgroundColor: Colors.teal,
28 | elevation: 4,
29 | ),
30 | body: Column(
31 | children: [
32 | ElevatedButton(onPressed: getUserApi, child: Text("Get Users"))
33 | ],
34 | ));
35 | }
36 |
37 | void getUserApi() async {
38 | var response =
39 | await http.get(Uri.parse('https://gorest.co.in/public/v2/users'));
40 | print(response.body);
41 | }
42 | }
43 |
44 |
45 |
46 |
47 |
48 |
--------------------------------------------------------------------------------
/lib/3-Asynchronous Networking Programming/2-UserListScreen.dart:
--------------------------------------------------------------------------------
1 | import 'dart:convert';
2 | import 'dart:math';
3 |
4 | import 'package:courses_codes/3-Asynchronous%20Networking%20Programming/4-AddUserScreen.dart';
5 | import 'package:flutter/material.dart';
6 | import 'package:http/http.dart' as http;
7 |
8 |
9 |
10 | void main() => runApp(MyApp());
11 |
12 | class MyApp extends StatelessWidget {
13 | MyApp({Key? key}) : super(key: key);
14 |
15 | @override
16 | Widget build(BuildContext context) {
17 | return MaterialApp(
18 | home: MyHomePage(),
19 | );
20 | }
21 | }
22 |
23 | class MyHomePage extends StatefulWidget {
24 | MyHomePage({Key? key}) : super(key: key);
25 |
26 | @override
27 | State createState() => _MyHomePageState();
28 | }
29 |
30 | class _MyHomePageState extends State {
31 | bool isHorizental = false;
32 |
33 | @override
34 | Widget build(BuildContext context) {
35 | return Scaffold(
36 | floatingActionButton: FloatingActionButton(
37 | onPressed: () {
38 | Navigator.push(context, AddUserScreen.getRoute(context));
39 | },
40 | child: Icon(Icons.person_add),
41 | ),
42 | appBar: AppBar(
43 | title: const Text('App Title'),
44 | backgroundColor: Colors.teal,
45 | elevation: 4,
46 | ),
47 | body: Center(
48 | child: FutureBuilder(
49 | future: getUserApi(),
50 | builder: (context, snapshot) {
51 | // on error
52 | if (snapshot.hasError) return Text("Error retriving Users");
53 |
54 | // on success
55 | if (snapshot.connectionState == ConnectionState.done) {
56 | List userList = snapshot.data as List;
57 | return buildUserList(userList);
58 | }
59 | // on waiting
60 | return Center(child: CircularProgressIndicator());
61 | },
62 | ),
63 | ),
64 | );
65 | }
66 |
67 | void changeLogoStyle() async {
68 | String value = await getFuture(null).onError((error, stackTrace) {
69 | print(error);
70 | return "Sorry Error Happend";
71 | });
72 |
73 | ScaffoldMessenger.of(context)
74 | .showSnackBar(SnackBar(content: Text("$value")));
75 | setState(() {
76 | isHorizental = !isHorizental;
77 | });
78 | }
79 |
80 | Future getFuture(value) async {
81 | await Future.delayed(Duration(seconds: 2));
82 | if (value == null) throw Exception();
83 | return Future.value("I'm data retured from future is $value");
84 | }
85 |
86 | Future> getUserApi() async {
87 | await Future.delayed(Duration(seconds: 1));
88 | print("Connecting to Internet");
89 | http.Response response =
90 | await http.get(Uri.parse("https://gorest.co.in/public/v2/users"));
91 |
92 | final jsonArray = json.decode(response.body) as List;
93 |
94 | List userList = [];
95 | jsonArray.forEach((json) {
96 | User user = User.fromJson(json);
97 | userList.add(user);
98 | });
99 |
100 | return userList;
101 | }
102 |
103 | buildUserList(List userList) {
104 | return ListView.builder(
105 | itemCount: userList.length,
106 | itemBuilder: (context, index) => Column(
107 | children: [
108 | ListTile(
109 | title: Text(userList[index].name!,style: TextStyle(fontFamily: "Eczar"),),
110 | trailing: userList[index].status == "active"
111 | ? Icon(
112 | Icons.check,
113 | color: Colors.green,
114 | )
115 | : Icon(
116 | Icons.close,
117 | color: Colors.redAccent,
118 | ),
119 | subtitle: Text(userList[index].email!),
120 | leading: userList[index].gender == "male"
121 | ? Icon(
122 | Icons.male,
123 | color: Colors.indigo,
124 | )
125 | : Icon(
126 | Icons.female,
127 | color: Colors.pink,
128 | )),
129 | Divider()
130 | ],
131 | ));
132 | }
133 | }
134 |
135 | class User {
136 | int? id;
137 | String? name;
138 | String? email;
139 | String? gender;
140 | String? status;
141 |
142 | User();
143 |
144 | User.fromJson(Map json) {
145 | name = json["name"];
146 | email = json["email"];
147 | gender = json["gender"];
148 | status = json["status"];
149 | id = json["id"];
150 | }
151 | }
152 |
--------------------------------------------------------------------------------
/lib/3-Asynchronous Networking Programming/4-AddUserScreen.dart:
--------------------------------------------------------------------------------
1 | import 'dart:convert';
2 |
3 | import 'package:flutter/material.dart';
4 | import 'package:http/http.dart' as http;
5 |
6 | import 'User.dart';
7 |
8 | class AddUserScreen extends StatefulWidget {
9 | /// make the screen introduce it self
10 | static getRoute(BuildContext context) {
11 | return PageRouteBuilder(
12 | transitionsBuilder: (_, animation, secondAnimation, child) {
13 | /// add your animation here
14 | return FadeTransition(
15 | opacity: animation,
16 | child: RotationTransition(
17 | turns: Tween(begin: 0.5, end: 1.0).animate(animation),
18 | child: child,
19 | ),
20 | );
21 | }, pageBuilder: (_, __, ___) {
22 | return new AddUserScreen();
23 | });
24 |
25 | // you can add this line as a child to FadeTransition to add multiple animation
26 | // RotationTransition(
27 | // turns: Tween(begin: 0.5, end: 1.0).animate(animation),
28 | // child: child,
29 | // )
30 | }
31 |
32 | const AddUserScreen({Key? key}) : super(key: key);
33 |
34 | @override
35 | _AddUserScreenState createState() => _AddUserScreenState();
36 | }
37 |
38 | class _AddUserScreenState extends State {
39 | TextEditingController nameController = TextEditingController();
40 | TextEditingController emailController =
41 | TextEditingController(text: "@gmail.com");
42 | TextEditingController genderController = TextEditingController(text: "male");
43 |
44 | @override
45 | Widget build(BuildContext context) {
46 | return Scaffold(
47 | appBar: AppBar(
48 | title: Text('Add new user'),
49 | ),
50 | body: Padding(
51 | padding: const EdgeInsets.all(16.0),
52 | child: Column(
53 | children: [
54 | TextField(
55 | controller: nameController,
56 | decoration: const InputDecoration(
57 | icon: Icon(Icons.person),
58 | filled: true,
59 | hintText: 'Enter your Name',
60 | labelText: 'Name ',
61 | ),
62 | ),
63 | SizedBox(
64 | height: 16,
65 | ),
66 | TextField(
67 | controller: emailController,
68 | decoration: const InputDecoration(
69 | icon: Icon(Icons.email),
70 | filled: true,
71 | hintText: 'Enter your Email',
72 | labelText: 'Email ',
73 | ),
74 | ),
75 | SizedBox(
76 | height: 16,
77 | ),
78 | TextField(
79 | controller: genderController,
80 | decoration: const InputDecoration(
81 | icon: Icon(Icons.group),
82 | filled: true,
83 | hintText: 'Enter your Gender',
84 | labelText: 'Gender ',
85 | ),
86 | ),
87 | SizedBox(
88 | height: 16,
89 | ),
90 | Align(
91 | alignment: Alignment.bottomRight,
92 | child: ElevatedButton(
93 | onPressed: () {
94 | // postUser(name: name, gender: gender, email: email);
95 | },
96 | child: Text("Add User".toUpperCase()),
97 | ),
98 | )
99 | ],
100 | ),
101 | ),
102 | );
103 | }
104 |
105 | void postUser({required String name,
106 | required String gender,
107 | required String email}) async {
108 | var response = await http.post(
109 | Uri.parse(
110 | "https://gorest.co.in/public/v2/users",
111 | ),
112 | headers: {
113 | "Authorization":
114 | "Bearer ed0645c09baf75ccb7b21afc0af41ab01f0770fd90e831d5295fab6c77d96965",
115 | "Content-Type": "application/json",
116 | },
117 | body: jsonEncode({
118 | "name": "$name",
119 | "gender": "$gender",
120 | "email": "$email",
121 | "status": "active",
122 | }));
123 |
124 | print(response.body);
125 | if (response.statusCode == 201) {
126 | ScaffoldMessenger.of(context)
127 | .showSnackBar(SnackBar(content: Text('User Added')));
128 | } else
129 | ScaffoldMessenger.of(context)
130 | .showSnackBar(SnackBar(content: Text('Error ${response.body}')));
131 | }
132 | }
133 |
--------------------------------------------------------------------------------
/lib/3-Asynchronous Networking Programming/User.dart:
--------------------------------------------------------------------------------
1 | class User {
2 | late int id;
3 | late String name;
4 | late String email;
5 | late String status;
6 | late String gender;
7 |
8 |
9 | User.fromJson(Map json) {
10 | id = json['id'];
11 | name = json['name'];
12 | email = json['email'];
13 | status = json['status'];
14 | gender = json['gender'];
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/lib/3-Asynchronous Networking Programming/UserScreens/AddUserScreen.dart:
--------------------------------------------------------------------------------
1 | import 'dart:convert';
2 |
3 | import 'package:flutter/cupertino.dart';
4 | import 'package:flutter/material.dart';
5 | import 'package:http/http.dart' as http;
6 | import 'package:http/http.dart';
7 |
8 | class AddUserScreenT extends StatefulWidget {
9 | static getRoutes() {
10 | return PageRouteBuilder(pageBuilder: (_, __, ___) => AddUserScreenT());
11 | }
12 |
13 | @override
14 | State createState() => _AddUserScreenTState();
15 | }
16 |
17 | class _AddUserScreenTState extends State {
18 | bool isLoading = false;
19 |
20 | TextEditingController genderController = TextEditingController(text: "male");
21 |
22 | TextEditingController emailController = TextEditingController();
23 |
24 | TextEditingController nameController = TextEditingController();
25 |
26 | @override
27 | Widget build(BuildContext context) {
28 | return Scaffold(
29 | appBar: AppBar(
30 | title: Text("Add user screen"),
31 | ),
32 | body: Padding(
33 | padding: const EdgeInsets.all(16.0),
34 | child: Column(
35 | children: [
36 | TextField(
37 | controller: nameController,
38 | decoration: const InputDecoration(
39 | icon: Icon(Icons.person),
40 | filled: true,
41 | hintText: 'Enter your Name',
42 | labelText: 'Name ',
43 | ),
44 | ),
45 | SizedBox(
46 | height: 16,
47 | ),
48 | TextField(
49 | controller: emailController,
50 | decoration: InputDecoration(
51 | icon: Icon(Icons.email),
52 | filled: true,
53 | hintText: "Enter your email",
54 | label: Text("Email"),
55 | ),
56 | ),
57 | SizedBox(
58 | height: 16,
59 | ),
60 | TextField(
61 | controller: genderController,
62 | decoration: InputDecoration(
63 | icon: Icon(Icons.group),
64 | filled: true,
65 | hintText: "Enter your Gender",
66 | label: Text("Gender"),
67 | ),
68 | ),
69 | SizedBox(
70 | height: 16,
71 | ),
72 | if (!isLoading)
73 | Align(
74 | alignment: Alignment.topRight,
75 | child: ElevatedButton(
76 | onPressed: () {
77 | addUser(
78 | name: nameController.text,
79 | email: emailController.text,
80 | gender: genderController.text,
81 | context: context);
82 | },
83 | child: Text("add user".toUpperCase())),
84 | ),
85 | if (isLoading)
86 | Align(
87 | alignment: Alignment.topRight,
88 | child: CircularProgressIndicator(),
89 | )
90 | ],
91 | ),
92 | ),
93 | );
94 | }
95 |
96 | void addUser(
97 | {required context,
98 | required String name,
99 | required String email,
100 | String gender = "male"}) async {
101 |
102 | setState(() {
103 | isLoading = true;
104 | });
105 |
106 | await Future.delayed(Duration(seconds: 3),(){});
107 | String url = "https://gorest.co.in/public/v2/users";
108 | print("Connecting to $url");
109 | String accessToken =
110 | "ed0645c09baf75ccb7b21afc0af41ab01f0770fd90e831d5295fab6c77d96965";
111 |
112 | Response response = await http.post(Uri.parse(url),
113 | headers: {
114 | "Authorization": "Bearer $accessToken",
115 | "Content-Type": "application/json"
116 | },
117 | body: jsonEncode({
118 | "name": "$name",
119 | "email": "$email",
120 | "gender": "$gender",
121 | "status": "active"
122 | }));
123 |
124 | print(response.body);
125 |
126 | if (response.statusCode == 201) {
127 | ScaffoldMessenger.of(context).showSnackBar(SnackBar(
128 | content: Text("User Added Successfully"),
129 | action: SnackBarAction(
130 | textColor: Colors.amber,
131 | label: "OK",
132 | onPressed: () {},
133 | ),
134 | ));
135 | } else {
136 | ScaffoldMessenger.of(context).showSnackBar(SnackBar(
137 | content: Text("Error happened while adding user"),
138 | action: SnackBarAction(
139 | textColor: Colors.redAccent,
140 | label: "OK",
141 | onPressed: () {},
142 | ),
143 | ));
144 | }
145 |
146 | setState(() {
147 | isLoading = false;
148 | });
149 | }
150 |
151 |
152 | }
153 |
--------------------------------------------------------------------------------
/lib/5-StateManagment/BlocStateManagment/UI/UserUIScreen.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 | import 'package:flutter_bloc/flutter_bloc.dart';
3 | import '../bloc/user_events.dart';
4 | import '../bloc/user_state.dart';
5 | import '../bloc/user_bloc.dart';
6 | import '../data/UserProvider.dart';
7 |
8 | class MyBlocPage extends StatefulWidget {
9 | MyBlocPage({Key? key}) : super(key: key);
10 |
11 | @override
12 | State createState() => _MyBlocPageState();
13 | }
14 |
15 | class _MyBlocPageState extends State {
16 | bool change = true;
17 | List users = [];
18 |
19 | @override
20 | Widget build(BuildContext context) {
21 | return Scaffold(
22 | appBar: AppBar(
23 | title: Text("Users List"),
24 | ),
25 | floatingActionButton: FloatingActionButton(
26 | onPressed: () {},
27 | child: Icon(Icons.person_add),
28 | ),
29 | body: buildBloc(),
30 | );
31 | }
32 |
33 | /** --------------- Focus Here ----------------------- **/
34 | Widget buildBloc() {
35 | return BlocBuilder(builder: (context, state) {
36 | if (state is SuccessCreatedUser) {
37 | return Center(child: Text("Success Creating User"));
38 | }
39 | if (state is FailureState) {
40 | return Text("Errrrror!!!!",
41 | style: TextStyle(color: Colors.red, fontSize: 40));
42 | }
43 | // Loading
44 | if (state is LoadingState)
45 | return Center(child: CircularProgressIndicator());
46 |
47 | // Succuess
48 | if (state is SuccessUserList) {
49 | List userList = state.userList;
50 | return buildUserList(userList, state.userDivder);
51 | }
52 |
53 | // Inital
54 | return Center(
55 | child: Column(
56 | mainAxisAlignment: MainAxisAlignment.spaceEvenly,
57 | children: [
58 | ElevatedButton(
59 | onPressed: () {
60 | context.read().add(GetUserEvent());
61 | },
62 | child: Text("Get User List")),
63 | ElevatedButton(
64 | onPressed: () {
65 | context.read().add(AddUserEvent(
66 | email: "m.mfdfddfdmm@gmail.com",
67 | gender: "Male",
68 | name: "Ali m f Rozaria"));
69 | },
70 | child: Text("Add a User"))
71 | ],
72 | ));
73 | });
74 | }
75 | /**
76 | --------------- Focus Here -----------------------
77 | **/
78 |
79 | Widget buildUserList(List users, bool useDivider) {
80 | return ListView.builder(
81 | itemCount: users.length,
82 | itemBuilder: (BuildContext context, int index) {
83 | return Column(
84 | children: [
85 | ListTile(
86 | leading: Icon(Icons.person),
87 | title: Text("${users[index].name}"),
88 | subtitle: Text("${users[index].email}"),
89 | ),
90 | if (useDivider) Divider()
91 | ],
92 | );
93 | });
94 | }
95 | }
96 |
--------------------------------------------------------------------------------
/lib/5-StateManagment/BlocStateManagment/bloc/user_bloc.dart:
--------------------------------------------------------------------------------
1 | import 'dart:async';
2 | import 'dart:math';
3 |
4 | import '../data/UserProvider.dart';
5 |
6 | import '../bloc/user_events.dart';
7 | import '../bloc/user_state.dart';
8 | import 'package:flutter_bloc/flutter_bloc.dart';
9 |
10 | class UsersBloc extends Bloc {
11 | UsersBloc() : super(InitialState()) {
12 | on(_getUserList);
13 | on(_addUser);
14 | }
15 |
16 | FutureOr _getUserList(
17 | GetUserEvent event, Emitter emit) async {
18 | emit(LoadingState());
19 | try {
20 | List user = await ApiProvider().getUsers();
21 | emit(SuccessUserList(user, false));
22 | } catch (error) {
23 | print(error);
24 | emit(FailureState());
25 | }
26 | }
27 |
28 | FutureOr _addUser(AddUserEvent event, Emitter emit) async {
29 | emit(LoadingState());
30 | try {
31 | bool isCreated = await ApiProvider()
32 | .postUser(name: event.name, gender: event.gender, email: event.email);
33 | if (isCreated)
34 | emit(SuccessCreatedUser());
35 | else
36 | emit(FailureState());
37 | } catch (error) {
38 | print(error);
39 | emit(FailureState());
40 | }
41 | }
42 | }
43 |
--------------------------------------------------------------------------------
/lib/5-StateManagment/BlocStateManagment/bloc/user_events.dart:
--------------------------------------------------------------------------------
1 | abstract class UserEvent {}
2 |
3 | class GetUserEvent extends UserEvent {}
4 |
5 | class AddUserEvent extends UserEvent {
6 | String name, email, gender;
7 | AddUserEvent({required this.email,required this.gender,required this.name});
8 | }
9 |
--------------------------------------------------------------------------------
/lib/5-StateManagment/BlocStateManagment/bloc/user_state.dart:
--------------------------------------------------------------------------------
1 | import '../data/UserProvider.dart';
2 |
3 | abstract class UserState {}
4 |
5 | class InitialState extends UserState {}
6 |
7 | class SuccessUserList extends UserState {
8 | List userList;
9 | bool userDivder;
10 | SuccessUserList(this.userList, this.userDivder);
11 | }
12 |
13 | class SuccessCreatedUser extends UserState{}
14 |
15 | class LoadingState extends UserState {}
16 |
17 | class FailureState extends UserState {}
18 |
--------------------------------------------------------------------------------
/lib/5-StateManagment/BlocStateManagment/data/UserProvider.dart:
--------------------------------------------------------------------------------
1 | import 'dart:convert';
2 | import 'package:http/http.dart' as http;
3 | import 'package:http/http.dart';
4 |
5 | class ApiProvider {
6 | Future> getUsers() async {
7 | await Future.delayed(Duration(seconds: 2));
8 | print("getting User List.....");
9 | List usersList = [];
10 | print("connect to internet");
11 | Response response =
12 | await http.get(Uri.parse('https://gorest.co.in/public/v2/users'));
13 | if (response.statusCode == 200) {
14 | final body = json.decode(response.body) as List;
15 | body.forEach((json) {
16 | print(json);
17 | usersList.add(User.fromJson(json));
18 | });
19 | return usersList;
20 | }
21 | return [];
22 | }
23 |
24 | Future postUser(
25 | {required String name,
26 | required String gender,
27 | required String email}) async {
28 | print("Creating User .....");
29 | var response = await http.post(
30 | Uri.parse(
31 | "https://gorest.co.in/public/v2/users",
32 | ),
33 | headers: {
34 | "Authorization":
35 | "Bearer ed0645c09baf75ccb7b21afc0af41ab01f0770fd90e831d5295fab6c77d96965",
36 | "Content-Type": "application/json",
37 | },
38 | body: jsonEncode({
39 | "name": "$name",
40 | "gender": "$gender",
41 | "email": "$email",
42 | "status": "active",
43 | }));
44 |
45 | print(response.body);
46 | if (response.statusCode == 201) {
47 | return true;
48 | } else
49 | return false;
50 | }
51 | }
52 |
53 | class User {
54 | late int id;
55 | late String name;
56 | late String email;
57 | late String status;
58 | late String gender;
59 |
60 | User.fromJson(Map json) {
61 | id = json['id'];
62 | name = json['name'];
63 | email = json['email'];
64 | status = json['status'];
65 | gender = json['gender'];
66 | }
67 | }
68 |
--------------------------------------------------------------------------------
/lib/5-StateManagment/BlocStateManagment/main.dart:
--------------------------------------------------------------------------------
1 | import 'package:courses_codes/5-StateManagment/BlocStateManagment/UI/UserUIScreen.dart';
2 | import 'package:courses_codes/5-StateManagment/BlocStateManagment/bloc/user_bloc.dart';
3 | import 'package:flutter/material.dart';
4 | import 'package:flutter_bloc/flutter_bloc.dart';
5 | import 'package:provider/provider.dart';
6 |
7 | void main() {
8 | runApp(const MyApp());
9 | }
10 |
11 | class MyApp extends StatelessWidget {
12 | const MyApp({Key? key}) : super(key: key);
13 |
14 | // This widget is the root of your application.
15 | @override
16 | Widget build(BuildContext context) {
17 | return MaterialApp(
18 | home: BlocProvider(
19 | create: (BuildContext context) => UsersBloc(), child: MyBlocPage()),
20 | );
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/lib/5-StateManagment/ProviderStateManagment/UI/UserListScreen.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 | import 'package:provider/provider.dart';
3 | import '../provider/UserProvider.dart';
4 | import '../data/UserApi.dart';
5 |
6 | class MyProviderPage extends StatefulWidget {
7 | MyProviderPage({Key? key}) : super(key: key);
8 |
9 | @override
10 | State createState() => _MyProviderPageState();
11 | }
12 |
13 | class _MyProviderPageState extends State {
14 | bool change = true;
15 | List users = [];
16 | late UserProvider provider;
17 |
18 | @override
19 | Widget build(BuildContext context) {
20 | provider = context.watch();
21 | users = provider.userList;
22 | return Scaffold(
23 | body: buildProvider(context),
24 | );
25 | }
26 |
27 | /** --------------- Focus Here ----------------------- **/
28 | Widget buildProvider(context) {
29 | return users.isEmpty ? buildButton() : buildUserList(users);
30 | }
31 | /**
32 | --------------- Focus Here -----------------------
33 | **/
34 |
35 | Widget buildUserList(List users) {
36 | return ListView.builder(
37 | itemCount: users.length,
38 | itemBuilder: (BuildContext context, int index) {
39 | return ListTile(
40 | leading: Icon(Icons.person),
41 | title: Text("${users[index].name}"),
42 | subtitle: Text("${users[index].email}"),
43 | trailing: IconButton(
44 | icon: Icon(Icons.delete,color: Colors.red,),
45 | onPressed: () {
46 | provider.removeUser(users[index]);
47 | },
48 | ),
49 | );
50 | });
51 | }
52 |
53 | buildButton() {
54 | return Center(
55 | child: ElevatedButton(
56 | onPressed: () {
57 | provider.getUsers();
58 | },
59 | child: Text("Get User Api")),
60 | );
61 | }
62 | }
63 |
--------------------------------------------------------------------------------
/lib/5-StateManagment/ProviderStateManagment/data/UserApi.dart:
--------------------------------------------------------------------------------
1 | import 'dart:convert';
2 | import 'package:http/http.dart' as http;
3 | import 'package:http/http.dart';
4 |
5 | class UserApis {
6 | Future> getUsers() async {
7 | print("getting User List.....");
8 | List usersList = [];
9 | print("connect to internet");
10 | Response response =
11 | await http.get(Uri.parse('https://gorest.co.in/public/v2/users'));
12 | if (response.statusCode == 200) {
13 | final body = json.decode(response.body) as List;
14 | body.forEach((json) {
15 | print(json);
16 | usersList.add(User.fromJson(json));
17 | });
18 | return usersList;
19 | }
20 | return [];
21 | }
22 | }
23 |
24 | class User {
25 | late int id;
26 | late String name;
27 | late String email;
28 | late String status;
29 | late String gender;
30 |
31 | User.fromJson(Map json) {
32 | id = json['id'];
33 | name = json['name'];
34 | email = json['email'];
35 | status = json['status'];
36 | gender = json['gender'];
37 | }
38 | }
39 |
--------------------------------------------------------------------------------
/lib/5-StateManagment/ProviderStateManagment/main.dart:
--------------------------------------------------------------------------------
1 | import 'package:courses_codes/5-StateManagment/ProviderStateManagment/UI/UserListScreen.dart';
2 | import 'package:courses_codes/5-StateManagment/ProviderStateManagment/provider/UserProvider.dart';
3 | import 'package:flutter/material.dart';
4 | import 'package:provider/provider.dart';
5 |
6 |
7 | void main() {
8 | runApp(const MyApp());
9 | }
10 |
11 | class MyApp extends StatelessWidget {
12 | const MyApp({Key? key}) : super(key: key);
13 |
14 | // This widget is the root of your application.
15 | @override
16 | Widget build(BuildContext context) {
17 | return MaterialApp(
18 | home: ChangeNotifierProvider(
19 | create: (BuildContext context) => UserProvider(),
20 | child: MyHomePage()),
21 | );
22 | }
23 | }
24 |
25 | class MyHomePage extends StatelessWidget {
26 | @override
27 | Widget build(BuildContext context) {
28 | return Scaffold(
29 | appBar: AppBar(
30 | title: Text("Provider"),
31 | leading: Consumer(builder: (context, provider, child) {
32 | return Center(
33 | child: Text(
34 | "Users: ${provider.userList.length}",
35 | ));
36 | }),
37 | ),
38 | body: MyProviderPage(),
39 | );
40 | }
41 | }
42 |
--------------------------------------------------------------------------------
/lib/5-StateManagment/ProviderStateManagment/provider/UserProvider.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 | import '../data/UserApi.dart';
3 |
4 | class UserProvider extends ChangeNotifier {
5 | List userList = [];
6 |
7 | getUsers() async {
8 | userList = await UserApis().getUsers();
9 | notifyListeners();
10 | }
11 |
12 | removeUser(user) {
13 | userList.remove(user);
14 | notifyListeners();
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/lib/6-FlutterAndAI/CV/BarcodeScreen.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 | import 'package:google_ml_kit/google_ml_kit.dart';
3 | import 'package:google_mlkit_barcode_scanning/google_mlkit_barcode_scanning.dart';
4 | import 'package:image_picker/image_picker.dart';
5 | import 'dart:io';
6 | import 'dart:ui' as ui;
7 |
8 | class BarcodeScannerView extends StatefulWidget {
9 | @override
10 | _BarcodeScannerViewState createState() => _BarcodeScannerViewState();
11 | }
12 |
13 | class _BarcodeScannerViewState extends State {
14 | bool isLoading = false;
15 | final picker = ImagePicker();
16 | List barcodes = [];
17 | late ui.Image _image;
18 | File? _imageFile;
19 | XFile? imageFile;
20 |
21 | final BarcodeScanner _barcodeScanner = BarcodeScanner();
22 |
23 | @override
24 | Widget build(BuildContext context) {
25 | return Scaffold(
26 | appBar: AppBar(
27 | title: const Text('Barcode Scanner'),
28 | ),
29 | floatingActionButton: FloatingActionButton(
30 | onPressed: _getImageFromGallery,
31 | tooltip: 'Get Image',
32 | child: const Icon(Icons.add_a_photo),
33 | ),
34 | body: isLoading
35 | ? const Center(child: CircularProgressIndicator())
36 | : (_imageFile == null)
37 | ? buildEmptyView()
38 | : BuildAIView(),
39 | );
40 | }
41 |
42 | /// Build UI
43 | Widget buildEmptyView() {
44 | return InkWell(
45 | onTap: _getImageFromGallery,
46 | child: Center(
47 | child: Column(
48 | mainAxisAlignment: MainAxisAlignment.center,
49 | children: [
50 | CircleAvatar(
51 | radius: 150,
52 | child: Icon(
53 | Icons.add_a_photo,
54 | size: 150,
55 | ),
56 | ),
57 | SizedBox(
58 | height: 16,
59 | ),
60 | Text("Click here to add an Image")
61 | ],
62 | )),
63 | );
64 | }
65 |
66 | Column BuildAIView() {
67 | return Column(
68 | children: [
69 | Center(
70 | child: FittedBox(
71 | child: SizedBox(
72 | width: _image.width.toDouble(),
73 | height: _image.height.toDouble(),
74 | child: Image.file(_imageFile!)),
75 | ),
76 | ),
77 | if (barcodes.isNotEmpty)
78 | Expanded(
79 | child: ListView.separated(
80 | itemCount: barcodes.length,
81 | itemBuilder: (context, index) => ListTile(
82 | title: Text("${barcodes[index].displayValue}"),
83 | subtitle: Text("${barcodes[index].type.name}"),
84 | leading: Icon(
85 | Icons.qr_code_rounded,
86 | color: Colors.blueAccent,
87 | ),
88 | ),
89 | separatorBuilder: (BuildContext context, int index) => Divider(),
90 | ),
91 | )
92 | ],
93 | );
94 | }
95 |
96 | ///---------- Focus Here ---------------///
97 | Future processImage(InputImage inputImage) async {
98 | setState(() {
99 | isLoading = true;
100 | });
101 | barcodes = await _barcodeScanner.processImage(inputImage);
102 | if (barcodes.isEmpty) {
103 | ScaffoldMessenger.of(context).showSnackBar(
104 | SnackBar(content: Text('Nothing is detected, try again!')));
105 | return;
106 | }
107 |
108 | setState(() {});
109 | }
110 |
111 | ///---------- Focus Here ---------------///
112 |
113 | _getImageFromGallery() async {
114 | imageFile = await picker.pickImage(source: ImageSource.gallery);
115 | setState(() {
116 | isLoading = true;
117 | });
118 |
119 | if (mounted) {
120 | if (imageFile != null) {
121 | setState(() {
122 | _imageFile = File(imageFile!.path);
123 | _loadImage(File(imageFile!.path));
124 | processImage(InputImage.fromFile(_imageFile!));
125 | });
126 | }
127 | }
128 | }
129 |
130 | _loadImage(File file) async {
131 | final data = await file.readAsBytes();
132 | await decodeImageFromList(data).then((value) => setState(() {
133 | _image = value;
134 | isLoading = false;
135 | }));
136 | }
137 |
138 | @override
139 | void dispose() {
140 | _barcodeScanner.close();
141 | super.dispose();
142 | }
143 | }
144 |
--------------------------------------------------------------------------------
/lib/6-FlutterAndAI/CV/ImageLabellingScreen.dart:
--------------------------------------------------------------------------------
1 | import 'dart:io';
2 |
3 | import 'package:flutter/material.dart';
4 | import 'package:google_ml_kit/google_ml_kit.dart';
5 | import 'package:google_mlkit_barcode_scanning/google_mlkit_barcode_scanning.dart';
6 | import 'package:image_picker/image_picker.dart';
7 | import 'dart:ui' as ui;
8 |
9 | class ImageLabelPage extends StatefulWidget {
10 | const ImageLabelPage({Key? key}) : super(key: key);
11 |
12 | @override
13 | ImageLabelPageState createState() => ImageLabelPageState();
14 | }
15 |
16 | class ImageLabelPageState extends State {
17 | bool isLoading = false;
18 | final picker = ImagePicker();
19 | late ui.Image _image;
20 | File? _imageFile;
21 | XFile? imageFile;
22 |
23 | List _labels = [];
24 | final ImageLabeler _imageLabeler =
25 | ImageLabeler(options: ImageLabelerOptions());
26 |
27 | @override
28 | Widget build(BuildContext context) {
29 | return Scaffold(
30 | appBar: AppBar(
31 | title: const Text('Image Lableing'),
32 | ),
33 | floatingActionButton: FloatingActionButton(
34 | onPressed: _getImageFromGallery,
35 | tooltip: 'Get Image',
36 | child: const Icon(Icons.add_a_photo),
37 | ),
38 | body: isLoading
39 | ? const Center(child: CircularProgressIndicator())
40 | : (_imageFile == null)
41 | ? buildEmptyView()
42 | : BuildAIView(),
43 | );
44 | }
45 |
46 | Widget buildEmptyView() {
47 | return InkWell(
48 | onTap: _getImageFromGallery,
49 | child: Center(
50 | child: Column(
51 | mainAxisAlignment: MainAxisAlignment.center,
52 | children: [
53 | CircleAvatar(
54 | radius: 150,
55 | child: Icon(
56 | Icons.add_a_photo,
57 | size: 150,
58 | ),
59 | ),
60 | SizedBox(
61 | height: 16,
62 | ),
63 | Text("Click here to add an Image")
64 | ],
65 | )),
66 | );
67 | }
68 |
69 | Column BuildAIView() {
70 | return Column(
71 | children: [
72 | FittedBox(
73 | child: SizedBox(
74 | width: _image.width.toDouble(),
75 | height: _image.height.toDouble(),
76 | child: Image.file(_imageFile!)),
77 | ),
78 | Divider(thickness: 5),
79 | Text(
80 | 'Labels Extracted',
81 | style: TextStyle(fontSize: 18),
82 | ),
83 | if (_labels.isNotEmpty)
84 | Expanded(
85 | child: ListView.separated(
86 | itemCount: _labels.length,
87 | itemBuilder: (BuildContext context, int index) {
88 | return ListTile(
89 | title: Text(_labels[index].label),
90 | subtitle: Text(
91 | 'Confidence ${_labels[index].confidence.toStringAsFixed(2)}'),
92 | );
93 | },
94 | separatorBuilder: (BuildContext context, int index) => Divider(),
95 | ),
96 | ),
97 | ],
98 | );
99 | }
100 |
101 | _getImageFromGallery() async {
102 | imageFile = await picker.pickImage(source: ImageSource.gallery);
103 | setState(() {
104 | isLoading = true;
105 | });
106 |
107 | if (mounted) {
108 | if (imageFile != null) {
109 | setState(() {
110 | _imageFile = File(imageFile!.path);
111 | processImage(InputImage.fromFile(_imageFile!));
112 | _loadImage(File(imageFile!.path));
113 | });
114 | }
115 | }
116 | }
117 |
118 | _loadImage(File file) async {
119 | final data = await file.readAsBytes();
120 | await decodeImageFromList(data).then((value) => setState(() {
121 | _image = value;
122 | isLoading = false;
123 | }));
124 | }
125 |
126 | ///---------- Focus Here ---------------///
127 | Future processImage(InputImage inputImage) async {
128 | setState(() {
129 | isLoading = true;
130 | });
131 | final labels = await _imageLabeler.processImage(inputImage);
132 | if (labels.isEmpty) {
133 | ScaffoldMessenger.of(context).showSnackBar(
134 | SnackBar(content: Text('Nothing is detected, try again!')));
135 | return;
136 | }
137 | setState(() {
138 | _labels = labels;
139 | isLoading = false;
140 | });
141 | }
142 | ///---------- Focus Here ---------------///
143 |
144 |
145 | @override
146 | void dispose() {
147 | _imageLabeler.close();
148 | super.dispose();
149 | }
150 | }
151 |
--------------------------------------------------------------------------------
/lib/6-FlutterAndAI/CV/TextRecognitionScreen.dart:
--------------------------------------------------------------------------------
1 | import 'dart:io';
2 |
3 | import 'package:flutter/material.dart';
4 | import 'package:google_ml_kit/google_ml_kit.dart';
5 | import 'package:image_picker/image_picker.dart';
6 | import 'dart:ui' as ui;
7 |
8 | class TextRecognitionPage extends StatefulWidget {
9 | const TextRecognitionPage({Key? key}) : super(key: key);
10 |
11 | @override
12 | TextRecognitionState createState() => TextRecognitionState();
13 | }
14 |
15 | class TextRecognitionState extends State {
16 | bool isLoading = false;
17 | RecognizedText? textRecognized;
18 | final picker = ImagePicker();
19 |
20 | late ui.Image _image;
21 | File? _imageFile;
22 | XFile? imageFile;
23 |
24 | final TextRecognizer _textRecognizer = TextRecognizer();
25 |
26 | @override
27 | Widget build(BuildContext context) {
28 | return Scaffold(
29 | appBar: AppBar(
30 | title: const Text('Text Recognition'),
31 | ),
32 | floatingActionButton: FloatingActionButton(
33 | onPressed: _getImageFromGallery,
34 | tooltip: 'Get Image',
35 | child: const Icon(Icons.add_a_photo),
36 | ),
37 | body: isLoading
38 | ? const Center(child: CircularProgressIndicator())
39 | : (_imageFile == null)
40 | ? buildEmptyView()
41 | : BuildAIView(),
42 | );
43 | }
44 |
45 | Widget BuildAIView() {
46 | return Column(
47 | crossAxisAlignment: CrossAxisAlignment.start,
48 | children: [
49 | FittedBox(
50 | child: SizedBox(
51 | width: _image.width.toDouble(),
52 | height: _image.height.toDouble(),
53 | child: Image.file(_imageFile!)),
54 | ),
55 | Divider(thickness: 5),
56 | Padding(
57 | padding: const EdgeInsets.all(16.0),
58 | child: Text(
59 | 'Extracted Text:',
60 | style: TextStyle(fontSize: 24),
61 | ),
62 | ),
63 | if (textRecognized != null)
64 | Expanded(
65 | child: ListView.builder(
66 | itemCount: textRecognized!.blocks.length,
67 | itemBuilder: (BuildContext context, int index) {
68 | return ListTile(
69 | title: Text(textRecognized!.blocks[index].text),
70 | );
71 | },
72 | ),
73 | ),
74 | ],
75 | );
76 | }
77 |
78 | /// Build UI
79 | Widget buildEmptyView() {
80 | return InkWell(
81 | onTap: _getImageFromGallery,
82 | child: Center(
83 | child: Column(
84 | mainAxisAlignment: MainAxisAlignment.center,
85 | children: [
86 | CircleAvatar(
87 | radius: 150,
88 | child: Icon(
89 | Icons.add_a_photo,
90 | size: 150,
91 | ),
92 | ),
93 | SizedBox(
94 | height: 16,
95 | ),
96 | Text("Click here to add an Image")
97 | ],
98 | )),
99 | );
100 | }
101 |
102 | ///---------- Focus Here ---------------///
103 | Future processImage(InputImage inputImage) async {
104 | setState(() {
105 | isLoading = true;
106 | });
107 | RecognizedText recognizedText =
108 | await _textRecognizer.processImage(inputImage);
109 | if (recognizedText.text.isEmpty) {
110 | ScaffoldMessenger.of(context).showSnackBar(
111 | SnackBar(content: Text('Nothing is detected, try again!')));
112 | return;
113 | }
114 | setState(() {
115 | textRecognized = recognizedText;
116 | });
117 | }
118 |
119 | ///---------- Focus Here ---------------///
120 |
121 | /// Pick Image From Galleary
122 | _getImageFromGallery() async {
123 | imageFile = await picker.pickImage(source: ImageSource.gallery);
124 | setState(() {
125 | isLoading = true;
126 | });
127 | if (mounted) {
128 | if (imageFile != null) {
129 | setState(() {
130 | _imageFile = File(imageFile!.path);
131 | _loadImage(File(imageFile!.path));
132 | ///---------- Focus Here ---------------///
133 | processImage(InputImage.fromFile(_imageFile!));
134 | ///---------- Focus Here ---------------///
135 | });
136 | }
137 | }
138 | }
139 |
140 | /// Read Image From Bytes
141 | _loadImage(File file) async {
142 | final data = await file.readAsBytes();
143 | await decodeImageFromList(data).then((value) => setState(() {
144 | _image = value;
145 | isLoading = false;
146 | }));
147 | }
148 |
149 | @override
150 | void dispose() {
151 | _textRecognizer.close();
152 | super.dispose();
153 | }
154 | }
155 |
--------------------------------------------------------------------------------
/lib/6-FlutterAndAI/NLP/language_identifier_view.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 | import 'package:flutter/services.dart';
3 | import 'package:google_mlkit_language_id/google_mlkit_language_id.dart';
4 |
5 | class LanguageIdentifierView extends StatefulWidget {
6 | const LanguageIdentifierView({Key? key}) : super(key: key);
7 |
8 | @override
9 | State createState() => _LanguageIdentifierViewState();
10 | }
11 |
12 | class _LanguageIdentifierViewState extends State {
13 | List _identifiedLanguages = [];
14 | final TextEditingController _controller = TextEditingController();
15 | final _languageIdentifier = LanguageIdentifier(confidenceThreshold: 0.5);
16 | var _identifiedLanguage = '';
17 |
18 | Future _identifyLanguage() async {
19 | if (_controller.text == '') return;
20 | String language;
21 | try {
22 | language = await _languageIdentifier.identifyLanguage(_controller.text);
23 | } catch (e) {
24 | print(e);
25 | language = 'error: no language identified!';
26 | }
27 | setState(() {
28 | _identifiedLanguage = language;
29 | });
30 | }
31 |
32 | Future _identifyPossibleLanguages() async {
33 | if (_controller.text == '') return;
34 | String error;
35 | try {
36 | final possibleLanguages =
37 | await _languageIdentifier.identifyPossibleLanguages(_controller.text);
38 | setState(() {
39 | _identifiedLanguages = possibleLanguages;
40 | });
41 | return;
42 | } catch (e) {
43 | print(e);
44 | error = 'error: ${e.toString()}';
45 | }
46 | setState(() {
47 | _identifiedLanguages = [];
48 | _identifiedLanguage = error;
49 | });
50 | }
51 |
52 | @override
53 | void dispose() {
54 | _languageIdentifier.close();
55 | super.dispose();
56 | }
57 |
58 | @override
59 | Widget build(BuildContext context) {
60 | return Scaffold(
61 | appBar: AppBar(title: const Text('Language Identification')),
62 | body: Padding(
63 | padding: const EdgeInsets.all(16.0),
64 | child: Column(mainAxisAlignment: MainAxisAlignment.center, children: [
65 | TextField(
66 | controller: _controller,
67 | decoration: InputDecoration(
68 | icon: Icon(Icons.edit),
69 | border: OutlineInputBorder(),
70 | labelText: "Enter Text to identify",
71 | ),
72 | maxLines: null,
73 | ),
74 | const SizedBox(height: 15),
75 | _identifiedLanguage == ''
76 | ? Container()
77 | : Container(
78 | margin: const EdgeInsets.only(bottom: 5),
79 | child: Text(
80 | 'Identified Language: $_identifiedLanguage',
81 | style: const TextStyle(fontSize: 20),
82 | )),
83 | ElevatedButton(
84 | onPressed: _identifyLanguage,
85 | child: const Text('Identify Language'),
86 | style: ElevatedButton.styleFrom(
87 | shape: StadiumBorder(),
88 | backgroundColor: Colors.green,
89 | padding: EdgeInsets.symmetric(horizontal: 50)),
90 | ),
91 | const SizedBox(height: 15),
92 | ElevatedButton(
93 | onPressed: _identifyPossibleLanguages,
94 | child: const Text('Identify possible languages'),
95 | style: ElevatedButton.styleFrom(
96 | shape: StadiumBorder(),
97 | backgroundColor: Colors.indigo,
98 | padding: EdgeInsets.symmetric(horizontal: 25),
99 | ),
100 | ),
101 | ListView.builder(
102 | shrinkWrap: true,
103 | itemCount: _identifiedLanguages.length,
104 | itemBuilder: (context, index) {
105 | return ListTile(
106 | title: Text(
107 | 'Language: ${_identifiedLanguages[index].languageTag} Confidence: ${_identifiedLanguages[index].confidence.toString()}'),
108 | );
109 | })
110 | ]),
111 | ),
112 | );
113 | }
114 | }
115 |
--------------------------------------------------------------------------------
/lib/6-FlutterAndAI/NLP/language_translator_view.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 | import 'package:google_ml_kit/google_ml_kit.dart';
3 |
4 | class LanguageTranslatorView extends StatefulWidget {
5 | const LanguageTranslatorView({Key? key}) : super(key: key);
6 |
7 | @override
8 | State createState() => _LanguageTranslatorViewState();
9 | }
10 |
11 | class _LanguageTranslatorViewState extends State {
12 | String? _translatedText;
13 | final _controller = TextEditingController();
14 | final _controllerTo = TextEditingController();
15 | final _sourceLanguage = TranslateLanguage.english;
16 | final _targetLanguage = TranslateLanguage.arabic;
17 | bool isLoading = false;
18 |
19 | late final _onDeviceTranslator = OnDeviceTranslator(
20 | sourceLanguage: _sourceLanguage, targetLanguage: _targetLanguage);
21 |
22 | Future _translateText() async {
23 | setState(() {
24 | isLoading = true;
25 | });
26 |
27 | final result = await _onDeviceTranslator.translateText(_controller.text);
28 | setState(() {
29 | _translatedText = result;
30 | _controllerTo.text = result;
31 | isLoading = false;
32 | });
33 | }
34 |
35 | @override
36 | void dispose() {
37 | _onDeviceTranslator.close();
38 | super.dispose();
39 | }
40 |
41 | @override
42 | Widget build(BuildContext context) {
43 | return SafeArea(
44 | child: Scaffold(
45 | appBar: AppBar(
46 | title: const Text('On-device Translation'),
47 | ),
48 | body: isLoading ? buildLoading() : buildTraslateUI(),
49 | ),
50 | );
51 | }
52 |
53 | Center buildLoading() {
54 | return Center(
55 | child: SizedBox(
56 | child: Column(
57 | mainAxisAlignment: MainAxisAlignment.center,
58 | children: [
59 | Icon(
60 | Icons.download,
61 | size: 150,
62 | ),
63 | Text("Downloading ${_targetLanguage.name} Modle, please wait "),
64 | SizedBox(
65 | height: 16,
66 | ),
67 | CircularProgressIndicator()
68 | ],
69 | )),
70 | );
71 | }
72 |
73 | Padding buildTraslateUI() {
74 | return Padding(
75 | padding: const EdgeInsets.all(16.0),
76 | child: ListView(
77 | children: [
78 | const SizedBox(height: 24),
79 | Center(
80 | child: Text(
81 | 'Translated To (${_targetLanguage.name})',
82 | style: TextStyle(fontSize: 24),
83 | )),
84 | const SizedBox(height: 16),
85 | TextField(
86 | controller: _controller,
87 | decoration: InputDecoration(
88 | icon: Icon(Icons.abc),
89 | border: OutlineInputBorder(),
90 | helperText: "Translate from English",
91 | labelText: "Enter Text",
92 | ),
93 | maxLines: null,
94 | ),
95 | const SizedBox(height: 30),
96 | TextField(
97 | controller: _controllerTo,
98 | decoration: InputDecoration(
99 | enabled: false,
100 | icon: Icon(
101 | Icons.translate,
102 | color: Colors.red,
103 | ),
104 | border: OutlineInputBorder(),
105 | ),
106 | maxLines: null,
107 | ),
108 | const SizedBox(height: 30),
109 | Padding(
110 | padding: const EdgeInsets.only(left: 40),
111 | child: ElevatedButton(
112 | onPressed: _translateText,
113 | child: const Text('Translate'),
114 | style: ElevatedButton.styleFrom(
115 | shape: StadiumBorder(), backgroundColor: Colors.indigo),
116 | ),
117 | ),
118 | ],
119 | ),
120 | );
121 | }
122 | }
123 |
--------------------------------------------------------------------------------
/lib/Firebase/Art.dart:
--------------------------------------------------------------------------------
1 | import 'package:cloud_firestore/cloud_firestore.dart';
2 |
3 | class Art {
4 | late String docId;
5 | late String title;
6 | late String image;
7 | late int views;
8 |
9 |
10 |
11 | // constructor
12 | Art.fromDoc(QueryDocumentSnapshot doc) {
13 | title = doc["title"];
14 | image = doc["image"];
15 | views = doc["views"];
16 | docId = doc.id;
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/lib/Firebase/ArtDetails.dart:
--------------------------------------------------------------------------------
1 | import 'package:cloud_firestore/cloud_firestore.dart';
2 | import 'package:flutter/cupertino.dart';
3 | import 'package:flutter/material.dart';
4 |
5 | import 'Art.dart';
6 |
7 | class ArtDetails extends StatelessWidget {
8 | final Art art;
9 |
10 | ArtDetails(this.art, {Key? key}) : super(key: key);
11 |
12 | static PageRouteBuilder getRoute(Art art) {
13 | return PageRouteBuilder(
14 | transitionsBuilder: (_, animation, secondAnimation, child) {
15 | return FadeTransition(
16 | opacity: animation,
17 | child: RotationTransition(
18 | turns: Tween(begin: 0.5, end: 1.0).animate(animation),
19 | child: child,
20 | ),
21 | );
22 | }, pageBuilder: (_, __, ___) {
23 | return new ArtDetails(art);
24 | });
25 | }
26 |
27 | @override
28 | Widget build(BuildContext context) {
29 | updateViews();
30 | return Scaffold(
31 | backgroundColor: Colors.black,
32 | appBar: AppBar(
33 | title: Text(art.title),
34 | ),
35 | body: Center(child: Image.network(art.image)),
36 | );
37 | }
38 |
39 | void updateViews() {
40 | FirebaseFirestore.instance
41 | .collection('gallery')
42 | .doc(art.docId)
43 | .update({'views': FieldValue.increment(1)})
44 | .then((value) => print("User Updated"))
45 | .catchError((error) => print("Failed to update user: $error"));
46 | }
47 | }
48 |
--------------------------------------------------------------------------------
/lib/Firebase/ArtGallaryList.dart:
--------------------------------------------------------------------------------
1 | import 'package:cloud_firestore/cloud_firestore.dart';
2 | import './ArtDetails.dart';
3 | import 'package:firebase_core/firebase_core.dart';
4 | import 'package:flutter/material.dart';
5 | import 'Art.dart';
6 |
7 | void main() async{
8 | WidgetsFlutterBinding.ensureInitialized();
9 | await Firebase.initializeApp().then((value) => print(value.options.projectId));
10 | runApp(MyApp());
11 | }
12 |
13 | class MyApp extends StatelessWidget {
14 | const MyApp({Key? key}) : super(key: key);
15 |
16 | @override
17 | Widget build(BuildContext context) {
18 | return MaterialApp(
19 | theme: ThemeData(
20 | colorScheme: ColorScheme.fromSwatch(
21 | primarySwatch: Colors.deepPurple,
22 | accentColor: Colors.deepOrangeAccent)),
23 | home: MyArtApp(),
24 | );
25 | }
26 | }
27 |
28 | class MyArtApp extends StatefulWidget {
29 | MyArtApp({Key? key}) : super(key: key);
30 |
31 | @override
32 | State createState() => _MyHomePageState();
33 | }
34 |
35 | class _MyHomePageState extends State {
36 | List artList = [];
37 |
38 | @override
39 | Widget build(BuildContext context) {
40 | return Scaffold(
41 | appBar: AppBar(
42 | title: Text("FireBase"),
43 | ),
44 | body: FutureBuilder>(
45 | /// Initialize FlutterFire:
46 | future: getArt(),
47 | builder: (context, snapshot) {
48 | /// if Error
49 | if (snapshot.hasError) {
50 | return Text('${snapshot.error}');
51 | }
52 |
53 | /// On completion
54 | if (snapshot.connectionState == ConnectionState.done) {
55 | artList = snapshot.data!;
56 | return buildGrid(artList);
57 | }
58 |
59 | /// On Loading
60 | return Center(
61 | child: CircularProgressIndicator(
62 | strokeWidth: 3,
63 | ));
64 | },
65 | ),
66 | );
67 | }
68 |
69 | Future> getArt() async {
70 | List arts = [];
71 | await FirebaseFirestore.instance
72 | .collection('gallery')
73 | .get()
74 | .then((QuerySnapshot querySnapshot) {
75 | querySnapshot.docs.forEach((QueryDocumentSnapshot doc) {
76 | arts.add(Art.fromDoc(doc));
77 | });
78 | });
79 | return arts;
80 | }
81 |
82 | Widget buildGrid(List artList) {
83 | return RefreshIndicator(
84 | onRefresh: () async{
85 | artList=[];
86 | await getArt();
87 | setState(() {});
88 | return Future.value();
89 | },
90 | child: GridView.builder(
91 | gridDelegate: const SliverGridDelegateWithFixedCrossAxisCount(
92 | crossAxisCount: 2,
93 | childAspectRatio: 0.70,
94 | ),
95 | itemCount: artList.length,
96 | itemBuilder: (BuildContext context, int index) {
97 | return InkWell(
98 | onTap: () {
99 | Navigator.push(context, ArtDetails.getRoute(artList[index]));
100 | },
101 | child: Card(
102 | child: Column(
103 | crossAxisAlignment: CrossAxisAlignment.start,
104 | children: [
105 | Image.network(
106 | artList[index].image,
107 | fit: BoxFit.cover,
108 | ),
109 | Padding(
110 | padding: const EdgeInsets.all(8.0),
111 | child: Text(
112 | artList[index].title,
113 | style: TextStyle(fontSize: 24),
114 | ),
115 | ),
116 | Padding(
117 | padding: const EdgeInsets.all(8.0),
118 | child: Row(
119 | children: [
120 | Icon(Icons.remove_red_eye),
121 | SizedBox(
122 | width: 8,
123 | ),
124 | Text('${artList[index].views}'),
125 | ],
126 | ),
127 | ),
128 | ],
129 | ),
130 | ),
131 | );
132 | }),
133 | );
134 | }
135 | }
136 |
--------------------------------------------------------------------------------
/lib/FlutterCourse.code-workspace:
--------------------------------------------------------------------------------
1 | {
2 | "folders": [
3 | {
4 | "name": "FlutterCourse",
5 | "path": ".."
6 | }
7 | ],
8 | "settings": {}
9 | }
--------------------------------------------------------------------------------
/lib/main.dart:
--------------------------------------------------------------------------------
1 | import 'dart:math';
2 |
3 | import 'package:flutter/material.dart';
4 |
5 | void main() => runApp(MyApp());
6 |
7 | class MyApp extends StatelessWidget {
8 | const MyApp({Key? key}) : super(key: key);
9 |
10 | @override
11 | Widget build(BuildContext context) {
12 | return MaterialApp(
13 | home: MyHomePage(),
14 | );
15 | }
16 | }
17 |
18 | class MyHomePage extends StatefulWidget {
19 | MyHomePage({Key? key}) : super(key: key);
20 |
21 | @override
22 | State createState() => _MyHomePageState();
23 | }
24 |
25 | class _MyHomePageState extends State {
26 | @override
27 | Widget build(BuildContext context) {
28 | double screenWidth = MediaQuery.of(context).size.width;
29 | double screenHeight = MediaQuery.of(context).size.height;
30 |
31 | return Scaffold(
32 | backgroundColor: Colors.grey,
33 | appBar: AppBar(
34 | title: Text(
35 | 'Lab 3',
36 | style: TextStyle(fontSize: 18),
37 | ),
38 | ),
39 | body: AnimatedContainer(
40 | margin: EdgeInsets.all(20),
41 | duration: Duration(milliseconds: 450),
42 | width: screenWidth,
43 | height: screenHeight,
44 | // to 0 when click on it, to screen height when also click on it
45 | color: Colors.indigo,
46 | child: Stack(
47 | children: [
48 | Container(
49 | height: 60,
50 | padding: EdgeInsets.symmetric(horizontal: 16),
51 | color: Colors.yellow,
52 | child: InkWell(
53 | onTap: () {
54 | setState(() {});
55 | },
56 | child: Row(
57 | crossAxisAlignment: CrossAxisAlignment.center,
58 | children: [
59 | Expanded(
60 | child: Text(
61 | 'Click to Expand',
62 | style: TextStyle(fontSize: 18),
63 | )),
64 | Icon(Icons.keyboard_arrow_up),
65 | ],
66 | ),
67 | ),
68 | ),
69 | Padding(
70 | padding: const EdgeInsets.only(top: 60.0),
71 | child: SingleChildScrollView(
72 | child: Column(
73 | children: [
74 | changeShapes(screenWidth),
75 | flutterChanger(screenWidth),
76 | showHide(screenWidth),
77 | ],
78 | ),
79 | ),
80 | ),
81 | ],
82 | ),
83 | ),
84 | );
85 | }
86 |
87 | Widget changeShapes(double width) {
88 | return Padding(
89 | padding: const EdgeInsets.all(8.0),
90 | child: Card(
91 | child: Container(
92 | margin: EdgeInsets.all(8),
93 | color: Colors.white,
94 | width: width,
95 | height: 150,
96 |
97 | /// ********** Do changes in child below ********** ///
98 | child: Text('Change with Requested')),
99 | ),
100 | );
101 | }
102 |
103 | Widget flutterChanger(double width) {
104 | return Padding(
105 | padding: const EdgeInsets.all(8.0),
106 | child: Card(
107 | child: Container(
108 | margin: EdgeInsets.all(8),
109 | color: Colors.white,
110 | width: width,
111 | height: 150,
112 |
113 | /// ********** Do changes in child below ********** ///
114 | child: Text('Change with Requested')),
115 | ),
116 | );
117 | }
118 |
119 | Widget showHide(double width) {
120 | return Padding(
121 | padding: const EdgeInsets.all(8.0),
122 | child: Card(
123 | child: Container(
124 | margin: EdgeInsets.all(8),
125 | color: Colors.white,
126 | width: width,
127 | height: 150,
128 |
129 | /// ********** Do changes in child below ********** ///
130 | child: Text('Change with Requested')),
131 | ),
132 | );
133 | }
134 | }
--------------------------------------------------------------------------------
/lib/templates/1-FlutterBasic101/FlutterStarterCode.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 |
3 | void main() => runApp(MyApp());
4 |
5 | /// this is your APP Main screen configuration
6 | class MyApp extends StatelessWidget {
7 | MyApp({Key? key}) : super(key: key);
8 |
9 | @override
10 | Widget build(BuildContext context) {
11 | return MaterialApp(
12 | home: MyHomePage(),
13 | );
14 | }
15 | }
16 |
17 | /// this is a template to start building a UI
18 | /// to start adding any UI you want change what comes after the [ body: ] tag below
19 | class MyHomePage extends StatelessWidget {
20 | MyHomePage({Key? key}) : super(key: key);
21 |
22 | @override
23 | Widget build(BuildContext context) {
24 | return Scaffold(
25 | backgroundColor: const Color(0xfff4f4f4),
26 | appBar: AppBar(
27 | leading: const Icon(Icons.android_sharp),
28 | title: const Text('App Title'),
29 | backgroundColor: Colors.teal,
30 | elevation: 4,
31 | ),
32 | /*******************--[focus here 🧐]--*******************/
33 | body: myWidget(),
34 | /*******************--[focus here 🧐]--*******************/
35 | );
36 | }
37 |
38 | Widget myWidget() {
39 | return Container(
40 | padding: EdgeInsets.all(20),
41 | child:
42 | /*******************--[focus here 🧐]--*******************/
43 | Text(
44 | 'Welcome to the Course',
45 | ),
46 | /*******************--[focus here 🧐]--*******************/
47 | );
48 | }
49 | }
50 |
--------------------------------------------------------------------------------
/lib/templates/1-FlutterBasic101/FlutterStarterLayout.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 |
3 | void main() => runApp(MyApp());
4 |
5 | /// this is your APP Main screen configuration
6 | class MyApp extends StatelessWidget {
7 | MyApp({Key? key}) : super(key: key);
8 |
9 | @override
10 | Widget build(BuildContext context) {
11 | return MaterialApp(
12 | home: MyHomePage(),
13 | );
14 | }
15 | }
16 |
17 | /// this is a template to start building a UI
18 | /// to start adding any UI you want change what comes after the [ body: ] tag below
19 | class MyHomePage extends StatelessWidget {
20 | MyHomePage({Key? key}) : super(key: key);
21 |
22 | @override
23 | Widget build(BuildContext context) {
24 | return Scaffold(
25 | backgroundColor: const Color(0xfff4f4f4),
26 | appBar: AppBar(
27 | leading: const Icon(Icons.android_sharp),
28 | title: const Text('App Title'),
29 | backgroundColor: Colors.teal,
30 | elevation: 4,
31 | ),
32 | /*******************--[focus here 🧐]--*******************/
33 | body: myWidget(),
34 | /*******************--[focus here 🧐]--*******************/
35 | );
36 | }
37 |
38 | Widget myWidget() {
39 | return Container(
40 | padding: EdgeInsets.all(20),
41 | child:
42 | /*******************--[focus here 🧐]--*******************/
43 | Text(
44 | 'Welcome to the Course',
45 | ),
46 | /*******************--[focus here 🧐]--*******************/
47 | );
48 | }
49 | }
50 |
--------------------------------------------------------------------------------
/lib/templates/1-FlutterBasic101/StateFullTemplate.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 |
3 | void main() => runApp(MyApp());
4 |
5 | class MyApp extends StatelessWidget {
6 | MyApp({Key? key}) : super(key: key);
7 |
8 | @override
9 | Widget build(BuildContext context) {
10 | return MaterialApp(
11 | theme: ThemeData(
12 | colorScheme: ColorScheme.fromSwatch(
13 | primarySwatch: Colors.red,
14 | accentColor: Colors.lightBlue,
15 | )),
16 | home: MyHomePage(),
17 | );
18 | }
19 | }
20 |
21 | class MyHomePage extends StatefulWidget {
22 | MyHomePage({Key? key}) : super(key: key);
23 |
24 | @override
25 | State createState() => _MyHomePageState();
26 | }
27 |
28 | class _MyHomePageState extends State {
29 |
30 | @override
31 | Widget build(BuildContext context) {
32 | return Scaffold(
33 | appBar: AppBar(
34 | leading: const Icon(Icons.android_sharp),
35 | title: const Text('Flutter course'),
36 | elevation: 4,
37 | ),
38 | body: Center(
39 | child: Row(
40 | mainAxisAlignment: MainAxisAlignment.center,
41 | children: [
42 | ElevatedButton(onPressed: (){
43 | // TODO: Increase the counter here
44 |
45 | }, child: Icon(Icons.add),),
46 | Padding(
47 | padding: const EdgeInsets.all(20.0),
48 | // TODO long press on text rest counter
49 | child: Text(
50 | '0',
51 | style: TextStyle(
52 | fontSize: 50,
53 | color: Colors.black),
54 | ),
55 | ),
56 |
57 | ElevatedButton(onPressed: (){
58 | // TODO: Decrease the counter here
59 |
60 | }, child: Icon(Icons.remove),)
61 | ],
62 | ),
63 | ));
64 | }
65 | }
66 |
67 |
--------------------------------------------------------------------------------
/lib/templates/1-FlutterBasic101/UnderstandingFlutterTemplate.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 |
3 |
4 | void main() => runApp(MyApp());
5 |
6 |
7 | /// this is your APP Main screen configuration
8 | class MyApp extends StatelessWidget {
9 |
10 | @override
11 | Widget build(BuildContext context) {
12 | return Text('nothing');
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/lib/templates/2-MaterialDesign&Theming/DarkThemeTemplate.dart:
--------------------------------------------------------------------------------
1 | import 'package:adaptive_theme/adaptive_theme.dart';
2 | import 'package:flutter/material.dart';
3 |
4 | void main() => runApp(MyApp());
5 |
6 | /// this is your APP Main screen configuration
7 | class MyApp extends StatelessWidget {
8 | MyApp({Key? key}) : super(key: key);
9 |
10 | @override
11 | Widget build(BuildContext context) {
12 | return MaterialApp(
13 | home: MyHomePage(),
14 | );
15 | }
16 | }
17 |
18 | class MyHomePage extends StatefulWidget {
19 | MyHomePage({Key? key}) : super(key: key);
20 |
21 | @override
22 | State createState() => _MyHomePageState();
23 | }
24 |
25 | class _MyHomePageState extends State {
26 | @override
27 | Widget build(BuildContext context) {
28 | return Scaffold(
29 | floatingActionButtonLocation: FloatingActionButtonLocation.centerDocked,
30 | floatingActionButton: FloatingActionButton(
31 | onPressed: () {},
32 | child: Icon(
33 | Icons.edit,
34 | )),
35 | bottomNavigationBar: BottomAppBar(
36 | shape: CircularNotchedRectangle(),
37 | child: SizedBox(height: 56),
38 | ),
39 | appBar: AppBar(
40 | title: const Text('App Title'),
41 | elevation: 4,
42 | ),
43 | body: Center(
44 | child: Column(
45 | mainAxisAlignment: MainAxisAlignment.center,
46 | children: [
47 | Icon(
48 | Icons.refresh,
49 | size: 200,
50 | ),
51 | ElevatedButton(onPressed: () {}, child: Text("Toggel Theme"))
52 | ],
53 | ),
54 | ));
55 | }
56 | }
57 |
--------------------------------------------------------------------------------
/lib/templates/2-MaterialDesign&Theming/FormsTemplate.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 |
3 | void main() => runApp(MyApp());
4 |
5 | class MyApp extends StatelessWidget {
6 | const MyApp({Key? key}) : super(key: key);
7 |
8 | @override
9 | Widget build(BuildContext context) {
10 | return MaterialApp(
11 | theme: ThemeData(
12 | colorScheme: ColorScheme.fromSwatch(
13 | primarySwatch: Colors.deepPurple,
14 | accentColor: Colors.deepOrangeAccent)),
15 | home: FormPage(),
16 | );
17 | }
18 | }
19 |
20 | class FormPage extends StatefulWidget {
21 | const FormPage({Key? key}) : super(key: key);
22 |
23 | @override
24 | State createState() => _FormPageState();
25 | }
26 |
27 | class _FormPageState extends State {
28 | final _formKey = GlobalKey();
29 | TextEditingController _emailController = TextEditingController();
30 | bool isObscure = true;
31 |
32 | @override
33 | Widget build(BuildContext context) {
34 | return Scaffold(
35 | appBar: AppBar(title: const Text("Form")),
36 | body: ListView(
37 | padding: const EdgeInsets.only(bottom: 24.0),
38 | children: [
39 | Form(
40 | key: _formKey,
41 | child: Column(
42 | children: [
43 | Padding(
44 | padding: const EdgeInsets.all(16),
45 | child: ElevatedButton(
46 | onPressed: (){},
47 | child: Text(
48 | "Login".toUpperCase(),
49 | style: const TextStyle(fontSize: 14),
50 | ),
51 | )),
52 | ],
53 | ),
54 | ),
55 | ],
56 | ));
57 | }
58 | }
59 |
--------------------------------------------------------------------------------
/lib/templates/2-MaterialDesign&Theming/MaterialStarterCode.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 |
3 | void main() => runApp(MyApp());
4 |
5 | /// this is your APP Main screen configuration
6 | class MyApp extends StatelessWidget {
7 | MyApp({Key? key}) : super(key: key);
8 |
9 | @override
10 | Widget build(BuildContext context) {
11 | return MaterialApp(
12 | home: MyHomePage(),
13 | );
14 | }
15 | }
16 |
17 | class MyHomePage extends StatelessWidget {
18 | MyHomePage({Key? key}) : super(key: key);
19 |
20 | @override
21 | Widget build(BuildContext context) {
22 | return Scaffold(
23 | /*******************--[focus here 🧐]--*******************/
24 | appBar: AppBar(),
25 | bottomNavigationBar: BottomAppBar(),
26 | floatingActionButton: FloatingActionButton(onPressed: () { },),
27 | /*******************--[focus here 🧐]--*******************/
28 | body: myWidget()
29 | );
30 | }
31 |
32 |
33 | Widget myWidget() {
34 | return SingleChildScrollView(
35 | child: Column(
36 | children: [
37 | /*******************--[focus here 🧐]--*******************/
38 | SizedBox(height: 25,),
39 | exercise1(),
40 | SizedBox(height: 25,),
41 | exercise2(),
42 | SizedBox(height: 25,),
43 | exercise3(),
44 | SizedBox(height: 25,),
45 | exercise4(),
46 | /*******************--[focus here 🧐]--*******************/
47 | ],
48 | ),
49 | );
50 | }
51 |
52 | /// TODO: Implement Exercises below as per the handed Document
53 | Widget exercise1() {
54 | return FlutterLogo(
55 | size: 100,
56 | );
57 | }
58 |
59 | Widget exercise2() {
60 | return FlutterLogo(
61 | size: 100,
62 | );
63 | }
64 |
65 | /// TODO : print on the screen on Pressed when clicking on the button, and print on Long Pressed when long click to Button
66 | Widget exercise3() {
67 | return FlutterLogo(
68 | size: 100,
69 | );
70 | }
71 |
72 | Widget exercise4() {
73 | return FlutterLogo(
74 | size: 100,
75 | );
76 | }
77 |
78 | Widget exercise5() {
79 | return FlutterLogo(
80 | size: 100,
81 | );
82 | }
83 | Widget exercise6() {
84 | return FlutterLogo(
85 | size: 100,
86 | );
87 | }
88 | }
89 |
--------------------------------------------------------------------------------
/lib/templates/3-Asynchronous Networking Programming/AddUserScreenTemplate.dart:
--------------------------------------------------------------------------------
1 | import 'dart:convert';
2 | import 'package:flutter/material.dart';
3 | import 'package:http/http.dart' as http;
4 |
5 |
6 | void main() => runApp(MyApp());
7 |
8 | class MyApp extends StatelessWidget {
9 | MyApp({Key? key}) : super(key: key);
10 |
11 | @override
12 | Widget build(BuildContext context) {
13 | return MaterialApp(
14 | home: AddUserScreen(),
15 | );
16 | }
17 | }
18 | class AddUserScreen extends StatefulWidget {
19 | /// make the screen introduce it self
20 | static getRoute(BuildContext context) {
21 | return PageRouteBuilder(
22 | transitionsBuilder: (_, animation, secondAnimation, child) {
23 | /// add your animation here
24 | return FadeTransition(
25 | opacity: animation,
26 | child: RotationTransition(
27 | turns: Tween(begin: 0.5, end: 1.0).animate(animation),
28 | child: child,
29 | ),
30 | );
31 | }, pageBuilder: (_, __, ___) {
32 | return new AddUserScreen();
33 | });
34 |
35 | // you can add this line as a child to FadeTransition to add multiple animation
36 | // RotationTransition(
37 | // turns: Tween(begin: 0.5, end: 1.0).animate(animation),
38 | // child: child,
39 | // )
40 | }
41 |
42 | const AddUserScreen({Key? key}) : super(key: key);
43 |
44 | @override
45 | _AddUserScreenState createState() => _AddUserScreenState();
46 | }
47 |
48 | class _AddUserScreenState extends State {
49 | TextEditingController nameController = TextEditingController();
50 | TextEditingController emailController =
51 | TextEditingController(text: "@gmail.com");
52 | TextEditingController genderController = TextEditingController(text: "male");
53 |
54 | @override
55 | Widget build(BuildContext context) {
56 | return Scaffold(
57 | appBar: AppBar(
58 | title: Text('Add new user'),
59 | ),
60 | body: Padding(
61 | padding: const EdgeInsets.all(16.0),
62 | child: Column(
63 | children: [
64 | TextField(
65 | controller: nameController,
66 | decoration: const InputDecoration(
67 | icon: Icon(Icons.person),
68 | filled: true,
69 | hintText: 'Enter your Name',
70 | labelText: 'Name ',
71 | ),
72 | ),
73 | SizedBox(
74 | height: 16,
75 | ),
76 | TextField(
77 | controller: emailController,
78 | decoration: const InputDecoration(
79 | icon: Icon(Icons.email),
80 | filled: true,
81 | hintText: 'Enter your Email',
82 | labelText: 'Email ',
83 | ),
84 | ),
85 | SizedBox(
86 | height: 16,
87 | ),
88 | TextField(
89 | controller: genderController,
90 | decoration: const InputDecoration(
91 | icon: Icon(Icons.group),
92 | filled: true,
93 | hintText: 'Enter your Gender',
94 | labelText: 'Gender ',
95 | ),
96 | ),
97 | SizedBox(
98 | height: 16,
99 | ),
100 | Align(
101 | alignment: Alignment.bottomRight,
102 | child: ElevatedButton(
103 | onPressed: () {
104 | // postUser(name: name, gender: gender, email: email);
105 | },
106 | child: Text("Add User".toUpperCase()),
107 | ),
108 | )
109 | ],
110 | ),
111 | ),
112 | );
113 | }
114 |
115 | void postUser(
116 | {required String name, required String gender, required String email}) {
117 | // TODO: Call the API
118 | }
119 | }
120 |
--------------------------------------------------------------------------------
/lib/templates/3-Asynchronous Networking Programming/RoutingTemplate.dart:
--------------------------------------------------------------------------------
1 | import 'package:courses_codes/3-Asynchronous%20Networking%20Programming/3-RoutingScreens.dart';
2 | import 'package:flutter/material.dart';
3 |
4 | void main() => runApp(MyApp());
5 |
6 | class MyApp extends StatelessWidget {
7 | MyApp({Key? key}) : super(key: key);
8 |
9 | @override
10 | Widget build(BuildContext context) {
11 | return MaterialApp(
12 | theme: ThemeData(fontFamily: "Eczar"),
13 | routes: {
14 | "ScreenB": (context) => ScreenB(),
15 | },
16 | home: ScreenA(),
17 | );
18 | }
19 | }
20 |
21 | class ScreenA extends StatelessWidget {
22 | ScreenA({Key? key}) : super(key: key);
23 |
24 | @override
25 | Widget build(BuildContext context) {
26 | return Scaffold(
27 | backgroundColor: Colors.amber,
28 | appBar: AppBar(
29 | title: const Text('App Title'),
30 | backgroundColor: Colors.black,
31 | elevation: 4,
32 | ),
33 | body: Center(
34 | child: Column(
35 | mainAxisAlignment: MainAxisAlignment.center,
36 | children: [
37 | Text(
38 | "Screen A",
39 | style: Theme.of(context)
40 | .textTheme
41 | .headline2!
42 | .copyWith(color: Colors.indigo),
43 | ),
44 | ElevatedButton(onPressed: () {}, child: Text("Go to B"))
45 | ],
46 | ),
47 | ));
48 | }
49 |
50 | void MethodPageRoute(BuildContext context) {}
51 |
52 | void MethodMaterilRoute(BuildContext context) {}
53 |
54 | void MethodPushedName(BuildContext context) {}
55 |
56 | void MethodAnimation(BuildContext context) {
57 | PageRouteBuilder(
58 | transitionsBuilder: (_, animation, secondAnimation, child) {
59 | /// add your animation here
60 | return FadeTransition(
61 | opacity: animation,
62 | child: RotationTransition(
63 | turns: Tween(begin: 0.5, end: 1.0).animate(animation),
64 | child: child,
65 | ),
66 | );
67 | }, pageBuilder: (_, __, ___) {
68 | return new ScreenB();
69 | });
70 | }
71 |
72 | void MethodWaitForData(BuildContext context) async {}
73 | }
74 |
75 | class ScreenB extends StatelessWidget {
76 | var data;
77 | ScreenB({Key? key, this.data}) : super(key: key);
78 |
79 | @override
80 | Widget build(BuildContext context) {
81 | var arguments = ModalRoute.of(context)?.settings.arguments;
82 |
83 | return Scaffold(
84 | backgroundColor: Color(0xFF303030),
85 | appBar: AppBar(
86 | title: const Text('App Title'),
87 | backgroundColor: Colors.black,
88 | elevation: 0,
89 | ),
90 | body: Center(
91 | child: Column(
92 | mainAxisAlignment: MainAxisAlignment.center,
93 | children: [
94 | Text(
95 | "Screen B",
96 | style: Theme.of(context)
97 | .textTheme
98 | .headline2!
99 | .copyWith(color: Colors.amberAccent),
100 | ),
101 | if (arguments != null)
102 | Text(
103 | "$arguments",
104 | style: Theme.of(context)
105 | .textTheme
106 | .headline6!
107 | .copyWith(color: Colors.blueAccent),
108 | ),
109 | if (data != null)
110 | Text(
111 | "$data",
112 | style: Theme.of(context)
113 | .textTheme
114 | .headline6!
115 | .copyWith(color: Colors.blueAccent),
116 | ),
117 | SizedBox(
118 | height: 16,
119 | ),
120 | ElevatedButton(
121 | onPressed: () {
122 | Navigator.pop(context, "Data From Other");
123 | },
124 | child: Text("Go back"))
125 | ],
126 | ),
127 | ));
128 | }
129 | }
130 |
--------------------------------------------------------------------------------
/lib/templates/3-Asynchronous Networking Programming/SimpleStarterCode.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 |
3 | void main() => runApp(MyApp());
4 |
5 | class MyApp extends StatelessWidget {
6 | MyApp({Key? key}) : super(key: key);
7 |
8 | @override
9 | Widget build(BuildContext context) {
10 | return MaterialApp(
11 | home: MyHomePage(),
12 | );
13 | }
14 | }
15 |
16 | class MyHomePage extends StatelessWidget {
17 | MyHomePage({Key? key}) : super(key: key);
18 |
19 | @override
20 | Widget build(BuildContext context) {
21 | return Scaffold(
22 | appBar: AppBar(
23 | title: const Text('App Title'),
24 | backgroundColor: Colors.teal,
25 | elevation: 4,
26 | ),
27 | body: Center(
28 | child: Column(
29 | mainAxisAlignment:MainAxisAlignment.center,
30 | children: [
31 | ElevatedButton(onPressed: getUserApi, child: Text("Get Users".toUpperCase()))
32 | ],
33 | ),
34 | ));
35 | }
36 |
37 |
38 | void getUserApi() {
39 |
40 | }
41 | }
42 |
--------------------------------------------------------------------------------
/lib/templates/4-ReactiveProgramming/ReactiveProgrammingTemplate.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 |
3 | void main() => runApp(MyApp());
4 |
5 | /// this is your APP Main screen configuration
6 | class MyApp extends StatelessWidget {
7 | MyApp({Key? key}) : super(key: key);
8 |
9 | @override
10 | Widget build(BuildContext context) {
11 | return MaterialApp(
12 | home: MyHomePage(),
13 | );
14 | }
15 | }
16 |
17 | /// this is a template to start building a UI
18 | /// to start adding any UI you want change what comes after the [ body: ] tag below
19 | class MyHomePage extends StatefulWidget {
20 | MyHomePage({Key? key}) : super(key: key);
21 |
22 | @override
23 | State createState() => _MyHomePageState();
24 | }
25 |
26 | class _MyHomePageState extends State {
27 | List todos = [];
28 | List todosOriginal = [];
29 |
30 | @override
31 | void initState() {
32 | createListToDos();
33 | super.initState();
34 | }
35 |
36 | @override
37 | Widget build(BuildContext context) {
38 | return Scaffold(
39 | backgroundColor: const Color(0xfff4f4f4),
40 | appBar: AppBar(
41 | leading: const Icon(Icons.android_sharp),
42 | title: const Text('App Title'),
43 | backgroundColor: Colors.teal,
44 | elevation: 4,
45 | ),
46 | body: myWidget(),
47 | );
48 | }
49 |
50 | Widget myWidget() {
51 | return Column(
52 | children: [
53 | Text(
54 | 'Total hours to finis ${calulateTotalHours()}',
55 | style: TextStyle(fontSize: 24, fontFamily: 'Eczar')),
56 | Wrap(
57 | spacing: 8,
58 | runSpacing: 8,
59 | alignment: WrapAlignment.center,
60 | children: [
61 | InkWell(
62 | onTap: () {
63 | filterBy("h");
64 | },
65 | child: Chip(
66 | label: Text("Filter by H"),
67 | backgroundColor: Colors.greenAccent,
68 | )),
69 | InkWell(
70 | onTap: () {
71 | filterBy("m");
72 | },
73 | child: Chip(
74 | label: Text("Filter by M"),
75 | backgroundColor: Colors.amberAccent)),
76 | InkWell(
77 | onTap: () {
78 | duplicate();
79 | },
80 | child: Chip(
81 | label: Text("Duplicate"),
82 | backgroundColor: Colors.redAccent)),
83 | InkWell(
84 | onTap: () {
85 | depricate();
86 | },
87 | child: Chip(
88 | label: Text("Depricate"),
89 | backgroundColor: Colors.indigoAccent)),
90 | InkWell(
91 | onTap: () {
92 | clearFilter();
93 | },
94 | child: Chip(
95 | avatar: Icon(Icons.close),
96 | padding: EdgeInsets.symmetric(horizontal: 30),
97 | label: Text("Clear"),
98 | backgroundColor: Colors.purpleAccent)),
99 | ],
100 | ),
101 | Divider(),
102 | Expanded(
103 | child: ListView(
104 | children: [
105 | Text("Use map to create the list, Sugar!")
106 | ]
107 | ),
108 | ),
109 | ],
110 | );
111 | }
112 |
113 | int calulateTotalHours() {
114 | return -100;
115 | }
116 |
117 | void filterBy(String filter) {
118 |
119 | }
120 |
121 | void duplicate() {
122 |
123 | }
124 |
125 | void clearFilter() {
126 |
127 | }
128 |
129 | depricate() {
130 |
131 | }
132 |
133 | void createListToDos() {
134 | todos.add(Todo("create lesson ", "h", 2, true));
135 | todos.add(Todo("break ", "l", 1, false));
136 | todos.add(Todo("Talk to relatives ", "m", 1, false));
137 | todos.add(Todo("play Horizon ", "l", 2, false));
138 | todos.add(Todo("Grade IP ", "h", 2, false));
139 | todos.add(Todo("Teach Flutter ", "h", 3, false));
140 | todos.add(Todo("Grade SWP ", "h", 1, false));
141 | todosOriginal.addAll(todos);
142 | }
143 |
144 |
145 | }
146 |
147 | class Todo {
148 | String name;
149 | String priority;
150 | int hours;
151 | bool isCompleted;
152 |
153 | Todo(this.name, this.priority, this.hours, this.isCompleted);
154 | }
155 |
--------------------------------------------------------------------------------
/lib/templates/templatesLabs/Lab1/Lab1Template.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 |
3 | void main() => runApp(Lab1());
4 |
5 | /// this is your APP Main screen configuration
6 | class Lab1 extends StatelessWidget {
7 | Lab1({Key? key}) : super(key: key);
8 |
9 | @override
10 | Widget build(BuildContext context) {
11 | return MaterialApp(
12 | home: LAb1HomePage(),
13 | );
14 | }
15 | }
16 |
17 | /// this is a template to start building a UI
18 | /// to start adding any UI you want change what comes after the [ body: ] tag below
19 | class LAb1HomePage extends StatelessWidget {
20 | LAb1HomePage({Key? key}) : super(key: key);
21 |
22 | @override
23 | Widget build(BuildContext context) {
24 | return Scaffold(
25 | backgroundColor: const Color(0xfff4f4f4),
26 | /*******************--[focus here 🧐]--*******************/
27 | appBar: AppBar(
28 | leading: const Icon(Icons.stars),
29 | title: const Text('Lab 1'),
30 | backgroundColor: Colors.teal,
31 | elevation: 4,
32 | ),
33 | body: myWidget(),
34 | /*******************--[focus here 🧐]--*******************/
35 | );
36 | }
37 |
38 | Widget myWidget() {
39 | return SingleChildScrollView(
40 | child: Column(
41 | children: [
42 | /*******************--[focus here 🧐]--*******************/
43 | SizedBox(height: 25,),
44 | exercise1(),
45 | SizedBox(height: 25,),
46 | exercise2(),
47 | SizedBox(height: 25,),
48 | exercise3(),
49 | SizedBox(height: 25,),
50 | exercise4(),
51 | SizedBox(height: 25,),
52 | exercise5(),
53 | SizedBox(height: 25,),
54 | exercise6(),
55 | /*******************--[focus here 🧐]--*******************/
56 | ],
57 | ),
58 | );
59 | }
60 |
61 | /// TODO: Implement Exercises below as per the handed Document
62 | Widget exercise1() {
63 | return FlutterLogo(
64 | size: 100,
65 | );
66 | }
67 |
68 | Widget exercise2() {
69 | return FlutterLogo(
70 | size: 100,
71 | );
72 | }
73 |
74 | /// TODO : print on the screen on Pressed when clicking on the button, and print on Long Pressed when long click to Button
75 | Widget exercise3() {
76 | return FlutterLogo(
77 | size: 100,
78 | );
79 | }
80 |
81 | Widget exercise4() {
82 | return FlutterLogo(
83 | size: 100,
84 | );
85 | }
86 |
87 | Widget exercise5() {
88 | return FlutterLogo(
89 | size: 100,
90 | );
91 | }
92 | Widget exercise6() {
93 | return FlutterLogo(
94 | size: 100,
95 | );
96 | }
97 | }
--------------------------------------------------------------------------------
/lib/templates/templatesLabs/Lab1/MaterialDesignCompnenetTeamplate.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 |
3 | void main() => runApp(MyApp());
4 |
5 | /// this is your APP Main screen configuration
6 | class MyApp extends StatelessWidget {
7 | MyApp({Key? key}) : super(key: key);
8 |
9 | @override
10 | Widget build(BuildContext context) {
11 | return MaterialApp(
12 | home: MyHomePage(),
13 | );
14 | }
15 | }
16 |
17 | class MyHomePage extends StatelessWidget {
18 | MyHomePage({Key? key}) : super(key: key);
19 |
20 | @override
21 | Widget build(BuildContext context) {
22 | /*******************--[focus here 🧐]--*******************/
23 | return Scaffold(
24 | floatingActionButtonLocation: FloatingActionButtonLocation.endDocked,
25 | floatingActionButton: FloatingActionButton(
26 | onPressed: () {},
27 | ),
28 | appBar: AppBar(
29 |
30 | ),
31 | bottomNavigationBar: BottomAppBar(
32 | shape: CircularNotchedRectangle(),
33 | child: SizedBox(
34 | height: 56,
35 | ),
36 | ),
37 | body: Center(child: myWidget(context)));
38 | /*******************--[focus here 🧐]--*******************/
39 | }
40 |
41 | Widget myWidget(BuildContext context) {
42 | return SingleChildScrollView(
43 | child: Column(
44 | children: [
45 | /*******************--[focus here 🧐]--*******************/
46 | SizedBox(height: 25,),
47 | exercise1(),
48 | SizedBox(height: 25,),
49 | exercise2(),
50 | SizedBox(height: 25,),
51 | exercise3(),
52 | SizedBox(height: 25,),
53 | exercise4(),
54 |
55 | /*******************--[focus here 🧐]--*******************/
56 | ],
57 | ),
58 | );
59 | }
60 |
61 | Widget exercise1() {
62 | return FlutterLogo(
63 | size: 100,
64 | );
65 | }
66 |
67 | Widget exercise2() {
68 | return FlutterLogo(
69 | size: 100,
70 | );
71 | }
72 |
73 | /// TODO : print on the screen on Pressed when clicking on the button, and print on Long Pressed when long click to Button
74 | Widget exercise3() {
75 | return FlutterLogo(
76 | size: 100,
77 | );
78 | }
79 |
80 | Widget exercise4() {
81 | return FlutterLogo(
82 | size: 100,
83 | );
84 | }
85 |
86 | Widget exercise5() {
87 | return FlutterLogo(
88 | size: 100,
89 | );
90 | }
91 |
92 | Widget exercise6() {
93 | return FlutterLogo(
94 | size: 100,
95 | );
96 | }
97 | }
98 |
--------------------------------------------------------------------------------
/lib/templates/templatesLabs/Lab1/SunflowerScreen.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 |
3 | void main() => runApp(MyApp());
4 | class MyApp extends StatelessWidget {
5 | // This widget is the root of your application.
6 | @override
7 | Widget build(BuildContext context) {
8 | return MaterialApp(
9 | theme: ThemeData(
10 | // to change your app color change this
11 | primarySwatch: Colors.amber,
12 | ),
13 | home: MyHomePage(),
14 | );
15 | }
16 | }
17 |
18 | /// this is a template to start building a UI
19 | /// to start adding any UI you want change what comes after the [ body: ] tag below
20 | class MyHomePage extends StatelessWidget {
21 | @override
22 | Widget build(BuildContext context) {
23 | return Scaffold(
24 | backgroundColor: Colors.amber,
25 | appBar: AppBar(
26 | title: Text(
27 | 'Flower Shop',
28 | style: TextStyle(fontFamily: 'casual'),
29 | ),
30 | elevation: 0.0,
31 | ),
32 | body: ListView(
33 | children: [
34 | flowerDetails(context),
35 | ],
36 | ));
37 | }
38 | }
39 |
40 |
41 | Widget flowerDetails(BuildContext context) {
42 | return Container(
43 | padding: EdgeInsets.all(20),
44 | color: Colors.amber,
45 | child: Column(
46 | crossAxisAlignment: CrossAxisAlignment.start,
47 | mainAxisSize: MainAxisSize.max,
48 | children: [
49 | imageGroup(),
50 | titleGroup(),
51 | iconGroup(),
52 | textGroup(),
53 | buttonGroup(),
54 | ],
55 | ),
56 | );
57 | }
58 |
59 | /// Image work on Mobile https://wp-s.ru/wallpapers/11/18/389922058154790/yarkie-podsolnuxi-zhizneradostnyj-blik.jpg
60 | /// Image that works on Web: https://ichef.bbci.co.uk/images/ic/640x360/p046xkbw.jpg
61 |
62 | Widget imageGroup() {
63 | return Text('Replace with Image group');
64 | }
65 | Widget titleGroup() {
66 | return Text('Replace with title group');
67 | }
68 |
69 | Widget iconGroup() {
70 | return Text('Replace with icons group');
71 | }
72 | /// here is the text to copy
73 | ///Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry\'s standard dummy text ever since the 1500s',
74 | Widget textGroup() {
75 | return Text('Replace with text group');;
76 | }
77 |
78 | Widget buttonGroup() {
79 | return Text('Replace with button group');;
80 | }
--------------------------------------------------------------------------------
/lib/templates/templatesLabs/Lab2/SunflowerScreen.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 |
3 | void main() => runApp(MyApp());
4 | class MyApp extends StatelessWidget {
5 | // This widget is the root of your application.
6 | @override
7 | Widget build(BuildContext context) {
8 | return MaterialApp(
9 | theme: ThemeData(
10 | // to change your app color change this
11 | primarySwatch: Colors.amber,
12 | ),
13 | home: MyHomePage(),
14 | );
15 | }
16 | }
17 |
18 | /// this is a template to start building a UI
19 | /// to start adding any UI you want change what comes after the [ body: ] tag below
20 | class MyHomePage extends StatelessWidget {
21 | @override
22 | Widget build(BuildContext context) {
23 | return Scaffold(
24 | backgroundColor: Colors.amber,
25 | appBar: AppBar(
26 | title: Text(
27 | 'Flower Shop',
28 | style: TextStyle(fontFamily: 'casual'),
29 | ),
30 | elevation: 0.0,
31 | ),
32 | body: ListView(
33 | children: [
34 | flowerDetails(context),
35 | ],
36 | ));
37 | }
38 | }
39 |
40 |
41 | Widget flowerDetails(BuildContext context) {
42 | return Container(
43 | padding: EdgeInsets.all(20),
44 | color: Colors.amber,
45 | child: Column(
46 | crossAxisAlignment: CrossAxisAlignment.start,
47 | mainAxisSize: MainAxisSize.max,
48 | children: [
49 | imageGroup(),
50 | titleGroup(),
51 | iconGroup(),
52 | textGroup(),
53 | buttonGroup(),
54 | ],
55 | ),
56 | );
57 | }
58 |
59 | /// Image URL
60 | /// https://newevolutiondesigns.com/images/freebies/yellow-wallpaper-12.jpg
61 |
62 | Widget imageGroup() {
63 | return Text('Replace with image group');
64 | }
65 | Widget titleGroup() {
66 | return Text('Replace with title group');
67 | }
68 |
69 | Widget iconGroup() {
70 | return Text('Replace with icons group');;
71 | }
72 | /// here is the text to copy
73 | ///Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry\'s standard dummy text ever since the 1500s',
74 | Widget textGroup() {
75 | return Text('Replace with text group');;
76 | }
77 |
78 | Widget buttonGroup() {
79 | return Text('Replace with button group');;
80 | }
--------------------------------------------------------------------------------
/lib/templates/templatesLabs/Lab3/Lab3Template.dart:
--------------------------------------------------------------------------------
1 | import 'dart:math';
2 |
3 | import 'package:flutter/material.dart';
4 |
5 | void main() => runApp(MyApp());
6 |
7 | class MyApp extends StatelessWidget {
8 | const MyApp({Key? key}) : super(key: key);
9 |
10 | @override
11 | Widget build(BuildContext context) {
12 | return MaterialApp(
13 | home: MyHomePage(),
14 | );
15 | }
16 | }
17 |
18 | class MyHomePage extends StatefulWidget {
19 | MyHomePage({Key? key}) : super(key: key);
20 |
21 | @override
22 | State createState() => _MyHomePageState();
23 | }
24 |
25 | class _MyHomePageState extends State {
26 | @override
27 | Widget build(BuildContext context) {
28 | double screenWidth = MediaQuery.of(context).size.width;
29 | double screenHeight = MediaQuery.of(context).size.height;
30 |
31 | return Scaffold(
32 | backgroundColor: Colors.grey,
33 | appBar: AppBar(
34 | title: Text(
35 | 'Lab 3',
36 | style: TextStyle(fontSize: 18),
37 | ),
38 | ),
39 | body: AnimatedContainer(
40 | margin: EdgeInsets.all(20),
41 | duration: Duration(milliseconds: 450),
42 | width: screenWidth,
43 | height: screenHeight,
44 | // to 0 when click on it, to screen height when also click on it
45 | color: Colors.indigo,
46 | child: Stack(
47 | children: [
48 | Container(
49 | height: 60,
50 | padding: EdgeInsets.symmetric(horizontal: 16),
51 | color: Colors.yellow,
52 | child: InkWell(
53 | onTap: () {
54 | setState(() {});
55 | },
56 | child: Row(
57 | crossAxisAlignment: CrossAxisAlignment.center,
58 | children: [
59 | Expanded(
60 | child: Text(
61 | 'Click to Expand',
62 | style: TextStyle(fontSize: 18),
63 | )),
64 | Icon(Icons.keyboard_arrow_up),
65 | ],
66 | ),
67 | ),
68 | ),
69 | Padding(
70 | padding: const EdgeInsets.only(top: 60.0),
71 | child: SingleChildScrollView(
72 | child: Column(
73 | children: [
74 | changeShapes(screenWidth),
75 | flutterChanger(screenWidth),
76 | showHide(screenWidth),
77 | ],
78 | ),
79 | ),
80 | ),
81 | ],
82 | ),
83 | ),
84 | );
85 | }
86 |
87 | Widget changeShapes(double width) {
88 | return Padding(
89 | padding: const EdgeInsets.all(8.0),
90 | child: Card(
91 | child: Container(
92 | margin: EdgeInsets.all(8),
93 | color: Colors.white,
94 | width: width,
95 | height: 150,
96 |
97 | /// ********** Do changes in child below ********** ///
98 | child: Text('Change with Requested')),
99 | ),
100 | );
101 | }
102 |
103 | Widget flutterChanger(double width) {
104 | return Padding(
105 | padding: const EdgeInsets.all(8.0),
106 | child: Card(
107 | child: Container(
108 | margin: EdgeInsets.all(8),
109 | color: Colors.white,
110 | width: width,
111 | height: 150,
112 |
113 | /// ********** Do changes in child below ********** ///
114 | child: Text('Change with Requested')),
115 | ),
116 | );
117 | }
118 |
119 | Widget showHide(double width) {
120 | return Padding(
121 | padding: const EdgeInsets.all(8.0),
122 | child: Card(
123 | child: Container(
124 | margin: EdgeInsets.all(8),
125 | color: Colors.white,
126 | width: width,
127 | height: 150,
128 |
129 | /// ********** Do changes in child below ********** ///
130 | child: Text('Change with Requested')),
131 | ),
132 | );
133 | }
134 | }
135 |
--------------------------------------------------------------------------------
/lib/templates/templatesLabs/Lab4/AddPostScreenTemplate.dart:
--------------------------------------------------------------------------------
1 | import 'dart:convert';
2 | import 'package:flutter/material.dart';
3 | import 'package:http/http.dart' as http;
4 | //
5 |
6 | class AddPostScreenTemplate extends StatefulWidget {
7 | /// make the screen introduce it self
8 | static getRoute(BuildContext context) {
9 | /// Exercise 4 return PageRouteBuilder to show this screen recap last lesson or search Internet if you forgot
10 | return null;
11 | }
12 |
13 | const AddPostScreenTemplate({Key? key}) : super(key: key);
14 |
15 | @override
16 | _AddPostScreenTemplateState createState() => _AddPostScreenTemplateState();
17 | }
18 |
19 | class _AddPostScreenTemplateState extends State {
20 | @override
21 | Widget build(BuildContext context) {
22 | return Scaffold(
23 | appBar: AppBar(
24 | title: Text('Add new user'),
25 | ),
26 | body: Padding(
27 | padding: const EdgeInsets.all(16.0),
28 | child: Column(
29 | children: [
30 | TextField(
31 | decoration: const InputDecoration(
32 | icon: Icon(Icons.title),
33 | filled: true,
34 | hintText: 'write title here...',
35 | labelText: 'title ',
36 | ),
37 | ),
38 | SizedBox(
39 | height: 16,
40 | ),
41 | TextField(),
42 | SizedBox(
43 | height: 16,
44 | ),
45 | ElevatedButton(
46 | onPressed: () {
47 | /// Exercise 5 call addComment with Named parameter
48 | },
49 | child: Text("Add Comment".toUpperCase()),
50 | )
51 | ],
52 | ),
53 | ),
54 | );
55 | }
56 |
57 | addComment() {
58 | /// Exercise 5 call Post API here
59 | }
60 | }
61 |
--------------------------------------------------------------------------------
/lib/templates/templatesLabs/Lab4/PostsListScreenTemplate.dart:
--------------------------------------------------------------------------------
1 | import 'dart:convert';
2 | import 'package:flutter/material.dart';
3 | import 'package:http/http.dart' as http;
4 |
5 | void main() => runApp(MyApp());
6 |
7 | class MyApp extends StatefulWidget {
8 | const MyApp({Key? key}) : super(key: key);
9 |
10 | @override
11 | State createState() => _MyAppState();
12 | }
13 |
14 | class _MyAppState extends State {
15 | @override
16 | Widget build(BuildContext context) {
17 | return MaterialApp(
18 | theme: ThemeData(
19 | colorScheme: ColorScheme.fromSwatch(
20 | primarySwatch: Colors.teal, accentColor: Colors.blueGrey)),
21 | home: MyHomePage(),
22 | );
23 | }
24 | }
25 |
26 | class MyHomePage extends StatefulWidget {
27 | MyHomePage({Key? key}) : super(key: key);
28 |
29 | @override
30 | State createState() => _MyHomePageState();
31 | }
32 |
33 | class _MyHomePageState extends State {
34 | List posts = [];
35 | bool isLoading = false;
36 |
37 | @override
38 | Widget build(BuildContext context) {
39 | return Scaffold(
40 | appBar: AppBar(
41 | title: Text("Posts List"),
42 | ),
43 | floatingActionButton: FloatingActionButton(
44 | onPressed: () {
45 | },
46 | child: Icon(Icons.add_comment_sharp),
47 | ),
48 | body: posts.isEmpty ? buildEmptyView() : buildUserList());
49 | }
50 |
51 | Widget buildEmptyView() {
52 | return Center(
53 | child: ElevatedButton(
54 | onPressed: () {
55 | getPosts();
56 | },
57 | child: Text('press me')),
58 | );
59 | }
60 |
61 | getPosts() async {
62 | //"https://jsonplaceholder.typicode.com/posts"
63 |
64 | // TODO Implement here connect to the API
65 | }
66 |
67 | buildUserList() {
68 | // TODO Implement here populating the list
69 | return ListView.builder(
70 | itemCount: 10,
71 | itemBuilder: (context, index) {
72 | return Text("hello Lab 4");
73 | },
74 | );
75 | }
76 | }
77 |
78 | class Post {
79 | late int userId;
80 | late int id;
81 | late String title;
82 | late String body;
83 |
84 | Post.fromJson(Map json) {
85 | // TODO Implement here parsing JSON
86 | }
87 |
88 | @override
89 | String toString() {
90 | return 'Post{userId: $userId, id: $id, title: $title} \n \n ---------- ';
91 | }
92 | }
93 |
--------------------------------------------------------------------------------
/lib/templates/templatesLabs/Lab5/Todo.dart:
--------------------------------------------------------------------------------
1 | class Todo {
2 | late int userId;
3 | late int id;
4 | late String title;
5 | late bool completed;
6 |
7 |
8 | Todo.fromJson(Map json) {
9 | userId = json['userId'];
10 | title = json['title'];
11 | completed = json['completed'];
12 | id = json['id'];
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/lib/templates/templatesLabs/Lab5/TodoScreen.dart:
--------------------------------------------------------------------------------
1 | import 'package:courses_codes/templates/templatesLabs/Lab5/bloc/api_events.dart';
2 | import 'package:flutter/material.dart';
3 | import 'package:flutter_bloc/flutter_bloc.dart';
4 | import 'Todo.dart';
5 | import 'bloc/api_bloc.dart';
6 | import 'bloc/api_states.dart';
7 |
8 | void main() => runApp(MyApp());
9 |
10 | class MyApp extends StatelessWidget {
11 | const MyApp({Key? key}) : super(key: key);
12 |
13 | @override
14 | Widget build(BuildContext context) {
15 | return MaterialApp(
16 | theme: ThemeData(
17 | colorScheme: ColorScheme.fromSwatch(
18 | primarySwatch: Colors.deepPurple,
19 | accentColor: Colors.deepOrangeAccent)),
20 | home: BlocProvider(
21 | create: (_) => ApiBloc(),
22 | child: MyHomePage(),
23 | ),
24 | );
25 | }
26 | }
27 |
28 | class MyHomePage extends StatefulWidget {
29 | MyHomePage({Key? key}) : super(key: key);
30 |
31 | @override
32 | State createState() => _MyHomePageState();
33 | }
34 |
35 | class _MyHomePageState extends State {
36 | List users = [];
37 |
38 | @override
39 | Widget build(BuildContext context) {
40 | return Scaffold(
41 | appBar: AppBar(
42 | title: Text("Users List"),
43 | ),
44 | floatingActionButton: FloatingActionButton(
45 | onPressed: () {},
46 | child: Icon(Icons.person_add),
47 | ),
48 | body: buildBloc(),
49 | );
50 | }
51 |
52 | Widget buildBloc() {
53 | return BlocBuilder(builder: (context, state) {
54 | // TODO Implement BlocBuilder and show states
55 | return buildInitialView();
56 | });
57 | }
58 |
59 | Center buildInitialView() {
60 | return Center(
61 | child: ElevatedButton(
62 | onPressed: () {
63 | // TODO call bloc and trigger event
64 | },
65 | child: Text("Get TODO".toUpperCase())),
66 | );
67 | }
68 |
69 | Widget buildUserList(List todo) {
70 | return ListView.builder(
71 | itemCount: todo.length,
72 | itemBuilder: (context, index) => ListTile(
73 | title: Text(todo[index].title),
74 | leading: Icon(todo[index].completed
75 | ? Icons.check
76 | : Icons.check_box_outline_blank),
77 | tileColor: todo[index].completed ? Colors.green : Colors.white),
78 | );
79 | }
80 | }
81 |
--------------------------------------------------------------------------------
/lib/templates/templatesLabs/Lab5/bloc/api_bloc.dart:
--------------------------------------------------------------------------------
1 | import 'dart:convert';
2 | import 'package:flutter_bloc/flutter_bloc.dart';
3 | import 'package:http/http.dart' as http;
4 | import 'package:http/http.dart';import '../Todo.dart';
5 | import 'api_events.dart';
6 | import 'api_states.dart';
7 |
8 | class ApiBloc extends Bloc {
9 | ApiBloc() : super(InitialState()) {
10 | // TODO Implement "on" function
11 | }
12 |
13 | // TODO Implement the emitter function
14 |
15 |
16 |
17 | Future> getTodosApi() async {
18 | List todo = [];
19 | print("connect to internet");
20 | await Future.delayed(Duration(seconds: 3),(){});
21 | // throw(Exception("Error creating Todo list"));
22 | Response response =
23 | await http.get(Uri.parse('https://jsonplaceholder.typicode.com/todos'));
24 | if (response.statusCode == 200) {
25 | final body = json.decode(response.body) as List;
26 | body.forEach((json) {
27 | print(json);
28 | todo.add(Todo.fromJson(json));
29 | });
30 | return todo;
31 | }
32 | return [];
33 | }
34 | }
35 |
--------------------------------------------------------------------------------
/lib/templates/templatesLabs/Lab5/bloc/api_events.dart:
--------------------------------------------------------------------------------
1 | abstract class ApiEvents {}
2 | // TODO Implement GetTodo Event
3 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/lib/templates/templatesLabs/Lab5/bloc/api_states.dart:
--------------------------------------------------------------------------------
1 |
2 |
3 | abstract class ApiStates{}
4 | class InitialState extends ApiStates{}
5 |
6 | // TODO Implement 3 states Loading, SuccessTodo and ErrorState
7 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/lib/templates/templatesLabs/Lab6/AddTodo.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 |
3 | import './ReactiveProgrammingLab.dart';
4 |
5 | class AddTodo extends StatefulWidget {
6 | const AddTodo({Key? key}) : super(key: key);
7 |
8 | @override
9 | State createState() => _AddTodoState();
10 | }
11 |
12 | class _AddTodoState extends State {
13 | final _formKey = GlobalKey();
14 |
15 | late TodoLab newTodo = TodoLab();
16 |
17 |
18 | @override
19 | Widget build(BuildContext context) {
20 | return Scaffold(
21 | appBar: AppBar(
22 | backgroundColor: Colors.indigoAccent,
23 | title: const Text("New Todo Form")),
24 | body: SingleChildScrollView(
25 | child: Center(
26 | child: Form(
27 | key: _formKey,
28 | child: Padding(
29 | padding: const EdgeInsets.all(20.0),
30 | child: Column(
31 | children: [
32 | TextFormField(
33 | decoration: const InputDecoration(
34 | labelText: 'Enter todo name',
35 | helperText: 'Name should not be empty',
36 | border: OutlineInputBorder(),
37 | prefixIcon: Icon(Icons.label),
38 | filled: true),
39 | validator: (value) {
40 | // TODO do validation here
41 | },
42 | onChanged: (value) {
43 | newTodo.name = value;
44 | },
45 | ),
46 | const SizedBox(height: 10),
47 | TextFormField(
48 | decoration: InputDecoration(
49 | labelText: 'Enter todo description',
50 | helperText: 'Description should be less than 20',
51 | border: OutlineInputBorder(),
52 | prefixIcon: Icon(Icons.textsms),
53 | filled: true),
54 | validator: (value) {
55 | // TODO do validation here
56 | },
57 | onChanged: (value) {
58 | // TODO get values from here
59 |
60 | },
61 | ),
62 | const SizedBox(height: 10),
63 | TextFormField(
64 | keyboardType: TextInputType.number,
65 | decoration: const InputDecoration(
66 | labelText: 'Enter todo hours to complete',
67 | helperText: 'Hours should not be 0',
68 | border: OutlineInputBorder(),
69 | prefixIcon: Icon(Icons.warning),
70 | filled: true),
71 | validator: (value) {
72 | // TODO do validation here
73 |
74 | },
75 | onChanged: (value) {
76 | // TODO get values from here
77 | },
78 | ),
79 | const SizedBox(height: 10),
80 | TextFormField(
81 | decoration: const InputDecoration(
82 | labelText: 'Enter todo Priority',
83 | helperText: 'Priority must be one of: High, Mid, Low',
84 | border: OutlineInputBorder(),
85 | prefixIcon: Icon(Icons.tag),
86 | filled: true),
87 | validator: (value) {
88 | // TODO do validation here
89 | },
90 | onChanged: (value) {
91 |
92 | },
93 | ),
94 | const SizedBox(height: 10),
95 | ElevatedButton(
96 | onPressed: () {
97 | // TODO do Form validation here
98 |
99 | },
100 | child: const Text('Add todo'),
101 | ),
102 | ],
103 | ),
104 | ),
105 | )),
106 | ),
107 | );
108 | }
109 | }
110 |
--------------------------------------------------------------------------------
/lib/templates/templatesLabs/old/AddUserScreenTemplate.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 |
3 | class AddUser extends StatefulWidget {
4 | const AddUser({Key? key}) : super(key: key);
5 |
6 | @override
7 | _AddUserState createState() => _AddUserState();
8 | }
9 |
10 | class _AddUserState extends State {
11 |
12 |
13 | @override
14 | Widget build(BuildContext context) {
15 | return Scaffold(
16 | appBar: AppBar(
17 | title: Text('Add new user'),
18 | ),
19 | body: Padding(
20 | padding: const EdgeInsets.all(16.0),
21 | child: Column(
22 | children: [
23 | TextField(
24 | decoration: const InputDecoration(
25 | icon: Icon(Icons.person),
26 | filled: true,
27 | hintText: 'Enter your Name',
28 | labelText: 'Name ',
29 | ),
30 | ),
31 | SizedBox(
32 | height: 16,
33 | ),
34 | TextField(
35 | decoration: const InputDecoration(
36 | icon: Icon(Icons.email),
37 | filled: true,
38 | hintText: 'Enter your Email',
39 | labelText: 'Email ',
40 | ),
41 | ),
42 | SizedBox(
43 | height: 16,
44 | ),
45 | TextField(
46 | decoration: const InputDecoration(
47 | icon: Icon(Icons.group),
48 | filled: true,
49 | hintText: 'Enter your Gender',
50 | labelText: 'Gender ',
51 | ),
52 | ),
53 | SizedBox(
54 | height: 16,
55 | ),
56 | Align(
57 | alignment: Alignment.bottomRight,
58 | child: ElevatedButton(
59 | onPressed: () {
60 | // addUser();
61 | },
62 | child: Text("Add User".toUpperCase()),
63 | ),
64 | )
65 | ],
66 | ),
67 | ),
68 | );
69 | }
70 |
71 | void addUser(){
72 |
73 | }
74 | }
75 |
--------------------------------------------------------------------------------
/lib/templates/templatesLabs/old/FirebaseTemplate.dart:
--------------------------------------------------------------------------------
1 | import 'package:firebase_core/firebase_core.dart';
2 | import 'package:flutter/material.dart';
3 |
4 | void main() async {
5 | WidgetsFlutterBinding.ensureInitialized();
6 | await Firebase.initializeApp();
7 | runApp(MyApp());
8 | }
9 |
10 | class MyApp extends StatelessWidget {
11 | const MyApp({Key? key}) : super(key: key);
12 |
13 | @override
14 | Widget build(BuildContext context) {
15 | return MaterialApp(
16 | theme: ThemeData(
17 | colorScheme: ColorScheme.fromSwatch(
18 | primarySwatch: Colors.deepPurple,
19 | accentColor: Colors.deepOrangeAccent)),
20 | home: MyArtApp(),
21 | );
22 | }
23 | }
24 |
25 | class MyArtApp extends StatefulWidget {
26 | MyArtApp({Key? key}) : super(key: key);
27 |
28 | @override
29 | State createState() => _MyHomePageState();
30 | }
31 |
32 | class _MyHomePageState extends State {
33 | @override
34 | Widget build(BuildContext context) {
35 | return Scaffold(
36 | appBar: AppBar(
37 | title: Text("FireBase"),
38 | ),
39 | body: FutureBuilder(
40 | /// Initialize FlutterFire:
41 | future: getArt(),
42 | builder: (context, snapshot) {
43 | /// if Error
44 | if (snapshot.hasError) {
45 | return Text('${snapshot.error}');
46 | }
47 |
48 | /// On completion
49 | if (snapshot.connectionState == ConnectionState.done) {
50 | return Center(child: Text('${snapshot.data}'));
51 | }
52 |
53 | /// On Loading
54 | return Center(
55 | child: CircularProgressIndicator(
56 | strokeWidth: 3,
57 | ));
58 | },
59 | ),
60 | );
61 | }
62 |
63 | Future getArt() async {
64 | await Future.delayed(Duration(seconds: 3), () {});
65 | return Future.value("Finished");
66 | }
67 | }
68 |
--------------------------------------------------------------------------------
/lib/templates/templatesLabs/old/StyleTemplate.dart:
--------------------------------------------------------------------------------
1 | import 'dart:ui';
2 |
3 | import 'package:flutter/material.dart';
4 |
5 | class MyColors {
6 | static const Color redCaramel = Color(0xFF864921);
7 | static const Color greenGrass = Color(0xFF4D6658);
8 | static const Color smoothBackground = Color(0xFFF2EEE1);
9 | static final Color smoothGreen = Color(0xFFFBFDF7);
10 | }
11 |
12 | class MyTextStyles {
13 |
14 | static final String eczar = "Eczar";
15 | static final String merriweather = "Merriweather";
16 |
17 | static TextStyle headline6 = TextStyle(
18 | color: Colors.white,
19 | fontFamily: eczar,
20 | fontSize: 20.0,
21 | fontWeight: FontWeight.w900,
22 | );
23 | static TextStyle headline5 = TextStyle(
24 | color: Colors.red,
25 | fontFamily: eczar,
26 | fontSize: 24.0,
27 | fontWeight: FontWeight.w700,
28 | );
29 |
30 | static TextStyle button = TextStyle(
31 | color: Colors.red,
32 | fontFamily: merriweather,
33 | fontSize: 18.0,
34 | fontWeight: FontWeight.w300,
35 | );
36 |
37 |
38 |
39 | }
--------------------------------------------------------------------------------
/lib/templates/templatesLabs/old/UserListTemplate.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 |
3 | void main() => runApp(MyApp());
4 |
5 | class MyApp extends StatelessWidget {
6 | const MyApp({Key? key}) : super(key: key);
7 |
8 | @override
9 | Widget build(BuildContext context) {
10 | return MaterialApp(
11 | theme: ThemeData(
12 | colorScheme: ColorScheme.fromSwatch(
13 | primarySwatch: Colors.deepPurple,
14 | accentColor: Colors.deepOrangeAccent)),
15 | home: MyHomePage(),
16 | );
17 | }
18 | }
19 |
20 | class MyHomePage extends StatefulWidget {
21 | MyHomePage({Key? key}) : super(key: key);
22 |
23 | @override
24 | State createState() => _MyHomePageState();
25 | }
26 |
27 | class _MyHomePageState extends State {
28 | @override
29 | Widget build(BuildContext context) {
30 | return Scaffold(
31 | appBar: AppBar(
32 | title: Text("Users List"),
33 | ),
34 | floatingActionButton: FloatingActionButton(
35 | onPressed: () {
36 |
37 | },
38 | child: Icon(Icons.person_add),
39 | ),
40 | body: Center(
41 | child: ElevatedButton(
42 | onPressed: () {
43 | getUsers();
44 | },
45 | child: Text("Get Users".toUpperCase()),
46 | ),
47 | ),
48 | );
49 | }
50 |
51 | getUsers() {
52 |
53 |
54 | }
55 | }
56 |
--------------------------------------------------------------------------------
/pubspec.yaml:
--------------------------------------------------------------------------------
1 | name: courses_codes
2 | description: A new Flutter project.
3 |
4 | # The following line prevents the package from being accidentally published to
5 | # pub.dev using `flutter pub publish`. This is preferred for private packages.
6 | publish_to: 'none' # Remove this line if you wish to publish to pub.dev
7 |
8 | # The following defines the version and build number for your application.
9 | # A version number is three numbers separated by dots, like 1.2.43
10 | # followed by an optional build number separated by a +.
11 | # Both the version and the builder number may be overridden in flutter
12 | # build by specifying --build-name and --build-number, respectively.
13 | # In Android, build-name is used as versionName while build-number used as versionCode.
14 | # Read more about Android versioning at https://developer.android.com/studio/publish/versioning
15 | # In iOS, build-name is used as CFBundleShortVersionString while build-number used as CFBundleVersion.
16 | # Read more about iOS versioning at
17 | # https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
18 | version: 1.0.0+1
19 |
20 | environment:
21 | sdk: ">=2.15.1 <3.0.0"
22 |
23 | # Dependencies specify other packages that your package needs in order to work.
24 | # To automatically upgrade your package dependencies to the latest versions
25 | # consider running `flutter pub upgrade --major-versions`. Alternatively,
26 | # dependencies can be manually updated by changing the version numbers below to
27 | # the latest version available on pub.dev. To see which dependencies have newer
28 | # versions available, run `flutter pub outdated`.
29 | dependencies:
30 | flutter:
31 | sdk: flutter
32 |
33 | cupertino_icons: ^1.0.2
34 | http: ^0.13.5
35 | firebase_core: ^1.13.1
36 | cloud_firestore: ^3.1.10
37 | flutter_bloc: ^8.0.1
38 | provider: ^6.0.5
39 | google_ml_kit: ^0.13.0
40 | image_picker: ^0.8.5+3
41 | path_provider: ^2.0.11
42 | url_launcher: ^6.1.5
43 | adaptive_theme: ^3.1.1
44 | font_awesome_flutter: ^10.2.1
45 | firebase_core_platform_interface: 4.5.1
46 | # paste your dependenciese below:
47 |
48 |
49 |
50 | dev_dependencies:
51 | flutter_test:
52 | sdk: flutter
53 |
54 | # The "flutter_lints" package below contains a set of recommended lints to
55 | # encourage good coding practices. The lint set provided by the package is
56 | # activated in the `analysis_options.yaml` file located at the root of your
57 | # package. See that file for information about deactivating specific lint
58 | # rules and activating additional ones.
59 | # For information on the generic Dart part of this file, see the
60 | # following page: https://dart.dev/tools/pub/pubspec
61 |
62 | # The following section is specific to Flutter.
63 | flutter:
64 |
65 | # The following line ensures that the Material Icons font is
66 | # included with your application, so that you can use the icons in
67 | # the material Icons class.
68 | uses-material-design: true
69 |
70 | assets:
71 | - assets/
72 | - assets/ml/
73 |
74 |
75 | fonts:
76 |
77 | - family: Satisfy
78 | fonts:
79 | - asset: assets/fonts/Satisfy/Satisfy-Regular.ttf
80 |
81 | - family: Eczar
82 | fonts:
83 | - asset: assets/fonts/Eczar/Eczar-Bold.ttf
84 |
85 | - family: Merriweather
86 | fonts:
87 | - asset: assets/fonts/Merriweather/Merriweather-Light.ttf
88 |
89 | - family: ZenDots
90 | fonts:
91 | - asset: assets/fonts/ZenDots/ZenDots-Regular.ttf
92 |
93 | - family: Agbalumo
94 | fonts:
95 | - asset: assets/fonts/Agbalumo/Agbalumo-Regular.ttf
96 |
97 |
98 | #
99 | # fonts:
100 | # - family: Merriweather
101 | # fonts:
102 | # - asset: assets/fonts/Merriweather/Merriweather-Light.ttf
103 | # - asset: assets/fonts/Merriweather/Merriweather-Regular.ttf
104 | #
105 | #
106 | # - family: Eczar
107 | # fonts:
108 | # - asset: assets/fonts/Eczar/Eczar-Bold.ttf
109 | # - asset: assets/fonts/Eczar/Eczar-ExtraBold.ttf
110 |
--------------------------------------------------------------------------------
/web/favicon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MuwaffaqImam/FlutterCourseInnopolis/abbca9551ffd3a77b07f98ea50c761dba36420ff/web/favicon.png
--------------------------------------------------------------------------------
/web/icons/Icon-192.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MuwaffaqImam/FlutterCourseInnopolis/abbca9551ffd3a77b07f98ea50c761dba36420ff/web/icons/Icon-192.png
--------------------------------------------------------------------------------
/web/icons/Icon-512.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MuwaffaqImam/FlutterCourseInnopolis/abbca9551ffd3a77b07f98ea50c761dba36420ff/web/icons/Icon-512.png
--------------------------------------------------------------------------------
/web/icons/Icon-maskable-192.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MuwaffaqImam/FlutterCourseInnopolis/abbca9551ffd3a77b07f98ea50c761dba36420ff/web/icons/Icon-maskable-192.png
--------------------------------------------------------------------------------
/web/icons/Icon-maskable-512.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MuwaffaqImam/FlutterCourseInnopolis/abbca9551ffd3a77b07f98ea50c761dba36420ff/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 | courses_codes
33 |
34 |
35 |
36 |
39 |
103 |
104 |
105 |
--------------------------------------------------------------------------------
/web/manifest.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "courses_codes",
3 | "short_name": "courses_codes",
4 | "start_url": ".",
5 | "display": "standalone",
6 | "background_color": "#0175C2",
7 | "theme_color": "#0175C2",
8 | "description": "A new Flutter project.",
9 | "orientation": "portrait-primary",
10 | "prefer_related_applications": false,
11 | "icons": [
12 | {
13 | "src": "icons/Icon-192.png",
14 | "sizes": "192x192",
15 | "type": "image/png"
16 | },
17 | {
18 | "src": "icons/Icon-512.png",
19 | "sizes": "512x512",
20 | "type": "image/png"
21 | },
22 | {
23 | "src": "icons/Icon-maskable-192.png",
24 | "sizes": "192x192",
25 | "type": "image/png",
26 | "purpose": "maskable"
27 | },
28 | {
29 | "src": "icons/Icon-maskable-512.png",
30 | "sizes": "512x512",
31 | "type": "image/png",
32 | "purpose": "maskable"
33 | }
34 | ]
35 | }
36 |
--------------------------------------------------------------------------------