mirror of
https://github.com/flutter/samples.git
synced 2025-11-10 14:58:34 +00:00
Enforce use_key_in_widget_constructors and file_names lints (#913)
* Start enforcing use_key_in_widget_constructors and file_names lints * dart format * analysis fixes * analysis fixes, pt2 * analysis fixes, part 3 * Revert platform_design (test failure) * More reverts * Notate why we aren't enforcing a lint
This commit is contained in:
@@ -10,6 +10,8 @@ import 'package:platform_channels/src/pet_list_message_channel.dart';
|
||||
/// The widget uses [TextField] and [RadioListTile] to take the [PetDetails.breed] and
|
||||
/// [PetDetails.petType] from the user respectively.
|
||||
class AddPetDetails extends StatefulWidget {
|
||||
const AddPetDetails({Key? key}) : super(key: key);
|
||||
|
||||
@override
|
||||
_AddPetDetailsState createState() => _AddPetDetailsState();
|
||||
}
|
||||
|
||||
@@ -14,6 +14,8 @@ import 'package:platform_channels/src/accelerometer_event_channel.dart';
|
||||
/// [Text] widgets to display the value of [AccelerometerReadings.x],
|
||||
/// [AccelerometerReadings.y], and [AccelerometerReadings.z] respectively.
|
||||
class EventChannelDemo extends StatelessWidget {
|
||||
const EventChannelDemo({Key? key}) : super(key: key);
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final textStyle = Theme.of(context).textTheme.headline5;
|
||||
|
||||
@@ -10,6 +10,8 @@ import 'package:platform_channels/src/counter_method_channel.dart';
|
||||
/// It has two [ElevatedButton]s to increment and decrement the value of
|
||||
/// [count], and a [Text] widget to display its value.
|
||||
class MethodChannelDemo extends StatefulWidget {
|
||||
const MethodChannelDemo({Key? key}) : super(key: key);
|
||||
|
||||
@override
|
||||
_MethodChannelDemoState createState() => _MethodChannelDemoState();
|
||||
}
|
||||
|
||||
@@ -9,6 +9,8 @@ import 'package:platform_channels/src/pet_list_message_channel.dart';
|
||||
/// Demonstrates how to use [BasicMessageChannel] to send & receive the platform
|
||||
/// Message.
|
||||
class PetListScreen extends StatefulWidget {
|
||||
const PetListScreen({Key? key}) : super(key: key);
|
||||
|
||||
@override
|
||||
_PetListScreenState createState() => _PetListScreenState();
|
||||
}
|
||||
@@ -59,7 +61,7 @@ class _PetListScreenState extends State<PetListScreen> {
|
||||
class BuildPetList extends StatelessWidget {
|
||||
final List<PetDetails> petList;
|
||||
|
||||
const BuildPetList(this.petList);
|
||||
const BuildPetList(this.petList, {Key? key}) : super(key: key);
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
|
||||
@@ -13,6 +13,8 @@ import 'package:platform_channels/src/image_basic_message_channel.dart';
|
||||
/// The widget uses [Image.memory] to display the image obtained from the
|
||||
/// platform.
|
||||
class PlatformImageDemo extends StatefulWidget {
|
||||
const PlatformImageDemo({Key? key}) : super(key: key);
|
||||
|
||||
@override
|
||||
_PlatformImageDemoState createState() => _PlatformImageDemoState();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user