1
0
mirror of https://github.com/flutter/samples.git synced 2025-11-13 00:08:24 +00:00

Upgrading samples to flutter_lints, part 1 of n (#804)

This commit is contained in:
Brett Morgan
2021-06-05 12:24:28 +10:00
committed by GitHub
parent 14921d0c06
commit 936d1fdaae
230 changed files with 2361 additions and 2444 deletions

View File

@@ -33,19 +33,19 @@ class _HomePageState extends State<HomePage> {
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text('Federated Plugin Demo'),
title: const Text('Federated Plugin Demo'),
),
body: Center(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
batteryLevel == null
? SizedBox.shrink()
? const SizedBox.shrink()
: Text(
'Battery Level: $batteryLevel',
style: Theme.of(context).textTheme.headline5,
),
SizedBox(height: 16),
const SizedBox(height: 16),
ElevatedButton(
onPressed: () async {
try {
@@ -64,7 +64,7 @@ class _HomePageState extends State<HomePage> {
);
}
},
child: Text('Get Battery Level'),
child: const Text('Get Battery Level'),
),
],
),

View File

@@ -97,6 +97,13 @@ packages:
description: flutter
source: sdk
version: "0.0.0"
flutter_lints:
dependency: "direct dev"
description:
name: flutter_lints
url: "https://pub.dartlang.org"
source: hosted
version: "1.0.3"
flutter_test:
dependency: "direct dev"
description: flutter
@@ -114,6 +121,13 @@ packages:
url: "https://pub.dartlang.org"
source: hosted
version: "0.6.3"
lints:
dependency: transitive
description:
name: lints
url: "https://pub.dartlang.org"
source: hosted
version: "1.0.1"
matcher:
dependency: transitive
description:
@@ -135,13 +149,6 @@ packages:
url: "https://pub.dartlang.org"
source: hosted
version: "1.8.0"
pedantic:
dependency: "direct dev"
description:
name: pedantic
url: "https://pub.dartlang.org"
source: hosted
version: "1.11.0"
plugin_platform_interface:
dependency: transitive
description:

View File

@@ -1,7 +1,7 @@
name: federated_plugin_example
description: Demonstrates how to use the federated_plugin plugin.
publish_to: 'none' # Remove this line if you wish to publish to pub.dev
publish_to: "none" # Remove this line if you wish to publish to pub.dev
environment:
sdk: ">=2.12.0 <3.0.0"
@@ -17,7 +17,7 @@ dependencies:
dev_dependencies:
flutter_test:
sdk: flutter
pedantic: ^1.11.0
flutter_lints: ^1.0.0
flutter:
uses-material-design: true

View File

@@ -9,9 +9,9 @@ import 'package:flutter_test/flutter_test.dart';
void main() {
group('federated plugin demo tests', () {
final batteryLevel = 45;
const batteryLevel = 45;
setUpAll(() {
MethodChannel('battery').setMockMethodCallHandler((call) async {
const MethodChannel('battery').setMockMethodCallHandler((call) async {
if (call.method == 'getBatteryLevel') {
return batteryLevel;
}