├── .gitignore ├── .metadata ├── LICENSE ├── README.md ├── analysis_options.yaml ├── android ├── .gitignore ├── app │ ├── build.gradle │ ├── google-services.json │ └── src │ │ ├── debug │ │ └── AndroidManifest.xml │ │ ├── main │ │ ├── AndroidManifest.xml │ │ ├── kotlin │ │ │ └── com │ │ │ │ └── example │ │ │ │ └── flutter_30_tips │ │ │ │ └── MainActivity.kt │ │ └── res │ │ │ ├── drawable-v21 │ │ │ └── launch_background.xml │ │ │ ├── drawable │ │ │ └── launch_background.xml │ │ │ ├── mipmap-hdpi │ │ │ └── ic_launcher.png │ │ │ ├── mipmap-mdpi │ │ │ └── ic_launcher.png │ │ │ ├── mipmap-xhdpi │ │ │ └── ic_launcher.png │ │ │ ├── mipmap-xxhdpi │ │ │ └── ic_launcher.png │ │ │ ├── mipmap-xxxhdpi │ │ │ └── ic_launcher.png │ │ │ ├── values-night │ │ │ └── styles.xml │ │ │ └── values │ │ │ └── styles.xml │ │ └── profile │ │ └── AndroidManifest.xml ├── build.gradle ├── gradle.properties ├── gradle │ └── wrapper │ │ └── gradle-wrapper.properties └── settings.gradle ├── assets ├── Notification.mp3 └── tips20.png ├── fluttertips.png ├── 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 ├── home.dart ├── main.dart ├── tips1 │ └── tips1.dart ├── tips10 │ └── urlview.dart ├── tips11 │ └── pdfView.dart ├── tips12 │ ├── layout_builder_screen.dart │ ├── responsive.dart │ └── responsive_builder_screen.dart ├── tips13 │ └── isfirstRun.dart ├── tips14 │ └── resizeImage.dart ├── tips15 │ └── wa.dart ├── tips16 │ └── focusNode.dart ├── tips17 │ └── celebration.dart ├── tips18 │ └── zoomWid.dart ├── tips19 │ └── stepperWid.dart ├── tips2 │ ├── chat-details.dart │ ├── chatController.dart │ └── userList.dart ├── tips20 │ └── scroll.dart ├── tips21 │ ├── crearefolder.dart │ └── folderTypes │ │ └── externalFolder.dart ├── tips22 │ └── write_files.dart ├── tips23 │ └── tips23.dart ├── tips24 │ └── shimmer_effect.dart ├── tips25 │ └── tips25.dart ├── tips26 │ └── tips26.dart ├── tips27 │ ├── bargraphView.dart │ ├── piechartView.dart │ └── tips27.dart ├── tips28 │ └── tips28.dart ├── tips29 │ └── tips29.dart ├── tips3 │ ├── image.dart │ └── image_chat.dart ├── tips30 │ ├── bottomNavBar.dart │ ├── home.dart │ └── tips30.dart ├── tips31 │ └── tips31.dart ├── tips4 │ ├── audioController.dart │ └── voice_chat.dart ├── tips5 │ └── online.dart ├── tips6 │ └── searchSuggestion.dart ├── tips7 │ └── textformValidation.dart ├── tips8 │ ├── showCase.dart │ └── text_theme.dart └── tips9 │ ├── webView.dart │ └── wid.dart ├── linux ├── .gitignore ├── CMakeLists.txt ├── flutter │ ├── CMakeLists.txt │ ├── generated_plugin_registrant.cc │ ├── generated_plugin_registrant.h │ └── generated_plugins.cmake ├── main.cc ├── my_application.cc └── my_application.h ├── macos ├── .gitignore ├── Flutter │ ├── Flutter-Debug.xcconfig │ ├── Flutter-Release.xcconfig │ └── GeneratedPluginRegistrant.swift ├── Podfile ├── Runner.xcodeproj │ ├── project.pbxproj │ ├── project.xcworkspace │ │ └── xcshareddata │ │ │ └── IDEWorkspaceChecks.plist │ └── xcshareddata │ │ └── xcschemes │ │ └── Runner.xcscheme ├── Runner.xcworkspace │ ├── contents.xcworkspacedata │ └── xcshareddata │ │ └── IDEWorkspaceChecks.plist └── Runner │ ├── AppDelegate.swift │ ├── Assets.xcassets │ └── AppIcon.appiconset │ │ ├── Contents.json │ │ ├── app_icon_1024.png │ │ ├── app_icon_128.png │ │ ├── app_icon_16.png │ │ ├── app_icon_256.png │ │ ├── app_icon_32.png │ │ ├── app_icon_512.png │ │ └── app_icon_64.png │ ├── Base.lproj │ └── MainMenu.xib │ ├── Configs │ ├── AppInfo.xcconfig │ ├── Debug.xcconfig │ ├── Release.xcconfig │ └── Warnings.xcconfig │ ├── DebugProfile.entitlements │ ├── Info.plist │ ├── MainFlutterWindow.swift │ └── Release.entitlements ├── pubspec.lock ├── pubspec.yaml ├── test └── widget_test.dart ├── web ├── favicon.png ├── icons │ ├── Icon-192.png │ ├── Icon-512.png │ ├── Icon-maskable-192.png │ └── Icon-maskable-512.png ├── index.html └── manifest.json ├── windows ├── .gitignore ├── CMakeLists.txt ├── flutter │ ├── CMakeLists.txt │ ├── generated_plugin_registrant.cc │ ├── generated_plugin_registrant.h │ └── generated_plugins.cmake └── runner │ ├── CMakeLists.txt │ ├── Runner.rc │ ├── flutter_window.cpp │ ├── flutter_window.h │ ├── main.cpp │ ├── resource.h │ ├── resources │ └── app_icon.ico │ ├── runner.exe.manifest │ ├── utils.cpp │ ├── utils.h │ ├── win32_window.cpp │ └── win32_window.h └── youtubeChannel.png /.gitignore: -------------------------------------------------------------------------------- 1 | # Miscellaneous 2 | *.class 3 | *.log 4 | *.pyc 5 | *.swp 6 | .DS_Store 7 | .atom/ 8 | .buildlog/ 9 | .history 10 | .svn/ 11 | migrate_working_dir/ 12 | 13 | # IntelliJ related 14 | *.iml 15 | *.ipr 16 | *.iws 17 | .idea/ 18 | 19 | # The .vscode folder contains launch configuration and tasks you configure in 20 | # VS Code which you may wish to be included in version control, so this line 21 | # is commented out by default. 22 | #.vscode/ 23 | 24 | # Flutter/Dart/Pub related 25 | **/doc/api/ 26 | **/ios/Flutter/.last_build_id 27 | .dart_tool/ 28 | .flutter-plugins 29 | .flutter-plugins-dependencies 30 | .packages 31 | .pub-cache/ 32 | .pub/ 33 | /build/ 34 | /windows/ 35 | pubspec.lock 36 | 37 | # Web related 38 | lib/generated_plugin_registrant.dart 39 | 40 | # Symbolication related 41 | app.*.symbols 42 | 43 | # Obfuscation related 44 | app.*.map.json 45 | 46 | # Android Studio will place build artifacts here 47 | /android/app/debug 48 | /android/app/profile 49 | /android/app/release 50 | -------------------------------------------------------------------------------- /.metadata: -------------------------------------------------------------------------------- 1 | # This file tracks properties of this Flutter project. 2 | # Used by Flutter tool to assess capabilities and perform upgrades etc. 3 | # 4 | # This file should be version controlled. 5 | 6 | version: 7 | revision: f1875d570e39de09040c8f79aa13cc56baab8db1 8 | channel: stable 9 | 10 | project_type: app 11 | 12 | # Tracks metadata for the flutter migrate command 13 | migration: 14 | platforms: 15 | - platform: root 16 | create_revision: f1875d570e39de09040c8f79aa13cc56baab8db1 17 | base_revision: f1875d570e39de09040c8f79aa13cc56baab8db1 18 | - platform: android 19 | create_revision: f1875d570e39de09040c8f79aa13cc56baab8db1 20 | base_revision: f1875d570e39de09040c8f79aa13cc56baab8db1 21 | - platform: ios 22 | create_revision: f1875d570e39de09040c8f79aa13cc56baab8db1 23 | base_revision: f1875d570e39de09040c8f79aa13cc56baab8db1 24 | - platform: linux 25 | create_revision: f1875d570e39de09040c8f79aa13cc56baab8db1 26 | base_revision: f1875d570e39de09040c8f79aa13cc56baab8db1 27 | - platform: macos 28 | create_revision: f1875d570e39de09040c8f79aa13cc56baab8db1 29 | base_revision: f1875d570e39de09040c8f79aa13cc56baab8db1 30 | - platform: web 31 | create_revision: f1875d570e39de09040c8f79aa13cc56baab8db1 32 | base_revision: f1875d570e39de09040c8f79aa13cc56baab8db1 33 | - platform: windows 34 | create_revision: f1875d570e39de09040c8f79aa13cc56baab8db1 35 | base_revision: f1875d570e39de09040c8f79aa13cc56baab8db1 36 | 37 | # User provided section 38 | 39 | # List of Local paths (relative to this file) that should be 40 | # ignored by the migrate tool. 41 | # 42 | # Files that are not part of the templates will be ignored by default. 43 | unmanaged_files: 44 | - 'lib/main.dart' 45 | - 'ios/Runner.xcodeproj/project.pbxproj' 46 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) [2023] [LakshydeepVikramSah] 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Top 30 Amazing Flutter Tips With Lakshydeep Vikram 2 | 3 | flutter 4 | 5 | ### FT 1: Search In Flutter 6 | ### FT 2: Messaging With Firebase In Flutter 7 | ### FT 3: Messaging With Firebase Including Image In Flutter 8 | ### FT 4: Messaging With Firebase Including Voice In Flutter 9 | ### FT 5: Show User Online In Flutter 10 | ### FT 6: Search Suggestion & Selection In Flutter 11 | ### FT 7: TextFormField Validation In Flutter 12 | ### FT 8: TextTheme In Flutter 13 | ### FT 9: WebView In Flutter 14 | ### FT 10: Url Launcher In Flutter 15 | ### FT 11: Create, View, Print & Download PDF In Flutter 16 | ### FT 12: Responsiveness In Flutter 17 | ### FT 13: Is First Run In Flutter 18 | ### FT 14: Resize, Crop & Compress Image In Flutter 19 | ### FT 15: Send Direct Message To WhatsApp Contacts & Groups In Flutter 20 | ### FT 16: FocusNode In Flutter 21 | ### FT 17: Flutter Celebration / Confetti In Flutter 22 | ### FT 18: Zoom In Flutter 23 | ### FT 19: Stepper In Flutter 24 | ### FT 20: Silver AppBar In Flutter 25 | ### FT 21: Create Folder and Files In Flutter 26 | ### FT 22: Write To and Read From Files In Flutter 27 | ### FT 23: Rotation In Flutter 28 | ### FT 24: Shimmer Effect In Flutter 29 | ### FT 25: Searchable Dropdown In Flutter 30 | ### FT 26: Move Widget Up When Keyboard Appears In Flutter 31 | ### FT 27: Pie Chart and Bar Graph In Flutter 32 | ### FT 28: Numeral System In Flutter 33 | ### FT 29: Pagination In Flutter 34 | ### FT 30: Persistent Bottom Navigation Bar In Flutter 35 | 36 | ## YouTube Channel 37 | flutter 38 | 39 | ## LinkedIn 40 | Subscribe on LinkedIn 41 |   Buy Me A Coffee  42 | 43 | 44 | 45 | 46 | -------------------------------------------------------------------------------- /analysis_options.yaml: -------------------------------------------------------------------------------- 1 | # This file configures the analyzer, which statically analyzes Dart code to 2 | # check for errors, warnings, and lints. 3 | # 4 | # The issues identified by the analyzer are surfaced in the UI of Dart-enabled 5 | # IDEs (https://dart.dev/tools#ides-and-editors). The analyzer can also be 6 | # invoked from the command line by running `flutter analyze`. 7 | 8 | # The following line activates a set of recommended lints for Flutter apps, 9 | # packages, and plugins designed to encourage good coding practices. 10 | include: package:flutter_lints/flutter.yaml 11 | 12 | linter: 13 | # The lint rules applied to this project can be customized in the 14 | # section below to disable rules from the `package:flutter_lints/flutter.yaml` 15 | # included above or to enable additional rules. A list of all available lints 16 | # and their documentation is published at 17 | # https://dart-lang.github.io/linter/lints/index.html. 18 | # 19 | # Instead of disabling a lint rule for the entire project in the 20 | # section below, it can also be suppressed for a single line of code 21 | # or a specific dart file by using the `// ignore: name_of_lint` and 22 | # `// ignore_for_file: name_of_lint` syntax on the line or in the file 23 | # producing the lint. 24 | rules: 25 | # avoid_print: false # Uncomment to disable the `avoid_print` rule 26 | # prefer_single_quotes: true # Uncomment to enable the `prefer_single_quotes` rule 27 | 28 | # Additional information about this file can be found at 29 | # https://dart.dev/guides/language/analysis-options 30 | -------------------------------------------------------------------------------- /android/.gitignore: -------------------------------------------------------------------------------- 1 | gradle-wrapper.jar 2 | /.gradle 3 | /captures/ 4 | /gradlew 5 | /gradlew.bat 6 | /local.properties 7 | GeneratedPluginRegistrant.java 8 | 9 | # Remember to never publicly share your keystore. 10 | # See https://flutter.dev/docs/deployment/android#reference-the-keystore-from-the-app 11 | key.properties 12 | **/*.keystore 13 | **/*.jks 14 | -------------------------------------------------------------------------------- /android/app/build.gradle: -------------------------------------------------------------------------------- 1 | def localProperties = new Properties() 2 | def localPropertiesFile = rootProject.file('local.properties') 3 | if (localPropertiesFile.exists()) { 4 | localPropertiesFile.withReader('UTF-8') { reader -> 5 | localProperties.load(reader) 6 | } 7 | } 8 | 9 | def flutterRoot = localProperties.getProperty('flutter.sdk') 10 | if (flutterRoot == null) { 11 | throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.") 12 | } 13 | 14 | def flutterVersionCode = localProperties.getProperty('flutter.versionCode') 15 | if (flutterVersionCode == null) { 16 | flutterVersionCode = '1' 17 | } 18 | 19 | def flutterVersionName = localProperties.getProperty('flutter.versionName') 20 | if (flutterVersionName == null) { 21 | flutterVersionName = '1.0' 22 | } 23 | 24 | apply plugin: 'com.android.application' 25 | apply plugin: 'kotlin-android' 26 | apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle" 27 | apply plugin: 'com.google.gms.google-services' 28 | 29 | android { 30 | compileSdkVersion 33 31 | ndkVersion flutter.ndkVersion 32 | 33 | compileOptions { 34 | sourceCompatibility JavaVersion.VERSION_1_8 35 | targetCompatibility JavaVersion.VERSION_1_8 36 | } 37 | 38 | kotlinOptions { 39 | jvmTarget = '1.8' 40 | } 41 | 42 | sourceSets { 43 | main.java.srcDirs += 'src/main/kotlin' 44 | } 45 | 46 | defaultConfig { 47 | // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html). 48 | applicationId "com.example.flutter_30_tips" 49 | // You can update the following values to match your application needs. 50 | // For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-build-configuration. 51 | minSdkVersion 21 52 | targetSdkVersion flutter.targetSdkVersion 53 | versionCode flutterVersionCode.toInteger() 54 | versionName flutterVersionName 55 | } 56 | 57 | buildTypes { 58 | release { 59 | // TODO: Add your own signing config for the release build. 60 | // Signing with the debug keys for now, so `flutter run --release` works. 61 | signingConfig signingConfigs.debug 62 | } 63 | } 64 | } 65 | 66 | flutter { 67 | source '../..' 68 | } 69 | 70 | dependencies { 71 | implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" 72 | implementation platform('com.google.firebase:firebase-bom:30.3.2') 73 | implementation 'androidx.multidex:multidex:2.0.1' 74 | } 75 | -------------------------------------------------------------------------------- /android/app/google-services.json: -------------------------------------------------------------------------------- 1 | { 2 | "project_info": { 3 | "project_number": "612258289358", 4 | "project_id": "flutter30tips", 5 | "storage_bucket": "flutter30tips.appspot.com" 6 | }, 7 | "client": [ 8 | { 9 | "client_info": { 10 | "mobilesdk_app_id": "1:612258289358:android:b88492d1454f0baf5e229f", 11 | "android_client_info": { 12 | "package_name": "com.example.flutter_30_tips" 13 | } 14 | }, 15 | "oauth_client": [ 16 | { 17 | "client_id": "612258289358-ajhld0i8lbmqkl6hi23rk1kgk24osgeq.apps.googleusercontent.com", 18 | "client_type": 3 19 | } 20 | ], 21 | "api_key": [ 22 | { 23 | "current_key": "AIzaSyA-2wwrvzD0hz2J40-FVRxq16FdkwnkjzI" 24 | } 25 | ], 26 | "services": { 27 | "appinvite_service": { 28 | "other_platform_oauth_client": [ 29 | { 30 | "client_id": "612258289358-ajhld0i8lbmqkl6hi23rk1kgk24osgeq.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 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /android/app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 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 | 43 | 51 | 55 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 68 | 71 | 72 | 73 | -------------------------------------------------------------------------------- /android/app/src/main/kotlin/com/example/flutter_30_tips/MainActivity.kt: -------------------------------------------------------------------------------- 1 | package com.example.flutter_30_tips 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/lakshydeep-14/30FlutterTips/ddaa0da4b1ed90c51f26efc5a6c892efbb239337/android/app/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lakshydeep-14/30FlutterTips/ddaa0da4b1ed90c51f26efc5a6c892efbb239337/android/app/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lakshydeep-14/30FlutterTips/ddaa0da4b1ed90c51f26efc5a6c892efbb239337/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lakshydeep-14/30FlutterTips/ddaa0da4b1ed90c51f26efc5a6c892efbb239337/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lakshydeep-14/30FlutterTips/ddaa0da4b1ed90c51f26efc5a6c892efbb239337/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 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /android/build.gradle: -------------------------------------------------------------------------------- 1 | buildscript { 2 | ext.kotlin_version = '1.6.10' 3 | repositories { 4 | google() 5 | mavenCentral() 6 | } 7 | 8 | dependencies { 9 | classpath 'com.android.tools.build:gradle:7.1.2' 10 | classpath 'com.google.gms:google-services:4.3.13' 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/gradle.properties: -------------------------------------------------------------------------------- 1 | org.gradle.jvmargs=-Xmx1536M 2 | android.useAndroidX=true 3 | android.enableJetifier=true 4 | -------------------------------------------------------------------------------- /android/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Fri Jun 23 08:50:38 CEST 2017 2 | distributionBase=GRADLE_USER_HOME 3 | distributionPath=wrapper/dists 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | distributionUrl=https\://services.gradle.org/distributions/gradle-7.4-all.zip 7 | -------------------------------------------------------------------------------- /android/settings.gradle: -------------------------------------------------------------------------------- 1 | include ':app' 2 | 3 | def localPropertiesFile = new File(rootProject.projectDir, "local.properties") 4 | def properties = new Properties() 5 | 6 | assert localPropertiesFile.exists() 7 | localPropertiesFile.withReader("UTF-8") { reader -> properties.load(reader) } 8 | 9 | def flutterSdkPath = properties.getProperty("flutter.sdk") 10 | assert flutterSdkPath != null, "flutter.sdk not set in local.properties" 11 | apply from: "$flutterSdkPath/packages/flutter_tools/gradle/app_plugin_loader.gradle" 12 | -------------------------------------------------------------------------------- /assets/Notification.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lakshydeep-14/30FlutterTips/ddaa0da4b1ed90c51f26efc5a6c892efbb239337/assets/Notification.mp3 -------------------------------------------------------------------------------- /assets/tips20.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lakshydeep-14/30FlutterTips/ddaa0da4b1ed90c51f26efc5a6c892efbb239337/assets/tips20.png -------------------------------------------------------------------------------- /fluttertips.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lakshydeep-14/30FlutterTips/ddaa0da4b1ed90c51f26efc5a6c892efbb239337/fluttertips.png -------------------------------------------------------------------------------- /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 | 11.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, '11.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/lakshydeep-14/30FlutterTips/ddaa0da4b1ed90c51f26efc5a6c892efbb239337/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/lakshydeep-14/30FlutterTips/ddaa0da4b1ed90c51f26efc5a6c892efbb239337/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/lakshydeep-14/30FlutterTips/ddaa0da4b1ed90c51f26efc5a6c892efbb239337/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/lakshydeep-14/30FlutterTips/ddaa0da4b1ed90c51f26efc5a6c892efbb239337/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/lakshydeep-14/30FlutterTips/ddaa0da4b1ed90c51f26efc5a6c892efbb239337/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/lakshydeep-14/30FlutterTips/ddaa0da4b1ed90c51f26efc5a6c892efbb239337/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/lakshydeep-14/30FlutterTips/ddaa0da4b1ed90c51f26efc5a6c892efbb239337/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/lakshydeep-14/30FlutterTips/ddaa0da4b1ed90c51f26efc5a6c892efbb239337/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/lakshydeep-14/30FlutterTips/ddaa0da4b1ed90c51f26efc5a6c892efbb239337/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/lakshydeep-14/30FlutterTips/ddaa0da4b1ed90c51f26efc5a6c892efbb239337/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/lakshydeep-14/30FlutterTips/ddaa0da4b1ed90c51f26efc5a6c892efbb239337/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/lakshydeep-14/30FlutterTips/ddaa0da4b1ed90c51f26efc5a6c892efbb239337/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/lakshydeep-14/30FlutterTips/ddaa0da4b1ed90c51f26efc5a6c892efbb239337/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/lakshydeep-14/30FlutterTips/ddaa0da4b1ed90c51f26efc5a6c892efbb239337/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/lakshydeep-14/30FlutterTips/ddaa0da4b1ed90c51f26efc5a6c892efbb239337/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/lakshydeep-14/30FlutterTips/ddaa0da4b1ed90c51f26efc5a6c892efbb239337/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lakshydeep-14/30FlutterTips/ddaa0da4b1ed90c51f26efc5a6c892efbb239337/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lakshydeep-14/30FlutterTips/ddaa0da4b1ed90c51f26efc5a6c892efbb239337/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md: -------------------------------------------------------------------------------- 1 | # Launch Screen Assets 2 | 3 | You can customize the launch screen with your own desired assets by replacing the image files in this directory. 4 | 5 | You can also do it by opening your Flutter project's Xcode project with `open ios/Runner.xcworkspace`, selecting `Runner/Assets.xcassets` in the Project Navigator and dropping in the desired images. -------------------------------------------------------------------------------- /ios/Runner/Base.lproj/LaunchScreen.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | -------------------------------------------------------------------------------- /ios/Runner/Base.lproj/Main.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /ios/Runner/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | $(DEVELOPMENT_LANGUAGE) 7 | CFBundleDisplayName 8 | Flutter 30 Tips 9 | CFBundleExecutable 10 | $(EXECUTABLE_NAME) 11 | CFBundleIdentifier 12 | $(PRODUCT_BUNDLE_IDENTIFIER) 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | flutter_30_tips 17 | CFBundlePackageType 18 | APPL 19 | CFBundleShortVersionString 20 | $(FLUTTER_BUILD_NAME) 21 | CFBundleSignature 22 | ???? 23 | CFBundleVersion 24 | $(FLUTTER_BUILD_NUMBER) 25 | LSRequiresIPhoneOS 26 | 27 | UILaunchStoryboardName 28 | LaunchScreen 29 | UIMainStoryboardFile 30 | Main 31 | UISupportedInterfaceOrientations 32 | 33 | UIInterfaceOrientationPortrait 34 | UIInterfaceOrientationLandscapeLeft 35 | UIInterfaceOrientationLandscapeRight 36 | 37 | UISupportedInterfaceOrientations~ipad 38 | 39 | UIInterfaceOrientationPortrait 40 | UIInterfaceOrientationPortraitUpsideDown 41 | UIInterfaceOrientationLandscapeLeft 42 | UIInterfaceOrientationLandscapeRight 43 | 44 | UIViewControllerBasedStatusBarAppearance 45 | 46 | CADisableMinimumFrameDurationOnPhone 47 | 48 | UIApplicationSupportsIndirectInputEvents 49 | 50 | 51 | 52 | -------------------------------------------------------------------------------- /ios/Runner/Runner-Bridging-Header.h: -------------------------------------------------------------------------------- 1 | #import "GeneratedPluginRegistrant.h" 2 | -------------------------------------------------------------------------------- /lib/main.dart: -------------------------------------------------------------------------------- 1 | // ignore_for_file: prefer_const_constructors 2 | 3 | import 'package:device_preview/device_preview.dart'; 4 | import 'package:firebase_core/firebase_core.dart'; 5 | import 'package:flutter/foundation.dart'; 6 | import 'package:flutter/material.dart'; 7 | import 'package:flutter_30_tips/home.dart'; 8 | import 'package:flutter_30_tips/tips8/text_theme.dart'; 9 | import 'package:get/get.dart'; 10 | 11 | void main() async { 12 | WidgetsFlutterBinding.ensureInitialized(); 13 | await Firebase.initializeApp(); 14 | runApp( 15 | DevicePreview( 16 | enabled: !kReleaseMode, 17 | builder: (context) => MyApp(), // Wrap your app 18 | ), 19 | ); 20 | } 21 | 22 | class MyApp extends StatelessWidget { 23 | const MyApp({Key? key}) : super(key: key); 24 | 25 | // This widget is the root of your application. 26 | @override 27 | Widget build(BuildContext context) { 28 | return GetMaterialApp( 29 | useInheritedMediaQuery: true, 30 | locale: DevicePreview.locale(context), 31 | builder: DevicePreview.appBuilder, 32 | debugShowCheckedModeBanner: false, 33 | theme: AppTheme.light(), 34 | home: Home(), 35 | ); 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /lib/tips10/urlview.dart: -------------------------------------------------------------------------------- 1 | // ignore_for_file: prefer_const_constructors 2 | 3 | import 'package:flutter/material.dart'; 4 | import 'package:flutter_30_tips/home.dart'; 5 | import 'package:font_awesome_flutter/font_awesome_flutter.dart'; 6 | import 'package:url_launcher/url_launcher.dart'; 7 | 8 | class URLLauncherWid extends StatefulWidget { 9 | const URLLauncherWid({Key? key}) : super(key: key); 10 | 11 | @override 12 | State createState() => _URLLauncherWidState(); 13 | } 14 | 15 | class _URLLauncherWidState extends State { 16 | // for opening url 17 | void profile(String host) async { 18 | Uri url = Uri.parse(host); 19 | if (await canLaunchUrl(url)) { 20 | await launchUrl( 21 | url, 22 | mode: LaunchMode.platformDefault, 23 | ); 24 | } else { 25 | throw "Can't launch link"; 26 | } 27 | } 28 | 29 | //for call 30 | void call() async { 31 | Uri url = Uri(scheme: 'tel', path: '+9779801234567'); 32 | if (await canLaunchUrl(url)) { 33 | await launchUrl(url); 34 | } else { 35 | throw "Can't launch call"; 36 | } 37 | } 38 | 39 | //for sending mail 40 | void mail() async { 41 | Uri url = Uri(scheme: 'mailto', path: "lvikramsah@gmail.com"); 42 | if (await canLaunchUrl(url)) { 43 | await launchUrl(url); 44 | } else { 45 | throw "Can't launch mail"; 46 | } 47 | } 48 | 49 | //for sending message 50 | void msg() async { 51 | Uri url = Uri(scheme: 'sms', path: "+9779801234567"); 52 | if (await canLaunchUrl(url)) { 53 | await launchUrl(url); 54 | } else { 55 | throw "Can't launch message"; 56 | } 57 | } 58 | 59 | @override 60 | Widget build(BuildContext context) { 61 | return Scaffold( 62 | appBar: customAppBar("Tips 10"), 63 | body: Column( 64 | crossAxisAlignment: CrossAxisAlignment.center, 65 | mainAxisAlignment: MainAxisAlignment.center, 66 | children: [ 67 | Center( 68 | child: IconButton( 69 | onPressed: () => call(), 70 | icon: Icon( 71 | Icons.call, 72 | color: mainColor, 73 | )), 74 | ), 75 | Center( 76 | child: IconButton( 77 | onPressed: () => mail(), 78 | icon: Icon( 79 | Icons.email, 80 | color: mainColor, 81 | )), 82 | ), 83 | Center( 84 | child: IconButton( 85 | onPressed: () => msg(), 86 | icon: Icon( 87 | Icons.message, 88 | color: mainColor, 89 | )), 90 | ), 91 | Center( 92 | child: IconButton( 93 | onPressed: () => 94 | profile('https://www.github.com/lakshydeep-14/'), 95 | icon: Icon( 96 | FontAwesomeIcons.github, 97 | color: mainColor, 98 | )), 99 | ), 100 | Center( 101 | child: IconButton( 102 | onPressed: () => 103 | profile('https://www.linkedin.com/in/lakshydeep-14/'), 104 | icon: Icon( 105 | FontAwesomeIcons.linkedin, 106 | color: mainColor, 107 | )), 108 | ), 109 | Center( 110 | child: IconButton( 111 | onPressed: () => profile('https://lakshydeep-14.medium.com'), 112 | icon: Icon( 113 | FontAwesomeIcons.medium, 114 | color: mainColor, 115 | )), 116 | ), 117 | Center( 118 | child: IconButton( 119 | onPressed: () => 120 | profile('https://github.com/lakshydeep-14/30FlutterTips'), 121 | icon: Icon( 122 | Icons.link, 123 | color: mainColor, 124 | )), 125 | ) 126 | ]), 127 | ); 128 | } 129 | } 130 | -------------------------------------------------------------------------------- /lib/tips11/pdfView.dart: -------------------------------------------------------------------------------- 1 | // ignore_for_file: prefer_const_constructors 2 | 3 | import 'dart:typed_data'; 4 | 5 | import 'package:flutter/material.dart'; 6 | import 'package:flutter_30_tips/home.dart'; 7 | import 'package:pdf/pdf.dart'; 8 | import 'package:pdf/widgets.dart' as pdfWid; 9 | import 'package:printing/printing.dart'; 10 | 11 | class PDFView extends StatefulWidget { 12 | const PDFView({ 13 | Key? key, 14 | }) : super(key: key); 15 | 16 | @override 17 | _PDFViewState createState() => _PDFViewState(); 18 | } 19 | 20 | class _PDFViewState extends State { 21 | @override 22 | void initState() { 23 | super.initState(); 24 | } 25 | 26 | @override 27 | Widget build(BuildContext context) { 28 | return Scaffold( 29 | appBar: customAppBar("Tips 11"), 30 | body: PdfPreview( 31 | build: (format) => _createPdf( 32 | format, 33 | ), 34 | ), 35 | ); 36 | } 37 | 38 | Future _createPdf( 39 | PdfPageFormat format, 40 | ) async { 41 | final pdf = pdfWid.Document( 42 | version: PdfVersion.pdf_1_4, 43 | compress: true, 44 | ); 45 | pdf.addPage( 46 | pdfWid.Page( 47 | pageFormat: PdfPageFormat((80 * (72.0 / 25.4)), 600, 48 | marginAll: 5 * (72.0 / 25.4)), 49 | //pageFormat: format, 50 | build: (context) { 51 | return pdfWid.SizedBox( 52 | width: double.infinity, 53 | child: pdfWid.FittedBox( 54 | child: pdfWid.Column( 55 | mainAxisAlignment: pdfWid.MainAxisAlignment.start, 56 | children: [ 57 | pdfWid.Text("Follow", 58 | style: pdfWid.TextStyle( 59 | fontSize: 35, fontWeight: pdfWid.FontWeight.bold)), 60 | pdfWid.Container( 61 | width: 250, 62 | height: 1.5, 63 | margin: pdfWid.EdgeInsets.symmetric(vertical: 5), 64 | color: PdfColors.black, 65 | ), 66 | pdfWid.Container( 67 | width: 300, 68 | child: pdfWid.Text("#30FlutterTips", 69 | style: pdfWid.TextStyle( 70 | fontSize: 35, 71 | fontWeight: pdfWid.FontWeight.bold, 72 | ), 73 | textAlign: pdfWid.TextAlign.center, 74 | maxLines: 5), 75 | ), 76 | pdfWid.Container( 77 | width: 250, 78 | height: 1.5, 79 | margin: pdfWid.EdgeInsets.symmetric(vertical: 10), 80 | color: PdfColors.black, 81 | ), 82 | pdfWid.Text("Lakshydeep Vikram", 83 | style: pdfWid.TextStyle( 84 | fontSize: 25, fontWeight: pdfWid.FontWeight.bold)), 85 | pdfWid.Text("Follow on Medium, LinkedIn, GitHub", 86 | style: pdfWid.TextStyle( 87 | fontSize: 25, fontWeight: pdfWid.FontWeight.bold)), 88 | ])), 89 | ); 90 | }, 91 | ), 92 | ); 93 | return pdf.save(); 94 | } 95 | } 96 | -------------------------------------------------------------------------------- /lib/tips12/layout_builder_screen.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:flutter_30_tips/home.dart'; 3 | import 'package:flutter_30_tips/tips8/showCase.dart'; 4 | 5 | class LayoutBuilderScreen extends StatefulWidget { 6 | const LayoutBuilderScreen({super.key}); 7 | 8 | @override 9 | State createState() => _LayoutBuilderScreenState(); 10 | } 11 | 12 | class _LayoutBuilderScreenState extends State { 13 | @override 14 | Widget build(BuildContext context) { 15 | return Scaffold( 16 | body: LayoutBuilder(builder: (context, size) { 17 | if (size.maxWidth >= 320 && size.maxWidth <= 480) { 18 | return Column( 19 | children: [ 20 | Expanded(child: _box("Flutter", Colors.red)), 21 | Flexible(child: _box("Meetup", Colors.orange)), 22 | _screen("Mobile") 23 | ], 24 | ); 25 | } else if (size.maxWidth >= 481 && size.maxWidth <= 1024) { 26 | return Column( 27 | children: [ 28 | Row(children: [ 29 | Expanded(child: _box("Flutter", Colors.red)), 30 | Flexible(child: _box("Meetup", Colors.orange)), 31 | ]), 32 | _screen("Tab") 33 | ], 34 | ); 35 | } else if (size.maxWidth >= 1025 && size.maxWidth <= 1200) { 36 | return Column( 37 | children: [ 38 | Row(children: [ 39 | Expanded(child: _box("Flutter", Colors.red)), 40 | Flexible(child: _box("Meetup", Colors.orange)), 41 | ]), 42 | _screen("Desktop") 43 | ], 44 | ); 45 | } else { 46 | return Column( 47 | children: [ 48 | Row(children: [ 49 | Expanded(child: _box("Flutter", Colors.red)), 50 | Flexible(child: _box("Meetup", Colors.orange)), 51 | ]), 52 | _screen("Large Screen") 53 | ], 54 | ); 55 | } 56 | }), 57 | ); 58 | } 59 | 60 | Widget _box(String label, Color color) { 61 | return Container( 62 | width: double.maxFinite, 63 | height: 200, 64 | color: color, 65 | child: Center(child: Text(label)), 66 | ); 67 | } 68 | 69 | Widget _screen(String label) { 70 | return Center( 71 | child: Text( 72 | label, 73 | style: context.text.headline1!.copyWith(fontSize: 30, color: mainColor), 74 | ), 75 | ); 76 | } 77 | } 78 | -------------------------------------------------------------------------------- /lib/tips12/responsive_builder_screen.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:responsive_builder/responsive_builder.dart'; 3 | 4 | class ResScreen extends StatefulWidget { 5 | const ResScreen({super.key}); 6 | 7 | @override 8 | State createState() => _ResScreenState(); 9 | } 10 | 11 | class _ResScreenState extends State { 12 | @override 13 | Widget build(BuildContext context) { 14 | return Scaffold( 15 | body: // Construct and pass in a widget builder per screen type 16 | ScreenTypeLayout.builder( 17 | mobile: (BuildContext context) => Container(color: Colors.blue), 18 | tablet: (BuildContext context) => Container(color: Colors.yellow), 19 | desktop: (BuildContext context) => Container(color: Colors.red), 20 | watch: (BuildContext context) => Container(color: Colors.purple), 21 | ), 22 | ); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /lib/tips13/isfirstRun.dart: -------------------------------------------------------------------------------- 1 | // ignore_for_file: sort_child_properties_last, prefer_const_constructors 2 | 3 | import 'package:flutter/material.dart'; 4 | import 'package:flutter_30_tips/home.dart'; 5 | import 'package:is_first_run/is_first_run.dart'; 6 | import 'package:flutter_30_tips/tips8/showCase.dart'; 7 | 8 | class IsFirstWidget extends StatefulWidget { 9 | const IsFirstWidget({ 10 | Key? key, 11 | }) : super(key: key); 12 | 13 | @override 14 | _IsFirstWidgetState createState() => _IsFirstWidgetState(); 15 | } 16 | 17 | class _IsFirstWidgetState extends State { 18 | bool? _isFirstRun; 19 | void _checkFirstRun() async { 20 | bool ifr = await IsFirstRun.isFirstRun(); 21 | setState(() { 22 | _isFirstRun = ifr; 23 | }); 24 | } 25 | 26 | bool? _isFirstCall; 27 | void _checkFirstCall() async { 28 | bool ifc = await IsFirstRun.isFirstCall(); 29 | setState(() { 30 | _isFirstCall = ifc; 31 | }); 32 | } 33 | 34 | void _reset() async { 35 | await IsFirstRun.reset(); 36 | _checkFirstRun(); 37 | _checkFirstCall(); 38 | } 39 | 40 | @override 41 | Widget build(BuildContext context) { 42 | return Scaffold( 43 | appBar: customAppBar("Tips 13"), 44 | body: Center( 45 | child: Column( 46 | mainAxisAlignment: MainAxisAlignment.center, 47 | children: [ 48 | Text( 49 | 'Is first run: ${_isFirstRun ?? 'Unknown'}', 50 | style: context.text.headline1, 51 | ), 52 | ElevatedButton( 53 | child: Text('Check first run'), onPressed: _checkFirstRun), 54 | Text( 55 | 'Is first call: ${_isFirstCall ?? 'Unknown'}', 56 | style: context.text.headline1, 57 | ), 58 | ElevatedButton( 59 | child: Text('Check first call'), onPressed: _checkFirstCall), 60 | ElevatedButton(child: Text('Reset'), onPressed: _reset), 61 | SizedBox(height: 24), 62 | ]), 63 | ), 64 | ); 65 | } 66 | } 67 | -------------------------------------------------------------------------------- /lib/tips14/resizeImage.dart: -------------------------------------------------------------------------------- 1 | import 'dart:io'; 2 | 3 | import 'package:flutter/material.dart'; 4 | import 'package:flutter_30_tips/home.dart'; 5 | import 'package:flutter_native_image/flutter_native_image.dart'; 6 | import 'package:image_picker/image_picker.dart'; 7 | import 'package:flutter_30_tips/tips8/showCase.dart'; 8 | 9 | class ResizeImageWidget extends StatefulWidget { 10 | const ResizeImageWidget({Key? key}) : super(key: key); 11 | 12 | @override 13 | State createState() => _ResizeImageWidgetState(); 14 | } 15 | 16 | class _ResizeImageWidgetState extends State { 17 | File? imageFilePath, cropped, resized, compressed; 18 | List? imageProperties; 19 | bool loading = false; 20 | _pickImage() async { 21 | setState(() { 22 | loading = true; 23 | }); 24 | await ImagePicker.platform 25 | .getImage(source: ImageSource.gallery) 26 | .then((value) { 27 | if (_pickImage != null) { 28 | setState(() { 29 | imageFilePath = File(value!.path); 30 | }); 31 | } 32 | }); 33 | var a = await _compressImage(); 34 | var b = await _resizeImage(); 35 | var c = await _cropImage(); 36 | var d = await _imageProperties(); 37 | setState(() { 38 | cropped = c; 39 | resized = b; 40 | compressed = a; 41 | imageProperties = d; 42 | loading = false; 43 | }); 44 | } 45 | 46 | _compressImage() async { 47 | File compressedFile = await FlutterNativeImage.compressImage( 48 | imageFilePath!.path, 49 | quality: 40, 50 | percentage: 50); 51 | return compressedFile; 52 | } 53 | 54 | _resizeImage() async { 55 | File compressedFile = await FlutterNativeImage.compressImage( 56 | imageFilePath!.path, 57 | quality: 80, 58 | targetWidth: 600, 59 | targetHeight: 300); 60 | return compressedFile; 61 | } 62 | 63 | _imageProperties() async { 64 | ImageProperties properties = 65 | await FlutterNativeImage.getImageProperties(imageFilePath!.path); 66 | 67 | return [ 68 | properties.height, 69 | properties.width, 70 | ImageOrientation.values[properties.orientation.index] 71 | ]; 72 | } 73 | 74 | _cropImage() async { 75 | File croppedFile = await FlutterNativeImage.cropImage( 76 | imageFilePath!.path, 50, 50, 100, 100); 77 | return croppedFile; 78 | } 79 | 80 | @override 81 | void initState() { 82 | // TODO: implement initState 83 | super.initState(); 84 | _pickImage(); 85 | } 86 | 87 | @override 88 | Widget build(BuildContext context) { 89 | return Scaffold( 90 | appBar: customAppBar("Tips 14"), 91 | body: loading == true 92 | ? CircularProgressIndicator() 93 | : SingleChildScrollView( 94 | child: Column( 95 | crossAxisAlignment: CrossAxisAlignment.start, 96 | children: [ 97 | Container( 98 | height: 0.5 * MediaQuery.of(context).size.height, 99 | child: Image.file(imageFilePath!)), 100 | Text( 101 | "Original Height:${imageProperties![0].toString()}", 102 | style: context.text.headline4!, 103 | ), 104 | Text( 105 | "Original Width:${imageProperties![1].toString()}", 106 | style: context.text.headline4!, 107 | ), 108 | Text( 109 | "Original Orientation:${imageProperties![2].toString()}", 110 | style: context.text.headline4!, 111 | ), 112 | Divider( 113 | height: 10, 114 | thickness: 2, 115 | ), 116 | Text( 117 | "Compressed Image", 118 | style: context.text.headline2!, 119 | ), 120 | Image.file(compressed!), 121 | Divider( 122 | height: 10, 123 | thickness: 2, 124 | ), 125 | Text( 126 | "Resized Image", 127 | style: context.text.headline2!, 128 | ), 129 | Image.file(resized!), 130 | Divider( 131 | height: 10, 132 | thickness: 2, 133 | ), 134 | Text( 135 | "Cropped Image", 136 | style: context.text.headline2!, 137 | ), 138 | Image.file(cropped!), 139 | ], 140 | ), 141 | ), 142 | ); 143 | } 144 | } 145 | -------------------------------------------------------------------------------- /lib/tips15/wa.dart: -------------------------------------------------------------------------------- 1 | // ignore_for_file: prefer_const_constructors 2 | 3 | import 'package:flutter/material.dart'; 4 | import 'package:flutter_30_tips/home.dart'; 5 | import 'package:font_awesome_flutter/font_awesome_flutter.dart'; 6 | import 'package:share_plus/share_plus.dart'; 7 | import 'package:url_launcher/url_launcher.dart'; 8 | import 'package:flutter_30_tips/tips8/showCase.dart'; 9 | 10 | class WhatsAppChat extends StatefulWidget { 11 | const WhatsAppChat({Key? key}) : super(key: key); 12 | 13 | @override 14 | State createState() => _WhatsAppChatState(); 15 | } 16 | 17 | class _WhatsAppChatState extends State { 18 | //edit groupLink and numberWithCode firsr 19 | String groupLink = ""; //https://chat.whatsapp.com/HMudsgtHEzS7xLmHrN8El/ 20 | String numberWithCode = ""; //https://wa.me/9779812345678/ 21 | void wa(String host) async { 22 | Uri url = 23 | Uri.parse("$host?text=Follow 30FlutterTips With Lakshydeep Vikram"); 24 | if (await canLaunchUrl(url)) { 25 | await launchUrl( 26 | url, 27 | mode: LaunchMode.externalApplication, 28 | ); 29 | } else { 30 | throw "Can't launch link"; 31 | } 32 | } 33 | 34 | @override 35 | Widget build(BuildContext context) { 36 | return Scaffold( 37 | appBar: customAppBar("Tips 10"), 38 | body: Column( 39 | crossAxisAlignment: CrossAxisAlignment.center, 40 | mainAxisAlignment: MainAxisAlignment.center, 41 | children: [ 42 | Center( 43 | child: Text( 44 | "WhatsApp Number", 45 | style: context.text.headline2!, 46 | ), 47 | ), 48 | Center( 49 | child: IconButton( 50 | onPressed: () => wa(numberWithCode), 51 | icon: Icon( 52 | FontAwesomeIcons.whatsapp, 53 | color: mainColor, 54 | )), 55 | ), 56 | Center( 57 | child: Text( 58 | "WhatsApp Group", 59 | style: context.text.headline2!, 60 | ), 61 | ), 62 | Center( 63 | child: IconButton( 64 | onPressed: () => wa(groupLink), 65 | icon: Icon( 66 | FontAwesomeIcons.whatsapp, 67 | color: mainColor, 68 | )), 69 | ), 70 | Center( 71 | child: Text( 72 | "WhatsApp Any", 73 | style: context.text.headline2!, 74 | ), 75 | ), 76 | Center( 77 | child: IconButton( 78 | onPressed: () => wa('https://wa.me/'), 79 | icon: Icon( 80 | FontAwesomeIcons.whatsapp, 81 | color: mainColor, 82 | )), 83 | ), 84 | Center( 85 | child: Text( 86 | "Share Message/link to Group", 87 | style: context.text.headline2!, 88 | ), 89 | ), 90 | Center( 91 | child: IconButton( 92 | onPressed: () async { 93 | final box = context.findRenderObject() as RenderBox?; 94 | await Share.share( 95 | "text", 96 | subject: "subject", 97 | sharePositionOrigin: 98 | box!.localToGlobal(Offset.zero) & box.size, 99 | ); 100 | }, 101 | icon: Icon( 102 | FontAwesomeIcons.share, 103 | color: mainColor, 104 | )), 105 | ), 106 | ]), 107 | ); 108 | } 109 | } 110 | -------------------------------------------------------------------------------- /lib/tips16/focusNode.dart: -------------------------------------------------------------------------------- 1 | // ignore_for_file: prefer_const_constructors 2 | 3 | import 'package:flutter/material.dart'; 4 | import 'package:flutter_30_tips/home.dart'; 5 | import 'package:flutter_30_tips/tips8/showCase.dart'; 6 | 7 | class FocusNodeWid extends StatefulWidget { 8 | const FocusNodeWid({Key? key}) : super(key: key); 9 | 10 | @override 11 | State createState() => _FocusNodeWidState(); 12 | } 13 | 14 | class _FocusNodeWidState extends State { 15 | List textEditingControllerList = 16 | List.generate(5, (index) => TextEditingController()); 17 | List focusNodeList = List.generate(5, (index) => FocusNode()); 18 | 19 | @override 20 | void initState() { 21 | // TODO: implement initState 22 | super.initState(); 23 | } 24 | 25 | @override 26 | Widget build(BuildContext context) { 27 | return Scaffold( 28 | appBar: customAppBar("Tips 16"), 29 | body: SingleChildScrollView( 30 | padding: const EdgeInsets.only(top: 50), 31 | child: Column( 32 | mainAxisAlignment: MainAxisAlignment.center, 33 | children: [ 34 | ...textEditingControllerList.asMap().entries.map( 35 | (e) => Padding( 36 | padding: const EdgeInsets.symmetric( 37 | horizontal: 25.0, vertical: 10), 38 | child: TextFormField( 39 | textInputAction: TextInputAction.done, 40 | controller: e.value, 41 | onEditingComplete: () { 42 | if (int.parse(e.key.toString()) == 4) { 43 | FocusScope.of(context).unfocus(); 44 | ScaffoldMessenger.of(context).showSnackBar(SnackBar( 45 | content: Text( 46 | "Unfocused", 47 | style: context.text.headline3, 48 | ), 49 | )); 50 | } else { 51 | FocusScope.of(context).requestFocus( 52 | focusNodeList[int.parse(e.key.toString()) + 1]); 53 | } 54 | }, 55 | focusNode: focusNodeList[e.key], 56 | decoration: InputDecoration( 57 | prefixIcon: Container( 58 | padding: EdgeInsets.all(20), 59 | child: Text( 60 | "${int.parse(e.key.toString()) + 1}. ", 61 | style: context.text.headline3! 62 | .copyWith(color: Colors.black, fontSize: 18), 63 | ), 64 | ), 65 | 66 | enabledBorder: OutlineInputBorder( 67 | borderSide: BorderSide(color: Colors.transparent), 68 | borderRadius: BorderRadius.all( 69 | Radius.circular(12.0), 70 | ), 71 | ), 72 | focusedBorder: OutlineInputBorder( 73 | borderSide: BorderSide(color: Colors.transparent), 74 | borderRadius: BorderRadius.all( 75 | Radius.circular(15.0), 76 | ), 77 | ), 78 | focusedErrorBorder: OutlineInputBorder( 79 | borderSide: BorderSide(color: Colors.transparent), 80 | borderRadius: BorderRadius.all( 81 | Radius.circular(15.0), 82 | ), 83 | ), 84 | // labelText: 'Add a comment ...', 85 | // labelStyle: TextStyle(fontSize: 12, color: Colors.grey), 86 | fillColor: Colors.grey.withOpacity(0.5), 87 | filled: true, 88 | ), 89 | ), 90 | ), 91 | ), 92 | ], 93 | ), 94 | )); 95 | } 96 | } 97 | -------------------------------------------------------------------------------- /lib/tips17/celebration.dart: -------------------------------------------------------------------------------- 1 | import 'package:confetti/confetti.dart'; 2 | import 'package:flutter/material.dart'; 3 | import 'dart:math'; 4 | import 'package:flutter_30_tips/home.dart'; 5 | 6 | class Celebration extends StatefulWidget { 7 | const Celebration({Key? key}) : super(key: key); 8 | 9 | @override 10 | State createState() => _CelebrationState(); 11 | } 12 | 13 | class _CelebrationState extends State { 14 | late ConfettiController _confettiController; 15 | late ConfettiController _confettiController1; 16 | late ConfettiController _confettiController2; 17 | 18 | @override 19 | void initState() { 20 | super.initState(); 21 | _confettiController = 22 | ConfettiController(duration: const Duration(seconds: 5)); 23 | _confettiController1 = 24 | ConfettiController(duration: const Duration(seconds: 10)); 25 | 26 | _confettiController2 = 27 | ConfettiController(duration: const Duration(seconds: 5)); 28 | _confettiController.play(); 29 | _confettiController1.play(); 30 | _confettiController2.play(); 31 | } 32 | 33 | @override 34 | void dispose() { 35 | _confettiController.dispose(); 36 | super.dispose(); 37 | } 38 | 39 | @override 40 | Widget build(BuildContext context) { 41 | return Scaffold( 42 | appBar: customAppBar("Tips 17"), 43 | body: Stack( 44 | children: [ 45 | Align( 46 | alignment: Alignment.bottomLeft, 47 | child: ConfettiWidget( 48 | confettiController: _confettiController, 49 | blastDirection: -pi / 2, 50 | emissionFrequency: 0.01, 51 | numberOfParticles: 50, 52 | maxBlastForce: 20, 53 | minBlastForce: 10, 54 | gravity: 0.1, 55 | ), 56 | ), 57 | Align( 58 | alignment: Alignment.bottomCenter, 59 | child: ConfettiWidget( 60 | confettiController: _confettiController1, 61 | blastDirection: -pi / 2, 62 | emissionFrequency: 0.01, 63 | numberOfParticles: 100, 64 | maxBlastForce: 50, 65 | minBlastForce: 20, 66 | gravity: 0.1, 67 | createParticlePath: drawStar, 68 | shouldLoop: true, 69 | ), 70 | ), 71 | Align( 72 | alignment: Alignment.bottomRight, 73 | child: ConfettiWidget( 74 | confettiController: _confettiController2, 75 | blastDirection: -pi / 2, 76 | emissionFrequency: 0.01, 77 | numberOfParticles: 1000, 78 | maxBlastForce: 100, 79 | minBlastForce: 80, 80 | gravity: 0.5, 81 | ), 82 | ), 83 | ], 84 | )); 85 | } 86 | 87 | Path drawStar(Size size) { 88 | double degToRad(double deg) => deg * (pi / 180.0); 89 | const numberOfPoints = 5; 90 | final halfWidth = size.width / 2; 91 | final externalRadius = halfWidth; 92 | final internalRadius = halfWidth / 2.5; 93 | final degreesPerStep = degToRad(360 / numberOfPoints); 94 | final halfDegreesPerStep = degreesPerStep / 2; 95 | final path = Path(); 96 | final fullAngle = degToRad(360); 97 | path.moveTo(size.width, halfWidth); 98 | for (double step = 0; step < fullAngle; step += degreesPerStep) { 99 | path.lineTo(halfWidth + externalRadius * cos(step), 100 | halfWidth + externalRadius * sin(step)); 101 | path.lineTo(halfWidth + internalRadius * cos(step + halfDegreesPerStep), 102 | halfWidth + internalRadius * sin(step + halfDegreesPerStep)); 103 | } 104 | path.close(); 105 | return path; 106 | } 107 | } 108 | -------------------------------------------------------------------------------- /lib/tips18/zoomWid.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:flutter_30_tips/tips8/showCase.dart'; 3 | import 'package:flutter_30_tips/home.dart'; 4 | import 'package:google_fonts/google_fonts.dart'; 5 | import 'package:zoom_widget/zoom_widget.dart'; 6 | 7 | class ZoomWid extends StatefulWidget { 8 | const ZoomWid({Key? key}) : super(key: key); 9 | 10 | @override 11 | State createState() => _ZoomWidState(); 12 | } 13 | 14 | class _ZoomWidState extends State { 15 | @override 16 | Widget build(BuildContext context) { 17 | return Scaffold( 18 | appBar: customAppBar("Tips 18"), 19 | body: Zoom( 20 | maxZoomWidth: 5 * MediaQuery.of(context).size.width, 21 | maxZoomHeight: 5 * MediaQuery.of(context).size.height, 22 | backgroundColor: Colors.white, 23 | colorScrollBars: mainColor, 24 | opacityScrollBars: 0.5, 25 | scrollWeight: 5.0, 26 | centerOnScale: true, 27 | enableScroll: true, 28 | doubleTapZoom: true, 29 | zoomSensibility: 2.3, 30 | //initZoom: 0.5, 31 | child: Column( 32 | mainAxisAlignment: MainAxisAlignment.start, 33 | crossAxisAlignment: CrossAxisAlignment.start, 34 | children: [ 35 | Text( 36 | "Follow", 37 | style: context.text.headline1, 38 | ), 39 | Text( 40 | " #30FlutterTipsWithLakshydeepVikram", 41 | style: context.text.headline1! 42 | .copyWith(fontFamily: GoogleFonts.poppins().fontFamily), 43 | ), 44 | Text( 45 | " #30FlutterTipsWithLakshydeepVikram", 46 | style: context.text.headline3!.copyWith( 47 | color: mainColor.withOpacity(0.89), 48 | fontFamily: GoogleFonts.sansita().fontFamily), 49 | ), 50 | Text( 51 | " #30FlutterTipsWithLakshydeepVikram", 52 | style: context.text.headline4, 53 | ), 54 | Text( 55 | " On", 56 | style: context.text.headline4, 57 | ), 58 | Text( 59 | " GitHub ", 60 | style: context.text.headline4! 61 | .copyWith(fontFamily: GoogleFonts.newTegomin().fontFamily), 62 | ), 63 | Text( 64 | " Medium", 65 | style: context.text.headline4! 66 | .copyWith(fontFamily: GoogleFonts.newTegomin().fontFamily), 67 | ), 68 | Text( 69 | " LinkedIN", 70 | style: context.text.headline4! 71 | .copyWith(fontFamily: GoogleFonts.newTegomin().fontFamily), 72 | ), 73 | Text( 74 | " @lakshydeep-14", 75 | style: context.text.headline4! 76 | .copyWith(fontFamily: GoogleFonts.newTegomin().fontFamily), 77 | ), 78 | ]), 79 | ), 80 | ); 81 | } 82 | } 83 | -------------------------------------------------------------------------------- /lib/tips2/chatController.dart: -------------------------------------------------------------------------------- 1 | import 'dart:io'; 2 | 3 | import 'package:cloud_firestore/cloud_firestore.dart'; 4 | import 'package:firebase_storage/firebase_storage.dart'; 5 | import 'package:get/get.dart'; 6 | 7 | class ChatProvider extends GetxController { 8 | final FirebaseFirestore firebaseFirestore; 9 | final FirebaseStorage firebaseStorage; 10 | 11 | ChatProvider( 12 | {required this.firebaseFirestore, required this.firebaseStorage}); 13 | 14 | UploadTask uploadFile(File image, String fileName) { 15 | Reference reference = firebaseStorage.ref().child(fileName); 16 | UploadTask uploadTask = reference.putFile(image); 17 | return uploadTask; 18 | } 19 | 20 | UploadTask uploadAudio(var audioFile, String fileName) { 21 | Reference reference = firebaseStorage.ref().child(fileName); 22 | UploadTask uploadTask = reference.putFile(audioFile); 23 | return uploadTask; 24 | } 25 | 26 | Future updateDataFirestore(String collectionPath, String docPath, 27 | Map dataNeedUpdate) { 28 | return firebaseFirestore 29 | .collection(collectionPath) 30 | .doc(docPath) 31 | .update(dataNeedUpdate); 32 | } 33 | 34 | Stream getChatStream(String groupChatId, int limit) { 35 | return firebaseFirestore 36 | .collection('messages') 37 | .doc(groupChatId) 38 | .collection(groupChatId) 39 | .orderBy('timestamp', descending: true) 40 | .limit(limit) 41 | .snapshots(); 42 | } 43 | 44 | void sendMessage(String content, int type, String groupChatId, 45 | String currentUserId, String peerId, 46 | {String duration = ""}) { 47 | DocumentReference documentReference = firebaseFirestore 48 | .collection('messages') 49 | .doc(groupChatId) 50 | .collection(groupChatId) 51 | .doc(DateTime.now().millisecondsSinceEpoch.toString()); 52 | 53 | MessageChat messageChat = MessageChat( 54 | idFrom: currentUserId, 55 | idTo: peerId, 56 | timestamp: DateTime.now().millisecondsSinceEpoch.toString(), 57 | content: content, 58 | type: type, 59 | duration: duration); 60 | 61 | FirebaseFirestore.instance.runTransaction((transaction) async { 62 | transaction.set( 63 | documentReference, 64 | messageChat.toJson(), 65 | ); 66 | }); 67 | } 68 | } 69 | 70 | class TypeMessage { 71 | static const text = 0; 72 | static const image = 1; 73 | static const audio = 3; 74 | } 75 | 76 | class MessageChat { 77 | String idFrom; 78 | String idTo; 79 | String timestamp; 80 | String content; 81 | int type; 82 | String? duration; 83 | 84 | MessageChat( 85 | {required this.idFrom, 86 | required this.idTo, 87 | required this.timestamp, 88 | required this.content, 89 | required this.type, 90 | this.duration}); 91 | 92 | Map toJson() { 93 | return { 94 | "idFrom": idFrom, 95 | "idTo": idTo, 96 | "timestamp": timestamp, 97 | "content": content, 98 | "type": type, 99 | "duration": duration 100 | }; 101 | } 102 | 103 | factory MessageChat.fromDocument(DocumentSnapshot doc) { 104 | String idFrom = doc.get('idFrom'); 105 | String idTo = doc.get('idTo'); 106 | String timestamp = doc.get('timestamp'); 107 | String content = doc.get('content'); 108 | int type = doc.get('type'); 109 | String duration = doc.get('duration'); 110 | return MessageChat( 111 | idFrom: idFrom, 112 | idTo: idTo, 113 | duration: duration, 114 | timestamp: timestamp, 115 | content: content, 116 | type: type); 117 | } 118 | } 119 | -------------------------------------------------------------------------------- /lib/tips21/crearefolder.dart: -------------------------------------------------------------------------------- 1 | // ignore_for_file: prefer_const_constructors 2 | 3 | import 'package:flutter/material.dart'; 4 | import 'package:flutter_30_tips/tips8/showCase.dart'; 5 | import 'package:flutter_30_tips/home.dart'; 6 | import 'package:flutter_30_tips/tips21/folderTypes/externalFolder.dart'; 7 | 8 | class CreateFolderScreen extends StatefulWidget { 9 | const CreateFolderScreen({Key? key}) : super(key: key); 10 | 11 | @override 12 | State createState() => _CreateFolderScreenState(); 13 | } 14 | 15 | class _CreateFolderScreenState extends State { 16 | @override 17 | Widget build(BuildContext context) { 18 | return Scaffold( 19 | appBar: customAppBar("Tips 21"), 20 | body: Column( 21 | mainAxisAlignment: MainAxisAlignment.center, 22 | crossAxisAlignment: CrossAxisAlignment.center, 23 | children: [ 24 | TextButton( 25 | style: ButtonStyle( 26 | foregroundColor: MaterialStateProperty.all(Colors.white), 27 | backgroundColor: MaterialStateProperty.all(mainColor)), 28 | onPressed: () async { 29 | CreateFolder().internalFolder(); 30 | ScaffoldMessenger.of(context).showSnackBar(SnackBar( 31 | backgroundColor: mainColor, 32 | content: Text( 33 | "Folder created!!", 34 | ))); 35 | }, 36 | child: Text("Create Folder to Internal Path"), 37 | ), 38 | Center( 39 | child: TextButton( 40 | style: ButtonStyle( 41 | foregroundColor: MaterialStateProperty.all(Colors.white), 42 | backgroundColor: MaterialStateProperty.all(mainColor)), 43 | onPressed: () async { 44 | CreateFolder().externalFolder(); 45 | ScaffoldMessenger.of(context).showSnackBar(SnackBar( 46 | backgroundColor: mainColor, 47 | content: Text( 48 | "Folder created!!", 49 | ))); 50 | }, 51 | child: Text("Create Folder to External Path"), 52 | ), 53 | ), 54 | ], 55 | ), 56 | ); 57 | } 58 | } 59 | -------------------------------------------------------------------------------- /lib/tips21/folderTypes/externalFolder.dart: -------------------------------------------------------------------------------- 1 | import 'dart:io'; 2 | import 'package:permission_handler/permission_handler.dart'; 3 | import 'package:path_provider/path_provider.dart'; 4 | 5 | class CreateFolder { 6 | externalFolder() async { 7 | if (await Permission.manageExternalStorage.isGranted) { 8 | final path = Directory('/storage/emulated/0/30FlutterTips/'); 9 | String res = ""; 10 | 11 | if (await path.exists()) { 12 | res = path.path; 13 | } else { 14 | final Directory appDocDirNewFolder = await path.create(recursive: true); 15 | 16 | res = appDocDirNewFolder.path; 17 | } 18 | final File file = File("${res}tips21.dart"); 19 | await file.writeAsString("data"); 20 | } else { 21 | await Permission.manageExternalStorage.request(); 22 | } 23 | } 24 | 25 | internalFolder() async { 26 | final abc = (await getExternalStorageDirectories())!.first; 27 | final path = Directory('${abc.path}/30FlutterTips/'); 28 | String res = ""; 29 | 30 | if (await path.exists()) { 31 | res = path.path; 32 | } else { 33 | final Directory appDocDirNewFolder = await path.create(recursive: true); 34 | 35 | res = appDocDirNewFolder.path; 36 | } 37 | final File file = File("${res}tips21.dart"); 38 | await file.writeAsString("data"); 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /lib/tips22/write_files.dart: -------------------------------------------------------------------------------- 1 | // ignore_for_file: prefer_const_constructors 2 | 3 | import 'dart:io'; 4 | 5 | import 'package:flutter/material.dart'; 6 | import 'package:flutter_30_tips/home.dart'; 7 | import 'package:permission_handler/permission_handler.dart'; 8 | 9 | class WriteFileScreen extends StatefulWidget { 10 | const WriteFileScreen({Key? key}) : super(key: key); 11 | 12 | @override 13 | State createState() => _WriteFileScreenState(); 14 | } 15 | 16 | class _WriteFileScreenState extends State { 17 | TextEditingController controller = TextEditingController(); 18 | FocusNode focusNode = FocusNode(); 19 | String? res; 20 | @override 21 | void initState() { 22 | // TODO: implement initState 23 | super.initState(); 24 | focusNode.requestFocus(); 25 | } 26 | 27 | @override 28 | Widget build(BuildContext context) { 29 | return Scaffold( 30 | appBar: customAppBar("Tips 21"), 31 | body: Padding( 32 | padding: const EdgeInsets.all(25.0), 33 | child: Column( 34 | mainAxisAlignment: MainAxisAlignment.center, 35 | crossAxisAlignment: CrossAxisAlignment.center, 36 | children: [ 37 | TextField( 38 | focusNode: focusNode, 39 | controller: controller, 40 | style: TextStyle(color: mainColor), 41 | ), 42 | TextButton( 43 | style: ButtonStyle( 44 | foregroundColor: MaterialStateProperty.all(Colors.white), 45 | backgroundColor: MaterialStateProperty.all(mainColor)), 46 | onPressed: () async { 47 | await externalFolder(); 48 | ScaffoldMessenger.of(context).showSnackBar(SnackBar( 49 | backgroundColor: mainColor, 50 | content: Text( 51 | "Write to File", 52 | ))); 53 | controller.clear(); 54 | focusNode.unfocus(); 55 | }, 56 | child: Text("Write To File"), 57 | ), 58 | Center( 59 | child: TextButton( 60 | style: ButtonStyle( 61 | foregroundColor: MaterialStateProperty.all(Colors.white), 62 | backgroundColor: MaterialStateProperty.all(mainColor)), 63 | onPressed: () async { 64 | if (await Permission.manageExternalStorage.isGranted) { 65 | await File("/storage/emulated/0/30FlutterTips/tips22.dart") 66 | .readAsString(); 67 | } else { 68 | await Permission.manageExternalStorage.request(); 69 | } 70 | }, 71 | child: Text("Read From File"), 72 | ), 73 | ), 74 | if (res != null) 75 | Container( 76 | height: 100, 77 | width: double.infinity, 78 | padding: EdgeInsets.all(15), 79 | color: mainColor, 80 | child: Center(child: Text(res.toString()))) 81 | ], 82 | ), 83 | ), 84 | ); 85 | } 86 | 87 | externalFolder() async { 88 | if (await Permission.manageExternalStorage.isGranted) { 89 | final path = Directory('/storage/emulated/0/30FlutterTips/'); 90 | String res = ""; 91 | 92 | if (await path.exists()) { 93 | res = path.path; 94 | } else { 95 | final Directory appDocDirNewFolder = await path.create(recursive: true); 96 | 97 | res = appDocDirNewFolder.path; 98 | } 99 | final File file = File("${res}tips22.dart"); 100 | await file.writeAsString(controller.text.toString()); 101 | } else { 102 | await Permission.manageExternalStorage.request(); 103 | } 104 | } 105 | } 106 | -------------------------------------------------------------------------------- /lib/tips23/tips23.dart: -------------------------------------------------------------------------------- 1 | // ignore_for_file: prefer_const_constructors 2 | 3 | import 'package:flutter/material.dart'; 4 | import 'package:google_fonts/google_fonts.dart'; 5 | import '../home.dart'; 6 | import 'package:flutter_30_tips/tips8/showCase.dart'; 7 | 8 | class Tips23 extends StatefulWidget { 9 | const Tips23({Key? key}) : super(key: key); 10 | 11 | @override 12 | State createState() => _Tips23State(); 13 | } 14 | 15 | class _Tips23State extends State { 16 | @override 17 | Widget build(BuildContext context) { 18 | return Scaffold( 19 | appBar: customAppBar("Tips 23"), 20 | body: Padding( 21 | padding: const EdgeInsets.all(25.0), 22 | child: Column( 23 | mainAxisAlignment: MainAxisAlignment.center, 24 | crossAxisAlignment: CrossAxisAlignment.center, 25 | children: [ 26 | Center( 27 | child: Text( 28 | " Without Rotation", 29 | style: context.text.headline1!.copyWith( 30 | fontFamily: GoogleFonts.poppins().fontFamily), 31 | ), 32 | ), 33 | Center(child: _widget()), 34 | SizedBox( 35 | height: 50, 36 | ), 37 | Row( 38 | mainAxisAlignment: MainAxisAlignment.spaceBetween, 39 | children: [ 40 | Column( 41 | children: [ 42 | Text( 43 | "Quartered Rotation", 44 | style: context.text.headline4!.copyWith( 45 | fontWeight: FontWeight.bold, 46 | fontFamily: GoogleFonts.poppins().fontFamily), 47 | ), 48 | _rotatedByQuarter(1), 49 | _rotatedByQuarter(2), 50 | _rotatedByQuarter(3), 51 | _rotatedByQuarter(4), 52 | ], 53 | ), 54 | Column( 55 | children: [ 56 | Text( 57 | "Angled Rotation", 58 | style: context.text.headline4!.copyWith( 59 | fontWeight: FontWeight.bold, 60 | fontFamily: GoogleFonts.poppins().fontFamily), 61 | ), 62 | _rotatedBydegree(0), 63 | _rotatedBydegree(15), 64 | _rotatedBydegree(30), 65 | _rotatedBydegree(40), 66 | ], 67 | ), 68 | ], 69 | ), 70 | ]))); 71 | } 72 | 73 | Widget _widget() { 74 | return Icon( 75 | Icons.thumb_down, 76 | size: 55, 77 | color: mainColor, 78 | ); 79 | } 80 | 81 | Widget _rotatedByQuarter(int turn) { 82 | return Column( 83 | children: [ 84 | RotatedBox( 85 | quarterTurns: turn, 86 | child: _widget(), 87 | ), 88 | SizedBox( 89 | height: 10, 90 | ), 91 | Text( 92 | "Rotated $turn quarter turn", 93 | style: context.text.headline4!.copyWith( 94 | fontSize: 15, fontFamily: GoogleFonts.poppins().fontFamily), 95 | ), 96 | SizedBox( 97 | height: 20, 98 | ) 99 | ], 100 | ); 101 | } 102 | 103 | Widget _rotatedBydegree(double turn) { 104 | return Column( 105 | children: [ 106 | Transform.rotate( 107 | angle: turn, 108 | child: _widget(), 109 | ), 110 | SizedBox( 111 | height: 10, 112 | ), 113 | Text( 114 | "Rotated $turn quarter turn", 115 | style: context.text.headline4!.copyWith( 116 | fontSize: 15, fontFamily: GoogleFonts.poppins().fontFamily), 117 | ), 118 | SizedBox( 119 | height: 20, 120 | ) 121 | ], 122 | ); 123 | } 124 | } 125 | -------------------------------------------------------------------------------- /lib/tips24/shimmer_effect.dart: -------------------------------------------------------------------------------- 1 | // ignore_for_file: prefer_const_constructors 2 | 3 | import 'package:flutter/material.dart'; 4 | import 'package:flutter_30_tips/home.dart'; 5 | import 'package:flutter_30_tips/tips8/showCase.dart'; 6 | import 'package:shimmer/shimmer.dart'; 7 | 8 | class ShimmerEffect extends StatefulWidget { 9 | const ShimmerEffect({super.key}); 10 | 11 | @override 12 | State createState() => _ShimmerEffectState(); 13 | } 14 | 15 | class _ShimmerEffectState extends State { 16 | bool loading1 = true; 17 | bool loading2 = true; 18 | bool loading3 = true; 19 | bool loading4 = true; 20 | bool loading5 = true; 21 | bool loading6 = true; 22 | 23 | @override 24 | void initState() { 25 | // TODO: implement initState 26 | super.initState(); 27 | _loading1(); 28 | } 29 | 30 | _loading1({int sec = 2}) { 31 | Future.delayed(Duration(seconds: sec)).then((value) { 32 | setState(() { 33 | loading1 = false; 34 | }); 35 | }); 36 | Future.delayed(Duration(seconds: sec + 2)).then((value) { 37 | setState(() { 38 | loading2 = false; 39 | }); 40 | }); 41 | Future.delayed(Duration(seconds: sec + 5)).then((value) { 42 | setState(() { 43 | loading3 = false; 44 | }); 45 | }); 46 | Future.delayed(Duration(seconds: sec + 7)).then((value) { 47 | setState(() { 48 | loading4 = false; 49 | }); 50 | }); 51 | Future.delayed(Duration(seconds: sec + 9)).then((value) { 52 | setState(() { 53 | loading5 = false; 54 | }); 55 | }); 56 | Future.delayed(Duration(seconds: sec + 11)).then((value) { 57 | setState(() { 58 | loading6 = false; 59 | }); 60 | }); 61 | } 62 | 63 | @override 64 | Widget build(BuildContext context) { 65 | return Scaffold( 66 | appBar: customAppBar("Tips 23"), 67 | body: Padding( 68 | padding: const EdgeInsets.all(25.0), 69 | child: Column( 70 | crossAxisAlignment: CrossAxisAlignment.center, 71 | children: [ 72 | Center( 73 | child: TextButton.icon( 74 | style: ButtonStyle( 75 | foregroundColor: 76 | MaterialStateProperty.all(Colors.white), 77 | backgroundColor: 78 | MaterialStateProperty.all(mainColor)), 79 | onPressed: () { 80 | setState(() { 81 | loading1 = true; 82 | loading2 = true; 83 | loading3 = true; 84 | loading4 = true; 85 | loading5 = true; 86 | loading6 = true; 87 | }); 88 | _loading1(); 89 | }, 90 | icon: Icon(Icons.refresh), 91 | label: Text("Reload")), 92 | ), 93 | SizedBox( 94 | height: 50, 95 | ), 96 | _widget(loading1, "Follow #30FlutterTips"), 97 | _widget(loading2, "On"), 98 | _widget(loading3, "YouTube: @gowithflutter"), 99 | _widget(loading4, "Github: lakshydeep-14"), 100 | _widget(loading5, "Medium: lakshydeep-14"), 101 | _widget(loading6, "LinkedIn: lakshydeep-14"), 102 | ], 103 | ))); 104 | } 105 | 106 | Widget _widget(bool loader, String label) { 107 | return loader 108 | ? Shimmer.fromColors( 109 | baseColor: Colors.grey[300]!, 110 | highlightColor: Colors.grey[100]!, 111 | child: SizedBox( 112 | height: 80, 113 | width: double.infinity, 114 | child: Card( 115 | elevation: 1.0, 116 | shape: RoundedRectangleBorder( 117 | borderRadius: BorderRadius.circular(16), 118 | ), 119 | child: const SizedBox(height: 80), 120 | ), 121 | )) 122 | : Text( 123 | label, 124 | style: TextStyle( 125 | fontSize: 25, fontWeight: FontWeight.w900, color: mainColor), 126 | ); 127 | } 128 | } 129 | -------------------------------------------------------------------------------- /lib/tips26/tips26.dart: -------------------------------------------------------------------------------- 1 | // ignore_for_file: prefer_const_constructors 2 | 3 | import 'package:flutter/material.dart'; 4 | import 'package:flutter_30_tips/home.dart'; 5 | import 'package:flutter_30_tips/tips8/showCase.dart'; 6 | 7 | class Tips26 extends StatefulWidget { 8 | const Tips26({Key? key}) : super(key: key); 9 | 10 | @override 11 | State createState() => _Tips26State(); 12 | } 13 | 14 | class _Tips26State extends State { 15 | List textEditingControllerList = 16 | List.generate(10, (index) => TextEditingController()); 17 | List focusNodeList = List.generate(10, (index) => FocusNode()); 18 | 19 | @override 20 | void initState() { 21 | // TODO: implement initState 22 | super.initState(); 23 | } 24 | 25 | @override 26 | Widget build(BuildContext context) { 27 | return Scaffold( 28 | appBar: customAppBar("Tips 26"), 29 | body: SingleChildScrollView( 30 | padding: EdgeInsets.only( 31 | top: 50, bottom: MediaQuery.of(context).viewInsets.bottom), 32 | child: Column( 33 | mainAxisAlignment: MainAxisAlignment.center, 34 | children: [ 35 | ...textEditingControllerList.asMap().entries.map( 36 | (e) => Padding( 37 | padding: const EdgeInsets.symmetric( 38 | horizontal: 25.0, vertical: 10), 39 | child: TextFormField( 40 | scrollPadding: EdgeInsets.only( 41 | bottom: MediaQuery.of(context).viewInsets.bottom), 42 | textInputAction: TextInputAction.done, 43 | controller: e.value, 44 | onEditingComplete: () { 45 | if (int.parse(e.key.toString()) == 4) { 46 | FocusScope.of(context).unfocus(); 47 | ScaffoldMessenger.of(context).showSnackBar(SnackBar( 48 | content: Text( 49 | "Unfocused", 50 | style: context.text.headline3, 51 | ), 52 | )); 53 | } else { 54 | FocusScope.of(context).requestFocus( 55 | focusNodeList[int.parse(e.key.toString()) + 1]); 56 | } 57 | }, 58 | focusNode: focusNodeList[e.key], 59 | decoration: InputDecoration( 60 | prefixIcon: Container( 61 | padding: EdgeInsets.all(20), 62 | child: Text( 63 | "${int.parse(e.key.toString()) + 1}. ", 64 | style: context.text.headline3! 65 | .copyWith(color: Colors.black, fontSize: 18), 66 | ), 67 | ), 68 | 69 | enabledBorder: OutlineInputBorder( 70 | borderSide: BorderSide(color: Colors.transparent), 71 | borderRadius: BorderRadius.all( 72 | Radius.circular(12.0), 73 | ), 74 | ), 75 | focusedBorder: OutlineInputBorder( 76 | borderSide: BorderSide(color: Colors.transparent), 77 | borderRadius: BorderRadius.all( 78 | Radius.circular(15.0), 79 | ), 80 | ), 81 | focusedErrorBorder: OutlineInputBorder( 82 | borderSide: BorderSide(color: Colors.transparent), 83 | borderRadius: BorderRadius.all( 84 | Radius.circular(15.0), 85 | ), 86 | ), 87 | // labelText: 'Add a comment ...', 88 | // labelStyle: TextStyle(fontSize: 12, color: Colors.grey), 89 | fillColor: Colors.grey.withOpacity(0.5), 90 | filled: true, 91 | ), 92 | ), 93 | ), 94 | ), 95 | ], 96 | ), 97 | )); 98 | } 99 | } 100 | -------------------------------------------------------------------------------- /lib/tips27/bargraphView.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:flutter_30_tips/home.dart'; 3 | import 'package:flutter_30_tips/tips8/showCase.dart'; 4 | import 'package:syncfusion_flutter_charts/charts.dart'; 5 | 6 | class BarGraphView extends StatefulWidget { 7 | const BarGraphView({super.key}); 8 | 9 | @override 10 | State createState() => _BarGraphViewState(); 11 | } 12 | 13 | class _BarGraphViewState extends State { 14 | TooltipBehavior _tooltip = TooltipBehavior(enable: true); 15 | @override 16 | Widget build(BuildContext context) { 17 | return Expanded( 18 | child: Column( 19 | children: [ 20 | Text( 21 | "Bar Graph", 22 | style: context.text.headline2!.copyWith(), 23 | ), 24 | SfCartesianChart( 25 | primaryXAxis: CategoryAxis(), 26 | primaryYAxis: NumericAxis(minimum: 0, maximum: 1500, interval: 100), 27 | tooltipBehavior: _tooltip, 28 | series: >[ 29 | ColumnSeries<_ChartData, String>( 30 | dataSource: [ 31 | _ChartData("LinkedIN", 600), 32 | _ChartData("Medium", 250), 33 | _ChartData("GitHub", 1094) 34 | ], 35 | xValueMapper: (_ChartData data, _) => data.x, 36 | yValueMapper: (_ChartData data, _) => data.y, 37 | name: 'Followers', 38 | color: mainColor) 39 | ]), 40 | ], 41 | )); 42 | } 43 | } 44 | 45 | class _ChartData { 46 | _ChartData(this.x, this.y); 47 | 48 | final String x; 49 | final double y; 50 | } 51 | -------------------------------------------------------------------------------- /lib/tips27/piechartView.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:flutter_30_tips/tips8/showCase.dart'; 3 | 4 | import 'package:pie_chart/pie_chart.dart'; 5 | 6 | class PieChartWid extends StatefulWidget { 7 | const PieChartWid({super.key}); 8 | 9 | @override 10 | State createState() => _PieChartWidState(); 11 | } 12 | 13 | class _PieChartWidState extends State { 14 | @override 15 | Widget build(BuildContext context) { 16 | return Column( 17 | children: [ 18 | Text( 19 | "Bar Graph", 20 | style: context.text.headline2!.copyWith(), 21 | ), 22 | SizedBox( 23 | height: 20, 24 | ), 25 | PieChart( 26 | dataMap: const { 27 | "LinkedIn": 700, 28 | "GitHub": 1000, 29 | "Medium": 250, 30 | }, 31 | animationDuration: const Duration(milliseconds: 800), 32 | chartLegendSpacing: 32, 33 | chartRadius: MediaQuery.of(context).size.height * 0.25, 34 | initialAngleInDegree: 0, 35 | chartType: ChartType.ring, 36 | centerText: "Followers", 37 | ringStrokeWidth: 32, 38 | chartValuesOptions: const ChartValuesOptions( 39 | showChartValueBackground: true, 40 | showChartValues: true, 41 | showChartValuesInPercentage: false, 42 | showChartValuesOutside: false, 43 | decimalPlaces: 2, 44 | ), 45 | legendOptions: const LegendOptions( 46 | showLegendsInRow: true, 47 | legendPosition: LegendPosition.bottom, 48 | showLegends: true, 49 | legendShape: BoxShape.circle, 50 | legendTextStyle: TextStyle( 51 | color: Colors.black, 52 | fontWeight: FontWeight.bold, 53 | ), 54 | ), 55 | ), 56 | ], 57 | ); 58 | } 59 | } 60 | -------------------------------------------------------------------------------- /lib/tips27/tips27.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:flutter_30_tips/home.dart'; 3 | import 'package:flutter_30_tips/tips27/piechartView.dart'; 4 | import 'bargraphView.dart'; 5 | 6 | class Tips27 extends StatefulWidget { 7 | const Tips27({super.key}); 8 | 9 | @override 10 | State createState() => _Tips27State(); 11 | } 12 | 13 | class _Tips27State extends State { 14 | @override 15 | Widget build(BuildContext context) { 16 | return Scaffold( 17 | appBar: customAppBar("Tips 27"), 18 | body: Column(children: const [ 19 | PieChartWid(), 20 | SizedBox( 21 | height: 50, 22 | ), 23 | BarGraphView() 24 | ]), 25 | ); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /lib/tips28/tips28.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:flutter/src/widgets/container.dart'; 3 | import 'package:flutter/src/widgets/framework.dart'; 4 | import 'package:flutter_30_tips/home.dart'; 5 | import 'package:flutter_30_tips/tips8/showCase.dart'; 6 | import 'package:google_fonts/google_fonts.dart'; 7 | import 'package:numeral_system/numeral_system.dart'; 8 | 9 | class Tips28 extends StatefulWidget { 10 | const Tips28({super.key}); 11 | 12 | @override 13 | State createState() => _Tips28State(); 14 | } 15 | 16 | class _Tips28State extends State { 17 | @override 18 | Widget build(BuildContext context) { 19 | return Scaffold( 20 | appBar: customAppBar("Tips 28"), 21 | body: Column( 22 | mainAxisAlignment: MainAxisAlignment.center, 23 | crossAxisAlignment: CrossAxisAlignment.center, 24 | children: [ 25 | Text( 26 | "International", 27 | style: context.text.headline2!.copyWith( 28 | decoration: TextDecoration.underline, 29 | fontWeight: FontWeight.bold, 30 | fontFamily: GoogleFonts.poppins().fontFamily), 31 | ), 32 | Center( 33 | child: NumeralSystem( 34 | numberSystem: NumberSystem.international, 35 | digit: 987387659876, 36 | //afterDecimalDigits: 3, 37 | textStyle: context.text.headline3!.copyWith( 38 | fontWeight: FontWeight.bold, 39 | fontFamily: GoogleFonts.poppins().fontFamily), 40 | ), 41 | ), 42 | NumeralSystem( 43 | numberSystem: NumberSystem.international, 44 | digit: 987387676, 45 | //afterDecimalDigits: 2, 46 | textStyle: context.text.headline3!.copyWith( 47 | fontWeight: FontWeight.bold, 48 | fontFamily: GoogleFonts.poppins().fontFamily), 49 | ), 50 | NumeralSystem( 51 | numberSystem: NumberSystem.international, 52 | digit: 987376, 53 | //digitAfterDecimal: 1, 54 | textStyle: context.text.headline3!.copyWith( 55 | fontWeight: FontWeight.bold, 56 | fontFamily: GoogleFonts.poppins().fontFamily), 57 | ), 58 | const SizedBox( 59 | height: 30, 60 | ), 61 | Text( 62 | "Hindu- Arabic", 63 | style: context.text.headline2!.copyWith( 64 | decoration: TextDecoration.underline, 65 | fontWeight: FontWeight.bold, 66 | fontFamily: GoogleFonts.poppins().fontFamily), 67 | ), 68 | NumeralSystem( 69 | numberSystem: NumberSystem.indian, 70 | digit: 9873876576, 71 | //afterDecimalDigits: 5, 72 | textStyle: context.text.headline3!.copyWith( 73 | fontWeight: FontWeight.bold, 74 | fontFamily: GoogleFonts.poppins().fontFamily), 75 | ), 76 | NumeralSystem( 77 | numberSystem: NumberSystem.indian, 78 | digit: 9876576, 79 | //afterDecimalDigits: 5, 80 | textStyle: context.text.headline3!.copyWith( 81 | fontWeight: FontWeight.bold, 82 | fontFamily: GoogleFonts.poppins().fontFamily), 83 | ), 84 | NumeralSystem( 85 | numberSystem: NumberSystem.indian, 86 | digit: 98876576, 87 | //afterDecimalDigits: 5, 88 | textStyle: context.text.headline3!.copyWith( 89 | fontWeight: FontWeight.bold, 90 | fontFamily: GoogleFonts.poppins().fontFamily), 91 | ), 92 | ]), 93 | ); 94 | } 95 | } 96 | -------------------------------------------------------------------------------- /lib/tips29/tips29.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:flutter_30_tips/home.dart'; 3 | import 'package:flutter_30_tips/tips8/showCase.dart'; 4 | 5 | class Tips29 extends StatefulWidget { 6 | const Tips29({super.key}); 7 | 8 | @override 9 | State createState() => _Tips29State(); 10 | } 11 | 12 | class _Tips29State extends State { 13 | List list = List.generate(20, (index) => index); 14 | final _controller = ScrollController(); 15 | bool _isMoreData = false; 16 | @override 17 | void initState() { 18 | // TODO: implement initState 19 | super.initState(); 20 | fetch(); 21 | _controller.addListener(() { 22 | if (_controller.position.maxScrollExtent == _controller.offset) { 23 | fetch(); 24 | } 25 | }); 26 | } 27 | 28 | fetch() async { 29 | await Future.delayed(Duration(seconds: 3)); 30 | if (list.length != 50) { 31 | List _int = List.generate(5, (i) => list.length + i + 1); 32 | //API Calls 33 | setState(() { 34 | list.addAll(_int); 35 | _isMoreData = false; 36 | }); 37 | } else { 38 | setState(() { 39 | _isMoreData = true; 40 | }); 41 | } 42 | } 43 | 44 | @override 45 | void dispose() { 46 | _controller.dispose(); 47 | super.dispose(); 48 | } 49 | 50 | @override 51 | Widget build(BuildContext context) { 52 | return Scaffold( 53 | appBar: customAppBar("Tips 29"), 54 | body: ListView.builder( 55 | itemCount: list.length + 1, 56 | controller: _controller, 57 | itemBuilder: (context, index) { 58 | if (index < list.length) { 59 | return Padding( 60 | padding: const EdgeInsets.all(8.0), 61 | child: Text( 62 | "Item ${list[index]}", 63 | style: context.text.headline2, 64 | ), 65 | ); 66 | } else { 67 | return _isMoreData == true 68 | ? Center( 69 | child: Text( 70 | "No More Dara", 71 | style: context.text.headline2, 72 | )) 73 | : Center( 74 | child: Padding( 75 | padding: const EdgeInsets.all(8.0), 76 | child: CircularProgressIndicator(), 77 | )); 78 | } 79 | }, 80 | ), 81 | ); 82 | } 83 | } 84 | -------------------------------------------------------------------------------- /lib/tips3/image.dart: -------------------------------------------------------------------------------- 1 | // ignore_for_file: prefer_const_constructors 2 | 3 | import 'package:flutter/material.dart'; 4 | import 'package:flutter_30_tips/home.dart'; 5 | import 'package:flutter_30_tips/tips2/chatController.dart'; 6 | 7 | class ImageContainer extends StatefulWidget { 8 | final MessageChat messageChat; 9 | const ImageContainer({Key? key, required this.messageChat}) : super(key: key); 10 | 11 | @override 12 | State createState() => _ImageContainerState(); 13 | } 14 | 15 | class _ImageContainerState extends State { 16 | @override 17 | Widget build(BuildContext context) { 18 | return Container( 19 | padding: const EdgeInsets.all(2), 20 | decoration: BoxDecoration( 21 | border: Border.all(color: mainColor), 22 | borderRadius: BorderRadius.all( 23 | Radius.circular(8), 24 | ), 25 | ), 26 | clipBehavior: Clip.hardEdge, 27 | child: Image.network( 28 | widget.messageChat.content, 29 | loadingBuilder: (BuildContext context, Widget child, 30 | ImageChunkEvent? loadingProgress) { 31 | if (loadingProgress == null) return child; 32 | return Container( 33 | decoration: BoxDecoration( 34 | color: mainColor.withOpacity(0.25), 35 | border: Border.all(color: mainColor), 36 | borderRadius: BorderRadius.all( 37 | Radius.circular(8), 38 | ), 39 | ), 40 | width: 200, 41 | height: 200, 42 | child: Center( 43 | child: CircularProgressIndicator( 44 | color: Colors.blue, 45 | value: loadingProgress.expectedTotalBytes != null 46 | ? loadingProgress.cumulativeBytesLoaded / 47 | loadingProgress.expectedTotalBytes! 48 | : null, 49 | ), 50 | ), 51 | ); 52 | }, 53 | errorBuilder: (context, object, stackTrace) { 54 | return Material( 55 | borderRadius: BorderRadius.all( 56 | Radius.circular(8), 57 | ), 58 | clipBehavior: Clip.hardEdge, 59 | child: Icon(Icons.no_photography)); 60 | }, 61 | width: 200, 62 | height: 200, 63 | fit: BoxFit.cover, 64 | ), 65 | ); 66 | } 67 | } 68 | -------------------------------------------------------------------------------- /lib/tips30/bottomNavBar.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:flutter_30_tips/home.dart'; 3 | 4 | class PersistentBottomBarScaffold extends StatefulWidget { 5 | final List items; 6 | 7 | const PersistentBottomBarScaffold({Key? key, required this.items}) 8 | : super(key: key); 9 | 10 | @override 11 | _PersistentBottomBarScaffoldState createState() => 12 | _PersistentBottomBarScaffoldState(); 13 | } 14 | 15 | class _PersistentBottomBarScaffoldState 16 | extends State { 17 | int _selectedTab = 0; 18 | 19 | @override 20 | Widget build(BuildContext context) { 21 | return WillPopScope( 22 | onWillPop: () async { 23 | if (widget.items[_selectedTab].navigatorkey?.currentState?.canPop() ?? 24 | false) { 25 | widget.items[_selectedTab].navigatorkey?.currentState?.pop(); 26 | return false; 27 | } else { 28 | return true; 29 | } 30 | }, 31 | child: Scaffold( 32 | body: IndexedStack( 33 | index: _selectedTab, 34 | children: widget.items 35 | .map((page) => Navigator( 36 | key: page.navigatorkey, 37 | onGenerateInitialRoutes: (navigator, initialRoute) { 38 | return [ 39 | MaterialPageRoute(builder: (context) => page.tab) 40 | ]; 41 | }, 42 | )) 43 | .toList(), 44 | ), 45 | 46 | /// Define the persistent bottom bar 47 | bottomNavigationBar: BottomNavigationBar( 48 | backgroundColor: mainColor, 49 | currentIndex: _selectedTab, 50 | onTap: (index) { 51 | /// Check if the tab that the user is pressing is currently selected 52 | if (index == _selectedTab) { 53 | /// if you want to pop the current tab to its root then use 54 | widget.items[index].navigatorkey?.currentState 55 | ?.popUntil((route) => route.isFirst); 56 | 57 | /// if you want to pop the current tab to its last page 58 | /// then use 59 | // widget.items[index].navigatorkey?.currentState?.pop(); 60 | } else { 61 | setState(() { 62 | _selectedTab = index; 63 | }); 64 | } 65 | }, 66 | selectedItemColor: Colors.white, 67 | unselectedItemColor: Colors.grey, 68 | items: widget.items 69 | .map((item) => BottomNavigationBarItem( 70 | icon: Icon( 71 | item.icon, 72 | color: _selectedTab == widget.items.indexOf(item) 73 | ? Colors.white 74 | : Colors.grey, 75 | ), 76 | label: item.title)) 77 | .toList(), 78 | ), 79 | ), 80 | ); 81 | } 82 | } 83 | 84 | /// Model class that holds the tab info for the [PersistentBottomBarScaffold] 85 | class PersistentTabItem { 86 | final Widget tab; 87 | final GlobalKey? navigatorkey; 88 | final String title; 89 | final IconData icon; 90 | 91 | PersistentTabItem( 92 | {required this.tab, 93 | this.navigatorkey, 94 | required this.title, 95 | required this.icon}); 96 | } 97 | -------------------------------------------------------------------------------- /lib/tips30/home.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:flutter_30_tips/home.dart'; 3 | import 'package:flutter_30_tips/tips8/showCase.dart'; 4 | 5 | class Home extends StatefulWidget { 6 | final String text; 7 | const Home({super.key, required this.text}); 8 | 9 | @override 10 | State createState() => _HomeState(); 11 | } 12 | 13 | class _HomeState extends State { 14 | @override 15 | Widget build(BuildContext context) { 16 | return Scaffold( 17 | body: Center( 18 | child: TextButton( 19 | onPressed: () => Navigator.push(context, 20 | MaterialPageRoute(builder: (_) => Tab1(text: widget.text))), 21 | child: Text( 22 | widget.text, 23 | style: context.text.headline3, 24 | )), 25 | ), 26 | ); 27 | } 28 | } 29 | 30 | class Tab1 extends StatefulWidget { 31 | final String text; 32 | const Tab1({super.key, required this.text}); 33 | 34 | @override 35 | State createState() => _Tab1State(); 36 | } 37 | 38 | class _Tab1State extends State { 39 | @override 40 | Widget build(BuildContext context) { 41 | return Scaffold( 42 | appBar: customAppBar(""), 43 | body: Center( 44 | child: Text( 45 | "Inside " + widget.text, 46 | style: context.text.headline3, 47 | )), 48 | ); 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /lib/tips30/tips30.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import './home.dart'; 3 | import 'bottomNavBar.dart'; 4 | 5 | class Tips30 extends StatefulWidget { 6 | Tips30({super.key}); 7 | 8 | @override 9 | State createState() => _Tips30State(); 10 | } 11 | 12 | class _Tips30State extends State { 13 | int _index = 0; 14 | final List _body = [ 15 | Home( 16 | text: "Tab1", 17 | ), 18 | Home( 19 | text: "tab2", 20 | ), 21 | Home( 22 | text: "tab3", 23 | ) 24 | ]; 25 | final _tab1navigatorKey = GlobalKey(); 26 | final _tab2navigatorKey = GlobalKey(); 27 | final _tab3navigatorKey = GlobalKey(); 28 | 29 | @override 30 | Widget build(BuildContext context) { 31 | return PersistentBottomBarScaffold( 32 | items: [ 33 | PersistentTabItem( 34 | tab: _body[0], 35 | icon: Icons.home, 36 | title: 'Home', 37 | navigatorkey: _tab1navigatorKey, 38 | ), 39 | PersistentTabItem( 40 | tab: _body[1], 41 | icon: Icons.search, 42 | title: 'Search', 43 | navigatorkey: _tab2navigatorKey, 44 | ), 45 | PersistentTabItem( 46 | tab: _body[2], 47 | icon: Icons.book, 48 | title: 'Profile', 49 | navigatorkey: _tab3navigatorKey, 50 | ), 51 | ], 52 | ); 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /lib/tips31/tips31.dart: -------------------------------------------------------------------------------- 1 | import 'package:carousel_slider/carousel_slider.dart'; 2 | import 'package:firebase_storage/firebase_storage.dart'; 3 | import 'package:flutter/material.dart'; 4 | import 'package:flutter_30_tips/home.dart'; 5 | import 'package:flutter_30_tips/tips8/showCase.dart'; 6 | import 'package:google_fonts/google_fonts.dart'; 7 | 8 | class Tips31 extends StatefulWidget { 9 | const Tips31({super.key}); 10 | 11 | @override 12 | State createState() => _Tips31State(); 13 | } 14 | 15 | class _Tips31State extends State { 16 | List imageURL = []; 17 | List list = []; 18 | 19 | bool isLoading = false; 20 | @override 21 | void initState() { 22 | super.initState(); 23 | abc(); 24 | } 25 | 26 | abc() async { 27 | setState(() { 28 | isLoading = true; 29 | }); 30 | final data = 31 | await FirebaseStorage.instance.ref().child("fetchImage").listAll(); 32 | for (var item in data.items) { 33 | var a = await item.getDownloadURL(); 34 | imageURL.add(a); 35 | list.add(item); 36 | } 37 | setState(() { 38 | isLoading = false; 39 | }); 40 | } 41 | 42 | @override 43 | Widget build(BuildContext context) { 44 | return Scaffold( 45 | appBar: AppBar( 46 | backgroundColor: Colors.white, 47 | centerTitle: true, 48 | title: Text( 49 | "Fetch Images from Firebase Storage", 50 | style: context.text.headline5, 51 | )), 52 | body: isLoading == true 53 | ? Center( 54 | child: Column( 55 | children: [ 56 | const CircularProgressIndicator(), 57 | Text( 58 | "Fetching images...", 59 | style: context.text.headline5!.copyWith( 60 | fontFamily: GoogleFonts.acme().fontFamily.toString()), 61 | ) 62 | ], 63 | )) 64 | : SingleChildScrollView( 65 | child: Column(children: [ 66 | CarouselSlider( 67 | options: CarouselOptions( 68 | aspectRatio: 2.0, 69 | enlargeCenterPage: true, 70 | enableInfiniteScroll: true, 71 | initialPage: 0, 72 | autoPlay: true, 73 | ), 74 | items: imageURL 75 | .map( 76 | (item) => Container( 77 | margin: const EdgeInsets.fromLTRB(0, 20, 0, 0), 78 | child: ClipRRect( 79 | borderRadius: const BorderRadius.all( 80 | Radius.circular(18.0), 81 | ), 82 | child: Stack( 83 | children: [ 84 | Image.network( 85 | item, 86 | fit: BoxFit.fill, 87 | width: 1000.0, 88 | ), 89 | ], 90 | )), 91 | ), 92 | ) 93 | .toList(), 94 | ), 95 | const SizedBox( 96 | height: 10, 97 | ), 98 | ...list.map((e) => Column( 99 | children: [ 100 | Text( 101 | "Full path: ${e.fullPath}", 102 | style: context.text.headline5!.copyWith( 103 | fontFamily: 104 | GoogleFonts.acme().fontFamily.toString()), 105 | ), 106 | Text( 107 | "Name: ${e.name}", 108 | style: context.text.headline5!.copyWith( 109 | fontFamily: 110 | GoogleFonts.acme().fontFamily.toString()), 111 | ), 112 | Text( 113 | "Link: ${imageURL[list.indexOf(e)]}", 114 | style: context.text.headline5!.copyWith( 115 | fontFamily: 116 | GoogleFonts.acme().fontFamily.toString()), 117 | ), 118 | Divider( 119 | color: mainColor, 120 | ) 121 | ], 122 | )) 123 | ]), 124 | ), 125 | ); 126 | } 127 | } 128 | -------------------------------------------------------------------------------- /lib/tips4/audioController.dart: -------------------------------------------------------------------------------- 1 | import 'package:audioplayers/audioplayers.dart'; 2 | import 'package:get/get.dart'; 3 | import 'package:sizer/sizer.dart'; 4 | 5 | class AudioController extends GetxController { 6 | final _isRecordPlaying = false.obs, 7 | isRecording = false.obs, 8 | isSending = false.obs, 9 | isUploading = false.obs; 10 | final _currentId = 999999.obs; 11 | final start = DateTime.now().obs; 12 | final end = DateTime.now().obs; 13 | String _total = ""; 14 | String get total => _total; 15 | var completedPercentage = 0.0.obs; 16 | var currentDuration = 0.obs; 17 | var totalDuration = 0.obs; 18 | 19 | bool get isRecordPlaying => _isRecordPlaying.value; 20 | bool get isRecordingValue => isRecording.value; 21 | late final AudioPlayerService _audioPlayerService; 22 | int get currentId => _currentId.value; 23 | @override 24 | void onInit() { 25 | _audioPlayerService = AudioPlayerAdapter(); 26 | 27 | _audioPlayerService.getAudioPlayer.onDurationChanged.listen((duration) { 28 | totalDuration.value = duration.inMicroseconds; 29 | }); 30 | 31 | _audioPlayerService.getAudioPlayer.onPositionChanged.listen((duration) { 32 | currentDuration.value = duration.inMicroseconds; 33 | completedPercentage.value = 34 | currentDuration.value.toDouble() / totalDuration.value.toDouble(); 35 | }); 36 | 37 | _audioPlayerService.getAudioPlayer.onPlayerComplete.listen((event) async { 38 | await _audioPlayerService.getAudioPlayer.seek(Duration.zero); 39 | _isRecordPlaying.value = false; 40 | }); 41 | 42 | super.onInit(); 43 | } 44 | 45 | @override 46 | void onClose() { 47 | _audioPlayerService.dispose(); 48 | super.onClose(); 49 | } 50 | 51 | Future changeProg() async { 52 | if (isRecordPlaying) { 53 | _audioPlayerService.getAudioPlayer.onDurationChanged.listen((duration) { 54 | totalDuration.value = duration.inMicroseconds; 55 | }); 56 | 57 | _audioPlayerService.getAudioPlayer.onPositionChanged.listen((duration) { 58 | currentDuration.value = duration.inMicroseconds; 59 | completedPercentage.value = 60 | currentDuration.value.toDouble() / totalDuration.value.toDouble(); 61 | }); 62 | } 63 | } 64 | 65 | void onPressedPlayButton(int id, var content) async { 66 | _currentId.value = id; 67 | if (isRecordPlaying) { 68 | await _pauseRecord(); 69 | } else { 70 | _isRecordPlaying.value = true; 71 | await _audioPlayerService.play(content); 72 | } 73 | } 74 | 75 | calcDuration() { 76 | var a = end.value.difference(start.value).inSeconds; 77 | format(Duration d) => d.toString().split('.').first.padLeft(8, "0"); 78 | _total = format(Duration(seconds: a)); 79 | } 80 | 81 | Future _pauseRecord() async { 82 | _isRecordPlaying.value = false; 83 | await _audioPlayerService.pause(); 84 | } 85 | } 86 | 87 | abstract class AudioPlayerService { 88 | void dispose(); 89 | Future play(String url); 90 | Future resume(); 91 | Future pause(); 92 | Future release(); 93 | 94 | AudioPlayer get getAudioPlayer; 95 | } 96 | 97 | class AudioPlayerAdapter implements AudioPlayerService { 98 | late AudioPlayer _audioPlayer; 99 | 100 | @override 101 | AudioPlayer get getAudioPlayer => _audioPlayer; 102 | 103 | AudioPlayerAdapter() { 104 | _audioPlayer = AudioPlayer(); 105 | } 106 | 107 | @override 108 | void dispose() async { 109 | await _audioPlayer.dispose(); 110 | } 111 | 112 | @override 113 | Future pause() async { 114 | await _audioPlayer.pause(); 115 | } 116 | 117 | @override 118 | Future play(String url) async { 119 | await _audioPlayer.play(UrlSource(url)); 120 | } 121 | 122 | @override 123 | Future release() async { 124 | await _audioPlayer.release(); 125 | } 126 | 127 | @override 128 | Future resume() async { 129 | await _audioPlayer.resume(); 130 | } 131 | } 132 | 133 | class AudioDuration { 134 | static double calculate(Duration soundDuration) { 135 | if (soundDuration.inSeconds > 60) { 136 | return 70.w; 137 | } else if (soundDuration.inSeconds > 50) { 138 | return 65.w; 139 | } else if (soundDuration.inSeconds > 40) { 140 | return 60.w; 141 | } else if (soundDuration.inSeconds > 30) { 142 | return 55.w; 143 | } else if (soundDuration.inSeconds > 20) { 144 | return 50.w; 145 | } else if (soundDuration.inSeconds > 10) { 146 | return 45.w; 147 | } else { 148 | return 40.w; 149 | } 150 | } 151 | } 152 | 153 | -------------------------------------------------------------------------------- /lib/tips5/online.dart: -------------------------------------------------------------------------------- 1 | import 'package:cloud_firestore/cloud_firestore.dart'; 2 | import 'package:flutter/material.dart'; 3 | import 'package:flutter_30_tips/home.dart'; 4 | 5 | class Online extends StatefulWidget { 6 | const Online({Key? key}) : super(key: key); 7 | 8 | @override 9 | State createState() => _OnlineState(); 10 | } 11 | 12 | class _OnlineState extends State with WidgetsBindingObserver { 13 | @override 14 | void initState() { 15 | // TODO: implement initState 16 | super.initState(); 17 | WidgetsBinding.instance.addObserver(this); 18 | setStatus(true); 19 | } 20 | 21 | void setStatus(bool status) async { 22 | await FirebaseFirestore.instance 23 | .collection('chat') 24 | .doc('9JkY7nEu5nyPQP15P67v') 25 | .update({"online": status}); 26 | } 27 | 28 | @override 29 | void didChangeAppLifecycleState(AppLifecycleState state) { 30 | if (state == AppLifecycleState.resumed) { 31 | setStatus(true); 32 | } else { 33 | setStatus(false); 34 | } 35 | } 36 | 37 | @override 38 | Widget build(BuildContext context) { 39 | return Scaffold( 40 | appBar: customAppBar("Tips 5"), 41 | body: const Center( 42 | child: Text( 43 | "Online", 44 | style: TextStyle(color: Colors.black), 45 | ))); 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /lib/tips6/searchSuggestion.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:flutter_30_tips/home.dart'; 3 | 4 | class SearchSuggestion extends StatefulWidget { 5 | const SearchSuggestion({Key? key}) : super(key: key); 6 | 7 | @override 8 | State createState() => _SearchSuggestionState(); 9 | } 10 | 11 | class _SearchSuggestionState extends State { 12 | String? selected; 13 | final List _suggestion = [ 14 | "Follow GO WITH FLUTTER", 15 | "Like", 16 | "Share", 17 | "Subscribe", 18 | 'Lakshydeep', 19 | 'Vikram', 20 | 'Rishi', 21 | 'Medium', 22 | "30FlutterTips" 23 | ]; 24 | @override 25 | Widget build(BuildContext context) { 26 | return Scaffold( 27 | appBar: customAppBar("Tips 6"), 28 | body: Center( 29 | child: Padding( 30 | padding: const EdgeInsets.all(40.0), 31 | child: Autocomplete( 32 | 33 | fieldViewBuilder: 34 | ((context, textEditingController, focusNode, onFieldSubmitted) { 35 | return TextFormField( 36 | controller: textEditingController, 37 | focusNode: focusNode, 38 | style: const TextStyle(color: Colors.black), 39 | onFieldSubmitted: (value) => onFieldSubmitted, 40 | decoration: InputDecoration( 41 | hintText: "Search and see suggestion", 42 | border: OutlineInputBorder( 43 | borderSide: BorderSide(color: mainColor))), 44 | ); 45 | }), 46 | optionsBuilder: (TextEditingValue textEditingValue) async { 47 | if (textEditingValue.text == '') { 48 | return const Iterable.empty(); 49 | } 50 | 51 | final List result = []; 52 | for (var e in _suggestion) { 53 | if (e 54 | .toString() 55 | .toLowerCase() 56 | .contains(textEditingValue.text.toLowerCase())) { 57 | result.add(e.toString()); 58 | } 59 | } 60 | 61 | return result; 62 | }, 63 | onSelected: (selection) { 64 | //debugPrint('You just selected $selection'); 65 | }, 66 | ), 67 | ), 68 | ), 69 | ); 70 | } 71 | } 72 | -------------------------------------------------------------------------------- /lib/tips7/textformValidation.dart: -------------------------------------------------------------------------------- 1 | // ignore_for_file: prefer_const_constructors 2 | import 'package:flutter/material.dart'; 3 | import 'package:flutter_30_tips/home.dart'; 4 | 5 | class TextFormValidation extends StatefulWidget { 6 | const TextFormValidation({Key? key}) : super(key: key); 7 | 8 | @override 9 | State createState() => _TextFormValidationState(); 10 | } 11 | 12 | class _TextFormValidationState extends State { 13 | String? requiredText( 14 | String? value, { 15 | String message = 'Subscribe @gowithflutter in YT', 16 | }) { 17 | if (value == null || value.trim().isEmpty || value != "@gowithflutter") { 18 | return message; 19 | } 20 | return null; 21 | } 22 | 23 | @override 24 | Widget build(BuildContext context) { 25 | return Scaffold( 26 | appBar: customAppBar("Tips 7"), 27 | body: Center( 28 | child: Padding( 29 | padding: const EdgeInsets.all(40.0), 30 | child: TextFormField( 31 | textInputAction: TextInputAction.done, 32 | autovalidateMode: AutovalidateMode.onUserInteraction, 33 | validator: (value) => requiredText(value), 34 | cursorHeight: 36, 35 | style: const TextStyle( 36 | fontSize: 15, 37 | fontWeight: FontWeight.w700, 38 | letterSpacing: 1.5, 39 | color: Colors.black), 40 | onEditingComplete: () { 41 | FocusScope.of(context).unfocus(); 42 | }, 43 | decoration: InputDecoration( 44 | border: OutlineInputBorder( 45 | borderSide: BorderSide(color: mainColor, width: 2)), 46 | hintStyle: TextStyle( 47 | fontSize: 36, 48 | fontWeight: FontWeight.w700, 49 | letterSpacing: 4.5, 50 | color: mainColor, 51 | ), 52 | ), 53 | ), 54 | ), 55 | ), 56 | ); 57 | } 58 | } 59 | -------------------------------------------------------------------------------- /lib/tips8/showCase.dart: -------------------------------------------------------------------------------- 1 | // ignore_for_file: deprecated_member_use 2 | 3 | import 'package:flutter/material.dart'; 4 | import 'package:flutter_30_tips/home.dart'; 5 | import 'package:google_fonts/google_fonts.dart'; 6 | 7 | class MyWidget extends StatefulWidget { 8 | const MyWidget({Key? key}) : super(key: key); 9 | 10 | @override 11 | State createState() => _MyWidgetState(); 12 | } 13 | 14 | class _MyWidgetState extends State { 15 | @override 16 | Widget build(BuildContext context) { 17 | return Scaffold( 18 | appBar: customAppBar("Tips 8"), 19 | body: Column( 20 | crossAxisAlignment: CrossAxisAlignment.center, 21 | mainAxisAlignment: MainAxisAlignment.center, 22 | children: [ 23 | Center( 24 | child: Text( 25 | "Follow and Subscribe", 26 | style: context.text.headline3, 27 | ), 28 | ), 29 | Text( 30 | " @gowithFlutter", 31 | style: context.text.headline1!.copyWith( 32 | color: mainColor.withOpacity(0.89), 33 | fontFamily: GoogleFonts.sansita().fontFamily), 34 | ), 35 | Text( 36 | " on", 37 | style: context.text.headline1, 38 | ), 39 | Text( 40 | " YouTube", 41 | style: context.text.headline2, 42 | ), 43 | Text( 44 | " #30FlutterTips", 45 | style: context.text.headline2! 46 | .copyWith(fontFamily: GoogleFonts.poppins().fontFamily), 47 | ), 48 | Text( 49 | " On", 50 | style: context.text.headline4, 51 | ), 52 | Text( 53 | " GitHub ", 54 | style: context.text.headline4! 55 | .copyWith(fontFamily: GoogleFonts.newTegomin().fontFamily), 56 | ), 57 | Text( 58 | " Medium", 59 | style: context.text.headline4! 60 | .copyWith(fontFamily: GoogleFonts.newTegomin().fontFamily), 61 | ), 62 | Text( 63 | " LinkedIN", 64 | style: context.text.headline4! 65 | .copyWith(fontFamily: GoogleFonts.newTegomin().fontFamily), 66 | ), 67 | Text( 68 | " @lakshydeep-14", 69 | style: context.text.headline4! 70 | .copyWith(fontFamily: GoogleFonts.newTegomin().fontFamily), 71 | ), 72 | ]), 73 | ); 74 | } 75 | } 76 | 77 | extension ThemeContext on BuildContext { 78 | ThemeData get theme => Theme.of(this); 79 | TextTheme get text => theme.textTheme; 80 | double get deviceHeight => MediaQuery.of(this).size.height; 81 | double get deviceWidth => MediaQuery.of(this).size.width; 82 | } 83 | -------------------------------------------------------------------------------- /lib/tips8/text_theme.dart: -------------------------------------------------------------------------------- 1 | // ignore_for_file: deprecated_member_use 2 | 3 | import 'package:flutter/material.dart'; 4 | import 'package:flutter_30_tips/home.dart'; 5 | import 'package:google_fonts/google_fonts.dart'; 6 | 7 | class AppTextStyle { 8 | AppTextStyle._(); 9 | static TextTheme get lightTextTheme => TextTheme( 10 | headline1: _headline1, 11 | headline2: _headline2, 12 | headline3: _headline3, 13 | headline4: _headline4, 14 | headline5: _headline5, 15 | ); 16 | 17 | static TextStyle get _baseHeadline => TextStyle( 18 | fontFamily: GoogleFonts.pacifico().fontFamily, 19 | color: mainColor, 20 | ); 21 | 22 | static TextStyle get _headline1 => _baseHeadline.copyWith( 23 | fontSize: 32, 24 | fontFamily: GoogleFonts.inter().fontFamily, 25 | fontWeight: FontWeight.w700, 26 | // letterSpacing: 1.0, 27 | ); 28 | static TextStyle get _headline2 => _baseHeadline.copyWith( 29 | fontSize: 24, 30 | fontWeight: FontWeight.w400, 31 | ); 32 | static TextStyle get _headline3 => _baseHeadline.copyWith( 33 | fontSize: 22, 34 | fontWeight: FontWeight.w400, 35 | ); 36 | static TextStyle get _headline4 => _baseHeadline.copyWith( 37 | fontSize: 20, 38 | fontWeight: FontWeight.w500, 39 | ); 40 | static TextStyle get _headline5 => _baseHeadline.copyWith( 41 | fontSize: 18, 42 | fontWeight: FontWeight.w500, 43 | ); 44 | } 45 | 46 | class AppTheme { 47 | AppTheme._(); 48 | 49 | static ThemeData light() { 50 | return ThemeData.light().copyWith( 51 | brightness: Brightness.light, 52 | scaffoldBackgroundColor: Colors.white, 53 | textTheme: AppTextStyle.lightTextTheme, 54 | ); 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /lib/tips9/webView.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:flutter_30_tips/home.dart'; 3 | import 'package:flutter_30_tips/tips9/wid.dart'; 4 | import 'package:font_awesome_flutter/font_awesome_flutter.dart'; 5 | import 'package:get/get.dart'; 6 | 7 | class WebViewWid extends StatefulWidget { 8 | const WebViewWid({Key? key}) : super(key: key); 9 | 10 | @override 11 | State createState() => _WebViewWidState(); 12 | } 13 | 14 | class _WebViewWidState extends State { 15 | @override 16 | Widget build(BuildContext context) { 17 | return Scaffold( 18 | appBar: customAppBar("Tips 9"), 19 | body: Column( 20 | mainAxisAlignment: MainAxisAlignment.center, 21 | crossAxisAlignment: CrossAxisAlignment.center, 22 | children: [ 23 | _wid( 24 | url: "https://lakshydeep-14.medium.com", 25 | label: "Medium", 26 | icon: FontAwesomeIcons.medium), 27 | _wid( 28 | url: "https://linkedin.com/in/lakshydeep-14", 29 | label: "LinkedIN", 30 | icon: FontAwesomeIcons.linkedin), 31 | _wid( 32 | url: "https://github.com/lakshydeep-14", 33 | label: "GitHub", 34 | icon: FontAwesomeIcons.github), 35 | ], 36 | )); 37 | } 38 | 39 | Widget _wid({String? url, IconData? icon, String? label}) { 40 | return Center( 41 | child: TextButton.icon( 42 | onPressed: () { 43 | Get.to(Wid( 44 | url: url!, 45 | )); 46 | }, 47 | icon: Icon( 48 | icon, 49 | color: mainColor, 50 | ), 51 | label: Text(label!)), 52 | ); 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /lib/tips9/wid.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:flutter_30_tips/home.dart'; 3 | import 'package:webview_flutter/webview_flutter.dart'; 4 | 5 | class Wid extends StatefulWidget { 6 | final String url; 7 | const Wid({Key? key, required this.url}) : super(key: key); 8 | 9 | @override 10 | State createState() => _WidState(); 11 | } 12 | 13 | class _WidState extends State { 14 | @override 15 | Widget build(BuildContext context) { 16 | return Scaffold( 17 | appBar: customAppBar("Tips 9"), 18 | body: WebViewWidget( 19 | controller: WebViewController() 20 | ..loadRequest(Uri.parse(widget.url)), 21 | )); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /linux/.gitignore: -------------------------------------------------------------------------------- 1 | flutter/ephemeral 2 | -------------------------------------------------------------------------------- /linux/flutter/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # This file controls Flutter-level build steps. It should not be edited. 2 | cmake_minimum_required(VERSION 3.10) 3 | 4 | set(EPHEMERAL_DIR "${CMAKE_CURRENT_SOURCE_DIR}/ephemeral") 5 | 6 | # Configuration provided via flutter tool. 7 | include(${EPHEMERAL_DIR}/generated_config.cmake) 8 | 9 | # TODO: Move the rest of this into files in ephemeral. See 10 | # https://github.com/flutter/flutter/issues/57146. 11 | 12 | # Serves the same purpose as list(TRANSFORM ... PREPEND ...), 13 | # which isn't available in 3.10. 14 | function(list_prepend LIST_NAME PREFIX) 15 | set(NEW_LIST "") 16 | foreach(element ${${LIST_NAME}}) 17 | list(APPEND NEW_LIST "${PREFIX}${element}") 18 | endforeach(element) 19 | set(${LIST_NAME} "${NEW_LIST}" PARENT_SCOPE) 20 | endfunction() 21 | 22 | # === Flutter Library === 23 | # System-level dependencies. 24 | find_package(PkgConfig REQUIRED) 25 | pkg_check_modules(GTK REQUIRED IMPORTED_TARGET gtk+-3.0) 26 | pkg_check_modules(GLIB REQUIRED IMPORTED_TARGET glib-2.0) 27 | pkg_check_modules(GIO REQUIRED IMPORTED_TARGET gio-2.0) 28 | 29 | set(FLUTTER_LIBRARY "${EPHEMERAL_DIR}/libflutter_linux_gtk.so") 30 | 31 | # Published to parent scope for install step. 32 | set(FLUTTER_LIBRARY ${FLUTTER_LIBRARY} PARENT_SCOPE) 33 | set(FLUTTER_ICU_DATA_FILE "${EPHEMERAL_DIR}/icudtl.dat" PARENT_SCOPE) 34 | set(PROJECT_BUILD_DIR "${PROJECT_DIR}/build/" PARENT_SCOPE) 35 | set(AOT_LIBRARY "${PROJECT_DIR}/build/lib/libapp.so" PARENT_SCOPE) 36 | 37 | list(APPEND FLUTTER_LIBRARY_HEADERS 38 | "fl_basic_message_channel.h" 39 | "fl_binary_codec.h" 40 | "fl_binary_messenger.h" 41 | "fl_dart_project.h" 42 | "fl_engine.h" 43 | "fl_json_message_codec.h" 44 | "fl_json_method_codec.h" 45 | "fl_message_codec.h" 46 | "fl_method_call.h" 47 | "fl_method_channel.h" 48 | "fl_method_codec.h" 49 | "fl_method_response.h" 50 | "fl_plugin_registrar.h" 51 | "fl_plugin_registry.h" 52 | "fl_standard_message_codec.h" 53 | "fl_standard_method_codec.h" 54 | "fl_string_codec.h" 55 | "fl_value.h" 56 | "fl_view.h" 57 | "flutter_linux.h" 58 | ) 59 | list_prepend(FLUTTER_LIBRARY_HEADERS "${EPHEMERAL_DIR}/flutter_linux/") 60 | add_library(flutter INTERFACE) 61 | target_include_directories(flutter INTERFACE 62 | "${EPHEMERAL_DIR}" 63 | ) 64 | target_link_libraries(flutter INTERFACE "${FLUTTER_LIBRARY}") 65 | target_link_libraries(flutter INTERFACE 66 | PkgConfig::GTK 67 | PkgConfig::GLIB 68 | PkgConfig::GIO 69 | ) 70 | add_dependencies(flutter flutter_assemble) 71 | 72 | # === Flutter tool backend === 73 | # _phony_ is a non-existent file to force this command to run every time, 74 | # since currently there's no way to get a full input/output list from the 75 | # flutter tool. 76 | add_custom_command( 77 | OUTPUT ${FLUTTER_LIBRARY} ${FLUTTER_LIBRARY_HEADERS} 78 | ${CMAKE_CURRENT_BINARY_DIR}/_phony_ 79 | COMMAND ${CMAKE_COMMAND} -E env 80 | ${FLUTTER_TOOL_ENVIRONMENT} 81 | "${FLUTTER_ROOT}/packages/flutter_tools/bin/tool_backend.sh" 82 | ${FLUTTER_TARGET_PLATFORM} ${CMAKE_BUILD_TYPE} 83 | VERBATIM 84 | ) 85 | add_custom_target(flutter_assemble DEPENDS 86 | "${FLUTTER_LIBRARY}" 87 | ${FLUTTER_LIBRARY_HEADERS} 88 | ) 89 | -------------------------------------------------------------------------------- /linux/flutter/generated_plugin_registrant.cc: -------------------------------------------------------------------------------- 1 | // 2 | // Generated file. Do not edit. 3 | // 4 | 5 | // clang-format off 6 | 7 | #include "generated_plugin_registrant.h" 8 | 9 | #include 10 | #include 11 | #include 12 | 13 | void fl_register_plugins(FlPluginRegistry* registry) { 14 | g_autoptr(FlPluginRegistrar) audioplayers_linux_registrar = 15 | fl_plugin_registry_get_registrar_for_plugin(registry, "AudioplayersLinuxPlugin"); 16 | audioplayers_linux_plugin_register_with_registrar(audioplayers_linux_registrar); 17 | g_autoptr(FlPluginRegistrar) printing_registrar = 18 | fl_plugin_registry_get_registrar_for_plugin(registry, "PrintingPlugin"); 19 | printing_plugin_register_with_registrar(printing_registrar); 20 | g_autoptr(FlPluginRegistrar) url_launcher_linux_registrar = 21 | fl_plugin_registry_get_registrar_for_plugin(registry, "UrlLauncherPlugin"); 22 | url_launcher_plugin_register_with_registrar(url_launcher_linux_registrar); 23 | } 24 | -------------------------------------------------------------------------------- /linux/flutter/generated_plugin_registrant.h: -------------------------------------------------------------------------------- 1 | // 2 | // Generated file. Do not edit. 3 | // 4 | 5 | // clang-format off 6 | 7 | #ifndef GENERATED_PLUGIN_REGISTRANT_ 8 | #define GENERATED_PLUGIN_REGISTRANT_ 9 | 10 | #include 11 | 12 | // Registers Flutter plugins. 13 | void fl_register_plugins(FlPluginRegistry* registry); 14 | 15 | #endif // GENERATED_PLUGIN_REGISTRANT_ 16 | -------------------------------------------------------------------------------- /linux/flutter/generated_plugins.cmake: -------------------------------------------------------------------------------- 1 | # 2 | # Generated file, do not edit. 3 | # 4 | 5 | list(APPEND FLUTTER_PLUGIN_LIST 6 | audioplayers_linux 7 | printing 8 | url_launcher_linux 9 | ) 10 | 11 | list(APPEND FLUTTER_FFI_PLUGIN_LIST 12 | ) 13 | 14 | set(PLUGIN_BUNDLED_LIBRARIES) 15 | 16 | foreach(plugin ${FLUTTER_PLUGIN_LIST}) 17 | add_subdirectory(flutter/ephemeral/.plugin_symlinks/${plugin}/linux plugins/${plugin}) 18 | target_link_libraries(${BINARY_NAME} PRIVATE ${plugin}_plugin) 19 | list(APPEND PLUGIN_BUNDLED_LIBRARIES $) 20 | list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${plugin}_bundled_libraries}) 21 | endforeach(plugin) 22 | 23 | foreach(ffi_plugin ${FLUTTER_FFI_PLUGIN_LIST}) 24 | add_subdirectory(flutter/ephemeral/.plugin_symlinks/${ffi_plugin}/linux plugins/${ffi_plugin}) 25 | list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${ffi_plugin}_bundled_libraries}) 26 | endforeach(ffi_plugin) 27 | -------------------------------------------------------------------------------- /linux/main.cc: -------------------------------------------------------------------------------- 1 | #include "my_application.h" 2 | 3 | int main(int argc, char** argv) { 4 | g_autoptr(MyApplication) app = my_application_new(); 5 | return g_application_run(G_APPLICATION(app), argc, argv); 6 | } 7 | -------------------------------------------------------------------------------- /linux/my_application.cc: -------------------------------------------------------------------------------- 1 | #include "my_application.h" 2 | 3 | #include 4 | #ifdef GDK_WINDOWING_X11 5 | #include 6 | #endif 7 | 8 | #include "flutter/generated_plugin_registrant.h" 9 | 10 | struct _MyApplication { 11 | GtkApplication parent_instance; 12 | char** dart_entrypoint_arguments; 13 | }; 14 | 15 | G_DEFINE_TYPE(MyApplication, my_application, GTK_TYPE_APPLICATION) 16 | 17 | // Implements GApplication::activate. 18 | static void my_application_activate(GApplication* application) { 19 | MyApplication* self = MY_APPLICATION(application); 20 | GtkWindow* window = 21 | GTK_WINDOW(gtk_application_window_new(GTK_APPLICATION(application))); 22 | 23 | // Use a header bar when running in GNOME as this is the common style used 24 | // by applications and is the setup most users will be using (e.g. Ubuntu 25 | // desktop). 26 | // If running on X and not using GNOME then just use a traditional title bar 27 | // in case the window manager does more exotic layout, e.g. tiling. 28 | // If running on Wayland assume the header bar will work (may need changing 29 | // if future cases occur). 30 | gboolean use_header_bar = TRUE; 31 | #ifdef GDK_WINDOWING_X11 32 | GdkScreen* screen = gtk_window_get_screen(window); 33 | if (GDK_IS_X11_SCREEN(screen)) { 34 | const gchar* wm_name = gdk_x11_screen_get_window_manager_name(screen); 35 | if (g_strcmp0(wm_name, "GNOME Shell") != 0) { 36 | use_header_bar = FALSE; 37 | } 38 | } 39 | #endif 40 | if (use_header_bar) { 41 | GtkHeaderBar* header_bar = GTK_HEADER_BAR(gtk_header_bar_new()); 42 | gtk_widget_show(GTK_WIDGET(header_bar)); 43 | gtk_header_bar_set_title(header_bar, "flutter_30_tips"); 44 | gtk_header_bar_set_show_close_button(header_bar, TRUE); 45 | gtk_window_set_titlebar(window, GTK_WIDGET(header_bar)); 46 | } else { 47 | gtk_window_set_title(window, "flutter_30_tips"); 48 | } 49 | 50 | gtk_window_set_default_size(window, 1280, 720); 51 | gtk_widget_show(GTK_WIDGET(window)); 52 | 53 | g_autoptr(FlDartProject) project = fl_dart_project_new(); 54 | fl_dart_project_set_dart_entrypoint_arguments(project, self->dart_entrypoint_arguments); 55 | 56 | FlView* view = fl_view_new(project); 57 | gtk_widget_show(GTK_WIDGET(view)); 58 | gtk_container_add(GTK_CONTAINER(window), GTK_WIDGET(view)); 59 | 60 | fl_register_plugins(FL_PLUGIN_REGISTRY(view)); 61 | 62 | gtk_widget_grab_focus(GTK_WIDGET(view)); 63 | } 64 | 65 | // Implements GApplication::local_command_line. 66 | static gboolean my_application_local_command_line(GApplication* application, gchar*** arguments, int* exit_status) { 67 | MyApplication* self = MY_APPLICATION(application); 68 | // Strip out the first argument as it is the binary name. 69 | self->dart_entrypoint_arguments = g_strdupv(*arguments + 1); 70 | 71 | g_autoptr(GError) error = nullptr; 72 | if (!g_application_register(application, nullptr, &error)) { 73 | g_warning("Failed to register: %s", error->message); 74 | *exit_status = 1; 75 | return TRUE; 76 | } 77 | 78 | g_application_activate(application); 79 | *exit_status = 0; 80 | 81 | return TRUE; 82 | } 83 | 84 | // Implements GObject::dispose. 85 | static void my_application_dispose(GObject* object) { 86 | MyApplication* self = MY_APPLICATION(object); 87 | g_clear_pointer(&self->dart_entrypoint_arguments, g_strfreev); 88 | G_OBJECT_CLASS(my_application_parent_class)->dispose(object); 89 | } 90 | 91 | static void my_application_class_init(MyApplicationClass* klass) { 92 | G_APPLICATION_CLASS(klass)->activate = my_application_activate; 93 | G_APPLICATION_CLASS(klass)->local_command_line = my_application_local_command_line; 94 | G_OBJECT_CLASS(klass)->dispose = my_application_dispose; 95 | } 96 | 97 | static void my_application_init(MyApplication* self) {} 98 | 99 | MyApplication* my_application_new() { 100 | return MY_APPLICATION(g_object_new(my_application_get_type(), 101 | "application-id", APPLICATION_ID, 102 | "flags", G_APPLICATION_NON_UNIQUE, 103 | nullptr)); 104 | } 105 | -------------------------------------------------------------------------------- /linux/my_application.h: -------------------------------------------------------------------------------- 1 | #ifndef FLUTTER_MY_APPLICATION_H_ 2 | #define FLUTTER_MY_APPLICATION_H_ 3 | 4 | #include 5 | 6 | G_DECLARE_FINAL_TYPE(MyApplication, my_application, MY, APPLICATION, 7 | GtkApplication) 8 | 9 | /** 10 | * my_application_new: 11 | * 12 | * Creates a new Flutter-based application. 13 | * 14 | * Returns: a new #MyApplication. 15 | */ 16 | MyApplication* my_application_new(); 17 | 18 | #endif // FLUTTER_MY_APPLICATION_H_ 19 | -------------------------------------------------------------------------------- /macos/.gitignore: -------------------------------------------------------------------------------- 1 | # Flutter-related 2 | **/Flutter/ephemeral/ 3 | **/Pods/ 4 | 5 | # Xcode-related 6 | **/dgph 7 | **/xcuserdata/ 8 | -------------------------------------------------------------------------------- /macos/Flutter/Flutter-Debug.xcconfig: -------------------------------------------------------------------------------- 1 | #include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig" 2 | #include "ephemeral/Flutter-Generated.xcconfig" 3 | -------------------------------------------------------------------------------- /macos/Flutter/Flutter-Release.xcconfig: -------------------------------------------------------------------------------- 1 | #include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig" 2 | #include "ephemeral/Flutter-Generated.xcconfig" 3 | -------------------------------------------------------------------------------- /macos/Flutter/GeneratedPluginRegistrant.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Generated file. Do not edit. 3 | // 4 | 5 | import FlutterMacOS 6 | import Foundation 7 | 8 | import audioplayers_darwin 9 | import cloud_firestore 10 | import firebase_core 11 | import firebase_storage 12 | import path_provider_foundation 13 | import printing 14 | import share_plus 15 | import shared_preferences_foundation 16 | import url_launcher_macos 17 | 18 | func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) { 19 | AudioplayersDarwinPlugin.register(with: registry.registrar(forPlugin: "AudioplayersDarwinPlugin")) 20 | FLTFirebaseFirestorePlugin.register(with: registry.registrar(forPlugin: "FLTFirebaseFirestorePlugin")) 21 | FLTFirebaseCorePlugin.register(with: registry.registrar(forPlugin: "FLTFirebaseCorePlugin")) 22 | FLTFirebaseStoragePlugin.register(with: registry.registrar(forPlugin: "FLTFirebaseStoragePlugin")) 23 | PathProviderPlugin.register(with: registry.registrar(forPlugin: "PathProviderPlugin")) 24 | PrintingPlugin.register(with: registry.registrar(forPlugin: "PrintingPlugin")) 25 | SharePlusMacosPlugin.register(with: registry.registrar(forPlugin: "SharePlusMacosPlugin")) 26 | SharedPreferencesPlugin.register(with: registry.registrar(forPlugin: "SharedPreferencesPlugin")) 27 | UrlLauncherPlugin.register(with: registry.registrar(forPlugin: "UrlLauncherPlugin")) 28 | } 29 | -------------------------------------------------------------------------------- /macos/Podfile: -------------------------------------------------------------------------------- 1 | platform :osx, '10.14' 2 | 3 | # CocoaPods analytics sends network stats synchronously affecting flutter build latency. 4 | ENV['COCOAPODS_DISABLE_STATS'] = 'true' 5 | 6 | project 'Runner', { 7 | 'Debug' => :debug, 8 | 'Profile' => :release, 9 | 'Release' => :release, 10 | } 11 | 12 | def flutter_root 13 | generated_xcode_build_settings_path = File.expand_path(File.join('..', 'Flutter', 'ephemeral', 'Flutter-Generated.xcconfig'), __FILE__) 14 | unless File.exist?(generated_xcode_build_settings_path) 15 | raise "#{generated_xcode_build_settings_path} must exist. If you're running pod install manually, make sure \"flutter pub get\" is executed first" 16 | end 17 | 18 | File.foreach(generated_xcode_build_settings_path) do |line| 19 | matches = line.match(/FLUTTER_ROOT\=(.*)/) 20 | return matches[1].strip if matches 21 | end 22 | raise "FLUTTER_ROOT not found in #{generated_xcode_build_settings_path}. Try deleting Flutter-Generated.xcconfig, then run \"flutter pub get\"" 23 | end 24 | 25 | require File.expand_path(File.join('packages', 'flutter_tools', 'bin', 'podhelper'), flutter_root) 26 | 27 | flutter_macos_podfile_setup 28 | 29 | target 'Runner' do 30 | use_frameworks! 31 | use_modular_headers! 32 | 33 | flutter_install_all_macos_pods File.dirname(File.realpath(__FILE__)) 34 | end 35 | 36 | post_install do |installer| 37 | installer.pods_project.targets.each do |target| 38 | flutter_additional_macos_build_settings(target) 39 | end 40 | end 41 | -------------------------------------------------------------------------------- /macos/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /macos/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 37 | 38 | 39 | 40 | 41 | 42 | 52 | 54 | 60 | 61 | 62 | 63 | 69 | 71 | 77 | 78 | 79 | 80 | 82 | 83 | 86 | 87 | 88 | -------------------------------------------------------------------------------- /macos/Runner.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /macos/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /macos/Runner/AppDelegate.swift: -------------------------------------------------------------------------------- 1 | import Cocoa 2 | import FlutterMacOS 3 | 4 | @NSApplicationMain 5 | class AppDelegate: FlutterAppDelegate { 6 | override func applicationShouldTerminateAfterLastWindowClosed(_ sender: NSApplication) -> Bool { 7 | return true 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /macos/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "size" : "16x16", 5 | "idiom" : "mac", 6 | "filename" : "app_icon_16.png", 7 | "scale" : "1x" 8 | }, 9 | { 10 | "size" : "16x16", 11 | "idiom" : "mac", 12 | "filename" : "app_icon_32.png", 13 | "scale" : "2x" 14 | }, 15 | { 16 | "size" : "32x32", 17 | "idiom" : "mac", 18 | "filename" : "app_icon_32.png", 19 | "scale" : "1x" 20 | }, 21 | { 22 | "size" : "32x32", 23 | "idiom" : "mac", 24 | "filename" : "app_icon_64.png", 25 | "scale" : "2x" 26 | }, 27 | { 28 | "size" : "128x128", 29 | "idiom" : "mac", 30 | "filename" : "app_icon_128.png", 31 | "scale" : "1x" 32 | }, 33 | { 34 | "size" : "128x128", 35 | "idiom" : "mac", 36 | "filename" : "app_icon_256.png", 37 | "scale" : "2x" 38 | }, 39 | { 40 | "size" : "256x256", 41 | "idiom" : "mac", 42 | "filename" : "app_icon_256.png", 43 | "scale" : "1x" 44 | }, 45 | { 46 | "size" : "256x256", 47 | "idiom" : "mac", 48 | "filename" : "app_icon_512.png", 49 | "scale" : "2x" 50 | }, 51 | { 52 | "size" : "512x512", 53 | "idiom" : "mac", 54 | "filename" : "app_icon_512.png", 55 | "scale" : "1x" 56 | }, 57 | { 58 | "size" : "512x512", 59 | "idiom" : "mac", 60 | "filename" : "app_icon_1024.png", 61 | "scale" : "2x" 62 | } 63 | ], 64 | "info" : { 65 | "version" : 1, 66 | "author" : "xcode" 67 | } 68 | } 69 | -------------------------------------------------------------------------------- /macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_1024.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lakshydeep-14/30FlutterTips/ddaa0da4b1ed90c51f26efc5a6c892efbb239337/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_1024.png -------------------------------------------------------------------------------- /macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_128.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lakshydeep-14/30FlutterTips/ddaa0da4b1ed90c51f26efc5a6c892efbb239337/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_128.png -------------------------------------------------------------------------------- /macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lakshydeep-14/30FlutterTips/ddaa0da4b1ed90c51f26efc5a6c892efbb239337/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_16.png -------------------------------------------------------------------------------- /macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_256.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lakshydeep-14/30FlutterTips/ddaa0da4b1ed90c51f26efc5a6c892efbb239337/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_256.png -------------------------------------------------------------------------------- /macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lakshydeep-14/30FlutterTips/ddaa0da4b1ed90c51f26efc5a6c892efbb239337/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_32.png -------------------------------------------------------------------------------- /macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lakshydeep-14/30FlutterTips/ddaa0da4b1ed90c51f26efc5a6c892efbb239337/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_512.png -------------------------------------------------------------------------------- /macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_64.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lakshydeep-14/30FlutterTips/ddaa0da4b1ed90c51f26efc5a6c892efbb239337/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_64.png -------------------------------------------------------------------------------- /macos/Runner/Configs/AppInfo.xcconfig: -------------------------------------------------------------------------------- 1 | // Application-level settings for the Runner target. 2 | // 3 | // This may be replaced with something auto-generated from metadata (e.g., pubspec.yaml) in the 4 | // future. If not, the values below would default to using the project name when this becomes a 5 | // 'flutter create' template. 6 | 7 | // The application's name. By default this is also the title of the Flutter window. 8 | PRODUCT_NAME = flutter_30_tips 9 | 10 | // The application's bundle identifier 11 | PRODUCT_BUNDLE_IDENTIFIER = com.example.flutter30Tips 12 | 13 | // The copyright displayed in application information 14 | PRODUCT_COPYRIGHT = Copyright © 2022 com.example. All rights reserved. 15 | -------------------------------------------------------------------------------- /macos/Runner/Configs/Debug.xcconfig: -------------------------------------------------------------------------------- 1 | #include "../../Flutter/Flutter-Debug.xcconfig" 2 | #include "Warnings.xcconfig" 3 | -------------------------------------------------------------------------------- /macos/Runner/Configs/Release.xcconfig: -------------------------------------------------------------------------------- 1 | #include "../../Flutter/Flutter-Release.xcconfig" 2 | #include "Warnings.xcconfig" 3 | -------------------------------------------------------------------------------- /macos/Runner/Configs/Warnings.xcconfig: -------------------------------------------------------------------------------- 1 | WARNING_CFLAGS = -Wall -Wconditional-uninitialized -Wnullable-to-nonnull-conversion -Wmissing-method-return-type -Woverlength-strings 2 | GCC_WARN_UNDECLARED_SELECTOR = YES 3 | CLANG_UNDEFINED_BEHAVIOR_SANITIZER_NULLABILITY = YES 4 | CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE 5 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES 6 | CLANG_WARN_PRAGMA_PACK = YES 7 | CLANG_WARN_STRICT_PROTOTYPES = YES 8 | CLANG_WARN_COMMA = YES 9 | GCC_WARN_STRICT_SELECTOR_MATCH = YES 10 | CLANG_WARN_OBJC_REPEATED_USE_OF_WEAK = YES 11 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES 12 | GCC_WARN_SHADOW = YES 13 | CLANG_WARN_UNREACHABLE_CODE = YES 14 | -------------------------------------------------------------------------------- /macos/Runner/DebugProfile.entitlements: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | com.apple.security.app-sandbox 6 | 7 | com.apple.security.cs.allow-jit 8 | 9 | com.apple.security.network.server 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /macos/Runner/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | $(DEVELOPMENT_LANGUAGE) 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIconFile 10 | 11 | CFBundleIdentifier 12 | $(PRODUCT_BUNDLE_IDENTIFIER) 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | $(PRODUCT_NAME) 17 | CFBundlePackageType 18 | APPL 19 | CFBundleShortVersionString 20 | $(FLUTTER_BUILD_NAME) 21 | CFBundleVersion 22 | $(FLUTTER_BUILD_NUMBER) 23 | LSMinimumSystemVersion 24 | $(MACOSX_DEPLOYMENT_TARGET) 25 | NSHumanReadableCopyright 26 | $(PRODUCT_COPYRIGHT) 27 | NSMainNibFile 28 | MainMenu 29 | NSPrincipalClass 30 | NSApplication 31 | 32 | 33 | -------------------------------------------------------------------------------- /macos/Runner/MainFlutterWindow.swift: -------------------------------------------------------------------------------- 1 | import Cocoa 2 | import FlutterMacOS 3 | 4 | class MainFlutterWindow: NSWindow { 5 | override func awakeFromNib() { 6 | let flutterViewController = FlutterViewController.init() 7 | let windowFrame = self.frame 8 | self.contentViewController = flutterViewController 9 | self.setFrame(windowFrame, display: true) 10 | 11 | RegisterGeneratedPlugins(registry: flutterViewController) 12 | 13 | super.awakeFromNib() 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /macos/Runner/Release.entitlements: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | com.apple.security.app-sandbox 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: flutter_30_tips 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.17.6 <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 | audioplayers: null 31 | bot_toast: ^4.0.3 32 | carousel_slider: ^4.2.1 33 | cloud_firestore: null 34 | confetti: ^0.7.0 35 | cupertino_icons: ^1.0.2 36 | dropdown_button2: ^1.7.0 37 | firebase_core: ^2.5.0 38 | firebase_storage: null 39 | flutter: 40 | sdk: flutter 41 | flutter_native_image: ^0.0.6+1 42 | fluttertoast: ^8.0.9 43 | font_awesome_flutter: ^10.1.0 44 | get: null 45 | google_fonts: ^4.0.3 46 | image_picker: ^0.8.5+3 47 | is_first_run: ^1.0.0 48 | numeral_system: ^2.0.0+1 49 | path_provider: null 50 | pdf: ^3.8.2 51 | permission_handler: ^10.0.0 52 | pie_chart: null 53 | printing: null 54 | record_mp3: ^3.0.0 55 | share_plus: ^6.3.1 56 | shimmer: null 57 | sizer: null 58 | syncfusion_flutter_charts: null 59 | url_launcher: ^6.1.5 60 | webview_flutter: ^4.0.2 61 | zoom_widget: ^2.0.0 62 | responsive_builder: null 63 | device_preview: ^1.1.0 64 | 65 | 66 | dev_dependencies: 67 | flutter_lints: ^2.0.0 68 | flutter_test: 69 | sdk: flutter 70 | 71 | # For information on the generic Dart part of this file, see the 72 | # following page: https://dart.dev/tools/pub/pubspec 73 | # The following section is specific to Flutter packages. 74 | flutter: 75 | 76 | # The following line ensures that the Material Icons font is 77 | # included with your application, so that you can use the icons in 78 | # the material Icons class. 79 | uses-material-design: true 80 | # To add assets to your application, add an assets section, like this: 81 | assets: 82 | - assets/ 83 | # - images/a_dot_ham.jpeg 84 | # An image asset can refer to one or more resolution-specific "variants", see 85 | # https://flutter.dev/assets-and-images/#resolution-aware 86 | # For details regarding adding assets from package dependencies, see 87 | # https://flutter.dev/assets-and-images/#from-packages 88 | # To add custom fonts to your application, add a fonts section here, 89 | # in this "flutter" section. Each entry in this list should have a 90 | # "family" key with the font family name, and a "fonts" key with a 91 | # list giving the asset and other descriptors for the font. For 92 | # example: 93 | # fonts: 94 | # - family: Schyler 95 | # fonts: 96 | # - asset: fonts/Schyler-Regular.ttf 97 | # - asset: fonts/Schyler-Italic.ttf 98 | # style: italic 99 | # - family: Trajan Pro 100 | # fonts: 101 | # - asset: fonts/TrajanPro.ttf 102 | # - asset: fonts/TrajanPro_Bold.ttf 103 | # weight: 700 104 | # 105 | # For details regarding fonts from package dependencies, 106 | # see https://flutter.dev/custom-fonts/#from-packages 107 | -------------------------------------------------------------------------------- /test/widget_test.dart: -------------------------------------------------------------------------------- 1 | // This is a basic Flutter widget test. 2 | // 3 | // To perform an interaction with a widget in your test, use the WidgetTester 4 | // utility in the flutter_test package. For example, you can send tap and scroll 5 | // gestures. You can also use WidgetTester to find child widgets in the widget 6 | // tree, read text, and verify that the values of widget properties are correct. 7 | 8 | import 'package:flutter/material.dart'; 9 | import 'package:flutter_test/flutter_test.dart'; 10 | 11 | import 'package:flutter_30_tips/main.dart'; 12 | 13 | void main() { 14 | testWidgets('Counter increments smoke test', (WidgetTester tester) async { 15 | // Build our app and trigger a frame. 16 | await tester.pumpWidget(const MyApp()); 17 | 18 | // Verify that our counter starts at 0. 19 | expect(find.text('0'), findsOneWidget); 20 | expect(find.text('1'), findsNothing); 21 | 22 | // Tap the '+' icon and trigger a frame. 23 | await tester.tap(find.byIcon(Icons.add)); 24 | await tester.pump(); 25 | 26 | // Verify that our counter has incremented. 27 | expect(find.text('0'), findsNothing); 28 | expect(find.text('1'), findsOneWidget); 29 | }); 30 | } 31 | -------------------------------------------------------------------------------- /web/favicon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lakshydeep-14/30FlutterTips/ddaa0da4b1ed90c51f26efc5a6c892efbb239337/web/favicon.png -------------------------------------------------------------------------------- /web/icons/Icon-192.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lakshydeep-14/30FlutterTips/ddaa0da4b1ed90c51f26efc5a6c892efbb239337/web/icons/Icon-192.png -------------------------------------------------------------------------------- /web/icons/Icon-512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lakshydeep-14/30FlutterTips/ddaa0da4b1ed90c51f26efc5a6c892efbb239337/web/icons/Icon-512.png -------------------------------------------------------------------------------- /web/icons/Icon-maskable-192.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lakshydeep-14/30FlutterTips/ddaa0da4b1ed90c51f26efc5a6c892efbb239337/web/icons/Icon-maskable-192.png -------------------------------------------------------------------------------- /web/icons/Icon-maskable-512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lakshydeep-14/30FlutterTips/ddaa0da4b1ed90c51f26efc5a6c892efbb239337/web/icons/Icon-maskable-512.png -------------------------------------------------------------------------------- /web/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | flutter_30_tips 33 | 34 | 35 | 39 | 40 | 41 | 42 | 43 | 57 | 58 | 59 | -------------------------------------------------------------------------------- /web/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "flutter_30_tips", 3 | "short_name": "flutter_30_tips", 4 | "start_url": ".", 5 | "display": "standalone", 6 | "background_color": "#0175C2", 7 | "theme_color": "#0175C2", 8 | "description": "A new Flutter project.", 9 | "orientation": "portrait-primary", 10 | "prefer_related_applications": false, 11 | "icons": [ 12 | { 13 | "src": "icons/Icon-192.png", 14 | "sizes": "192x192", 15 | "type": "image/png" 16 | }, 17 | { 18 | "src": "icons/Icon-512.png", 19 | "sizes": "512x512", 20 | "type": "image/png" 21 | }, 22 | { 23 | "src": "icons/Icon-maskable-192.png", 24 | "sizes": "192x192", 25 | "type": "image/png", 26 | "purpose": "maskable" 27 | }, 28 | { 29 | "src": "icons/Icon-maskable-512.png", 30 | "sizes": "512x512", 31 | "type": "image/png", 32 | "purpose": "maskable" 33 | } 34 | ] 35 | } 36 | -------------------------------------------------------------------------------- /windows/.gitignore: -------------------------------------------------------------------------------- 1 | flutter/ephemeral/ 2 | 3 | # Visual Studio user-specific files. 4 | *.suo 5 | *.user 6 | *.userosscache 7 | *.sln.docstates 8 | 9 | # Visual Studio build-related files. 10 | x64/ 11 | x86/ 12 | 13 | # Visual Studio cache files 14 | # files ending in .cache can be ignored 15 | *.[Cc]ache 16 | # but keep track of directories ending in .cache 17 | !*.[Cc]ache/ 18 | -------------------------------------------------------------------------------- /windows/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Project-level configuration. 2 | cmake_minimum_required(VERSION 3.14) 3 | project(flutter_30_tips LANGUAGES CXX) 4 | 5 | # The name of the executable created for the application. Change this to change 6 | # the on-disk name of your application. 7 | set(BINARY_NAME "flutter_30_tips") 8 | 9 | # Explicitly opt in to modern CMake behaviors to avoid warnings with recent 10 | # versions of CMake. 11 | cmake_policy(SET CMP0063 NEW) 12 | 13 | # Define build configuration option. 14 | get_property(IS_MULTICONFIG GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG) 15 | if(IS_MULTICONFIG) 16 | set(CMAKE_CONFIGURATION_TYPES "Debug;Profile;Release" 17 | CACHE STRING "" FORCE) 18 | else() 19 | if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES) 20 | set(CMAKE_BUILD_TYPE "Debug" CACHE 21 | STRING "Flutter build mode" FORCE) 22 | set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS 23 | "Debug" "Profile" "Release") 24 | endif() 25 | endif() 26 | # Define settings for the Profile build mode. 27 | set(CMAKE_EXE_LINKER_FLAGS_PROFILE "${CMAKE_EXE_LINKER_FLAGS_RELEASE}") 28 | set(CMAKE_SHARED_LINKER_FLAGS_PROFILE "${CMAKE_SHARED_LINKER_FLAGS_RELEASE}") 29 | set(CMAKE_C_FLAGS_PROFILE "${CMAKE_C_FLAGS_RELEASE}") 30 | set(CMAKE_CXX_FLAGS_PROFILE "${CMAKE_CXX_FLAGS_RELEASE}") 31 | 32 | # Use Unicode for all projects. 33 | add_definitions(-DUNICODE -D_UNICODE) 34 | 35 | # Compilation settings that should be applied to most targets. 36 | # 37 | # Be cautious about adding new options here, as plugins use this function by 38 | # default. In most cases, you should add new options to specific targets instead 39 | # of modifying this function. 40 | function(APPLY_STANDARD_SETTINGS TARGET) 41 | target_compile_features(${TARGET} PUBLIC cxx_std_17) 42 | target_compile_options(${TARGET} PRIVATE /W4 /WX /wd"4100") 43 | target_compile_options(${TARGET} PRIVATE /EHsc) 44 | target_compile_definitions(${TARGET} PRIVATE "_HAS_EXCEPTIONS=0") 45 | target_compile_definitions(${TARGET} PRIVATE "$<$:_DEBUG>") 46 | endfunction() 47 | 48 | # Flutter library and tool build rules. 49 | set(FLUTTER_MANAGED_DIR "${CMAKE_CURRENT_SOURCE_DIR}/flutter") 50 | add_subdirectory(${FLUTTER_MANAGED_DIR}) 51 | 52 | # Application build; see runner/CMakeLists.txt. 53 | add_subdirectory("runner") 54 | 55 | # Generated plugin build rules, which manage building the plugins and adding 56 | # them to the application. 57 | include(flutter/generated_plugins.cmake) 58 | 59 | 60 | # === Installation === 61 | # Support files are copied into place next to the executable, so that it can 62 | # run in place. This is done instead of making a separate bundle (as on Linux) 63 | # so that building and running from within Visual Studio will work. 64 | set(BUILD_BUNDLE_DIR "$") 65 | # Make the "install" step default, as it's required to run. 66 | set(CMAKE_VS_INCLUDE_INSTALL_TO_DEFAULT_BUILD 1) 67 | if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT) 68 | set(CMAKE_INSTALL_PREFIX "${BUILD_BUNDLE_DIR}" CACHE PATH "..." FORCE) 69 | endif() 70 | 71 | set(INSTALL_BUNDLE_DATA_DIR "${CMAKE_INSTALL_PREFIX}/data") 72 | set(INSTALL_BUNDLE_LIB_DIR "${CMAKE_INSTALL_PREFIX}") 73 | 74 | install(TARGETS ${BINARY_NAME} RUNTIME DESTINATION "${CMAKE_INSTALL_PREFIX}" 75 | COMPONENT Runtime) 76 | 77 | install(FILES "${FLUTTER_ICU_DATA_FILE}" DESTINATION "${INSTALL_BUNDLE_DATA_DIR}" 78 | COMPONENT Runtime) 79 | 80 | install(FILES "${FLUTTER_LIBRARY}" DESTINATION "${INSTALL_BUNDLE_LIB_DIR}" 81 | COMPONENT Runtime) 82 | 83 | if(PLUGIN_BUNDLED_LIBRARIES) 84 | install(FILES "${PLUGIN_BUNDLED_LIBRARIES}" 85 | DESTINATION "${INSTALL_BUNDLE_LIB_DIR}" 86 | COMPONENT Runtime) 87 | endif() 88 | 89 | # Fully re-copy the assets directory on each build to avoid having stale files 90 | # from a previous install. 91 | set(FLUTTER_ASSET_DIR_NAME "flutter_assets") 92 | install(CODE " 93 | file(REMOVE_RECURSE \"${INSTALL_BUNDLE_DATA_DIR}/${FLUTTER_ASSET_DIR_NAME}\") 94 | " COMPONENT Runtime) 95 | install(DIRECTORY "${PROJECT_BUILD_DIR}/${FLUTTER_ASSET_DIR_NAME}" 96 | DESTINATION "${INSTALL_BUNDLE_DATA_DIR}" COMPONENT Runtime) 97 | 98 | # Install the AOT library on non-Debug builds only. 99 | install(FILES "${AOT_LIBRARY}" DESTINATION "${INSTALL_BUNDLE_DATA_DIR}" 100 | CONFIGURATIONS Profile;Release 101 | COMPONENT Runtime) 102 | -------------------------------------------------------------------------------- /windows/flutter/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # This file controls Flutter-level build steps. It should not be edited. 2 | cmake_minimum_required(VERSION 3.14) 3 | 4 | set(EPHEMERAL_DIR "${CMAKE_CURRENT_SOURCE_DIR}/ephemeral") 5 | 6 | # Configuration provided via flutter tool. 7 | include(${EPHEMERAL_DIR}/generated_config.cmake) 8 | 9 | # TODO: Move the rest of this into files in ephemeral. See 10 | # https://github.com/flutter/flutter/issues/57146. 11 | set(WRAPPER_ROOT "${EPHEMERAL_DIR}/cpp_client_wrapper") 12 | 13 | # === Flutter Library === 14 | set(FLUTTER_LIBRARY "${EPHEMERAL_DIR}/flutter_windows.dll") 15 | 16 | # Published to parent scope for install step. 17 | set(FLUTTER_LIBRARY ${FLUTTER_LIBRARY} PARENT_SCOPE) 18 | set(FLUTTER_ICU_DATA_FILE "${EPHEMERAL_DIR}/icudtl.dat" PARENT_SCOPE) 19 | set(PROJECT_BUILD_DIR "${PROJECT_DIR}/build/" PARENT_SCOPE) 20 | set(AOT_LIBRARY "${PROJECT_DIR}/build/windows/app.so" PARENT_SCOPE) 21 | 22 | list(APPEND FLUTTER_LIBRARY_HEADERS 23 | "flutter_export.h" 24 | "flutter_windows.h" 25 | "flutter_messenger.h" 26 | "flutter_plugin_registrar.h" 27 | "flutter_texture_registrar.h" 28 | ) 29 | list(TRANSFORM FLUTTER_LIBRARY_HEADERS PREPEND "${EPHEMERAL_DIR}/") 30 | add_library(flutter INTERFACE) 31 | target_include_directories(flutter INTERFACE 32 | "${EPHEMERAL_DIR}" 33 | ) 34 | target_link_libraries(flutter INTERFACE "${FLUTTER_LIBRARY}.lib") 35 | add_dependencies(flutter flutter_assemble) 36 | 37 | # === Wrapper === 38 | list(APPEND CPP_WRAPPER_SOURCES_CORE 39 | "core_implementations.cc" 40 | "standard_codec.cc" 41 | ) 42 | list(TRANSFORM CPP_WRAPPER_SOURCES_CORE PREPEND "${WRAPPER_ROOT}/") 43 | list(APPEND CPP_WRAPPER_SOURCES_PLUGIN 44 | "plugin_registrar.cc" 45 | ) 46 | list(TRANSFORM CPP_WRAPPER_SOURCES_PLUGIN PREPEND "${WRAPPER_ROOT}/") 47 | list(APPEND CPP_WRAPPER_SOURCES_APP 48 | "flutter_engine.cc" 49 | "flutter_view_controller.cc" 50 | ) 51 | list(TRANSFORM CPP_WRAPPER_SOURCES_APP PREPEND "${WRAPPER_ROOT}/") 52 | 53 | # Wrapper sources needed for a plugin. 54 | add_library(flutter_wrapper_plugin STATIC 55 | ${CPP_WRAPPER_SOURCES_CORE} 56 | ${CPP_WRAPPER_SOURCES_PLUGIN} 57 | ) 58 | apply_standard_settings(flutter_wrapper_plugin) 59 | set_target_properties(flutter_wrapper_plugin PROPERTIES 60 | POSITION_INDEPENDENT_CODE ON) 61 | set_target_properties(flutter_wrapper_plugin PROPERTIES 62 | CXX_VISIBILITY_PRESET hidden) 63 | target_link_libraries(flutter_wrapper_plugin PUBLIC flutter) 64 | target_include_directories(flutter_wrapper_plugin PUBLIC 65 | "${WRAPPER_ROOT}/include" 66 | ) 67 | add_dependencies(flutter_wrapper_plugin flutter_assemble) 68 | 69 | # Wrapper sources needed for the runner. 70 | add_library(flutter_wrapper_app STATIC 71 | ${CPP_WRAPPER_SOURCES_CORE} 72 | ${CPP_WRAPPER_SOURCES_APP} 73 | ) 74 | apply_standard_settings(flutter_wrapper_app) 75 | target_link_libraries(flutter_wrapper_app PUBLIC flutter) 76 | target_include_directories(flutter_wrapper_app PUBLIC 77 | "${WRAPPER_ROOT}/include" 78 | ) 79 | add_dependencies(flutter_wrapper_app flutter_assemble) 80 | 81 | # === Flutter tool backend === 82 | # _phony_ is a non-existent file to force this command to run every time, 83 | # since currently there's no way to get a full input/output list from the 84 | # flutter tool. 85 | set(PHONY_OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/_phony_") 86 | set_source_files_properties("${PHONY_OUTPUT}" PROPERTIES SYMBOLIC TRUE) 87 | add_custom_command( 88 | OUTPUT ${FLUTTER_LIBRARY} ${FLUTTER_LIBRARY_HEADERS} 89 | ${CPP_WRAPPER_SOURCES_CORE} ${CPP_WRAPPER_SOURCES_PLUGIN} 90 | ${CPP_WRAPPER_SOURCES_APP} 91 | ${PHONY_OUTPUT} 92 | COMMAND ${CMAKE_COMMAND} -E env 93 | ${FLUTTER_TOOL_ENVIRONMENT} 94 | "${FLUTTER_ROOT}/packages/flutter_tools/bin/tool_backend.bat" 95 | windows-x64 $ 96 | VERBATIM 97 | ) 98 | add_custom_target(flutter_assemble DEPENDS 99 | "${FLUTTER_LIBRARY}" 100 | ${FLUTTER_LIBRARY_HEADERS} 101 | ${CPP_WRAPPER_SOURCES_CORE} 102 | ${CPP_WRAPPER_SOURCES_PLUGIN} 103 | ${CPP_WRAPPER_SOURCES_APP} 104 | ) 105 | -------------------------------------------------------------------------------- /windows/flutter/generated_plugin_registrant.cc: -------------------------------------------------------------------------------- 1 | // 2 | // Generated file. Do not edit. 3 | // 4 | 5 | // clang-format off 6 | 7 | #include "generated_plugin_registrant.h" 8 | 9 | #include 10 | #include 11 | #include 12 | #include 13 | #include 14 | 15 | void RegisterPlugins(flutter::PluginRegistry* registry) { 16 | AudioplayersWindowsPluginRegisterWithRegistrar( 17 | registry->GetRegistrarForPlugin("AudioplayersWindowsPlugin")); 18 | PermissionHandlerWindowsPluginRegisterWithRegistrar( 19 | registry->GetRegistrarForPlugin("PermissionHandlerWindowsPlugin")); 20 | PrintingPluginRegisterWithRegistrar( 21 | registry->GetRegistrarForPlugin("PrintingPlugin")); 22 | SharePlusWindowsPluginCApiRegisterWithRegistrar( 23 | registry->GetRegistrarForPlugin("SharePlusWindowsPluginCApi")); 24 | UrlLauncherWindowsRegisterWithRegistrar( 25 | registry->GetRegistrarForPlugin("UrlLauncherWindows")); 26 | } 27 | -------------------------------------------------------------------------------- /windows/flutter/generated_plugin_registrant.h: -------------------------------------------------------------------------------- 1 | // 2 | // Generated file. Do not edit. 3 | // 4 | 5 | // clang-format off 6 | 7 | #ifndef GENERATED_PLUGIN_REGISTRANT_ 8 | #define GENERATED_PLUGIN_REGISTRANT_ 9 | 10 | #include 11 | 12 | // Registers Flutter plugins. 13 | void RegisterPlugins(flutter::PluginRegistry* registry); 14 | 15 | #endif // GENERATED_PLUGIN_REGISTRANT_ 16 | -------------------------------------------------------------------------------- /windows/flutter/generated_plugins.cmake: -------------------------------------------------------------------------------- 1 | # 2 | # Generated file, do not edit. 3 | # 4 | 5 | list(APPEND FLUTTER_PLUGIN_LIST 6 | audioplayers_windows 7 | permission_handler_windows 8 | printing 9 | share_plus 10 | url_launcher_windows 11 | ) 12 | 13 | list(APPEND FLUTTER_FFI_PLUGIN_LIST 14 | ) 15 | 16 | set(PLUGIN_BUNDLED_LIBRARIES) 17 | 18 | foreach(plugin ${FLUTTER_PLUGIN_LIST}) 19 | add_subdirectory(flutter/ephemeral/.plugin_symlinks/${plugin}/windows plugins/${plugin}) 20 | target_link_libraries(${BINARY_NAME} PRIVATE ${plugin}_plugin) 21 | list(APPEND PLUGIN_BUNDLED_LIBRARIES $) 22 | list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${plugin}_bundled_libraries}) 23 | endforeach(plugin) 24 | 25 | foreach(ffi_plugin ${FLUTTER_FFI_PLUGIN_LIST}) 26 | add_subdirectory(flutter/ephemeral/.plugin_symlinks/${ffi_plugin}/windows plugins/${ffi_plugin}) 27 | list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${ffi_plugin}_bundled_libraries}) 28 | endforeach(ffi_plugin) 29 | -------------------------------------------------------------------------------- /windows/runner/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.14) 2 | project(runner LANGUAGES CXX) 3 | 4 | # Define the application target. To change its name, change BINARY_NAME in the 5 | # top-level CMakeLists.txt, not the value here, or `flutter run` will no longer 6 | # work. 7 | # 8 | # Any new source files that you add to the application should be added here. 9 | add_executable(${BINARY_NAME} WIN32 10 | "flutter_window.cpp" 11 | "main.cpp" 12 | "utils.cpp" 13 | "win32_window.cpp" 14 | "${FLUTTER_MANAGED_DIR}/generated_plugin_registrant.cc" 15 | "Runner.rc" 16 | "runner.exe.manifest" 17 | ) 18 | 19 | # Apply the standard set of build settings. This can be removed for applications 20 | # that need different build settings. 21 | apply_standard_settings(${BINARY_NAME}) 22 | 23 | # Disable Windows macros that collide with C++ standard library functions. 24 | target_compile_definitions(${BINARY_NAME} PRIVATE "NOMINMAX") 25 | 26 | # Add dependency libraries and include directories. Add any application-specific 27 | # dependencies here. 28 | target_link_libraries(${BINARY_NAME} PRIVATE flutter flutter_wrapper_app) 29 | target_include_directories(${BINARY_NAME} PRIVATE "${CMAKE_SOURCE_DIR}") 30 | 31 | # Run the Flutter tool portions of the build. This must not be removed. 32 | add_dependencies(${BINARY_NAME} flutter_assemble) 33 | -------------------------------------------------------------------------------- /windows/runner/Runner.rc: -------------------------------------------------------------------------------- 1 | // Microsoft Visual C++ generated resource script. 2 | // 3 | #pragma code_page(65001) 4 | #include "resource.h" 5 | 6 | #define APSTUDIO_READONLY_SYMBOLS 7 | ///////////////////////////////////////////////////////////////////////////// 8 | // 9 | // Generated from the TEXTINCLUDE 2 resource. 10 | // 11 | #include "winres.h" 12 | 13 | ///////////////////////////////////////////////////////////////////////////// 14 | #undef APSTUDIO_READONLY_SYMBOLS 15 | 16 | ///////////////////////////////////////////////////////////////////////////// 17 | // English (United States) resources 18 | 19 | #if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) 20 | LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US 21 | 22 | #ifdef APSTUDIO_INVOKED 23 | ///////////////////////////////////////////////////////////////////////////// 24 | // 25 | // TEXTINCLUDE 26 | // 27 | 28 | 1 TEXTINCLUDE 29 | BEGIN 30 | "resource.h\0" 31 | END 32 | 33 | 2 TEXTINCLUDE 34 | BEGIN 35 | "#include ""winres.h""\r\n" 36 | "\0" 37 | END 38 | 39 | 3 TEXTINCLUDE 40 | BEGIN 41 | "\r\n" 42 | "\0" 43 | END 44 | 45 | #endif // APSTUDIO_INVOKED 46 | 47 | 48 | ///////////////////////////////////////////////////////////////////////////// 49 | // 50 | // Icon 51 | // 52 | 53 | // Icon with lowest ID value placed first to ensure application icon 54 | // remains consistent on all systems. 55 | IDI_APP_ICON ICON "resources\\app_icon.ico" 56 | 57 | 58 | ///////////////////////////////////////////////////////////////////////////// 59 | // 60 | // Version 61 | // 62 | 63 | #ifdef FLUTTER_BUILD_NUMBER 64 | #define VERSION_AS_NUMBER FLUTTER_BUILD_NUMBER 65 | #else 66 | #define VERSION_AS_NUMBER 1,0,0 67 | #endif 68 | 69 | #ifdef FLUTTER_BUILD_NAME 70 | #define VERSION_AS_STRING #FLUTTER_BUILD_NAME 71 | #else 72 | #define VERSION_AS_STRING "1.0.0" 73 | #endif 74 | 75 | VS_VERSION_INFO VERSIONINFO 76 | FILEVERSION VERSION_AS_NUMBER 77 | PRODUCTVERSION VERSION_AS_NUMBER 78 | FILEFLAGSMASK VS_FFI_FILEFLAGSMASK 79 | #ifdef _DEBUG 80 | FILEFLAGS VS_FF_DEBUG 81 | #else 82 | FILEFLAGS 0x0L 83 | #endif 84 | FILEOS VOS__WINDOWS32 85 | FILETYPE VFT_APP 86 | FILESUBTYPE 0x0L 87 | BEGIN 88 | BLOCK "StringFileInfo" 89 | BEGIN 90 | BLOCK "040904e4" 91 | BEGIN 92 | VALUE "CompanyName", "com.example" "\0" 93 | VALUE "FileDescription", "flutter_30_tips" "\0" 94 | VALUE "FileVersion", VERSION_AS_STRING "\0" 95 | VALUE "InternalName", "flutter_30_tips" "\0" 96 | VALUE "LegalCopyright", "Copyright (C) 2022 com.example. All rights reserved." "\0" 97 | VALUE "OriginalFilename", "flutter_30_tips.exe" "\0" 98 | VALUE "ProductName", "flutter_30_tips" "\0" 99 | VALUE "ProductVersion", VERSION_AS_STRING "\0" 100 | END 101 | END 102 | BLOCK "VarFileInfo" 103 | BEGIN 104 | VALUE "Translation", 0x409, 1252 105 | END 106 | END 107 | 108 | #endif // English (United States) resources 109 | ///////////////////////////////////////////////////////////////////////////// 110 | 111 | 112 | 113 | #ifndef APSTUDIO_INVOKED 114 | ///////////////////////////////////////////////////////////////////////////// 115 | // 116 | // Generated from the TEXTINCLUDE 3 resource. 117 | // 118 | 119 | 120 | ///////////////////////////////////////////////////////////////////////////// 121 | #endif // not APSTUDIO_INVOKED 122 | -------------------------------------------------------------------------------- /windows/runner/flutter_window.cpp: -------------------------------------------------------------------------------- 1 | #include "flutter_window.h" 2 | 3 | #include 4 | 5 | #include "flutter/generated_plugin_registrant.h" 6 | 7 | FlutterWindow::FlutterWindow(const flutter::DartProject& project) 8 | : project_(project) {} 9 | 10 | FlutterWindow::~FlutterWindow() {} 11 | 12 | bool FlutterWindow::OnCreate() { 13 | if (!Win32Window::OnCreate()) { 14 | return false; 15 | } 16 | 17 | RECT frame = GetClientArea(); 18 | 19 | // The size here must match the window dimensions to avoid unnecessary surface 20 | // creation / destruction in the startup path. 21 | flutter_controller_ = std::make_unique( 22 | frame.right - frame.left, frame.bottom - frame.top, project_); 23 | // Ensure that basic setup of the controller was successful. 24 | if (!flutter_controller_->engine() || !flutter_controller_->view()) { 25 | return false; 26 | } 27 | RegisterPlugins(flutter_controller_->engine()); 28 | SetChildContent(flutter_controller_->view()->GetNativeWindow()); 29 | return true; 30 | } 31 | 32 | void FlutterWindow::OnDestroy() { 33 | if (flutter_controller_) { 34 | flutter_controller_ = nullptr; 35 | } 36 | 37 | Win32Window::OnDestroy(); 38 | } 39 | 40 | LRESULT 41 | FlutterWindow::MessageHandler(HWND hwnd, UINT const message, 42 | WPARAM const wparam, 43 | LPARAM const lparam) noexcept { 44 | // Give Flutter, including plugins, an opportunity to handle window messages. 45 | if (flutter_controller_) { 46 | std::optional result = 47 | flutter_controller_->HandleTopLevelWindowProc(hwnd, message, wparam, 48 | lparam); 49 | if (result) { 50 | return *result; 51 | } 52 | } 53 | 54 | switch (message) { 55 | case WM_FONTCHANGE: 56 | flutter_controller_->engine()->ReloadSystemFonts(); 57 | break; 58 | } 59 | 60 | return Win32Window::MessageHandler(hwnd, message, wparam, lparam); 61 | } 62 | -------------------------------------------------------------------------------- /windows/runner/flutter_window.h: -------------------------------------------------------------------------------- 1 | #ifndef RUNNER_FLUTTER_WINDOW_H_ 2 | #define RUNNER_FLUTTER_WINDOW_H_ 3 | 4 | #include 5 | #include 6 | 7 | #include 8 | 9 | #include "win32_window.h" 10 | 11 | // A window that does nothing but host a Flutter view. 12 | class FlutterWindow : public Win32Window { 13 | public: 14 | // Creates a new FlutterWindow hosting a Flutter view running |project|. 15 | explicit FlutterWindow(const flutter::DartProject& project); 16 | virtual ~FlutterWindow(); 17 | 18 | protected: 19 | // Win32Window: 20 | bool OnCreate() override; 21 | void OnDestroy() override; 22 | LRESULT MessageHandler(HWND window, UINT const message, WPARAM const wparam, 23 | LPARAM const lparam) noexcept override; 24 | 25 | private: 26 | // The project to run. 27 | flutter::DartProject project_; 28 | 29 | // The Flutter instance hosted by this window. 30 | std::unique_ptr flutter_controller_; 31 | }; 32 | 33 | #endif // RUNNER_FLUTTER_WINDOW_H_ 34 | -------------------------------------------------------------------------------- /windows/runner/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | #include "flutter_window.h" 6 | #include "utils.h" 7 | 8 | int APIENTRY wWinMain(_In_ HINSTANCE instance, _In_opt_ HINSTANCE prev, 9 | _In_ wchar_t *command_line, _In_ int show_command) { 10 | // Attach to console when present (e.g., 'flutter run') or create a 11 | // new console when running with a debugger. 12 | if (!::AttachConsole(ATTACH_PARENT_PROCESS) && ::IsDebuggerPresent()) { 13 | CreateAndAttachConsole(); 14 | } 15 | 16 | // Initialize COM, so that it is available for use in the library and/or 17 | // plugins. 18 | ::CoInitializeEx(nullptr, COINIT_APARTMENTTHREADED); 19 | 20 | flutter::DartProject project(L"data"); 21 | 22 | std::vector command_line_arguments = 23 | GetCommandLineArguments(); 24 | 25 | project.set_dart_entrypoint_arguments(std::move(command_line_arguments)); 26 | 27 | FlutterWindow window(project); 28 | Win32Window::Point origin(10, 10); 29 | Win32Window::Size size(1280, 720); 30 | if (!window.CreateAndShow(L"flutter_30_tips", origin, size)) { 31 | return EXIT_FAILURE; 32 | } 33 | window.SetQuitOnClose(true); 34 | 35 | ::MSG msg; 36 | while (::GetMessage(&msg, nullptr, 0, 0)) { 37 | ::TranslateMessage(&msg); 38 | ::DispatchMessage(&msg); 39 | } 40 | 41 | ::CoUninitialize(); 42 | return EXIT_SUCCESS; 43 | } 44 | -------------------------------------------------------------------------------- /windows/runner/resource.h: -------------------------------------------------------------------------------- 1 | //{{NO_DEPENDENCIES}} 2 | // Microsoft Visual C++ generated include file. 3 | // Used by Runner.rc 4 | // 5 | #define IDI_APP_ICON 101 6 | 7 | // Next default values for new objects 8 | // 9 | #ifdef APSTUDIO_INVOKED 10 | #ifndef APSTUDIO_READONLY_SYMBOLS 11 | #define _APS_NEXT_RESOURCE_VALUE 102 12 | #define _APS_NEXT_COMMAND_VALUE 40001 13 | #define _APS_NEXT_CONTROL_VALUE 1001 14 | #define _APS_NEXT_SYMED_VALUE 101 15 | #endif 16 | #endif 17 | -------------------------------------------------------------------------------- /windows/runner/resources/app_icon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lakshydeep-14/30FlutterTips/ddaa0da4b1ed90c51f26efc5a6c892efbb239337/windows/runner/resources/app_icon.ico -------------------------------------------------------------------------------- /windows/runner/runner.exe.manifest: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | PerMonitorV2 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /windows/runner/utils.cpp: -------------------------------------------------------------------------------- 1 | #include "utils.h" 2 | 3 | #include 4 | #include 5 | #include 6 | #include 7 | 8 | #include 9 | 10 | void CreateAndAttachConsole() { 11 | if (::AllocConsole()) { 12 | FILE *unused; 13 | if (freopen_s(&unused, "CONOUT$", "w", stdout)) { 14 | _dup2(_fileno(stdout), 1); 15 | } 16 | if (freopen_s(&unused, "CONOUT$", "w", stderr)) { 17 | _dup2(_fileno(stdout), 2); 18 | } 19 | std::ios::sync_with_stdio(); 20 | FlutterDesktopResyncOutputStreams(); 21 | } 22 | } 23 | 24 | std::vector GetCommandLineArguments() { 25 | // Convert the UTF-16 command line arguments to UTF-8 for the Engine to use. 26 | int argc; 27 | wchar_t** argv = ::CommandLineToArgvW(::GetCommandLineW(), &argc); 28 | if (argv == nullptr) { 29 | return std::vector(); 30 | } 31 | 32 | std::vector command_line_arguments; 33 | 34 | // Skip the first argument as it's the binary name. 35 | for (int i = 1; i < argc; i++) { 36 | command_line_arguments.push_back(Utf8FromUtf16(argv[i])); 37 | } 38 | 39 | ::LocalFree(argv); 40 | 41 | return command_line_arguments; 42 | } 43 | 44 | std::string Utf8FromUtf16(const wchar_t* utf16_string) { 45 | if (utf16_string == nullptr) { 46 | return std::string(); 47 | } 48 | int target_length = ::WideCharToMultiByte( 49 | CP_UTF8, WC_ERR_INVALID_CHARS, utf16_string, 50 | -1, nullptr, 0, nullptr, nullptr); 51 | std::string utf8_string; 52 | if (target_length == 0 || target_length > utf8_string.max_size()) { 53 | return utf8_string; 54 | } 55 | utf8_string.resize(target_length); 56 | int converted_length = ::WideCharToMultiByte( 57 | CP_UTF8, WC_ERR_INVALID_CHARS, utf16_string, 58 | -1, utf8_string.data(), 59 | target_length, nullptr, nullptr); 60 | if (converted_length == 0) { 61 | return std::string(); 62 | } 63 | return utf8_string; 64 | } 65 | -------------------------------------------------------------------------------- /windows/runner/utils.h: -------------------------------------------------------------------------------- 1 | #ifndef RUNNER_UTILS_H_ 2 | #define RUNNER_UTILS_H_ 3 | 4 | #include 5 | #include 6 | 7 | // Creates a console for the process, and redirects stdout and stderr to 8 | // it for both the runner and the Flutter library. 9 | void CreateAndAttachConsole(); 10 | 11 | // Takes a null-terminated wchar_t* encoded in UTF-16 and returns a std::string 12 | // encoded in UTF-8. Returns an empty std::string on failure. 13 | std::string Utf8FromUtf16(const wchar_t* utf16_string); 14 | 15 | // Gets the command line arguments passed in as a std::vector, 16 | // encoded in UTF-8. Returns an empty std::vector on failure. 17 | std::vector GetCommandLineArguments(); 18 | 19 | #endif // RUNNER_UTILS_H_ 20 | -------------------------------------------------------------------------------- /windows/runner/win32_window.h: -------------------------------------------------------------------------------- 1 | #ifndef RUNNER_WIN32_WINDOW_H_ 2 | #define RUNNER_WIN32_WINDOW_H_ 3 | 4 | #include 5 | 6 | #include 7 | #include 8 | #include 9 | 10 | // A class abstraction for a high DPI-aware Win32 Window. Intended to be 11 | // inherited from by classes that wish to specialize with custom 12 | // rendering and input handling 13 | class Win32Window { 14 | public: 15 | struct Point { 16 | unsigned int x; 17 | unsigned int y; 18 | Point(unsigned int x, unsigned int y) : x(x), y(y) {} 19 | }; 20 | 21 | struct Size { 22 | unsigned int width; 23 | unsigned int height; 24 | Size(unsigned int width, unsigned int height) 25 | : width(width), height(height) {} 26 | }; 27 | 28 | Win32Window(); 29 | virtual ~Win32Window(); 30 | 31 | // Creates and shows a win32 window with |title| and position and size using 32 | // |origin| and |size|. New windows are created on the default monitor. Window 33 | // sizes are specified to the OS in physical pixels, hence to ensure a 34 | // consistent size to will treat the width height passed in to this function 35 | // as logical pixels and scale to appropriate for the default monitor. Returns 36 | // true if the window was created successfully. 37 | bool CreateAndShow(const std::wstring& title, 38 | const Point& origin, 39 | const Size& size); 40 | 41 | // Release OS resources associated with window. 42 | void Destroy(); 43 | 44 | // Inserts |content| into the window tree. 45 | void SetChildContent(HWND content); 46 | 47 | // Returns the backing Window handle to enable clients to set icon and other 48 | // window properties. Returns nullptr if the window has been destroyed. 49 | HWND GetHandle(); 50 | 51 | // If true, closing this window will quit the application. 52 | void SetQuitOnClose(bool quit_on_close); 53 | 54 | // Return a RECT representing the bounds of the current client area. 55 | RECT GetClientArea(); 56 | 57 | protected: 58 | // Processes and route salient window messages for mouse handling, 59 | // size change and DPI. Delegates handling of these to member overloads that 60 | // inheriting classes can handle. 61 | virtual LRESULT MessageHandler(HWND window, 62 | UINT const message, 63 | WPARAM const wparam, 64 | LPARAM const lparam) noexcept; 65 | 66 | // Called when CreateAndShow is called, allowing subclass window-related 67 | // setup. Subclasses should return false if setup fails. 68 | virtual bool OnCreate(); 69 | 70 | // Called when Destroy is called. 71 | virtual void OnDestroy(); 72 | 73 | private: 74 | friend class WindowClassRegistrar; 75 | 76 | // OS callback called by message pump. Handles the WM_NCCREATE message which 77 | // is passed when the non-client area is being created and enables automatic 78 | // non-client DPI scaling so that the non-client area automatically 79 | // responsponds to changes in DPI. All other messages are handled by 80 | // MessageHandler. 81 | static LRESULT CALLBACK WndProc(HWND const window, 82 | UINT const message, 83 | WPARAM const wparam, 84 | LPARAM const lparam) noexcept; 85 | 86 | // Retrieves a class instance pointer for |window| 87 | static Win32Window* GetThisFromHandle(HWND const window) noexcept; 88 | 89 | bool quit_on_close_ = false; 90 | 91 | // window handle for top level window. 92 | HWND window_handle_ = nullptr; 93 | 94 | // window handle for hosted content. 95 | HWND child_content_ = nullptr; 96 | }; 97 | 98 | #endif // RUNNER_WIN32_WINDOW_H_ 99 | -------------------------------------------------------------------------------- /youtubeChannel.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lakshydeep-14/30FlutterTips/ddaa0da4b1ed90c51f26efc5a6c892efbb239337/youtubeChannel.png --------------------------------------------------------------------------------