Unverified Commit 91bcf420 authored by Michael Goderbauer's avatar Michael Goderbauer Committed by GitHub

Prepare examples for use_super_parameters (#100514)

parent 195a1cc4
......@@ -11,7 +11,7 @@ void main() {
}
class FlutterView extends StatelessWidget {
const FlutterView({Key? key}) : super(key: key);
const FlutterView({super.key});
@override
Widget build(BuildContext context) {
......@@ -26,7 +26,7 @@ class FlutterView extends StatelessWidget {
}
class MyHomePage extends StatefulWidget {
const MyHomePage({Key? key}) : super(key: key);
const MyHomePage({super.key});
@override
State<MyHomePage> createState() => _MyHomePageState();
......
......@@ -2,7 +2,7 @@ name: flutter_view
description: A new flutter project.
environment:
sdk: ">=2.12.0-0 <3.0.0"
sdk: ">=2.17.0-0 <3.0.0"
dependencies:
flutter:
......
name: hello_world
environment:
sdk: ">=2.12.0-0 <3.0.0"
sdk: ">=2.17.0-0 <3.0.0"
dependencies:
flutter:
......
......@@ -124,7 +124,7 @@ const int IMAGES = 50;
@immutable
class MyApp extends StatelessWidget {
const MyApp(this.port, {Key? key}) : super(key: key);
const MyApp(this.port, {super.key});
final int port;
......@@ -141,7 +141,7 @@ class MyApp extends StatelessWidget {
}
class MyHomePage extends StatefulWidget {
const MyHomePage({Key? key, required this.title, required this.port}) : super(key: key);
const MyHomePage({super.key, required this.title, required this.port});
final String title;
final int port;
......
......@@ -4,7 +4,7 @@ description: Simple Flutter project used for benchmarking image loading over net
version: 1.0.0+1
environment:
sdk: ">=2.12.0-0 <3.0.0"
sdk: ">=2.17.0-0 <3.0.0"
dependencies:
flutter:
......
name: flutter_examples_layers
environment:
sdk: ">=2.12.0-0 <3.0.0"
sdk: ">=2.17.0-0 <3.0.0"
dependencies:
flutter:
......
......@@ -198,7 +198,7 @@ abstract class RenderDecoratedSector extends RenderSector {
class SectorChildListParentData extends SectorParentData with ContainerParentDataMixin<RenderSector> { }
class RenderSectorWithChildren extends RenderDecoratedSector with ContainerRenderObjectMixin<RenderSector, SectorChildListParentData> {
RenderSectorWithChildren(BoxDecoration? decoration) : super(decoration);
RenderSectorWithChildren(super.decoration);
@override
void hitTestChildren(SectorHitTestResult result, { required double radius, required double theta }) {
......@@ -620,7 +620,7 @@ class SectorHitTestResult extends HitTestResult {
///
/// * [HitTestResult.wrap], which turns a [SectorHitTestResult] back into a
/// generic [HitTestResult].
SectorHitTestResult.wrap(HitTestResult result) : super.wrap(result);
SectorHitTestResult.wrap(super.result) : super.wrap();
// TODO(goderbauer): Add convenience methods to transform hit test positions
// once we have RenderSector implementations that move the origin of their
......@@ -632,10 +632,9 @@ class SectorHitTestEntry extends HitTestEntry {
/// Creates a box hit test entry.
///
/// The [radius] and [theta] argument must not be null.
SectorHitTestEntry(RenderSector target, { required this.radius, required this.theta })
SectorHitTestEntry(RenderSector super.target, { required this.radius, required this.theta })
: assert(radius != null),
assert(theta != null),
super(target);
assert(theta != null);
@override
RenderSector get target => super.target as RenderSector;
......
......@@ -197,7 +197,7 @@ class CalculationManager {
// This is a StatefulWidget in order to hold the CalculationManager and
// the AnimationController for the running animation.
class IsolateExampleWidget extends StatefulWidget {
const IsolateExampleWidget({Key? key}) : super(key: key);
const IsolateExampleWidget({super.key});
@override
IsolateExampleState createState() => IsolateExampleState();
......
......@@ -5,7 +5,7 @@
import 'package:flutter/widgets.dart';
class LifecycleWatcher extends StatefulWidget {
const LifecycleWatcher({ Key? key }) : super(key: key);
const LifecycleWatcher({ super.key });
@override
State<LifecycleWatcher> createState() => _LifecycleWatcherState();
......
......@@ -39,7 +39,7 @@ class RenderDots extends RenderConstrainedBox {
}
class Dots extends SingleChildRenderObjectWidget {
const Dots({ Key? key, Widget? child }) : super(key: key, child: child);
const Dots({ super.key, super.child });
@override
RenderDots createRenderObject(BuildContext context) => RenderDots();
......
......@@ -56,7 +56,7 @@ class _GesturePainter extends CustomPainter {
}
class GestureDemo extends StatefulWidget {
const GestureDemo({Key? key}) : super(key: key);
const GestureDemo({super.key});
@override
GestureDemoState createState() => GestureDemoState();
......
......@@ -5,7 +5,7 @@
import 'package:flutter/material.dart';
class AdaptedListItem extends StatelessWidget {
const AdaptedListItem({ Key? key, required this.name }) : super(key: key);
const AdaptedListItem({ super.key, required this.name });
final String name;
......@@ -26,7 +26,7 @@ class AdaptedListItem extends StatelessWidget {
}
class AdaptedGridItem extends StatelessWidget {
const AdaptedGridItem({ Key? key, required this.name }) : super(key: key);
const AdaptedGridItem({ super.key, required this.name });
final String name;
......@@ -65,7 +65,7 @@ const double _kMaxTileWidth = 150.0;
const double _kGridViewBreakpoint = 450.0;
class AdaptiveContainer extends StatelessWidget {
const AdaptiveContainer({ Key? key, required this.names }) : super(key: key);
const AdaptiveContainer({ super.key, required this.names });
final List<String> names;
......
......@@ -16,7 +16,7 @@ RenderBoxToRenderSectorAdapter initCircle() {
}
class SectorApp extends StatefulWidget {
const SectorApp({Key? key}) : super(key: key);
const SectorApp({super.key});
@override
SectorAppState createState() => SectorAppState();
......
......@@ -17,7 +17,7 @@ void addFlexChildSolidColor(RenderFlex parent, Color backgroundColor, { int flex
// Solid color, Widget version
class Rectangle extends StatelessWidget {
const Rectangle(this.color, { Key? key }) : super(key: key);
const Rectangle(this.color, { super.key });
final Color color;
......
......@@ -5,7 +5,7 @@
import 'package:flutter/widgets.dart';
class SpinningSquare extends StatefulWidget {
const SpinningSquare({Key? key}) : super(key: key);
const SpinningSquare({super.key});
@override
State<SpinningSquare> createState() => _SpinningSquareState();
......
......@@ -58,7 +58,7 @@ Widget toStyledText(String name, String text) {
Widget toPlainText(String name, String text) => Text('$name:$text');
class SpeakerSeparator extends StatelessWidget {
const SpeakerSeparator({Key? key}) : super(key: key);
const SpeakerSeparator({super.key});
@override
Widget build(BuildContext context) {
......@@ -75,7 +75,7 @@ class SpeakerSeparator extends StatelessWidget {
}
class StyledTextDemo extends StatefulWidget {
const StyledTextDemo({Key? key}) : super(key: key);
const StyledTextDemo({super.key});
@override
State<StyledTextDemo> createState() => _StyledTextDemoState();
......
......@@ -8,7 +8,7 @@ import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
class PlatformChannel extends StatefulWidget {
const PlatformChannel({Key? key}) : super(key: key);
const PlatformChannel({super.key});
@override
State<PlatformChannel> createState() => _PlatformChannelState();
......
name: platform_channel
environment:
sdk: ">=2.12.0-0 <3.0.0"
sdk: ">=2.17.0-0 <3.0.0"
dependencies:
flutter:
......
......@@ -8,7 +8,7 @@ import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
class PlatformChannel extends StatefulWidget {
const PlatformChannel({Key? key}) : super(key: key);
const PlatformChannel({super.key});
@override
State<PlatformChannel> createState() => _PlatformChannelState();
......
name: platform_channel_swift
environment:
sdk: ">=2.12.0-0 <3.0.0"
sdk: ">=2.17.0-0 <3.0.0"
dependencies:
flutter:
......
......@@ -12,7 +12,7 @@ void main() {
}
class PlatformView extends StatelessWidget {
const PlatformView({Key? key}) : super(key: key);
const PlatformView({super.key});
@override
Widget build(BuildContext context) {
......@@ -27,7 +27,7 @@ class PlatformView 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;
......
name: platform_view
environment:
sdk: ">=2.12.0-0 <3.0.0"
sdk: ">=2.17.0-0 <3.0.0"
dependencies:
flutter:
......
name: splash
environment:
sdk: ">=2.12.0-0 <3.0.0"
sdk: ">=2.17.0-0 <3.0.0"
dependencies:
flutter:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment