diff --git a/examples/alice/analysis_options.yaml b/examples/alice/analysis_options.yaml index 01f89e9c..d4e71cb5 100644 --- a/examples/alice/analysis_options.yaml +++ b/examples/alice/analysis_options.yaml @@ -1,16 +1,12 @@ -1include: package:very_good_analysis/analysis_options.yaml +analyzer: + exclude: + - "lib/generated_plugin_registrant.dart" + - "**.g.dart" + - "**.mocks.dart" + - "**.gen.dart" + +include: package:flutter_lints/flutter.yaml linter: rules: - public_member_api_docs: false - flutter_style_todos: false - avoid_final_parameters: false - sort_constructors_first: false - avoid_function_literals_in_foreach_calls: false - avoid_positional_boolean_parameters: false - use_if_null_to_convert_nulls_to_bools: false - use_build_context_synchronously: false - prefer_constructors_over_static_methods: false - use_setters_to_change_properties: false - avoid_print: false - sort_pub_dependencies: false \ No newline at end of file + #library_annotations: false diff --git a/examples/alice/lib/main.dart b/examples/alice/lib/main.dart index ab7b6141..5f483389 100644 --- a/examples/alice/lib/main.dart +++ b/examples/alice/lib/main.dart @@ -1,26 +1,21 @@ import 'package:alice/alice.dart'; import 'package:flutter/material.dart'; -void main() => runApp(MyApp()); +void main() => runApp(const MyApp()); class MyApp extends StatefulWidget { + const MyApp({super.key}); + @override - _MyAppState createState() => _MyAppState(); + State createState() => _MyAppState(); } class _MyAppState extends State { - late Alice _alice; - - @override - void initState() { - _alice = Alice( - showNotification: true, - showInspectorOnShake: true, - maxCallsCount: 1000, - ); - - super.initState(); - } + late final Alice _alice = Alice( + showNotification: true, + showInspectorOnShake: true, + maxCallsCount: 1000, + ); @override Widget build(BuildContext context) { @@ -32,27 +27,32 @@ class _MyAppState extends State { title: const Text('Alice HTTP Inspector - Example'), ), body: Container( - padding: EdgeInsets.all(16), + padding: const EdgeInsets.all(16), child: ListView( children: [ const SizedBox(height: 8), - Text( - 'Welcome to example of Alice Http Inspector. Click buttons below to generate sample data.'), + const Text( + style: TextStyle(fontSize: 14), + 'Welcome to example of Alice Http Inspector. ' + 'Click buttons below to generate sample data.', + ), ElevatedButton( - child: Text( + onPressed: _logExampleData, + child: const Text( 'Log example data', ), - onPressed: _logExampleData, ), - const SizedBox(height: 24), - Text( - 'After clicking on buttons above, you should receive notification.' - ' Click on it to show inspector. You can also shake your device or click button below.'), + const SizedBox(height: 8), + const Text( + style: TextStyle(fontSize: 14), + 'After clicking on buttons above, you should receive notification.' + ' Click on it to show inspector. You can also shake your device or click button below.', + ), ElevatedButton( - child: Text( + onPressed: _runHttpInspector, + child: const Text( 'Run HTTP Inspector', ), - onPressed: _runHttpInspector, ) ], ), @@ -84,7 +84,7 @@ class _MyAppState extends State { message: 'Warning log', ), ); - final notNumber = 'afs'; + const String notNumber = 'afs'; try { int.parse(notNumber); } catch (e, stacktrace) { diff --git a/examples/alice/pubspec.yaml b/examples/alice/pubspec.yaml index 314cd0fc..4f22354c 100644 --- a/examples/alice/pubspec.yaml +++ b/examples/alice/pubspec.yaml @@ -12,12 +12,12 @@ dependencies: sdk: flutter chopper: ^8.0.0 path_provider: + alice: - alice: any dev_dependencies: build_runner: chopper_generator: ^8.0.0 - very_good_analysis: ^5.1.0 + flutter_lints: ^4.0.0 dependency_overrides: alice: