mirror of
https://github.com/flutter/samples.git
synced 2025-11-08 22:09:06 +00:00
Adjust experimental/federated_plugin/federated_plugin lint rules (#817)
This commit is contained in:
@@ -17,4 +17,3 @@ linter:
|
|||||||
test_types_in_equals: true
|
test_types_in_equals: true
|
||||||
throw_in_finally: true
|
throw_in_finally: true
|
||||||
unnecessary_statements: true
|
unnecessary_statements: true
|
||||||
use_key_in_widget_constructors: false
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
include: package:pedantic/analysis_options.1.11.0.yaml
|
include: package:flutter_lints/flutter.yaml
|
||||||
|
|
||||||
analyzer:
|
analyzer:
|
||||||
strong-mode:
|
strong-mode:
|
||||||
@@ -7,25 +7,13 @@ analyzer:
|
|||||||
|
|
||||||
linter:
|
linter:
|
||||||
rules:
|
rules:
|
||||||
- avoid_types_on_closure_parameters
|
avoid_types_on_closure_parameters: true
|
||||||
- avoid_void_async
|
avoid_void_async: true
|
||||||
- await_only_futures
|
cancel_subscriptions: true
|
||||||
- camel_case_types
|
close_sinks: true
|
||||||
- cancel_subscriptions
|
directives_ordering: true
|
||||||
- close_sinks
|
package_api_docs: true
|
||||||
- constant_identifier_names
|
package_prefixed_library_names: true
|
||||||
- control_flow_in_finally
|
test_types_in_equals: true
|
||||||
- directives_ordering
|
throw_in_finally: true
|
||||||
- empty_statements
|
unnecessary_statements: true
|
||||||
- hash_and_equals
|
|
||||||
- implementation_imports
|
|
||||||
- non_constant_identifier_names
|
|
||||||
- package_api_docs
|
|
||||||
- package_names
|
|
||||||
- package_prefixed_library_names
|
|
||||||
- test_types_in_equals
|
|
||||||
- throw_in_finally
|
|
||||||
- unnecessary_brace_in_string_interps
|
|
||||||
- unnecessary_getters_setters
|
|
||||||
- unnecessary_new
|
|
||||||
- unnecessary_statements
|
|
||||||
|
|||||||
@@ -7,13 +7,15 @@ import 'package:flutter/material.dart';
|
|||||||
import 'package:flutter/services.dart';
|
import 'package:flutter/services.dart';
|
||||||
|
|
||||||
void main() {
|
void main() {
|
||||||
runApp(MyApp());
|
runApp(const MyApp());
|
||||||
}
|
}
|
||||||
|
|
||||||
class MyApp extends StatelessWidget {
|
class MyApp extends StatelessWidget {
|
||||||
|
const MyApp({Key? key}) : super(key: key);
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return MaterialApp(
|
return const MaterialApp(
|
||||||
home: HomePage(),
|
home: HomePage(),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@@ -22,6 +24,8 @@ class MyApp extends StatelessWidget {
|
|||||||
/// Demonstrates how to use the getBatteryLevel method from federated_plugin to retrieve
|
/// Demonstrates how to use the getBatteryLevel method from federated_plugin to retrieve
|
||||||
/// current battery level of device.
|
/// current battery level of device.
|
||||||
class HomePage extends StatefulWidget {
|
class HomePage extends StatefulWidget {
|
||||||
|
const HomePage({Key? key}) : super(key: key);
|
||||||
|
|
||||||
@override
|
@override
|
||||||
_HomePageState createState() => _HomePageState();
|
_HomePageState createState() => _HomePageState();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ void main() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
testWidgets('get current battery level from platform', (tester) async {
|
testWidgets('get current battery level from platform', (tester) async {
|
||||||
await tester.pumpWidget(MyApp());
|
await tester.pumpWidget(const MyApp());
|
||||||
|
|
||||||
// Tap button to retrieve current battery level from platform.
|
// Tap button to retrieve current battery level from platform.
|
||||||
await tester.tap(find.byType(ElevatedButton));
|
await tester.tap(find.byType(ElevatedButton));
|
||||||
|
|||||||
Reference in New Issue
Block a user