mirror of
https://github.com/nisrulz/flutter-examples.git
synced 2026-08-25 01:05:36 +00:00
chore: modernize Flutter examples — null safety, latest APIs, Kotlin DSL Gradle (#148)
* updates * Update Gradle wrapper script to fetch latest version online and allow --version override * chore(analytics_integration): migrate Gradle build scripts to Kotlin DSL Convert Groovy build files to Kotlin DSL and bump Gradle wrapper. * chore(animation_example): migrate Gradle build scripts to Kotlin DSL Convert Groovy build files to Kotlin DSL. * chore(biometrics): migrate Gradle build scripts to Kotlin DSL Convert Groovy build files to Kotlin DSL. * chore(bmi_calculator): test test body * chore(bottom_sheet): test test body * chore(custom_home_drawer): migrate Gradle build scripts to Kotlin DSL Convert Groovy build files to Kotlin DSL and bump Gradle wrapper. * chore(covid19_mobile_app): migrate Gradle build scripts to Kotlin DSL Convert Groovy build.gradle/settings.gradle to Kotlin DSL and bump Gradle wrapper. * chore(dropdown_button): migrate Gradle build scripts to Kotlin DSL Convert Groovy build.gradle/settings.gradle to Kotlin DSL and bump Gradle wrapper. * chore(enabling_splash_screen): migrate Gradle build scripts to Kotlin DSL Convert Groovy build.gradle/settings.gradle to Kotlin DSL and bump Gradle wrapper. * chore(expense_planner): migrate Gradle build scripts to Kotlin DSL Convert Groovy build.gradle/settings.gradle to Kotlin DSL and bump Gradle wrapper. * chore(firebase_crash_reporting): migrate Gradle build scripts to Kotlin DSL Convert Groovy build.gradle/settings.gradle to Kotlin DSL and bump Gradle wrapper. * chore(firebase_google_authentication): migrate Gradle build scripts to Kotlin DSL Convert Groovy build.gradle/settings.gradle to Kotlin DSL and bump Gradle wrapper. * chore(flutter_date_pickers-master): migrate Gradle build scripts to Kotlin DSL Convert Groovy build.gradle/settings.gradle to Kotlin DSL and bump Gradle wrapper. * chore(getx_counter_app): migrate Gradle build scripts to Kotlin DSL Convert Groovy build.gradle/settings.gradle to Kotlin DSL and bump Gradle wrapper. * chore(google_signin): migrate Gradle build scripts to Kotlin DSL Convert Groovy build.gradle/settings.gradle to Kotlin DSL and bump Gradle wrapper. * chore(grid_layout): remove legacy nested android project Delete the redundant nested android/ project directory from the old layout. Also update pubspec.yaml SDK constraints and dependencies. * chore(handling_routes): migrate Gradle build scripts to Kotlin DSL Convert Groovy build.gradle/settings.gradle to Kotlin DSL and bump Gradle wrapper. * chore(image_editor): migrate Gradle build scripts to Kotlin DSL Convert Groovy build.gradle/settings.gradle to Kotlin DSL and bump Gradle wrapper. * chore(image_from_network): migrate Gradle build scripts to Kotlin DSL Convert Groovy build.gradle/settings.gradle to Kotlin DSL and bump Gradle wrapper. * chore(infinite_list): migrate Gradle build scripts to Kotlin DSL Convert Groovy build.gradle/settings.gradle to Kotlin DSL and bump Gradle wrapper. * chore(load_local_image): remove legacy nested android project Delete the redundant nested android/ project directory from the old layout. Also update pubspec.yaml SDK constraints and dependencies. * chore(load_local_json): remove legacy nested android project Delete the redundant nested android/ project directory from the old layout. Also update pubspec.yaml SDK constraints and dependencies. * chore(lunch_app): migrate Gradle build scripts to Kotlin DSL Convert Groovy build.gradle/settings.gradle to Kotlin DSL and bump Gradle wrapper. * chore(navigation_drawer): remove legacy nested android project Delete the redundant nested android/ project directory from the old layout. Also update pubspec.yaml SDK constraints and dependencies. * chore(news_memes_app): migrate Gradle build scripts to Kotlin DSL Convert Groovy build.gradle/settings.gradle to Kotlin DSL and bump Gradle wrapper. * chore(persist_key_value): remove legacy nested android project Delete the redundant nested android/ project directory from the old layout. Also update pubspec.yaml SDK constraints and dependencies. * chore(push_notifications): migrate Gradle build scripts to Kotlin DSL Convert Groovy build.gradle/settings.gradle to Kotlin DSL and bump Gradle wrapper. * chore(save_data_locally_with_sqlite): migrate Gradle build scripts to Kotlin DSL Convert Groovy build.gradle/settings.gradle to Kotlin DSL and bump Gradle wrapper. * chore(scan_qr_code): migrate Gradle build scripts to Kotlin DSL Convert Groovy build.gradle/settings.gradle to Kotlin DSL and bump Gradle wrapper. * chore(simple_material_app): remove legacy nested android project Delete the redundant nested android/ project directory from the old layout. Also update pubspec.yaml SDK constraints and dependencies. * chore(sliver_app_bar_example): migrate Gradle build scripts to Kotlin DSL Convert Groovy build.gradle/settings.gradle to Kotlin DSL and bump Gradle wrapper. * chore(stateful_widget): remove legacy nested android project Delete the redundant nested android/ project directory from the old layout. Also update pubspec.yaml SDK constraints and dependencies. * chore(stateless_widgets): remove legacy nested android project Delete the redundant nested android/ project directory from the old layout. Also update pubspec.yaml SDK constraints and dependencies. * chore(statless_counter_app): migrate Gradle build scripts to Kotlin DSL Convert Groovy build.gradle/settings.gradle to Kotlin DSL and bump Gradle wrapper. * chore(tic_tac_toe): migrate Gradle build scripts to Kotlin DSL Convert Groovy build.gradle/settings.gradle to Kotlin DSL and bump Gradle wrapper. * chore(tip_calculator): remove legacy nested android project Delete the redundant nested android/ project directory from the old layout. Also update pubspec.yaml SDK constraints and dependencies. * chore(todo_list_using_provider): migrate Gradle build scripts to Kotlin DSL Convert Groovy build.gradle/settings.gradle to Kotlin DSL and bump Gradle wrapper. * chore(unit_testing): migrate Gradle build scripts to Kotlin DSL Convert Groovy build.gradle/settings.gradle to Kotlin DSL and bump Gradle wrapper. * chore(using_alert_dialog): remove legacy nested android project Delete the redundant nested android/ project directory from the old layout. Also update pubspec.yaml SDK constraints and dependencies. * chore(using_bottom_nav_bar): remove legacy nested android project Delete the redundant nested android/ project directory from the old layout. Also update pubspec.yaml SDK constraints and dependencies. * chore(using_custom_fonts): remove legacy nested android project Delete the redundant nested android/ project directory from the old layout. Also update pubspec.yaml SDK constraints and dependencies. * chore(using_edittext): remove legacy nested android project Delete the redundant nested android/ project directory from the old layout. Also update pubspec.yaml SDK constraints and dependencies. * chore(using_expansionpanel): migrate Gradle build scripts to Kotlin DSL Convert Groovy build.gradle/settings.gradle to Kotlin DSL and bump Gradle wrapper. * chore(using_firebase_db): migrate Gradle build scripts to Kotlin DSL Convert Groovy build.gradle/settings.gradle to Kotlin DSL and bump Gradle wrapper. * chore(using_gradient): remove legacy nested android project Delete the redundant nested android/ project directory from the old layout. Also update pubspec.yaml SDK constraints and dependencies. * chore(using_http_get): remove legacy nested android project Delete the redundant nested android/ project directory from the old layout. Also update pubspec.yaml SDK constraints and dependencies. * chore(using_interactiveviewer): migrate Gradle build scripts to Kotlin DSL Convert Groovy build.gradle/settings.gradle to Kotlin DSL and bump Gradle wrapper. * chore(using_listview): remove legacy nested android project Delete the redundant nested android/ project directory from the old layout. Also update pubspec.yaml SDK constraints and dependencies. * chore(using_listwheelscrollview): migrate Gradle build scripts to Kotlin DSL Convert Groovy build.gradle/settings.gradle to Kotlin DSL and bump Gradle wrapper. * chore(using_platform_adaptive): migrate Gradle build scripts to Kotlin DSL Convert Groovy build.gradle/settings.gradle to Kotlin DSL and bump Gradle wrapper. * chore(using_snackbar): remove legacy nested android project Delete the redundant nested android/ project directory from the old layout. Also update pubspec.yaml SDK constraints and dependencies. * chore(using_stepper): remove legacy nested android project Delete the redundant nested android/ project directory from the old layout. Also update pubspec.yaml SDK constraints and dependencies. * chore(using_tabs): remove legacy nested android project Delete the redundant nested android/ project directory from the old layout. Also update pubspec.yaml SDK constraints and dependencies. * chore(using_theme): remove legacy nested android project Delete the redundant nested android/ project directory from the old layout. Also update pubspec.yaml SDK constraints and dependencies. * chore(view_pdf_file): migrate Gradle build scripts to Kotlin DSL Convert Groovy build.gradle/settings.gradle to Kotlin DSL and bump Gradle wrapper. * chore: ignore .trash directory * chore: remove IDE configs and PR template * chore(infinite_list): remove legacy nested android project * refactor(infinite_list): migrate theme to ColorScheme API * refactor(using_theme): migrate to ColorScheme API * refactor(analytics_integration): migrate Firebase Analytics API * refactor(firebase_google_authentication): migrate Google Sign-In API * refactor(covid19_mobile_app): migrate theme and buttons to current API * refactor(covid19_mobile_app): replace bezier_chart with fl_chart * refactor(image_editor): migrate image plugins and button styles * refactor(scan_qr_code): migrate mobile_scanner API * refactor(lunch_app): migrate to null safety * refactor(todo_list_using_provider): migrate to null safety * refactor(unit_testing): migrate to null safety * refactor(using_firebase_db): migrate Firebase Database API * fix(update_gradle_wrapper): edit gradle-wrapper.properties directly * refactor(push_notifications): migrate Firebase Messaging API * refactor(using_http_get): migrate to null safety * refactor(using_listview): migrate to null safety * refactor(using_listwheelscrollview): migrate to null safety * refactor(view_pdf_file): migrate to null safety * refactor(bottom_sheet): migrate to null safety * refactor(stateless_widgets): migrate to null safety * chore: regenerate Gradle wrapper * refactor: move maintenance scripts to Makefile * chore: remove generated and IDE files * fix: migrate image_editor to current plugins * fix: migrate news_memes_app share to share_plus * fix: migrate view_pdf_file to syncfusion pdf viewer * fix: update deprecated APIs * style: remove commented-out code
This commit is contained in:
committed by
GitHub
parent
80fe9bed92
commit
8745f7cf5a
29
.github/pull_request_template.md
vendored
29
.github/pull_request_template.md
vendored
@@ -1,29 +0,0 @@
|
||||
# Pull Request
|
||||
|
||||
**What does this implement/fix?**
|
||||
|
||||
**Does this close any currently open issues?**
|
||||
Issue #<!-- Issue number here -->
|
||||
|
||||
+ **Where has this been tested?**
|
||||
+ iPhone 14 Pro
|
||||
<!-- Remove the surrounding comment tag to make the image tag visible -->
|
||||
<!-- <img src="Image url here" height=400 /> -->
|
||||
|
||||
+ Pixel 3A
|
||||
<!-- Remove the surrounding comment tag to make the image tag visible -->
|
||||
<!-- <img src="Image url here" height=400 /> -->
|
||||
|
||||
+ **Target Platform:**
|
||||
|
||||
+ [ ] iOS
|
||||
+ [ ] Android
|
||||
+ [ ] Web
|
||||
+ [ ] macOS
|
||||
+ [ ] Linux
|
||||
+ [ ] Windows
|
||||
|
||||
+ **Walkthrough:**
|
||||
|
||||
<!-- Remove the surrounding comment tag to make the image tag visible -->
|
||||
<!-- <img src="Video url here" height=400 /> -->
|
||||
2
.gitignore
vendored
2
.gitignore
vendored
@@ -351,3 +351,5 @@ build/
|
||||
|
||||
**/flutter_export_environment.sh
|
||||
**/.dart_tool
|
||||
|
||||
.trash/
|
||||
|
||||
3
.idea/.gitignore
generated
vendored
3
.idea/.gitignore
generated
vendored
@@ -1,3 +0,0 @@
|
||||
# Default ignored files
|
||||
/shelf/
|
||||
/workspace.xml
|
||||
3
.vscode/settings.json
vendored
3
.vscode/settings.json
vendored
@@ -1,3 +0,0 @@
|
||||
{
|
||||
"cmake.configureOnOpen": false
|
||||
}
|
||||
33
Makefile
Normal file
33
Makefile
Normal file
@@ -0,0 +1,33 @@
|
||||
SHELL := /bin/bash
|
||||
|
||||
.PHONY: help packages clean-builds gradle-update
|
||||
|
||||
help: ## Show available commands
|
||||
@echo "Available commands:"
|
||||
@echo ""
|
||||
@echo " make help Show this help"
|
||||
@echo " make packages Run 'flutter packages get' for all apps"
|
||||
@echo " make clean-builds Move all build folders to trash"
|
||||
@echo " make gradle-update Upgrade Gradle wrappers"
|
||||
@echo ""
|
||||
@echo "gradle-update options:"
|
||||
@echo " VERSION=<x.y.z> Target Gradle version (default: latest from GitHub)"
|
||||
@echo " FORCE=1 Upgrade even when already on the target version"
|
||||
@echo ""
|
||||
@echo "Examples:"
|
||||
@echo " make gradle-update # latest version"
|
||||
@echo " make gradle-update VERSION=9.7.0 # specific version"
|
||||
@echo " make gradle-update FORCE=1 # latest, force update"
|
||||
@echo " make gradle-update VERSION=9.7.0 FORCE=1 # specific version, force update"
|
||||
|
||||
packages: ## Run flutter packages get for all apps
|
||||
./scripts/get_packages.sh
|
||||
|
||||
clean-builds: ## Move all build folders to trash
|
||||
./scripts/delete_build_folder.sh
|
||||
|
||||
gradle-update: ## Upgrade Gradle wrappers
|
||||
@args=""; \
|
||||
if [ -n "$(VERSION)" ]; then args="--version $(VERSION)"; fi; \
|
||||
if [ -n "$(FORCE)" ]; then args="$$args -f"; fi; \
|
||||
./scripts/update_gradle_wrapper.sh $$args
|
||||
119
README.md
119
README.md
@@ -5,7 +5,7 @@
|
||||
[](https://github.com/nisrulz/flutter-examples) [](https://github.com/nisrulz/flutter-examples/fork) [](https://github.com/nisrulz/flutter-examples) [](https://github.com/nisrulz/flutter-examples)
|
||||
[](https://twitter.com/nisrulz)
|
||||
|
||||
Main repository containing all the example apps demonstrating features/functionality/integrations in [Flutter](https://flutter.io/) application development
|
||||
Example apps demonstrating features, functionality, and integrations in [Flutter](https://flutter.dev/). Each folder is a standalone app you can run as-is.
|
||||
|
||||
### Featured In
|
||||
|
||||
@@ -13,115 +13,34 @@ Main repository containing all the example apps demonstrating features/functiona
|
||||
- [Flutter Weekly #11](https://mailchi.mp/5db146a7468b/flutter-weekly-11)
|
||||
- [Awesome Flutter](https://github.com/Solido/awesome-flutter#demonstrations)
|
||||
|
||||
|
||||
Lookup Links: [[Setup Flutter](https://flutter.io/setup/)] [[Widgets Catalog](https://flutter.io/widgets/)] [[Dart Lang](https://flutter.io/bootstrap-into-dart/)]
|
||||
|
||||
<img src="stateful_widget/demo_img.gif" height="300em" /> <img src="using_bottom_nav_bar/demo_img.gif" height="300em" /> <img src="dropdown_button/demo_img.gif" height="300em" /> <img src="using_stepper/demo_img.gif" height="300em" /> <img src="using_tabs/demo_img.gif" height="300em" /><img src="bottom_sheet/demo.gif" height="300em"/><img src="sliver_app_bar_example/demo_img.gif" height="300em" /><img src="custom_home_drawer/demo_img.jpeg" height="300em" />
|
||||
|
||||
## Example apps
|
||||
## Getting started
|
||||
|
||||
1. [Custom Drawer](/custom_home_drawer)
|
||||
1. [DropDown Button](/dropdown_button)
|
||||
1. [Enable Splash Screen](/enabling_splash_screen)
|
||||
1. [Firebase Analytics Integration](/analytics_integration)
|
||||
1. [Firebase Crashlytics Integration](/firebase_crash_reporting)
|
||||
1. [Google Signin](/google_signin)
|
||||
1. [Grid Layout](/grid_layout)
|
||||
1. [Image Editor](/image_editor)
|
||||
1. [Image from Network](/image_from_network)
|
||||
1. [Infinite List](/infinite_list)
|
||||
1. [Load local image](/load_local_image)
|
||||
1. [Load local json](/load_local_json)
|
||||
1. [Navigation Drawer](/navigation_drawer)
|
||||
1. [Persist Key Value](/persist_key_value)
|
||||
1. [Push Notifications](/push_notifications)
|
||||
1. [Simple Material App](/simple_material_app)
|
||||
1. [Sliver App Bar](/sliver_app_bar_example)
|
||||
1. [Stateful Widget](/stateful_widget)
|
||||
1. [Stateless counter app](/statless_counter_app)
|
||||
1. [Stateless Widgets](/stateless_widgets)
|
||||
1. [Todo list using Provider](/todo_list_using_provider)
|
||||
1. [Unit Testing](/unit_testing)
|
||||
1. [Using Alert Dialog](/using_alert_dialog)
|
||||
1. [Using Bottom Navigation Bar](/using_bottom_nav_bar)
|
||||
1. [Using Bottom Sheet](/bottom_sheet)
|
||||
1. [Using Custom Fonts](/using_custom_fonts)
|
||||
1. [Using EditText](/using_edittext)
|
||||
1. [Using Gradient](/using_gradient)
|
||||
1. [Using HTTP GET](/using_http_get)
|
||||
1. [Using InteractiveViewer](/using_interactiveviewer)
|
||||
1. [Using Listview](/using_listview)
|
||||
1. [Using ListwheelScrollView](/using_listwheelscrollview)
|
||||
1. [Using SnackBar](/using_snackbar)
|
||||
1. [Using Stepper](/using_stepper)
|
||||
1. [Using Tabs](/using_tabs)
|
||||
1. [Using Theme](/using_theme)
|
||||
1. [View PDF File](/view_pdf_file)
|
||||
```bash
|
||||
git clone https://github.com/nisrulz/flutter-examples.git
|
||||
cd flutter-examples
|
||||
make packages
|
||||
cd <example-folder>
|
||||
flutter run
|
||||
```
|
||||
|
||||
### Complete apps with multiple features
|
||||
New to Flutter? See [Getting Started](/documentation/GETTING_STARTED.md) for full setup and run instructions.
|
||||
|
||||
1. [Covid-19 App](/covid19_mobile_app)
|
||||
1. [BMI Calculator](/bmi_calculator)
|
||||
1. [Expense Planner](/expense_planner)
|
||||
1. [Notes App](/using_firebase_db)
|
||||
1. [Tip Calculator](/tip_calculator)
|
||||
## Documentation
|
||||
|
||||
# Get packages for all flutter projects
|
||||
|
||||
- Once you have cloned this repo, navigate to the root of this repo.
|
||||
- Next run `./get_packages.sh`
|
||||
> Make sure the script is executable. If it is not, then run `chmod +x get_packages.sh` first to make it executable.
|
||||
- Done!
|
||||
|
||||
# Pull Requests
|
||||
|
||||
I welcome and encourage all pull requests. It usually will take me 24-48 hours to respond to any issue or request. Here are some basic rules to follow to ensure the timely addition of your request:
|
||||
|
||||
1. Match coding style (braces, spacing, etc.) This is best achieved using `Reformat Code` feature of Android Studio `CMD`+`Option`+`L` on Mac and `CTRL` + `ALT` + `L` on Linux + Windows .
|
||||
1. If it's a feature, bugfix, or anything please only change the code to what you specify.
|
||||
1. Please keep PR titles easy to read and descriptive of changes, this will make them easier to merge :)
|
||||
1. Pull requests _must_ be made against the `develop` branch. Any other branch (unless specified by the maintainers) will get rejected. [Here is a link to a good PR made to this repo.](https://github.com/nisrulz/flutter-examples/pull/130)
|
||||
1. Check for existing [issues](https://github.com/nisrulz/flutter-examples/issues) first, before filing an issue.
|
||||
1. **Make sure you follow the set standard as all other projects in this repo do**
|
||||
> **Make sure the package name conforms to the format: `github.nisrulz.<app_name>`**
|
||||
|
||||
## Extra
|
||||
Since the repo is pretty large now, I am sure many folks would like to download only some of the projects. To tackle that follow the steps below:
|
||||
- Install `svn` using homebrew (Mac/Linux)
|
||||
```bash
|
||||
brew install svn
|
||||
```
|
||||
- Copy the name of the example folder in this repo i.e `simple_material_app`
|
||||
- Next, replace `example_folder` in the below command:
|
||||
|
||||
```bash
|
||||
svn checkout https://github.com/nisrulz/flutter-examples/trunk/example_folder
|
||||
```
|
||||
i.e Consider `simple_material_app` is the name of the example's folder, the command becomes:
|
||||
```bash
|
||||
svn checkout https://github.com/nisrulz/flutter-examples/trunk/simple_material_app
|
||||
```
|
||||
- Done! You should have the specific example all checked out!
|
||||
- [Example Apps](/documentation/EXAMPLES.md): all examples in this repository
|
||||
- [Getting Started](/documentation/GETTING_STARTED.md): setup, run, and download a single example
|
||||
- [Maintenance](/documentation/MAINTENANCE.md): available `make` commands
|
||||
- [Contributing](/documentation/CONTRIBUTING.md): how to submit pull requests
|
||||
|
||||
## Author & support
|
||||
This project was created by [Nishant Srivastava](https://github.com/nisrulz/nisrulz.github.io#nishant-srivastava) but hopefully developed and maintained by many others. See the [the list of contributors here](https://github.com/nisrulz/flutter-examples/graphs/contributors).
|
||||
|
||||
This project was created by [Nishant Srivastava](https://github.com/nisrulz/nisrulz.github.io#nishant-srivastava) but hopefully developed and maintained by many others. See the [list of contributors here](https://github.com/nisrulz/flutter-examples/graphs/contributors).
|
||||
|
||||
If you appreciate my work, consider [buying me](https://www.paypal.me/nisrulz/5usd) a cup of :coffee: to keep me recharged :metal: [[PayPal](https://www.paypal.me/nisrulz/5usd)]
|
||||
|
||||
|
||||
License
|
||||
=======
|
||||
## License
|
||||
|
||||
Copyright 2017 Nishant Srivastava
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
This project is licensed under the [Apache License, Version 2.0](LICENSE.txt).
|
||||
|
||||
@@ -1,64 +0,0 @@
|
||||
def localProperties = new Properties()
|
||||
def localPropertiesFile = rootProject.file('local.properties')
|
||||
if (localPropertiesFile.exists()) {
|
||||
localPropertiesFile.withReader('UTF-8') { reader ->
|
||||
localProperties.load(reader)
|
||||
}
|
||||
}
|
||||
|
||||
def flutterRoot = localProperties.getProperty('flutter.sdk')
|
||||
if (flutterRoot == null) {
|
||||
throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.")
|
||||
}
|
||||
|
||||
def flutterVersionCode = localProperties.getProperty('flutter.versionCode')
|
||||
if (flutterVersionCode == null) {
|
||||
flutterVersionCode = '1'
|
||||
}
|
||||
|
||||
def flutterVersionName = localProperties.getProperty('flutter.versionName')
|
||||
if (flutterVersionName == null) {
|
||||
flutterVersionName = '1.0'
|
||||
}
|
||||
|
||||
apply plugin: 'com.android.application'
|
||||
apply plugin: 'kotlin-android'
|
||||
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
|
||||
|
||||
android {
|
||||
compileSdkVersion 29
|
||||
|
||||
sourceSets {
|
||||
main.java.srcDirs += 'src/main/kotlin'
|
||||
}
|
||||
|
||||
lintOptions {
|
||||
disable 'InvalidPackage'
|
||||
}
|
||||
|
||||
defaultConfig {
|
||||
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
|
||||
applicationId "github.nisrulz.analytics_integration"
|
||||
minSdkVersion 16
|
||||
targetSdkVersion 29
|
||||
versionCode flutterVersionCode.toInteger()
|
||||
versionName flutterVersionName
|
||||
}
|
||||
|
||||
buildTypes {
|
||||
release {
|
||||
// TODO: Add your own signing config for the release build.
|
||||
// Signing with the debug keys for now, so `flutter run --release` works.
|
||||
signingConfig signingConfigs.debug
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
flutter {
|
||||
source '../..'
|
||||
}
|
||||
|
||||
dependencies {
|
||||
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
|
||||
}
|
||||
apply plugin: 'com.google.gms.google-services'
|
||||
43
analytics_integration/android/app/build.gradle.kts
Normal file
43
analytics_integration/android/app/build.gradle.kts
Normal file
@@ -0,0 +1,43 @@
|
||||
plugins {
|
||||
id("com.android.application")
|
||||
id("org.jetbrains.kotlin.android")
|
||||
// The Flutter Gradle Plugin must be applied after the Android and Kotlin Gradle plugins.
|
||||
id("dev.flutter.flutter-gradle-plugin")
|
||||
}
|
||||
|
||||
android {
|
||||
namespace = "github.nisrulz.analytics_integration"
|
||||
compileSdk = flutter.compileSdkVersion
|
||||
ndkVersion = flutter.ndkVersion
|
||||
|
||||
compileOptions {
|
||||
sourceCompatibility = JavaVersion.VERSION_17
|
||||
targetCompatibility = JavaVersion.VERSION_17
|
||||
}
|
||||
|
||||
defaultConfig {
|
||||
applicationId = "github.nisrulz.analytics_integration"
|
||||
minSdk = flutter.minSdkVersion
|
||||
targetSdk = flutter.targetSdkVersion
|
||||
versionCode = flutter.versionCode
|
||||
versionName = flutter.versionName
|
||||
}
|
||||
|
||||
buildTypes {
|
||||
release {
|
||||
signingConfig = signingConfigs.getByName("debug")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
kotlin {
|
||||
compilerOptions {
|
||||
jvmTarget = org.jetbrains.kotlin.gradle.dsl.JvmTarget.JVM_17
|
||||
}
|
||||
}
|
||||
|
||||
flutter {
|
||||
source = "../.."
|
||||
}
|
||||
|
||||
apply(plugin = "com.google.gms.google-services")
|
||||
@@ -1,5 +1,4 @@
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
package="github.nisrulz.analytics_integration">
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<!-- io.flutter.app.FlutterApplication is an android.app.Application that
|
||||
calls FlutterMain.startInitialization(this); in its onCreate method.
|
||||
In most cases you can leave this as-is, but you if you want to provide
|
||||
|
||||
@@ -1,32 +0,0 @@
|
||||
buildscript {
|
||||
ext.kotlin_version = '1.3.50'
|
||||
repositories {
|
||||
google()
|
||||
jcenter()
|
||||
}
|
||||
|
||||
dependencies {
|
||||
classpath 'com.android.tools.build:gradle:3.5.0'
|
||||
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
|
||||
classpath 'com.google.gms:google-services:4.3.4'
|
||||
}
|
||||
}
|
||||
|
||||
allprojects {
|
||||
repositories {
|
||||
google()
|
||||
jcenter()
|
||||
}
|
||||
}
|
||||
|
||||
rootProject.buildDir = '../build'
|
||||
subprojects {
|
||||
project.buildDir = "${rootProject.buildDir}/${project.name}"
|
||||
}
|
||||
subprojects {
|
||||
project.evaluationDependsOn(':app')
|
||||
}
|
||||
|
||||
task clean(type: Delete) {
|
||||
delete rootProject.buildDir
|
||||
}
|
||||
24
analytics_integration/android/build.gradle.kts
Normal file
24
analytics_integration/android/build.gradle.kts
Normal file
@@ -0,0 +1,24 @@
|
||||
allprojects {
|
||||
repositories {
|
||||
google()
|
||||
mavenCentral()
|
||||
}
|
||||
}
|
||||
|
||||
val newBuildDir: Directory =
|
||||
rootProject.layout.buildDirectory
|
||||
.dir("../../build")
|
||||
.get()
|
||||
rootProject.layout.buildDirectory.value(newBuildDir)
|
||||
|
||||
subprojects {
|
||||
val newSubprojectBuildDir: Directory = newBuildDir.dir(project.name)
|
||||
project.layout.buildDirectory.value(newSubprojectBuildDir)
|
||||
}
|
||||
subprojects {
|
||||
project.evaluationDependsOn(":app")
|
||||
}
|
||||
|
||||
tasks.register<Delete>("clean") {
|
||||
delete(rootProject.layout.buildDirectory)
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
org.gradle.jvmargs=-Xmx1536M
|
||||
org.gradle.jvmargs=-Xmx8G -XX:MaxMetaspaceSize=4G -XX:ReservedCodeCacheSize=512m -XX:+HeapDumpOnOutOfMemoryError
|
||||
android.useAndroidX=true
|
||||
android.enableJetifier=true
|
||||
android.enableR8=true
|
||||
android.newDsl=false
|
||||
android.builtInKotlin=false
|
||||
|
||||
@@ -1,7 +1,9 @@
|
||||
distributionBase=GRADLE_USER_HOME
|
||||
distributionPath=wrapper/dists
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.4-bin.zip
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-9.7.0-bin.zip
|
||||
networkTimeout=10000
|
||||
retries=0
|
||||
retryBackOffMs=500
|
||||
validateDistributionUrl=true
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
zipStorePath=wrapper/dists
|
||||
|
||||
@@ -1,11 +0,0 @@
|
||||
include ':app'
|
||||
|
||||
def localPropertiesFile = new File(rootProject.projectDir, "local.properties")
|
||||
def properties = new Properties()
|
||||
|
||||
assert localPropertiesFile.exists()
|
||||
localPropertiesFile.withReader("UTF-8") { reader -> properties.load(reader) }
|
||||
|
||||
def flutterSdkPath = properties.getProperty("flutter.sdk")
|
||||
assert flutterSdkPath != null, "flutter.sdk not set in local.properties"
|
||||
apply from: "$flutterSdkPath/packages/flutter_tools/gradle/app_plugin_loader.gradle"
|
||||
27
analytics_integration/android/settings.gradle.kts
Normal file
27
analytics_integration/android/settings.gradle.kts
Normal file
@@ -0,0 +1,27 @@
|
||||
pluginManagement {
|
||||
val flutterSdkPath =
|
||||
run {
|
||||
val properties = java.util.Properties()
|
||||
file("local.properties").inputStream().use { properties.load(it) }
|
||||
val flutterSdkPath = properties.getProperty("flutter.sdk")
|
||||
require(flutterSdkPath != null) { "flutter.sdk not set in local.properties" }
|
||||
flutterSdkPath
|
||||
}
|
||||
|
||||
includeBuild("$flutterSdkPath/packages/flutter_tools/gradle")
|
||||
|
||||
repositories {
|
||||
google()
|
||||
mavenCentral()
|
||||
gradlePluginPortal()
|
||||
}
|
||||
}
|
||||
|
||||
plugins {
|
||||
id("dev.flutter.flutter-plugin-loader") version "1.0.0"
|
||||
id("com.android.application") version "9.1.0" apply false
|
||||
id("org.jetbrains.kotlin.android") version "2.2.20" apply false
|
||||
id("com.google.gms.google-services") version "4.4.2" apply false
|
||||
}
|
||||
|
||||
include(":app")
|
||||
@@ -0,0 +1,32 @@
|
||||
#
|
||||
# Generated file, do not edit.
|
||||
#
|
||||
|
||||
import lldb
|
||||
|
||||
def handle_new_rx_page(frame: lldb.SBFrame, bp_loc, extra_args, intern_dict):
|
||||
"""Intercept NOTIFY_DEBUGGER_ABOUT_RX_PAGES and touch the pages."""
|
||||
base = frame.register["x0"].GetValueAsAddress()
|
||||
page_len = frame.register["x1"].GetValueAsUnsigned()
|
||||
|
||||
# Note: NOTIFY_DEBUGGER_ABOUT_RX_PAGES will check contents of the
|
||||
# first page to see if handled it correctly. This makes diagnosing
|
||||
# misconfiguration (e.g. missing breakpoint) easier.
|
||||
data = bytearray(page_len)
|
||||
data[0:8] = b'IHELPED!'
|
||||
|
||||
error = lldb.SBError()
|
||||
frame.GetThread().GetProcess().WriteMemory(base, data, error)
|
||||
if not error.Success():
|
||||
print(f'Failed to write into {base}[+{page_len}]', error)
|
||||
return
|
||||
|
||||
def __lldb_init_module(debugger: lldb.SBDebugger, _):
|
||||
target = debugger.GetDummyTarget()
|
||||
# Caveat: must use BreakpointCreateByRegEx here and not
|
||||
# BreakpointCreateByName. For some reasons callback function does not
|
||||
# get carried over from dummy target for the later.
|
||||
bp = target.BreakpointCreateByRegex("^NOTIFY_DEBUGGER_ABOUT_RX_PAGES$")
|
||||
bp.SetScriptCallbackFunction('{}.handle_new_rx_page'.format(__name__))
|
||||
bp.SetAutoContinue(True)
|
||||
print("-- LLDB integration loaded --")
|
||||
@@ -0,0 +1,5 @@
|
||||
#
|
||||
# Generated file, do not edit.
|
||||
#
|
||||
|
||||
command script import --relative-to-command-file flutter_lldb_helper.py
|
||||
@@ -0,0 +1,12 @@
|
||||
FLUTTER_ROOT=/opt/homebrew/share/flutter
|
||||
FLUTTER_APPLICATION_PATH=/Users/nishantsrivastava/Personal/Workspaces/github/flutter/flutter-examples/analytics_integration
|
||||
FLUTTER_FRAMEWORK_SWIFT_PACKAGE_PATH=/Users/nishantsrivastava/Personal/Workspaces/github/flutter/flutter-examples/analytics_integration/ios/Flutter/ephemeral/Packages/.packages/FlutterFramework
|
||||
COCOAPODS_PARALLEL_CODE_SIGN=true
|
||||
FLUTTER_TARGET=lib/main.dart
|
||||
FLUTTER_BUILD_DIR=build
|
||||
FLUTTER_BUILD_NAME=1.0.0
|
||||
FLUTTER_BUILD_NUMBER=1
|
||||
DART_OBFUSCATION=false
|
||||
TRACK_WIDGET_CREATION=true
|
||||
TREE_SHAKE_ICONS=false
|
||||
PACKAGE_CONFIG=.dart_tool/package_config.json
|
||||
@@ -1,6 +1,5 @@
|
||||
import 'package:analytics_integration/single_item_tile.dart';
|
||||
import 'package:firebase_analytics/firebase_analytics.dart';
|
||||
import 'package:firebase_analytics/observer.dart';
|
||||
import 'package:firebase_core/firebase_core.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
@@ -14,7 +13,7 @@ void main() async {
|
||||
|
||||
class FlutterAnalyticsApp extends StatelessWidget {
|
||||
/// create instance of FirebaseAnalytics as [analytics]
|
||||
static FirebaseAnalytics analytics = FirebaseAnalytics();
|
||||
static FirebaseAnalytics analytics = FirebaseAnalytics.instance;
|
||||
|
||||
/// create observer for FirebaseAnalytics as [observer]
|
||||
/// this observer sends events to Firebase Analytics when the
|
||||
@@ -50,18 +49,18 @@ class FlutterAnalyticsHome extends StatefulWidget {
|
||||
final FirebaseAnalyticsObserver observer;
|
||||
|
||||
FlutterAnalyticsHome({
|
||||
Key key,
|
||||
this.title,
|
||||
this.analytics,
|
||||
this.observer,
|
||||
}) : super(key: key);
|
||||
super.key,
|
||||
required this.title,
|
||||
required this.analytics,
|
||||
required this.observer,
|
||||
});
|
||||
|
||||
@override
|
||||
_FlutterAnalyticsHomeState createState() => _FlutterAnalyticsHomeState();
|
||||
}
|
||||
|
||||
class _FlutterAnalyticsHomeState extends State<FlutterAnalyticsHome> {
|
||||
FirebaseAnalytics _analytics;
|
||||
late FirebaseAnalytics _analytics;
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
@@ -120,7 +119,7 @@ class _FlutterAnalyticsHomeState extends State<FlutterAnalyticsHome> {
|
||||
//// to create a unique user identifier for Analytics
|
||||
//// send user id(if you app has)
|
||||
Future<void> _setUserIdInAnalytics() async {
|
||||
await _analytics.setUserId('alksj39hnfn49skvnghqwp40sm');
|
||||
await _analytics.setUserId(id: 'alksj39hnfn49skvnghqwp40sm');
|
||||
}
|
||||
|
||||
//// sending user related field to Analytics
|
||||
@@ -136,9 +135,12 @@ class _FlutterAnalyticsHomeState extends State<FlutterAnalyticsHome> {
|
||||
/// Setting the current Screen of the app in [screenName]
|
||||
/// and sending back to Analytics
|
||||
Future<void> _currentScreen() async {
|
||||
await _analytics.setCurrentScreen(
|
||||
screenName: 'FlutterAnalyticsHome',
|
||||
screenClassOverride: 'FlutterAnalyticsHome',
|
||||
await _analytics.logEvent(
|
||||
name: 'screen_view',
|
||||
parameters: <String, Object>{
|
||||
'screen_name': 'FlutterAnalyticsHome',
|
||||
'screen_class': 'FlutterAnalyticsHome',
|
||||
},
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,10 +8,10 @@ class SingleItemTile extends StatefulWidget {
|
||||
final FirebaseAnalytics analytics;
|
||||
|
||||
SingleItemTile({
|
||||
this.itemName,
|
||||
this.price,
|
||||
this.quantity,
|
||||
this.analytics,
|
||||
required this.itemName,
|
||||
required this.price,
|
||||
required this.quantity,
|
||||
required this.analytics,
|
||||
});
|
||||
|
||||
@override
|
||||
@@ -21,7 +21,7 @@ class SingleItemTile extends StatefulWidget {
|
||||
class _SingleItemTileState extends State<SingleItemTile> {
|
||||
/// [addedToCart] this variable is used to to justify that product is added in
|
||||
/// cart or not
|
||||
bool addedToCart;
|
||||
late bool addedToCart;
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
@@ -127,7 +127,7 @@ class _SingleItemTileState extends State<SingleItemTile> {
|
||||
String price, String itemName, double quantity, bool addedToCart) async {
|
||||
await widget.analytics.logEvent(
|
||||
name: 'item',
|
||||
parameters: <String, dynamic>{
|
||||
parameters: <String, Object>{
|
||||
'price': price,
|
||||
'itemName': itemName,
|
||||
'quantity': quantity,
|
||||
|
||||
@@ -6,15 +6,15 @@ publish_to: 'none'
|
||||
version: 1.0.0+1
|
||||
|
||||
environment:
|
||||
sdk: ">=2.12.0 <3.0.0"
|
||||
sdk: ">=3.0.0 <4.0.0"
|
||||
|
||||
dependencies:
|
||||
flutter:
|
||||
sdk: flutter
|
||||
|
||||
cupertino_icons: ^1.0.0
|
||||
firebase_analytics: ^6.0.2
|
||||
firebase_core: ^0.5.0+1
|
||||
cupertino_icons: ^1.0.9
|
||||
firebase_analytics: ^12.4.6
|
||||
firebase_core: ^4.13.0
|
||||
|
||||
|
||||
dev_dependencies:
|
||||
|
||||
@@ -7,6 +7,15 @@
|
||||
|
||||
# The following line activates a set of recommended lints for Flutter apps,
|
||||
# packages, and plugins designed to encourage good coding practices.
|
||||
analyzer:
|
||||
exclude:
|
||||
- build/**
|
||||
- android/**
|
||||
- ios/**
|
||||
- web/**
|
||||
- windows/**
|
||||
- macos/**
|
||||
- linux/**
|
||||
include: package:flutter_lints/flutter.yaml
|
||||
|
||||
linter:
|
||||
|
||||
@@ -1,68 +0,0 @@
|
||||
def localProperties = new Properties()
|
||||
def localPropertiesFile = rootProject.file('local.properties')
|
||||
if (localPropertiesFile.exists()) {
|
||||
localPropertiesFile.withReader('UTF-8') { reader ->
|
||||
localProperties.load(reader)
|
||||
}
|
||||
}
|
||||
|
||||
def flutterRoot = localProperties.getProperty('flutter.sdk')
|
||||
if (flutterRoot == null) {
|
||||
throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.")
|
||||
}
|
||||
|
||||
def flutterVersionCode = localProperties.getProperty('flutter.versionCode')
|
||||
if (flutterVersionCode == null) {
|
||||
flutterVersionCode = '1'
|
||||
}
|
||||
|
||||
def flutterVersionName = localProperties.getProperty('flutter.versionName')
|
||||
if (flutterVersionName == null) {
|
||||
flutterVersionName = '1.0'
|
||||
}
|
||||
|
||||
apply plugin: 'com.android.application'
|
||||
apply plugin: 'kotlin-android'
|
||||
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
|
||||
|
||||
android {
|
||||
compileSdkVersion 30
|
||||
|
||||
compileOptions {
|
||||
sourceCompatibility JavaVersion.VERSION_1_8
|
||||
targetCompatibility JavaVersion.VERSION_1_8
|
||||
}
|
||||
|
||||
kotlinOptions {
|
||||
jvmTarget = '1.8'
|
||||
}
|
||||
|
||||
sourceSets {
|
||||
main.java.srcDirs += 'src/main/kotlin'
|
||||
}
|
||||
|
||||
defaultConfig {
|
||||
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
|
||||
applicationId "com.example.penassignment"
|
||||
minSdkVersion 16
|
||||
targetSdkVersion 30
|
||||
versionCode flutterVersionCode.toInteger()
|
||||
versionName flutterVersionName
|
||||
}
|
||||
|
||||
buildTypes {
|
||||
release {
|
||||
// TODO: Add your own signing config for the release build.
|
||||
// Signing with the debug keys for now, so `flutter run --release` works.
|
||||
signingConfig signingConfigs.debug
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
flutter {
|
||||
source '../..'
|
||||
}
|
||||
|
||||
dependencies {
|
||||
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
|
||||
}
|
||||
42
animation_example/android/app/build.gradle.kts
Normal file
42
animation_example/android/app/build.gradle.kts
Normal file
@@ -0,0 +1,42 @@
|
||||
plugins {
|
||||
id("com.android.application")
|
||||
id("org.jetbrains.kotlin.android")
|
||||
// The Flutter Gradle Plugin must be applied after the Android and Kotlin Gradle plugins.
|
||||
id("dev.flutter.flutter-gradle-plugin")
|
||||
}
|
||||
|
||||
android {
|
||||
namespace = "com.example.penassignment"
|
||||
compileSdk = flutter.compileSdkVersion
|
||||
ndkVersion = flutter.ndkVersion
|
||||
|
||||
compileOptions {
|
||||
sourceCompatibility = JavaVersion.VERSION_17
|
||||
targetCompatibility = JavaVersion.VERSION_17
|
||||
}
|
||||
|
||||
defaultConfig {
|
||||
applicationId = "com.example.penassignment"
|
||||
minSdk = flutter.minSdkVersion
|
||||
targetSdk = flutter.targetSdkVersion
|
||||
versionCode = flutter.versionCode
|
||||
versionName = flutter.versionName
|
||||
}
|
||||
|
||||
buildTypes {
|
||||
release {
|
||||
signingConfig = signingConfigs.getByName("debug")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
kotlin {
|
||||
compilerOptions {
|
||||
jvmTarget = org.jetbrains.kotlin.gradle.dsl.JvmTarget.JVM_17
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
flutter {
|
||||
source = "../.."
|
||||
}
|
||||
@@ -1,5 +1,5 @@
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
package="com.example.penassignment">
|
||||
>
|
||||
<application
|
||||
android:label="penassignment"
|
||||
android:icon="@mipmap/ic_launcher">
|
||||
|
||||
@@ -1,29 +0,0 @@
|
||||
buildscript {
|
||||
ext.kotlin_version = '1.3.50'
|
||||
repositories {
|
||||
google()
|
||||
mavenCentral()
|
||||
}
|
||||
|
||||
dependencies {
|
||||
classpath 'com.android.tools.build:gradle:4.1.0'
|
||||
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
|
||||
}
|
||||
}
|
||||
|
||||
allprojects {
|
||||
repositories {
|
||||
google()
|
||||
mavenCentral()
|
||||
}
|
||||
}
|
||||
|
||||
rootProject.buildDir = '../build'
|
||||
subprojects {
|
||||
project.buildDir = "${rootProject.buildDir}/${project.name}"
|
||||
project.evaluationDependsOn(':app')
|
||||
}
|
||||
|
||||
task clean(type: Delete) {
|
||||
delete rootProject.buildDir
|
||||
}
|
||||
24
animation_example/android/build.gradle.kts
Normal file
24
animation_example/android/build.gradle.kts
Normal file
@@ -0,0 +1,24 @@
|
||||
allprojects {
|
||||
repositories {
|
||||
google()
|
||||
mavenCentral()
|
||||
}
|
||||
}
|
||||
|
||||
val newBuildDir: Directory =
|
||||
rootProject.layout.buildDirectory
|
||||
.dir("../../build")
|
||||
.get()
|
||||
rootProject.layout.buildDirectory.value(newBuildDir)
|
||||
|
||||
subprojects {
|
||||
val newSubprojectBuildDir: Directory = newBuildDir.dir(project.name)
|
||||
project.layout.buildDirectory.value(newSubprojectBuildDir)
|
||||
}
|
||||
subprojects {
|
||||
project.evaluationDependsOn(":app")
|
||||
}
|
||||
|
||||
tasks.register<Delete>("clean") {
|
||||
delete(rootProject.layout.buildDirectory)
|
||||
}
|
||||
@@ -1,3 +1,4 @@
|
||||
org.gradle.jvmargs=-Xmx1536M
|
||||
org.gradle.jvmargs=-Xmx8G -XX:MaxMetaspaceSize=4G -XX:ReservedCodeCacheSize=512m -XX:+HeapDumpOnOutOfMemoryError
|
||||
android.useAndroidX=true
|
||||
android.enableJetifier=true
|
||||
android.newDsl=false
|
||||
android.builtInKotlin=false
|
||||
|
||||
@@ -1,7 +1,9 @@
|
||||
distributionBase=GRADLE_USER_HOME
|
||||
distributionPath=wrapper/dists
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.4-bin.zip
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-9.7.0-bin.zip
|
||||
networkTimeout=10000
|
||||
retries=0
|
||||
retryBackOffMs=500
|
||||
validateDistributionUrl=true
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
zipStorePath=wrapper/dists
|
||||
|
||||
@@ -1,11 +0,0 @@
|
||||
include ':app'
|
||||
|
||||
def localPropertiesFile = new File(rootProject.projectDir, "local.properties")
|
||||
def properties = new Properties()
|
||||
|
||||
assert localPropertiesFile.exists()
|
||||
localPropertiesFile.withReader("UTF-8") { reader -> properties.load(reader) }
|
||||
|
||||
def flutterSdkPath = properties.getProperty("flutter.sdk")
|
||||
assert flutterSdkPath != null, "flutter.sdk not set in local.properties"
|
||||
apply from: "$flutterSdkPath/packages/flutter_tools/gradle/app_plugin_loader.gradle"
|
||||
26
animation_example/android/settings.gradle.kts
Normal file
26
animation_example/android/settings.gradle.kts
Normal file
@@ -0,0 +1,26 @@
|
||||
pluginManagement {
|
||||
val flutterSdkPath =
|
||||
run {
|
||||
val properties = java.util.Properties()
|
||||
file("local.properties").inputStream().use { properties.load(it) }
|
||||
val flutterSdkPath = properties.getProperty("flutter.sdk")
|
||||
require(flutterSdkPath != null) { "flutter.sdk not set in local.properties" }
|
||||
flutterSdkPath
|
||||
}
|
||||
|
||||
includeBuild("$flutterSdkPath/packages/flutter_tools/gradle")
|
||||
|
||||
repositories {
|
||||
google()
|
||||
mavenCentral()
|
||||
gradlePluginPortal()
|
||||
}
|
||||
}
|
||||
|
||||
plugins {
|
||||
id("dev.flutter.flutter-plugin-loader") version "1.0.0"
|
||||
id("com.android.application") version "9.1.0" apply false
|
||||
id("org.jetbrains.kotlin.android") version "2.2.20" apply false
|
||||
}
|
||||
|
||||
include(":app")
|
||||
@@ -18,7 +18,7 @@ publish_to: 'none' # Remove this line if you wish to publish to pub.dev
|
||||
version: 1.0.0+1
|
||||
|
||||
environment:
|
||||
sdk: ">=2.12.0 <3.0.0"
|
||||
sdk: ">=3.0.0 <4.0.0"
|
||||
|
||||
# Dependencies specify other packages that your package needs in order to work.
|
||||
# To automatically upgrade your package dependencies to the latest versions
|
||||
@@ -33,7 +33,7 @@ dependencies:
|
||||
|
||||
# The following adds the Cupertino Icons font to your application.
|
||||
# Use with the CupertinoIcons class for iOS style icons.
|
||||
cupertino_icons: ^1.0.2
|
||||
cupertino_icons: ^1.0.9
|
||||
|
||||
dev_dependencies:
|
||||
flutter_test:
|
||||
@@ -44,7 +44,7 @@ dev_dependencies:
|
||||
# activated in the `analysis_options.yaml` file located at the root of your
|
||||
# package. See that file for information about deactivating specific lint
|
||||
# rules and activating additional ones.
|
||||
flutter_lints: ^1.0.0
|
||||
flutter_lints: ^6.0.0
|
||||
|
||||
# For information on the generic Dart part of this file, see the
|
||||
# following page: https://dart.dev/tools/pub/pubspec
|
||||
|
||||
@@ -7,6 +7,15 @@
|
||||
|
||||
# The following line activates a set of recommended lints for Flutter apps,
|
||||
# packages, and plugins designed to encourage good coding practices.
|
||||
analyzer:
|
||||
exclude:
|
||||
- build/**
|
||||
- android/**
|
||||
- ios/**
|
||||
- web/**
|
||||
- windows/**
|
||||
- macos/**
|
||||
- linux/**
|
||||
include: package:flutter_lints/flutter.yaml
|
||||
|
||||
linter:
|
||||
|
||||
@@ -1,68 +0,0 @@
|
||||
def localProperties = new Properties()
|
||||
def localPropertiesFile = rootProject.file('local.properties')
|
||||
if (localPropertiesFile.exists()) {
|
||||
localPropertiesFile.withReader('UTF-8') { reader ->
|
||||
localProperties.load(reader)
|
||||
}
|
||||
}
|
||||
|
||||
def flutterRoot = localProperties.getProperty('flutter.sdk')
|
||||
if (flutterRoot == null) {
|
||||
throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.")
|
||||
}
|
||||
|
||||
def flutterVersionCode = localProperties.getProperty('flutter.versionCode')
|
||||
if (flutterVersionCode == null) {
|
||||
flutterVersionCode = '1'
|
||||
}
|
||||
|
||||
def flutterVersionName = localProperties.getProperty('flutter.versionName')
|
||||
if (flutterVersionName == null) {
|
||||
flutterVersionName = '1.0'
|
||||
}
|
||||
|
||||
apply plugin: 'com.android.application'
|
||||
apply plugin: 'kotlin-android'
|
||||
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
|
||||
|
||||
android {
|
||||
compileSdkVersion flutter.compileSdkVersion
|
||||
|
||||
compileOptions {
|
||||
sourceCompatibility JavaVersion.VERSION_1_8
|
||||
targetCompatibility JavaVersion.VERSION_1_8
|
||||
}
|
||||
|
||||
kotlinOptions {
|
||||
jvmTarget = '1.8'
|
||||
}
|
||||
|
||||
sourceSets {
|
||||
main.java.srcDirs += 'src/main/kotlin'
|
||||
}
|
||||
|
||||
defaultConfig {
|
||||
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
|
||||
applicationId "studio.sdev.biometrics"
|
||||
minSdkVersion flutter.minSdkVersion
|
||||
targetSdkVersion flutter.targetSdkVersion
|
||||
versionCode flutterVersionCode.toInteger()
|
||||
versionName flutterVersionName
|
||||
}
|
||||
|
||||
buildTypes {
|
||||
release {
|
||||
// TODO: Add your own signing config for the release build.
|
||||
// Signing with the debug keys for now, so `flutter run --release` works.
|
||||
signingConfig signingConfigs.debug
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
flutter {
|
||||
source '../..'
|
||||
}
|
||||
|
||||
dependencies {
|
||||
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
|
||||
}
|
||||
42
biometrics/android/app/build.gradle.kts
Normal file
42
biometrics/android/app/build.gradle.kts
Normal file
@@ -0,0 +1,42 @@
|
||||
plugins {
|
||||
id("com.android.application")
|
||||
id("org.jetbrains.kotlin.android")
|
||||
// The Flutter Gradle Plugin must be applied after the Android and Kotlin Gradle plugins.
|
||||
id("dev.flutter.flutter-gradle-plugin")
|
||||
}
|
||||
|
||||
android {
|
||||
namespace = "studio.sdev.biometrics"
|
||||
compileSdk = flutter.compileSdkVersion
|
||||
ndkVersion = flutter.ndkVersion
|
||||
|
||||
compileOptions {
|
||||
sourceCompatibility = JavaVersion.VERSION_17
|
||||
targetCompatibility = JavaVersion.VERSION_17
|
||||
}
|
||||
|
||||
defaultConfig {
|
||||
applicationId = "studio.sdev.biometrics"
|
||||
minSdk = flutter.minSdkVersion
|
||||
targetSdk = flutter.targetSdkVersion
|
||||
versionCode = flutter.versionCode
|
||||
versionName = flutter.versionName
|
||||
}
|
||||
|
||||
buildTypes {
|
||||
release {
|
||||
signingConfig = signingConfigs.getByName("debug")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
kotlin {
|
||||
compilerOptions {
|
||||
jvmTarget = org.jetbrains.kotlin.gradle.dsl.JvmTarget.JVM_17
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
flutter {
|
||||
source = "../.."
|
||||
}
|
||||
@@ -1,5 +1,5 @@
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
package="studio.sdev.biometrics">
|
||||
>
|
||||
<application
|
||||
android:label="biometrics"
|
||||
android:name="${applicationName}"
|
||||
|
||||
@@ -1,31 +0,0 @@
|
||||
buildscript {
|
||||
ext.kotlin_version = '1.6.10'
|
||||
repositories {
|
||||
google()
|
||||
mavenCentral()
|
||||
}
|
||||
|
||||
dependencies {
|
||||
classpath 'com.android.tools.build:gradle:4.1.0'
|
||||
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
|
||||
}
|
||||
}
|
||||
|
||||
allprojects {
|
||||
repositories {
|
||||
google()
|
||||
mavenCentral()
|
||||
}
|
||||
}
|
||||
|
||||
rootProject.buildDir = '../build'
|
||||
subprojects {
|
||||
project.buildDir = "${rootProject.buildDir}/${project.name}"
|
||||
}
|
||||
subprojects {
|
||||
project.evaluationDependsOn(':app')
|
||||
}
|
||||
|
||||
task clean(type: Delete) {
|
||||
delete rootProject.buildDir
|
||||
}
|
||||
24
biometrics/android/build.gradle.kts
Normal file
24
biometrics/android/build.gradle.kts
Normal file
@@ -0,0 +1,24 @@
|
||||
allprojects {
|
||||
repositories {
|
||||
google()
|
||||
mavenCentral()
|
||||
}
|
||||
}
|
||||
|
||||
val newBuildDir: Directory =
|
||||
rootProject.layout.buildDirectory
|
||||
.dir("../../build")
|
||||
.get()
|
||||
rootProject.layout.buildDirectory.value(newBuildDir)
|
||||
|
||||
subprojects {
|
||||
val newSubprojectBuildDir: Directory = newBuildDir.dir(project.name)
|
||||
project.layout.buildDirectory.value(newSubprojectBuildDir)
|
||||
}
|
||||
subprojects {
|
||||
project.evaluationDependsOn(":app")
|
||||
}
|
||||
|
||||
tasks.register<Delete>("clean") {
|
||||
delete(rootProject.layout.buildDirectory)
|
||||
}
|
||||
@@ -1,3 +1,4 @@
|
||||
org.gradle.jvmargs=-Xmx1536M
|
||||
org.gradle.jvmargs=-Xmx8G -XX:MaxMetaspaceSize=4G -XX:ReservedCodeCacheSize=512m -XX:+HeapDumpOnOutOfMemoryError
|
||||
android.useAndroidX=true
|
||||
android.enableJetifier=true
|
||||
android.newDsl=false
|
||||
android.builtInKotlin=false
|
||||
|
||||
@@ -1,7 +1,9 @@
|
||||
distributionBase=GRADLE_USER_HOME
|
||||
distributionPath=wrapper/dists
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.4-bin.zip
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-9.7.0-bin.zip
|
||||
networkTimeout=10000
|
||||
retries=0
|
||||
retryBackOffMs=500
|
||||
validateDistributionUrl=true
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
zipStorePath=wrapper/dists
|
||||
|
||||
@@ -1,11 +0,0 @@
|
||||
include ':app'
|
||||
|
||||
def localPropertiesFile = new File(rootProject.projectDir, "local.properties")
|
||||
def properties = new Properties()
|
||||
|
||||
assert localPropertiesFile.exists()
|
||||
localPropertiesFile.withReader("UTF-8") { reader -> properties.load(reader) }
|
||||
|
||||
def flutterSdkPath = properties.getProperty("flutter.sdk")
|
||||
assert flutterSdkPath != null, "flutter.sdk not set in local.properties"
|
||||
apply from: "$flutterSdkPath/packages/flutter_tools/gradle/app_plugin_loader.gradle"
|
||||
26
biometrics/android/settings.gradle.kts
Normal file
26
biometrics/android/settings.gradle.kts
Normal file
@@ -0,0 +1,26 @@
|
||||
pluginManagement {
|
||||
val flutterSdkPath =
|
||||
run {
|
||||
val properties = java.util.Properties()
|
||||
file("local.properties").inputStream().use { properties.load(it) }
|
||||
val flutterSdkPath = properties.getProperty("flutter.sdk")
|
||||
require(flutterSdkPath != null) { "flutter.sdk not set in local.properties" }
|
||||
flutterSdkPath
|
||||
}
|
||||
|
||||
includeBuild("$flutterSdkPath/packages/flutter_tools/gradle")
|
||||
|
||||
repositories {
|
||||
google()
|
||||
mavenCentral()
|
||||
gradlePluginPortal()
|
||||
}
|
||||
}
|
||||
|
||||
plugins {
|
||||
id("dev.flutter.flutter-plugin-loader") version "1.0.0"
|
||||
id("com.android.application") version "9.1.0" apply false
|
||||
id("org.jetbrains.kotlin.android") version "2.2.20" apply false
|
||||
}
|
||||
|
||||
include(":app")
|
||||
@@ -21,10 +21,7 @@ class BiometricsVerifier {
|
||||
try {
|
||||
didAuthenticate = await auth.authenticate(
|
||||
localizedReason: prompt ?? 'Please authenticate with biometrics',
|
||||
options: const AuthenticationOptions(
|
||||
stickyAuth: true,
|
||||
biometricOnly: true,
|
||||
),
|
||||
);
|
||||
} on PlatformException {
|
||||
throw "Platform Exception : Biometrics Failed !";
|
||||
|
||||
@@ -18,7 +18,7 @@ publish_to: 'none' # Remove this line if you wish to publish to pub.dev
|
||||
version: 1.0.0+1
|
||||
|
||||
environment:
|
||||
sdk: ">=2.16.2 <3.0.0"
|
||||
sdk: ">=3.0.0 <4.0.0"
|
||||
|
||||
# Dependencies specify other packages that your package needs in order to work.
|
||||
# To automatically upgrade your package dependencies to the latest versions
|
||||
@@ -33,8 +33,8 @@ dependencies:
|
||||
|
||||
# The following adds the Cupertino Icons font to your application.
|
||||
# Use with the CupertinoIcons class for iOS style icons.
|
||||
cupertino_icons: ^1.0.2
|
||||
local_auth: ^2.1.2
|
||||
cupertino_icons: ^1.0.9
|
||||
local_auth: ^3.0.2
|
||||
|
||||
dev_dependencies:
|
||||
flutter_test:
|
||||
@@ -45,7 +45,7 @@ dev_dependencies:
|
||||
# activated in the `analysis_options.yaml` file located at the root of your
|
||||
# package. See that file for information about deactivating specific lint
|
||||
# rules and activating additional ones.
|
||||
flutter_lints: ^1.0.0
|
||||
flutter_lints: ^6.0.0
|
||||
|
||||
# For information on the generic Dart part of this file, see the
|
||||
# following page: https://dart.dev/tools/pub/pubspec
|
||||
|
||||
@@ -1,3 +1,12 @@
|
||||
analyzer:
|
||||
exclude:
|
||||
- build/**
|
||||
- android/**
|
||||
- ios/**
|
||||
- web/**
|
||||
- windows/**
|
||||
- macos/**
|
||||
- linux/**
|
||||
include: package:flutter_lints/flutter.yaml
|
||||
|
||||
# Additional information about this file can be found at
|
||||
|
||||
@@ -4,18 +4,18 @@ description: A new Flutter module project.
|
||||
version: 1.0.0+1
|
||||
|
||||
environment:
|
||||
sdk: ">=2.17.6 <3.0.0"
|
||||
sdk: ">=3.0.0 <4.0.0"
|
||||
|
||||
dependencies:
|
||||
flutter:
|
||||
sdk: flutter
|
||||
|
||||
cupertino_icons: ^1.0.2
|
||||
cupertino_icons: ^1.0.9
|
||||
|
||||
dev_dependencies:
|
||||
flutter_test:
|
||||
sdk: flutter
|
||||
flutter_lints: ^2.0.0
|
||||
flutter_lints: ^6.0.0
|
||||
|
||||
flutter:
|
||||
uses-material-design: true
|
||||
|
||||
@@ -1,63 +0,0 @@
|
||||
def localProperties = new Properties()
|
||||
def localPropertiesFile = rootProject.file('local.properties')
|
||||
if (localPropertiesFile.exists()) {
|
||||
localPropertiesFile.withReader('UTF-8') { reader ->
|
||||
localProperties.load(reader)
|
||||
}
|
||||
}
|
||||
|
||||
def flutterRoot = localProperties.getProperty('flutter.sdk')
|
||||
if (flutterRoot == null) {
|
||||
throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.")
|
||||
}
|
||||
|
||||
def flutterVersionCode = localProperties.getProperty('flutter.versionCode')
|
||||
if (flutterVersionCode == null) {
|
||||
flutterVersionCode = '1'
|
||||
}
|
||||
|
||||
def flutterVersionName = localProperties.getProperty('flutter.versionName')
|
||||
if (flutterVersionName == null) {
|
||||
flutterVersionName = '1.0'
|
||||
}
|
||||
|
||||
apply plugin: 'com.android.application'
|
||||
apply plugin: 'kotlin-android'
|
||||
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
|
||||
|
||||
android {
|
||||
compileSdkVersion 28
|
||||
|
||||
sourceSets {
|
||||
main.java.srcDirs += 'src/main/kotlin'
|
||||
}
|
||||
|
||||
lintOptions {
|
||||
disable 'InvalidPackage'
|
||||
}
|
||||
|
||||
defaultConfig {
|
||||
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
|
||||
applicationId "github.nisrulz.bottomsheet"
|
||||
minSdkVersion 16
|
||||
targetSdkVersion 28
|
||||
versionCode flutterVersionCode.toInteger()
|
||||
versionName flutterVersionName
|
||||
}
|
||||
|
||||
buildTypes {
|
||||
release {
|
||||
// TODO: Add your own signing config for the release build.
|
||||
// Signing with the debug keys for now, so `flutter run --release` works.
|
||||
signingConfig signingConfigs.debug
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
flutter {
|
||||
source '../..'
|
||||
}
|
||||
|
||||
dependencies {
|
||||
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
|
||||
}
|
||||
42
bottom_sheet/android/app/build.gradle.kts
Normal file
42
bottom_sheet/android/app/build.gradle.kts
Normal file
@@ -0,0 +1,42 @@
|
||||
plugins {
|
||||
id("com.android.application")
|
||||
id("org.jetbrains.kotlin.android")
|
||||
// The Flutter Gradle Plugin must be applied after the Android and Kotlin Gradle plugins.
|
||||
id("dev.flutter.flutter-gradle-plugin")
|
||||
}
|
||||
|
||||
android {
|
||||
namespace = "github.nisrulz.bottomsheet"
|
||||
compileSdk = flutter.compileSdkVersion
|
||||
ndkVersion = flutter.ndkVersion
|
||||
|
||||
compileOptions {
|
||||
sourceCompatibility = JavaVersion.VERSION_17
|
||||
targetCompatibility = JavaVersion.VERSION_17
|
||||
}
|
||||
|
||||
defaultConfig {
|
||||
applicationId = "github.nisrulz.bottomsheet"
|
||||
minSdk = flutter.minSdkVersion
|
||||
targetSdk = flutter.targetSdkVersion
|
||||
versionCode = flutter.versionCode
|
||||
versionName = flutter.versionName
|
||||
}
|
||||
|
||||
buildTypes {
|
||||
release {
|
||||
signingConfig = signingConfigs.getByName("debug")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
kotlin {
|
||||
compilerOptions {
|
||||
jvmTarget = org.jetbrains.kotlin.gradle.dsl.JvmTarget.JVM_17
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
flutter {
|
||||
source = "../.."
|
||||
}
|
||||
@@ -1,5 +1,5 @@
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
package="github.nisrulz.bottomsheet">
|
||||
>
|
||||
<!-- io.flutter.app.FlutterApplication is an android.app.Application that
|
||||
calls FlutterMain.startInitialization(this); in its onCreate method.
|
||||
In most cases you can leave this as-is, but you if you want to provide
|
||||
|
||||
@@ -1,31 +0,0 @@
|
||||
buildscript {
|
||||
ext.kotlin_version = '1.4.32'
|
||||
repositories {
|
||||
google()
|
||||
mavenCentral()
|
||||
}
|
||||
|
||||
dependencies {
|
||||
classpath 'com.android.tools.build:gradle:4.1.3'
|
||||
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
|
||||
}
|
||||
}
|
||||
|
||||
allprojects {
|
||||
repositories {
|
||||
google()
|
||||
mavenCentral()
|
||||
}
|
||||
}
|
||||
|
||||
rootProject.buildDir = '../build'
|
||||
subprojects {
|
||||
project.buildDir = "${rootProject.buildDir}/${project.name}"
|
||||
}
|
||||
subprojects {
|
||||
project.evaluationDependsOn(':app')
|
||||
}
|
||||
|
||||
task clean(type: Delete) {
|
||||
delete rootProject.buildDir
|
||||
}
|
||||
24
bottom_sheet/android/build.gradle.kts
Normal file
24
bottom_sheet/android/build.gradle.kts
Normal file
@@ -0,0 +1,24 @@
|
||||
allprojects {
|
||||
repositories {
|
||||
google()
|
||||
mavenCentral()
|
||||
}
|
||||
}
|
||||
|
||||
val newBuildDir: Directory =
|
||||
rootProject.layout.buildDirectory
|
||||
.dir("../../build")
|
||||
.get()
|
||||
rootProject.layout.buildDirectory.value(newBuildDir)
|
||||
|
||||
subprojects {
|
||||
val newSubprojectBuildDir: Directory = newBuildDir.dir(project.name)
|
||||
project.layout.buildDirectory.value(newSubprojectBuildDir)
|
||||
}
|
||||
subprojects {
|
||||
project.evaluationDependsOn(":app")
|
||||
}
|
||||
|
||||
tasks.register<Delete>("clean") {
|
||||
delete(rootProject.layout.buildDirectory)
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
org.gradle.jvmargs=-Xmx1536M
|
||||
android.enableR8=true
|
||||
org.gradle.jvmargs=-Xmx8G -XX:MaxMetaspaceSize=4G -XX:ReservedCodeCacheSize=512m -XX:+HeapDumpOnOutOfMemoryError
|
||||
android.useAndroidX=true
|
||||
android.enableJetifier=true
|
||||
android.newDsl=false
|
||||
android.builtInKotlin=false
|
||||
|
||||
@@ -1,7 +1,9 @@
|
||||
distributionBase=GRADLE_USER_HOME
|
||||
distributionPath=wrapper/dists
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.4-bin.zip
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-9.7.0-bin.zip
|
||||
networkTimeout=10000
|
||||
retries=0
|
||||
retryBackOffMs=500
|
||||
validateDistributionUrl=true
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
zipStorePath=wrapper/dists
|
||||
|
||||
@@ -1,11 +0,0 @@
|
||||
include ':app'
|
||||
|
||||
def localPropertiesFile = new File(rootProject.projectDir, "local.properties")
|
||||
def properties = new Properties()
|
||||
|
||||
assert localPropertiesFile.exists()
|
||||
localPropertiesFile.withReader("UTF-8") { reader -> properties.load(reader) }
|
||||
|
||||
def flutterSdkPath = properties.getProperty("flutter.sdk")
|
||||
assert flutterSdkPath != null, "flutter.sdk not set in local.properties"
|
||||
apply from: "$flutterSdkPath/packages/flutter_tools/gradle/app_plugin_loader.gradle"
|
||||
26
bottom_sheet/android/settings.gradle.kts
Normal file
26
bottom_sheet/android/settings.gradle.kts
Normal file
@@ -0,0 +1,26 @@
|
||||
pluginManagement {
|
||||
val flutterSdkPath =
|
||||
run {
|
||||
val properties = java.util.Properties()
|
||||
file("local.properties").inputStream().use { properties.load(it) }
|
||||
val flutterSdkPath = properties.getProperty("flutter.sdk")
|
||||
require(flutterSdkPath != null) { "flutter.sdk not set in local.properties" }
|
||||
flutterSdkPath
|
||||
}
|
||||
|
||||
includeBuild("$flutterSdkPath/packages/flutter_tools/gradle")
|
||||
|
||||
repositories {
|
||||
google()
|
||||
mavenCentral()
|
||||
gradlePluginPortal()
|
||||
}
|
||||
}
|
||||
|
||||
plugins {
|
||||
id("dev.flutter.flutter-plugin-loader") version "1.0.0"
|
||||
id("com.android.application") version "9.1.0" apply false
|
||||
id("org.jetbrains.kotlin.android") version "2.2.20" apply false
|
||||
}
|
||||
|
||||
include(":app")
|
||||
32
bottom_sheet/ios/Flutter/ephemeral/flutter_lldb_helper.py
Normal file
32
bottom_sheet/ios/Flutter/ephemeral/flutter_lldb_helper.py
Normal file
@@ -0,0 +1,32 @@
|
||||
#
|
||||
# Generated file, do not edit.
|
||||
#
|
||||
|
||||
import lldb
|
||||
|
||||
def handle_new_rx_page(frame: lldb.SBFrame, bp_loc, extra_args, intern_dict):
|
||||
"""Intercept NOTIFY_DEBUGGER_ABOUT_RX_PAGES and touch the pages."""
|
||||
base = frame.register["x0"].GetValueAsAddress()
|
||||
page_len = frame.register["x1"].GetValueAsUnsigned()
|
||||
|
||||
# Note: NOTIFY_DEBUGGER_ABOUT_RX_PAGES will check contents of the
|
||||
# first page to see if handled it correctly. This makes diagnosing
|
||||
# misconfiguration (e.g. missing breakpoint) easier.
|
||||
data = bytearray(page_len)
|
||||
data[0:8] = b'IHELPED!'
|
||||
|
||||
error = lldb.SBError()
|
||||
frame.GetThread().GetProcess().WriteMemory(base, data, error)
|
||||
if not error.Success():
|
||||
print(f'Failed to write into {base}[+{page_len}]', error)
|
||||
return
|
||||
|
||||
def __lldb_init_module(debugger: lldb.SBDebugger, _):
|
||||
target = debugger.GetDummyTarget()
|
||||
# Caveat: must use BreakpointCreateByRegEx here and not
|
||||
# BreakpointCreateByName. For some reasons callback function does not
|
||||
# get carried over from dummy target for the later.
|
||||
bp = target.BreakpointCreateByRegex("^NOTIFY_DEBUGGER_ABOUT_RX_PAGES$")
|
||||
bp.SetScriptCallbackFunction('{}.handle_new_rx_page'.format(__name__))
|
||||
bp.SetAutoContinue(True)
|
||||
print("-- LLDB integration loaded --")
|
||||
5
bottom_sheet/ios/Flutter/ephemeral/flutter_lldbinit
Normal file
5
bottom_sheet/ios/Flutter/ephemeral/flutter_lldbinit
Normal file
@@ -0,0 +1,5 @@
|
||||
#
|
||||
# Generated file, do not edit.
|
||||
#
|
||||
|
||||
command script import --relative-to-command-file flutter_lldb_helper.py
|
||||
@@ -0,0 +1,12 @@
|
||||
FLUTTER_ROOT=/opt/homebrew/share/flutter
|
||||
FLUTTER_APPLICATION_PATH=/Users/nishantsrivastava/Personal/Workspaces/github/flutter/flutter-examples/bottom_sheet
|
||||
FLUTTER_FRAMEWORK_SWIFT_PACKAGE_PATH=/Users/nishantsrivastava/Personal/Workspaces/github/flutter/flutter-examples/bottom_sheet/ios/Flutter/ephemeral/Packages/.packages/FlutterFramework
|
||||
COCOAPODS_PARALLEL_CODE_SIGN=true
|
||||
FLUTTER_TARGET=lib/main.dart
|
||||
FLUTTER_BUILD_DIR=build
|
||||
FLUTTER_BUILD_NAME=1.0.0
|
||||
FLUTTER_BUILD_NUMBER=1
|
||||
DART_OBFUSCATION=false
|
||||
TRACK_WIDGET_CREATION=true
|
||||
TREE_SHAKE_ICONS=false
|
||||
PACKAGE_CONFIG=.dart_tool/package_config.json
|
||||
@@ -2,7 +2,7 @@ import 'package:flutter/material.dart';
|
||||
import 'package:project/models/ListTileModel.dart';
|
||||
|
||||
class MyHomePage extends StatefulWidget {
|
||||
MyHomePage({Key key, this.title}) : super(key: key);
|
||||
MyHomePage({super.key, required this.title});
|
||||
|
||||
final String title;
|
||||
|
||||
@@ -22,7 +22,7 @@ class _MyHomePageState extends State<MyHomePage> {
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: <Widget>[
|
||||
new RaisedButton(
|
||||
new ElevatedButton(
|
||||
child: Text(
|
||||
"Bottom Sheet",
|
||||
style: TextStyle(fontSize: 20),
|
||||
@@ -39,7 +39,6 @@ class _MyHomePageState extends State<MyHomePage> {
|
||||
}
|
||||
|
||||
void _openBottomSheet(context) {
|
||||
|
||||
showModalBottomSheet(
|
||||
context: context,
|
||||
builder: (builder) {
|
||||
|
||||
@@ -18,7 +18,7 @@ publish_to: 'none' # Remove this line if you wish to publish to pub.dev
|
||||
version: 1.0.0+1
|
||||
|
||||
environment:
|
||||
sdk: ">=2.12.0 <3.0.0"
|
||||
sdk: ">=3.0.0 <4.0.0"
|
||||
|
||||
dependencies:
|
||||
flutter:
|
||||
@@ -27,7 +27,7 @@ dependencies:
|
||||
|
||||
# The following adds the Cupertino Icons font to your application.
|
||||
# Use with the CupertinoIcons class for iOS style icons.
|
||||
cupertino_icons: ^0.1.3
|
||||
cupertino_icons: ^1.0.9
|
||||
|
||||
dev_dependencies:
|
||||
flutter_test:
|
||||
|
||||
@@ -1,63 +0,0 @@
|
||||
def localProperties = new Properties()
|
||||
def localPropertiesFile = rootProject.file('local.properties')
|
||||
if (localPropertiesFile.exists()) {
|
||||
localPropertiesFile.withReader('UTF-8') { reader ->
|
||||
localProperties.load(reader)
|
||||
}
|
||||
}
|
||||
|
||||
def flutterRoot = localProperties.getProperty('flutter.sdk')
|
||||
if (flutterRoot == null) {
|
||||
throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.")
|
||||
}
|
||||
|
||||
def flutterVersionCode = localProperties.getProperty('flutter.versionCode')
|
||||
if (flutterVersionCode == null) {
|
||||
flutterVersionCode = '1'
|
||||
}
|
||||
|
||||
def flutterVersionName = localProperties.getProperty('flutter.versionName')
|
||||
if (flutterVersionName == null) {
|
||||
flutterVersionName = '1.0'
|
||||
}
|
||||
|
||||
apply plugin: 'com.android.application'
|
||||
apply plugin: 'kotlin-android'
|
||||
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
|
||||
|
||||
android {
|
||||
compileSdkVersion 29
|
||||
|
||||
sourceSets {
|
||||
main.java.srcDirs += 'src/main/kotlin'
|
||||
}
|
||||
|
||||
lintOptions {
|
||||
disable 'InvalidPackage'
|
||||
}
|
||||
|
||||
defaultConfig {
|
||||
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
|
||||
applicationId "github.nisrulz.covid19mobileapp"
|
||||
minSdkVersion 16
|
||||
targetSdkVersion 29
|
||||
versionCode flutterVersionCode.toInteger()
|
||||
versionName flutterVersionName
|
||||
}
|
||||
|
||||
buildTypes {
|
||||
release {
|
||||
// TODO: Add your own signing config for the release build.
|
||||
// Signing with the debug keys for now, so `flutter run --release` works.
|
||||
signingConfig signingConfigs.debug
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
flutter {
|
||||
source '../..'
|
||||
}
|
||||
|
||||
dependencies {
|
||||
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
|
||||
}
|
||||
42
covid19_mobile_app/android/app/build.gradle.kts
Normal file
42
covid19_mobile_app/android/app/build.gradle.kts
Normal file
@@ -0,0 +1,42 @@
|
||||
plugins {
|
||||
id("com.android.application")
|
||||
id("org.jetbrains.kotlin.android")
|
||||
// The Flutter Gradle Plugin must be applied after the Android and Kotlin Gradle plugins.
|
||||
id("dev.flutter.flutter-gradle-plugin")
|
||||
}
|
||||
|
||||
android {
|
||||
namespace = "github.nisrulz.covid19mobileapp"
|
||||
compileSdk = flutter.compileSdkVersion
|
||||
ndkVersion = flutter.ndkVersion
|
||||
|
||||
compileOptions {
|
||||
sourceCompatibility = JavaVersion.VERSION_17
|
||||
targetCompatibility = JavaVersion.VERSION_17
|
||||
}
|
||||
|
||||
defaultConfig {
|
||||
applicationId = "github.nisrulz.covid19mobileapp"
|
||||
minSdk = flutter.minSdkVersion
|
||||
targetSdk = flutter.targetSdkVersion
|
||||
versionCode = flutter.versionCode
|
||||
versionName = flutter.versionName
|
||||
}
|
||||
|
||||
buildTypes {
|
||||
release {
|
||||
signingConfig = signingConfigs.getByName("debug")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
kotlin {
|
||||
compilerOptions {
|
||||
jvmTarget = org.jetbrains.kotlin.gradle.dsl.JvmTarget.JVM_17
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
flutter {
|
||||
source = "../.."
|
||||
}
|
||||
@@ -1,5 +1,5 @@
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
package="github.nisrulz.covid19mobileapp">
|
||||
>
|
||||
<!-- io.flutter.app.FlutterApplication is an android.app.Application that
|
||||
calls FlutterMain.startInitialization(this); in its onCreate method.
|
||||
In most cases you can leave this as-is, but you if you want to provide
|
||||
|
||||
@@ -1,31 +0,0 @@
|
||||
buildscript {
|
||||
ext.kotlin_version = '1.3.50'
|
||||
repositories {
|
||||
google()
|
||||
jcenter()
|
||||
}
|
||||
|
||||
dependencies {
|
||||
classpath 'com.android.tools.build:gradle:3.5.0'
|
||||
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
|
||||
}
|
||||
}
|
||||
|
||||
allprojects {
|
||||
repositories {
|
||||
google()
|
||||
jcenter()
|
||||
}
|
||||
}
|
||||
|
||||
rootProject.buildDir = '../build'
|
||||
subprojects {
|
||||
project.buildDir = "${rootProject.buildDir}/${project.name}"
|
||||
}
|
||||
subprojects {
|
||||
project.evaluationDependsOn(':app')
|
||||
}
|
||||
|
||||
task clean(type: Delete) {
|
||||
delete rootProject.buildDir
|
||||
}
|
||||
24
covid19_mobile_app/android/build.gradle.kts
Normal file
24
covid19_mobile_app/android/build.gradle.kts
Normal file
@@ -0,0 +1,24 @@
|
||||
allprojects {
|
||||
repositories {
|
||||
google()
|
||||
mavenCentral()
|
||||
}
|
||||
}
|
||||
|
||||
val newBuildDir: Directory =
|
||||
rootProject.layout.buildDirectory
|
||||
.dir("../../build")
|
||||
.get()
|
||||
rootProject.layout.buildDirectory.value(newBuildDir)
|
||||
|
||||
subprojects {
|
||||
val newSubprojectBuildDir: Directory = newBuildDir.dir(project.name)
|
||||
project.layout.buildDirectory.value(newSubprojectBuildDir)
|
||||
}
|
||||
subprojects {
|
||||
project.evaluationDependsOn(":app")
|
||||
}
|
||||
|
||||
tasks.register<Delete>("clean") {
|
||||
delete(rootProject.layout.buildDirectory)
|
||||
}
|
||||
@@ -1,3 +1,4 @@
|
||||
org.gradle.jvmargs=-Xmx1536M
|
||||
org.gradle.jvmargs=-Xmx8G -XX:MaxMetaspaceSize=4G -XX:ReservedCodeCacheSize=512m -XX:+HeapDumpOnOutOfMemoryError
|
||||
android.useAndroidX=true
|
||||
android.enableJetifier=true
|
||||
android.newDsl=false
|
||||
android.builtInKotlin=false
|
||||
|
||||
@@ -1,7 +1,9 @@
|
||||
distributionBase=GRADLE_USER_HOME
|
||||
distributionPath=wrapper/dists
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.4-bin.zip
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-9.7.0-bin.zip
|
||||
networkTimeout=10000
|
||||
retries=0
|
||||
retryBackOffMs=500
|
||||
validateDistributionUrl=true
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
zipStorePath=wrapper/dists
|
||||
|
||||
@@ -1,11 +0,0 @@
|
||||
include ':app'
|
||||
|
||||
def localPropertiesFile = new File(rootProject.projectDir, "local.properties")
|
||||
def properties = new Properties()
|
||||
|
||||
assert localPropertiesFile.exists()
|
||||
localPropertiesFile.withReader("UTF-8") { reader -> properties.load(reader) }
|
||||
|
||||
def flutterSdkPath = properties.getProperty("flutter.sdk")
|
||||
assert flutterSdkPath != null, "flutter.sdk not set in local.properties"
|
||||
apply from: "$flutterSdkPath/packages/flutter_tools/gradle/app_plugin_loader.gradle"
|
||||
26
covid19_mobile_app/android/settings.gradle.kts
Normal file
26
covid19_mobile_app/android/settings.gradle.kts
Normal file
@@ -0,0 +1,26 @@
|
||||
pluginManagement {
|
||||
val flutterSdkPath =
|
||||
run {
|
||||
val properties = java.util.Properties()
|
||||
file("local.properties").inputStream().use { properties.load(it) }
|
||||
val flutterSdkPath = properties.getProperty("flutter.sdk")
|
||||
require(flutterSdkPath != null) { "flutter.sdk not set in local.properties" }
|
||||
flutterSdkPath
|
||||
}
|
||||
|
||||
includeBuild("$flutterSdkPath/packages/flutter_tools/gradle")
|
||||
|
||||
repositories {
|
||||
google()
|
||||
mavenCentral()
|
||||
gradlePluginPortal()
|
||||
}
|
||||
}
|
||||
|
||||
plugins {
|
||||
id("dev.flutter.flutter-plugin-loader") version "1.0.0"
|
||||
id("com.android.application") version "9.1.0" apply false
|
||||
id("org.jetbrains.kotlin.android") version "2.2.20" apply false
|
||||
}
|
||||
|
||||
include(":app")
|
||||
@@ -0,0 +1,32 @@
|
||||
#
|
||||
# Generated file, do not edit.
|
||||
#
|
||||
|
||||
import lldb
|
||||
|
||||
def handle_new_rx_page(frame: lldb.SBFrame, bp_loc, extra_args, intern_dict):
|
||||
"""Intercept NOTIFY_DEBUGGER_ABOUT_RX_PAGES and touch the pages."""
|
||||
base = frame.register["x0"].GetValueAsAddress()
|
||||
page_len = frame.register["x1"].GetValueAsUnsigned()
|
||||
|
||||
# Note: NOTIFY_DEBUGGER_ABOUT_RX_PAGES will check contents of the
|
||||
# first page to see if handled it correctly. This makes diagnosing
|
||||
# misconfiguration (e.g. missing breakpoint) easier.
|
||||
data = bytearray(page_len)
|
||||
data[0:8] = b'IHELPED!'
|
||||
|
||||
error = lldb.SBError()
|
||||
frame.GetThread().GetProcess().WriteMemory(base, data, error)
|
||||
if not error.Success():
|
||||
print(f'Failed to write into {base}[+{page_len}]', error)
|
||||
return
|
||||
|
||||
def __lldb_init_module(debugger: lldb.SBDebugger, _):
|
||||
target = debugger.GetDummyTarget()
|
||||
# Caveat: must use BreakpointCreateByRegEx here and not
|
||||
# BreakpointCreateByName. For some reasons callback function does not
|
||||
# get carried over from dummy target for the later.
|
||||
bp = target.BreakpointCreateByRegex("^NOTIFY_DEBUGGER_ABOUT_RX_PAGES$")
|
||||
bp.SetScriptCallbackFunction('{}.handle_new_rx_page'.format(__name__))
|
||||
bp.SetAutoContinue(True)
|
||||
print("-- LLDB integration loaded --")
|
||||
@@ -0,0 +1,5 @@
|
||||
#
|
||||
# Generated file, do not edit.
|
||||
#
|
||||
|
||||
command script import --relative-to-command-file flutter_lldb_helper.py
|
||||
@@ -0,0 +1,12 @@
|
||||
FLUTTER_ROOT=/opt/homebrew/share/flutter
|
||||
FLUTTER_APPLICATION_PATH=/Users/nishantsrivastava/Personal/Workspaces/github/flutter/flutter-examples/covid19_mobile_app
|
||||
FLUTTER_FRAMEWORK_SWIFT_PACKAGE_PATH=/Users/nishantsrivastava/Personal/Workspaces/github/flutter/flutter-examples/covid19_mobile_app/ios/Flutter/ephemeral/Packages/.packages/FlutterFramework
|
||||
COCOAPODS_PARALLEL_CODE_SIGN=true
|
||||
FLUTTER_TARGET=lib/main.dart
|
||||
FLUTTER_BUILD_DIR=build
|
||||
FLUTTER_BUILD_NAME=1.0.0
|
||||
FLUTTER_BUILD_NUMBER=1
|
||||
DART_OBFUSCATION=false
|
||||
TRACK_WIDGET_CREATION=true
|
||||
TREE_SHAKE_ICONS=false
|
||||
PACKAGE_CONFIG=.dart_tool/package_config.json
|
||||
@@ -10,7 +10,10 @@ class MyApp extends StatelessWidget {
|
||||
title: 'Covid-19',
|
||||
theme: ThemeData(
|
||||
primarySwatch: Colors.blue,
|
||||
accentColor: Color(0xfff4796b),
|
||||
colorScheme: ColorScheme.fromSwatch(
|
||||
primarySwatch: Colors.blue,
|
||||
brightness: Brightness.dark,
|
||||
).copyWith(secondary: Color(0xfff4796b)),
|
||||
brightness: Brightness.dark,
|
||||
),
|
||||
home: Home(),
|
||||
|
||||
@@ -6,10 +6,10 @@ import 'package:http/http.dart' as http;
|
||||
Future getAllData() async {
|
||||
try {
|
||||
var allCountriesUrl = 'https://corona.lmao.ninja/v2/all';
|
||||
var allCountriesResponse = await http.get(allCountriesUrl);
|
||||
var allCountriesResponse = await http.get(Uri.parse(allCountriesUrl));
|
||||
|
||||
var particularCountryUrl = 'https://corona.lmao.ninja/v2/historical/India';
|
||||
var particularCountryResponse = await http.get(particularCountryUrl);
|
||||
var particularCountryResponse = await http.get(Uri.parse(particularCountryUrl));
|
||||
|
||||
// a list to store the data points
|
||||
List<Map<String, dynamic>> dataPoints = [];
|
||||
@@ -48,7 +48,7 @@ Future getAllData() async {
|
||||
Future getAllCountriesData() async {
|
||||
try {
|
||||
var url = 'https://corona.lmao.ninja/v2/countries?sort=country';
|
||||
var response = await http.get(url);
|
||||
var response = await http.get(Uri.parse(url));
|
||||
return response.body;
|
||||
} catch (e) {
|
||||
print(e);
|
||||
|
||||
@@ -10,7 +10,7 @@ import 'package:folding_cell/folding_cell.dart';
|
||||
class CountryList extends StatelessWidget {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
List<dynamic> results;
|
||||
List<dynamic> results = [];
|
||||
return Scaffold(
|
||||
drawer: DrawerWidget(),
|
||||
appBar: AppBar(
|
||||
@@ -48,14 +48,15 @@ class CountryList extends StatelessWidget {
|
||||
return Container(
|
||||
color: Color(0xFF2e282a),
|
||||
alignment: Alignment.topCenter,
|
||||
child: SimpleFoldingCell(
|
||||
child: SimpleFoldingCell.create(
|
||||
key: _foldingCellKey,
|
||||
frontWidget: Builder(
|
||||
builder: (BuildContext context) {
|
||||
return GestureDetector(
|
||||
onTap: () {
|
||||
SimpleFoldingCellState foldingCellState =
|
||||
context.findAncestorStateOfType();
|
||||
SimpleFoldingCellState? foldingCellState =
|
||||
context.findAncestorStateOfType<
|
||||
SimpleFoldingCellState>();
|
||||
foldingCellState?.toggleFold();
|
||||
},
|
||||
child: Container(
|
||||
@@ -68,7 +69,9 @@ class CountryList extends StatelessWidget {
|
||||
);
|
||||
},
|
||||
),
|
||||
innerTopWidget: buildInnerTopWidget(
|
||||
innerWidget: Column(
|
||||
children: [
|
||||
buildInnerTopWidget(
|
||||
results[index]['country'],
|
||||
results[index]['todayCases'].toString(),
|
||||
results[index]['deaths'].toString(),
|
||||
@@ -77,8 +80,10 @@ class CountryList extends StatelessWidget {
|
||||
results[index]['critical'].toString(),
|
||||
results[index]['casesPerOneMillion'].toString(),
|
||||
),
|
||||
innerBottomWidget: buildInnerBottomWidget(
|
||||
buildInnerBottomWidget(
|
||||
results[index]['cases'].toString()),
|
||||
],
|
||||
),
|
||||
cellSize: Size(MediaQuery.of(context).size.width, 125),
|
||||
padding: EdgeInsets.all(15),
|
||||
animationDuration: Duration(milliseconds: 300),
|
||||
|
||||
@@ -50,14 +50,14 @@ class CountrySearchDelegate extends SearchDelegate {
|
||||
return Container(
|
||||
color: Color(0xFF2e282a),
|
||||
alignment: Alignment.topCenter,
|
||||
child: SimpleFoldingCell(
|
||||
child: SimpleFoldingCell.create(
|
||||
key: _foldingCellKey,
|
||||
frontWidget: Builder(
|
||||
builder: (BuildContext context) {
|
||||
return GestureDetector(
|
||||
onTap: () {
|
||||
SimpleFoldingCellState foldingCellState =
|
||||
context.findAncestorStateOfType();
|
||||
SimpleFoldingCellState? foldingCellState =
|
||||
context.findAncestorStateOfType<SimpleFoldingCellState>();
|
||||
foldingCellState?.toggleFold();
|
||||
},
|
||||
child: Container(
|
||||
@@ -70,7 +70,9 @@ class CountrySearchDelegate extends SearchDelegate {
|
||||
);
|
||||
},
|
||||
),
|
||||
innerTopWidget: buildInnerTopWidget(
|
||||
innerWidget: Column(
|
||||
children: [
|
||||
buildInnerTopWidget(
|
||||
suggestionsList[index]['country'],
|
||||
suggestionsList[index]['todayCases'].toString(),
|
||||
suggestionsList[index]['deaths'].toString(),
|
||||
@@ -79,8 +81,10 @@ class CountrySearchDelegate extends SearchDelegate {
|
||||
suggestionsList[index]['critical'].toString(),
|
||||
suggestionsList[index]['casesPerOneMillion'].toString(),
|
||||
),
|
||||
innerBottomWidget: buildInnerBottomWidget(
|
||||
buildInnerBottomWidget(
|
||||
suggestionsList[index]['cases'].toString()),
|
||||
],
|
||||
),
|
||||
cellSize: Size(MediaQuery.of(context).size.width, 125),
|
||||
padding: EdgeInsets.all(15),
|
||||
animationDuration: Duration(milliseconds: 300),
|
||||
@@ -122,14 +126,14 @@ class CountrySearchDelegate extends SearchDelegate {
|
||||
return Container(
|
||||
color: Color(0xFF2e282a),
|
||||
alignment: Alignment.topCenter,
|
||||
child: SimpleFoldingCell(
|
||||
child: SimpleFoldingCell.create(
|
||||
key: _foldingCellKey,
|
||||
frontWidget: Builder(
|
||||
builder: (BuildContext context) {
|
||||
return GestureDetector(
|
||||
onTap: () {
|
||||
SimpleFoldingCellState foldingCellState =
|
||||
context.findAncestorStateOfType();
|
||||
SimpleFoldingCellState? foldingCellState =
|
||||
context.findAncestorStateOfType<SimpleFoldingCellState>();
|
||||
foldingCellState?.toggleFold();
|
||||
},
|
||||
child: Container(
|
||||
@@ -142,7 +146,9 @@ class CountrySearchDelegate extends SearchDelegate {
|
||||
);
|
||||
},
|
||||
),
|
||||
innerTopWidget: buildInnerTopWidget(
|
||||
innerWidget: Column(
|
||||
children: [
|
||||
buildInnerTopWidget(
|
||||
suggestionsList[index]['country'],
|
||||
suggestionsList[index]['todayCases'].toString(),
|
||||
suggestionsList[index]['deaths'].toString(),
|
||||
@@ -151,8 +157,10 @@ class CountrySearchDelegate extends SearchDelegate {
|
||||
suggestionsList[index]['critical'].toString(),
|
||||
suggestionsList[index]['casesPerOneMillion'].toString(),
|
||||
),
|
||||
innerBottomWidget: buildInnerBottomWidget(
|
||||
buildInnerBottomWidget(
|
||||
suggestionsList[index]['cases'].toString()),
|
||||
],
|
||||
),
|
||||
cellSize: Size(MediaQuery.of(context).size.width, 125),
|
||||
padding: EdgeInsets.all(15),
|
||||
animationDuration: Duration(milliseconds: 300),
|
||||
|
||||
@@ -123,18 +123,20 @@ Widget buildInnerBottomWidget(String cases) {
|
||||
fontSize: 20.0,
|
||||
),
|
||||
)),
|
||||
FlatButton(
|
||||
TextButton(
|
||||
onPressed: () {
|
||||
SimpleFoldingCellState foldingCellState =
|
||||
context.findAncestorStateOfType();
|
||||
SimpleFoldingCellState? foldingCellState =
|
||||
context.findAncestorStateOfType<SimpleFoldingCellState>();
|
||||
foldingCellState?.toggleFold();
|
||||
},
|
||||
child: Text(
|
||||
"Close",
|
||||
),
|
||||
color: Colors.black,
|
||||
style: TextButton.styleFrom(
|
||||
foregroundColor: Colors.black,
|
||||
shape: StadiumBorder(),
|
||||
splashColor: Colors.white.withOpacity(0.5),
|
||||
overlayColor: Colors.white.withOpacity(0.5),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
|
||||
@@ -1,22 +1,14 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:bezier_chart/bezier_chart.dart';
|
||||
import 'package:fl_chart/fl_chart.dart';
|
||||
|
||||
// Widget that will build the graph
|
||||
Widget buildGraph(
|
||||
BuildContext context, List<Map<String, dynamic>> datesAndValues) {
|
||||
// Data is avalaible from a particular date and we are getting that here
|
||||
final fromDate = datesAndValues[0]['date'];
|
||||
|
||||
// Data is avalaible until a particular date and we are getting that here
|
||||
final toDate = datesAndValues.last['date'];
|
||||
|
||||
// Add dates and values corresponding to those dates
|
||||
// in a list
|
||||
List<DataPoint<DateTime>> dataPoints = [];
|
||||
for (final dateAndValue in datesAndValues) {
|
||||
dataPoints.add(DataPoint<DateTime>(
|
||||
value: double.parse(dateAndValue['value'].toString()),
|
||||
xAxis: dateAndValue['date']));
|
||||
// Convert the dates and values into chart points.
|
||||
final spots = <FlSpot>[];
|
||||
for (var i = 0; i < datesAndValues.length; i++) {
|
||||
final value = double.parse(datesAndValues[i]['value'].toString());
|
||||
spots.add(FlSpot(i.toDouble(), value));
|
||||
}
|
||||
|
||||
return Center(
|
||||
@@ -26,24 +18,22 @@ Widget buildGraph(
|
||||
),
|
||||
height: MediaQuery.of(context).size.height / 2,
|
||||
width: MediaQuery.of(context).size.width,
|
||||
child: BezierChart(
|
||||
fromDate: fromDate,
|
||||
bezierChartScale: BezierChartScale.WEEKLY,
|
||||
toDate: toDate,
|
||||
selectedDate: toDate,
|
||||
series: [
|
||||
BezierLine(
|
||||
data: dataPoints,
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(16.0),
|
||||
child: LineChart(
|
||||
LineChartData(
|
||||
gridData: FlGridData(show: true),
|
||||
titlesData: FlTitlesData(show: true),
|
||||
borderData: FlBorderData(show: true),
|
||||
lineBarsData: [
|
||||
LineChartBarData(
|
||||
spots: spots,
|
||||
isCurved: true,
|
||||
color: Colors.white,
|
||||
belowBarData: BarAreaData(show: false),
|
||||
),
|
||||
],
|
||||
config: BezierChartConfig(
|
||||
physics: BouncingScrollPhysics(),
|
||||
verticalIndicatorStrokeWidth: 3.0,
|
||||
verticalIndicatorColor: Colors.black26,
|
||||
showVerticalIndicator: true,
|
||||
verticalIndicatorFixedPosition: false,
|
||||
backgroundColor: Colors.transparent,
|
||||
footerHeight: 30.0,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
|
||||
@@ -18,19 +18,19 @@ publish_to: 'none' # Remove this line if you wish to publish to pub.dev
|
||||
version: 1.0.0+1
|
||||
|
||||
environment:
|
||||
sdk: ">=2.12.0 <3.0.0"
|
||||
sdk: ">=3.0.0 <4.0.0"
|
||||
|
||||
dependencies:
|
||||
flutter:
|
||||
sdk: flutter
|
||||
number_display: ^2.2.1
|
||||
http: ^0.13.3
|
||||
bezier_chart: ^1.0.16
|
||||
folding_cell: ^0.1.2
|
||||
number_display: ^3.0.0
|
||||
http: ^1.6.0
|
||||
fl_chart: ^1.2.0
|
||||
folding_cell: ^1.0.2
|
||||
|
||||
# The following adds the Cupertino Icons font to your application.
|
||||
# Use with the CupertinoIcons class for iOS style icons.
|
||||
cupertino_icons: ^1.0.0
|
||||
cupertino_icons: ^1.0.9
|
||||
|
||||
dev_dependencies:
|
||||
flutter_test:
|
||||
|
||||
@@ -7,6 +7,15 @@
|
||||
|
||||
# The following line activates a set of recommended lints for Flutter apps,
|
||||
# packages, and plugins designed to encourage good coding practices.
|
||||
analyzer:
|
||||
exclude:
|
||||
- build/**
|
||||
- android/**
|
||||
- ios/**
|
||||
- web/**
|
||||
- windows/**
|
||||
- macos/**
|
||||
- linux/**
|
||||
include: package:flutter_lints/flutter.yaml
|
||||
|
||||
linter:
|
||||
|
||||
@@ -1,71 +0,0 @@
|
||||
def localProperties = new Properties()
|
||||
def localPropertiesFile = rootProject.file('local.properties')
|
||||
if (localPropertiesFile.exists()) {
|
||||
localPropertiesFile.withReader('UTF-8') { reader ->
|
||||
localProperties.load(reader)
|
||||
}
|
||||
}
|
||||
|
||||
def flutterRoot = localProperties.getProperty('flutter.sdk')
|
||||
if (flutterRoot == null) {
|
||||
throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.")
|
||||
}
|
||||
|
||||
def flutterVersionCode = localProperties.getProperty('flutter.versionCode')
|
||||
if (flutterVersionCode == null) {
|
||||
flutterVersionCode = '1'
|
||||
}
|
||||
|
||||
def flutterVersionName = localProperties.getProperty('flutter.versionName')
|
||||
if (flutterVersionName == null) {
|
||||
flutterVersionName = '1.0'
|
||||
}
|
||||
|
||||
apply plugin: 'com.android.application'
|
||||
apply plugin: 'kotlin-android'
|
||||
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
|
||||
|
||||
android {
|
||||
compileSdkVersion flutter.compileSdkVersion
|
||||
ndkVersion flutter.ndkVersion
|
||||
|
||||
compileOptions {
|
||||
sourceCompatibility JavaVersion.VERSION_1_8
|
||||
targetCompatibility JavaVersion.VERSION_1_8
|
||||
}
|
||||
|
||||
kotlinOptions {
|
||||
jvmTarget = '1.8'
|
||||
}
|
||||
|
||||
sourceSets {
|
||||
main.java.srcDirs += 'src/main/kotlin'
|
||||
}
|
||||
|
||||
defaultConfig {
|
||||
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
|
||||
applicationId "github.nisrulz.custom_home_drawer"
|
||||
// You can update the following values to match your application needs.
|
||||
// For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-build-configuration.
|
||||
minSdkVersion flutter.minSdkVersion
|
||||
targetSdkVersion flutter.targetSdkVersion
|
||||
versionCode flutterVersionCode.toInteger()
|
||||
versionName flutterVersionName
|
||||
}
|
||||
|
||||
buildTypes {
|
||||
release {
|
||||
// TODO: Add your own signing config for the release build.
|
||||
// Signing with the debug keys for now, so `flutter run --release` works.
|
||||
signingConfig signingConfigs.debug
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
flutter {
|
||||
source '../..'
|
||||
}
|
||||
|
||||
dependencies {
|
||||
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
|
||||
}
|
||||
42
custom_home_drawer/android/app/build.gradle.kts
Normal file
42
custom_home_drawer/android/app/build.gradle.kts
Normal file
@@ -0,0 +1,42 @@
|
||||
plugins {
|
||||
id("com.android.application")
|
||||
id("org.jetbrains.kotlin.android")
|
||||
// The Flutter Gradle Plugin must be applied after the Android and Kotlin Gradle plugins.
|
||||
id("dev.flutter.flutter-gradle-plugin")
|
||||
}
|
||||
|
||||
android {
|
||||
namespace = "github.nisrulz.custom_home_drawer"
|
||||
compileSdk = flutter.compileSdkVersion
|
||||
ndkVersion = flutter.ndkVersion
|
||||
|
||||
compileOptions {
|
||||
sourceCompatibility = JavaVersion.VERSION_17
|
||||
targetCompatibility = JavaVersion.VERSION_17
|
||||
}
|
||||
|
||||
defaultConfig {
|
||||
applicationId = "github.nisrulz.custom_home_drawer"
|
||||
minSdk = flutter.minSdkVersion
|
||||
targetSdk = flutter.targetSdkVersion
|
||||
versionCode = flutter.versionCode
|
||||
versionName = flutter.versionName
|
||||
}
|
||||
|
||||
buildTypes {
|
||||
release {
|
||||
signingConfig = signingConfigs.getByName("debug")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
kotlin {
|
||||
compilerOptions {
|
||||
jvmTarget = org.jetbrains.kotlin.gradle.dsl.JvmTarget.JVM_17
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
flutter {
|
||||
source = "../.."
|
||||
}
|
||||
@@ -1,5 +1,5 @@
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
package="github.nisrulz.custom_home_drawer">
|
||||
>
|
||||
<application
|
||||
android:label="custom_home_drawer"
|
||||
android:name="${applicationName}"
|
||||
|
||||
@@ -1,31 +0,0 @@
|
||||
buildscript {
|
||||
ext.kotlin_version = '1.6.10'
|
||||
repositories {
|
||||
google()
|
||||
mavenCentral()
|
||||
}
|
||||
|
||||
dependencies {
|
||||
classpath 'com.android.tools.build:gradle:7.1.2'
|
||||
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
|
||||
}
|
||||
}
|
||||
|
||||
allprojects {
|
||||
repositories {
|
||||
google()
|
||||
mavenCentral()
|
||||
}
|
||||
}
|
||||
|
||||
rootProject.buildDir = '../build'
|
||||
subprojects {
|
||||
project.buildDir = "${rootProject.buildDir}/${project.name}"
|
||||
}
|
||||
subprojects {
|
||||
project.evaluationDependsOn(':app')
|
||||
}
|
||||
|
||||
task clean(type: Delete) {
|
||||
delete rootProject.buildDir
|
||||
}
|
||||
24
custom_home_drawer/android/build.gradle.kts
Normal file
24
custom_home_drawer/android/build.gradle.kts
Normal file
@@ -0,0 +1,24 @@
|
||||
allprojects {
|
||||
repositories {
|
||||
google()
|
||||
mavenCentral()
|
||||
}
|
||||
}
|
||||
|
||||
val newBuildDir: Directory =
|
||||
rootProject.layout.buildDirectory
|
||||
.dir("../../build")
|
||||
.get()
|
||||
rootProject.layout.buildDirectory.value(newBuildDir)
|
||||
|
||||
subprojects {
|
||||
val newSubprojectBuildDir: Directory = newBuildDir.dir(project.name)
|
||||
project.layout.buildDirectory.value(newSubprojectBuildDir)
|
||||
}
|
||||
subprojects {
|
||||
project.evaluationDependsOn(":app")
|
||||
}
|
||||
|
||||
tasks.register<Delete>("clean") {
|
||||
delete(rootProject.layout.buildDirectory)
|
||||
}
|
||||
@@ -1,3 +1,4 @@
|
||||
org.gradle.jvmargs=-Xmx1536M
|
||||
org.gradle.jvmargs=-Xmx8G -XX:MaxMetaspaceSize=4G -XX:ReservedCodeCacheSize=512m -XX:+HeapDumpOnOutOfMemoryError
|
||||
android.useAndroidX=true
|
||||
android.enableJetifier=true
|
||||
android.newDsl=false
|
||||
android.builtInKotlin=false
|
||||
|
||||
@@ -1,7 +1,9 @@
|
||||
distributionBase=GRADLE_USER_HOME
|
||||
distributionPath=wrapper/dists
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.4-bin.zip
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-9.7.0-bin.zip
|
||||
networkTimeout=10000
|
||||
retries=0
|
||||
retryBackOffMs=500
|
||||
validateDistributionUrl=true
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
zipStorePath=wrapper/dists
|
||||
|
||||
@@ -1,11 +0,0 @@
|
||||
include ':app'
|
||||
|
||||
def localPropertiesFile = new File(rootProject.projectDir, "local.properties")
|
||||
def properties = new Properties()
|
||||
|
||||
assert localPropertiesFile.exists()
|
||||
localPropertiesFile.withReader("UTF-8") { reader -> properties.load(reader) }
|
||||
|
||||
def flutterSdkPath = properties.getProperty("flutter.sdk")
|
||||
assert flutterSdkPath != null, "flutter.sdk not set in local.properties"
|
||||
apply from: "$flutterSdkPath/packages/flutter_tools/gradle/app_plugin_loader.gradle"
|
||||
26
custom_home_drawer/android/settings.gradle.kts
Normal file
26
custom_home_drawer/android/settings.gradle.kts
Normal file
@@ -0,0 +1,26 @@
|
||||
pluginManagement {
|
||||
val flutterSdkPath =
|
||||
run {
|
||||
val properties = java.util.Properties()
|
||||
file("local.properties").inputStream().use { properties.load(it) }
|
||||
val flutterSdkPath = properties.getProperty("flutter.sdk")
|
||||
require(flutterSdkPath != null) { "flutter.sdk not set in local.properties" }
|
||||
flutterSdkPath
|
||||
}
|
||||
|
||||
includeBuild("$flutterSdkPath/packages/flutter_tools/gradle")
|
||||
|
||||
repositories {
|
||||
google()
|
||||
mavenCentral()
|
||||
gradlePluginPortal()
|
||||
}
|
||||
}
|
||||
|
||||
plugins {
|
||||
id("dev.flutter.flutter-plugin-loader") version "1.0.0"
|
||||
id("com.android.application") version "9.1.0" apply false
|
||||
id("org.jetbrains.kotlin.android") version "2.2.20" apply false
|
||||
}
|
||||
|
||||
include(":app")
|
||||
@@ -96,7 +96,7 @@ class _HomeScreenState extends State<HomeScreen> with SingleTickerProviderStateM
|
||||
),
|
||||
Text(
|
||||
'$_counter',
|
||||
style: Theme.of(context).textTheme.headline4,
|
||||
style: Theme.of(context).textTheme.headlineSmall,
|
||||
),
|
||||
],
|
||||
),
|
||||
|
||||
@@ -35,7 +35,7 @@ dependencies:
|
||||
|
||||
# The following adds the Cupertino Icons font to your application.
|
||||
# Use with the CupertinoIcons class for iOS style icons.
|
||||
cupertino_icons: ^1.0.2
|
||||
cupertino_icons: ^1.0.9
|
||||
|
||||
dev_dependencies:
|
||||
flutter_test:
|
||||
@@ -46,7 +46,7 @@ dev_dependencies:
|
||||
# activated in the `analysis_options.yaml` file located at the root of your
|
||||
# package. See that file for information about deactivating specific lint
|
||||
# rules and activating additional ones.
|
||||
flutter_lints: ^2.0.0
|
||||
flutter_lints: ^6.0.0
|
||||
|
||||
# For information on the generic Dart part of this file, see the
|
||||
# following page: https://dart.dev/tools/pub/pubspec
|
||||
|
||||
@@ -1,33 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# Copyright 2018 Nishant Srivastava
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
# ______________________________________________________________________
|
||||
# Dependency: trash cli tool
|
||||
# >> Install: brew install trash
|
||||
#
|
||||
# Call as
|
||||
# ./delete_build_folder.sh
|
||||
# ______________________________________________________________________
|
||||
|
||||
echo " 🗑 Deleting build directories..."
|
||||
|
||||
# Find all directories with name "build" inside the current directory, recursively
|
||||
for FOUND_BUILD_DIR in $(find . -type d -name "build");
|
||||
do
|
||||
# Run the trash command on found build directory
|
||||
trash $FOUND_BUILD_DIR
|
||||
done
|
||||
|
||||
echo " ✔️ Done."
|
||||
13
documentation/CONTRIBUTING.md
Normal file
13
documentation/CONTRIBUTING.md
Normal file
@@ -0,0 +1,13 @@
|
||||
# Contributing
|
||||
|
||||
I welcome and encourage all pull requests. It usually takes 24-48 hours to respond to any issue or request.
|
||||
|
||||
## Basic rules
|
||||
|
||||
1. Match coding style (braces, spacing, etc.). Use the `Reformat Code` feature of Android Studio (`CMD` + `Option` + `L` on Mac, `CTRL` + `ALT` + `L` on Linux and Windows).
|
||||
1. For a feature or bugfix, only change the code that is needed for it.
|
||||
1. Keep pull request titles easy to read and descriptive. This makes them easier to merge.
|
||||
1. Pull requests must be made against the `develop` branch. Requests against any other branch will be rejected. [Here is a link to a good PR made to this repo.](https://github.com/nisrulz/flutter-examples/pull/130)
|
||||
1. Check for existing [issues](https://github.com/nisrulz/flutter-examples/issues) before filing a new one.
|
||||
1. Follow the same standard as all other projects in this repo.
|
||||
> The package name must conform to the format: `github.nisrulz.<app_name>`
|
||||
51
documentation/EXAMPLES.md
Normal file
51
documentation/EXAMPLES.md
Normal file
@@ -0,0 +1,51 @@
|
||||
# Example Apps
|
||||
|
||||
Each folder in this repository is a standalone Flutter example app.
|
||||
|
||||
## Individual examples
|
||||
|
||||
1. [Custom Drawer](/custom_home_drawer)
|
||||
1. [DropDown Button](/dropdown_button)
|
||||
1. [Enable Splash Screen](/enabling_splash_screen)
|
||||
1. [Firebase Analytics Integration](/analytics_integration)
|
||||
1. [Firebase Crashlytics Integration](/firebase_crash_reporting)
|
||||
1. [Google Signin](/google_signin)
|
||||
1. [Grid Layout](/grid_layout)
|
||||
1. [Image Editor](/image_editor)
|
||||
1. [Image from Network](/image_from_network)
|
||||
1. [Infinite List](/infinite_list)
|
||||
1. [Load local image](/load_local_image)
|
||||
1. [Load local json](/load_local_json)
|
||||
1. [Navigation Drawer](/navigation_drawer)
|
||||
1. [Persist Key Value](/persist_key_value)
|
||||
1. [Push Notifications](/push_notifications)
|
||||
1. [Simple Material App](/simple_material_app)
|
||||
1. [Sliver App Bar](/sliver_app_bar_example)
|
||||
1. [Stateful Widget](/stateful_widget)
|
||||
1. [Stateless counter app](/statless_counter_app)
|
||||
1. [Stateless Widgets](/stateless_widgets)
|
||||
1. [Todo list using Provider](/todo_list_using_provider)
|
||||
1. [Unit Testing](/unit_testing)
|
||||
1. [Using Alert Dialog](/using_alert_dialog)
|
||||
1. [Using Bottom Navigation Bar](/using_bottom_nav_bar)
|
||||
1. [Using Bottom Sheet](/bottom_sheet)
|
||||
1. [Using Custom Fonts](/using_custom_fonts)
|
||||
1. [Using EditText](/using_edittext)
|
||||
1. [Using Gradient](/using_gradient)
|
||||
1. [Using HTTP GET](/using_http_get)
|
||||
1. [Using InteractiveViewer](/using_interactiveviewer)
|
||||
1. [Using Listview](/using_listview)
|
||||
1. [Using ListwheelScrollView](/using_listwheelscrollview)
|
||||
1. [Using SnackBar](/using_snackbar)
|
||||
1. [Using Stepper](/using_stepper)
|
||||
1. [Using Tabs](/using_tabs)
|
||||
1. [Using Theme](/using_theme)
|
||||
1. [View PDF File](/view_pdf_file)
|
||||
|
||||
## Complete apps with multiple features
|
||||
|
||||
1. [Covid-19 App](/covid19_mobile_app)
|
||||
1. [BMI Calculator](/bmi_calculator)
|
||||
1. [Expense Planner](/expense_planner)
|
||||
1. [Notes App](/using_firebase_db)
|
||||
1. [Tip Calculator](/tip_calculator)
|
||||
55
documentation/GETTING_STARTED.md
Normal file
55
documentation/GETTING_STARTED.md
Normal file
@@ -0,0 +1,55 @@
|
||||
# Getting Started
|
||||
|
||||
## Prerequisites
|
||||
|
||||
Install Flutter. See the [official setup guide](https://flutter.dev/setup/).
|
||||
|
||||
You also need an editor. See the [Flutter docs](https://flutter.dev/docs/get-started/editor) for setup.
|
||||
|
||||
## Run an example app
|
||||
|
||||
Clone this repository and install packages:
|
||||
|
||||
```bash
|
||||
git clone https://github.com/nisrulz/flutter-examples.git
|
||||
cd flutter-examples
|
||||
make packages
|
||||
```
|
||||
|
||||
Open any example folder in your editor, then run the app on a device or emulator:
|
||||
|
||||
```bash
|
||||
cd <example-folder>
|
||||
flutter run
|
||||
```
|
||||
|
||||
For example:
|
||||
|
||||
```bash
|
||||
cd simple_material_app
|
||||
flutter run
|
||||
```
|
||||
|
||||
## Useful links
|
||||
|
||||
- [Flutter Widgets Catalog](https://flutter.dev/widgets/)
|
||||
- [Learn Dart](https://dart.dev/guides)
|
||||
|
||||
## Download a single example
|
||||
|
||||
The repository is large. If you only want one example, use `svn`:
|
||||
|
||||
1. Install `svn` (macOS / Linux):
|
||||
```bash
|
||||
brew install svn
|
||||
```
|
||||
2. Replace `example_folder` in the command below with the example folder name:
|
||||
```bash
|
||||
svn checkout https://github.com/nisrulz/flutter-examples/trunk/example_folder
|
||||
```
|
||||
3. Example:
|
||||
```bash
|
||||
svn checkout https://github.com/nisrulz/flutter-examples/trunk/simple_material_app
|
||||
```
|
||||
|
||||
That's it. You now have the single example checked out.
|
||||
35
documentation/MAINTENANCE.md
Normal file
35
documentation/MAINTENANCE.md
Normal file
@@ -0,0 +1,35 @@
|
||||
# Repository Maintenance
|
||||
|
||||
All maintenance commands are available through the `Makefile` at the repository root. Run `make help` to see the full list.
|
||||
|
||||
## Available commands
|
||||
|
||||
| Command | Description |
|
||||
| --- | --- |
|
||||
| `make help` | Show all available commands |
|
||||
| `make packages` | Run `flutter packages get` for all example apps |
|
||||
| `make clean-builds` | Move all build folders to trash |
|
||||
| `make gradle-update` | Upgrade Gradle wrappers to the latest version |
|
||||
|
||||
## Update Gradle wrappers
|
||||
|
||||
`make gradle-update` upgrades the Gradle wrapper of every example app.
|
||||
|
||||
| Option | Description |
|
||||
| --- | --- |
|
||||
| `VERSION=<x.y.z>` | Target a specific Gradle version. Default: latest from GitHub |
|
||||
| `FORCE=1` | Upgrade even when the app is already on the target version |
|
||||
|
||||
Examples:
|
||||
|
||||
```bash
|
||||
make gradle-update # latest version
|
||||
make gradle-update VERSION=9.7.0 # specific version
|
||||
make gradle-update FORCE=1 # latest version, force update
|
||||
make gradle-update VERSION=9.7.0 FORCE=1 # specific version, force update
|
||||
```
|
||||
|
||||
## Requirements
|
||||
|
||||
- `make` (preinstalled on macOS and most Linux systems)
|
||||
- `trash` (required by `make clean-builds`): `brew install trash`
|
||||
@@ -3,138 +3,164 @@
|
||||
"packages": [
|
||||
{
|
||||
"name": "async",
|
||||
"rootUri": "file:///usr/local/Caskroom/flutter/2.8.1/flutter/.pub-cache/hosted/pub.dartlang.org/async-2.9.0",
|
||||
"rootUri": "file:///Users/nishantsrivastava/.pub-cache/hosted/pub.dev/async-2.13.1",
|
||||
"packageUri": "lib/",
|
||||
"languageVersion": "2.14"
|
||||
"languageVersion": "3.4"
|
||||
},
|
||||
{
|
||||
"name": "boolean_selector",
|
||||
"rootUri": "file:///usr/local/Caskroom/flutter/2.8.1/flutter/.pub-cache/hosted/pub.dartlang.org/boolean_selector-2.1.0",
|
||||
"rootUri": "file:///Users/nishantsrivastava/.pub-cache/hosted/pub.dev/boolean_selector-2.1.2",
|
||||
"packageUri": "lib/",
|
||||
"languageVersion": "2.12"
|
||||
"languageVersion": "3.1"
|
||||
},
|
||||
{
|
||||
"name": "characters",
|
||||
"rootUri": "file:///usr/local/Caskroom/flutter/2.8.1/flutter/.pub-cache/hosted/pub.dartlang.org/characters-1.2.1",
|
||||
"rootUri": "file:///Users/nishantsrivastava/.pub-cache/hosted/pub.dev/characters-1.4.1",
|
||||
"packageUri": "lib/",
|
||||
"languageVersion": "2.12"
|
||||
"languageVersion": "3.4"
|
||||
},
|
||||
{
|
||||
"name": "clock",
|
||||
"rootUri": "file:///usr/local/Caskroom/flutter/2.8.1/flutter/.pub-cache/hosted/pub.dartlang.org/clock-1.1.1",
|
||||
"rootUri": "file:///Users/nishantsrivastava/.pub-cache/hosted/pub.dev/clock-1.1.2",
|
||||
"packageUri": "lib/",
|
||||
"languageVersion": "2.12"
|
||||
"languageVersion": "3.4"
|
||||
},
|
||||
{
|
||||
"name": "collection",
|
||||
"rootUri": "file:///usr/local/Caskroom/flutter/2.8.1/flutter/.pub-cache/hosted/pub.dartlang.org/collection-1.16.0",
|
||||
"rootUri": "file:///Users/nishantsrivastava/.pub-cache/hosted/pub.dev/collection-1.19.1",
|
||||
"packageUri": "lib/",
|
||||
"languageVersion": "2.12"
|
||||
"languageVersion": "3.4"
|
||||
},
|
||||
{
|
||||
"name": "cupertino_icons",
|
||||
"rootUri": "file:///usr/local/Caskroom/flutter/2.8.1/flutter/.pub-cache/hosted/pub.dartlang.org/cupertino_icons-0.1.3",
|
||||
"rootUri": "file:///Users/nishantsrivastava/.pub-cache/hosted/pub.dev/cupertino_icons-1.0.9",
|
||||
"packageUri": "lib/",
|
||||
"languageVersion": "2.0"
|
||||
"languageVersion": "3.9"
|
||||
},
|
||||
{
|
||||
"name": "fake_async",
|
||||
"rootUri": "file:///usr/local/Caskroom/flutter/2.8.1/flutter/.pub-cache/hosted/pub.dartlang.org/fake_async-1.3.1",
|
||||
"rootUri": "file:///Users/nishantsrivastava/.pub-cache/hosted/pub.dev/fake_async-1.3.3",
|
||||
"packageUri": "lib/",
|
||||
"languageVersion": "2.12"
|
||||
"languageVersion": "3.3"
|
||||
},
|
||||
{
|
||||
"name": "flutter",
|
||||
"rootUri": "file:///usr/local/Caskroom/flutter/2.8.1/flutter/packages/flutter",
|
||||
"rootUri": "file:///opt/homebrew/share/flutter/packages/flutter",
|
||||
"packageUri": "lib/",
|
||||
"languageVersion": "2.17"
|
||||
"languageVersion": "3.11"
|
||||
},
|
||||
{
|
||||
"name": "flutter_test",
|
||||
"rootUri": "file:///usr/local/Caskroom/flutter/2.8.1/flutter/packages/flutter_test",
|
||||
"rootUri": "file:///opt/homebrew/share/flutter/packages/flutter_test",
|
||||
"packageUri": "lib/",
|
||||
"languageVersion": "2.17"
|
||||
"languageVersion": "3.11"
|
||||
},
|
||||
{
|
||||
"name": "leak_tracker",
|
||||
"rootUri": "file:///Users/nishantsrivastava/.pub-cache/hosted/pub.dev/leak_tracker-11.0.2",
|
||||
"packageUri": "lib/",
|
||||
"languageVersion": "3.2"
|
||||
},
|
||||
{
|
||||
"name": "leak_tracker_flutter_testing",
|
||||
"rootUri": "file:///Users/nishantsrivastava/.pub-cache/hosted/pub.dev/leak_tracker_flutter_testing-3.0.10",
|
||||
"packageUri": "lib/",
|
||||
"languageVersion": "3.2"
|
||||
},
|
||||
{
|
||||
"name": "leak_tracker_testing",
|
||||
"rootUri": "file:///Users/nishantsrivastava/.pub-cache/hosted/pub.dev/leak_tracker_testing-3.0.2",
|
||||
"packageUri": "lib/",
|
||||
"languageVersion": "3.2"
|
||||
},
|
||||
{
|
||||
"name": "matcher",
|
||||
"rootUri": "file:///usr/local/Caskroom/flutter/2.8.1/flutter/.pub-cache/hosted/pub.dartlang.org/matcher-0.12.12",
|
||||
"rootUri": "file:///Users/nishantsrivastava/.pub-cache/hosted/pub.dev/matcher-0.12.20",
|
||||
"packageUri": "lib/",
|
||||
"languageVersion": "2.12"
|
||||
"languageVersion": "3.10"
|
||||
},
|
||||
{
|
||||
"name": "material_color_utilities",
|
||||
"rootUri": "file:///usr/local/Caskroom/flutter/2.8.1/flutter/.pub-cache/hosted/pub.dartlang.org/material_color_utilities-0.1.5",
|
||||
"rootUri": "file:///Users/nishantsrivastava/.pub-cache/hosted/pub.dev/material_color_utilities-0.13.0",
|
||||
"packageUri": "lib/",
|
||||
"languageVersion": "2.13"
|
||||
"languageVersion": "3.5"
|
||||
},
|
||||
{
|
||||
"name": "meta",
|
||||
"rootUri": "file:///usr/local/Caskroom/flutter/2.8.1/flutter/.pub-cache/hosted/pub.dartlang.org/meta-1.8.0",
|
||||
"rootUri": "file:///Users/nishantsrivastava/.pub-cache/hosted/pub.dev/meta-1.19.0",
|
||||
"packageUri": "lib/",
|
||||
"languageVersion": "2.12"
|
||||
"languageVersion": "3.5"
|
||||
},
|
||||
{
|
||||
"name": "path",
|
||||
"rootUri": "file:///usr/local/Caskroom/flutter/2.8.1/flutter/.pub-cache/hosted/pub.dartlang.org/path-1.8.2",
|
||||
"rootUri": "file:///Users/nishantsrivastava/.pub-cache/hosted/pub.dev/path-1.9.1",
|
||||
"packageUri": "lib/",
|
||||
"languageVersion": "2.12"
|
||||
"languageVersion": "3.4"
|
||||
},
|
||||
{
|
||||
"name": "sky_engine",
|
||||
"rootUri": "file:///usr/local/Caskroom/flutter/2.8.1/flutter/bin/cache/pkg/sky_engine",
|
||||
"rootUri": "file:///opt/homebrew/share/flutter/bin/cache/pkg/sky_engine",
|
||||
"packageUri": "lib/",
|
||||
"languageVersion": "2.12"
|
||||
"languageVersion": "3.11"
|
||||
},
|
||||
{
|
||||
"name": "source_span",
|
||||
"rootUri": "file:///usr/local/Caskroom/flutter/2.8.1/flutter/.pub-cache/hosted/pub.dartlang.org/source_span-1.9.0",
|
||||
"rootUri": "file:///Users/nishantsrivastava/.pub-cache/hosted/pub.dev/source_span-1.10.2",
|
||||
"packageUri": "lib/",
|
||||
"languageVersion": "2.14"
|
||||
"languageVersion": "3.1"
|
||||
},
|
||||
{
|
||||
"name": "stack_trace",
|
||||
"rootUri": "file:///usr/local/Caskroom/flutter/2.8.1/flutter/.pub-cache/hosted/pub.dartlang.org/stack_trace-1.10.0",
|
||||
"rootUri": "file:///Users/nishantsrivastava/.pub-cache/hosted/pub.dev/stack_trace-1.12.1",
|
||||
"packageUri": "lib/",
|
||||
"languageVersion": "2.12"
|
||||
"languageVersion": "3.4"
|
||||
},
|
||||
{
|
||||
"name": "stream_channel",
|
||||
"rootUri": "file:///usr/local/Caskroom/flutter/2.8.1/flutter/.pub-cache/hosted/pub.dartlang.org/stream_channel-2.1.0",
|
||||
"rootUri": "file:///Users/nishantsrivastava/.pub-cache/hosted/pub.dev/stream_channel-2.1.4",
|
||||
"packageUri": "lib/",
|
||||
"languageVersion": "2.12"
|
||||
"languageVersion": "3.3"
|
||||
},
|
||||
{
|
||||
"name": "string_scanner",
|
||||
"rootUri": "file:///usr/local/Caskroom/flutter/2.8.1/flutter/.pub-cache/hosted/pub.dartlang.org/string_scanner-1.1.1",
|
||||
"rootUri": "file:///Users/nishantsrivastava/.pub-cache/hosted/pub.dev/string_scanner-1.4.1",
|
||||
"packageUri": "lib/",
|
||||
"languageVersion": "2.12"
|
||||
"languageVersion": "3.1"
|
||||
},
|
||||
{
|
||||
"name": "term_glyph",
|
||||
"rootUri": "file:///usr/local/Caskroom/flutter/2.8.1/flutter/.pub-cache/hosted/pub.dartlang.org/term_glyph-1.2.1",
|
||||
"rootUri": "file:///Users/nishantsrivastava/.pub-cache/hosted/pub.dev/term_glyph-1.2.2",
|
||||
"packageUri": "lib/",
|
||||
"languageVersion": "2.12"
|
||||
"languageVersion": "3.1"
|
||||
},
|
||||
{
|
||||
"name": "test_api",
|
||||
"rootUri": "file:///usr/local/Caskroom/flutter/2.8.1/flutter/.pub-cache/hosted/pub.dartlang.org/test_api-0.4.12",
|
||||
"rootUri": "file:///Users/nishantsrivastava/.pub-cache/hosted/pub.dev/test_api-0.7.12",
|
||||
"packageUri": "lib/",
|
||||
"languageVersion": "2.12"
|
||||
"languageVersion": "3.10"
|
||||
},
|
||||
{
|
||||
"name": "vector_math",
|
||||
"rootUri": "file:///usr/local/Caskroom/flutter/2.8.1/flutter/.pub-cache/hosted/pub.dartlang.org/vector_math-2.1.2",
|
||||
"rootUri": "file:///Users/nishantsrivastava/.pub-cache/hosted/pub.dev/vector_math-2.4.2",
|
||||
"packageUri": "lib/",
|
||||
"languageVersion": "2.14"
|
||||
"languageVersion": "3.10"
|
||||
},
|
||||
{
|
||||
"name": "vm_service",
|
||||
"rootUri": "file:///Users/nishantsrivastava/.pub-cache/hosted/pub.dev/vm_service-15.2.0",
|
||||
"packageUri": "lib/",
|
||||
"languageVersion": "3.5"
|
||||
},
|
||||
{
|
||||
"name": "dropdown_button",
|
||||
"rootUri": "../",
|
||||
"packageUri": "lib/",
|
||||
"languageVersion": "2.10"
|
||||
"languageVersion": "3.0"
|
||||
}
|
||||
],
|
||||
"generated": "2022-10-22T19:11:19.381451Z",
|
||||
"generator": "pub",
|
||||
"generatorVersion": "2.18.2"
|
||||
"generatorVersion": "3.13.0",
|
||||
"flutterRoot": "file:///opt/homebrew/share/flutter",
|
||||
"flutterVersion": "3.47.0",
|
||||
"pubCache": "file:///Users/nishantsrivastava/.pub-cache"
|
||||
}
|
||||
|
||||
@@ -1 +1 @@
|
||||
3.3.5
|
||||
3.47.0
|
||||
@@ -1,140 +0,0 @@
|
||||
{
|
||||
"configVersion": 2,
|
||||
"packages": [
|
||||
{
|
||||
"name": "async",
|
||||
"rootUri": "file:///usr/local/Caskroom/flutter/2.8.1/flutter/.pub-cache/hosted/pub.dartlang.org/async-2.9.0",
|
||||
"packageUri": "lib/",
|
||||
"languageVersion": "2.14"
|
||||
},
|
||||
{
|
||||
"name": "boolean_selector",
|
||||
"rootUri": "file:///usr/local/Caskroom/flutter/2.8.1/flutter/.pub-cache/hosted/pub.dartlang.org/boolean_selector-2.1.0",
|
||||
"packageUri": "lib/",
|
||||
"languageVersion": "2.12"
|
||||
},
|
||||
{
|
||||
"name": "characters",
|
||||
"rootUri": "file:///usr/local/Caskroom/flutter/2.8.1/flutter/.pub-cache/hosted/pub.dartlang.org/characters-1.2.1",
|
||||
"packageUri": "lib/",
|
||||
"languageVersion": "2.12"
|
||||
},
|
||||
{
|
||||
"name": "clock",
|
||||
"rootUri": "file:///usr/local/Caskroom/flutter/2.8.1/flutter/.pub-cache/hosted/pub.dartlang.org/clock-1.1.1",
|
||||
"packageUri": "lib/",
|
||||
"languageVersion": "2.12"
|
||||
},
|
||||
{
|
||||
"name": "collection",
|
||||
"rootUri": "file:///usr/local/Caskroom/flutter/2.8.1/flutter/.pub-cache/hosted/pub.dartlang.org/collection-1.16.0",
|
||||
"packageUri": "lib/",
|
||||
"languageVersion": "2.12"
|
||||
},
|
||||
{
|
||||
"name": "cupertino_icons",
|
||||
"rootUri": "file:///usr/local/Caskroom/flutter/2.8.1/flutter/.pub-cache/hosted/pub.dartlang.org/cupertino_icons-0.1.3",
|
||||
"packageUri": "lib/",
|
||||
"languageVersion": "2.0"
|
||||
},
|
||||
{
|
||||
"name": "fake_async",
|
||||
"rootUri": "file:///usr/local/Caskroom/flutter/2.8.1/flutter/.pub-cache/hosted/pub.dartlang.org/fake_async-1.3.1",
|
||||
"packageUri": "lib/",
|
||||
"languageVersion": "2.12"
|
||||
},
|
||||
{
|
||||
"name": "flutter",
|
||||
"rootUri": "file:///usr/local/Caskroom/flutter/2.8.1/flutter/packages/flutter",
|
||||
"packageUri": "lib/",
|
||||
"languageVersion": "2.17"
|
||||
},
|
||||
{
|
||||
"name": "flutter_test",
|
||||
"rootUri": "file:///usr/local/Caskroom/flutter/2.8.1/flutter/packages/flutter_test",
|
||||
"packageUri": "lib/",
|
||||
"languageVersion": "2.17"
|
||||
},
|
||||
{
|
||||
"name": "matcher",
|
||||
"rootUri": "file:///usr/local/Caskroom/flutter/2.8.1/flutter/.pub-cache/hosted/pub.dartlang.org/matcher-0.12.12",
|
||||
"packageUri": "lib/",
|
||||
"languageVersion": "2.12"
|
||||
},
|
||||
{
|
||||
"name": "material_color_utilities",
|
||||
"rootUri": "file:///usr/local/Caskroom/flutter/2.8.1/flutter/.pub-cache/hosted/pub.dartlang.org/material_color_utilities-0.1.5",
|
||||
"packageUri": "lib/",
|
||||
"languageVersion": "2.13"
|
||||
},
|
||||
{
|
||||
"name": "meta",
|
||||
"rootUri": "file:///usr/local/Caskroom/flutter/2.8.1/flutter/.pub-cache/hosted/pub.dartlang.org/meta-1.8.0",
|
||||
"packageUri": "lib/",
|
||||
"languageVersion": "2.12"
|
||||
},
|
||||
{
|
||||
"name": "path",
|
||||
"rootUri": "file:///usr/local/Caskroom/flutter/2.8.1/flutter/.pub-cache/hosted/pub.dartlang.org/path-1.8.2",
|
||||
"packageUri": "lib/",
|
||||
"languageVersion": "2.12"
|
||||
},
|
||||
{
|
||||
"name": "sky_engine",
|
||||
"rootUri": "file:///usr/local/Caskroom/flutter/2.8.1/flutter/bin/cache/pkg/sky_engine",
|
||||
"packageUri": "lib/",
|
||||
"languageVersion": "2.12"
|
||||
},
|
||||
{
|
||||
"name": "source_span",
|
||||
"rootUri": "file:///usr/local/Caskroom/flutter/2.8.1/flutter/.pub-cache/hosted/pub.dartlang.org/source_span-1.9.0",
|
||||
"packageUri": "lib/",
|
||||
"languageVersion": "2.14"
|
||||
},
|
||||
{
|
||||
"name": "stack_trace",
|
||||
"rootUri": "file:///usr/local/Caskroom/flutter/2.8.1/flutter/.pub-cache/hosted/pub.dartlang.org/stack_trace-1.10.0",
|
||||
"packageUri": "lib/",
|
||||
"languageVersion": "2.12"
|
||||
},
|
||||
{
|
||||
"name": "stream_channel",
|
||||
"rootUri": "file:///usr/local/Caskroom/flutter/2.8.1/flutter/.pub-cache/hosted/pub.dartlang.org/stream_channel-2.1.0",
|
||||
"packageUri": "lib/",
|
||||
"languageVersion": "2.12"
|
||||
},
|
||||
{
|
||||
"name": "string_scanner",
|
||||
"rootUri": "file:///usr/local/Caskroom/flutter/2.8.1/flutter/.pub-cache/hosted/pub.dartlang.org/string_scanner-1.1.1",
|
||||
"packageUri": "lib/",
|
||||
"languageVersion": "2.12"
|
||||
},
|
||||
{
|
||||
"name": "term_glyph",
|
||||
"rootUri": "file:///usr/local/Caskroom/flutter/2.8.1/flutter/.pub-cache/hosted/pub.dartlang.org/term_glyph-1.2.1",
|
||||
"packageUri": "lib/",
|
||||
"languageVersion": "2.12"
|
||||
},
|
||||
{
|
||||
"name": "test_api",
|
||||
"rootUri": "file:///usr/local/Caskroom/flutter/2.8.1/flutter/.pub-cache/hosted/pub.dartlang.org/test_api-0.4.12",
|
||||
"packageUri": "lib/",
|
||||
"languageVersion": "2.12"
|
||||
},
|
||||
{
|
||||
"name": "vector_math",
|
||||
"rootUri": "file:///usr/local/Caskroom/flutter/2.8.1/flutter/.pub-cache/hosted/pub.dartlang.org/vector_math-2.1.2",
|
||||
"packageUri": "lib/",
|
||||
"languageVersion": "2.14"
|
||||
},
|
||||
{
|
||||
"name": "android",
|
||||
"rootUri": "../",
|
||||
"packageUri": "lib/",
|
||||
"languageVersion": "2.10"
|
||||
}
|
||||
],
|
||||
"generated": "2022-10-22T18:57:22.194540Z",
|
||||
"generator": "pub",
|
||||
"generatorVersion": "2.18.2"
|
||||
}
|
||||
10
dropdown_button/android/.gitignore
vendored
10
dropdown_button/android/.gitignore
vendored
@@ -1,10 +0,0 @@
|
||||
*.iml
|
||||
*.class
|
||||
.gradle
|
||||
/local.properties
|
||||
/.idea/workspace.xml
|
||||
/.idea/libraries
|
||||
.DS_Store
|
||||
/build
|
||||
/captures
|
||||
GeneratedPluginRegistrant.java
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user