From 5c53498119d73cf0b52d172a9dbfdf8a4355427c Mon Sep 17 00:00:00 2001 From: Nishant Srivastava Date: Mon, 17 Aug 2026 17:26:39 +0200 Subject: [PATCH] refactor: standardize Dart and Android config across all 54 apps - Bump all apps to sdk >=3.0.0 <4.0.0 and add flutter_lints + a shared analysis_options.yaml to every app (flutter analyze is now green repo-wide) - Fix real compile errors in firebase_google_authentication and image_editor, plus deprecated APIs (Matrix4, SvgPicture.color, textScaleFactor), missing async 'mounted' guards, and misc lints via dart fix + manual fixes - Align pubspec 'name' with each folder and Android namespace/applicationId with the documented github.nisrulz.* convention - Convert bmi_calculator from a legacy Flutter module to a standard app with a proper android/ scaffold; fix missing android:exported in launcher manifests across 22 apps so all Android builds pass - Untrack generated build files (GeneratedPluginRegistrant, .flutter-plugins-dependencies) and ignore them --- .gitignore | 5 + analytics_integration/analysis_options.yaml | 23 +++ .../android/app/src/main/AndroidManifest.xml | 1 + analytics_integration/lib/main.dart | 4 +- .../lib/single_item_tile.dart | 4 +- analytics_integration/pubspec.yaml | 1 + animation_example/analysis_options.yaml | 35 ++-- .../android/app/build.gradle.kts | 4 +- .../android/app/src/debug/AndroidManifest.xml | 3 +- .../android/app/src/main/AndroidManifest.xml | 1 + .../app/src/profile/AndroidManifest.xml | 3 +- animation_example/lib/home_page.dart | 37 ++--- animation_example/lib/main.dart | 2 +- animation_example/pubspec.yaml | 2 +- biometrics/analysis_options.yaml | 35 ++-- biometrics/android/app/build.gradle.kts | 4 +- .../android/app/src/debug/AndroidManifest.xml | 3 +- .../app/src/profile/AndroidManifest.xml | 3 +- biometrics/lib/main.dart | 5 + bmi_calculator/.metadata | 26 ++- bmi_calculator/analysis_options.yaml | 16 +- bmi_calculator/android/.gitignore | 14 ++ bmi_calculator/android/app/build.gradle.kts | 49 ++++++ .../android/app/src/debug/AndroidManifest.xml | 7 + .../android/app/src/main/AndroidManifest.xml | 45 ++++++ .../nisrulz/bmi_calculator/MainActivity.kt | 5 + .../res/drawable-v21/launch_background.xml | 12 ++ .../main/res/drawable/launch_background.xml | 12 ++ .../src/main/res/mipmap-hdpi/ic_launcher.png | Bin 0 -> 544 bytes .../src/main/res/mipmap-mdpi/ic_launcher.png | Bin 0 -> 442 bytes .../src/main/res/mipmap-xhdpi/ic_launcher.png | Bin 0 -> 721 bytes .../main/res/mipmap-xxhdpi/ic_launcher.png | Bin 0 -> 1031 bytes .../main/res/mipmap-xxxhdpi/ic_launcher.png | Bin 0 -> 1443 bytes .../app/src/main/res/values-night/styles.xml | 18 +++ .../app/src/main/res/values/styles.xml | 18 +++ bmi_calculator/android/build.gradle.kts | 24 +++ bmi_calculator/android/gradle.properties | 6 + .../gradle/wrapper/gradle-wrapper.properties | 5 + bmi_calculator/android/settings.gradle.kts | 26 +++ .../lib/calculator/calculate_button.dart | 2 +- .../lib/calculator/calculator_page.dart | 4 +- bmi_calculator/lib/main.dart | 2 +- bmi_calculator/pubspec.yaml | 7 +- bottom_sheet/analysis_options.yaml | 23 +++ .../android/app/src/main/AndroidManifest.xml | 1 + bottom_sheet/lib/home.dart | 12 +- bottom_sheet/lib/main.dart | 4 +- bottom_sheet/lib/models/ListTileModel.dart | 6 +- bottom_sheet/pubspec.yaml | 3 +- covid19_mobile_app/analysis_options.yaml | 23 +++ .../android/app/src/main/AndroidManifest.xml | 1 + covid19_mobile_app/lib/main.dart | 2 + .../lib/screens/countrylist.dart | 12 +- covid19_mobile_app/lib/screens/home.dart | 5 +- .../lib/screens/searchCountry.dart | 8 +- covid19_mobile_app/lib/widgets/drawer.dart | 2 + .../lib/widgets/foldable_cell_widgets.dart | 8 +- covid19_mobile_app/lib/widgets/info_card.dart | 4 +- covid19_mobile_app/pubspec.yaml | 1 + custom_home_drawer/analysis_options.yaml | 35 ++-- .../lib/screen/home_screen.dart | 21 ++- custom_home_drawer/pubspec.yaml | 2 +- dropdown_button/analysis_options.yaml | 23 +++ .../android/app/src/main/AndroidManifest.xml | 1 + .../plugins/GeneratedPluginRegistrant.java | 19 --- dropdown_button/lib/main.dart | 4 +- dropdown_button/pubspec.yaml | 1 + enabling_splash_screen/analysis_options.yaml | 23 +++ .../android/app/src/main/AndroidManifest.xml | 1 + .../plugins/GeneratedPluginRegistrant.java | 19 --- enabling_splash_screen/lib/main.dart | 2 + enabling_splash_screen/pubspec.yaml | 1 + expense_planner/analysis_options.yaml | 23 +++ .../android/app/src/main/AndroidManifest.xml | 1 + .../plugins/GeneratedPluginRegistrant.java | 19 --- .../ios/Runner/GeneratedPluginRegistrant.h | 19 --- .../ios/Runner/GeneratedPluginRegistrant.m | 14 -- expense_planner/lib/main.dart | 6 +- expense_planner/lib/widgets/chart.dart | 2 +- expense_planner/lib/widgets/chart_bar.dart | 6 +- .../lib/widgets/new_transaction.dart | 4 +- .../lib/widgets/transaction_list.dart | 6 +- .../lib/widgets/user_transactions.dart | 2 + expense_planner/pubspec.yaml | 1 + .../analysis_options.yaml | 23 +++ .../android/app/src/main/AndroidManifest.xml | 1 + firebase_crash_reporting/lib/main.dart | 6 +- firebase_crash_reporting/pubspec.yaml | 1 + .../analysis_options.yaml | 23 +++ .../android/app/src/main/AndroidManifest.xml | 1 + .../lib/Screens/HomePage.dart | 6 +- .../lib/Screens/InfoPage.dart | 4 +- .../lib/Screens/SignUpPage.dart | 46 +++--- .../lib/Services/google_auth.dart | 3 +- firebase_google_authentication/lib/main.dart | 2 +- firebase_google_authentication/pubspec.yaml | 1 + getx_counter_app/analysis_options.yaml | 35 ++-- getx_counter_app/android/app/build.gradle.kts | 4 +- .../android/app/src/debug/AndroidManifest.xml | 3 +- .../app/src/profile/AndroidManifest.xml | 3 +- getx_counter_app/lib/main.dart | 10 +- google_signin/.flutter-plugins-dependencies | 1 - google_signin/analysis_options.yaml | 23 +++ .../android/app/src/main/AndroidManifest.xml | 1 + .../plugins/GeneratedPluginRegistrant.java | 34 ---- google_signin/pubspec.yaml | 1 + grid_layout/analysis_options.yaml | 23 +++ grid_layout/lib/gridview.dart | 2 +- grid_layout/lib/main.dart | 2 + grid_layout/pubspec.yaml | 1 + handling_routes/analysis_options.yaml | 23 +++ .../android/app/src/main/AndroidManifest.xml | 1 + .../plugins/GeneratedPluginRegistrant.java | 19 --- handling_routes/lib/screens/about.dart | 2 + handling_routes/lib/screens/home.dart | 2 + handling_routes/pubspec.yaml | 1 + image_editor/analysis_options.yaml | 23 +++ .../android/app/src/main/AndroidManifest.xml | 1 + image_editor/lib/ApplyFilters.dart | 21 ++- image_editor/lib/EditImg.dart | 11 +- image_editor/lib/GetImg.dart | 6 +- image_editor/lib/HomePage.dart | 75 +++------ image_editor/lib/SaveInGallery.dart | 7 +- image_editor/lib/main.dart | 2 + image_editor/pubspec.yaml | 2 + image_from_network/analysis_options.yaml | 23 +++ .../android/app/src/main/AndroidManifest.xml | 1 + .../plugins/GeneratedPluginRegistrant.java | 19 --- image_from_network/lib/main.dart | 2 + image_from_network/pubspec.yaml | 1 + infinite_list/analysis_options.yaml | 23 +++ .../android/app/src/main/AndroidManifest.xml | 1 + infinite_list/lib/main.dart | 6 +- infinite_list/pubspec.yaml | 1 + load_local_image/analysis_options.yaml | 23 +++ load_local_image/lib/main.dart | 15 +- load_local_image/pubspec.yaml | 1 + load_local_json/analysis_options.yaml | 23 +++ load_local_json/lib/main.dart | 25 ++- load_local_json/pubspec.yaml | 1 + lunch_app/analysis_options.yaml | 23 +++ lunch_app/android/app/build.gradle.kts | 4 +- .../android/app/src/debug/AndroidManifest.xml | 3 +- .../android/app/src/main/AndroidManifest.xml | 1 + .../app/src/profile/AndroidManifest.xml | 3 +- lunch_app/lib/main.dart | 3 +- .../prototype/bottom_nav/bottom_nav.dart | 4 +- .../lib/views/prototype/food_detail_view.dart | 3 +- lunch_app/lib/views/prototype/home.dart | 7 +- .../prototype/widgets/carousel_indicator.dart | 2 +- .../views/prototype/widgets/food_lister.dart | 4 +- lunch_app/pubspec.yaml | 1 + navigation_drawer/analysis_options.yaml | 23 +++ navigation_drawer/lib/screens/account.dart | 2 + navigation_drawer/lib/screens/home.dart | 6 +- navigation_drawer/lib/screens/settings.dart | 2 + navigation_drawer/pubspec.yaml | 1 + news_memes_app/analysis_options.yaml | 23 +++ .../android/app/src/main/AndroidManifest.xml | 1 + news_memes_app/lib/Screens/HomePage.dart | 2 +- news_memes_app/lib/Screens/MemeScreen.dart | 2 +- news_memes_app/lib/Screens/NewsScreen.dart | 10 +- news_memes_app/pubspec.yaml | 1 + .../.flutter-plugins-dependencies | 1 - persist_key_value/analysis_options.yaml | 23 +++ persist_key_value/lib/main.dart | 16 +- persist_key_value/pubspec.yaml | 3 +- push_notifications/analysis_options.yaml | 23 +++ .../android/app/src/main/AndroidManifest.xml | 1 + push_notifications/lib/main.dart | 6 +- push_notifications/pubspec.yaml | 1 + .../analysis_options.yaml | 23 +++ .../android/app/src/main/AndroidManifest.xml | 1 + .../lib/database/local_database.dart | 9 +- save_data_locally_with_sqlite/lib/main.dart | 2 + .../lib/screens/homescreen/homescreen.dart | 2 + .../homescreen/widgets/note_container.dart | 10 +- save_data_locally_with_sqlite/pubspec.yaml | 2 + scan_qr_code/analysis_options.yaml | 35 ++-- scan_qr_code/pubspec.yaml | 2 +- simple_material_app/analysis_options.yaml | 23 +++ simple_material_app/pubspec.yaml | 1 + sliver_app_bar_example/analysis_options.yaml | 35 ++-- sliver_app_bar_example/pubspec.yaml | 2 +- stateful_widget/analysis_options.yaml | 23 +++ stateful_widget/lib/main.dart | 6 +- stateful_widget/pubspec.yaml | 1 + stateless_widgets/analysis_options.yaml | 23 +++ stateless_widgets/lib/main.dart | 7 +- stateless_widgets/pubspec.yaml | 1 + statless_counter_app/analysis_options.yaml | 23 +++ .../android/app/build.gradle.kts | 4 +- .../android/app/src/debug/AndroidManifest.xml | 3 +- .../android/app/src/main/AndroidManifest.xml | 1 + .../app/src/profile/AndroidManifest.xml | 3 +- statless_counter_app/lib/counter.g.dart | 2 +- statless_counter_app/lib/main.dart | 4 +- statless_counter_app/pubspec.yaml | 1 + tic_tac_toe/analysis_options.yaml | 35 ++-- tic_tac_toe/android/app/build.gradle.kts | 4 +- .../android/app/src/debug/AndroidManifest.xml | 3 +- .../app/src/profile/AndroidManifest.xml | 3 +- tic_tac_toe/pubspec.yaml | 2 +- tip_calculator/analysis_options.yaml | 23 +++ tip_calculator/lib/main.dart | 12 +- tip_calculator/pubspec.yaml | 1 + .../analysis_options.yaml | 23 +++ .../android/app/build.gradle.kts | 4 +- .../android/app/src/debug/AndroidManifest.xml | 3 +- .../android/app/src/main/AndroidManifest.xml | 1 + .../app/src/profile/AndroidManifest.xml | 3 +- todo_list_using_provider/lib/main.dart | 2 + todo_list_using_provider/lib/models/todo.dart | 2 +- .../lib/notifiers/todo_list.dart | 10 +- .../lib/widgets/add_button.dart | 4 +- .../lib/widgets/todo_list_item_display.dart | 2 + .../widgets/todo_list_item_toggle_button.dart | 2 + .../lib/widgets/todo_list_item_wdt.dart | 4 +- .../lib/widgets/todo_list_wdt.dart | 4 +- todo_list_using_provider/pubspec.yaml | 3 +- unit_testing/analysis_options.yaml | 23 +++ .../android/app/src/main/AndroidManifest.xml | 1 + .../lib/components/place_info_card.dart | 4 +- unit_testing/lib/main.dart | 2 + unit_testing/lib/screens/home_screen.dart | 2 + unit_testing/lib/screens/sign_in_screen.dart | 2 + unit_testing/pubspec.yaml | 1 + using_alert_dialog/analysis_options.yaml | 23 +++ using_alert_dialog/lib/main.dart | 2 + using_alert_dialog/pubspec.yaml | 1 + using_bottom_nav_bar/analysis_options.yaml | 23 +++ using_bottom_nav_bar/lib/main.dart | 6 +- using_bottom_nav_bar/lib/tabs/first.dart | 2 + using_bottom_nav_bar/lib/tabs/second.dart | 2 + using_bottom_nav_bar/lib/tabs/third.dart | 2 + using_bottom_nav_bar/pubspec.yaml | 1 + using_custom_fonts/analysis_options.yaml | 23 +++ using_custom_fonts/pubspec.yaml | 1 + using_edittext/analysis_options.yaml | 23 +++ using_edittext/lib/main.dart | 4 +- using_edittext/pubspec.yaml | 1 + using_expansionpanel/analysis_options.yaml | 35 ++-- using_expansionpanel/lib/main.dart | 2 +- using_expansionpanel/pubspec.yaml | 3 +- .../.flutter-plugins-dependencies | 1 - using_firebase_db/analysis_options.yaml | 23 +++ .../android/app/src/main/AndroidManifest.xml | 1 + using_firebase_db/lib/main.dart | 14 +- using_firebase_db/pubspec.yaml | 1 + using_gradient/analysis_options.yaml | 23 +++ using_gradient/lib/main.dart | 10 +- using_gradient/pubspec.yaml | 1 + using_http_get/analysis_options.yaml | 23 +++ using_http_get/lib/main.dart | 7 +- using_http_get/pubspec.yaml | 1 + using_interactiveviewer/analysis_options.yaml | 23 +++ .../android/app/src/main/AndroidManifest.xml | 1 + using_interactiveviewer/lib/main.dart | 2 + using_interactiveviewer/pubspec.yaml | 1 + using_listview/analysis_options.yaml | 23 +++ using_listview/lib/contact_page.dart | 4 +- .../lib/contactlist/contact_list.dart | 2 +- .../lib/contactlist/contact_list_item.dart | 2 +- using_listview/pubspec.yaml | 1 + .../analysis_options.yaml | 23 +++ .../android/app/src/main/AndroidManifest.xml | 95 +++++------ .../plugins/GeneratedPluginRegistrant.java | 19 --- .../ios/Runner/GeneratedPluginRegistrant.h | 19 --- .../ios/Runner/GeneratedPluginRegistrant.m | 14 -- using_listwheelscrollview/lib/listwheel.dart | 11 +- using_listwheelscrollview/lib/main.dart | 2 + .../lib/roundcontainer.dart | 7 +- using_listwheelscrollview/pubspec.yaml | 153 +++++++++--------- using_platform_adaptive/analysis_options.yaml | 35 ++-- using_platform_adaptive/lib/main.dart | 1 - .../Flutter/GeneratedPluginRegistrant.swift | 10 -- using_platform_adaptive/pubspec.yaml | 2 +- using_snackbar/analysis_options.yaml | 23 +++ using_snackbar/lib/main.dart | 4 + using_snackbar/pubspec.yaml | 1 + using_stepper/analysis_options.yaml | 23 +++ using_stepper/lib/main.dart | 10 +- using_stepper/pubspec.yaml | 1 + using_tabs/analysis_options.yaml | 23 +++ using_tabs/lib/main.dart | 2 + using_tabs/lib/tabs/first.dart | 2 + using_tabs/lib/tabs/second.dart | 2 + using_tabs/lib/tabs/third.dart | 2 + using_tabs/pubspec.yaml | 1 + using_theme/analysis_options.yaml | 23 +++ using_theme/lib/main.dart | 2 + using_theme/pubspec.yaml | 1 + view_pdf_file/analysis_options.yaml | 23 +++ .../android/app/src/main/AndroidManifest.xml | 1 + view_pdf_file/lib/main.dart | 8 +- view_pdf_file/lib/viewPDF.dart | 2 +- view_pdf_file/pubspec.yaml | 1 + 297 files changed, 2037 insertions(+), 930 deletions(-) create mode 100644 analytics_integration/analysis_options.yaml create mode 100644 bmi_calculator/android/.gitignore create mode 100644 bmi_calculator/android/app/build.gradle.kts create mode 100644 bmi_calculator/android/app/src/debug/AndroidManifest.xml create mode 100644 bmi_calculator/android/app/src/main/AndroidManifest.xml create mode 100644 bmi_calculator/android/app/src/main/kotlin/github/nisrulz/bmi_calculator/MainActivity.kt create mode 100644 bmi_calculator/android/app/src/main/res/drawable-v21/launch_background.xml create mode 100644 bmi_calculator/android/app/src/main/res/drawable/launch_background.xml create mode 100644 bmi_calculator/android/app/src/main/res/mipmap-hdpi/ic_launcher.png create mode 100644 bmi_calculator/android/app/src/main/res/mipmap-mdpi/ic_launcher.png create mode 100644 bmi_calculator/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png create mode 100644 bmi_calculator/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png create mode 100644 bmi_calculator/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png create mode 100644 bmi_calculator/android/app/src/main/res/values-night/styles.xml create mode 100644 bmi_calculator/android/app/src/main/res/values/styles.xml create mode 100644 bmi_calculator/android/build.gradle.kts create mode 100644 bmi_calculator/android/gradle.properties create mode 100644 bmi_calculator/android/gradle/wrapper/gradle-wrapper.properties create mode 100644 bmi_calculator/android/settings.gradle.kts create mode 100644 bottom_sheet/analysis_options.yaml create mode 100644 covid19_mobile_app/analysis_options.yaml create mode 100644 dropdown_button/analysis_options.yaml delete mode 100644 dropdown_button/android/app/src/main/java/io/flutter/plugins/GeneratedPluginRegistrant.java create mode 100644 enabling_splash_screen/analysis_options.yaml delete mode 100644 enabling_splash_screen/android/app/src/main/java/io/flutter/plugins/GeneratedPluginRegistrant.java create mode 100644 expense_planner/analysis_options.yaml delete mode 100644 expense_planner/android/app/src/main/java/io/flutter/plugins/GeneratedPluginRegistrant.java delete mode 100644 expense_planner/ios/Runner/GeneratedPluginRegistrant.h delete mode 100644 expense_planner/ios/Runner/GeneratedPluginRegistrant.m create mode 100644 firebase_crash_reporting/analysis_options.yaml create mode 100644 firebase_google_authentication/analysis_options.yaml delete mode 100644 google_signin/.flutter-plugins-dependencies create mode 100644 google_signin/analysis_options.yaml delete mode 100644 google_signin/android/app/src/main/java/io/flutter/plugins/GeneratedPluginRegistrant.java create mode 100644 grid_layout/analysis_options.yaml create mode 100644 handling_routes/analysis_options.yaml delete mode 100644 handling_routes/android/app/src/main/java/io/flutter/plugins/GeneratedPluginRegistrant.java create mode 100644 image_editor/analysis_options.yaml create mode 100644 image_from_network/analysis_options.yaml delete mode 100644 image_from_network/android/app/src/main/java/io/flutter/plugins/GeneratedPluginRegistrant.java create mode 100644 infinite_list/analysis_options.yaml create mode 100644 load_local_image/analysis_options.yaml create mode 100644 load_local_json/analysis_options.yaml create mode 100644 lunch_app/analysis_options.yaml create mode 100644 navigation_drawer/analysis_options.yaml create mode 100644 news_memes_app/analysis_options.yaml delete mode 100644 persist_key_value/.flutter-plugins-dependencies create mode 100644 persist_key_value/analysis_options.yaml create mode 100644 push_notifications/analysis_options.yaml create mode 100644 save_data_locally_with_sqlite/analysis_options.yaml create mode 100644 simple_material_app/analysis_options.yaml create mode 100644 stateful_widget/analysis_options.yaml create mode 100644 stateless_widgets/analysis_options.yaml create mode 100644 statless_counter_app/analysis_options.yaml create mode 100644 tip_calculator/analysis_options.yaml create mode 100644 todo_list_using_provider/analysis_options.yaml create mode 100644 unit_testing/analysis_options.yaml create mode 100644 using_alert_dialog/analysis_options.yaml create mode 100644 using_bottom_nav_bar/analysis_options.yaml create mode 100644 using_custom_fonts/analysis_options.yaml create mode 100644 using_edittext/analysis_options.yaml delete mode 100644 using_firebase_db/.flutter-plugins-dependencies create mode 100644 using_firebase_db/analysis_options.yaml create mode 100644 using_gradient/analysis_options.yaml create mode 100644 using_http_get/analysis_options.yaml create mode 100644 using_interactiveviewer/analysis_options.yaml create mode 100644 using_listview/analysis_options.yaml create mode 100644 using_listwheelscrollview/analysis_options.yaml delete mode 100644 using_listwheelscrollview/android/app/src/main/java/io/flutter/plugins/GeneratedPluginRegistrant.java delete mode 100644 using_listwheelscrollview/ios/Runner/GeneratedPluginRegistrant.h delete mode 100644 using_listwheelscrollview/ios/Runner/GeneratedPluginRegistrant.m delete mode 100644 using_platform_adaptive/macos/Flutter/GeneratedPluginRegistrant.swift create mode 100644 using_snackbar/analysis_options.yaml create mode 100644 using_stepper/analysis_options.yaml create mode 100644 using_tabs/analysis_options.yaml create mode 100644 using_theme/analysis_options.yaml create mode 100644 view_pdf_file/analysis_options.yaml diff --git a/.gitignore b/.gitignore index 0f23716..6545d75 100644 --- a/.gitignore +++ b/.gitignore @@ -351,6 +351,11 @@ build/ **/flutter_export_environment.sh **/.dart_tool +**/.flutter-plugins-dependencies +**/GeneratedPluginRegistrant.java +**/GeneratedPluginRegistrant.h +**/GeneratedPluginRegistrant.m +**/GeneratedPluginRegistrant.swift .pr-description-*/ .trash/ diff --git a/analytics_integration/analysis_options.yaml b/analytics_integration/analysis_options.yaml new file mode 100644 index 0000000..90b40f5 --- /dev/null +++ b/analytics_integration/analysis_options.yaml @@ -0,0 +1,23 @@ +# Lint rules for Flutter apps. +# See https://dart.dev/guides/language/analysis-options +include: package:flutter_lints/flutter.yaml + +analyzer: + exclude: + - build/** + - android/** + - ios/** + - web/** + - windows/** + - macos/** + - linux/** + +linter: + rules: + # Noise in small sample apps; keep the code readable. + avoid_print: false + avoid_unnecessary_containers: false + file_names: false + library_private_types_in_public_api: false + non_constant_identifier_names: false + strict_top_level_inference: false diff --git a/analytics_integration/android/app/src/main/AndroidManifest.xml b/analytics_integration/android/app/src/main/AndroidManifest.xml index 2b2d99e..366696b 100644 --- a/analytics_integration/android/app/src/main/AndroidManifest.xml +++ b/analytics_integration/android/app/src/main/AndroidManifest.xml @@ -10,6 +10,7 @@ android:icon="@mipmap/ic_launcher"> { ), ), Text( - widget.quantity.toString() + ' kg', + '${widget.quantity} kg', style: TextStyle( color: Colors.grey, fontSize: 12, diff --git a/analytics_integration/pubspec.yaml b/analytics_integration/pubspec.yaml index b85cadf..f580689 100644 --- a/analytics_integration/pubspec.yaml +++ b/analytics_integration/pubspec.yaml @@ -20,6 +20,7 @@ dependencies: dev_dependencies: flutter_test: sdk: flutter + flutter_lints: ^6.0.0 flutter: diff --git a/animation_example/analysis_options.yaml b/animation_example/analysis_options.yaml index 5bee4ff..90b40f5 100644 --- a/animation_example/analysis_options.yaml +++ b/animation_example/analysis_options.yaml @@ -1,12 +1,7 @@ -# This file configures the analyzer, which statically analyzes Dart code to -# check for errors, warnings, and lints. -# -# The issues identified by the analyzer are surfaced in the UI of Dart-enabled -# IDEs (https://dart.dev/tools#ides-and-editors). The analyzer can also be -# invoked from the command line by running `flutter analyze`. +# Lint rules for Flutter apps. +# See https://dart.dev/guides/language/analysis-options +include: package:flutter_lints/flutter.yaml -# The following line activates a set of recommended lints for Flutter apps, -# packages, and plugins designed to encourage good coding practices. analyzer: exclude: - build/** @@ -16,23 +11,13 @@ analyzer: - windows/** - macos/** - linux/** -include: package:flutter_lints/flutter.yaml linter: - # The lint rules applied to this project can be customized in the - # section below to disable rules from the `package:flutter_lints/flutter.yaml` - # included above or to enable additional rules. A list of all available lints - # and their documentation is published at - # https://dart-lang.github.io/linter/lints/index.html. - # - # Instead of disabling a lint rule for the entire project in the - # section below, it can also be suppressed for a single line of code - # or a specific dart file by using the `// ignore: name_of_lint` and - # `// ignore_for_file: name_of_lint` syntax on the line or in the file - # producing the lint. rules: - # avoid_print: false # Uncomment to disable the `avoid_print` rule - # prefer_single_quotes: true # Uncomment to enable the `prefer_single_quotes` rule - -# Additional information about this file can be found at -# https://dart.dev/guides/language/analysis-options + # Noise in small sample apps; keep the code readable. + avoid_print: false + avoid_unnecessary_containers: false + file_names: false + library_private_types_in_public_api: false + non_constant_identifier_names: false + strict_top_level_inference: false diff --git a/animation_example/android/app/build.gradle.kts b/animation_example/android/app/build.gradle.kts index 71eb520..31272ec 100644 --- a/animation_example/android/app/build.gradle.kts +++ b/animation_example/android/app/build.gradle.kts @@ -6,7 +6,7 @@ plugins { } android { - namespace = "com.example.penassignment" + namespace = "github.nisrulz.animation_example" compileSdk = flutter.compileSdkVersion ndkVersion = flutter.ndkVersion @@ -16,7 +16,7 @@ android { } defaultConfig { - applicationId = "com.example.penassignment" + applicationId = "github.nisrulz.animation_example" minSdk = flutter.minSdkVersion targetSdk = flutter.targetSdkVersion versionCode = flutter.versionCode diff --git a/animation_example/android/app/src/debug/AndroidManifest.xml b/animation_example/android/app/src/debug/AndroidManifest.xml index 0ba77cd..f880684 100644 --- a/animation_example/android/app/src/debug/AndroidManifest.xml +++ b/animation_example/android/app/src/debug/AndroidManifest.xml @@ -1,5 +1,4 @@ - + diff --git a/animation_example/android/app/src/main/AndroidManifest.xml b/animation_example/android/app/src/main/AndroidManifest.xml index 0c62235..5545c6c 100644 --- a/animation_example/android/app/src/main/AndroidManifest.xml +++ b/animation_example/android/app/src/main/AndroidManifest.xml @@ -5,6 +5,7 @@ android:icon="@mipmap/ic_launcher"> + diff --git a/animation_example/lib/home_page.dart b/animation_example/lib/home_page.dart index efd38d4..2a693a8 100644 --- a/animation_example/lib/home_page.dart +++ b/animation_example/lib/home_page.dart @@ -1,7 +1,8 @@ import 'package:flutter/material.dart'; -import 'package:flutter/scheduler.dart'; class HomePage extends StatefulWidget { + const HomePage({super.key}); + @override _HomePageState createState() => _HomePageState(); } @@ -42,7 +43,7 @@ class _HomePageState extends State return Scaffold( backgroundColor: Colors.white, - body: Container( + body: SizedBox( width: double.infinity, height: size.height, child: Stack( @@ -52,16 +53,16 @@ class _HomePageState extends State top: 80, child: TextButton( onPressed: () {}, + style: ButtonStyle( + backgroundColor: + WidgetStateProperty.all(Colors.green)), child: const Text( "North", style: TextStyle( fontSize: 18, fontWeight: FontWeight.w500, color: Colors.white), - ), - style: ButtonStyle( - backgroundColor: - MaterialStateProperty.all(Colors.green)))), + ))), Positioned( top: size.height * 0.48, left: -15, @@ -69,16 +70,16 @@ class _HomePageState extends State angle: 190.1, child: TextButton( onPressed: () {}, + style: ButtonStyle( + backgroundColor: + WidgetStateProperty.all(Colors.green)), child: const Text( "East", style: TextStyle( fontSize: 18, fontWeight: FontWeight.w500, color: Colors.white), - ), - style: ButtonStyle( - backgroundColor: - MaterialStateProperty.all(Colors.green))), + )), )), Positioned( top: size.height * 0.48, @@ -87,31 +88,31 @@ class _HomePageState extends State angle: -190.1, child: TextButton( onPressed: () {}, + style: ButtonStyle( + backgroundColor: + WidgetStateProperty.all(Colors.green)), child: const Text( "West", style: TextStyle( fontSize: 18, fontWeight: FontWeight.w500, color: Colors.white), - ), - style: ButtonStyle( - backgroundColor: - MaterialStateProperty.all(Colors.green))), + )), )), Positioned( bottom: 80, child: TextButton( onPressed: () {}, + style: ButtonStyle( + backgroundColor: + WidgetStateProperty.all(Colors.green)), child: const Text( "North", style: TextStyle( fontSize: 18, fontWeight: FontWeight.w500, color: Colors.white), - ), - style: ButtonStyle( - backgroundColor: - MaterialStateProperty.all(Colors.green)))), + ))), AnimatedBuilder( animation: controller, child: Container( diff --git a/animation_example/lib/main.dart b/animation_example/lib/main.dart index 8bce7f4..b7bf8f3 100644 --- a/animation_example/lib/main.dart +++ b/animation_example/lib/main.dart @@ -7,7 +7,7 @@ void main() { } class MyApp extends StatelessWidget { - const MyApp({Key? key}) : super(key: key); + const MyApp({super.key}); // This widget is the root of your application. @override diff --git a/animation_example/pubspec.yaml b/animation_example/pubspec.yaml index b2febfb..7efee8e 100644 --- a/animation_example/pubspec.yaml +++ b/animation_example/pubspec.yaml @@ -1,4 +1,4 @@ -name: penassignment +name: animation_example description: A new Flutter project. # The following line prevents the package from being accidentally published to diff --git a/biometrics/analysis_options.yaml b/biometrics/analysis_options.yaml index 5bee4ff..90b40f5 100644 --- a/biometrics/analysis_options.yaml +++ b/biometrics/analysis_options.yaml @@ -1,12 +1,7 @@ -# This file configures the analyzer, which statically analyzes Dart code to -# check for errors, warnings, and lints. -# -# The issues identified by the analyzer are surfaced in the UI of Dart-enabled -# IDEs (https://dart.dev/tools#ides-and-editors). The analyzer can also be -# invoked from the command line by running `flutter analyze`. +# Lint rules for Flutter apps. +# See https://dart.dev/guides/language/analysis-options +include: package:flutter_lints/flutter.yaml -# The following line activates a set of recommended lints for Flutter apps, -# packages, and plugins designed to encourage good coding practices. analyzer: exclude: - build/** @@ -16,23 +11,13 @@ analyzer: - windows/** - macos/** - linux/** -include: package:flutter_lints/flutter.yaml linter: - # The lint rules applied to this project can be customized in the - # section below to disable rules from the `package:flutter_lints/flutter.yaml` - # included above or to enable additional rules. A list of all available lints - # and their documentation is published at - # https://dart-lang.github.io/linter/lints/index.html. - # - # Instead of disabling a lint rule for the entire project in the - # section below, it can also be suppressed for a single line of code - # or a specific dart file by using the `// ignore: name_of_lint` and - # `// ignore_for_file: name_of_lint` syntax on the line or in the file - # producing the lint. rules: - # avoid_print: false # Uncomment to disable the `avoid_print` rule - # prefer_single_quotes: true # Uncomment to enable the `prefer_single_quotes` rule - -# Additional information about this file can be found at -# https://dart.dev/guides/language/analysis-options + # Noise in small sample apps; keep the code readable. + avoid_print: false + avoid_unnecessary_containers: false + file_names: false + library_private_types_in_public_api: false + non_constant_identifier_names: false + strict_top_level_inference: false diff --git a/biometrics/android/app/build.gradle.kts b/biometrics/android/app/build.gradle.kts index 47b1c46..9a3a853 100644 --- a/biometrics/android/app/build.gradle.kts +++ b/biometrics/android/app/build.gradle.kts @@ -6,7 +6,7 @@ plugins { } android { - namespace = "studio.sdev.biometrics" + namespace = "github.nisrulz.biometrics" compileSdk = flutter.compileSdkVersion ndkVersion = flutter.ndkVersion @@ -16,7 +16,7 @@ android { } defaultConfig { - applicationId = "studio.sdev.biometrics" + applicationId = "github.nisrulz.biometrics" minSdk = flutter.minSdkVersion targetSdk = flutter.targetSdkVersion versionCode = flutter.versionCode diff --git a/biometrics/android/app/src/debug/AndroidManifest.xml b/biometrics/android/app/src/debug/AndroidManifest.xml index 02d0760..f880684 100644 --- a/biometrics/android/app/src/debug/AndroidManifest.xml +++ b/biometrics/android/app/src/debug/AndroidManifest.xml @@ -1,5 +1,4 @@ - + diff --git a/biometrics/android/app/src/profile/AndroidManifest.xml b/biometrics/android/app/src/profile/AndroidManifest.xml index 02d0760..f880684 100644 --- a/biometrics/android/app/src/profile/AndroidManifest.xml +++ b/biometrics/android/app/src/profile/AndroidManifest.xml @@ -1,5 +1,4 @@ - + diff --git a/biometrics/lib/main.dart b/biometrics/lib/main.dart index 3e32195..06c7e21 100644 --- a/biometrics/lib/main.dart +++ b/biometrics/lib/main.dart @@ -4,6 +4,8 @@ import 'package:flutter/material.dart'; void main() => runApp(Biometrics()); class Biometrics extends StatelessWidget { + const Biometrics({super.key}); + @override Widget build(BuildContext context) { return MaterialApp( @@ -17,6 +19,8 @@ class Biometrics extends StatelessWidget { } class Home extends StatefulWidget { + const Home({super.key}); + @override State createState() => _HomeState(); } @@ -72,6 +76,7 @@ class _HomeState extends State { }); } catch (e) { // ---- Verification Failed + if (!context.mounted) return; showDialog( context: context, builder: (c) => AlertDialog( diff --git a/bmi_calculator/.metadata b/bmi_calculator/.metadata index 74dfa13..bfe2caf 100644 --- a/bmi_calculator/.metadata +++ b/bmi_calculator/.metadata @@ -4,7 +4,27 @@ # This file should be version controlled and should not be manually edited. version: - revision: f1875d570e39de09040c8f79aa13cc56baab8db1 - channel: stable + revision: "4cf24164269a5ebf0c16a028a00727d0e77bbb05" + channel: "stable" -project_type: module +project_type: app + +# Tracks metadata for the flutter migrate command +migration: + platforms: + - platform: root + create_revision: 4cf24164269a5ebf0c16a028a00727d0e77bbb05 + base_revision: 4cf24164269a5ebf0c16a028a00727d0e77bbb05 + - platform: android + create_revision: 4cf24164269a5ebf0c16a028a00727d0e77bbb05 + base_revision: 4cf24164269a5ebf0c16a028a00727d0e77bbb05 + + # User provided section + + # List of Local paths (relative to this file) that should be + # ignored by the migrate tool. + # + # Files that are not part of the templates will be ignored by default. + unmanaged_files: + - 'lib/main.dart' + - 'ios/Runner.xcodeproj/project.pbxproj' diff --git a/bmi_calculator/analysis_options.yaml b/bmi_calculator/analysis_options.yaml index 534f26d..90b40f5 100644 --- a/bmi_calculator/analysis_options.yaml +++ b/bmi_calculator/analysis_options.yaml @@ -1,3 +1,7 @@ +# Lint rules for Flutter apps. +# See https://dart.dev/guides/language/analysis-options +include: package:flutter_lints/flutter.yaml + analyzer: exclude: - build/** @@ -7,7 +11,13 @@ analyzer: - windows/** - macos/** - linux/** -include: package:flutter_lints/flutter.yaml -# Additional information about this file can be found at -# https://dart.dev/guides/language/analysis-options +linter: + rules: + # Noise in small sample apps; keep the code readable. + avoid_print: false + avoid_unnecessary_containers: false + file_names: false + library_private_types_in_public_api: false + non_constant_identifier_names: false + strict_top_level_inference: false diff --git a/bmi_calculator/android/.gitignore b/bmi_calculator/android/.gitignore new file mode 100644 index 0000000..be3943c --- /dev/null +++ b/bmi_calculator/android/.gitignore @@ -0,0 +1,14 @@ +gradle-wrapper.jar +/.gradle +/captures/ +/gradlew +/gradlew.bat +/local.properties +GeneratedPluginRegistrant.java +.cxx/ + +# Remember to never publicly share your keystore. +# See https://flutter.dev/to/reference-keystore +key.properties +**/*.keystore +**/*.jks diff --git a/bmi_calculator/android/app/build.gradle.kts b/bmi_calculator/android/app/build.gradle.kts new file mode 100644 index 0000000..1d2cf40 --- /dev/null +++ b/bmi_calculator/android/app/build.gradle.kts @@ -0,0 +1,49 @@ +plugins { + id("com.android.application") + // The Flutter Gradle Plugin must be applied after the Android and Kotlin Gradle plugins. + id("dev.flutter.flutter-gradle-plugin") +} + +android { + namespace = "github.nisrulz.bmi_calculator" + compileSdk = flutter.compileSdkVersion + ndkVersion = flutter.ndkVersion + + compileOptions { + sourceCompatibility = JavaVersion.VERSION_17 + targetCompatibility = JavaVersion.VERSION_17 + } + + defaultConfig { + // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html). + applicationId = "github.nisrulz.bmi_calculator" + // You can update the following values to match your application needs. + // For more information, see: https://flutter.dev/to/review-gradle-config. + minSdk = flutter.minSdkVersion + targetSdk = flutter.targetSdkVersion + // Uses the version code from pubspec.yaml. When using split APKs, 1000 * ABI_VERSION + // is added automatically by Flutter. (https://developer.android.com/studio/build/configure-apk-splits#configure-APK-versions) + // You can force using the value of versionCode by specifying the `-P force-version-code-ignoring-abi=true` + // flag during build. + versionCode = flutter.versionCode + versionName = flutter.versionName + } + + 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.getByName("debug") + } + } +} + +kotlin { + compilerOptions { + jvmTarget = org.jetbrains.kotlin.gradle.dsl.JvmTarget.JVM_17 + } +} + +flutter { + source = "../.." +} diff --git a/bmi_calculator/android/app/src/debug/AndroidManifest.xml b/bmi_calculator/android/app/src/debug/AndroidManifest.xml new file mode 100644 index 0000000..399f698 --- /dev/null +++ b/bmi_calculator/android/app/src/debug/AndroidManifest.xml @@ -0,0 +1,7 @@ + + + + diff --git a/bmi_calculator/android/app/src/main/AndroidManifest.xml b/bmi_calculator/android/app/src/main/AndroidManifest.xml new file mode 100644 index 0000000..a677ae3 --- /dev/null +++ b/bmi_calculator/android/app/src/main/AndroidManifest.xml @@ -0,0 +1,45 @@ + + + + + + + + + + + + + + + + + + + + + diff --git a/bmi_calculator/android/app/src/main/kotlin/github/nisrulz/bmi_calculator/MainActivity.kt b/bmi_calculator/android/app/src/main/kotlin/github/nisrulz/bmi_calculator/MainActivity.kt new file mode 100644 index 0000000..bdf0a49 --- /dev/null +++ b/bmi_calculator/android/app/src/main/kotlin/github/nisrulz/bmi_calculator/MainActivity.kt @@ -0,0 +1,5 @@ +package github.nisrulz.bmi_calculator + +import io.flutter.embedding.android.FlutterActivity + +class MainActivity : FlutterActivity() diff --git a/bmi_calculator/android/app/src/main/res/drawable-v21/launch_background.xml b/bmi_calculator/android/app/src/main/res/drawable-v21/launch_background.xml new file mode 100644 index 0000000..f74085f --- /dev/null +++ b/bmi_calculator/android/app/src/main/res/drawable-v21/launch_background.xml @@ -0,0 +1,12 @@ + + + + + + + + diff --git a/bmi_calculator/android/app/src/main/res/drawable/launch_background.xml b/bmi_calculator/android/app/src/main/res/drawable/launch_background.xml new file mode 100644 index 0000000..304732f --- /dev/null +++ b/bmi_calculator/android/app/src/main/res/drawable/launch_background.xml @@ -0,0 +1,12 @@ + + + + + + + + diff --git a/bmi_calculator/android/app/src/main/res/mipmap-hdpi/ic_launcher.png b/bmi_calculator/android/app/src/main/res/mipmap-hdpi/ic_launcher.png new file mode 100644 index 0000000000000000000000000000000000000000..db77bb4b7b0906d62b1847e87f15cdcacf6a4f29 GIT binary patch literal 544 zcmeAS@N?(olHy`uVBq!ia0vp^9w5xY3?!3`olAj~WQl7;NpOBzNqJ&XDuZK6ep0G} zXKrG8YEWuoN@d~6R2!h8bpbvhu0Wd6uZuB!w&u2PAxD2eNXD>P5D~Wn-+_Wa#27Xc zC?Zj|6r#X(-D3u$NCt}(Ms06KgJ4FxJVv{GM)!I~&n8Bnc94O7-Hd)cjDZswgC;Qs zO=b+9!WcT8F?0rF7!Uys2bs@gozCP?z~o%U|N3vA*22NaGQG zlg@K`O_XuxvZ&Ks^m&R!`&1=spLvfx7oGDKDwpwW`#iqdw@AL`7MR}m`rwr|mZgU`8P7SBkL78fFf!WnuYWm$5Z0 zNXhDbCv&49sM544K|?c)WrFfiZvCi9h0O)B3Pgg&ebxsLQ05GG~ AQ2+n{ literal 0 HcmV?d00001 diff --git a/bmi_calculator/android/app/src/main/res/mipmap-mdpi/ic_launcher.png b/bmi_calculator/android/app/src/main/res/mipmap-mdpi/ic_launcher.png new file mode 100644 index 0000000000000000000000000000000000000000..17987b79bb8a35cc66c3c1fd44f5a5526c1b78be GIT binary patch literal 442 zcmeAS@N?(olHy`uVBq!ia0vp^1|ZDA3?vioaBc-sk|nMYCBgY=CFO}lsSJ)O`AMk? zp1FzXsX?iUDV2pMQ*D5Xx&nMcT!A!W`0S9QKQy;}1Cl^CgaH=;G9cpY;r$Q>i*pfB zP2drbID<_#qf;rPZx^FqH)F_D#*k@@q03KywUtLX8Ua?`H+NMzkczFPK3lFz@i_kW%1NOn0|D2I9n9wzH8m|-tHjsw|9>@K=iMBhxvkv6m8Y-l zytQ?X=U+MF$@3 zt`~i=@j|6y)RWMK--}M|=T`o&^Ni>IoWKHEbBXz7?A@mgWoL>!*SXo`SZH-*HSdS+ yn*9;$7;m`l>wYBC5bq;=U}IMqLzqbYCidGC!)_gkIk_C@Uy!y&wkt5C($~2D>~)O*cj@FGjOCM)M>_ixfudOh)?xMu#Fs z#}Y=@YDTwOM)x{K_j*Q;dPdJ?Mz0n|pLRx{4n|)f>SXlmV)XB04CrSJn#dS5nK2lM zrZ9#~WelCp7&e13Y$jvaEXHskn$2V!!DN-nWS__6T*l;H&Fopn?A6HZ-6WRLFP=R` zqG+CE#d4|IbyAI+rJJ`&x9*T`+a=p|0O(+s{UBcyZdkhj=yS1>AirP+0R;mf2uMgM zC}@~JfByORAh4SyRgi&!(cja>F(l*O+nd+@4m$|6K6KDn_&uvCpV23&>G9HJp{xgg zoq1^2_p9@|WEo z*X_Uko@K)qYYv~>43eQGMdbiGbo>E~Q& zrYBH{QP^@Sti!`2)uG{irBBq@y*$B zi#&(U-*=fp74j)RyIw49+0MRPMRU)+a2r*PJ$L5roHt2$UjExCTZSbq%V!HeS7J$N zdG@vOZB4v_lF7Plrx+hxo7(fCV&}fHq)$ literal 0 HcmV?d00001 diff --git a/bmi_calculator/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png b/bmi_calculator/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png new file mode 100644 index 0000000000000000000000000000000000000000..d5f1c8d34e7a88e3f88bea192c3a370d44689c3c GIT binary patch literal 1031 zcmeAS@N?(olHy`uVBq!ia0vp^6F``Q8Ax83A=Cw=BuiW)N`mv#O3D+9QW+dm@{>{( zJaZG%Q-e|yQz{EjrrIztFa`(sgt!6~Yi|1%a`XoT0ojZ}lNrNjb9xjc(B0U1_% zz5^97Xt*%oq$rQy4?0GKNfJ44uvxI)gC`h-NZ|&0-7(qS@?b!5r36oQ}zyZrNO3 zMO=Or+<~>+A&uN&E!^Sl+>xE!QC-|oJv`ApDhqC^EWD|@=#J`=d#Xzxs4ah}w&Jnc z$|q_opQ^2TrnVZ0o~wh<3t%W&flvYGe#$xqda2bR_R zvPYgMcHgjZ5nSA^lJr%;<&0do;O^tDDh~=pIxA#coaCY>&N%M2^tq^U%3DB@ynvKo}b?yu-bFc-u0JHzced$sg7S3zqI(2 z#Km{dPr7I=pQ5>FuK#)QwK?Y`E`B?nP+}U)I#c1+FM*1kNvWG|a(TpksZQ3B@sD~b zpQ2)*V*TdwjFOtHvV|;OsiDqHi=6%)o4b!)x$)%9pGTsE z-JL={-Ffv+T87W(Xpooq<`r*VzWQcgBN$$`u}f>-ZQI1BB8ykN*=e4rIsJx9>z}*o zo~|9I;xof literal 0 HcmV?d00001 diff --git a/bmi_calculator/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png b/bmi_calculator/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png new file mode 100644 index 0000000000000000000000000000000000000000..4d6372eebdb28e45604e46eeda8dd24651419bc0 GIT binary patch literal 1443 zcmb`G{WsKk6vsdJTdFg%tJav9_E4vzrOaqkWF|A724Nly!y+?N9`YV6wZ}5(X(D_N(?!*n3`|_r0Hc?=PQw&*vnU?QTFY zB_MsH|!j$PP;I}?dppoE_gA(4uc!jV&0!l7_;&p2^pxNo>PEcNJv za5_RT$o2Mf!<+r?&EbHH6nMoTsDOa;mN(wv8RNsHpG)`^ymG-S5By8=l9iVXzN_eG%Xg2@Xeq76tTZ*dGh~Lo9vl;Zfs+W#BydUw zCkZ$o1LqWQO$FC9aKlLl*7x9^0q%0}$OMlp@Kk_jHXOjofdePND+j!A{q!8~Jn+s3 z?~~w@4?egS02}8NuulUA=L~QQfm;MzCGd)XhiftT;+zFO&JVyp2mBww?;QByS_1w! zrQlx%{^cMj0|Bo1FjwY@Q8?Hx0cIPF*@-ZRFpPc#bBw{5@tD(5%sClzIfl8WU~V#u zm5Q;_F!wa$BSpqhN>W@2De?TKWR*!ujY;Yylk_X5#~V!L*Gw~;$%4Q8~Mad z@`-kG?yb$a9cHIApZDVZ^U6Xkp<*4rU82O7%}0jjHlK{id@?-wpN*fCHXyXh(bLt* zPc}H-x0e4E&nQ>y%B-(EL=9}RyC%MyX=upHuFhAk&MLbsF0LP-q`XnH78@fT+pKPW zu72MW`|?8ht^tz$iC}ZwLp4tB;Q49K!QCF3@!iB1qOI=?w z7In!}F~ij(18UYUjnbmC!qKhPo%24?8U1x{7o(+?^Zu0Hx81|FuS?bJ0jgBhEMzf< zCgUq7r2OCB(`XkKcN-TL>u5y#dD6D!)5W?`O5)V^>jb)P)GBdy%t$uUMpf$SNV31$ zb||OojAbvMP?T@$h_ZiFLFVHDmbyMhJF|-_)HX3%m=CDI+ID$0^C>kzxprBW)hw(v zr!Gmda);ICoQyhV_oP5+C%?jcG8v+D@9f?Dk*!BxY}dazmrT@64UrP3hlslANK)bq z$67n83eh}OeW&SV@HG95P|bjfqJ7gw$e+`Hxo!4cx`jdK1bJ>YDSpGKLPZ^1cv$ek zIB?0S<#tX?SJCLWdMd{-ME?$hc7A$zBOdIJ)4!KcAwb=VMov)nK;9z>x~rfT1>dS+ zZ6#`2v@`jgbqq)P22H)Tx2CpmM^o1$B+xT6`(v%5xJ(?j#>Q$+rx_R|7TzDZe{J6q zG1*EcU%tE?!kO%^M;3aM6JN*LAKUVb^xz8-Pxo#jR5(-KBeLJvA@-gxNHx0M-ZJLl z;#JwQoh~9V?`UVo#}{6ka@II>++D@%KqGpMdlQ}?9E*wFcf5(#XQnP$Dk5~%iX^>f z%$y;?M0BLp{O3a(-4A?ewryHrrD%cx#Q^%KY1H zNre$ve+vceSLZcNY4U(RBX&)oZn*Py()h)XkE?PL$!bNb{N5FVI2Y%LKEm%yvpyTP z(1P?z~7YxD~Rf<(a@_y` literal 0 HcmV?d00001 diff --git a/bmi_calculator/android/app/src/main/res/values-night/styles.xml b/bmi_calculator/android/app/src/main/res/values-night/styles.xml new file mode 100644 index 0000000..06952be --- /dev/null +++ b/bmi_calculator/android/app/src/main/res/values-night/styles.xml @@ -0,0 +1,18 @@ + + + + + + + diff --git a/bmi_calculator/android/app/src/main/res/values/styles.xml b/bmi_calculator/android/app/src/main/res/values/styles.xml new file mode 100644 index 0000000..cb1ef88 --- /dev/null +++ b/bmi_calculator/android/app/src/main/res/values/styles.xml @@ -0,0 +1,18 @@ + + + + + + + diff --git a/bmi_calculator/android/build.gradle.kts b/bmi_calculator/android/build.gradle.kts new file mode 100644 index 0000000..dbee657 --- /dev/null +++ b/bmi_calculator/android/build.gradle.kts @@ -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("clean") { + delete(rootProject.layout.buildDirectory) +} diff --git a/bmi_calculator/android/gradle.properties b/bmi_calculator/android/gradle.properties new file mode 100644 index 0000000..e96108c --- /dev/null +++ b/bmi_calculator/android/gradle.properties @@ -0,0 +1,6 @@ +org.gradle.jvmargs=-Xmx8G -XX:MaxMetaspaceSize=4G -XX:ReservedCodeCacheSize=512m -XX:+HeapDumpOnOutOfMemoryError +android.useAndroidX=true +# This newDsl flag was added by the Flutter template +android.newDsl=false +# This builtInKotlin flag was added by the Flutter template +android.builtInKotlin=false diff --git a/bmi_calculator/android/gradle/wrapper/gradle-wrapper.properties b/bmi_calculator/android/gradle/wrapper/gradle-wrapper.properties new file mode 100644 index 0000000..a20f2c4 --- /dev/null +++ b/bmi_calculator/android/gradle/wrapper/gradle-wrapper.properties @@ -0,0 +1,5 @@ +distributionBase=GRADLE_USER_HOME +distributionPath=wrapper/dists +zipStoreBase=GRADLE_USER_HOME +zipStorePath=wrapper/dists +distributionUrl=https\://services.gradle.org/distributions/gradle-9.3.1-all.zip diff --git a/bmi_calculator/android/settings.gradle.kts b/bmi_calculator/android/settings.gradle.kts new file mode 100644 index 0000000..b28021a --- /dev/null +++ b/bmi_calculator/android/settings.gradle.kts @@ -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.4.0" apply false +} + +include(":app") diff --git a/bmi_calculator/lib/calculator/calculate_button.dart b/bmi_calculator/lib/calculator/calculate_button.dart index 54249f2..2aa0e5f 100644 --- a/bmi_calculator/lib/calculator/calculate_button.dart +++ b/bmi_calculator/lib/calculator/calculate_button.dart @@ -22,7 +22,7 @@ class CalculateButton extends StatelessWidget { child: TextButton( style: ButtonStyle( overlayColor: - MaterialStateProperty.all(Colors.white.withOpacity(0.10)), + WidgetStateProperty.all(Colors.white.withValues(alpha: 0.10)), ), onPressed: onTap, child: const Text( diff --git a/bmi_calculator/lib/calculator/calculator_page.dart b/bmi_calculator/lib/calculator/calculator_page.dart index c811323..287091d 100644 --- a/bmi_calculator/lib/calculator/calculator_page.dart +++ b/bmi_calculator/lib/calculator/calculator_page.dart @@ -5,9 +5,9 @@ import 'package:bmi_calculator/palette.dart'; class CalculatorPage extends StatelessWidget { CalculatorPage({ - Key? key, + super.key, required this.title, - }) : super(key: key); + }); final String title; diff --git a/bmi_calculator/lib/main.dart b/bmi_calculator/lib/main.dart index cf7f056..6a14542 100644 --- a/bmi_calculator/lib/main.dart +++ b/bmi_calculator/lib/main.dart @@ -13,7 +13,7 @@ void main() { } class MyApp extends StatelessWidget { - const MyApp({Key? key}) : super(key: key); + const MyApp({super.key}); // This widget is the root of your application. @override diff --git a/bmi_calculator/pubspec.yaml b/bmi_calculator/pubspec.yaml index 173708c..3a22bbe 100644 --- a/bmi_calculator/pubspec.yaml +++ b/bmi_calculator/pubspec.yaml @@ -1,5 +1,5 @@ name: bmi_calculator -description: A new Flutter module project. +description: A new Flutter project. version: 1.0.0+1 @@ -19,8 +19,3 @@ dev_dependencies: flutter: uses-material-design: true - - module: - androidX: true - androidPackage: github.nisrulz.bmi_calculator - iosBundleIdentifier: github.nisrulz.bmiCalculator diff --git a/bottom_sheet/analysis_options.yaml b/bottom_sheet/analysis_options.yaml new file mode 100644 index 0000000..90b40f5 --- /dev/null +++ b/bottom_sheet/analysis_options.yaml @@ -0,0 +1,23 @@ +# Lint rules for Flutter apps. +# See https://dart.dev/guides/language/analysis-options +include: package:flutter_lints/flutter.yaml + +analyzer: + exclude: + - build/** + - android/** + - ios/** + - web/** + - windows/** + - macos/** + - linux/** + +linter: + rules: + # Noise in small sample apps; keep the code readable. + avoid_print: false + avoid_unnecessary_containers: false + file_names: false + library_private_types_in_public_api: false + non_constant_identifier_names: false + strict_top_level_inference: false diff --git a/bottom_sheet/android/app/src/main/AndroidManifest.xml b/bottom_sheet/android/app/src/main/AndroidManifest.xml index 4b4f990..fd1e964 100644 --- a/bottom_sheet/android/app/src/main/AndroidManifest.xml +++ b/bottom_sheet/android/app/src/main/AndroidManifest.xml @@ -11,6 +11,7 @@ android:icon="@mipmap/ic_launcher"> { child: Column( mainAxisAlignment: MainAxisAlignment.center, children: [ - new ElevatedButton( + ElevatedButton( child: Text( "Bottom Sheet", style: TextStyle(fontSize: 20), @@ -42,14 +42,14 @@ void _openBottomSheet(context) { showModalBottomSheet( context: context, builder: (builder) { - return new Container( + return Container( padding: EdgeInsets.all(5.0), - child: new Wrap( + child: Wrap( children: [ getListTile(Icons.more, Colors.black45, "More", context), getListTile(Icons.favorite, Colors.pink, "Favourites", context), getListTile(Icons.account_box, Colors.blue, "Profile", context), - new Divider( + Divider( thickness: 2.0, height: 10.0, ), diff --git a/bottom_sheet/lib/main.dart b/bottom_sheet/lib/main.dart index c3e83c3..3f21778 100644 --- a/bottom_sheet/lib/main.dart +++ b/bottom_sheet/lib/main.dart @@ -1,11 +1,13 @@ import 'package:flutter/material.dart'; -import 'package:project/home.dart'; +import 'package:bottom_sheet/home.dart'; void main() { runApp(MyApp()); } class MyApp extends StatelessWidget { + const MyApp({super.key}); + // This widget is the root of your application. @override Widget build(BuildContext context) { diff --git a/bottom_sheet/lib/models/ListTileModel.dart b/bottom_sheet/lib/models/ListTileModel.dart index 36fc5e4..f7a75d1 100644 --- a/bottom_sheet/lib/models/ListTileModel.dart +++ b/bottom_sheet/lib/models/ListTileModel.dart @@ -1,8 +1,8 @@ import 'package:flutter/material.dart'; ListTile getListTile(icon, iconColor, titleText, context) { - return new ListTile( - leading: new Container( + return ListTile( + leading: SizedBox( width: 4.0, child: Icon( icon, @@ -10,7 +10,7 @@ ListTile getListTile(icon, iconColor, titleText, context) { size: 24.0, ), ), - title: new Text( + title: Text( titleText, style: TextStyle( fontSize: 14.0, diff --git a/bottom_sheet/pubspec.yaml b/bottom_sheet/pubspec.yaml index 9fde2f9..4c4ceba 100644 --- a/bottom_sheet/pubspec.yaml +++ b/bottom_sheet/pubspec.yaml @@ -1,4 +1,4 @@ -name: project +name: bottom_sheet description: A new Flutter project. # The following line prevents the package from being accidentally published to @@ -32,6 +32,7 @@ dependencies: dev_dependencies: flutter_test: sdk: flutter + 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 diff --git a/covid19_mobile_app/analysis_options.yaml b/covid19_mobile_app/analysis_options.yaml new file mode 100644 index 0000000..90b40f5 --- /dev/null +++ b/covid19_mobile_app/analysis_options.yaml @@ -0,0 +1,23 @@ +# Lint rules for Flutter apps. +# See https://dart.dev/guides/language/analysis-options +include: package:flutter_lints/flutter.yaml + +analyzer: + exclude: + - build/** + - android/** + - ios/** + - web/** + - windows/** + - macos/** + - linux/** + +linter: + rules: + # Noise in small sample apps; keep the code readable. + avoid_print: false + avoid_unnecessary_containers: false + file_names: false + library_private_types_in_public_api: false + non_constant_identifier_names: false + strict_top_level_inference: false diff --git a/covid19_mobile_app/android/app/src/main/AndroidManifest.xml b/covid19_mobile_app/android/app/src/main/AndroidManifest.xml index b949fb2..282714b 100644 --- a/covid19_mobile_app/android/app/src/main/AndroidManifest.xml +++ b/covid19_mobile_app/android/app/src/main/AndroidManifest.xml @@ -11,6 +11,7 @@ android:icon="@mipmap/ic_launcher"> runApp(MyApp()); class MyApp extends StatelessWidget { + const MyApp({super.key}); + @override Widget build(BuildContext context) { return MaterialApp( diff --git a/covid19_mobile_app/lib/screens/countrylist.dart b/covid19_mobile_app/lib/screens/countrylist.dart index 51eb96e..2e281f4 100644 --- a/covid19_mobile_app/lib/screens/countrylist.dart +++ b/covid19_mobile_app/lib/screens/countrylist.dart @@ -8,6 +8,8 @@ import 'dart:convert'; import 'package:folding_cell/folding_cell.dart'; class CountryList extends StatelessWidget { + const CountryList({super.key}); + @override Widget build(BuildContext context) { List results = []; @@ -31,25 +33,27 @@ class CountryList extends StatelessWidget { body: FutureBuilder( future: getAllCountriesData(), builder: (context, snapshot) { - if (snapshot.connectionState == ConnectionState.waiting) + if (snapshot.connectionState == ConnectionState.waiting) { return Center( child: CircularProgressIndicator(), ); - if (snapshot.hasError) + } + if (snapshot.hasError) { return Center( child: Text("Error! please check you wifi connection"), ); + } results = jsonDecode(snapshot.data); return ListView.builder( physics: BouncingScrollPhysics(), itemCount: results.length, itemBuilder: (context, index) { - var _foldingCellKey = GlobalKey(); + var foldingCellKey = GlobalKey(); return Container( color: Color(0xFF2e282a), alignment: Alignment.topCenter, child: SimpleFoldingCell.create( - key: _foldingCellKey, + key: foldingCellKey, frontWidget: Builder( builder: (BuildContext context) { return GestureDetector( diff --git a/covid19_mobile_app/lib/screens/home.dart b/covid19_mobile_app/lib/screens/home.dart index c4d6ca4..27201f1 100644 --- a/covid19_mobile_app/lib/screens/home.dart +++ b/covid19_mobile_app/lib/screens/home.dart @@ -9,6 +9,8 @@ import 'package:flutter/material.dart'; class Home extends StatelessWidget { final refreshKey = GlobalKey(); + Home({super.key}); + @override Widget build(BuildContext context) { return Scaffold( @@ -28,8 +30,9 @@ class Home extends StatelessWidget { future: getAllData(), builder: (context, snapshot) { // Display CircularProgressIndicator if data isn't fetched yet - if (snapshot.connectionState == ConnectionState.waiting) + if (snapshot.connectionState == ConnectionState.waiting) { return Center(child: CircularProgressIndicator()); + } // If in case an error occurs if (snapshot.hasError) { return Container( diff --git a/covid19_mobile_app/lib/screens/searchCountry.dart b/covid19_mobile_app/lib/screens/searchCountry.dart index 9619e7e..33c6c37 100644 --- a/covid19_mobile_app/lib/screens/searchCountry.dart +++ b/covid19_mobile_app/lib/screens/searchCountry.dart @@ -46,12 +46,12 @@ class CountrySearchDelegate extends SearchDelegate { physics: BouncingScrollPhysics(), itemCount: suggestionsList.length, itemBuilder: (context, index) { - var _foldingCellKey = GlobalKey(); + var foldingCellKey = GlobalKey(); return Container( color: Color(0xFF2e282a), alignment: Alignment.topCenter, child: SimpleFoldingCell.create( - key: _foldingCellKey, + key: foldingCellKey, frontWidget: Builder( builder: (BuildContext context) { return GestureDetector( @@ -122,12 +122,12 @@ class CountrySearchDelegate extends SearchDelegate { physics: BouncingScrollPhysics(), itemCount: suggestionsList.length, itemBuilder: (context, index) { - var _foldingCellKey = GlobalKey(); + var foldingCellKey = GlobalKey(); return Container( color: Color(0xFF2e282a), alignment: Alignment.topCenter, child: SimpleFoldingCell.create( - key: _foldingCellKey, + key: foldingCellKey, frontWidget: Builder( builder: (BuildContext context) { return GestureDetector( diff --git a/covid19_mobile_app/lib/widgets/drawer.dart b/covid19_mobile_app/lib/widgets/drawer.dart index 6b1bf8c..cd447d1 100644 --- a/covid19_mobile_app/lib/widgets/drawer.dart +++ b/covid19_mobile_app/lib/widgets/drawer.dart @@ -3,6 +3,8 @@ import '../screens/countrylist.dart'; import 'package:flutter/material.dart'; class DrawerWidget extends StatelessWidget { + const DrawerWidget({super.key}); + @override Widget build(BuildContext context) { return Drawer( diff --git a/covid19_mobile_app/lib/widgets/foldable_cell_widgets.dart b/covid19_mobile_app/lib/widgets/foldable_cell_widgets.dart index 433a444..4c47ab5 100644 --- a/covid19_mobile_app/lib/widgets/foldable_cell_widgets.dart +++ b/covid19_mobile_app/lib/widgets/foldable_cell_widgets.dart @@ -129,13 +129,13 @@ Widget buildInnerBottomWidget(String cases) { context.findAncestorStateOfType(); foldingCellState?.toggleFold(); }, - child: Text( - "Close", - ), style: TextButton.styleFrom( foregroundColor: Colors.black, shape: StadiumBorder(), - overlayColor: Colors.white.withOpacity(0.5), + overlayColor: Colors.white.withValues(alpha: 0.5), + ), + child: Text( + "Close", ), ), ], diff --git a/covid19_mobile_app/lib/widgets/info_card.dart b/covid19_mobile_app/lib/widgets/info_card.dart index d5803e4..ce62351 100644 --- a/covid19_mobile_app/lib/widgets/info_card.dart +++ b/covid19_mobile_app/lib/widgets/info_card.dart @@ -3,6 +3,8 @@ import 'package:flutter/material.dart'; // this is the rounded rectangle card widget that appears on the homescreen Widget infoCard(BuildContext context, String title, String number) { return Card( + shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(40.0)), + color: Color(0xfff44e3f), child: Column( mainAxisAlignment: MainAxisAlignment.center, children: [ @@ -25,7 +27,5 @@ Widget infoCard(BuildContext context, String title, String number) { ), ], ), - shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(40.0)), - color: Color(0xfff44e3f), ); } diff --git a/covid19_mobile_app/pubspec.yaml b/covid19_mobile_app/pubspec.yaml index 09c7a9e..3ec5fc2 100644 --- a/covid19_mobile_app/pubspec.yaml +++ b/covid19_mobile_app/pubspec.yaml @@ -35,6 +35,7 @@ dependencies: dev_dependencies: flutter_test: sdk: flutter + 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 diff --git a/custom_home_drawer/analysis_options.yaml b/custom_home_drawer/analysis_options.yaml index 5bee4ff..90b40f5 100644 --- a/custom_home_drawer/analysis_options.yaml +++ b/custom_home_drawer/analysis_options.yaml @@ -1,12 +1,7 @@ -# This file configures the analyzer, which statically analyzes Dart code to -# check for errors, warnings, and lints. -# -# The issues identified by the analyzer are surfaced in the UI of Dart-enabled -# IDEs (https://dart.dev/tools#ides-and-editors). The analyzer can also be -# invoked from the command line by running `flutter analyze`. +# Lint rules for Flutter apps. +# See https://dart.dev/guides/language/analysis-options +include: package:flutter_lints/flutter.yaml -# The following line activates a set of recommended lints for Flutter apps, -# packages, and plugins designed to encourage good coding practices. analyzer: exclude: - build/** @@ -16,23 +11,13 @@ analyzer: - windows/** - macos/** - linux/** -include: package:flutter_lints/flutter.yaml linter: - # The lint rules applied to this project can be customized in the - # section below to disable rules from the `package:flutter_lints/flutter.yaml` - # included above or to enable additional rules. A list of all available lints - # and their documentation is published at - # https://dart-lang.github.io/linter/lints/index.html. - # - # Instead of disabling a lint rule for the entire project in the - # section below, it can also be suppressed for a single line of code - # or a specific dart file by using the `// ignore: name_of_lint` and - # `// ignore_for_file: name_of_lint` syntax on the line or in the file - # producing the lint. rules: - # avoid_print: false # Uncomment to disable the `avoid_print` rule - # prefer_single_quotes: true # Uncomment to enable the `prefer_single_quotes` rule - -# Additional information about this file can be found at -# https://dart.dev/guides/language/analysis-options + # Noise in small sample apps; keep the code readable. + avoid_print: false + avoid_unnecessary_containers: false + file_names: false + library_private_types_in_public_api: false + non_constant_identifier_names: false + strict_top_level_inference: false diff --git a/custom_home_drawer/lib/screen/home_screen.dart b/custom_home_drawer/lib/screen/home_screen.dart index 46b91cc..c3fa074 100644 --- a/custom_home_drawer/lib/screen/home_screen.dart +++ b/custom_home_drawer/lib/screen/home_screen.dart @@ -1,13 +1,14 @@ import 'package:flutter/material.dart'; class HomeScreen extends StatefulWidget { - const HomeScreen({Key? key}) : super(key: key); + const HomeScreen({super.key}); @override State createState() => _HomeScreenState(); } -class _HomeScreenState extends State with SingleTickerProviderStateMixin { +class _HomeScreenState extends State + with SingleTickerProviderStateMixin { late final AnimationController _controller = AnimationController( vsync: this, duration: const Duration(milliseconds: 350), @@ -18,11 +19,14 @@ class _HomeScreenState extends State with SingleTickerProviderStateM int _counter = 0; bool _canDragged = false; - void _openCloseDrawer() => _controller.isDismissed ? _controller.forward() : _controller.reverse(); + void _openCloseDrawer() => + _controller.isDismissed ? _controller.forward() : _controller.reverse(); void _onDragStart(DragStartDetails details) { - bool isDragLeft = _controller.isDismissed && details.globalPosition.dx < dragStartPosition; - bool isDragRight = _controller.isCompleted && details.globalPosition.dx > dragStartPosition; + bool isDragLeft = _controller.isDismissed && + details.globalPosition.dx < dragStartPosition; + bool isDragRight = _controller.isCompleted && + details.globalPosition.dx > dragStartPosition; _canDragged = isDragLeft || isDragRight; } @@ -38,7 +42,8 @@ class _HomeScreenState extends State with SingleTickerProviderStateM return; } if (details.velocity.pixelsPerSecond.dx.abs() >= 365) { - var visualVelocity = details.velocity.pixelsPerSecond.dx / MediaQuery.of(context).size.width; + var visualVelocity = details.velocity.pixelsPerSecond.dx / + MediaQuery.of(context).size.width; _controller.fling(velocity: visualVelocity); } else if (_controller.value < 0.5) { _controller.reverse(); @@ -66,9 +71,9 @@ class _HomeScreenState extends State with SingleTickerProviderStateM _homeDrawer(context), Transform( transform: Matrix4.identity() - ..translate(slide) + ..translateByDouble(slide, 0, 0, 1) ..rotateZ(rotate) - ..scale(scale), + ..scaleByDouble(scale, scale, scale, 1), alignment: Alignment.centerLeft, child: _homeView(context), ) diff --git a/custom_home_drawer/pubspec.yaml b/custom_home_drawer/pubspec.yaml index 3cdae27..bab3dc5 100644 --- a/custom_home_drawer/pubspec.yaml +++ b/custom_home_drawer/pubspec.yaml @@ -20,7 +20,7 @@ publish_to: 'none' # Remove this line if you wish to publish to pub.dev version: 1.0.0+1 environment: - sdk: '>=2.18.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 diff --git a/dropdown_button/analysis_options.yaml b/dropdown_button/analysis_options.yaml new file mode 100644 index 0000000..90b40f5 --- /dev/null +++ b/dropdown_button/analysis_options.yaml @@ -0,0 +1,23 @@ +# Lint rules for Flutter apps. +# See https://dart.dev/guides/language/analysis-options +include: package:flutter_lints/flutter.yaml + +analyzer: + exclude: + - build/** + - android/** + - ios/** + - web/** + - windows/** + - macos/** + - linux/** + +linter: + rules: + # Noise in small sample apps; keep the code readable. + avoid_print: false + avoid_unnecessary_containers: false + file_names: false + library_private_types_in_public_api: false + non_constant_identifier_names: false + strict_top_level_inference: false diff --git a/dropdown_button/android/app/src/main/AndroidManifest.xml b/dropdown_button/android/app/src/main/AndroidManifest.xml index 47a153a..bccbf8c 100644 --- a/dropdown_button/android/app/src/main/AndroidManifest.xml +++ b/dropdown_button/android/app/src/main/AndroidManifest.xml @@ -18,6 +18,7 @@ android:icon="@mipmap/ic_launcher"> runApp(MyApp()); class MyApp extends StatefulWidget { + const MyApp({super.key}); + @override State createState() { return MyAppState(); @@ -10,7 +12,7 @@ class MyApp extends StatefulWidget { } class MyAppState extends State { - List _fruits = ["Apple", "Banana", "Pineapple", "Mango", "Grapes"]; + final List _fruits = ["Apple", "Banana", "Pineapple", "Mango", "Grapes"]; late List> _dropDownMenuItems; late String _selectedFruit; diff --git a/dropdown_button/pubspec.yaml b/dropdown_button/pubspec.yaml index 2a8e5a1..37a6c1e 100644 --- a/dropdown_button/pubspec.yaml +++ b/dropdown_button/pubspec.yaml @@ -15,6 +15,7 @@ dependencies: dev_dependencies: flutter_test: sdk: flutter + flutter_lints: ^6.0.0 # For information on the generic Dart part of this file, see the diff --git a/enabling_splash_screen/analysis_options.yaml b/enabling_splash_screen/analysis_options.yaml new file mode 100644 index 0000000..90b40f5 --- /dev/null +++ b/enabling_splash_screen/analysis_options.yaml @@ -0,0 +1,23 @@ +# Lint rules for Flutter apps. +# See https://dart.dev/guides/language/analysis-options +include: package:flutter_lints/flutter.yaml + +analyzer: + exclude: + - build/** + - android/** + - ios/** + - web/** + - windows/** + - macos/** + - linux/** + +linter: + rules: + # Noise in small sample apps; keep the code readable. + avoid_print: false + avoid_unnecessary_containers: false + file_names: false + library_private_types_in_public_api: false + non_constant_identifier_names: false + strict_top_level_inference: false diff --git a/enabling_splash_screen/android/app/src/main/AndroidManifest.xml b/enabling_splash_screen/android/app/src/main/AndroidManifest.xml index b8c3c20..8016c04 100644 --- a/enabling_splash_screen/android/app/src/main/AndroidManifest.xml +++ b/enabling_splash_screen/android/app/src/main/AndroidManifest.xml @@ -18,6 +18,7 @@ android:icon="@mipmap/ic_launcher"> runApp(MyApp()); class MyApp extends StatelessWidget { + const MyApp({super.key}); + // This widget is the root of your application. @override Widget build(BuildContext context) { diff --git a/enabling_splash_screen/pubspec.yaml b/enabling_splash_screen/pubspec.yaml index 3b8ebd3..306a8d6 100644 --- a/enabling_splash_screen/pubspec.yaml +++ b/enabling_splash_screen/pubspec.yaml @@ -15,6 +15,7 @@ dependencies: dev_dependencies: flutter_test: sdk: flutter + flutter_lints: ^6.0.0 # For information on the generic Dart part of this file, see the diff --git a/expense_planner/analysis_options.yaml b/expense_planner/analysis_options.yaml new file mode 100644 index 0000000..90b40f5 --- /dev/null +++ b/expense_planner/analysis_options.yaml @@ -0,0 +1,23 @@ +# Lint rules for Flutter apps. +# See https://dart.dev/guides/language/analysis-options +include: package:flutter_lints/flutter.yaml + +analyzer: + exclude: + - build/** + - android/** + - ios/** + - web/** + - windows/** + - macos/** + - linux/** + +linter: + rules: + # Noise in small sample apps; keep the code readable. + avoid_print: false + avoid_unnecessary_containers: false + file_names: false + library_private_types_in_public_api: false + non_constant_identifier_names: false + strict_top_level_inference: false diff --git a/expense_planner/android/app/src/main/AndroidManifest.xml b/expense_planner/android/app/src/main/AndroidManifest.xml index c7ab651..6683bd8 100644 --- a/expense_planner/android/app/src/main/AndroidManifest.xml +++ b/expense_planner/android/app/src/main/AndroidManifest.xml @@ -12,6 +12,7 @@ android:icon="@mipmap/ic_launcher"> - -NS_ASSUME_NONNULL_BEGIN - -@interface GeneratedPluginRegistrant : NSObject -+ (void)registerWithRegistry:(NSObject*)registry; -@end - -NS_ASSUME_NONNULL_END -#endif /* GeneratedPluginRegistrant_h */ diff --git a/expense_planner/ios/Runner/GeneratedPluginRegistrant.m b/expense_planner/ios/Runner/GeneratedPluginRegistrant.m deleted file mode 100644 index efe65ec..0000000 --- a/expense_planner/ios/Runner/GeneratedPluginRegistrant.m +++ /dev/null @@ -1,14 +0,0 @@ -// -// Generated file. Do not edit. -// - -// clang-format off - -#import "GeneratedPluginRegistrant.h" - -@implementation GeneratedPluginRegistrant - -+ (void)registerWithRegistry:(NSObject*)registry { -} - -@end diff --git a/expense_planner/lib/main.dart b/expense_planner/lib/main.dart index ec65952..1cdd60f 100644 --- a/expense_planner/lib/main.dart +++ b/expense_planner/lib/main.dart @@ -8,6 +8,8 @@ import './models/transaction.dart'; void main() => runApp(MyApp()); class MyApp extends StatelessWidget { + const MyApp({super.key}); + @override Widget build(BuildContext context) { return MaterialApp( @@ -38,6 +40,8 @@ class MyApp extends StatelessWidget { } class MyHomePage extends StatefulWidget { + const MyHomePage({super.key}); + @override _MyHomePageState createState() => _MyHomePageState(); } @@ -75,8 +79,8 @@ class _MyHomePageState extends State { builder: (_) { return GestureDetector( onTap: () {}, - child: NewTransaction(_addNewTransaction), behavior: HitTestBehavior.opaque, + child: NewTransaction(_addNewTransaction), ); }, ); diff --git a/expense_planner/lib/widgets/chart.dart b/expense_planner/lib/widgets/chart.dart index f7ba95e..3d884d8 100644 --- a/expense_planner/lib/widgets/chart.dart +++ b/expense_planner/lib/widgets/chart.dart @@ -7,7 +7,7 @@ import '../models/transaction.dart'; class Chart extends StatelessWidget { final List recentTransactions; - Chart(this.recentTransactions); + const Chart(this.recentTransactions, {super.key}); List> get groupedTransactionValues { return List.generate(7, (index) { diff --git a/expense_planner/lib/widgets/chart_bar.dart b/expense_planner/lib/widgets/chart_bar.dart index bd74cac..cf9e5e8 100644 --- a/expense_planner/lib/widgets/chart_bar.dart +++ b/expense_planner/lib/widgets/chart_bar.dart @@ -5,13 +5,13 @@ class ChartBar extends StatelessWidget { final double spendingAmount; final double spendingPctOfTotal; - ChartBar(this.label, this.spendingAmount, this.spendingPctOfTotal); + const ChartBar(this.label, this.spendingAmount, this.spendingPctOfTotal, {super.key}); @override Widget build(BuildContext context) { return Column( children: [ - Container( + SizedBox( height: 20, child: FittedBox( child: Text('\$${spendingAmount.toStringAsFixed(0)}'), @@ -20,7 +20,7 @@ class ChartBar extends StatelessWidget { SizedBox( height: 4, ), - Container( + SizedBox( height: 60, width: 10, child: Stack( diff --git a/expense_planner/lib/widgets/new_transaction.dart b/expense_planner/lib/widgets/new_transaction.dart index bf381a6..a891d92 100644 --- a/expense_planner/lib/widgets/new_transaction.dart +++ b/expense_planner/lib/widgets/new_transaction.dart @@ -4,7 +4,7 @@ import 'package:intl/intl.dart'; class NewTransaction extends StatefulWidget { final Function addTx; - NewTransaction(this.addTx); + const NewTransaction(this.addTx, {super.key}); @override _NewTransactionState createState() => _NewTransactionState(); @@ -72,7 +72,7 @@ class _NewTransactionState extends State { keyboardType: TextInputType.number, onSubmitted: (_) => _submitData(), ), - Container( + SizedBox( height: 70, child: Row( children: [ diff --git a/expense_planner/lib/widgets/transaction_list.dart b/expense_planner/lib/widgets/transaction_list.dart index 6a4be57..61012db 100644 --- a/expense_planner/lib/widgets/transaction_list.dart +++ b/expense_planner/lib/widgets/transaction_list.dart @@ -7,11 +7,11 @@ class TransactionList extends StatelessWidget { final List transactions; final Function deleteTx; - TransactionList(this.transactions, this.deleteTx); + const TransactionList(this.transactions, this.deleteTx, {super.key}); @override Widget build(BuildContext context) { - return Container( + return SizedBox( height: 450, child: transactions.isEmpty ? Column( @@ -23,7 +23,7 @@ class TransactionList extends StatelessWidget { SizedBox( height: 20, ), - Container( + SizedBox( height: 200, child: Image.asset( 'assets/images/waiting.png', diff --git a/expense_planner/lib/widgets/user_transactions.dart b/expense_planner/lib/widgets/user_transactions.dart index b71dccd..abba6e5 100644 --- a/expense_planner/lib/widgets/user_transactions.dart +++ b/expense_planner/lib/widgets/user_transactions.dart @@ -5,6 +5,8 @@ import './transaction_list.dart'; import '../models/transaction.dart'; class UserTransactions extends StatefulWidget { + const UserTransactions({super.key}); + @override _UserTransactionsState createState() => _UserTransactionsState(); } diff --git a/expense_planner/pubspec.yaml b/expense_planner/pubspec.yaml index f5e4b32..fb1263c 100644 --- a/expense_planner/pubspec.yaml +++ b/expense_planner/pubspec.yaml @@ -28,6 +28,7 @@ dependencies: dev_dependencies: flutter_test: sdk: flutter + flutter_lints: ^6.0.0 # For information on the generic Dart part of this file, see the diff --git a/firebase_crash_reporting/analysis_options.yaml b/firebase_crash_reporting/analysis_options.yaml new file mode 100644 index 0000000..90b40f5 --- /dev/null +++ b/firebase_crash_reporting/analysis_options.yaml @@ -0,0 +1,23 @@ +# Lint rules for Flutter apps. +# See https://dart.dev/guides/language/analysis-options +include: package:flutter_lints/flutter.yaml + +analyzer: + exclude: + - build/** + - android/** + - ios/** + - web/** + - windows/** + - macos/** + - linux/** + +linter: + rules: + # Noise in small sample apps; keep the code readable. + avoid_print: false + avoid_unnecessary_containers: false + file_names: false + library_private_types_in_public_api: false + non_constant_identifier_names: false + strict_top_level_inference: false diff --git a/firebase_crash_reporting/android/app/src/main/AndroidManifest.xml b/firebase_crash_reporting/android/app/src/main/AndroidManifest.xml index b948ab9..d830ddd 100644 --- a/firebase_crash_reporting/android/app/src/main/AndroidManifest.xml +++ b/firebase_crash_reporting/android/app/src/main/AndroidManifest.xml @@ -11,6 +11,7 @@ android:icon="@mipmap/ic_launcher"> _initializeFirebase() async { @@ -56,6 +58,8 @@ class App extends StatelessWidget { } class CrashApp extends StatelessWidget { + const CrashApp({super.key}); + @override Widget build(BuildContext context) { return Center( diff --git a/firebase_crash_reporting/pubspec.yaml b/firebase_crash_reporting/pubspec.yaml index 03bb404..283eb69 100644 --- a/firebase_crash_reporting/pubspec.yaml +++ b/firebase_crash_reporting/pubspec.yaml @@ -34,6 +34,7 @@ dependencies: dev_dependencies: flutter_test: sdk: flutter + 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 diff --git a/firebase_google_authentication/analysis_options.yaml b/firebase_google_authentication/analysis_options.yaml new file mode 100644 index 0000000..90b40f5 --- /dev/null +++ b/firebase_google_authentication/analysis_options.yaml @@ -0,0 +1,23 @@ +# Lint rules for Flutter apps. +# See https://dart.dev/guides/language/analysis-options +include: package:flutter_lints/flutter.yaml + +analyzer: + exclude: + - build/** + - android/** + - ios/** + - web/** + - windows/** + - macos/** + - linux/** + +linter: + rules: + # Noise in small sample apps; keep the code readable. + avoid_print: false + avoid_unnecessary_containers: false + file_names: false + library_private_types_in_public_api: false + non_constant_identifier_names: false + strict_top_level_inference: false diff --git a/firebase_google_authentication/android/app/src/main/AndroidManifest.xml b/firebase_google_authentication/android/app/src/main/AndroidManifest.xml index 145d538..5a426e7 100644 --- a/firebase_google_authentication/android/app/src/main/AndroidManifest.xml +++ b/firebase_google_authentication/android/app/src/main/AndroidManifest.xml @@ -5,6 +5,7 @@ android:icon="@mipmap/ic_launcher"> _HomePageState(); @@ -62,7 +62,7 @@ class _HomePageState extends State { Row( mainAxisAlignment: MainAxisAlignment.center, children: [ - Container( + SizedBox( width: size.width * 0.8, child: ClipRRect( borderRadius: BorderRadius.circular(29), @@ -92,7 +92,7 @@ class _HomePageState extends State { SizedBox( height: 15, ), - Container( + SizedBox( width: size.width * 0.8, child: ClipRRect( borderRadius: BorderRadius.circular(29), diff --git a/firebase_google_authentication/lib/Screens/InfoPage.dart b/firebase_google_authentication/lib/Screens/InfoPage.dart index e640e5f..da9fc00 100644 --- a/firebase_google_authentication/lib/Screens/InfoPage.dart +++ b/firebase_google_authentication/lib/Screens/InfoPage.dart @@ -4,7 +4,7 @@ import 'package:flutter/material.dart'; import 'package:provider/provider.dart'; class InfoPage extends StatefulWidget { - const InfoPage({Key? key}) : super(key: key); + const InfoPage({super.key}); @override _InfoPageState createState() => _InfoPageState(); @@ -53,7 +53,7 @@ class _InfoPageState extends State { height: 15, ), Text( - user!.email ?? '', + user.email ?? '', style: TextStyle(fontSize: 18, fontWeight: FontWeight.w500), ), ], diff --git a/firebase_google_authentication/lib/Screens/SignUpPage.dart b/firebase_google_authentication/lib/Screens/SignUpPage.dart index 395bd61..5a5c8f3 100644 --- a/firebase_google_authentication/lib/Screens/SignUpPage.dart +++ b/firebase_google_authentication/lib/Screens/SignUpPage.dart @@ -7,23 +7,28 @@ import 'package:google_fonts/google_fonts.dart'; import 'package:provider/provider.dart'; class SignUpPage extends StatefulWidget { - bool isLogin; - SignUpPage(this.isLogin); + final bool isLogin; + const SignUpPage(this.isLogin, {super.key}); @override - _SignUpPageState createState() => _SignUpPageState(isLogin); + State createState() => _SignUpPageState(); } class _SignUpPageState extends State { - bool isLogin; - _SignUpPageState(this.isLogin); + late bool isLogin; + + @override + void initState() { + super.initState(); + isLogin = widget.isLogin; + } bool loggingIn = false; - TextEditingController email = new TextEditingController(); - TextEditingController password = new TextEditingController(); + TextEditingController email = TextEditingController(); + TextEditingController password = TextEditingController(); bool showPassword = false; void showSnackBar() { - final snackBar = new SnackBar( + final snackBar = SnackBar( content: Text('Invalid Credentials!'), backgroundColor: Colors.red, padding: EdgeInsets.symmetric(horizontal: 10), @@ -40,7 +45,7 @@ class _SignUpPageState extends State { final Size size = MediaQuery.of(context).size; return Scaffold( body: SingleChildScrollView( - child: Container( + child: SizedBox( height: size.height, width: double.infinity, child: Stack( @@ -136,7 +141,7 @@ class _SignUpPageState extends State { SizedBox( height: 30, ), - Container( + SizedBox( width: size.width * 0.8, child: ClipRRect( borderRadius: BorderRadius.circular(29), @@ -147,11 +152,11 @@ class _SignUpPageState extends State { backgroundColor: Color(0xFF6F35A5), ), onPressed: () { - String _email = email.text; - String _password = password.text; + String emailText = email.text; + String passwordText = password.text; !(isLogin) - ? signUpClicked(_email, _password, context) - : loginClicked(_email, _password, context); + ? signUpClicked(emailText, passwordText, context) + : loginClicked(emailText, passwordText, context); }, child: Text( (isLogin) ? 'Login' : 'SignUp', @@ -166,7 +171,7 @@ class _SignUpPageState extends State { SizedBox( height: 18, ), - Container( + SizedBox( width: size.width * 0.81, child: ClipRRect( borderRadius: BorderRadius.circular(29), @@ -181,6 +186,7 @@ class _SignUpPageState extends State { context, listen: false); provider.googleLogin().then((value) { + if (!context.mounted) return; Navigator.popUntil( context, (route) => route.isFirst); }).catchError((onError) { @@ -242,14 +248,15 @@ class _SignUpPageState extends State { ); } - signUpClicked(String _email, String _password, BuildContext context) { + void signUpClicked(String email, String password, BuildContext context) { FirebaseAuth.instance - .createUserWithEmailAndPassword(email: _email, password: _password) + .createUserWithEmailAndPassword(email: email, password: password) .then((value) { setState(() { loggingIn = true; }); Future.delayed(Duration(seconds: 1, milliseconds: 50), () { + if (!context.mounted) return; Navigator.popUntil(context, (route) => route.isFirst); }); }).catchError((e) { @@ -257,14 +264,15 @@ class _SignUpPageState extends State { }); } - bool loginClicked(String _email, String _password, BuildContext context) { + bool loginClicked(String email, String password, BuildContext context) { FirebaseAuth.instance - .signInWithEmailAndPassword(email: _email, password: _password) + .signInWithEmailAndPassword(email: email, password: password) .then((value) { setState(() { loggingIn = true; }); Future.delayed(Duration(seconds: 1, milliseconds: 50), () { + if (!context.mounted) return; Navigator.pop(context); }); }).catchError((e) { diff --git a/firebase_google_authentication/lib/Services/google_auth.dart b/firebase_google_authentication/lib/Services/google_auth.dart index 052e144..88ee22d 100644 --- a/firebase_google_authentication/lib/Services/google_auth.dart +++ b/firebase_google_authentication/lib/Services/google_auth.dart @@ -15,10 +15,9 @@ class GoogleSignInProvider extends ChangeNotifier { try { await googleSignIn.initialize(); final googleUser = await googleSignIn.authenticate(); - if (googleUser == null) return; _user = googleUser; - final googleAuth = await googleUser.authentication; + final googleAuth = googleUser.authentication; final credentials = GoogleAuthProvider.credential( idToken: googleAuth.idToken, diff --git a/firebase_google_authentication/lib/main.dart b/firebase_google_authentication/lib/main.dart index d9a83fc..a18d4e2 100644 --- a/firebase_google_authentication/lib/main.dart +++ b/firebase_google_authentication/lib/main.dart @@ -11,7 +11,7 @@ void main() async{ } class MyApp extends StatelessWidget { - const MyApp({Key? key}) : super(key: key); + const MyApp({super.key}); @override Widget build(BuildContext context) { diff --git a/firebase_google_authentication/pubspec.yaml b/firebase_google_authentication/pubspec.yaml index c6ea425..b770ab9 100644 --- a/firebase_google_authentication/pubspec.yaml +++ b/firebase_google_authentication/pubspec.yaml @@ -40,6 +40,7 @@ dependencies: dev_dependencies: flutter_test: sdk: flutter + 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 diff --git a/getx_counter_app/analysis_options.yaml b/getx_counter_app/analysis_options.yaml index 5bee4ff..90b40f5 100644 --- a/getx_counter_app/analysis_options.yaml +++ b/getx_counter_app/analysis_options.yaml @@ -1,12 +1,7 @@ -# This file configures the analyzer, which statically analyzes Dart code to -# check for errors, warnings, and lints. -# -# The issues identified by the analyzer are surfaced in the UI of Dart-enabled -# IDEs (https://dart.dev/tools#ides-and-editors). The analyzer can also be -# invoked from the command line by running `flutter analyze`. +# Lint rules for Flutter apps. +# See https://dart.dev/guides/language/analysis-options +include: package:flutter_lints/flutter.yaml -# The following line activates a set of recommended lints for Flutter apps, -# packages, and plugins designed to encourage good coding practices. analyzer: exclude: - build/** @@ -16,23 +11,13 @@ analyzer: - windows/** - macos/** - linux/** -include: package:flutter_lints/flutter.yaml linter: - # The lint rules applied to this project can be customized in the - # section below to disable rules from the `package:flutter_lints/flutter.yaml` - # included above or to enable additional rules. A list of all available lints - # and their documentation is published at - # https://dart-lang.github.io/linter/lints/index.html. - # - # Instead of disabling a lint rule for the entire project in the - # section below, it can also be suppressed for a single line of code - # or a specific dart file by using the `// ignore: name_of_lint` and - # `// ignore_for_file: name_of_lint` syntax on the line or in the file - # producing the lint. rules: - # avoid_print: false # Uncomment to disable the `avoid_print` rule - # prefer_single_quotes: true # Uncomment to enable the `prefer_single_quotes` rule - -# Additional information about this file can be found at -# https://dart.dev/guides/language/analysis-options + # Noise in small sample apps; keep the code readable. + avoid_print: false + avoid_unnecessary_containers: false + file_names: false + library_private_types_in_public_api: false + non_constant_identifier_names: false + strict_top_level_inference: false diff --git a/getx_counter_app/android/app/build.gradle.kts b/getx_counter_app/android/app/build.gradle.kts index c25ebe1..e402b2e 100644 --- a/getx_counter_app/android/app/build.gradle.kts +++ b/getx_counter_app/android/app/build.gradle.kts @@ -6,7 +6,7 @@ plugins { } android { - namespace = "com.example.getx_counter_app" + namespace = "github.nisrulz.getx_counter_app" compileSdk = flutter.compileSdkVersion ndkVersion = flutter.ndkVersion @@ -16,7 +16,7 @@ android { } defaultConfig { - applicationId = "com.example.getx_counter_app" + applicationId = "github.nisrulz.getx_counter_app" minSdk = flutter.minSdkVersion targetSdk = flutter.targetSdkVersion versionCode = flutter.versionCode diff --git a/getx_counter_app/android/app/src/debug/AndroidManifest.xml b/getx_counter_app/android/app/src/debug/AndroidManifest.xml index 55dcde7..f880684 100644 --- a/getx_counter_app/android/app/src/debug/AndroidManifest.xml +++ b/getx_counter_app/android/app/src/debug/AndroidManifest.xml @@ -1,5 +1,4 @@ - + diff --git a/getx_counter_app/android/app/src/profile/AndroidManifest.xml b/getx_counter_app/android/app/src/profile/AndroidManifest.xml index 55dcde7..f880684 100644 --- a/getx_counter_app/android/app/src/profile/AndroidManifest.xml +++ b/getx_counter_app/android/app/src/profile/AndroidManifest.xml @@ -1,5 +1,4 @@ - + diff --git a/getx_counter_app/lib/main.dart b/getx_counter_app/lib/main.dart index c67965f..00bce94 100644 --- a/getx_counter_app/lib/main.dart +++ b/getx_counter_app/lib/main.dart @@ -7,7 +7,7 @@ void main() { } class MyApp extends StatelessWidget { - const MyApp({Key? key}) : super(key: key); + const MyApp({super.key}); @override Widget build(BuildContext context) { @@ -22,12 +22,12 @@ class MyApp extends StatelessWidget { } class MyHomePage extends StatelessWidget { - const MyHomePage({Key? key}) : super(key: key); + const MyHomePage({super.key}); @override Widget build(BuildContext context) { // create variable that hold out number with .obs parameter (.obs comes from getx state management) - var _counter = 0.obs; + var counter = 0.obs; return Scaffold( appBar: AppBar( title: const Text("Counter app with Getx (Get) state management"), @@ -43,7 +43,7 @@ class MyHomePage extends StatelessWidget { // in get (getx) we must ue Obx for the widget that we want to change like setState in statefull widget\ Obx(() => Text( // we can show our variable by call .value method - '${_counter.value}', + '${counter.value}', style: Theme.of(context).textTheme.headlineSmall, )), ], @@ -51,7 +51,7 @@ class MyHomePage extends StatelessWidget { ), floatingActionButton: FloatingActionButton( // we can plus or everything that we want by add .value method to our obs variable - onPressed: () => _counter.value++, + onPressed: () => counter.value++, tooltip: 'Increment', child: const Icon(Icons.add), )); diff --git a/google_signin/.flutter-plugins-dependencies b/google_signin/.flutter-plugins-dependencies deleted file mode 100644 index 29f0a17..0000000 --- a/google_signin/.flutter-plugins-dependencies +++ /dev/null @@ -1 +0,0 @@ -{"info":"This is a generated file; do not edit or check into version control.","plugins":{"ios":[{"name":"firebase_auth","path":"/Users/nishantsrivastava/.pub-cache/hosted/pub.dev/firebase_auth-6.5.7/","native_build":true,"dependencies":["firebase_core"],"dev_dependency":false},{"name":"firebase_core","path":"/Users/nishantsrivastava/.pub-cache/hosted/pub.dev/firebase_core-4.13.0/","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"google_sign_in_ios","path":"/Users/nishantsrivastava/.pub-cache/hosted/pub.dev/google_sign_in_ios-6.3.0/","shared_darwin_source":true,"native_build":true,"dependencies":[],"dev_dependency":false}],"android":[{"name":"firebase_auth","path":"/Users/nishantsrivastava/.pub-cache/hosted/pub.dev/firebase_auth-6.5.7/","native_build":true,"dependencies":["firebase_core"],"dev_dependency":false},{"name":"firebase_core","path":"/Users/nishantsrivastava/.pub-cache/hosted/pub.dev/firebase_core-4.13.0/","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"google_sign_in_android","path":"/Users/nishantsrivastava/.pub-cache/hosted/pub.dev/google_sign_in_android-7.2.16/","native_build":true,"dependencies":[],"dev_dependency":false}],"macos":[{"name":"firebase_auth","path":"/Users/nishantsrivastava/.pub-cache/hosted/pub.dev/firebase_auth-6.5.7/","native_build":true,"dependencies":["firebase_core"],"dev_dependency":false},{"name":"firebase_core","path":"/Users/nishantsrivastava/.pub-cache/hosted/pub.dev/firebase_core-4.13.0/","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"google_sign_in_ios","path":"/Users/nishantsrivastava/.pub-cache/hosted/pub.dev/google_sign_in_ios-6.3.0/","shared_darwin_source":true,"native_build":true,"dependencies":[],"dev_dependency":false}],"linux":[],"windows":[{"name":"firebase_auth","path":"/Users/nishantsrivastava/.pub-cache/hosted/pub.dev/firebase_auth-6.5.7/","native_build":true,"dependencies":["firebase_core"],"dev_dependency":false},{"name":"firebase_core","path":"/Users/nishantsrivastava/.pub-cache/hosted/pub.dev/firebase_core-4.13.0/","native_build":true,"dependencies":[],"dev_dependency":false}],"web":[{"name":"firebase_auth_web","path":"/Users/nishantsrivastava/.pub-cache/hosted/pub.dev/firebase_auth_web-6.2.6/","dependencies":["firebase_core_web"],"dev_dependency":false},{"name":"firebase_core_web","path":"/Users/nishantsrivastava/.pub-cache/hosted/pub.dev/firebase_core_web-3.10.0/","dependencies":[],"dev_dependency":false},{"name":"google_sign_in_web","path":"/Users/nishantsrivastava/.pub-cache/hosted/pub.dev/google_sign_in_web-1.1.3/","dependencies":[],"dev_dependency":false}]},"dependencyGraph":[{"name":"firebase_auth","dependencies":["firebase_auth_web","firebase_core"]},{"name":"firebase_auth_web","dependencies":["firebase_core","firebase_core_web"]},{"name":"firebase_core","dependencies":["firebase_core_web"]},{"name":"firebase_core_web","dependencies":[]},{"name":"google_sign_in","dependencies":["google_sign_in_android","google_sign_in_ios","google_sign_in_web"]},{"name":"google_sign_in_android","dependencies":[]},{"name":"google_sign_in_ios","dependencies":[]},{"name":"google_sign_in_web","dependencies":[]}],"date_created":"2026-08-16 19:48:53.354040","version":"3.47.0","swift_package_manager_enabled":{"ios":false,"macos":false}} \ No newline at end of file diff --git a/google_signin/analysis_options.yaml b/google_signin/analysis_options.yaml new file mode 100644 index 0000000..90b40f5 --- /dev/null +++ b/google_signin/analysis_options.yaml @@ -0,0 +1,23 @@ +# Lint rules for Flutter apps. +# See https://dart.dev/guides/language/analysis-options +include: package:flutter_lints/flutter.yaml + +analyzer: + exclude: + - build/** + - android/** + - ios/** + - web/** + - windows/** + - macos/** + - linux/** + +linter: + rules: + # Noise in small sample apps; keep the code readable. + avoid_print: false + avoid_unnecessary_containers: false + file_names: false + library_private_types_in_public_api: false + non_constant_identifier_names: false + strict_top_level_inference: false diff --git a/google_signin/android/app/src/main/AndroidManifest.xml b/google_signin/android/app/src/main/AndroidManifest.xml index 23244f8..a9151d5 100644 --- a/google_signin/android/app/src/main/AndroidManifest.xml +++ b/google_signin/android/app/src/main/AndroidManifest.xml @@ -18,6 +18,7 @@ android:icon="@mipmap/ic_launcher"> [ - Image(image: AssetImage('data_repo/img/' + image)), + Image(image: AssetImage('data_repo/img/$image')), Center( child: Text(name), ) diff --git a/grid_layout/lib/main.dart b/grid_layout/lib/main.dart index f270c89..9880e47 100644 --- a/grid_layout/lib/main.dart +++ b/grid_layout/lib/main.dart @@ -6,6 +6,8 @@ void main() => runApp(MyApp()); class MyApp extends StatelessWidget { final MyGridView myGridView = MyGridView(); + MyApp({super.key}); + @override Widget build(BuildContext context) { return MaterialApp( diff --git a/grid_layout/pubspec.yaml b/grid_layout/pubspec.yaml index a3701b5..43970dc 100644 --- a/grid_layout/pubspec.yaml +++ b/grid_layout/pubspec.yaml @@ -15,6 +15,7 @@ dependencies: dev_dependencies: flutter_test: sdk: flutter + flutter_lints: ^6.0.0 # For information on the generic Dart part of this file, see the diff --git a/handling_routes/analysis_options.yaml b/handling_routes/analysis_options.yaml new file mode 100644 index 0000000..90b40f5 --- /dev/null +++ b/handling_routes/analysis_options.yaml @@ -0,0 +1,23 @@ +# Lint rules for Flutter apps. +# See https://dart.dev/guides/language/analysis-options +include: package:flutter_lints/flutter.yaml + +analyzer: + exclude: + - build/** + - android/** + - ios/** + - web/** + - windows/** + - macos/** + - linux/** + +linter: + rules: + # Noise in small sample apps; keep the code readable. + avoid_print: false + avoid_unnecessary_containers: false + file_names: false + library_private_types_in_public_api: false + non_constant_identifier_names: false + strict_top_level_inference: false diff --git a/handling_routes/android/app/src/main/AndroidManifest.xml b/handling_routes/android/app/src/main/AndroidManifest.xml index 247db34..3bbcb5d 100644 --- a/handling_routes/android/app/src/main/AndroidManifest.xml +++ b/handling_routes/android/app/src/main/AndroidManifest.xml @@ -14,6 +14,7 @@ FlutterApplication and put your custom class here. --> ApplyFilters(context, image) async { + var decoded = image_lib.decodeImage(image.readAsBytesSync())!; + decoded = image_lib.copyResize(decoded, width: 600); + String fileName = basename(image.path); Map imagefile = await Navigator.push( context, - new MaterialPageRoute( - builder: (context) => new PhotoFilterSelector( + MaterialPageRoute( + builder: (context) => PhotoFilterSelector( title: Text("Photo Filter Example"), - image: image, + image: decoded, appBarColor: Colors.greenAccent[400]!, filters: presetFiltersList, filename: fileName, @@ -21,9 +21,8 @@ ApplyFilters(context, _image) async { ), ), ); - if (imagefile != null && imagefile.containsKey('image_filtered')) { - _image = imagefile['image_filtered']; - return _image; + if (imagefile.containsKey('image_filtered')) { + return imagefile['image_filtered']; } else { return null; } diff --git a/image_editor/lib/EditImg.dart b/image_editor/lib/EditImg.dart index 0b87038..0bd2060 100644 --- a/image_editor/lib/EditImg.dart +++ b/image_editor/lib/EditImg.dart @@ -1,9 +1,9 @@ import 'package:flutter/material.dart'; import 'package:image_cropper/image_cropper.dart'; -EditImg(_image) async { +Future EditImg(image) async { var CroppedImg = - await ImageCropper().cropImage(sourcePath: _image.path, uiSettings: [ + await ImageCropper().cropImage(sourcePath: image.path, uiSettings: [ AndroidUiSettings( toolbarTitle: 'Cropper', toolbarColor: Colors.greenAccent[400], @@ -15,8 +15,9 @@ EditImg(_image) async { ), ]); if (CroppedImg != null) { - _image = CroppedImg; - return _image; - } else + image = CroppedImg; + return image; + } else { return null; + } } diff --git a/image_editor/lib/GetImg.dart b/image_editor/lib/GetImg.dart index e5a75cc..da4c427 100644 --- a/image_editor/lib/GetImg.dart +++ b/image_editor/lib/GetImg.dart @@ -1,11 +1,11 @@ import 'package:image_picker/image_picker.dart'; import 'dart:io'; -GetiImg(_image) async { +Future GetiImg(image) async { var pickedFile = await ImagePicker().pickImage(source: ImageSource.gallery); if (pickedFile != null) { - _image = File(pickedFile.path); - return _image; + image = File(pickedFile.path); + return image; } else { return null; } diff --git a/image_editor/lib/HomePage.dart b/image_editor/lib/HomePage.dart index 697113f..ebbf91a 100644 --- a/image_editor/lib/HomePage.dart +++ b/image_editor/lib/HomePage.dart @@ -2,11 +2,12 @@ import 'package:flutter/material.dart'; import 'package:image_editor/ApplyFilters.dart'; import 'package:image_editor/EditImg.dart'; import 'package:image_editor/GetImg.dart'; -import 'package:fluttertoast/fluttertoast.dart'; import 'package:image_editor/SaveInGallery.dart'; import 'dart:io'; class HomePage extends StatefulWidget { + const HomePage({super.key}); + @override _HomePageState createState() => _HomePageState(); } @@ -15,7 +16,8 @@ class _HomePageState extends State { bool _selected = false; //to check if a image is selected or not late File _image; //here we will store the selected image and apply modifications - double _ImageContainerHeight = 450, _ImageContainerWidth = 400; + final double _ImageContainerHeight = 450; + final double _ImageContainerWidth = 400; @override Widget build(BuildContext context) { @@ -27,7 +29,7 @@ class _HomePageState extends State { body: Container( child: Column( children: [ - Container( + SizedBox( height: _ImageContainerHeight, width: _ImageContainerWidth, child: _selected // checks if a image is selected or not @@ -46,11 +48,11 @@ class _HomePageState extends State { style: TextStyle(color: Colors.white), ), onPressed: () async { - var _Ifile = await GetiImg( + var Ifile = await GetiImg( _image); // function called from GetImg.dart - if (_Ifile != null) { + if (Ifile != null) { setState(() { - _image = _Ifile; + _image = Ifile; _selected = true; }); } @@ -66,23 +68,12 @@ class _HomePageState extends State { style: TextStyle(color: Colors.white), ), onPressed: () async { - if (_image != null) { - var _Ifile = await EditImg( - _image); // function called from EditImg.dart - if (_Ifile != null) { - setState(() { - _image = _Ifile; - }); - } - } else { - Fluttertoast.showToast( - msg: "Select a image first :-(", - toastLength: Toast.LENGTH_SHORT, - gravity: ToastGravity.BOTTOM, - timeInSecForIosWeb: 1, - backgroundColor: Colors.green, - textColor: Colors.white, - fontSize: 16.0); + var Ifile0 = await EditImg( + _image); // function called from EditImg.dart + if (Ifile0 != null) { + setState(() { + _image = Ifile0; + }); } }), Spacer( @@ -103,23 +94,12 @@ class _HomePageState extends State { style: TextStyle(color: Colors.white), ), onPressed: () async { - if (_image != null) { - var _Ifile = await ApplyFilters(context, - _image); // function called from ApplyFilters.dart - if (_Ifile != null) { - setState(() { - _image = _Ifile; - }); - } - } else { - Fluttertoast.showToast( - msg: "Select a image first :-(", - toastLength: Toast.LENGTH_SHORT, - gravity: ToastGravity.BOTTOM, - timeInSecForIosWeb: 1, - backgroundColor: Colors.green, - textColor: Colors.white, - fontSize: 16.0); + var Ifile0 = await ApplyFilters(context, + _image); // function called from ApplyFilters.dart + if (Ifile0 != null) { + setState(() { + _image = Ifile0; + }); } }), Spacer( @@ -133,19 +113,8 @@ class _HomePageState extends State { style: TextStyle(color: Colors.white), ), onPressed: () async { - if (_image != null) { - await SaveImg( - _image); // function called from SaveInGallery.dart - } else { - Fluttertoast.showToast( - msg: "Select a image first :-(", - toastLength: Toast.LENGTH_SHORT, - gravity: ToastGravity.BOTTOM, - timeInSecForIosWeb: 1, - backgroundColor: Colors.green, - textColor: Colors.white, - fontSize: 16.0); - } + await SaveImg( + _image); // function called from SaveInGallery.dart }), Spacer( flex: 2, diff --git a/image_editor/lib/SaveInGallery.dart b/image_editor/lib/SaveInGallery.dart index ca6237a..2b3c1a0 100644 --- a/image_editor/lib/SaveInGallery.dart +++ b/image_editor/lib/SaveInGallery.dart @@ -2,10 +2,9 @@ import 'package:flutter/material.dart'; import 'package:gallery_saver_plus/gallery_saver.dart'; import 'package:fluttertoast/fluttertoast.dart'; -SaveImg(_image) async { - var result = - await GallerySaver.saveImage(_image.path, albumName: 'ImageEditor') - .then((bool? success) { +Future SaveImg(image) async { + await GallerySaver.saveImage(image.path, albumName: 'ImageEditor') + .then((bool? success) { success == true ? Fluttertoast.showToast( msg: "Image saved in gallery/ImageEditor", diff --git a/image_editor/lib/main.dart b/image_editor/lib/main.dart index 2c677ae..a264f5b 100644 --- a/image_editor/lib/main.dart +++ b/image_editor/lib/main.dart @@ -6,6 +6,8 @@ void main() { } class MyApp extends StatelessWidget { + const MyApp({super.key}); + // This widget is the root of your application. @override Widget build(BuildContext context) { diff --git a/image_editor/pubspec.yaml b/image_editor/pubspec.yaml index e403fd4..ecb886e 100644 --- a/image_editor/pubspec.yaml +++ b/image_editor/pubspec.yaml @@ -36,9 +36,11 @@ dependencies: # Use with the CupertinoIcons class for iOS style icons. cupertino_icons: ^1.0.9 gallery_saver_plus: 3.2.9 + path: any dev_dependencies: flutter_test: sdk: flutter + 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 diff --git a/image_from_network/analysis_options.yaml b/image_from_network/analysis_options.yaml new file mode 100644 index 0000000..90b40f5 --- /dev/null +++ b/image_from_network/analysis_options.yaml @@ -0,0 +1,23 @@ +# Lint rules for Flutter apps. +# See https://dart.dev/guides/language/analysis-options +include: package:flutter_lints/flutter.yaml + +analyzer: + exclude: + - build/** + - android/** + - ios/** + - web/** + - windows/** + - macos/** + - linux/** + +linter: + rules: + # Noise in small sample apps; keep the code readable. + avoid_print: false + avoid_unnecessary_containers: false + file_names: false + library_private_types_in_public_api: false + non_constant_identifier_names: false + strict_top_level_inference: false diff --git a/image_from_network/android/app/src/main/AndroidManifest.xml b/image_from_network/android/app/src/main/AndroidManifest.xml index e374101..78ed7e9 100644 --- a/image_from_network/android/app/src/main/AndroidManifest.xml +++ b/image_from_network/android/app/src/main/AndroidManifest.xml @@ -18,6 +18,7 @@ android:icon="@mipmap/ic_launcher"> runApp(MyApp()); class MyApp extends StatelessWidget { + const MyApp({super.key}); + @override Widget build(BuildContext context) { return MaterialApp( diff --git a/image_from_network/pubspec.yaml b/image_from_network/pubspec.yaml index 84edbbf..22e88e8 100644 --- a/image_from_network/pubspec.yaml +++ b/image_from_network/pubspec.yaml @@ -15,6 +15,7 @@ dependencies: dev_dependencies: flutter_test: sdk: flutter + flutter_lints: ^6.0.0 # For information on the generic Dart part of this file, see the diff --git a/infinite_list/analysis_options.yaml b/infinite_list/analysis_options.yaml new file mode 100644 index 0000000..90b40f5 --- /dev/null +++ b/infinite_list/analysis_options.yaml @@ -0,0 +1,23 @@ +# Lint rules for Flutter apps. +# See https://dart.dev/guides/language/analysis-options +include: package:flutter_lints/flutter.yaml + +analyzer: + exclude: + - build/** + - android/** + - ios/** + - web/** + - windows/** + - macos/** + - linux/** + +linter: + rules: + # Noise in small sample apps; keep the code readable. + avoid_print: false + avoid_unnecessary_containers: false + file_names: false + library_private_types_in_public_api: false + non_constant_identifier_names: false + strict_top_level_inference: false diff --git a/infinite_list/android/app/src/main/AndroidManifest.xml b/infinite_list/android/app/src/main/AndroidManifest.xml index ab044b0..4b7e588 100644 --- a/infinite_list/android/app/src/main/AndroidManifest.xml +++ b/infinite_list/android/app/src/main/AndroidManifest.xml @@ -18,6 +18,7 @@ android:icon="@mipmap/ic_launcher"> runApp(MyApp()); class MyApp extends StatelessWidget { + const MyApp({super.key}); + @override Widget build(BuildContext context) { return MaterialApp( @@ -17,13 +19,15 @@ class MyApp extends StatelessWidget { } class RandomWords extends StatefulWidget { + const RandomWords({super.key}); + @override createState() => RandomWordsState(); } class RandomWordsState extends State { final _suggestions = []; - final _saved = Set(); + final _saved = {}; final _biggerFont = const TextStyle(fontSize: 18.0); @override diff --git a/infinite_list/pubspec.yaml b/infinite_list/pubspec.yaml index f4c8e60..12d312d 100644 --- a/infinite_list/pubspec.yaml +++ b/infinite_list/pubspec.yaml @@ -16,6 +16,7 @@ dependencies: dev_dependencies: flutter_test: sdk: flutter + flutter_lints: ^6.0.0 # For information on the generic Dart part of this file, see the diff --git a/load_local_image/analysis_options.yaml b/load_local_image/analysis_options.yaml new file mode 100644 index 0000000..90b40f5 --- /dev/null +++ b/load_local_image/analysis_options.yaml @@ -0,0 +1,23 @@ +# Lint rules for Flutter apps. +# See https://dart.dev/guides/language/analysis-options +include: package:flutter_lints/flutter.yaml + +analyzer: + exclude: + - build/** + - android/** + - ios/** + - web/** + - windows/** + - macos/** + - linux/** + +linter: + rules: + # Noise in small sample apps; keep the code readable. + avoid_print: false + avoid_unnecessary_containers: false + file_names: false + library_private_types_in_public_api: false + non_constant_identifier_names: false + strict_top_level_inference: false diff --git a/load_local_image/lib/main.dart b/load_local_image/lib/main.dart index e73f7d3..8c09005 100644 --- a/load_local_image/lib/main.dart +++ b/load_local_image/lib/main.dart @@ -7,6 +7,8 @@ void main() { } class MyApp extends StatelessWidget { + const MyApp({super.key}); + @override Widget build(BuildContext context) { return Scaffold( @@ -14,19 +16,18 @@ class MyApp extends StatelessWidget { title: Text("Load local image"), ), body: Container( - child: Center( - child: Text( - "Hello World!", - style: TextStyle(color: Colors.white), - ), - ), - // Set the image as the background of the Container decoration: BoxDecoration( image: DecorationImage( // Load image from assets image: AssetImage('data_repo/img/bg1.jpg'), // Make the image cover the whole area fit: BoxFit.cover)), + child: Center( + child: Text( + "Hello World!", + style: TextStyle(color: Colors.white), + ), + ), )); } } diff --git a/load_local_image/pubspec.yaml b/load_local_image/pubspec.yaml index f78e781..25f2cc7 100644 --- a/load_local_image/pubspec.yaml +++ b/load_local_image/pubspec.yaml @@ -11,6 +11,7 @@ dependencies: dev_dependencies: flutter_test: sdk: flutter + flutter_lints: ^6.0.0 # For information on the generic Dart part of this file, see the diff --git a/load_local_json/analysis_options.yaml b/load_local_json/analysis_options.yaml new file mode 100644 index 0000000..90b40f5 --- /dev/null +++ b/load_local_json/analysis_options.yaml @@ -0,0 +1,23 @@ +# Lint rules for Flutter apps. +# See https://dart.dev/guides/language/analysis-options +include: package:flutter_lints/flutter.yaml + +analyzer: + exclude: + - build/** + - android/** + - ios/** + - web/** + - windows/** + - macos/** + - linux/** + +linter: + rules: + # Noise in small sample apps; keep the code readable. + avoid_print: false + avoid_unnecessary_containers: false + file_names: false + library_private_types_in_public_api: false + non_constant_identifier_names: false + strict_top_level_inference: false diff --git a/load_local_json/lib/main.dart b/load_local_json/lib/main.dart index 6ba9201..2edd142 100644 --- a/load_local_json/lib/main.dart +++ b/load_local_json/lib/main.dart @@ -9,6 +9,8 @@ void main() { } class MyApp extends StatefulWidget { + const MyApp({super.key}); + @override MyAppState createState() => MyAppState(); } @@ -30,7 +32,7 @@ class MyAppState extends State { .loadString('data_repo/starwars_data.json'), builder: (context, snapshot) { // Decode the JSON - var new_data = json.decode(snapshot.data.toString()); + var newData = json.decode(snapshot.data.toString()); return ListView.builder( // Build the ListView @@ -39,22 +41,19 @@ class MyAppState extends State { child: Column( crossAxisAlignment: CrossAxisAlignment.stretch, children: [ - Text("Name: " + new_data[index]['name']), - Text("Height: " + new_data[index]['height']), - Text("Mass: " + new_data[index]['mass']), - Text( - "Hair Color: " + new_data[index]['hair_color']), - Text( - "Skin Color: " + new_data[index]['skin_color']), - Text("Eye Color: " + new_data[index]['eye_color']), - Text( - "Birth Year: " + new_data[index]['birth_year']), - Text("Gender: " + new_data[index]['gender']) + Text("Name: ${newData[index]['name']}"), + Text("Height: ${newData[index]['height']}"), + Text("Mass: ${newData[index]['mass']}"), + Text("Hair Color: ${newData[index]['hair_color']}"), + Text("Skin Color: ${newData[index]['skin_color']}"), + Text("Eye Color: ${newData[index]['eye_color']}"), + Text("Birth Year: ${newData[index]['birth_year']}"), + Text("Gender: ${newData[index]['gender']}") ], ), ); }, - itemCount: new_data == null ? 0 : new_data.length, + itemCount: newData == null ? 0 : newData.length, ); }), ), diff --git a/load_local_json/pubspec.yaml b/load_local_json/pubspec.yaml index 057372b..7dd3e5f 100644 --- a/load_local_json/pubspec.yaml +++ b/load_local_json/pubspec.yaml @@ -11,6 +11,7 @@ dependencies: dev_dependencies: flutter_test: sdk: flutter + flutter_lints: ^6.0.0 # For information on the generic Dart part of this file, see the diff --git a/lunch_app/analysis_options.yaml b/lunch_app/analysis_options.yaml new file mode 100644 index 0000000..90b40f5 --- /dev/null +++ b/lunch_app/analysis_options.yaml @@ -0,0 +1,23 @@ +# Lint rules for Flutter apps. +# See https://dart.dev/guides/language/analysis-options +include: package:flutter_lints/flutter.yaml + +analyzer: + exclude: + - build/** + - android/** + - ios/** + - web/** + - windows/** + - macos/** + - linux/** + +linter: + rules: + # Noise in small sample apps; keep the code readable. + avoid_print: false + avoid_unnecessary_containers: false + file_names: false + library_private_types_in_public_api: false + non_constant_identifier_names: false + strict_top_level_inference: false diff --git a/lunch_app/android/app/build.gradle.kts b/lunch_app/android/app/build.gradle.kts index 0617009..e741911 100644 --- a/lunch_app/android/app/build.gradle.kts +++ b/lunch_app/android/app/build.gradle.kts @@ -6,7 +6,7 @@ plugins { } android { - namespace = "studio.sdev.lunch_app" + namespace = "github.nisrulz.lunch_app" compileSdk = flutter.compileSdkVersion ndkVersion = flutter.ndkVersion @@ -16,7 +16,7 @@ android { } defaultConfig { - applicationId = "studio.sdev.lunch_app" + applicationId = "github.nisrulz.lunch_app" minSdk = flutter.minSdkVersion targetSdk = flutter.targetSdkVersion versionCode = flutter.versionCode diff --git a/lunch_app/android/app/src/debug/AndroidManifest.xml b/lunch_app/android/app/src/debug/AndroidManifest.xml index d1fbb2d..f880684 100644 --- a/lunch_app/android/app/src/debug/AndroidManifest.xml +++ b/lunch_app/android/app/src/debug/AndroidManifest.xml @@ -1,5 +1,4 @@ - + diff --git a/lunch_app/android/app/src/main/AndroidManifest.xml b/lunch_app/android/app/src/main/AndroidManifest.xml index 5b16737..92b55f4 100644 --- a/lunch_app/android/app/src/main/AndroidManifest.xml +++ b/lunch_app/android/app/src/main/AndroidManifest.xml @@ -5,6 +5,7 @@ android:icon="@mipmap/ic_launcher"> + diff --git a/lunch_app/lib/main.dart b/lunch_app/lib/main.dart index fa7024c..7878933 100644 --- a/lunch_app/lib/main.dart +++ b/lunch_app/lib/main.dart @@ -1,11 +1,12 @@ import 'package:flutter/material.dart'; -import 'package:lunch_app/views/prototype/food_detail_view.dart'; import 'views/prototype/home.dart'; void main() => runApp(LunchApp()); class LunchApp extends StatelessWidget { + const LunchApp({super.key}); + @override Widget build(BuildContext context) { return MaterialApp( diff --git a/lunch_app/lib/views/prototype/bottom_nav/bottom_nav.dart b/lunch_app/lib/views/prototype/bottom_nav/bottom_nav.dart index 48a2a3d..9eb85d0 100644 --- a/lunch_app/lib/views/prototype/bottom_nav/bottom_nav.dart +++ b/lunch_app/lib/views/prototype/bottom_nav/bottom_nav.dart @@ -1,6 +1,8 @@ import 'package:flutter/material.dart'; class BottomNav extends StatelessWidget { + const BottomNav({super.key}); + @override Widget build(BuildContext context) { return Container( @@ -41,7 +43,7 @@ class BottomNav extends StatelessWidget { Expanded( child: Icon( Icons.shopping_basket, - color: Colors.white.withOpacity(0.5), + color: Colors.white.withValues(alpha: 0.5), ), ), ], diff --git a/lunch_app/lib/views/prototype/food_detail_view.dart b/lunch_app/lib/views/prototype/food_detail_view.dart index 9bf5842..e8eb403 100644 --- a/lunch_app/lib/views/prototype/food_detail_view.dart +++ b/lunch_app/lib/views/prototype/food_detail_view.dart @@ -1,9 +1,10 @@ -import 'dart:ui'; import 'package:flutter/material.dart'; import 'package:lunch_app/views/prototype/widgets/carousel_indicator.dart'; class FoodDetailView extends StatefulWidget { + const FoodDetailView({super.key}); + @override _FoodDetailViewState createState() => _FoodDetailViewState(); } diff --git a/lunch_app/lib/views/prototype/home.dart b/lunch_app/lib/views/prototype/home.dart index 8a2ca75..2456b24 100644 --- a/lunch_app/lib/views/prototype/home.dart +++ b/lunch_app/lib/views/prototype/home.dart @@ -7,6 +7,8 @@ import 'package:lunch_app/views/prototype/widgets/options_selector.dart'; import 'bottom_nav/bottom_nav.dart'; class Home extends StatefulWidget { + const Home({super.key}); + @override _HomeState createState() => _HomeState(); } @@ -21,7 +23,10 @@ class _HomeState extends State { child: SvgPicture.asset( "assets/nav/drawer.svg", width: 25, - color: Colors.black.withOpacity(0.7), + colorFilter: ColorFilter.mode( + Colors.black.withValues(alpha: 0.7), + BlendMode.srcIn, + ), ), ), ), diff --git a/lunch_app/lib/views/prototype/widgets/carousel_indicator.dart b/lunch_app/lib/views/prototype/widgets/carousel_indicator.dart index 9cbe043..692757a 100644 --- a/lunch_app/lib/views/prototype/widgets/carousel_indicator.dart +++ b/lunch_app/lib/views/prototype/widgets/carousel_indicator.dart @@ -21,7 +21,7 @@ class CarouselIndicator extends StatelessWidget { height: 8, width: 8, decoration: BoxDecoration( - color: active ? Colors.white : Colors.white.withOpacity(0.4), + color: active ? Colors.white : Colors.white.withValues(alpha: 0.4), shape: BoxShape.circle, ), margin: const EdgeInsets.only(right: 5), diff --git a/lunch_app/lib/views/prototype/widgets/food_lister.dart b/lunch_app/lib/views/prototype/widgets/food_lister.dart index 300ef42..5a78358 100644 --- a/lunch_app/lib/views/prototype/widgets/food_lister.dart +++ b/lunch_app/lib/views/prototype/widgets/food_lister.dart @@ -2,6 +2,8 @@ import 'package:flutter/material.dart'; import 'package:lunch_app/views/prototype/food_detail_view.dart'; class FoodLister extends StatefulWidget { + const FoodLister({super.key}); + @override _FoodListerState createState() => _FoodListerState(); } @@ -12,7 +14,7 @@ class _FoodListerState extends State { @override Widget build(BuildContext context) { - return Container( + return SizedBox( height: MediaQuery.of(context).size.width * 0.8, child: PageView.builder( scrollDirection: Axis.horizontal, diff --git a/lunch_app/pubspec.yaml b/lunch_app/pubspec.yaml index 90319d8..5c741be 100644 --- a/lunch_app/pubspec.yaml +++ b/lunch_app/pubspec.yaml @@ -15,6 +15,7 @@ dependencies: dev_dependencies: flutter_test: sdk: flutter + flutter_lints: ^6.0.0 flutter: uses-material-design: true diff --git a/navigation_drawer/analysis_options.yaml b/navigation_drawer/analysis_options.yaml new file mode 100644 index 0000000..90b40f5 --- /dev/null +++ b/navigation_drawer/analysis_options.yaml @@ -0,0 +1,23 @@ +# Lint rules for Flutter apps. +# See https://dart.dev/guides/language/analysis-options +include: package:flutter_lints/flutter.yaml + +analyzer: + exclude: + - build/** + - android/** + - ios/** + - web/** + - windows/** + - macos/** + - linux/** + +linter: + rules: + # Noise in small sample apps; keep the code readable. + avoid_print: false + avoid_unnecessary_containers: false + file_names: false + library_private_types_in_public_api: false + non_constant_identifier_names: false + strict_top_level_inference: false diff --git a/navigation_drawer/lib/screens/account.dart b/navigation_drawer/lib/screens/account.dart index ac3e59c..6523d7a 100644 --- a/navigation_drawer/lib/screens/account.dart +++ b/navigation_drawer/lib/screens/account.dart @@ -3,6 +3,8 @@ import 'package:flutter/material.dart'; class AccountScreen extends StatelessWidget { static const String routeName = "/account"; + const AccountScreen({super.key}); + @override Widget build(BuildContext context) { return Scaffold( diff --git a/navigation_drawer/lib/screens/home.dart b/navigation_drawer/lib/screens/home.dart index fae9cca..e76db03 100644 --- a/navigation_drawer/lib/screens/home.dart +++ b/navigation_drawer/lib/screens/home.dart @@ -3,6 +3,8 @@ import 'package:navigation_drawer/screens/account.dart'; import 'package:navigation_drawer/screens/settings.dart'; class HomeScreen extends StatefulWidget { + const HomeScreen({super.key}); + @override HomeScreenState createState() => HomeScreenState(); } @@ -11,11 +13,11 @@ class HomeScreenState extends State { Drawer getNavDrawer(BuildContext context) { var headerChild = DrawerHeader(child: Text("Header")); var aboutChild = AboutListTile( - child: Text("About"), applicationName: "Application Name", applicationVersion: "v1.0.0", applicationIcon: Icon(Icons.adb), - icon: Icon(Icons.info)); + icon: Icon(Icons.info), + child: Text("About")); ListTile getNavItem(var icon, String s, String routeName) { return ListTile( diff --git a/navigation_drawer/lib/screens/settings.dart b/navigation_drawer/lib/screens/settings.dart index 5c3f837..e6a34da 100644 --- a/navigation_drawer/lib/screens/settings.dart +++ b/navigation_drawer/lib/screens/settings.dart @@ -3,6 +3,8 @@ import 'package:flutter/material.dart'; class SettingsScreen extends StatelessWidget { static const String routeName = "/settings"; + const SettingsScreen({super.key}); + @override Widget build(BuildContext context) { return Scaffold( diff --git a/navigation_drawer/pubspec.yaml b/navigation_drawer/pubspec.yaml index d3f7551..c3e520f 100644 --- a/navigation_drawer/pubspec.yaml +++ b/navigation_drawer/pubspec.yaml @@ -15,6 +15,7 @@ dependencies: dev_dependencies: flutter_test: sdk: flutter + flutter_lints: ^6.0.0 # For information on the generic Dart part of this file, see the diff --git a/news_memes_app/analysis_options.yaml b/news_memes_app/analysis_options.yaml new file mode 100644 index 0000000..90b40f5 --- /dev/null +++ b/news_memes_app/analysis_options.yaml @@ -0,0 +1,23 @@ +# Lint rules for Flutter apps. +# See https://dart.dev/guides/language/analysis-options +include: package:flutter_lints/flutter.yaml + +analyzer: + exclude: + - build/** + - android/** + - ios/** + - web/** + - windows/** + - macos/** + - linux/** + +linter: + rules: + # Noise in small sample apps; keep the code readable. + avoid_print: false + avoid_unnecessary_containers: false + file_names: false + library_private_types_in_public_api: false + non_constant_identifier_names: false + strict_top_level_inference: false diff --git a/news_memes_app/android/app/src/main/AndroidManifest.xml b/news_memes_app/android/app/src/main/AndroidManifest.xml index 3887b42..68b8dbc 100644 --- a/news_memes_app/android/app/src/main/AndroidManifest.xml +++ b/news_memes_app/android/app/src/main/AndroidManifest.xml @@ -5,6 +5,7 @@ android:icon="@mipmap/ic_launcher"> _HomePageState(); diff --git a/news_memes_app/lib/Screens/MemeScreen.dart b/news_memes_app/lib/Screens/MemeScreen.dart index c198d93..681bcd0 100644 --- a/news_memes_app/lib/Screens/MemeScreen.dart +++ b/news_memes_app/lib/Screens/MemeScreen.dart @@ -4,7 +4,7 @@ import 'package:news_memes_app/services/getMemes.dart'; import 'package:share_plus/share_plus.dart'; class MemeScreen extends StatefulWidget { - const MemeScreen({Key? key}) : super(key: key); + const MemeScreen({super.key}); @override _MemeScreenState createState() => _MemeScreenState(); diff --git a/news_memes_app/lib/Screens/NewsScreen.dart b/news_memes_app/lib/Screens/NewsScreen.dart index 707c734..bc8ae71 100644 --- a/news_memes_app/lib/Screens/NewsScreen.dart +++ b/news_memes_app/lib/Screens/NewsScreen.dart @@ -4,17 +4,13 @@ import 'package:news_memes_app/services/getNews.dart'; class NewsScreen extends StatefulWidget { final List news; - NewsScreen(this.news); + const NewsScreen(this.news, {super.key}); @override - _NewsScreenState createState() => _NewsScreenState(news); + State createState() => _NewsScreenState(); } class _NewsScreenState extends State { - List news; - - _NewsScreenState(this.news); - @override Widget build(BuildContext context) { final Size size = MediaQuery.of(context).size; @@ -25,7 +21,7 @@ class _NewsScreenState extends State { child: InteractiveViewer( child: ListView( // magnification: 1.2, - children: news + children: widget.news .map((e) => Padding( padding: const EdgeInsets.symmetric( vertical: 15, horizontal: 20), diff --git a/news_memes_app/pubspec.yaml b/news_memes_app/pubspec.yaml index 453e484..cdd44d7 100644 --- a/news_memes_app/pubspec.yaml +++ b/news_memes_app/pubspec.yaml @@ -35,6 +35,7 @@ dependencies: dev_dependencies: flutter_test: sdk: flutter + flutter_lints: ^6.0.0 change_app_package_name: ^1.5.0 # For information on the generic Dart part of this file, see the # following page: https://dart.dev/tools/pub/pubspec diff --git a/persist_key_value/.flutter-plugins-dependencies b/persist_key_value/.flutter-plugins-dependencies deleted file mode 100644 index 0763bfb..0000000 --- a/persist_key_value/.flutter-plugins-dependencies +++ /dev/null @@ -1 +0,0 @@ -{"info":"This is a generated file; do not edit or check into version control.","plugins":{"ios":[{"name":"shared_preferences_foundation","path":"/Users/nishantsrivastava/.pub-cache/hosted/pub.dev/shared_preferences_foundation-2.5.6/","shared_darwin_source":true,"native_build":true,"dependencies":[],"dev_dependency":true}],"android":[{"name":"shared_preferences_android","path":"/Users/nishantsrivastava/.pub-cache/hosted/pub.dev/shared_preferences_android-2.4.27/","native_build":true,"dependencies":[],"dev_dependency":true}],"macos":[{"name":"shared_preferences_foundation","path":"/Users/nishantsrivastava/.pub-cache/hosted/pub.dev/shared_preferences_foundation-2.5.6/","shared_darwin_source":true,"native_build":true,"dependencies":[],"dev_dependency":true}],"linux":[{"name":"path_provider_linux","path":"/Users/nishantsrivastava/.pub-cache/hosted/pub.dev/path_provider_linux-2.2.2/","native_build":false,"dependencies":[],"dev_dependency":true},{"name":"shared_preferences_linux","path":"/Users/nishantsrivastava/.pub-cache/hosted/pub.dev/shared_preferences_linux-2.4.1/","native_build":false,"dependencies":["path_provider_linux"],"dev_dependency":true}],"windows":[{"name":"path_provider_windows","path":"/Users/nishantsrivastava/.pub-cache/hosted/pub.dev/path_provider_windows-2.3.0/","native_build":false,"dependencies":[],"dev_dependency":true},{"name":"shared_preferences_windows","path":"/Users/nishantsrivastava/.pub-cache/hosted/pub.dev/shared_preferences_windows-2.4.1/","native_build":false,"dependencies":["path_provider_windows"],"dev_dependency":true}],"web":[{"name":"shared_preferences_web","path":"/Users/nishantsrivastava/.pub-cache/hosted/pub.dev/shared_preferences_web-2.4.3/","dependencies":[],"dev_dependency":true}]},"dependencyGraph":[{"name":"path_provider_linux","dependencies":[]},{"name":"path_provider_windows","dependencies":[]},{"name":"shared_preferences","dependencies":["shared_preferences_android","shared_preferences_foundation","shared_preferences_linux","shared_preferences_web","shared_preferences_windows"]},{"name":"shared_preferences_android","dependencies":[]},{"name":"shared_preferences_foundation","dependencies":[]},{"name":"shared_preferences_linux","dependencies":["path_provider_linux"]},{"name":"shared_preferences_web","dependencies":[]},{"name":"shared_preferences_windows","dependencies":["path_provider_windows"]}],"date_created":"2026-08-16 19:49:08.125144","version":"3.47.0","swift_package_manager_enabled":{"ios":false,"macos":false}} \ No newline at end of file diff --git a/persist_key_value/analysis_options.yaml b/persist_key_value/analysis_options.yaml new file mode 100644 index 0000000..90b40f5 --- /dev/null +++ b/persist_key_value/analysis_options.yaml @@ -0,0 +1,23 @@ +# Lint rules for Flutter apps. +# See https://dart.dev/guides/language/analysis-options +include: package:flutter_lints/flutter.yaml + +analyzer: + exclude: + - build/** + - android/** + - ios/** + - web/** + - windows/** + - macos/** + - linux/** + +linter: + rules: + # Noise in small sample apps; keep the code readable. + avoid_print: false + avoid_unnecessary_containers: false + file_names: false + library_private_types_in_public_api: false + non_constant_identifier_names: false + strict_top_level_inference: false diff --git a/persist_key_value/lib/main.dart b/persist_key_value/lib/main.dart index b382794..1db943a 100644 --- a/persist_key_value/lib/main.dart +++ b/persist_key_value/lib/main.dart @@ -10,6 +10,8 @@ void main() { } class MyHome extends StatefulWidget { + const MyHome({super.key}); + @override MyHomeState createState() { return MyHomeState(); @@ -30,7 +32,7 @@ class MyHomeState extends State { _loadSavedData(); } - _loadSavedData() async { + Future _loadSavedData() async { // Get shared preference instance SharedPreferences prefs = await SharedPreferences.getInstance(); setState(() { @@ -39,7 +41,7 @@ class MyHomeState extends State { }); } - _onIncrementHit() async { + Future _onIncrementHit() async { // Get shared preference instance SharedPreferences prefs = await SharedPreferences.getInstance(); @@ -52,7 +54,7 @@ class MyHomeState extends State { prefs.setInt(key, counter); } - _onDecrementHit() async { + Future _onDecrementHit() async { // Get shared preference instance SharedPreferences prefs = await SharedPreferences.getInstance(); @@ -82,16 +84,14 @@ class MyHomeState extends State { children: [ Text( '$counter', - textScaleFactor: 10.0, + textScaler: TextScaler.linear(10.0), ), Padding(padding: EdgeInsets.all(10.0)), ElevatedButton( - onPressed: _onIncrementHit, - child: Text('Increment Counter')), + onPressed: _onIncrementHit, child: Text('Increment Counter')), Padding(padding: EdgeInsets.all(10.0)), ElevatedButton( - onPressed: _onDecrementHit, - child: Text('Decrement Counter')), + onPressed: _onDecrementHit, child: Text('Decrement Counter')), ], ), ), diff --git a/persist_key_value/pubspec.yaml b/persist_key_value/pubspec.yaml index ac70582..24383ae 100644 --- a/persist_key_value/pubspec.yaml +++ b/persist_key_value/pubspec.yaml @@ -12,10 +12,11 @@ dependencies: # Use with the CupertinoIcons class for iOS style icons. cupertino_icons: ^1.0.9 + shared_preferences: any dev_dependencies: flutter_test: sdk: flutter - shared_preferences: ^2.5.5 + flutter_lints: ^6.0.0 # For information on the generic Dart part of this file, see the diff --git a/push_notifications/analysis_options.yaml b/push_notifications/analysis_options.yaml new file mode 100644 index 0000000..90b40f5 --- /dev/null +++ b/push_notifications/analysis_options.yaml @@ -0,0 +1,23 @@ +# Lint rules for Flutter apps. +# See https://dart.dev/guides/language/analysis-options +include: package:flutter_lints/flutter.yaml + +analyzer: + exclude: + - build/** + - android/** + - ios/** + - web/** + - windows/** + - macos/** + - linux/** + +linter: + rules: + # Noise in small sample apps; keep the code readable. + avoid_print: false + avoid_unnecessary_containers: false + file_names: false + library_private_types_in_public_api: false + non_constant_identifier_names: false + strict_top_level_inference: false diff --git a/push_notifications/android/app/src/main/AndroidManifest.xml b/push_notifications/android/app/src/main/AndroidManifest.xml index 9f7a84a..b7ca1fc 100644 --- a/push_notifications/android/app/src/main/AndroidManifest.xml +++ b/push_notifications/android/app/src/main/AndroidManifest.xml @@ -11,6 +11,7 @@ android:icon="@mipmap/ic_launcher"> runApp(MyApp()); class MyApp extends StatelessWidget { + const MyApp({super.key}); + @override Widget build(BuildContext context) { return MaterialApp( @@ -18,6 +20,8 @@ class MyApp extends StatelessWidget { } class MyHomePage extends StatefulWidget { + const MyHomePage({super.key}); + @override _MyHomePageState createState() => _MyHomePageState(); } @@ -86,7 +90,7 @@ and other fields as per requirement child: Column( children: [ Text( - '$title', + title, style: Theme.of(context).textTheme.headlineSmall, ), SizedBox( diff --git a/push_notifications/pubspec.yaml b/push_notifications/pubspec.yaml index e5b500a..5441e45 100644 --- a/push_notifications/pubspec.yaml +++ b/push_notifications/pubspec.yaml @@ -34,6 +34,7 @@ dependencies: dev_dependencies: flutter_test: sdk: flutter + 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 diff --git a/save_data_locally_with_sqlite/analysis_options.yaml b/save_data_locally_with_sqlite/analysis_options.yaml new file mode 100644 index 0000000..90b40f5 --- /dev/null +++ b/save_data_locally_with_sqlite/analysis_options.yaml @@ -0,0 +1,23 @@ +# Lint rules for Flutter apps. +# See https://dart.dev/guides/language/analysis-options +include: package:flutter_lints/flutter.yaml + +analyzer: + exclude: + - build/** + - android/** + - ios/** + - web/** + - windows/** + - macos/** + - linux/** + +linter: + rules: + # Noise in small sample apps; keep the code readable. + avoid_print: false + avoid_unnecessary_containers: false + file_names: false + library_private_types_in_public_api: false + non_constant_identifier_names: false + strict_top_level_inference: false diff --git a/save_data_locally_with_sqlite/android/app/src/main/AndroidManifest.xml b/save_data_locally_with_sqlite/android/app/src/main/AndroidManifest.xml index 29c3fe7..89a9456 100644 --- a/save_data_locally_with_sqlite/android/app/src/main/AndroidManifest.xml +++ b/save_data_locally_with_sqlite/android/app/src/main/AndroidManifest.xml @@ -5,6 +5,7 @@ android:icon="@mipmap/ic_launcher"> get database async { - if (_database != null) + if (_database != null) { return _database; //if database already present it return the database else create a new one then return it + } _database = await _initDatabase(); return _database; } - _initDatabase() async { + Future _initDatabase() async { Directory documentsDirectory = await getApplicationDocumentsDirectory(); - String path = join(documentsDirectory.path, '$_databaseName'); + String path = join(documentsDirectory.path, _databaseName); return await openDatabase(path, version: _databaseVersion, - onCreate: (db, int) async { + onCreate: (db, version) async { await db.execute(''' CREATE TABLE data ( datetime TEXT, diff --git a/save_data_locally_with_sqlite/lib/main.dart b/save_data_locally_with_sqlite/lib/main.dart index d187332..bd17d0e 100644 --- a/save_data_locally_with_sqlite/lib/main.dart +++ b/save_data_locally_with_sqlite/lib/main.dart @@ -6,6 +6,8 @@ void main() { } class MyApp extends StatelessWidget { + const MyApp({super.key}); + // This widget is the root of your application. @override Widget build(BuildContext context) { diff --git a/save_data_locally_with_sqlite/lib/screens/homescreen/homescreen.dart b/save_data_locally_with_sqlite/lib/screens/homescreen/homescreen.dart index aa9c850..ff27d09 100644 --- a/save_data_locally_with_sqlite/lib/screens/homescreen/homescreen.dart +++ b/save_data_locally_with_sqlite/lib/screens/homescreen/homescreen.dart @@ -3,6 +3,8 @@ import 'package:save_data_locally_with_sqlite/database/database_queries.dart'; import 'package:save_data_locally_with_sqlite/screens/homescreen/widgets/note_container.dart'; class HomeScreen extends StatefulWidget { + const HomeScreen({super.key}); + @override _HomeScreenState createState() => _HomeScreenState(); } diff --git a/save_data_locally_with_sqlite/lib/screens/homescreen/widgets/note_container.dart b/save_data_locally_with_sqlite/lib/screens/homescreen/widgets/note_container.dart index 478c588..6912973 100644 --- a/save_data_locally_with_sqlite/lib/screens/homescreen/widgets/note_container.dart +++ b/save_data_locally_with_sqlite/lib/screens/homescreen/widgets/note_container.dart @@ -1,11 +1,9 @@ import 'package:flutter/material.dart'; -import 'package:flutter/painting.dart'; class NoteContainer extends StatelessWidget { final String text; final String datetime; - NoteContainer({Key? key, this.text = '', this.datetime = ''}) - : super(key: key); + const NoteContainer({super.key, this.text = '', this.datetime = ''}); @override Widget build(BuildContext context) { @@ -15,7 +13,7 @@ class NoteContainer extends StatelessWidget { borderRadius: BorderRadius.circular(15), boxShadow: [ BoxShadow( - color: Colors.blue.withOpacity(.4), + color: Colors.blue.withValues(alpha: .4), spreadRadius: 2.5, blurRadius: 2.5, ) @@ -27,7 +25,7 @@ class NoteContainer extends StatelessWidget { Container( alignment: Alignment.center, child: Text( - '$datetime', + datetime, style: TextStyle( color: Colors.grey.shade700, fontSize: 12, @@ -41,7 +39,7 @@ class NoteContainer extends StatelessWidget { child: Container( padding: EdgeInsets.symmetric(vertical: 5, horizontal: 10), child: Text( - '$text', + text, ), ), ), diff --git a/save_data_locally_with_sqlite/pubspec.yaml b/save_data_locally_with_sqlite/pubspec.yaml index 5e133ee..4a9774a 100644 --- a/save_data_locally_with_sqlite/pubspec.yaml +++ b/save_data_locally_with_sqlite/pubspec.yaml @@ -31,9 +31,11 @@ dependencies: sqflite: ^2.4.3 path_provider: ^2.1.6 + path: any dev_dependencies: flutter_test: sdk: flutter + 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 diff --git a/scan_qr_code/analysis_options.yaml b/scan_qr_code/analysis_options.yaml index 5bee4ff..90b40f5 100644 --- a/scan_qr_code/analysis_options.yaml +++ b/scan_qr_code/analysis_options.yaml @@ -1,12 +1,7 @@ -# This file configures the analyzer, which statically analyzes Dart code to -# check for errors, warnings, and lints. -# -# The issues identified by the analyzer are surfaced in the UI of Dart-enabled -# IDEs (https://dart.dev/tools#ides-and-editors). The analyzer can also be -# invoked from the command line by running `flutter analyze`. +# Lint rules for Flutter apps. +# See https://dart.dev/guides/language/analysis-options +include: package:flutter_lints/flutter.yaml -# The following line activates a set of recommended lints for Flutter apps, -# packages, and plugins designed to encourage good coding practices. analyzer: exclude: - build/** @@ -16,23 +11,13 @@ analyzer: - windows/** - macos/** - linux/** -include: package:flutter_lints/flutter.yaml linter: - # The lint rules applied to this project can be customized in the - # section below to disable rules from the `package:flutter_lints/flutter.yaml` - # included above or to enable additional rules. A list of all available lints - # and their documentation is published at - # https://dart-lang.github.io/linter/lints/index.html. - # - # Instead of disabling a lint rule for the entire project in the - # section below, it can also be suppressed for a single line of code - # or a specific dart file by using the `// ignore: name_of_lint` and - # `// ignore_for_file: name_of_lint` syntax on the line or in the file - # producing the lint. rules: - # avoid_print: false # Uncomment to disable the `avoid_print` rule - # prefer_single_quotes: true # Uncomment to enable the `prefer_single_quotes` rule - -# Additional information about this file can be found at -# https://dart.dev/guides/language/analysis-options + # Noise in small sample apps; keep the code readable. + avoid_print: false + avoid_unnecessary_containers: false + file_names: false + library_private_types_in_public_api: false + non_constant_identifier_names: false + strict_top_level_inference: false diff --git a/scan_qr_code/pubspec.yaml b/scan_qr_code/pubspec.yaml index 47c0f6d..5780738 100644 --- a/scan_qr_code/pubspec.yaml +++ b/scan_qr_code/pubspec.yaml @@ -20,7 +20,7 @@ publish_to: 'none' # Remove this line if you wish to publish to pub.dev version: 1.0.0+1 environment: - sdk: '>=2.18.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 diff --git a/simple_material_app/analysis_options.yaml b/simple_material_app/analysis_options.yaml new file mode 100644 index 0000000..90b40f5 --- /dev/null +++ b/simple_material_app/analysis_options.yaml @@ -0,0 +1,23 @@ +# Lint rules for Flutter apps. +# See https://dart.dev/guides/language/analysis-options +include: package:flutter_lints/flutter.yaml + +analyzer: + exclude: + - build/** + - android/** + - ios/** + - web/** + - windows/** + - macos/** + - linux/** + +linter: + rules: + # Noise in small sample apps; keep the code readable. + avoid_print: false + avoid_unnecessary_containers: false + file_names: false + library_private_types_in_public_api: false + non_constant_identifier_names: false + strict_top_level_inference: false diff --git a/simple_material_app/pubspec.yaml b/simple_material_app/pubspec.yaml index 9b1035e..7166603 100644 --- a/simple_material_app/pubspec.yaml +++ b/simple_material_app/pubspec.yaml @@ -11,6 +11,7 @@ dependencies: dev_dependencies: flutter_test: sdk: flutter + flutter_lints: ^6.0.0 # For information on the generic Dart part of this file, see the diff --git a/sliver_app_bar_example/analysis_options.yaml b/sliver_app_bar_example/analysis_options.yaml index 5bee4ff..90b40f5 100644 --- a/sliver_app_bar_example/analysis_options.yaml +++ b/sliver_app_bar_example/analysis_options.yaml @@ -1,12 +1,7 @@ -# This file configures the analyzer, which statically analyzes Dart code to -# check for errors, warnings, and lints. -# -# The issues identified by the analyzer are surfaced in the UI of Dart-enabled -# IDEs (https://dart.dev/tools#ides-and-editors). The analyzer can also be -# invoked from the command line by running `flutter analyze`. +# Lint rules for Flutter apps. +# See https://dart.dev/guides/language/analysis-options +include: package:flutter_lints/flutter.yaml -# The following line activates a set of recommended lints for Flutter apps, -# packages, and plugins designed to encourage good coding practices. analyzer: exclude: - build/** @@ -16,23 +11,13 @@ analyzer: - windows/** - macos/** - linux/** -include: package:flutter_lints/flutter.yaml linter: - # The lint rules applied to this project can be customized in the - # section below to disable rules from the `package:flutter_lints/flutter.yaml` - # included above or to enable additional rules. A list of all available lints - # and their documentation is published at - # https://dart-lang.github.io/linter/lints/index.html. - # - # Instead of disabling a lint rule for the entire project in the - # section below, it can also be suppressed for a single line of code - # or a specific dart file by using the `// ignore: name_of_lint` and - # `// ignore_for_file: name_of_lint` syntax on the line or in the file - # producing the lint. rules: - # avoid_print: false # Uncomment to disable the `avoid_print` rule - # prefer_single_quotes: true # Uncomment to enable the `prefer_single_quotes` rule - -# Additional information about this file can be found at -# https://dart.dev/guides/language/analysis-options + # Noise in small sample apps; keep the code readable. + avoid_print: false + avoid_unnecessary_containers: false + file_names: false + library_private_types_in_public_api: false + non_constant_identifier_names: false + strict_top_level_inference: false diff --git a/sliver_app_bar_example/pubspec.yaml b/sliver_app_bar_example/pubspec.yaml index 2ffb797..03bae9a 100644 --- a/sliver_app_bar_example/pubspec.yaml +++ b/sliver_app_bar_example/pubspec.yaml @@ -20,7 +20,7 @@ publish_to: 'none' # Remove this line if you wish to publish to pub.dev version: 1.0.0+1 environment: - sdk: '>=2.18.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 diff --git a/stateful_widget/analysis_options.yaml b/stateful_widget/analysis_options.yaml new file mode 100644 index 0000000..90b40f5 --- /dev/null +++ b/stateful_widget/analysis_options.yaml @@ -0,0 +1,23 @@ +# Lint rules for Flutter apps. +# See https://dart.dev/guides/language/analysis-options +include: package:flutter_lints/flutter.yaml + +analyzer: + exclude: + - build/** + - android/** + - ios/** + - web/** + - windows/** + - macos/** + - linux/** + +linter: + rules: + # Noise in small sample apps; keep the code readable. + avoid_print: false + avoid_unnecessary_containers: false + file_names: false + library_private_types_in_public_api: false + non_constant_identifier_names: false + strict_top_level_inference: false diff --git a/stateful_widget/lib/main.dart b/stateful_widget/lib/main.dart index a7e5be1..6b9f91d 100644 --- a/stateful_widget/lib/main.dart +++ b/stateful_widget/lib/main.dart @@ -7,6 +7,8 @@ void main() { } class MyButton extends StatefulWidget { + const MyButton({super.key}); + @override MyButtonState createState() { return MyButtonState(); @@ -40,12 +42,12 @@ class MyButtonState extends State { Text(displayedString, style: TextStyle(fontSize: 40.0)), Padding(padding: EdgeInsets.all(10.0)), ElevatedButton( + style: ElevatedButton.styleFrom(backgroundColor: Colors.red), + onPressed: onPressOfButton, child: Text( "Press me", style: TextStyle(color: Colors.white), ), - style: ElevatedButton.styleFrom(backgroundColor: Colors.red), - onPressed: onPressOfButton, ) ], ), diff --git a/stateful_widget/pubspec.yaml b/stateful_widget/pubspec.yaml index e0c66cb..18bfc64 100644 --- a/stateful_widget/pubspec.yaml +++ b/stateful_widget/pubspec.yaml @@ -11,6 +11,7 @@ dependencies: dev_dependencies: flutter_test: sdk: flutter + flutter_lints: ^6.0.0 # For information on the generic Dart part of this file, see the diff --git a/stateless_widgets/analysis_options.yaml b/stateless_widgets/analysis_options.yaml new file mode 100644 index 0000000..90b40f5 --- /dev/null +++ b/stateless_widgets/analysis_options.yaml @@ -0,0 +1,23 @@ +# Lint rules for Flutter apps. +# See https://dart.dev/guides/language/analysis-options +include: package:flutter_lints/flutter.yaml + +analyzer: + exclude: + - build/** + - android/** + - ios/** + - web/** + - windows/** + - macos/** + - linux/** + +linter: + rules: + # Noise in small sample apps; keep the code readable. + avoid_print: false + avoid_unnecessary_containers: false + file_names: false + library_private_types_in_public_api: false + non_constant_identifier_names: false + strict_top_level_inference: false diff --git a/stateless_widgets/lib/main.dart b/stateless_widgets/lib/main.dart index 9c9c04c..09685b4 100644 --- a/stateless_widgets/lib/main.dart +++ b/stateless_widgets/lib/main.dart @@ -9,6 +9,8 @@ void main() { } class MyApp extends StatelessWidget { + const MyApp({super.key}); + @override Widget build(BuildContext context) { // Declare some constants @@ -64,7 +66,6 @@ class MyApp extends StatelessWidget { ), ), ); - ; } } @@ -74,7 +75,7 @@ class MyCard extends StatelessWidget { final Widget title; // Constructor. {} here denote that they are optional values i.e you can use as: MyCard() - MyCard({required this.title, required this.icon}); + const MyCard({super.key, required this.title, required this.icon}); @override Widget build(BuildContext context) { @@ -84,7 +85,7 @@ class MyCard extends StatelessWidget { child: Container( padding: const EdgeInsets.all(20.0), child: Column( - children: [this.title, this.icon], + children: [title, icon], ), ), ), diff --git a/stateless_widgets/pubspec.yaml b/stateless_widgets/pubspec.yaml index 0dd1bf2..849f9be 100644 --- a/stateless_widgets/pubspec.yaml +++ b/stateless_widgets/pubspec.yaml @@ -11,6 +11,7 @@ dependencies: dev_dependencies: flutter_test: sdk: flutter + flutter_lints: ^6.0.0 # For information on the generic Dart part of this file, see the diff --git a/statless_counter_app/analysis_options.yaml b/statless_counter_app/analysis_options.yaml new file mode 100644 index 0000000..90b40f5 --- /dev/null +++ b/statless_counter_app/analysis_options.yaml @@ -0,0 +1,23 @@ +# Lint rules for Flutter apps. +# See https://dart.dev/guides/language/analysis-options +include: package:flutter_lints/flutter.yaml + +analyzer: + exclude: + - build/** + - android/** + - ios/** + - web/** + - windows/** + - macos/** + - linux/** + +linter: + rules: + # Noise in small sample apps; keep the code readable. + avoid_print: false + avoid_unnecessary_containers: false + file_names: false + library_private_types_in_public_api: false + non_constant_identifier_names: false + strict_top_level_inference: false diff --git a/statless_counter_app/android/app/build.gradle.kts b/statless_counter_app/android/app/build.gradle.kts index 8d7f196..596bb7f 100644 --- a/statless_counter_app/android/app/build.gradle.kts +++ b/statless_counter_app/android/app/build.gradle.kts @@ -6,7 +6,7 @@ plugins { } android { - namespace = "com.example.statless_counter_app" + namespace = "github.nisrulz.statless_counter_app" compileSdk = flutter.compileSdkVersion ndkVersion = flutter.ndkVersion @@ -16,7 +16,7 @@ android { } defaultConfig { - applicationId = "com.example.statless_counter_app" + applicationId = "github.nisrulz.statless_counter_app" minSdk = flutter.minSdkVersion targetSdk = flutter.targetSdkVersion versionCode = flutter.versionCode diff --git a/statless_counter_app/android/app/src/debug/AndroidManifest.xml b/statless_counter_app/android/app/src/debug/AndroidManifest.xml index ca56eea..f880684 100644 --- a/statless_counter_app/android/app/src/debug/AndroidManifest.xml +++ b/statless_counter_app/android/app/src/debug/AndroidManifest.xml @@ -1,5 +1,4 @@ - + diff --git a/statless_counter_app/android/app/src/main/AndroidManifest.xml b/statless_counter_app/android/app/src/main/AndroidManifest.xml index 97a3160..9e3ea71 100644 --- a/statless_counter_app/android/app/src/main/AndroidManifest.xml +++ b/statless_counter_app/android/app/src/main/AndroidManifest.xml @@ -5,6 +5,7 @@ android:icon="@mipmap/ic_launcher"> + diff --git a/statless_counter_app/lib/counter.g.dart b/statless_counter_app/lib/counter.g.dart index e03eebc..d856107 100644 --- a/statless_counter_app/lib/counter.g.dart +++ b/statless_counter_app/lib/counter.g.dart @@ -6,7 +6,7 @@ part of 'counter.dart'; // StoreGenerator // ************************************************************************** -// ignore_for_file: non_constant_identifier_names, unnecessary_brace_in_string_interps, unnecessary_lambdas, prefer_expression_function_bodies, lines_longer_than_80_chars, avoid_as, avoid_annotating_with_dynamic +// ignore_for_file: non_constant_identifier_names, unnecessary_brace_in_string_interps, unnecessary_lambdas, prefer_expression_function_bodies, lines_longer_than_80_chars, avoid_as, avoid_annotating_with_dynamic, no_leading_underscores_for_local_identifiers mixin _$Counter on _Counter, Store { final _$valueAtom = Atom(name: '_Counter.value'); diff --git a/statless_counter_app/lib/main.dart b/statless_counter_app/lib/main.dart index 07578ef..02c17ab 100644 --- a/statless_counter_app/lib/main.dart +++ b/statless_counter_app/lib/main.dart @@ -8,6 +8,8 @@ final counter = Counter(); // Instantiate the store void main() => runApp(MyApp()); class MyApp extends StatelessWidget { + const MyApp({super.key}); + // This widget is the root of your application. @override Widget build(BuildContext context) { @@ -23,7 +25,7 @@ class MyApp extends StatelessWidget { } class MyHomePage extends StatelessWidget { - const MyHomePage(); + const MyHomePage({super.key}); @override Widget build(BuildContext context) { diff --git a/statless_counter_app/pubspec.yaml b/statless_counter_app/pubspec.yaml index aa4ad7e..fe23554 100644 --- a/statless_counter_app/pubspec.yaml +++ b/statless_counter_app/pubspec.yaml @@ -34,6 +34,7 @@ dependencies: dev_dependencies: flutter_test: sdk: flutter + flutter_lints: ^6.0.0 build_runner: ^2.15.1 mobx_codegen: ^2.7.7 # For information on the generic Dart part of this file, see the diff --git a/tic_tac_toe/analysis_options.yaml b/tic_tac_toe/analysis_options.yaml index 5bee4ff..90b40f5 100644 --- a/tic_tac_toe/analysis_options.yaml +++ b/tic_tac_toe/analysis_options.yaml @@ -1,12 +1,7 @@ -# This file configures the analyzer, which statically analyzes Dart code to -# check for errors, warnings, and lints. -# -# The issues identified by the analyzer are surfaced in the UI of Dart-enabled -# IDEs (https://dart.dev/tools#ides-and-editors). The analyzer can also be -# invoked from the command line by running `flutter analyze`. +# Lint rules for Flutter apps. +# See https://dart.dev/guides/language/analysis-options +include: package:flutter_lints/flutter.yaml -# The following line activates a set of recommended lints for Flutter apps, -# packages, and plugins designed to encourage good coding practices. analyzer: exclude: - build/** @@ -16,23 +11,13 @@ analyzer: - windows/** - macos/** - linux/** -include: package:flutter_lints/flutter.yaml linter: - # The lint rules applied to this project can be customized in the - # section below to disable rules from the `package:flutter_lints/flutter.yaml` - # included above or to enable additional rules. A list of all available lints - # and their documentation is published at - # https://dart-lang.github.io/linter/lints/index.html. - # - # Instead of disabling a lint rule for the entire project in the - # section below, it can also be suppressed for a single line of code - # or a specific dart file by using the `// ignore: name_of_lint` and - # `// ignore_for_file: name_of_lint` syntax on the line or in the file - # producing the lint. rules: - # avoid_print: false # Uncomment to disable the `avoid_print` rule - # prefer_single_quotes: true # Uncomment to enable the `prefer_single_quotes` rule - -# Additional information about this file can be found at -# https://dart.dev/guides/language/analysis-options + # Noise in small sample apps; keep the code readable. + avoid_print: false + avoid_unnecessary_containers: false + file_names: false + library_private_types_in_public_api: false + non_constant_identifier_names: false + strict_top_level_inference: false diff --git a/tic_tac_toe/android/app/build.gradle.kts b/tic_tac_toe/android/app/build.gradle.kts index ec56d5f..c6a9a85 100644 --- a/tic_tac_toe/android/app/build.gradle.kts +++ b/tic_tac_toe/android/app/build.gradle.kts @@ -6,7 +6,7 @@ plugins { } android { - namespace = "com.example.tic_tac_toe" + namespace = "github.nisrulz.tic_tac_toe" compileSdk = flutter.compileSdkVersion ndkVersion = flutter.ndkVersion @@ -16,7 +16,7 @@ android { } defaultConfig { - applicationId = "com.example.tic_tac_toe" + applicationId = "github.nisrulz.tic_tac_toe" minSdk = flutter.minSdkVersion targetSdk = flutter.targetSdkVersion versionCode = flutter.versionCode diff --git a/tic_tac_toe/android/app/src/debug/AndroidManifest.xml b/tic_tac_toe/android/app/src/debug/AndroidManifest.xml index cb3ff04..399f698 100644 --- a/tic_tac_toe/android/app/src/debug/AndroidManifest.xml +++ b/tic_tac_toe/android/app/src/debug/AndroidManifest.xml @@ -1,5 +1,4 @@ - + diff --git a/todo_list_using_provider/android/app/src/main/AndroidManifest.xml b/todo_list_using_provider/android/app/src/main/AndroidManifest.xml index fef8ab3..b136e5d 100644 --- a/todo_list_using_provider/android/app/src/main/AndroidManifest.xml +++ b/todo_list_using_provider/android/app/src/main/AndroidManifest.xml @@ -11,6 +11,7 @@ android:icon="@mipmap/ic_launcher"> + diff --git a/todo_list_using_provider/lib/main.dart b/todo_list_using_provider/lib/main.dart index 37bc53c..5d1cbcf 100644 --- a/todo_list_using_provider/lib/main.dart +++ b/todo_list_using_provider/lib/main.dart @@ -9,6 +9,8 @@ void main() { } class MyApp extends StatelessWidget { + const MyApp({super.key}); + // This widget is the root of your application. @override Widget build(BuildContext context) { diff --git a/todo_list_using_provider/lib/models/todo.dart b/todo_list_using_provider/lib/models/todo.dart index 7888e8e..740cc79 100644 --- a/todo_list_using_provider/lib/models/todo.dart +++ b/todo_list_using_provider/lib/models/todo.dart @@ -9,7 +9,7 @@ class Todo extends ChangeNotifier { /// Toggles the value of the item and notify to listeners void toggle() { - this.done = !this.done; + done = !done; notifyListeners(); } } diff --git a/todo_list_using_provider/lib/notifiers/todo_list.dart b/todo_list_using_provider/lib/notifiers/todo_list.dart index 70db5af..43ce0d2 100644 --- a/todo_list_using_provider/lib/notifiers/todo_list.dart +++ b/todo_list_using_provider/lib/notifiers/todo_list.dart @@ -1,25 +1,25 @@ import 'package:flutter/foundation.dart'; -import 'package:flutter_new_provider_todo/models/todo.dart'; +import 'package:todo_list_using_provider/models/todo.dart'; /// This class represents a model /// that notify listeners when it has some changes class TodoList extends ChangeNotifier { - List _list = []; + final List _list = []; List get list => _list; void add(Todo newItem) { - this._list.add(newItem); + _list.add(newItem); notifyListeners(); } void remove(Todo removedItem) { - this._list.remove(removedItem); + _list.remove(removedItem); notifyListeners(); } void clearDoneItems() { - this._list.removeWhere((Todo element) => element.done); + _list.removeWhere((Todo element) => element.done); notifyListeners(); } } diff --git a/todo_list_using_provider/lib/widgets/add_button.dart b/todo_list_using_provider/lib/widgets/add_button.dart index e029067..f995f4f 100644 --- a/todo_list_using_provider/lib/widgets/add_button.dart +++ b/todo_list_using_provider/lib/widgets/add_button.dart @@ -5,6 +5,8 @@ import '../models/todo.dart'; import '../notifiers/todo_list.dart'; class AddButton extends StatelessWidget { + const AddButton({super.key}); + @override Widget build(BuildContext context) { final todoList = Provider.of(context, listen: false); @@ -13,7 +15,7 @@ class AddButton extends StatelessWidget { return FloatingActionButton( onPressed: () { todoList.add( - new Todo(id: '${todoList.list.length}', title: 'tituloTodo${todoList.list.length}') + Todo(id: '${todoList.list.length}', title: 'tituloTodo${todoList.list.length}') ); }, tooltip: 'Increment', diff --git a/todo_list_using_provider/lib/widgets/todo_list_item_display.dart b/todo_list_using_provider/lib/widgets/todo_list_item_display.dart index d5d9605..076bbdb 100644 --- a/todo_list_using_provider/lib/widgets/todo_list_item_display.dart +++ b/todo_list_using_provider/lib/widgets/todo_list_item_display.dart @@ -4,6 +4,8 @@ import 'package:provider/provider.dart'; import '../models/todo.dart'; class TodoListItemDisplay extends StatelessWidget { + const TodoListItemDisplay({super.key}); + @override Widget build(BuildContext context) { print('rebuilding Todo List Item Display'); diff --git a/todo_list_using_provider/lib/widgets/todo_list_item_toggle_button.dart b/todo_list_using_provider/lib/widgets/todo_list_item_toggle_button.dart index d77c688..367ed80 100644 --- a/todo_list_using_provider/lib/widgets/todo_list_item_toggle_button.dart +++ b/todo_list_using_provider/lib/widgets/todo_list_item_toggle_button.dart @@ -4,6 +4,8 @@ import 'package:provider/provider.dart'; import '../models/todo.dart'; class TodoListItemToggleButton extends StatelessWidget { + const TodoListItemToggleButton({super.key}); + @override Widget build(BuildContext context) { print('build Toggle Item Button'); diff --git a/todo_list_using_provider/lib/widgets/todo_list_item_wdt.dart b/todo_list_using_provider/lib/widgets/todo_list_item_wdt.dart index d4be69a..61f69a2 100644 --- a/todo_list_using_provider/lib/widgets/todo_list_item_wdt.dart +++ b/todo_list_using_provider/lib/widgets/todo_list_item_wdt.dart @@ -5,11 +5,13 @@ import 'todo_list_item_toggle_button.dart'; class TodoListItemWdt extends StatelessWidget { + const TodoListItemWdt({super.key}); + @override Widget build(BuildContext context) { print('rebuilding ToDo List Item: '); - return new Row( + return Row( mainAxisAlignment: MainAxisAlignment.spaceAround, children: [ TodoListItemDisplay(), diff --git a/todo_list_using_provider/lib/widgets/todo_list_wdt.dart b/todo_list_using_provider/lib/widgets/todo_list_wdt.dart index 88e8c01..581cefd 100644 --- a/todo_list_using_provider/lib/widgets/todo_list_wdt.dart +++ b/todo_list_using_provider/lib/widgets/todo_list_wdt.dart @@ -6,6 +6,8 @@ import '../notifiers/todo_list.dart'; import '../widgets/todo_list_item_wdt.dart'; class TodoListWdt extends StatelessWidget { + const TodoListWdt({super.key}); + @override Widget build(BuildContext context) { print('building Todo List Wdt'); @@ -20,7 +22,7 @@ class TodoListWdt extends StatelessWidget { itemBuilder: (context, index) { return ChangeNotifierProvider( create: (context) => todoList.list[index], - child: new TodoListItemWdt() + child: TodoListItemWdt() ); }, ); diff --git a/todo_list_using_provider/pubspec.yaml b/todo_list_using_provider/pubspec.yaml index d03a06b..f61311a 100644 --- a/todo_list_using_provider/pubspec.yaml +++ b/todo_list_using_provider/pubspec.yaml @@ -1,4 +1,4 @@ -name: flutter_new_provider_todo +name: todo_list_using_provider description: A new Flutter project. # The following line prevents the package from being accidentally published to @@ -33,6 +33,7 @@ dependencies: dev_dependencies: flutter_test: sdk: flutter + 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 diff --git a/unit_testing/analysis_options.yaml b/unit_testing/analysis_options.yaml new file mode 100644 index 0000000..90b40f5 --- /dev/null +++ b/unit_testing/analysis_options.yaml @@ -0,0 +1,23 @@ +# Lint rules for Flutter apps. +# See https://dart.dev/guides/language/analysis-options +include: package:flutter_lints/flutter.yaml + +analyzer: + exclude: + - build/** + - android/** + - ios/** + - web/** + - windows/** + - macos/** + - linux/** + +linter: + rules: + # Noise in small sample apps; keep the code readable. + avoid_print: false + avoid_unnecessary_containers: false + file_names: false + library_private_types_in_public_api: false + non_constant_identifier_names: false + strict_top_level_inference: false diff --git a/unit_testing/android/app/src/main/AndroidManifest.xml b/unit_testing/android/app/src/main/AndroidManifest.xml index 80a97a4..16a0e0f 100644 --- a/unit_testing/android/app/src/main/AndroidManifest.xml +++ b/unit_testing/android/app/src/main/AndroidManifest.xml @@ -11,6 +11,7 @@ android:icon="@mipmap/ic_launcher"> runApp(MyApp()); class MyApp extends StatelessWidget { + const MyApp({super.key}); + @override Widget build(BuildContext context) { return MaterialApp( diff --git a/unit_testing/lib/screens/home_screen.dart b/unit_testing/lib/screens/home_screen.dart index df91458..bb79f47 100644 --- a/unit_testing/lib/screens/home_screen.dart +++ b/unit_testing/lib/screens/home_screen.dart @@ -5,6 +5,8 @@ import 'package:unit_testing/model/location.dart'; import '../helpers.dart'; class HomeScreen extends StatefulWidget { + const HomeScreen({super.key}); + @override _HomeScreenState createState() => _HomeScreenState(); } diff --git a/unit_testing/lib/screens/sign_in_screen.dart b/unit_testing/lib/screens/sign_in_screen.dart index 1f3b057..d1efe62 100644 --- a/unit_testing/lib/screens/sign_in_screen.dart +++ b/unit_testing/lib/screens/sign_in_screen.dart @@ -2,6 +2,8 @@ import 'package:flutter/material.dart'; import 'package:unit_testing/helpers.dart'; class SignInScreen extends StatefulWidget { + const SignInScreen({super.key}); + @override _SignInScreenState createState() => _SignInScreenState(); } diff --git a/unit_testing/pubspec.yaml b/unit_testing/pubspec.yaml index 2861803..bf389e1 100644 --- a/unit_testing/pubspec.yaml +++ b/unit_testing/pubspec.yaml @@ -32,6 +32,7 @@ dependencies: dev_dependencies: flutter_test: sdk: flutter + 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 diff --git a/using_alert_dialog/analysis_options.yaml b/using_alert_dialog/analysis_options.yaml new file mode 100644 index 0000000..90b40f5 --- /dev/null +++ b/using_alert_dialog/analysis_options.yaml @@ -0,0 +1,23 @@ +# Lint rules for Flutter apps. +# See https://dart.dev/guides/language/analysis-options +include: package:flutter_lints/flutter.yaml + +analyzer: + exclude: + - build/** + - android/** + - ios/** + - web/** + - windows/** + - macos/** + - linux/** + +linter: + rules: + # Noise in small sample apps; keep the code readable. + avoid_print: false + avoid_unnecessary_containers: false + file_names: false + library_private_types_in_public_api: false + non_constant_identifier_names: false + strict_top_level_inference: false diff --git a/using_alert_dialog/lib/main.dart b/using_alert_dialog/lib/main.dart index 2b14b16..bc21094 100644 --- a/using_alert_dialog/lib/main.dart +++ b/using_alert_dialog/lib/main.dart @@ -7,6 +7,8 @@ void main() { } class MyHome extends StatefulWidget { + const MyHome({super.key}); + @override MyHomeState createState() => MyHomeState(); } diff --git a/using_alert_dialog/pubspec.yaml b/using_alert_dialog/pubspec.yaml index a447545..7606471 100644 --- a/using_alert_dialog/pubspec.yaml +++ b/using_alert_dialog/pubspec.yaml @@ -11,6 +11,7 @@ dependencies: dev_dependencies: flutter_test: sdk: flutter + flutter_lints: ^6.0.0 # For information on the generic Dart part of this file, see the diff --git a/using_bottom_nav_bar/analysis_options.yaml b/using_bottom_nav_bar/analysis_options.yaml new file mode 100644 index 0000000..90b40f5 --- /dev/null +++ b/using_bottom_nav_bar/analysis_options.yaml @@ -0,0 +1,23 @@ +# Lint rules for Flutter apps. +# See https://dart.dev/guides/language/analysis-options +include: package:flutter_lints/flutter.yaml + +analyzer: + exclude: + - build/** + - android/** + - ios/** + - web/** + - windows/** + - macos/** + - linux/** + +linter: + rules: + # Noise in small sample apps; keep the code readable. + avoid_print: false + avoid_unnecessary_containers: false + file_names: false + library_private_types_in_public_api: false + non_constant_identifier_names: false + strict_top_level_inference: false diff --git a/using_bottom_nav_bar/lib/main.dart b/using_bottom_nav_bar/lib/main.dart index b158e0e..ff6991b 100644 --- a/using_bottom_nav_bar/lib/main.dart +++ b/using_bottom_nav_bar/lib/main.dart @@ -12,6 +12,8 @@ void main() { } class MyHome extends StatefulWidget { + const MyHome({super.key}); + @override MyHomeState createState() => MyHomeState(); } @@ -49,9 +51,9 @@ class MyHomeState extends State with SingleTickerProviderStateMixin { // Set the TabBar view as the body of the Scaffold body: TabBarView( // Add tabs as widgets - children: [FirstTab(), SecondTab(), ThirdTab()], - // set the controller controller: controller, + // Add tabs as widgets + children: [FirstTab(), SecondTab(), ThirdTab()], ), // Set the bottom navigation bar bottomNavigationBar: Material( diff --git a/using_bottom_nav_bar/lib/tabs/first.dart b/using_bottom_nav_bar/lib/tabs/first.dart index 728ae26..2bc9c98 100644 --- a/using_bottom_nav_bar/lib/tabs/first.dart +++ b/using_bottom_nav_bar/lib/tabs/first.dart @@ -1,6 +1,8 @@ import 'package:flutter/material.dart'; class FirstTab extends StatelessWidget { + const FirstTab({super.key}); + @override Widget build(BuildContext context) { return Scaffold( diff --git a/using_bottom_nav_bar/lib/tabs/second.dart b/using_bottom_nav_bar/lib/tabs/second.dart index 6070c93..4fa52b3 100644 --- a/using_bottom_nav_bar/lib/tabs/second.dart +++ b/using_bottom_nav_bar/lib/tabs/second.dart @@ -1,6 +1,8 @@ import 'package:flutter/material.dart'; class SecondTab extends StatelessWidget { + const SecondTab({super.key}); + @override Widget build(BuildContext context) { return Scaffold( diff --git a/using_bottom_nav_bar/lib/tabs/third.dart b/using_bottom_nav_bar/lib/tabs/third.dart index 45ce847..b1dea31 100644 --- a/using_bottom_nav_bar/lib/tabs/third.dart +++ b/using_bottom_nav_bar/lib/tabs/third.dart @@ -1,6 +1,8 @@ import 'package:flutter/material.dart'; class ThirdTab extends StatelessWidget { + const ThirdTab({super.key}); + @override Widget build(BuildContext context) { return Scaffold( diff --git a/using_bottom_nav_bar/pubspec.yaml b/using_bottom_nav_bar/pubspec.yaml index 4155f7a..e45a636 100644 --- a/using_bottom_nav_bar/pubspec.yaml +++ b/using_bottom_nav_bar/pubspec.yaml @@ -11,6 +11,7 @@ dependencies: dev_dependencies: flutter_test: sdk: flutter + flutter_lints: ^6.0.0 # For information on the generic Dart part of this file, see the diff --git a/using_custom_fonts/analysis_options.yaml b/using_custom_fonts/analysis_options.yaml new file mode 100644 index 0000000..90b40f5 --- /dev/null +++ b/using_custom_fonts/analysis_options.yaml @@ -0,0 +1,23 @@ +# Lint rules for Flutter apps. +# See https://dart.dev/guides/language/analysis-options +include: package:flutter_lints/flutter.yaml + +analyzer: + exclude: + - build/** + - android/** + - ios/** + - web/** + - windows/** + - macos/** + - linux/** + +linter: + rules: + # Noise in small sample apps; keep the code readable. + avoid_print: false + avoid_unnecessary_containers: false + file_names: false + library_private_types_in_public_api: false + non_constant_identifier_names: false + strict_top_level_inference: false diff --git a/using_custom_fonts/pubspec.yaml b/using_custom_fonts/pubspec.yaml index d834e63..e154eab 100644 --- a/using_custom_fonts/pubspec.yaml +++ b/using_custom_fonts/pubspec.yaml @@ -11,6 +11,7 @@ dependencies: dev_dependencies: flutter_test: sdk: flutter + flutter_lints: ^6.0.0 # For information on the generic Dart part of this file, see the diff --git a/using_edittext/analysis_options.yaml b/using_edittext/analysis_options.yaml new file mode 100644 index 0000000..90b40f5 --- /dev/null +++ b/using_edittext/analysis_options.yaml @@ -0,0 +1,23 @@ +# Lint rules for Flutter apps. +# See https://dart.dev/guides/language/analysis-options +include: package:flutter_lints/flutter.yaml + +analyzer: + exclude: + - build/** + - android/** + - ios/** + - web/** + - windows/** + - macos/** + - linux/** + +linter: + rules: + # Noise in small sample apps; keep the code readable. + avoid_print: false + avoid_unnecessary_containers: false + file_names: false + library_private_types_in_public_api: false + non_constant_identifier_names: false + strict_top_level_inference: false diff --git a/using_edittext/lib/main.dart b/using_edittext/lib/main.dart index 5fda8b3..7b7305b 100644 --- a/using_edittext/lib/main.dart +++ b/using_edittext/lib/main.dart @@ -7,6 +7,8 @@ void main() { } class MyEditText extends StatefulWidget { + const MyEditText({super.key}); + @override MyEditTextState createState() => MyEditTextState(); } @@ -33,7 +35,7 @@ class MyEditTextState extends State { decoration: InputDecoration(hintText: "Enter text here..."), onSubmitted: (String str) { setState(() { - results = results + "\n" + str; + results = "$results\n$str"; controller.text = ""; }); }, diff --git a/using_edittext/pubspec.yaml b/using_edittext/pubspec.yaml index 6200074..0bf17db 100644 --- a/using_edittext/pubspec.yaml +++ b/using_edittext/pubspec.yaml @@ -11,6 +11,7 @@ dependencies: dev_dependencies: flutter_test: sdk: flutter + flutter_lints: ^6.0.0 # For information on the generic Dart part of this file, see the diff --git a/using_expansionpanel/analysis_options.yaml b/using_expansionpanel/analysis_options.yaml index 5bee4ff..90b40f5 100644 --- a/using_expansionpanel/analysis_options.yaml +++ b/using_expansionpanel/analysis_options.yaml @@ -1,12 +1,7 @@ -# This file configures the analyzer, which statically analyzes Dart code to -# check for errors, warnings, and lints. -# -# The issues identified by the analyzer are surfaced in the UI of Dart-enabled -# IDEs (https://dart.dev/tools#ides-and-editors). The analyzer can also be -# invoked from the command line by running `flutter analyze`. +# Lint rules for Flutter apps. +# See https://dart.dev/guides/language/analysis-options +include: package:flutter_lints/flutter.yaml -# The following line activates a set of recommended lints for Flutter apps, -# packages, and plugins designed to encourage good coding practices. analyzer: exclude: - build/** @@ -16,23 +11,13 @@ analyzer: - windows/** - macos/** - linux/** -include: package:flutter_lints/flutter.yaml linter: - # The lint rules applied to this project can be customized in the - # section below to disable rules from the `package:flutter_lints/flutter.yaml` - # included above or to enable additional rules. A list of all available lints - # and their documentation is published at - # https://dart-lang.github.io/linter/lints/index.html. - # - # Instead of disabling a lint rule for the entire project in the - # section below, it can also be suppressed for a single line of code - # or a specific dart file by using the `// ignore: name_of_lint` and - # `// ignore_for_file: name_of_lint` syntax on the line or in the file - # producing the lint. rules: - # avoid_print: false # Uncomment to disable the `avoid_print` rule - # prefer_single_quotes: true # Uncomment to enable the `prefer_single_quotes` rule - -# Additional information about this file can be found at -# https://dart.dev/guides/language/analysis-options + # Noise in small sample apps; keep the code readable. + avoid_print: false + avoid_unnecessary_containers: false + file_names: false + library_private_types_in_public_api: false + non_constant_identifier_names: false + strict_top_level_inference: false diff --git a/using_expansionpanel/lib/main.dart b/using_expansionpanel/lib/main.dart index c0465c9..b676199 100644 --- a/using_expansionpanel/lib/main.dart +++ b/using_expansionpanel/lib/main.dart @@ -21,7 +21,7 @@ class MyApp extends StatelessWidget { } class ExpansionPanelScreen extends StatefulWidget { - const ExpansionPanelScreen({Key? key}) : super(key: key); + const ExpansionPanelScreen({super.key}); @override State createState() => _ExpansionPanelScreenState(); diff --git a/using_expansionpanel/pubspec.yaml b/using_expansionpanel/pubspec.yaml index ead3963..efe9127 100644 --- a/using_expansionpanel/pubspec.yaml +++ b/using_expansionpanel/pubspec.yaml @@ -20,7 +20,7 @@ publish_to: 'none' # Remove this line if you wish to publish to pub.dev version: 1.0.0+1 environment: - sdk: '>=2.18.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 @@ -35,6 +35,7 @@ dependencies: dev_dependencies: flutter_test: sdk: flutter + 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 diff --git a/using_firebase_db/.flutter-plugins-dependencies b/using_firebase_db/.flutter-plugins-dependencies deleted file mode 100644 index 6ecbe8f..0000000 --- a/using_firebase_db/.flutter-plugins-dependencies +++ /dev/null @@ -1 +0,0 @@ -{"info":"This is a generated file; do not edit or check into version control.","plugins":{"ios":[{"name":"firebase_core","path":"/Users/nishantsrivastava/.pub-cache/hosted/pub.dev/firebase_core-4.13.0/","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"firebase_database","path":"/Users/nishantsrivastava/.pub-cache/hosted/pub.dev/firebase_database-12.4.7/","native_build":true,"dependencies":["firebase_core"],"dev_dependency":false}],"android":[{"name":"firebase_core","path":"/Users/nishantsrivastava/.pub-cache/hosted/pub.dev/firebase_core-4.13.0/","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"firebase_database","path":"/Users/nishantsrivastava/.pub-cache/hosted/pub.dev/firebase_database-12.4.7/","native_build":true,"dependencies":["firebase_core"],"dev_dependency":false}],"macos":[{"name":"firebase_core","path":"/Users/nishantsrivastava/.pub-cache/hosted/pub.dev/firebase_core-4.13.0/","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"firebase_database","path":"/Users/nishantsrivastava/.pub-cache/hosted/pub.dev/firebase_database-12.4.7/","native_build":true,"dependencies":["firebase_core"],"dev_dependency":false}],"linux":[],"windows":[{"name":"firebase_core","path":"/Users/nishantsrivastava/.pub-cache/hosted/pub.dev/firebase_core-4.13.0/","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"firebase_database","path":"/Users/nishantsrivastava/.pub-cache/hosted/pub.dev/firebase_database-12.4.7/","native_build":true,"dependencies":["firebase_core"],"dev_dependency":false}],"web":[{"name":"firebase_core_web","path":"/Users/nishantsrivastava/.pub-cache/hosted/pub.dev/firebase_core_web-3.10.0/","dependencies":[],"dev_dependency":false},{"name":"firebase_database_web","path":"/Users/nishantsrivastava/.pub-cache/hosted/pub.dev/firebase_database_web-0.2.7+13/","dependencies":["firebase_core_web"],"dev_dependency":false}]},"dependencyGraph":[{"name":"firebase_core","dependencies":["firebase_core_web"]},{"name":"firebase_core_web","dependencies":[]},{"name":"firebase_database","dependencies":["firebase_core","firebase_database_web"]},{"name":"firebase_database_web","dependencies":["firebase_core","firebase_core_web"]}],"date_created":"2026-08-16 19:49:25.655397","version":"3.47.0","swift_package_manager_enabled":{"ios":false,"macos":false}} \ No newline at end of file diff --git a/using_firebase_db/analysis_options.yaml b/using_firebase_db/analysis_options.yaml new file mode 100644 index 0000000..90b40f5 --- /dev/null +++ b/using_firebase_db/analysis_options.yaml @@ -0,0 +1,23 @@ +# Lint rules for Flutter apps. +# See https://dart.dev/guides/language/analysis-options +include: package:flutter_lints/flutter.yaml + +analyzer: + exclude: + - build/** + - android/** + - ios/** + - web/** + - windows/** + - macos/** + - linux/** + +linter: + rules: + # Noise in small sample apps; keep the code readable. + avoid_print: false + avoid_unnecessary_containers: false + file_names: false + library_private_types_in_public_api: false + non_constant_identifier_names: false + strict_top_level_inference: false diff --git a/using_firebase_db/android/app/src/main/AndroidManifest.xml b/using_firebase_db/android/app/src/main/AndroidManifest.xml index 70a42ec..73de986 100644 --- a/using_firebase_db/android/app/src/main/AndroidManifest.xml +++ b/using_firebase_db/android/app/src/main/AndroidManifest.xml @@ -12,6 +12,7 @@ android:icon="@mipmap/ic_launcher"> runApp(MyApp()); class MyApp extends StatelessWidget { + const MyApp({super.key}); + @override Widget build(BuildContext context) { return MaterialApp( @@ -29,7 +31,7 @@ class MyApp extends StatelessWidget { } class MyHomePage extends StatefulWidget { - MyHomePage({super.key, required this.title}); + const MyHomePage({super.key, required this.title}); final String title; @override @@ -74,6 +76,12 @@ class _MyHomePageState extends State { }); } + @override + void dispose() { + _noteAddedStream.cancel(); + super.dispose(); + } + // The note has to be cleared from the database and the local list void _deleteNote(int position) { String id = items[position].id; @@ -97,8 +105,8 @@ class _MyHomePageState extends State { Container( padding: EdgeInsets.all(15.0), child: TextField( - style: new TextStyle( - fontSize: 24.0, height: 2.0, color: Colors.black), + style: + TextStyle(fontSize: 24.0, height: 2.0, color: Colors.black), decoration: InputDecoration( border: InputBorder.none, hintText: 'Add a note'), controller: inputController, diff --git a/using_firebase_db/pubspec.yaml b/using_firebase_db/pubspec.yaml index 18eae27..6847681 100644 --- a/using_firebase_db/pubspec.yaml +++ b/using_firebase_db/pubspec.yaml @@ -28,6 +28,7 @@ dependencies: dev_dependencies: flutter_test: sdk: flutter + flutter_lints: ^6.0.0 # For information on the generic Dart part of this file, see the diff --git a/using_gradient/analysis_options.yaml b/using_gradient/analysis_options.yaml new file mode 100644 index 0000000..90b40f5 --- /dev/null +++ b/using_gradient/analysis_options.yaml @@ -0,0 +1,23 @@ +# Lint rules for Flutter apps. +# See https://dart.dev/guides/language/analysis-options +include: package:flutter_lints/flutter.yaml + +analyzer: + exclude: + - build/** + - android/** + - ios/** + - web/** + - windows/** + - macos/** + - linux/** + +linter: + rules: + # Noise in small sample apps; keep the code readable. + avoid_print: false + avoid_unnecessary_containers: false + file_names: false + library_private_types_in_public_api: false + non_constant_identifier_names: false + strict_top_level_inference: false diff --git a/using_gradient/lib/main.dart b/using_gradient/lib/main.dart index 1fc33cc..5ee3b74 100644 --- a/using_gradient/lib/main.dart +++ b/using_gradient/lib/main.dart @@ -16,15 +16,15 @@ void main() { // Body body: Container( // Center the content + decoration: BoxDecoration( + // Add Gradient + gradient: utils.getCustomGradient()), + // Center the content child: Center( // Add Text child: Text( "Hello World!", style: TextStyle(color: Colors.white), ), - ), - // Set background - decoration: BoxDecoration( - // Add Gradient - gradient: utils.getCustomGradient()))))); + ))))); } diff --git a/using_gradient/pubspec.yaml b/using_gradient/pubspec.yaml index 4f89f44..611b7e4 100644 --- a/using_gradient/pubspec.yaml +++ b/using_gradient/pubspec.yaml @@ -11,6 +11,7 @@ dependencies: dev_dependencies: flutter_test: sdk: flutter + flutter_lints: ^6.0.0 # For information on the generic Dart part of this file, see the diff --git a/using_http_get/analysis_options.yaml b/using_http_get/analysis_options.yaml new file mode 100644 index 0000000..90b40f5 --- /dev/null +++ b/using_http_get/analysis_options.yaml @@ -0,0 +1,23 @@ +# Lint rules for Flutter apps. +# See https://dart.dev/guides/language/analysis-options +include: package:flutter_lints/flutter.yaml + +analyzer: + exclude: + - build/** + - android/** + - ios/** + - web/** + - windows/** + - macos/** + - linux/** + +linter: + rules: + # Noise in small sample apps; keep the code readable. + avoid_print: false + avoid_unnecessary_containers: false + file_names: false + library_private_types_in_public_api: false + non_constant_identifier_names: false + strict_top_level_inference: false diff --git a/using_http_get/lib/main.dart b/using_http_get/lib/main.dart index 00c773f..7c3a7fa 100644 --- a/using_http_get/lib/main.dart +++ b/using_http_get/lib/main.dart @@ -11,6 +11,8 @@ void main() { // Create a stateful widget class MyGetHttpData extends StatefulWidget { + const MyGetHttpData({super.key}); + @override MyGetHttpDataState createState() => MyGetHttpDataState(); } @@ -66,6 +68,7 @@ class MyGetHttpDataState extends State { children: [ Card( child: Container( + padding: const EdgeInsets.all(15.0), child: Text( // Read the name field value and set it in the Text widget data![index]['name'], @@ -73,8 +76,6 @@ class MyGetHttpDataState extends State { style: TextStyle( fontSize: 20.0, color: Colors.lightBlueAccent), ), - // added padding - padding: const EdgeInsets.all(15.0), ), ) ], @@ -89,6 +90,6 @@ class MyGetHttpDataState extends State { super.initState(); // Call the getJSONData() method when the app initializes - this.getJSONData(); + getJSONData(); } } diff --git a/using_http_get/pubspec.yaml b/using_http_get/pubspec.yaml index 7a5b3d1..12d3ad0 100644 --- a/using_http_get/pubspec.yaml +++ b/using_http_get/pubspec.yaml @@ -12,6 +12,7 @@ dependencies: dev_dependencies: flutter_test: sdk: flutter + flutter_lints: ^6.0.0 # For information on the generic Dart part of this file, see the diff --git a/using_interactiveviewer/analysis_options.yaml b/using_interactiveviewer/analysis_options.yaml new file mode 100644 index 0000000..90b40f5 --- /dev/null +++ b/using_interactiveviewer/analysis_options.yaml @@ -0,0 +1,23 @@ +# Lint rules for Flutter apps. +# See https://dart.dev/guides/language/analysis-options +include: package:flutter_lints/flutter.yaml + +analyzer: + exclude: + - build/** + - android/** + - ios/** + - web/** + - windows/** + - macos/** + - linux/** + +linter: + rules: + # Noise in small sample apps; keep the code readable. + avoid_print: false + avoid_unnecessary_containers: false + file_names: false + library_private_types_in_public_api: false + non_constant_identifier_names: false + strict_top_level_inference: false diff --git a/using_interactiveviewer/android/app/src/main/AndroidManifest.xml b/using_interactiveviewer/android/app/src/main/AndroidManifest.xml index 6e7001b..ea7dcc1 100644 --- a/using_interactiveviewer/android/app/src/main/AndroidManifest.xml +++ b/using_interactiveviewer/android/app/src/main/AndroidManifest.xml @@ -11,6 +11,7 @@ android:icon="@mipmap/ic_launcher"> runApp(MyApp()); class MyApp extends StatelessWidget { + const MyApp({super.key}); + @override Widget build(BuildContext context) { return MaterialApp( diff --git a/using_interactiveviewer/pubspec.yaml b/using_interactiveviewer/pubspec.yaml index 4d49e98..899c4b4 100644 --- a/using_interactiveviewer/pubspec.yaml +++ b/using_interactiveviewer/pubspec.yaml @@ -32,6 +32,7 @@ dependencies: dev_dependencies: flutter_test: sdk: flutter + 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 diff --git a/using_listview/analysis_options.yaml b/using_listview/analysis_options.yaml new file mode 100644 index 0000000..90b40f5 --- /dev/null +++ b/using_listview/analysis_options.yaml @@ -0,0 +1,23 @@ +# Lint rules for Flutter apps. +# See https://dart.dev/guides/language/analysis-options +include: package:flutter_lints/flutter.yaml + +analyzer: + exclude: + - build/** + - android/** + - ios/** + - web/** + - windows/** + - macos/** + - linux/** + +linter: + rules: + # Noise in small sample apps; keep the code readable. + avoid_print: false + avoid_unnecessary_containers: false + file_names: false + library_private_types_in_public_api: false + non_constant_identifier_names: false + strict_top_level_inference: false diff --git a/using_listview/lib/contact_page.dart b/using_listview/lib/contact_page.dart index 8f9d318..0155fc9 100644 --- a/using_listview/lib/contact_page.dart +++ b/using_listview/lib/contact_page.dart @@ -3,7 +3,9 @@ import 'package:using_listview/contactlist/contact_list.dart'; import 'package:using_listview/contactlist/modal/contact.dart'; class ContactPage extends StatelessWidget { - _buildContactList() { + const ContactPage({super.key}); + + List _buildContactList() { return [ const ContactModal( fullName: 'Romain Hoogmoed', email: 'romain.hoogmoed@example.com'), diff --git a/using_listview/lib/contactlist/contact_list.dart b/using_listview/lib/contactlist/contact_list.dart index 9ad5fc4..20fdf90 100644 --- a/using_listview/lib/contactlist/contact_list.dart +++ b/using_listview/lib/contactlist/contact_list.dart @@ -5,7 +5,7 @@ import 'package:using_listview/contactlist/modal/contact.dart'; class ContactsList extends StatelessWidget { final List _contactModal; - ContactsList(this._contactModal); + const ContactsList(this._contactModal, {super.key}); @override Widget build(BuildContext context) { diff --git a/using_listview/lib/contactlist/contact_list_item.dart b/using_listview/lib/contactlist/contact_list_item.dart index 5de150f..82b1557 100644 --- a/using_listview/lib/contactlist/contact_list_item.dart +++ b/using_listview/lib/contactlist/contact_list_item.dart @@ -4,7 +4,7 @@ import 'package:using_listview/contactlist/modal/contact.dart'; class ContactListItem extends StatelessWidget { final ContactModal _contactModal; - ContactListItem(this._contactModal); + const ContactListItem(this._contactModal, {super.key}); @override Widget build(BuildContext context) { diff --git a/using_listview/pubspec.yaml b/using_listview/pubspec.yaml index 7d83100..3f8d4f0 100644 --- a/using_listview/pubspec.yaml +++ b/using_listview/pubspec.yaml @@ -15,6 +15,7 @@ dependencies: dev_dependencies: flutter_test: sdk: flutter + flutter_lints: ^6.0.0 # For information on the generic Dart part of this file, see the diff --git a/using_listwheelscrollview/analysis_options.yaml b/using_listwheelscrollview/analysis_options.yaml new file mode 100644 index 0000000..90b40f5 --- /dev/null +++ b/using_listwheelscrollview/analysis_options.yaml @@ -0,0 +1,23 @@ +# Lint rules for Flutter apps. +# See https://dart.dev/guides/language/analysis-options +include: package:flutter_lints/flutter.yaml + +analyzer: + exclude: + - build/** + - android/** + - ios/** + - web/** + - windows/** + - macos/** + - linux/** + +linter: + rules: + # Noise in small sample apps; keep the code readable. + avoid_print: false + avoid_unnecessary_containers: false + file_names: false + library_private_types_in_public_api: false + non_constant_identifier_names: false + strict_top_level_inference: false diff --git a/using_listwheelscrollview/android/app/src/main/AndroidManifest.xml b/using_listwheelscrollview/android/app/src/main/AndroidManifest.xml index e40c404..44fd9cc 100644 --- a/using_listwheelscrollview/android/app/src/main/AndroidManifest.xml +++ b/using_listwheelscrollview/android/app/src/main/AndroidManifest.xml @@ -1,47 +1,48 @@ - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + diff --git a/using_listwheelscrollview/android/app/src/main/java/io/flutter/plugins/GeneratedPluginRegistrant.java b/using_listwheelscrollview/android/app/src/main/java/io/flutter/plugins/GeneratedPluginRegistrant.java deleted file mode 100644 index 539ab02..0000000 --- a/using_listwheelscrollview/android/app/src/main/java/io/flutter/plugins/GeneratedPluginRegistrant.java +++ /dev/null @@ -1,19 +0,0 @@ -package io.flutter.plugins; - -import androidx.annotation.Keep; -import androidx.annotation.NonNull; -import io.flutter.Log; - -import io.flutter.embedding.engine.FlutterEngine; - -/** - * Generated file. Do not edit. - * This file is generated by the Flutter tool based on the - * plugins that support the Android platform. - */ -@Keep -public final class GeneratedPluginRegistrant { - private static final String TAG = "GeneratedPluginRegistrant"; - public static void registerWith(@NonNull FlutterEngine flutterEngine) { - } -} diff --git a/using_listwheelscrollview/ios/Runner/GeneratedPluginRegistrant.h b/using_listwheelscrollview/ios/Runner/GeneratedPluginRegistrant.h deleted file mode 100644 index 7a89092..0000000 --- a/using_listwheelscrollview/ios/Runner/GeneratedPluginRegistrant.h +++ /dev/null @@ -1,19 +0,0 @@ -// -// Generated file. Do not edit. -// - -// clang-format off - -#ifndef GeneratedPluginRegistrant_h -#define GeneratedPluginRegistrant_h - -#import - -NS_ASSUME_NONNULL_BEGIN - -@interface GeneratedPluginRegistrant : NSObject -+ (void)registerWithRegistry:(NSObject*)registry; -@end - -NS_ASSUME_NONNULL_END -#endif /* GeneratedPluginRegistrant_h */ diff --git a/using_listwheelscrollview/ios/Runner/GeneratedPluginRegistrant.m b/using_listwheelscrollview/ios/Runner/GeneratedPluginRegistrant.m deleted file mode 100644 index efe65ec..0000000 --- a/using_listwheelscrollview/ios/Runner/GeneratedPluginRegistrant.m +++ /dev/null @@ -1,14 +0,0 @@ -// -// Generated file. Do not edit. -// - -// clang-format off - -#import "GeneratedPluginRegistrant.h" - -@implementation GeneratedPluginRegistrant - -+ (void)registerWithRegistry:(NSObject*)registry { -} - -@end diff --git a/using_listwheelscrollview/lib/listwheel.dart b/using_listwheelscrollview/lib/listwheel.dart index c14ce53..c6e2fe0 100644 --- a/using_listwheelscrollview/lib/listwheel.dart +++ b/using_listwheelscrollview/lib/listwheel.dart @@ -1,8 +1,9 @@ -import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'roundcontainer.dart'; class Listwheel extends StatefulWidget { + const Listwheel({super.key}); + @override _ListwheelState createState() => _ListwheelState(); } @@ -16,6 +17,10 @@ class _ListwheelState extends State { backgroundColor: Colors.white70, body: Container( child: ListWheelScrollView( + squeeze: 1.0, + itemExtent: 180, + diameterRatio: 1.9, + offAxisFraction: -0.5, children: [ NewWidget( size: size, @@ -74,10 +79,6 @@ class _ListwheelState extends State { ), s: 'Email'), ], - squeeze: 1.0, - itemExtent: 180, - diameterRatio: 1.9, - offAxisFraction: -0.5, ), ), ); diff --git a/using_listwheelscrollview/lib/main.dart b/using_listwheelscrollview/lib/main.dart index 2ca3d7f..527434d 100644 --- a/using_listwheelscrollview/lib/main.dart +++ b/using_listwheelscrollview/lib/main.dart @@ -6,6 +6,8 @@ void main() { } class MyApp extends StatelessWidget { + const MyApp({super.key}); + // This widget is the root of your application. @override Widget build(BuildContext context) { diff --git a/using_listwheelscrollview/lib/roundcontainer.dart b/using_listwheelscrollview/lib/roundcontainer.dart index c904350..f41a879 100644 --- a/using_listwheelscrollview/lib/roundcontainer.dart +++ b/using_listwheelscrollview/lib/roundcontainer.dart @@ -3,8 +3,9 @@ import 'package:flutter/material.dart'; class NewWidget extends StatelessWidget { final Widget l; final String s; - double radius = 8; - NewWidget({required this.size, required this.l, required this.s}); + final double radius = 8; + const NewWidget( + {super.key, required this.size, required this.l, required this.s}); final double size; @override @@ -20,7 +21,7 @@ class NewWidget extends StatelessWidget { BoxShadow( offset: Offset(5, 5), blurRadius: radius, - color: Color(0XFF585858).withOpacity(.3), + color: Color(0XFF585858).withValues(alpha: .3), ), ], ), diff --git a/using_listwheelscrollview/pubspec.yaml b/using_listwheelscrollview/pubspec.yaml index 80c21b4..4b2e87f 100644 --- a/using_listwheelscrollview/pubspec.yaml +++ b/using_listwheelscrollview/pubspec.yaml @@ -1,76 +1,77 @@ -name: usinglistwheelscrollview -description: A new Flutter application. - -# The following line prevents the package from being accidentally published to -# pub.dev using `pub publish`. This is preferred for private packages. -publish_to: 'none' # Remove this line if you wish to publish to pub.dev - -# The following defines the version and build number for your application. -# A version number is three numbers separated by dots, like 1.2.43 -# followed by an optional build number separated by a +. -# Both the version and the builder number may be overridden in flutter -# build by specifying --build-name and --build-number, respectively. -# In Android, build-name is used as versionName while build-number used as versionCode. -# Read more about Android versioning at https://developer.android.com/studio/publish/versioning -# In iOS, build-name is used as CFBundleShortVersionString while build-number used as CFBundleVersion. -# Read more about iOS versioning at -# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html -version: 1.0.0+1 - -environment: - sdk: ">=3.0.0 <4.0.0" - -dependencies: - flutter: - sdk: flutter - - - # The following adds the Cupertino Icons font to your application. - # Use with the CupertinoIcons class for iOS style icons. - cupertino_icons: ^1.0.9 - -dev_dependencies: - flutter_test: - sdk: flutter - -# For information on the generic Dart part of this file, see the -# following page: https://dart.dev/tools/pub/pubspec - -# The following section is specific to Flutter. -flutter: - - # The following line ensures that the Material Icons font is - # included with your application, so that you can use the icons in - # the material Icons class. - uses-material-design: true - - # To add assets to your application, add an assets section, like this: - # assets: - # - images/a_dot_burr.jpeg - # - images/a_dot_ham.jpeg - - # An image asset can refer to one or more resolution-specific "variants", see - # https://flutter.dev/assets-and-images/#resolution-aware. - - # For details regarding adding assets from package dependencies, see - # https://flutter.dev/assets-and-images/#from-packages - - # To add custom fonts to your application, add a fonts section here, - # in this "flutter" section. Each entry in this list should have a - # "family" key with the font family name, and a "fonts" key with a - # list giving the asset and other descriptors for the font. For - # example: - # fonts: - # - family: Schyler - # fonts: - # - asset: fonts/Schyler-Regular.ttf - # - asset: fonts/Schyler-Italic.ttf - # style: italic - # - family: Trajan Pro - # fonts: - # - asset: fonts/TrajanPro.ttf - # - asset: fonts/TrajanPro_Bold.ttf - # weight: 700 - # - # For details regarding fonts from package dependencies, - # see https://flutter.dev/custom-fonts/#from-packages +name: using_listwheelscrollview +description: A new Flutter application. + +# The following line prevents the package from being accidentally published to +# pub.dev using `pub publish`. This is preferred for private packages. +publish_to: 'none' # Remove this line if you wish to publish to pub.dev + +# The following defines the version and build number for your application. +# A version number is three numbers separated by dots, like 1.2.43 +# followed by an optional build number separated by a +. +# Both the version and the builder number may be overridden in flutter +# build by specifying --build-name and --build-number, respectively. +# In Android, build-name is used as versionName while build-number used as versionCode. +# Read more about Android versioning at https://developer.android.com/studio/publish/versioning +# In iOS, build-name is used as CFBundleShortVersionString while build-number used as CFBundleVersion. +# Read more about iOS versioning at +# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html +version: 1.0.0+1 + +environment: + sdk: ">=3.0.0 <4.0.0" + +dependencies: + flutter: + sdk: flutter + + + # The following adds the Cupertino Icons font to your application. + # Use with the CupertinoIcons class for iOS style icons. + cupertino_icons: ^1.0.9 + +dev_dependencies: + flutter_test: + sdk: flutter + 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 + +# The following section is specific to Flutter. +flutter: + + # The following line ensures that the Material Icons font is + # included with your application, so that you can use the icons in + # the material Icons class. + uses-material-design: true + + # To add assets to your application, add an assets section, like this: + # assets: + # - images/a_dot_burr.jpeg + # - images/a_dot_ham.jpeg + + # An image asset can refer to one or more resolution-specific "variants", see + # https://flutter.dev/assets-and-images/#resolution-aware. + + # For details regarding adding assets from package dependencies, see + # https://flutter.dev/assets-and-images/#from-packages + + # To add custom fonts to your application, add a fonts section here, + # in this "flutter" section. Each entry in this list should have a + # "family" key with the font family name, and a "fonts" key with a + # list giving the asset and other descriptors for the font. For + # example: + # fonts: + # - family: Schyler + # fonts: + # - asset: fonts/Schyler-Regular.ttf + # - asset: fonts/Schyler-Italic.ttf + # style: italic + # - family: Trajan Pro + # fonts: + # - asset: fonts/TrajanPro.ttf + # - asset: fonts/TrajanPro_Bold.ttf + # weight: 700 + # + # For details regarding fonts from package dependencies, + # see https://flutter.dev/custom-fonts/#from-packages diff --git a/using_platform_adaptive/analysis_options.yaml b/using_platform_adaptive/analysis_options.yaml index 5bee4ff..90b40f5 100644 --- a/using_platform_adaptive/analysis_options.yaml +++ b/using_platform_adaptive/analysis_options.yaml @@ -1,12 +1,7 @@ -# This file configures the analyzer, which statically analyzes Dart code to -# check for errors, warnings, and lints. -# -# The issues identified by the analyzer are surfaced in the UI of Dart-enabled -# IDEs (https://dart.dev/tools#ides-and-editors). The analyzer can also be -# invoked from the command line by running `flutter analyze`. +# Lint rules for Flutter apps. +# See https://dart.dev/guides/language/analysis-options +include: package:flutter_lints/flutter.yaml -# The following line activates a set of recommended lints for Flutter apps, -# packages, and plugins designed to encourage good coding practices. analyzer: exclude: - build/** @@ -16,23 +11,13 @@ analyzer: - windows/** - macos/** - linux/** -include: package:flutter_lints/flutter.yaml linter: - # The lint rules applied to this project can be customized in the - # section below to disable rules from the `package:flutter_lints/flutter.yaml` - # included above or to enable additional rules. A list of all available lints - # and their documentation is published at - # https://dart-lang.github.io/linter/lints/index.html. - # - # Instead of disabling a lint rule for the entire project in the - # section below, it can also be suppressed for a single line of code - # or a specific dart file by using the `// ignore: name_of_lint` and - # `// ignore_for_file: name_of_lint` syntax on the line or in the file - # producing the lint. rules: - # avoid_print: false # Uncomment to disable the `avoid_print` rule - # prefer_single_quotes: true # Uncomment to enable the `prefer_single_quotes` rule - -# Additional information about this file can be found at -# https://dart.dev/guides/language/analysis-options + # Noise in small sample apps; keep the code readable. + avoid_print: false + avoid_unnecessary_containers: false + file_names: false + library_private_types_in_public_api: false + non_constant_identifier_names: false + strict_top_level_inference: false diff --git a/using_platform_adaptive/lib/main.dart b/using_platform_adaptive/lib/main.dart index bbe965b..fed9164 100644 --- a/using_platform_adaptive/lib/main.dart +++ b/using_platform_adaptive/lib/main.dart @@ -1,4 +1,3 @@ -import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:using_platform_adaptive/common_widgets/adaptive_button.dart'; import 'package:using_platform_adaptive/common_widgets/adaptive_date_picker.dart'; diff --git a/using_platform_adaptive/macos/Flutter/GeneratedPluginRegistrant.swift b/using_platform_adaptive/macos/Flutter/GeneratedPluginRegistrant.swift deleted file mode 100644 index cccf817..0000000 --- a/using_platform_adaptive/macos/Flutter/GeneratedPluginRegistrant.swift +++ /dev/null @@ -1,10 +0,0 @@ -// -// Generated file. Do not edit. -// - -import FlutterMacOS -import Foundation - - -func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) { -} diff --git a/using_platform_adaptive/pubspec.yaml b/using_platform_adaptive/pubspec.yaml index 971f0a5..135b855 100644 --- a/using_platform_adaptive/pubspec.yaml +++ b/using_platform_adaptive/pubspec.yaml @@ -20,7 +20,7 @@ publish_to: 'none' # Remove this line if you wish to publish to pub.dev version: 1.0.0+1 environment: - sdk: '>=2.18.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 diff --git a/using_snackbar/analysis_options.yaml b/using_snackbar/analysis_options.yaml new file mode 100644 index 0000000..90b40f5 --- /dev/null +++ b/using_snackbar/analysis_options.yaml @@ -0,0 +1,23 @@ +# Lint rules for Flutter apps. +# See https://dart.dev/guides/language/analysis-options +include: package:flutter_lints/flutter.yaml + +analyzer: + exclude: + - build/** + - android/** + - ios/** + - web/** + - windows/** + - macos/** + - linux/** + +linter: + rules: + # Noise in small sample apps; keep the code readable. + avoid_print: false + avoid_unnecessary_containers: false + file_names: false + library_private_types_in_public_api: false + non_constant_identifier_names: false + strict_top_level_inference: false diff --git a/using_snackbar/lib/main.dart b/using_snackbar/lib/main.dart index a6fb8ca..021c3ad 100644 --- a/using_snackbar/lib/main.dart +++ b/using_snackbar/lib/main.dart @@ -5,6 +5,8 @@ void main() { } class ContactPage extends StatelessWidget { + const ContactPage({super.key}); + @override Widget build(BuildContext context) { return Scaffold( @@ -19,6 +21,8 @@ class ContactPage extends StatelessWidget { } class MyButton extends StatelessWidget { + const MyButton({super.key}); + @override Widget build(BuildContext context) { return ElevatedButton( diff --git a/using_snackbar/pubspec.yaml b/using_snackbar/pubspec.yaml index a516db9..da395f0 100644 --- a/using_snackbar/pubspec.yaml +++ b/using_snackbar/pubspec.yaml @@ -15,6 +15,7 @@ dependencies: dev_dependencies: flutter_test: sdk: flutter + flutter_lints: ^6.0.0 # For information on the generic Dart part of this file, see the diff --git a/using_stepper/analysis_options.yaml b/using_stepper/analysis_options.yaml new file mode 100644 index 0000000..90b40f5 --- /dev/null +++ b/using_stepper/analysis_options.yaml @@ -0,0 +1,23 @@ +# Lint rules for Flutter apps. +# See https://dart.dev/guides/language/analysis-options +include: package:flutter_lints/flutter.yaml + +analyzer: + exclude: + - build/** + - android/** + - ios/** + - web/** + - windows/** + - macos/** + - linux/** + +linter: + rules: + # Noise in small sample apps; keep the code readable. + avoid_print: false + avoid_unnecessary_containers: false + file_names: false + library_private_types_in_public_api: false + non_constant_identifier_names: false + strict_top_level_inference: false diff --git a/using_stepper/lib/main.dart b/using_stepper/lib/main.dart index a0475bb..3ed05b9 100644 --- a/using_stepper/lib/main.dart +++ b/using_stepper/lib/main.dart @@ -9,6 +9,8 @@ void main() { } class MyHome extends StatefulWidget { + const MyHome({super.key}); + @override MyHomeState createState() => MyHomeState(); } @@ -47,7 +49,7 @@ class MyHomeState extends State { body: Container( child: Stepper( // Using a variable here for handling the currentStep - currentStep: this.current_step, + currentStep: current_step, // List the steps you would like to have steps: my_steps, // Define the type of Stepper style @@ -63,7 +65,7 @@ class MyHomeState extends State { current_step = step; }); // Log function call - print("onStepTapped : " + step.toString()); + print("onStepTapped : $step"); }, onStepCancel: () { // On hitting cancel button, change the state @@ -77,7 +79,7 @@ class MyHomeState extends State { } }); // Log function call - print("onStepCancel : " + current_step.toString()); + print("onStepCancel : $current_step"); }, // On hitting continue button, change the state onStepContinue: () { @@ -91,7 +93,7 @@ class MyHomeState extends State { } }); // Log function call - print("onStepContinue : " + current_step.toString()); + print("onStepContinue : $current_step"); }, )), ); diff --git a/using_stepper/pubspec.yaml b/using_stepper/pubspec.yaml index 67b6d6e..ea8b00a 100644 --- a/using_stepper/pubspec.yaml +++ b/using_stepper/pubspec.yaml @@ -11,6 +11,7 @@ dependencies: dev_dependencies: flutter_test: sdk: flutter + flutter_lints: ^6.0.0 # For information on the generic Dart part of this file, see the diff --git a/using_tabs/analysis_options.yaml b/using_tabs/analysis_options.yaml new file mode 100644 index 0000000..90b40f5 --- /dev/null +++ b/using_tabs/analysis_options.yaml @@ -0,0 +1,23 @@ +# Lint rules for Flutter apps. +# See https://dart.dev/guides/language/analysis-options +include: package:flutter_lints/flutter.yaml + +analyzer: + exclude: + - build/** + - android/** + - ios/** + - web/** + - windows/** + - macos/** + - linux/** + +linter: + rules: + # Noise in small sample apps; keep the code readable. + avoid_print: false + avoid_unnecessary_containers: false + file_names: false + library_private_types_in_public_api: false + non_constant_identifier_names: false + strict_top_level_inference: false diff --git a/using_tabs/lib/main.dart b/using_tabs/lib/main.dart index 664b7d8..4e834c5 100644 --- a/using_tabs/lib/main.dart +++ b/using_tabs/lib/main.dart @@ -12,6 +12,8 @@ void main() { } class MyHome extends StatefulWidget { + const MyHome({super.key}); + @override MyHomeState createState() => MyHomeState(); } diff --git a/using_tabs/lib/tabs/first.dart b/using_tabs/lib/tabs/first.dart index 4f588f9..dfa4bb9 100644 --- a/using_tabs/lib/tabs/first.dart +++ b/using_tabs/lib/tabs/first.dart @@ -1,6 +1,8 @@ import 'package:flutter/material.dart'; class First extends StatelessWidget { + const First({super.key}); + @override Widget build(BuildContext context) { return Container( diff --git a/using_tabs/lib/tabs/second.dart b/using_tabs/lib/tabs/second.dart index a2fa5e7..7544662 100644 --- a/using_tabs/lib/tabs/second.dart +++ b/using_tabs/lib/tabs/second.dart @@ -1,6 +1,8 @@ import 'package:flutter/material.dart'; class Second extends StatelessWidget { + const Second({super.key}); + @override Widget build(BuildContext context) { return Container( diff --git a/using_tabs/lib/tabs/third.dart b/using_tabs/lib/tabs/third.dart index 38274ec..98e1208 100644 --- a/using_tabs/lib/tabs/third.dart +++ b/using_tabs/lib/tabs/third.dart @@ -1,6 +1,8 @@ import 'package:flutter/material.dart'; class Third extends StatelessWidget { + const Third({super.key}); + @override Widget build(BuildContext context) { return Container( diff --git a/using_tabs/pubspec.yaml b/using_tabs/pubspec.yaml index 50d943e..4d86626 100644 --- a/using_tabs/pubspec.yaml +++ b/using_tabs/pubspec.yaml @@ -11,6 +11,7 @@ dependencies: dev_dependencies: flutter_test: sdk: flutter + flutter_lints: ^6.0.0 # For information on the generic Dart part of this file, see the diff --git a/using_theme/analysis_options.yaml b/using_theme/analysis_options.yaml new file mode 100644 index 0000000..90b40f5 --- /dev/null +++ b/using_theme/analysis_options.yaml @@ -0,0 +1,23 @@ +# Lint rules for Flutter apps. +# See https://dart.dev/guides/language/analysis-options +include: package:flutter_lints/flutter.yaml + +analyzer: + exclude: + - build/** + - android/** + - ios/** + - web/** + - windows/** + - macos/** + - linux/** + +linter: + rules: + # Noise in small sample apps; keep the code readable. + avoid_print: false + avoid_unnecessary_containers: false + file_names: false + library_private_types_in_public_api: false + non_constant_identifier_names: false + strict_top_level_inference: false diff --git a/using_theme/lib/main.dart b/using_theme/lib/main.dart index c9b8fd4..0015552 100644 --- a/using_theme/lib/main.dart +++ b/using_theme/lib/main.dart @@ -16,6 +16,8 @@ void main() { } class MyHome extends StatelessWidget { + const MyHome({super.key}); + @override Widget build(BuildContext context) { return Scaffold( diff --git a/using_theme/pubspec.yaml b/using_theme/pubspec.yaml index a05007c..7a6cbc7 100644 --- a/using_theme/pubspec.yaml +++ b/using_theme/pubspec.yaml @@ -11,6 +11,7 @@ dependencies: dev_dependencies: flutter_test: sdk: flutter + flutter_lints: ^6.0.0 # For information on the generic Dart part of this file, see the diff --git a/view_pdf_file/analysis_options.yaml b/view_pdf_file/analysis_options.yaml new file mode 100644 index 0000000..90b40f5 --- /dev/null +++ b/view_pdf_file/analysis_options.yaml @@ -0,0 +1,23 @@ +# Lint rules for Flutter apps. +# See https://dart.dev/guides/language/analysis-options +include: package:flutter_lints/flutter.yaml + +analyzer: + exclude: + - build/** + - android/** + - ios/** + - web/** + - windows/** + - macos/** + - linux/** + +linter: + rules: + # Noise in small sample apps; keep the code readable. + avoid_print: false + avoid_unnecessary_containers: false + file_names: false + library_private_types_in_public_api: false + non_constant_identifier_names: false + strict_top_level_inference: false diff --git a/view_pdf_file/android/app/src/main/AndroidManifest.xml b/view_pdf_file/android/app/src/main/AndroidManifest.xml index 2b4fb6c..fbdbfdb 100644 --- a/view_pdf_file/android/app/src/main/AndroidManifest.xml +++ b/view_pdf_file/android/app/src/main/AndroidManifest.xml @@ -11,6 +11,7 @@ android:icon="@mipmap/ic_launcher"> _HomePageState(); } @@ -63,7 +67,7 @@ class _HomePageState extends State { ); } - loadFromAsset() async { + Future loadFromAsset() async { setState(() { isLoading = true; }); @@ -79,7 +83,7 @@ class _HomePageState extends State { ); } - loadFromURL() async { + Future loadFromURL() async { setState(() { isLoading = true; }); diff --git a/view_pdf_file/lib/viewPDF.dart b/view_pdf_file/lib/viewPDF.dart index 9d545a6..924a7b7 100644 --- a/view_pdf_file/lib/viewPDF.dart +++ b/view_pdf_file/lib/viewPDF.dart @@ -2,7 +2,7 @@ import 'package:flutter/material.dart'; class ViewPDF extends StatelessWidget { final Widget viewer; - ViewPDF({ + const ViewPDF({super.key, required this.viewer, }); diff --git a/view_pdf_file/pubspec.yaml b/view_pdf_file/pubspec.yaml index 7167622..de03ec0 100644 --- a/view_pdf_file/pubspec.yaml +++ b/view_pdf_file/pubspec.yaml @@ -31,6 +31,7 @@ dependencies: dev_dependencies: flutter_test: sdk: flutter + 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