mirror of
https://github.com/flutter/samples.git
synced 2025-11-08 13:58:47 +00:00
Add use_super_parameters lint (#1269)
This commit is contained in:
@@ -8,7 +8,7 @@ import 'package:flutter_module_books/api.dart';
|
||||
void main() => runApp(const MyApp());
|
||||
|
||||
class MyApp extends StatelessWidget {
|
||||
const MyApp({Key? key}) : super(key: key);
|
||||
const MyApp({super.key});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
@@ -35,8 +35,7 @@ class FlutterBookApiHandler extends FlutterBookApi {
|
||||
}
|
||||
|
||||
class BookDetail extends StatefulWidget {
|
||||
const BookDetail({Key? key, this.hostApi, this.flutterApi, this.book})
|
||||
: super(key: key);
|
||||
const BookDetail({super.key, this.hostApi, this.flutterApi, this.book});
|
||||
|
||||
// These are the outgoing and incoming APIs that are here for injection for
|
||||
// tests.
|
||||
@@ -148,13 +147,13 @@ class _BookDetailState extends State<BookDetail> {
|
||||
|
||||
class BookForm extends StatelessWidget {
|
||||
const BookForm({
|
||||
Key? key,
|
||||
super.key,
|
||||
required this.book,
|
||||
required this.focusNode,
|
||||
required this.authorTextController,
|
||||
required this.subtitleTextController,
|
||||
required this.titleTextController,
|
||||
}) : super(key: key);
|
||||
});
|
||||
|
||||
final Book book;
|
||||
final FocusNode focusNode;
|
||||
|
||||
@@ -58,7 +58,7 @@ class CounterModel extends ChangeNotifier {
|
||||
/// It offers two routes, one suitable for displaying as a full screen and
|
||||
/// another designed to be part of a larger UI.class MyApp extends StatelessWidget {
|
||||
class MyApp extends StatelessWidget {
|
||||
const MyApp({Key? key}) : super(key: key);
|
||||
const MyApp({super.key});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
@@ -75,7 +75,7 @@ class MyApp extends StatelessWidget {
|
||||
/// Wraps [Contents] in a Material [Scaffold] so it looks correct when displayed
|
||||
/// full-screen.
|
||||
class FullScreenView extends StatelessWidget {
|
||||
const FullScreenView({Key? key}) : super(key: key);
|
||||
const FullScreenView({super.key});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
@@ -96,7 +96,7 @@ class FullScreenView extends StatelessWidget {
|
||||
class Contents extends StatelessWidget {
|
||||
final bool showExit;
|
||||
|
||||
const Contents({this.showExit = false, Key? key}) : super(key: key);
|
||||
const Contents({this.showExit = false, super.key});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
|
||||
@@ -15,7 +15,7 @@ void topMain() => runApp(const MyApp(color: Colors.green));
|
||||
void bottomMain() => runApp(const MyApp(color: Colors.purple));
|
||||
|
||||
class MyApp extends StatelessWidget {
|
||||
const MyApp({Key? key, required this.color}) : super(key: key);
|
||||
const MyApp({super.key, required this.color});
|
||||
|
||||
final MaterialColor color;
|
||||
|
||||
@@ -32,7 +32,7 @@ class MyApp extends StatelessWidget {
|
||||
}
|
||||
|
||||
class MyHomePage extends StatefulWidget {
|
||||
const MyHomePage({Key? key, required this.title}) : super(key: key);
|
||||
const MyHomePage({super.key, required this.title});
|
||||
final String title;
|
||||
|
||||
@override
|
||||
|
||||
@@ -15,7 +15,7 @@ void main() {
|
||||
}
|
||||
|
||||
class Cell extends StatefulWidget {
|
||||
const Cell({Key? key}) : super(key: key);
|
||||
const Cell({super.key});
|
||||
|
||||
@override
|
||||
State<StatefulWidget> createState() => _CellState();
|
||||
|
||||
@@ -69,7 +69,7 @@ class CounterModel extends ChangeNotifier {
|
||||
/// It offers two routes, one suitable for displaying as a full screen and
|
||||
/// another designed to be part of a larger UI.
|
||||
class MyApp extends StatelessWidget {
|
||||
const MyApp({Key? key}) : super(key: key);
|
||||
const MyApp({super.key});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
@@ -86,7 +86,7 @@ class MyApp extends StatelessWidget {
|
||||
/// Wraps [Contents] in a Material [Scaffold] so it looks correct when displayed
|
||||
/// full-screen.
|
||||
class FullScreenView extends StatelessWidget {
|
||||
const FullScreenView({Key? key}) : super(key: key);
|
||||
const FullScreenView({super.key});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
@@ -108,7 +108,7 @@ class FullScreenView extends StatelessWidget {
|
||||
class Contents extends StatelessWidget {
|
||||
final bool showExit;
|
||||
|
||||
const Contents({Key? key, this.showExit = false}) : super(key: key);
|
||||
const Contents({super.key, this.showExit = false});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
|
||||
@@ -58,7 +58,7 @@ class CounterModel extends ChangeNotifier {
|
||||
/// It offers two routes, one suitable for displaying as a full screen and
|
||||
/// another designed to be part of a larger UI.class MyApp extends StatelessWidget {
|
||||
class MyApp extends StatelessWidget {
|
||||
const MyApp({Key? key}) : super(key: key);
|
||||
const MyApp({super.key});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
@@ -75,7 +75,7 @@ class MyApp extends StatelessWidget {
|
||||
/// Wraps [Contents] in a Material [Scaffold] so it looks correct when displayed
|
||||
/// full-screen.
|
||||
class FullScreenView extends StatelessWidget {
|
||||
const FullScreenView({Key? key}) : super(key: key);
|
||||
const FullScreenView({super.key});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
@@ -96,7 +96,7 @@ class FullScreenView extends StatelessWidget {
|
||||
class Contents extends StatelessWidget {
|
||||
final bool showExit;
|
||||
|
||||
const Contents({Key? key, this.showExit = false}) : super(key: key);
|
||||
const Contents({super.key, this.showExit = false});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
|
||||
Reference in New Issue
Block a user