mirror of
https://github.com/nisrulz/flutter-examples.git
synced 2026-08-25 01:05:36 +00:00
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
This commit is contained in:
@@ -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}}
|
||||
23
persist_key_value/analysis_options.yaml
Normal file
23
persist_key_value/analysis_options.yaml
Normal file
@@ -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
|
||||
@@ -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<MyHome> {
|
||||
_loadSavedData();
|
||||
}
|
||||
|
||||
_loadSavedData() async {
|
||||
Future<void> _loadSavedData() async {
|
||||
// Get shared preference instance
|
||||
SharedPreferences prefs = await SharedPreferences.getInstance();
|
||||
setState(() {
|
||||
@@ -39,7 +41,7 @@ class MyHomeState extends State<MyHome> {
|
||||
});
|
||||
}
|
||||
|
||||
_onIncrementHit() async {
|
||||
Future<void> _onIncrementHit() async {
|
||||
// Get shared preference instance
|
||||
SharedPreferences prefs = await SharedPreferences.getInstance();
|
||||
|
||||
@@ -52,7 +54,7 @@ class MyHomeState extends State<MyHome> {
|
||||
prefs.setInt(key, counter);
|
||||
}
|
||||
|
||||
_onDecrementHit() async {
|
||||
Future<void> _onDecrementHit() async {
|
||||
// Get shared preference instance
|
||||
SharedPreferences prefs = await SharedPreferences.getInstance();
|
||||
|
||||
@@ -82,16 +84,14 @@ class MyHomeState extends State<MyHome> {
|
||||
children: <Widget>[
|
||||
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')),
|
||||
],
|
||||
),
|
||||
),
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user