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