Unverified Commit b8a24567 authored by Michael Goderbauer's avatar Michael Goderbauer Committed by GitHub

Enable library_private_types_in_public_api lint (#81578)

parent b878b11f
...@@ -122,6 +122,7 @@ linter: ...@@ -122,6 +122,7 @@ linter:
- leading_newlines_in_multiline_strings - leading_newlines_in_multiline_strings
- library_names - library_names
- library_prefixes - library_prefixes
- library_private_types_in_public_api
# - lines_longer_than_80_chars # not required by flutter style # - lines_longer_than_80_chars # not required by flutter style
- list_remove_unrelated_type - list_remove_unrelated_type
# - literal_only_boolean_expressions # too many false positives: https://github.com/dart-lang/sdk/issues/34181 # - literal_only_boolean_expressions # too many false positives: https://github.com/dart-lang/sdk/issues/34181
......
...@@ -8,8 +8,7 @@ class AnimationWithMicrotasks extends StatefulWidget { ...@@ -8,8 +8,7 @@ class AnimationWithMicrotasks extends StatefulWidget {
const AnimationWithMicrotasks({Key key}) : super(key: key); const AnimationWithMicrotasks({Key key}) : super(key: key);
@override @override
_AnimationWithMicrotasksState createState() => State<AnimationWithMicrotasks> createState() => _AnimationWithMicrotasksState();
_AnimationWithMicrotasksState();
} }
class _AnimationWithMicrotasksState extends State<AnimationWithMicrotasks> { class _AnimationWithMicrotasksState extends State<AnimationWithMicrotasks> {
......
...@@ -10,7 +10,7 @@ class BackdropFilterPage extends StatefulWidget { ...@@ -10,7 +10,7 @@ class BackdropFilterPage extends StatefulWidget {
const BackdropFilterPage({Key key}) : super(key: key); const BackdropFilterPage({Key key}) : super(key: key);
@override @override
_BackdropFilterPageState createState() => _BackdropFilterPageState(); State<BackdropFilterPage> createState() => _BackdropFilterPageState();
} }
class _BackdropFilterPageState extends State<BackdropFilterPage> with TickerProviderStateMixin { class _BackdropFilterPageState extends State<BackdropFilterPage> with TickerProviderStateMixin {
......
...@@ -12,7 +12,7 @@ class ColorFilterAndFadePage extends StatefulWidget { ...@@ -12,7 +12,7 @@ class ColorFilterAndFadePage extends StatefulWidget {
const ColorFilterAndFadePage({Key key}) : super(key: key); const ColorFilterAndFadePage({Key key}) : super(key: key);
@override @override
_ColorFilterAndFadePageState createState() => _ColorFilterAndFadePageState(); State<ColorFilterAndFadePage> createState() => _ColorFilterAndFadePageState();
} }
class _ColorFilterAndFadePageState extends State<ColorFilterAndFadePage> with TickerProviderStateMixin { class _ColorFilterAndFadePageState extends State<ColorFilterAndFadePage> with TickerProviderStateMixin {
......
...@@ -23,7 +23,7 @@ class FilteredChildAnimationPage extends StatefulWidget { ...@@ -23,7 +23,7 @@ class FilteredChildAnimationPage extends StatefulWidget {
final bool initialUseRepaintBoundary; final bool initialUseRepaintBoundary;
@override @override
_FilteredChildAnimationPageState createState() => _FilteredChildAnimationPageState(); State<FilteredChildAnimationPage> createState() => _FilteredChildAnimationPageState();
} }
class _FilteredChildAnimationPageState extends State<FilteredChildAnimationPage> with SingleTickerProviderStateMixin { class _FilteredChildAnimationPageState extends State<FilteredChildAnimationPage> with SingleTickerProviderStateMixin {
......
...@@ -11,7 +11,7 @@ class LargeImageChangerPage extends StatefulWidget { ...@@ -11,7 +11,7 @@ class LargeImageChangerPage extends StatefulWidget {
const LargeImageChangerPage({Key key}) : super(key: key); const LargeImageChangerPage({Key key}) : super(key: key);
@override @override
_LargeImageChangerState createState() => _LargeImageChangerState(); State<LargeImageChangerPage> createState() => _LargeImageChangerState();
} }
class _LargeImageChangerState extends State<LargeImageChangerPage> { class _LargeImageChangerState extends State<LargeImageChangerPage> {
......
...@@ -12,8 +12,7 @@ class MultiWidgetConstructTable extends StatefulWidget { ...@@ -12,8 +12,7 @@ class MultiWidgetConstructTable extends StatefulWidget {
final int rowCount; final int rowCount;
@override @override
_MultiWidgetConstructTableState createState() => State<MultiWidgetConstructTable> createState() => _MultiWidgetConstructTableState();
_MultiWidgetConstructTableState();
} }
class _MultiWidgetConstructTableState extends State<MultiWidgetConstructTable> class _MultiWidgetConstructTableState extends State<MultiWidgetConstructTable>
......
...@@ -10,7 +10,7 @@ class PostBackdropFilterPage extends StatefulWidget { ...@@ -10,7 +10,7 @@ class PostBackdropFilterPage extends StatefulWidget {
const PostBackdropFilterPage({Key key}) : super(key: key); const PostBackdropFilterPage({Key key}) : super(key: key);
@override @override
_PostBackdropFilterPageState createState() => _PostBackdropFilterPageState(); State<PostBackdropFilterPage> createState() => _PostBackdropFilterPageState();
} }
class _PostBackdropFilterPageState extends State<PostBackdropFilterPage> with TickerProviderStateMixin { class _PostBackdropFilterPageState extends State<PostBackdropFilterPage> with TickerProviderStateMixin {
......
...@@ -37,12 +37,12 @@ class _NestedMouseRegion extends StatelessWidget { ...@@ -37,12 +37,12 @@ class _NestedMouseRegion extends StatelessWidget {
/// Measures our ability to hit test mouse regions. /// Measures our ability to hit test mouse regions.
class BenchMouseRegionGridHover extends WidgetRecorder { class BenchMouseRegionGridHover extends WidgetRecorder {
BenchMouseRegionGridHover() : super(name: benchmarkName) { BenchMouseRegionGridHover() : super(name: benchmarkName) {
tester = _Tester(onDataPoint: handleDataPoint); _tester = _Tester(onDataPoint: handleDataPoint);
} }
static const String benchmarkName = 'bench_mouse_region_grid_hover'; static const String benchmarkName = 'bench_mouse_region_grid_hover';
_Tester tester; _Tester _tester;
void handleDataPoint(Duration duration) { void handleDataPoint(Duration duration) {
profile.addDataPoint('hitTestDuration', duration, reported: true); profile.addDataPoint('hitTestDuration', duration, reported: true);
...@@ -67,8 +67,8 @@ class BenchMouseRegionGridHover extends WidgetRecorder { ...@@ -67,8 +67,8 @@ class BenchMouseRegionGridHover extends WidgetRecorder {
if (!started) { if (!started) {
started = true; started = true;
SchedulerBinding.instance.addPostFrameCallback((Duration timeStamp) async { SchedulerBinding.instance.addPostFrameCallback((Duration timeStamp) async {
tester.start(); _tester.start();
registerDidStop(tester.stop); registerDidStop(_tester.stop);
}); });
} }
super.frameDidDraw(); super.frameDidDraw();
......
...@@ -21,7 +21,7 @@ class BenchMouseRegionGridScroll extends WidgetRecorder { ...@@ -21,7 +21,7 @@ class BenchMouseRegionGridScroll extends WidgetRecorder {
static const String benchmarkName = 'bench_mouse_region_grid_scroll'; static const String benchmarkName = 'bench_mouse_region_grid_scroll';
final _Tester tester = _Tester(); final _Tester _tester = _Tester();
// Use a non-trivial border to force Web to switch painter // Use a non-trivial border to force Web to switch painter
Border _getBorder(int columnIndex, int rowIndex) { Border _getBorder(int columnIndex, int rowIndex) {
...@@ -42,8 +42,8 @@ class BenchMouseRegionGridScroll extends WidgetRecorder { ...@@ -42,8 +42,8 @@ class BenchMouseRegionGridScroll extends WidgetRecorder {
if (!started) { if (!started) {
started = true; started = true;
SchedulerBinding.instance.addPostFrameCallback((Duration timeStamp) async { SchedulerBinding.instance.addPostFrameCallback((Duration timeStamp) async {
tester.start(); _tester.start();
registerDidStop(tester.stop); registerDidStop(_tester.stop);
}); });
} }
super.frameDidDraw(); super.frameDidDraw();
......
...@@ -56,12 +56,12 @@ class _NestedListener extends StatelessWidget { ...@@ -56,12 +56,12 @@ class _NestedListener extends StatelessWidget {
/// Measures our ability to hit test mouse regions. /// Measures our ability to hit test mouse regions.
class BenchMouseRegionMixedGridHover extends WidgetRecorder { class BenchMouseRegionMixedGridHover extends WidgetRecorder {
BenchMouseRegionMixedGridHover() : super(name: benchmarkName) { BenchMouseRegionMixedGridHover() : super(name: benchmarkName) {
tester = _Tester(onDataPoint: handleDataPoint); _tester = _Tester(onDataPoint: handleDataPoint);
} }
static const String benchmarkName = 'bench_mouse_region_mixed_grid_hover'; static const String benchmarkName = 'bench_mouse_region_mixed_grid_hover';
_Tester tester; _Tester _tester;
void handleDataPoint(Duration duration) { void handleDataPoint(Duration duration) {
profile.addDataPoint('hitTestDuration', duration, reported: true); profile.addDataPoint('hitTestDuration', duration, reported: true);
...@@ -86,8 +86,8 @@ class BenchMouseRegionMixedGridHover extends WidgetRecorder { ...@@ -86,8 +86,8 @@ class BenchMouseRegionMixedGridHover extends WidgetRecorder {
if (!started) { if (!started) {
started = true; started = true;
SchedulerBinding.instance.addPostFrameCallback((Duration timeStamp) async { SchedulerBinding.instance.addPostFrameCallback((Duration timeStamp) async {
tester.start(); _tester.start();
registerDidStop(tester.stop); registerDidStop(_tester.stop);
}); });
} }
super.frameDidDraw(); super.frameDidDraw();
......
...@@ -203,11 +203,11 @@ enum _TestMode { ...@@ -203,11 +203,11 @@ enum _TestMode {
/// colors. Each color's description is made of several [Text] nodes. /// colors. Each color's description is made of several [Text] nodes.
class BenchBuildColorsGrid extends WidgetBuildRecorder { class BenchBuildColorsGrid extends WidgetBuildRecorder {
BenchBuildColorsGrid.canvas() BenchBuildColorsGrid.canvas()
: mode = _TestMode.useCanvasTextLayout, super(name: canvasBenchmarkName); : _mode = _TestMode.useCanvasTextLayout, super(name: canvasBenchmarkName);
BenchBuildColorsGrid.dom() BenchBuildColorsGrid.dom()
: mode = _TestMode.useDomTextLayout, super(name: domBenchmarkName); : _mode = _TestMode.useDomTextLayout, super(name: domBenchmarkName);
BenchBuildColorsGrid.canvasKit() BenchBuildColorsGrid.canvasKit()
: mode = _TestMode.useCanvasKit, super(name: canvasKitBenchmarkName); : _mode = _TestMode.useCanvasKit, super(name: canvasKitBenchmarkName);
/// Disables tracing for this benchmark. /// Disables tracing for this benchmark.
/// ///
...@@ -224,16 +224,16 @@ class BenchBuildColorsGrid extends WidgetBuildRecorder { ...@@ -224,16 +224,16 @@ class BenchBuildColorsGrid extends WidgetBuildRecorder {
static const String canvasKitBenchmarkName = 'text_canvas_kit_color_grid'; static const String canvasKitBenchmarkName = 'text_canvas_kit_color_grid';
/// Whether to use the new canvas-based text measurement implementation. /// Whether to use the new canvas-based text measurement implementation.
final _TestMode mode; final _TestMode _mode;
num _textLayoutMicros = 0; num _textLayoutMicros = 0;
@override @override
Future<void> setUpAll() async { Future<void> setUpAll() async {
if (mode == _TestMode.useCanvasTextLayout) { if (_mode == _TestMode.useCanvasTextLayout) {
_useCanvasText(true); _useCanvasText(true);
} }
if (mode == _TestMode.useDomTextLayout) { if (_mode == _TestMode.useDomTextLayout) {
_useCanvasText(false); _useCanvasText(false);
} }
registerEngineBenchmarkValueListener('text_layout', (num value) { registerEngineBenchmarkValueListener('text_layout', (num value) {
...@@ -258,7 +258,7 @@ class BenchBuildColorsGrid extends WidgetBuildRecorder { ...@@ -258,7 +258,7 @@ class BenchBuildColorsGrid extends WidgetBuildRecorder {
// We need to do this before calling [super.frameDidDraw] because the latter // We need to do this before calling [super.frameDidDraw] because the latter
// updates the value of [showWidget] in preparation for the next frame. // updates the value of [showWidget] in preparation for the next frame.
// TODO(yjbanov): https://github.com/flutter/flutter/issues/53877 // TODO(yjbanov): https://github.com/flutter/flutter/issues/53877
if (showWidget && mode != _TestMode.useCanvasKit) { if (showWidget && _mode != _TestMode.useCanvasKit) {
profile.addDataPoint( profile.addDataPoint(
'text_layout', 'text_layout',
Duration(microseconds: _textLayoutMicros.toInt()), Duration(microseconds: _textLayoutMicros.toInt()),
......
...@@ -34,7 +34,7 @@ class MyHomePage extends StatefulWidget { ...@@ -34,7 +34,7 @@ class MyHomePage extends StatefulWidget {
final String title; final String title;
@override @override
_MyHomePageState createState() => _MyHomePageState(); State<MyHomePage> createState() => _MyHomePageState();
} }
class _MyHomePageState extends State<MyHomePage> { class _MyHomePageState extends State<MyHomePage> {
......
...@@ -34,7 +34,7 @@ class MyHomePage extends StatefulWidget { ...@@ -34,7 +34,7 @@ class MyHomePage extends StatefulWidget {
final String? title; final String? title;
@override @override
_MyHomePageState createState() => _MyHomePageState(); State<MyHomePage> createState() => _MyHomePageState();
} }
class _MyHomePageState extends State<MyHomePage> { class _MyHomePageState extends State<MyHomePage> {
......
...@@ -99,7 +99,7 @@ class RotationContainer extends StatefulWidget { ...@@ -99,7 +99,7 @@ class RotationContainer extends StatefulWidget {
const RotationContainer({Key? key}) : super(key: key); const RotationContainer({Key? key}) : super(key: key);
@override @override
_RotationContainerState createState() => _RotationContainerState(); State<RotationContainer> createState() => _RotationContainerState();
} }
class _RotationContainerState extends State<RotationContainer> class _RotationContainerState extends State<RotationContainer>
......
...@@ -104,7 +104,7 @@ class RotationContainer extends StatefulWidget { ...@@ -104,7 +104,7 @@ class RotationContainer extends StatefulWidget {
const RotationContainer({Key? key}) : super(key: key); const RotationContainer({Key? key}) : super(key: key);
@override @override
_RotationContainerState createState() => _RotationContainerState(); State<RotationContainer> createState() => _RotationContainerState();
} }
class _RotationContainerState extends State<RotationContainer> class _RotationContainerState extends State<RotationContainer>
......
...@@ -26,8 +26,8 @@ library dart.ui; ...@@ -26,8 +26,8 @@ library dart.ui;
/// } /// }
/// ``` /// ```
/// {@end-tool} /// {@end-tool}
const _KeepToString keepToString = _KeepToString(); const Object keepToString = _KeepToString();
class _KeepToString { class _KeepToString {
const _KeepToString(); const _KeepToString();
} }
\ No newline at end of file
...@@ -64,9 +64,9 @@ abstract class DeviceDiscovery { ...@@ -64,9 +64,9 @@ abstract class DeviceDiscovery {
case DeviceOperatingSystem.android: case DeviceOperatingSystem.android:
return AndroidDeviceDiscovery(); return AndroidDeviceDiscovery();
case DeviceOperatingSystem.androidArm: case DeviceOperatingSystem.androidArm:
return AndroidDeviceDiscovery(cpu: _AndroidCPU.arm); return AndroidDeviceDiscovery(cpu: AndroidCPU.arm);
case DeviceOperatingSystem.androidArm64: case DeviceOperatingSystem.androidArm64:
return AndroidDeviceDiscovery(cpu: _AndroidCPU.arm64); return AndroidDeviceDiscovery(cpu: AndroidCPU.arm64);
case DeviceOperatingSystem.ios: case DeviceOperatingSystem.ios:
return IosDeviceDiscovery(); return IosDeviceDiscovery();
case DeviceOperatingSystem.fuchsia: case DeviceOperatingSystem.fuchsia:
...@@ -158,19 +158,19 @@ abstract class Device { ...@@ -158,19 +158,19 @@ abstract class Device {
} }
} }
enum _AndroidCPU { enum AndroidCPU {
arm, arm,
arm64, arm64,
} }
class AndroidDeviceDiscovery implements DeviceDiscovery { class AndroidDeviceDiscovery implements DeviceDiscovery {
factory AndroidDeviceDiscovery({_AndroidCPU cpu}) { factory AndroidDeviceDiscovery({AndroidCPU cpu}) {
return _instance ??= AndroidDeviceDiscovery._(cpu); return _instance ??= AndroidDeviceDiscovery._(cpu);
} }
AndroidDeviceDiscovery._(this.cpu); AndroidDeviceDiscovery._(this.cpu);
final _AndroidCPU cpu; final AndroidCPU cpu;
// Parses information about a device. Example: // Parses information about a device. Example:
// //
...@@ -199,9 +199,9 @@ class AndroidDeviceDiscovery implements DeviceDiscovery { ...@@ -199,9 +199,9 @@ class AndroidDeviceDiscovery implements DeviceDiscovery {
if (cpu == null) if (cpu == null)
return true; return true;
switch (cpu) { switch (cpu) {
case _AndroidCPU.arm64: case AndroidCPU.arm64:
return device.isArm64(); return device.isArm64();
case _AndroidCPU.arm: case AndroidCPU.arm:
return device.isArm(); return device.isArm();
} }
return true; return true;
......
...@@ -32,7 +32,7 @@ class HomePage extends StatefulWidget { ...@@ -32,7 +32,7 @@ class HomePage extends StatefulWidget {
const HomePage({Key? key}) : super(key: key); const HomePage({Key? key}) : super(key: key);
@override @override
_HomePage createState() => _HomePage(); State<HomePage> createState() => _HomePage();
} }
class _HomePage extends State<HomePage> { class _HomePage extends State<HomePage> {
......
...@@ -33,7 +33,7 @@ enum _LastTestStatus { ...@@ -33,7 +33,7 @@ enum _LastTestStatus {
class WindowManagerBodyState extends State<WindowManagerBody> { class WindowManagerBodyState extends State<WindowManagerBody> {
MethodChannel? viewChannel; MethodChannel? viewChannel;
_LastTestStatus lastTestStatus = _LastTestStatus.pending; _LastTestStatus _lastTestStatus = _LastTestStatus.pending;
String? lastError; String? lastError;
int? id; int? id;
int windowClickCount = 0; int windowClickCount = 0;
...@@ -53,7 +53,7 @@ class WindowManagerBodyState extends State<WindowManagerBody> { ...@@ -53,7 +53,7 @@ class WindowManagerBodyState extends State<WindowManagerBody> {
onPlatformViewCreated: onPlatformViewCreated, onPlatformViewCreated: onPlatformViewCreated,
), ),
), ),
if (lastTestStatus != _LastTestStatus.pending) _statusWidget(), if (_lastTestStatus != _LastTestStatus.pending) _statusWidget(),
if (viewChannel != null) ... <Widget>[ if (viewChannel != null) ... <Widget>[
ElevatedButton( ElevatedButton(
key: const ValueKey<String>('ShowAlertDialog'), key: const ValueKey<String>('ShowAlertDialog'),
...@@ -86,34 +86,34 @@ class WindowManagerBodyState extends State<WindowManagerBody> { ...@@ -86,34 +86,34 @@ class WindowManagerBodyState extends State<WindowManagerBody> {
} }
Widget _statusWidget() { Widget _statusWidget() {
assert(lastTestStatus != _LastTestStatus.pending); assert(_lastTestStatus != _LastTestStatus.pending);
final String? message = lastTestStatus == _LastTestStatus.success ? 'Success' : lastError; final String? message = _lastTestStatus == _LastTestStatus.success ? 'Success' : lastError;
return Container( return Container(
color: lastTestStatus == _LastTestStatus.success ? Colors.green : Colors.red, color: _lastTestStatus == _LastTestStatus.success ? Colors.green : Colors.red,
child: Text( child: Text(
message!, message!,
key: const ValueKey<String>('Status'), key: const ValueKey<String>('Status'),
style: TextStyle( style: TextStyle(
color: lastTestStatus == _LastTestStatus.error ? Colors.yellow : null, color: _lastTestStatus == _LastTestStatus.error ? Colors.yellow : null,
), ),
), ),
); );
} }
Future<void> onShowAlertDialogPressed() async { Future<void> onShowAlertDialogPressed() async {
if (lastTestStatus != _LastTestStatus.pending) { if (_lastTestStatus != _LastTestStatus.pending) {
setState(() { setState(() {
lastTestStatus = _LastTestStatus.pending; _lastTestStatus = _LastTestStatus.pending;
}); });
} }
try { try {
await viewChannel?.invokeMethod<void>('showAndHideAlertDialog'); await viewChannel?.invokeMethod<void>('showAndHideAlertDialog');
setState(() { setState(() {
lastTestStatus = _LastTestStatus.success; _lastTestStatus = _LastTestStatus.success;
}); });
} catch(e) { } catch(e) {
setState(() { setState(() {
lastTestStatus = _LastTestStatus.error; _lastTestStatus = _LastTestStatus.error;
lastError = '$e'; lastError = '$e';
}); });
} }
...@@ -127,7 +127,7 @@ class WindowManagerBodyState extends State<WindowManagerBody> { ...@@ -127,7 +127,7 @@ class WindowManagerBodyState extends State<WindowManagerBody> {
}); });
} catch(e) { } catch(e) {
setState(() { setState(() {
lastTestStatus = _LastTestStatus.error; _lastTestStatus = _LastTestStatus.error;
lastError = '$e'; lastError = '$e';
}); });
} }
......
...@@ -22,7 +22,7 @@ class TestApp extends StatefulWidget { ...@@ -22,7 +22,7 @@ class TestApp extends StatefulWidget {
const TestApp({Key key}) : super(key: key); const TestApp({Key key}) : super(key: key);
@override @override
_TestAppState createState() => _TestAppState(); State<TestApp> createState() => _TestAppState();
} }
class _TestAppState extends State<TestApp> { class _TestAppState extends State<TestApp> {
......
...@@ -15,7 +15,7 @@ class Flavor extends StatefulWidget { ...@@ -15,7 +15,7 @@ class Flavor extends StatefulWidget {
const Flavor({Key? key}) : super(key: key); const Flavor({Key? key}) : super(key: key);
@override @override
_FlavorState createState() => _FlavorState(); State<Flavor> createState() => _FlavorState();
} }
class _FlavorState extends State<Flavor> { class _FlavorState extends State<Flavor> {
......
...@@ -420,7 +420,7 @@ class AnimationDemoHome extends StatefulWidget { ...@@ -420,7 +420,7 @@ class AnimationDemoHome extends StatefulWidget {
static const String routeName = '/animation'; static const String routeName = '/animation';
@override @override
_AnimationDemoHomeState createState() => _AnimationDemoHomeState(); State<AnimationDemoHome> createState() => _AnimationDemoHomeState();
} }
class _AnimationDemoHomeState extends State<AnimationDemoHome> { class _AnimationDemoHomeState extends State<AnimationDemoHome> {
......
...@@ -10,10 +10,10 @@ class Calculator extends StatefulWidget { ...@@ -10,10 +10,10 @@ class Calculator extends StatefulWidget {
const Calculator({Key? key}) : super(key: key); const Calculator({Key? key}) : super(key: key);
@override @override
_CalculatorState createState() => _CalculatorState(); State<Calculator> createState() => CalculatorState();
} }
class _CalculatorState extends State<Calculator> { class CalculatorState extends State<Calculator> {
/// As the user taps keys we update the current `_expression` and we also /// As the user taps keys we update the current `_expression` and we also
/// keep a stack of previous expressions so we can return to earlier states /// keep a stack of previous expressions so we can return to earlier states
/// when the user hits the DEL key. /// when the user hits the DEL key.
...@@ -156,7 +156,7 @@ class CalcDisplay extends StatelessWidget { ...@@ -156,7 +156,7 @@ class CalcDisplay extends StatelessWidget {
class KeyPad extends StatelessWidget { class KeyPad extends StatelessWidget {
const KeyPad({ Key? key, this.calcState }) : super(key: key); const KeyPad({ Key? key, this.calcState }) : super(key: key);
final _CalculatorState? calcState; final CalculatorState? calcState;
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
...@@ -265,7 +265,7 @@ class CalcKey extends StatelessWidget { ...@@ -265,7 +265,7 @@ class CalcKey extends StatelessWidget {
} }
class NumberKey extends CalcKey { class NumberKey extends CalcKey {
NumberKey(int value, _CalculatorState? calcState, {Key? key}) NumberKey(int value, CalculatorState? calcState, {Key? key})
: super('$value', () { : super('$value', () {
calcState!.handleNumberTap(value); calcState!.handleNumberTap(value);
}, key: key); }, key: key);
......
...@@ -12,7 +12,7 @@ class CupertinoAlertDemo extends StatefulWidget { ...@@ -12,7 +12,7 @@ class CupertinoAlertDemo extends StatefulWidget {
static const String routeName = '/cupertino/alert'; static const String routeName = '/cupertino/alert';
@override @override
_CupertinoAlertDemoState createState() => _CupertinoAlertDemoState(); State<CupertinoAlertDemo> createState() => _CupertinoAlertDemoState();
} }
class _CupertinoAlertDemoState extends State<CupertinoAlertDemo> { class _CupertinoAlertDemoState extends State<CupertinoAlertDemo> {
......
...@@ -12,7 +12,7 @@ class CupertinoButtonsDemo extends StatefulWidget { ...@@ -12,7 +12,7 @@ class CupertinoButtonsDemo extends StatefulWidget {
static const String routeName = '/cupertino/buttons'; static const String routeName = '/cupertino/buttons';
@override @override
_CupertinoButtonDemoState createState() => _CupertinoButtonDemoState(); State<CupertinoButtonsDemo> createState() => _CupertinoButtonDemoState();
} }
class _CupertinoButtonDemoState extends State<CupertinoButtonsDemo> { class _CupertinoButtonDemoState extends State<CupertinoButtonsDemo> {
......
...@@ -17,7 +17,7 @@ class CupertinoPickerDemo extends StatefulWidget { ...@@ -17,7 +17,7 @@ class CupertinoPickerDemo extends StatefulWidget {
static const String routeName = '/cupertino/picker'; static const String routeName = '/cupertino/picker';
@override @override
_CupertinoPickerDemoState createState() => _CupertinoPickerDemoState(); State<CupertinoPickerDemo> createState() => _CupertinoPickerDemoState();
} }
class _BottomPicker extends StatelessWidget { class _BottomPicker extends StatelessWidget {
......
...@@ -14,7 +14,7 @@ class CupertinoRefreshControlDemo extends StatefulWidget { ...@@ -14,7 +14,7 @@ class CupertinoRefreshControlDemo extends StatefulWidget {
static const String routeName = '/cupertino/refresh'; static const String routeName = '/cupertino/refresh';
@override @override
_CupertinoRefreshControlDemoState createState() => _CupertinoRefreshControlDemoState(); State<CupertinoRefreshControlDemo> createState() => _CupertinoRefreshControlDemoState();
} }
class _CupertinoRefreshControlDemoState extends State<CupertinoRefreshControlDemo> { class _CupertinoRefreshControlDemoState extends State<CupertinoRefreshControlDemo> {
......
...@@ -17,7 +17,7 @@ class CupertinoSegmentedControlDemo extends StatefulWidget { ...@@ -17,7 +17,7 @@ class CupertinoSegmentedControlDemo extends StatefulWidget {
static const String routeName = 'cupertino/segmented_control'; static const String routeName = 'cupertino/segmented_control';
@override @override
_CupertinoSegmentedControlDemoState createState() => _CupertinoSegmentedControlDemoState(); State<CupertinoSegmentedControlDemo> createState() => _CupertinoSegmentedControlDemoState();
} }
class _CupertinoSegmentedControlDemoState extends State<CupertinoSegmentedControlDemo> { class _CupertinoSegmentedControlDemoState extends State<CupertinoSegmentedControlDemo> {
......
...@@ -12,7 +12,7 @@ class CupertinoSliderDemo extends StatefulWidget { ...@@ -12,7 +12,7 @@ class CupertinoSliderDemo extends StatefulWidget {
static const String routeName = '/cupertino/slider'; static const String routeName = '/cupertino/slider';
@override @override
_CupertinoSliderDemoState createState() => _CupertinoSliderDemoState(); State<CupertinoSliderDemo> createState() => _CupertinoSliderDemoState();
} }
class _CupertinoSliderDemoState extends State<CupertinoSliderDemo> { class _CupertinoSliderDemoState extends State<CupertinoSliderDemo> {
......
...@@ -12,7 +12,7 @@ class CupertinoSwitchDemo extends StatefulWidget { ...@@ -12,7 +12,7 @@ class CupertinoSwitchDemo extends StatefulWidget {
static const String routeName = '/cupertino/switch'; static const String routeName = '/cupertino/switch';
@override @override
_CupertinoSwitchDemoState createState() => _CupertinoSwitchDemoState(); State<CupertinoSwitchDemo> createState() => _CupertinoSwitchDemoState();
} }
class _CupertinoSwitchDemoState extends State<CupertinoSwitchDemo> { class _CupertinoSwitchDemoState extends State<CupertinoSwitchDemo> {
......
...@@ -10,7 +10,7 @@ class CupertinoTextFieldDemo extends StatefulWidget { ...@@ -10,7 +10,7 @@ class CupertinoTextFieldDemo extends StatefulWidget {
static const String routeName = '/cupertino/text_fields'; static const String routeName = '/cupertino/text_fields';
@override @override
_CupertinoTextFieldDemoState createState() { State<CupertinoTextFieldDemo> createState() {
return _CupertinoTextFieldDemoState(); return _CupertinoTextFieldDemoState();
} }
} }
......
...@@ -244,7 +244,7 @@ class BackdropDemo extends StatefulWidget { ...@@ -244,7 +244,7 @@ class BackdropDemo extends StatefulWidget {
static const String routeName = '/material/backdrop'; static const String routeName = '/material/backdrop';
@override @override
_BackdropDemoState createState() => _BackdropDemoState(); State<BackdropDemo> createState() => _BackdropDemoState();
} }
class _BackdropDemoState extends State<BackdropDemo> with SingleTickerProviderStateMixin { class _BackdropDemoState extends State<BackdropDemo> with SingleTickerProviderStateMixin {
......
...@@ -18,7 +18,7 @@ class BannerDemo extends StatefulWidget { ...@@ -18,7 +18,7 @@ class BannerDemo extends StatefulWidget {
static const String routeName = '/material/banner'; static const String routeName = '/material/banner';
@override @override
_BannerDemoState createState() => _BannerDemoState(); State<BannerDemo> createState() => _BannerDemoState();
} }
class _BannerDemoState extends State<BannerDemo> { class _BannerDemoState extends State<BannerDemo> {
......
...@@ -112,7 +112,7 @@ class BottomNavigationDemo extends StatefulWidget { ...@@ -112,7 +112,7 @@ class BottomNavigationDemo extends StatefulWidget {
static const String routeName = '/material/bottom_navigation'; static const String routeName = '/material/bottom_navigation';
@override @override
_BottomNavigationDemoState createState() => _BottomNavigationDemoState(); State<BottomNavigationDemo> createState() => _BottomNavigationDemoState();
} }
class _BottomNavigationDemoState extends State<BottomNavigationDemo> class _BottomNavigationDemoState extends State<BottomNavigationDemo>
......
...@@ -51,7 +51,7 @@ class ButtonsDemo extends StatefulWidget { ...@@ -51,7 +51,7 @@ class ButtonsDemo extends StatefulWidget {
static const String routeName = '/material/buttons'; static const String routeName = '/material/buttons';
@override @override
_ButtonsDemoState createState() => _ButtonsDemoState(); State<ButtonsDemo> createState() => _ButtonsDemoState();
} }
class _ButtonsDemoState extends State<ButtonsDemo> { class _ButtonsDemoState extends State<ButtonsDemo> {
......
...@@ -150,7 +150,7 @@ class SelectableTravelDestinationItem extends StatefulWidget { ...@@ -150,7 +150,7 @@ class SelectableTravelDestinationItem extends StatefulWidget {
final ShapeBorder? shape; final ShapeBorder? shape;
@override @override
_SelectableTravelDestinationItemState createState() => _SelectableTravelDestinationItemState(); State<SelectableTravelDestinationItem> createState() => _SelectableTravelDestinationItemState();
} }
class _SelectableTravelDestinationItemState extends State<SelectableTravelDestinationItem> { class _SelectableTravelDestinationItemState extends State<SelectableTravelDestinationItem> {
...@@ -340,7 +340,7 @@ class CardsDemo extends StatefulWidget { ...@@ -340,7 +340,7 @@ class CardsDemo extends StatefulWidget {
static const String routeName = '/material/cards'; static const String routeName = '/material/cards';
@override @override
_CardsDemoState createState() => _CardsDemoState(); State<CardsDemo> createState() => _CardsDemoState();
} }
class _CardsDemoState extends State<CardsDemo> { class _CardsDemoState extends State<CardsDemo> {
......
...@@ -140,7 +140,7 @@ class ChipDemo extends StatefulWidget { ...@@ -140,7 +140,7 @@ class ChipDemo extends StatefulWidget {
static const String routeName = '/material/chip'; static const String routeName = '/material/chip';
@override @override
_ChipDemoState createState() => _ChipDemoState(); State<ChipDemo> createState() => _ChipDemoState();
} }
class _ChipDemoState extends State<ChipDemo> { class _ChipDemoState extends State<ChipDemo> {
......
...@@ -147,7 +147,7 @@ class DataTableDemo extends StatefulWidget { ...@@ -147,7 +147,7 @@ class DataTableDemo extends StatefulWidget {
static const String routeName = '/material/data-table'; static const String routeName = '/material/data-table';
@override @override
_DataTableDemoState createState() => _DataTableDemoState(); State<DataTableDemo> createState() => _DataTableDemoState();
} }
class _DataTableDemoState extends State<DataTableDemo> { class _DataTableDemoState extends State<DataTableDemo> {
......
...@@ -118,7 +118,7 @@ class DateAndTimePickerDemo extends StatefulWidget { ...@@ -118,7 +118,7 @@ class DateAndTimePickerDemo extends StatefulWidget {
static const String routeName = '/material/date-and-time-pickers'; static const String routeName = '/material/date-and-time-pickers';
@override @override
_DateAndTimePickerDemoState createState() => _DateAndTimePickerDemoState(); State<DateAndTimePickerDemo> createState() => _DateAndTimePickerDemoState();
} }
class _DateAndTimePickerDemoState extends State<DateAndTimePickerDemo> { class _DateAndTimePickerDemoState extends State<DateAndTimePickerDemo> {
......
...@@ -18,7 +18,7 @@ class DrawerDemo extends StatefulWidget { ...@@ -18,7 +18,7 @@ class DrawerDemo extends StatefulWidget {
static const String routeName = '/material/drawer'; static const String routeName = '/material/drawer';
@override @override
_DrawerDemoState createState() => _DrawerDemoState(); State<DrawerDemo> createState() => _DrawerDemoState();
} }
class _DrawerDemoState extends State<DrawerDemo> with TickerProviderStateMixin { class _DrawerDemoState extends State<DrawerDemo> with TickerProviderStateMixin {
......
...@@ -182,7 +182,7 @@ class ExpansionPanelsDemo extends StatefulWidget { ...@@ -182,7 +182,7 @@ class ExpansionPanelsDemo extends StatefulWidget {
static const String routeName = '/material/expansion_panels'; static const String routeName = '/material/expansion_panels';
@override @override
_ExpansionPanelsDemoState createState() => _ExpansionPanelsDemoState(); State<ExpansionPanelsDemo> createState() => _ExpansionPanelsDemoState();
} }
class _ExpansionPanelsDemoState extends State<ExpansionPanelsDemo> { class _ExpansionPanelsDemoState extends State<ExpansionPanelsDemo> {
......
...@@ -43,7 +43,7 @@ class GridPhotoViewer extends StatefulWidget { ...@@ -43,7 +43,7 @@ class GridPhotoViewer extends StatefulWidget {
final Photo? photo; final Photo? photo;
@override @override
_GridPhotoViewerState createState() => _GridPhotoViewerState(); State<GridPhotoViewer> createState() => _GridPhotoViewerState();
} }
class _GridTitleText extends StatelessWidget { class _GridTitleText extends StatelessWidget {
......
...@@ -26,7 +26,7 @@ class ListDemo extends StatefulWidget { ...@@ -26,7 +26,7 @@ class ListDemo extends StatefulWidget {
static const String routeName = '/material/list'; static const String routeName = '/material/list';
@override @override
_ListDemoState createState() => _ListDemoState(); State<ListDemo> createState() => _ListDemoState();
} }
class _ListDemoState extends State<ListDemo> { class _ListDemoState extends State<ListDemo> {
......
...@@ -12,7 +12,7 @@ class PersistentBottomSheetDemo extends StatefulWidget { ...@@ -12,7 +12,7 @@ class PersistentBottomSheetDemo extends StatefulWidget {
static const String routeName = '/material/persistent-bottom-sheet'; static const String routeName = '/material/persistent-bottom-sheet';
@override @override
_PersistentBottomSheetDemoState createState() => _PersistentBottomSheetDemoState(); State<PersistentBottomSheetDemo> createState() => _PersistentBottomSheetDemoState();
} }
class _PersistentBottomSheetDemoState extends State<PersistentBottomSheetDemo> { class _PersistentBottomSheetDemoState extends State<PersistentBottomSheetDemo> {
......
...@@ -12,7 +12,7 @@ class ProgressIndicatorDemo extends StatefulWidget { ...@@ -12,7 +12,7 @@ class ProgressIndicatorDemo extends StatefulWidget {
static const String routeName = '/material/progress-indicator'; static const String routeName = '/material/progress-indicator';
@override @override
_ProgressIndicatorDemoState createState() => _ProgressIndicatorDemoState(); State<ProgressIndicatorDemo> createState() => _ProgressIndicatorDemoState();
} }
class _ProgressIndicatorDemoState extends State<ProgressIndicatorDemo> with SingleTickerProviderStateMixin { class _ProgressIndicatorDemoState extends State<ProgressIndicatorDemo> with SingleTickerProviderStateMixin {
......
...@@ -23,7 +23,7 @@ class ReorderableListDemo extends StatefulWidget { ...@@ -23,7 +23,7 @@ class ReorderableListDemo extends StatefulWidget {
static const String routeName = '/material/reorderable-list'; static const String routeName = '/material/reorderable-list';
@override @override
_ListDemoState createState() => _ListDemoState(); State<ReorderableListDemo> createState() => _ListDemoState();
} }
class _ListItem { class _ListItem {
......
...@@ -12,7 +12,7 @@ class SearchDemo extends StatefulWidget { ...@@ -12,7 +12,7 @@ class SearchDemo extends StatefulWidget {
static const String routeName = '/material/search'; static const String routeName = '/material/search';
@override @override
_SearchDemoState createState() => _SearchDemoState(); State<SearchDemo> createState() => _SearchDemoState();
} }
class _SearchDemoState extends State<SearchDemo> { class _SearchDemoState extends State<SearchDemo> {
......
...@@ -33,7 +33,7 @@ class SelectionControlsDemo extends StatefulWidget { ...@@ -33,7 +33,7 @@ class SelectionControlsDemo extends StatefulWidget {
static const String routeName = '/material/selection-controls'; static const String routeName = '/material/selection-controls';
@override @override
_SelectionControlsDemoState createState() => _SelectionControlsDemoState(); State<SelectionControlsDemo> createState() => _SelectionControlsDemoState();
} }
class _SelectionControlsDemoState extends State<SelectionControlsDemo> { class _SelectionControlsDemoState extends State<SelectionControlsDemo> {
......
...@@ -14,7 +14,7 @@ class SliderDemo extends StatefulWidget { ...@@ -14,7 +14,7 @@ class SliderDemo extends StatefulWidget {
static const String routeName = '/material/slider'; static const String routeName = '/material/slider';
@override @override
_SliderDemoState createState() => _SliderDemoState(); State<SliderDemo> createState() => _SliderDemoState();
} }
Path _downTriangle(double size, Offset thumbCenter, { bool invert = false }) { Path _downTriangle(double size, Offset thumbCenter, { bool invert = false }) {
......
...@@ -24,7 +24,7 @@ class SnackBarDemo extends StatefulWidget { ...@@ -24,7 +24,7 @@ class SnackBarDemo extends StatefulWidget {
static const String routeName = '/material/snack-bar'; static const String routeName = '/material/snack-bar';
@override @override
_SnackBarDemoState createState() => _SnackBarDemoState(); State<SnackBarDemo> createState() => _SnackBarDemoState();
} }
class _SnackBarDemoState extends State<SnackBarDemo> { class _SnackBarDemoState extends State<SnackBarDemo> {
......
...@@ -40,7 +40,7 @@ class TabsFabDemo extends StatefulWidget { ...@@ -40,7 +40,7 @@ class TabsFabDemo extends StatefulWidget {
static const String routeName = '/material/tabs-fab'; static const String routeName = '/material/tabs-fab';
@override @override
_TabsFabDemoState createState() => _TabsFabDemoState(); State<TabsFabDemo> createState() => _TabsFabDemoState();
} }
class _TabsFabDemoState extends State<TabsFabDemo> with SingleTickerProviderStateMixin { class _TabsFabDemoState extends State<TabsFabDemo> with SingleTickerProviderStateMixin {
......
...@@ -45,7 +45,7 @@ class PasswordField extends StatefulWidget { ...@@ -45,7 +45,7 @@ class PasswordField extends StatefulWidget {
final ValueChanged<String>? onFieldSubmitted; final ValueChanged<String>? onFieldSubmitted;
@override @override
_PasswordFieldState createState() => _PasswordFieldState(); State<PasswordField> createState() => _PasswordFieldState();
} }
class _PasswordFieldState extends State<PasswordField> { class _PasswordFieldState extends State<PasswordField> {
......
...@@ -71,7 +71,7 @@ class RecipeGridPage extends StatefulWidget { ...@@ -71,7 +71,7 @@ class RecipeGridPage extends StatefulWidget {
final List<Recipe?>? recipes; final List<Recipe?>? recipes;
@override @override
_RecipeGridPageState createState() => _RecipeGridPageState(); State<RecipeGridPage> createState() => _RecipeGridPageState();
} }
class _RecipeGridPageState extends State<RecipeGridPage> { class _RecipeGridPageState extends State<RecipeGridPage> {
...@@ -195,7 +195,7 @@ class PestoLogo extends StatefulWidget { ...@@ -195,7 +195,7 @@ class PestoLogo extends StatefulWidget {
final double? t; final double? t;
@override @override
_PestoLogoState createState() => _PestoLogoState(); State<PestoLogo> createState() => _PestoLogoState();
} }
class _PestoLogoState extends State<PestoLogo> { class _PestoLogoState extends State<PestoLogo> {
...@@ -319,7 +319,7 @@ class RecipePage extends StatefulWidget { ...@@ -319,7 +319,7 @@ class RecipePage extends StatefulWidget {
final Recipe? recipe; final Recipe? recipe;
@override @override
_RecipePageState createState() => _RecipePageState(); State<RecipePage> createState() => _RecipePageState();
} }
class _RecipePageState extends State<RecipePage> { class _RecipePageState extends State<RecipePage> {
......
...@@ -16,7 +16,7 @@ class ShrineApp extends StatefulWidget { ...@@ -16,7 +16,7 @@ class ShrineApp extends StatefulWidget {
const ShrineApp({Key? key}) : super(key: key); const ShrineApp({Key? key}) : super(key: key);
@override @override
_ShrineAppState createState() => _ShrineAppState(); State<ShrineApp> createState() => _ShrineAppState();
} }
class _ShrineAppState extends State<ShrineApp> with SingleTickerProviderStateMixin { class _ShrineAppState extends State<ShrineApp> with SingleTickerProviderStateMixin {
......
...@@ -213,7 +213,7 @@ class Backdrop extends StatefulWidget { ...@@ -213,7 +213,7 @@ class Backdrop extends StatefulWidget {
final AnimationController controller; final AnimationController controller;
@override @override
_BackdropState createState() => _BackdropState(); State<Backdrop> createState() => _BackdropState();
} }
class _BackdropState extends State<Backdrop> with SingleTickerProviderStateMixin { class _BackdropState extends State<Backdrop> with SingleTickerProviderStateMixin {
......
...@@ -30,10 +30,10 @@ class ExpandingBottomSheet extends StatefulWidget { ...@@ -30,10 +30,10 @@ class ExpandingBottomSheet extends StatefulWidget {
final AnimationController hideController; final AnimationController hideController;
@override @override
_ExpandingBottomSheetState createState() => _ExpandingBottomSheetState(); ExpandingBottomSheetState createState() => ExpandingBottomSheetState();
static _ExpandingBottomSheetState? of(BuildContext context, {bool isNullOk = false}) { static ExpandingBottomSheetState? of(BuildContext context, {bool isNullOk = false}) {
final _ExpandingBottomSheetState? result = context.findAncestorStateOfType<_ExpandingBottomSheetState>(); final ExpandingBottomSheetState? result = context.findAncestorStateOfType<ExpandingBottomSheetState>();
if (isNullOk || result != null) { if (isNullOk || result != null) {
return result; return result;
} }
...@@ -97,7 +97,7 @@ double _getPeakPoint({required double begin, required double end}) { ...@@ -97,7 +97,7 @@ double _getPeakPoint({required double begin, required double end}) {
return begin + (end - begin) * _kPeakVelocityProgress; return begin + (end - begin) * _kPeakVelocityProgress;
} }
class _ExpandingBottomSheetState extends State<ExpandingBottomSheet> with TickerProviderStateMixin { class ExpandingBottomSheetState extends State<ExpandingBottomSheet> with TickerProviderStateMixin {
final GlobalKey _expandingBottomSheetKey = GlobalKey(debugLabel: 'Expanding bottom sheet'); final GlobalKey _expandingBottomSheetKey = GlobalKey(debugLabel: 'Expanding bottom sheet');
// The width of the Material, calculated by _widthFor() & based on the number // The width of the Material, calculated by _widthFor() & based on the number
...@@ -405,7 +405,7 @@ class ProductThumbnailRow extends StatefulWidget { ...@@ -405,7 +405,7 @@ class ProductThumbnailRow extends StatefulWidget {
const ProductThumbnailRow({Key? key}) : super(key: key); const ProductThumbnailRow({Key? key}) : super(key: key);
@override @override
_ProductThumbnailRowState createState() => _ProductThumbnailRowState(); State<ProductThumbnailRow> createState() => _ProductThumbnailRowState();
} }
class _ProductThumbnailRowState extends State<ProductThumbnailRow> { class _ProductThumbnailRowState extends State<ProductThumbnailRow> {
......
...@@ -10,7 +10,7 @@ class LoginPage extends StatefulWidget { ...@@ -10,7 +10,7 @@ class LoginPage extends StatefulWidget {
const LoginPage({Key? key}) : super(key: key); const LoginPage({Key? key}) : super(key: key);
@override @override
_LoginPageState createState() => _LoginPageState(); State<LoginPage> createState() => _LoginPageState();
} }
class _LoginPageState extends State<LoginPage> { class _LoginPageState extends State<LoginPage> {
......
...@@ -16,7 +16,7 @@ class ShoppingCartPage extends StatefulWidget { ...@@ -16,7 +16,7 @@ class ShoppingCartPage extends StatefulWidget {
const ShoppingCartPage({Key? key}) : super(key: key); const ShoppingCartPage({Key? key}) : super(key: key);
@override @override
_ShoppingCartPageState createState() => _ShoppingCartPageState(); State<ShoppingCartPage> createState() => _ShoppingCartPageState();
} }
class _ShoppingCartPageState extends State<ShoppingCartPage> { class _ShoppingCartPageState extends State<ShoppingCartPage> {
......
...@@ -13,7 +13,8 @@ class TransformationsDemo extends StatefulWidget { ...@@ -13,7 +13,8 @@ class TransformationsDemo extends StatefulWidget {
static const String routeName = '/transformations'; static const String routeName = '/transformations';
@override _TransformationsDemoState createState() => _TransformationsDemoState(); @override
State<TransformationsDemo> createState() => _TransformationsDemoState();
} }
class _TransformationsDemoState extends State<TransformationsDemo> { class _TransformationsDemoState extends State<TransformationsDemo> {
// The radius of a hexagon tile in pixels. // The radius of a hexagon tile in pixels.
......
...@@ -117,7 +117,8 @@ class GestureTransformable extends StatefulWidget { ...@@ -117,7 +117,8 @@ class GestureTransformable extends StatefulWidget {
final double? initialScale; final double? initialScale;
final double? initialRotation; final double? initialRotation;
@override _GestureTransformableState createState() => _GestureTransformableState(); @override
State<GestureTransformable> createState() => _GestureTransformableState();
} }
// A single user event can only represent one of these gestures. The user can't // A single user event can only represent one of these gestures. The user can't
......
...@@ -98,7 +98,7 @@ class VideoPlayerLoading extends StatefulWidget { ...@@ -98,7 +98,7 @@ class VideoPlayerLoading extends StatefulWidget {
final VideoPlayerController? controller; final VideoPlayerController? controller;
@override @override
_VideoPlayerLoadingState createState() => _VideoPlayerLoadingState(); State<VideoPlayerLoading> createState() => _VideoPlayerLoadingState();
} }
class _VideoPlayerLoadingState extends State<VideoPlayerLoading> { class _VideoPlayerLoadingState extends State<VideoPlayerLoading> {
...@@ -212,7 +212,7 @@ class FadeAnimation extends StatefulWidget { ...@@ -212,7 +212,7 @@ class FadeAnimation extends StatefulWidget {
final Duration duration; final Duration duration;
@override @override
_FadeAnimationState createState() => _FadeAnimationState(); State<FadeAnimation> createState() => _FadeAnimationState();
} }
class _FadeAnimationState extends State<FadeAnimation> with SingleTickerProviderStateMixin { class _FadeAnimationState extends State<FadeAnimation> with SingleTickerProviderStateMixin {
...@@ -275,7 +275,7 @@ class ConnectivityOverlay extends StatefulWidget { ...@@ -275,7 +275,7 @@ class ConnectivityOverlay extends StatefulWidget {
final Completer<void>? connectedCompleter; final Completer<void>? connectedCompleter;
@override @override
_ConnectivityOverlayState createState() => _ConnectivityOverlayState(); State<ConnectivityOverlay> createState() => _ConnectivityOverlayState();
} }
class _ConnectivityOverlayState extends State<ConnectivityOverlay> { class _ConnectivityOverlayState extends State<ConnectivityOverlay> {
...@@ -348,7 +348,7 @@ class VideoDemo extends StatefulWidget { ...@@ -348,7 +348,7 @@ class VideoDemo extends StatefulWidget {
static const String routeName = '/video'; static const String routeName = '/video';
@override @override
_VideoDemoState createState() => _VideoDemoState(); State<VideoDemo> createState() => _VideoDemoState();
} }
final DeviceInfoPlugin deviceInfoPlugin = DeviceInfoPlugin(); final DeviceInfoPlugin deviceInfoPlugin = DeviceInfoPlugin();
......
...@@ -39,7 +39,7 @@ class GalleryApp extends StatefulWidget { ...@@ -39,7 +39,7 @@ class GalleryApp extends StatefulWidget {
final bool testMode; final bool testMode;
@override @override
_GalleryAppState createState() => _GalleryAppState(); State<GalleryApp> createState() => _GalleryAppState();
} }
class _GalleryAppState extends State<GalleryApp> { class _GalleryAppState extends State<GalleryApp> {
......
...@@ -196,7 +196,7 @@ class Backdrop extends StatefulWidget { ...@@ -196,7 +196,7 @@ class Backdrop extends StatefulWidget {
final Widget? backLayer; final Widget? backLayer;
@override @override
_BackdropState createState() => _BackdropState(); State<Backdrop> createState() => _BackdropState();
} }
class _BackdropState extends State<Backdrop> with SingleTickerProviderStateMixin { class _BackdropState extends State<Backdrop> with SingleTickerProviderStateMixin {
......
...@@ -278,7 +278,7 @@ class GalleryHome extends StatefulWidget { ...@@ -278,7 +278,7 @@ class GalleryHome extends StatefulWidget {
static bool showPreviewBanner = true; static bool showPreviewBanner = true;
@override @override
_GalleryHomeState createState() => _GalleryHomeState(); State<GalleryHome> createState() => _GalleryHomeState();
} }
class _GalleryHomeState extends State<GalleryHome> with SingleTickerProviderStateMixin { class _GalleryHomeState extends State<GalleryHome> with SingleTickerProviderStateMixin {
......
...@@ -33,9 +33,8 @@ enum _LastTestStatus { ...@@ -33,9 +33,8 @@ enum _LastTestStatus {
} }
class NestedViewEventBodyState extends State<NestedViewEventBody> { class NestedViewEventBodyState extends State<NestedViewEventBody> {
MethodChannel viewChannel; MethodChannel viewChannel;
_LastTestStatus lastTestStatus = _LastTestStatus.pending; _LastTestStatus _lastTestStatus = _LastTestStatus.pending;
String lastError; String lastError;
int id; int id;
int nestedViewClickCount = 0; int nestedViewClickCount = 0;
...@@ -58,7 +57,7 @@ class NestedViewEventBodyState extends State<NestedViewEventBody> { ...@@ -58,7 +57,7 @@ class NestedViewEventBodyState extends State<NestedViewEventBody> {
onPlatformViewCreated: onPlatformViewCreated, onPlatformViewCreated: onPlatformViewCreated,
) : null, ) : null,
), ),
if (lastTestStatus != _LastTestStatus.pending) _statusWidget(), if (_lastTestStatus != _LastTestStatus.pending) _statusWidget(),
if (viewChannel != null) ... <Widget>[ if (viewChannel != null) ... <Widget>[
ElevatedButton( ElevatedButton(
key: const ValueKey<String>('ShowAlertDialog'), key: const ValueKey<String>('ShowAlertDialog'),
...@@ -96,34 +95,34 @@ class NestedViewEventBodyState extends State<NestedViewEventBody> { ...@@ -96,34 +95,34 @@ class NestedViewEventBodyState extends State<NestedViewEventBody> {
} }
Widget _statusWidget() { Widget _statusWidget() {
assert(lastTestStatus != _LastTestStatus.pending); assert(_lastTestStatus != _LastTestStatus.pending);
final String message = lastTestStatus == _LastTestStatus.success ? 'Success' : lastError; final String message = _lastTestStatus == _LastTestStatus.success ? 'Success' : lastError;
return Container( return Container(
color: lastTestStatus == _LastTestStatus.success ? Colors.green : Colors.red, color: _lastTestStatus == _LastTestStatus.success ? Colors.green : Colors.red,
child: Text( child: Text(
message, message,
key: const ValueKey<String>('Status'), key: const ValueKey<String>('Status'),
style: TextStyle( style: TextStyle(
color: lastTestStatus == _LastTestStatus.error ? Colors.yellow : null, color: _lastTestStatus == _LastTestStatus.error ? Colors.yellow : null,
), ),
), ),
); );
} }
Future<void> onShowAlertDialogPressed() async { Future<void> onShowAlertDialogPressed() async {
if (lastTestStatus != _LastTestStatus.pending) { if (_lastTestStatus != _LastTestStatus.pending) {
setState(() { setState(() {
lastTestStatus = _LastTestStatus.pending; _lastTestStatus = _LastTestStatus.pending;
}); });
} }
try { try {
await viewChannel.invokeMethod<void>('showAndHideAlertDialog'); await viewChannel.invokeMethod<void>('showAndHideAlertDialog');
setState(() { setState(() {
lastTestStatus = _LastTestStatus.success; _lastTestStatus = _LastTestStatus.success;
}); });
} catch(e) { } catch(e) {
setState(() { setState(() {
lastTestStatus = _LastTestStatus.error; _lastTestStatus = _LastTestStatus.error;
lastError = '$e'; lastError = '$e';
}); });
} }
...@@ -143,7 +142,7 @@ class NestedViewEventBodyState extends State<NestedViewEventBody> { ...@@ -143,7 +142,7 @@ class NestedViewEventBodyState extends State<NestedViewEventBody> {
}); });
} catch(e) { } catch(e) {
setState(() { setState(() {
lastTestStatus = _LastTestStatus.error; _lastTestStatus = _LastTestStatus.error;
lastError = '$e'; lastError = '$e';
}); });
} }
......
...@@ -32,7 +32,7 @@ class LifeCycleSpy extends StatefulWidget { ...@@ -32,7 +32,7 @@ class LifeCycleSpy extends StatefulWidget {
const LifeCycleSpy({Key? key}) : super(key: key); const LifeCycleSpy({Key? key}) : super(key: key);
@override @override
_LifeCycleSpyState createState() => _LifeCycleSpyState(); State<LifeCycleSpy> createState() => _LifeCycleSpyState();
} }
class _LifeCycleSpyState extends State<LifeCycleSpy> with WidgetsBindingObserver { class _LifeCycleSpyState extends State<LifeCycleSpy> with WidgetsBindingObserver {
......
...@@ -46,7 +46,7 @@ class MyHomePage extends StatefulWidget { ...@@ -46,7 +46,7 @@ class MyHomePage extends StatefulWidget {
final String? title; final String? title;
@override @override
_MyHomePageState createState() => _MyHomePageState(); State<MyHomePage> createState() => _MyHomePageState();
} }
class _MyHomePageState extends State<MyHomePage> { class _MyHomePageState extends State<MyHomePage> {
......
...@@ -34,7 +34,7 @@ class MyHomePage extends StatefulWidget { ...@@ -34,7 +34,7 @@ class MyHomePage extends StatefulWidget {
final String? title; final String? title;
@override @override
_MyHomePageState createState() => _MyHomePageState(); State<MyHomePage> createState() => _MyHomePageState();
} }
class _MyHomePageState extends State<MyHomePage> { class _MyHomePageState extends State<MyHomePage> {
......
...@@ -19,7 +19,7 @@ class TestApp extends StatefulWidget { ...@@ -19,7 +19,7 @@ class TestApp extends StatefulWidget {
const TestApp({Key? key}) : super(key: key); const TestApp({Key? key}) : super(key: key);
@override @override
_TestAppState createState() => _TestAppState(); State<TestApp> createState() => _TestAppState();
} }
class _TestAppState extends State<TestApp> { class _TestAppState extends State<TestApp> {
......
...@@ -32,7 +32,7 @@ class MyHomePage extends StatefulWidget { ...@@ -32,7 +32,7 @@ class MyHomePage extends StatefulWidget {
const MyHomePage({Key? key}) : super(key: key); const MyHomePage({Key? key}) : super(key: key);
@override @override
_MyHomePageState createState() => _MyHomePageState(); State<MyHomePage> createState() => _MyHomePageState();
} }
class _MyHomePageState extends State<MyHomePage> { class _MyHomePageState extends State<MyHomePage> {
......
...@@ -30,7 +30,7 @@ class MyHomePage extends StatefulWidget { ...@@ -30,7 +30,7 @@ class MyHomePage extends StatefulWidget {
const MyHomePage({Key? key}) : super(key: key); const MyHomePage({Key? key}) : super(key: key);
@override @override
_MyHomePageState createState() => _MyHomePageState(); State<MyHomePage> createState() => _MyHomePageState();
} }
class _MyHomePageState extends State<MyHomePage> { class _MyHomePageState extends State<MyHomePage> {
......
...@@ -25,7 +25,7 @@ class MyHomePage extends StatefulWidget { ...@@ -25,7 +25,7 @@ class MyHomePage extends StatefulWidget {
final String? title; final String? title;
@override @override
_MyHomePageState createState() => _MyHomePageState(); State<MyHomePage> createState() => _MyHomePageState();
} }
class _MyHomePageState extends State<MyHomePage> { class _MyHomePageState extends State<MyHomePage> {
......
...@@ -299,7 +299,7 @@ class DemoButton extends StatefulWidget { ...@@ -299,7 +299,7 @@ class DemoButton extends StatefulWidget {
final String name; final String name;
@override @override
_DemoButtonState createState() => _DemoButtonState(); State<DemoButton> createState() => _DemoButtonState();
} }
class _DemoButtonState extends State<DemoButton> { class _DemoButtonState extends State<DemoButton> {
...@@ -351,7 +351,7 @@ class FocusDemo extends StatefulWidget { ...@@ -351,7 +351,7 @@ class FocusDemo extends StatefulWidget {
static GlobalKey appKey = GlobalKey(); static GlobalKey appKey = GlobalKey();
@override @override
_FocusDemoState createState() => _FocusDemoState(); State<FocusDemo> createState() => _FocusDemoState();
} }
class _FocusDemoState extends State<FocusDemo> { class _FocusDemoState extends State<FocusDemo> {
......
...@@ -41,7 +41,7 @@ class MyHomePage extends StatefulWidget { ...@@ -41,7 +41,7 @@ class MyHomePage extends StatefulWidget {
final String title; final String title;
@override @override
_MyHomePageState createState() => _MyHomePageState(); State<MyHomePage> createState() => _MyHomePageState();
} }
class OptionModel extends ChangeNotifier { class OptionModel extends ChangeNotifier {
...@@ -139,7 +139,7 @@ class Options extends StatefulWidget { ...@@ -139,7 +139,7 @@ class Options extends StatefulWidget {
final OptionModel model; final OptionModel model;
@override @override
_OptionsState createState() => _OptionsState(); State<Options> createState() => _OptionsState();
} }
class _OptionsState extends State<Options> { class _OptionsState extends State<Options> {
......
...@@ -20,7 +20,7 @@ class DemoButton extends StatefulWidget { ...@@ -20,7 +20,7 @@ class DemoButton extends StatefulWidget {
final bool autofocus; final bool autofocus;
@override @override
_DemoButtonState createState() => _DemoButtonState(); State<DemoButton> createState() => _DemoButtonState();
} }
class _DemoButtonState extends State<DemoButton> { class _DemoButtonState extends State<DemoButton> {
...@@ -77,7 +77,7 @@ class FocusDemo extends StatefulWidget { ...@@ -77,7 +77,7 @@ class FocusDemo extends StatefulWidget {
const FocusDemo({Key key}) : super(key: key); const FocusDemo({Key key}) : super(key: key);
@override @override
_FocusDemoState createState() => _FocusDemoState(); State<FocusDemo> createState() => _FocusDemoState();
} }
class _FocusDemoState extends State<FocusDemo> { class _FocusDemoState extends State<FocusDemo> {
......
...@@ -33,7 +33,7 @@ class HoverDemo extends StatefulWidget { ...@@ -33,7 +33,7 @@ class HoverDemo extends StatefulWidget {
const HoverDemo({Key key}) : super(key: key); const HoverDemo({Key key}) : super(key: key);
@override @override
_HoverDemoState createState() => _HoverDemoState(); State<HoverDemo> createState() => _HoverDemoState();
} }
class _HoverDemoState extends State<HoverDemo> { class _HoverDemoState extends State<HoverDemo> {
......
...@@ -409,7 +409,7 @@ class AnimationDemo extends StatefulWidget { ...@@ -409,7 +409,7 @@ class AnimationDemo extends StatefulWidget {
const AnimationDemo({ Key key }) : super(key: key); const AnimationDemo({ Key key }) : super(key: key);
@override @override
_AnimationDemoState createState() => _AnimationDemoState(); State<AnimationDemo> createState() => _AnimationDemoState();
} }
class _AnimationDemoState extends State<AnimationDemo> with TickerProviderStateMixin { class _AnimationDemoState extends State<AnimationDemo> with TickerProviderStateMixin {
......
...@@ -23,7 +23,7 @@ class RawKeyboardDemo extends StatefulWidget { ...@@ -23,7 +23,7 @@ class RawKeyboardDemo extends StatefulWidget {
const RawKeyboardDemo({Key key}) : super(key: key); const RawKeyboardDemo({Key key}) : super(key: key);
@override @override
_HardwareKeyDemoState createState() => _HardwareKeyDemoState(); State<RawKeyboardDemo> createState() => _HardwareKeyDemoState();
} }
class _HardwareKeyDemoState extends State<RawKeyboardDemo> { class _HardwareKeyDemoState extends State<RawKeyboardDemo> {
......
...@@ -29,7 +29,7 @@ class Home extends StatefulWidget { ...@@ -29,7 +29,7 @@ class Home extends StatefulWidget {
const Home({ Key key }) : super(key: key); const Home({ Key key }) : super(key: key);
@override @override
_HomeState createState() => _HomeState(); State<Home> createState() => _HomeState();
} }
class _HomeState extends State<Home> { class _HomeState extends State<Home> {
...@@ -124,7 +124,7 @@ class Fuzzer extends StatefulWidget { ...@@ -124,7 +124,7 @@ class Fuzzer extends StatefulWidget {
final int seed; final int seed;
@override @override
_FuzzerState createState() => _FuzzerState(); State<Fuzzer> createState() => _FuzzerState();
} }
class _FuzzerState extends State<Fuzzer> with SingleTickerProviderStateMixin { class _FuzzerState extends State<Fuzzer> with SingleTickerProviderStateMixin {
...@@ -539,7 +539,7 @@ class Underlines extends StatefulWidget { ...@@ -539,7 +539,7 @@ class Underlines extends StatefulWidget {
const Underlines({ Key key }) : super(key: key); const Underlines({ Key key }) : super(key: key);
@override @override
_UnderlinesState createState() => _UnderlinesState(); State<Underlines> createState() => _UnderlinesState();
} }
class _UnderlinesState extends State<Underlines> { class _UnderlinesState extends State<Underlines> {
...@@ -644,7 +644,7 @@ class Fallback extends StatefulWidget { ...@@ -644,7 +644,7 @@ class Fallback extends StatefulWidget {
const Fallback({ Key key }) : super(key: key); const Fallback({ Key key }) : super(key: key);
@override @override
_FallbackState createState() => _FallbackState(); State<Fallback> createState() => _FallbackState();
} }
class _FallbackState extends State<Fallback> { class _FallbackState extends State<Fallback> {
...@@ -739,7 +739,7 @@ class Bidi extends StatefulWidget { ...@@ -739,7 +739,7 @@ class Bidi extends StatefulWidget {
const Bidi({ Key key }) : super(key: key); const Bidi({ Key key }) : super(key: key);
@override @override
_BidiState createState() => _BidiState(); State<Bidi> createState() => _BidiState();
} }
class _BidiState extends State<Bidi> { class _BidiState extends State<Bidi> {
...@@ -816,7 +816,7 @@ class Zalgo extends StatefulWidget { ...@@ -816,7 +816,7 @@ class Zalgo extends StatefulWidget {
final int seed; final int seed;
@override @override
_ZalgoState createState() => _ZalgoState(); State<Zalgo> createState() => _ZalgoState();
} }
class _ZalgoState extends State<Zalgo> with SingleTickerProviderStateMixin { class _ZalgoState extends State<Zalgo> with SingleTickerProviderStateMixin {
...@@ -923,7 +923,7 @@ class Painting extends StatefulWidget { ...@@ -923,7 +923,7 @@ class Painting extends StatefulWidget {
final int seed; final int seed;
@override @override
_PaintingState createState() => _PaintingState(); State<Painting> createState() => _PaintingState();
} }
class _PaintingState extends State<Painting> with SingleTickerProviderStateMixin { class _PaintingState extends State<Painting> with SingleTickerProviderStateMixin {
......
...@@ -30,7 +30,7 @@ class MyStatefulWidget extends StatefulWidget { ...@@ -30,7 +30,7 @@ class MyStatefulWidget extends StatefulWidget {
const MyStatefulWidget({Key? key}) : super(key: key); const MyStatefulWidget({Key? key}) : super(key: key);
@override @override
_MyStatefulWidgetState createState() => _MyStatefulWidgetState(); State<MyStatefulWidget> createState() => _MyStatefulWidgetState();
} }
/// This is the private State class that goes with MyStatefulWidget. /// This is the private State class that goes with MyStatefulWidget.
......
...@@ -31,7 +31,7 @@ class MyStatefulWidget extends StatefulWidget { ...@@ -31,7 +31,7 @@ class MyStatefulWidget extends StatefulWidget {
const MyStatefulWidget({Key? key}) : super(key: key); const MyStatefulWidget({Key? key}) : super(key: key);
@override @override
_MyStatefulWidgetState createState() => _MyStatefulWidgetState(); State<MyStatefulWidget> createState() => _MyStatefulWidgetState();
} }
/// This is the private State class that goes with MyStatefulWidget. /// This is the private State class that goes with MyStatefulWidget.
......
...@@ -34,7 +34,7 @@ class MyStatefulWidget extends StatefulWidget { ...@@ -34,7 +34,7 @@ class MyStatefulWidget extends StatefulWidget {
const MyStatefulWidget({Key? key}) : super(key: key); const MyStatefulWidget({Key? key}) : super(key: key);
@override @override
_MyStatefulWidgetState createState() => _MyStatefulWidgetState(); State<MyStatefulWidget> createState() => _MyStatefulWidgetState();
} }
/// This is the private State class that goes with MyStatefulWidget. /// This is the private State class that goes with MyStatefulWidget.
......
...@@ -31,7 +31,7 @@ class MyStatefulWidget extends StatefulWidget { ...@@ -31,7 +31,7 @@ class MyStatefulWidget extends StatefulWidget {
const MyStatefulWidget({Key? key}) : super(key: key); const MyStatefulWidget({Key? key}) : super(key: key);
@override @override
_MyStatefulWidgetState createState() => _MyStatefulWidgetState(); State<MyStatefulWidget> createState() => _MyStatefulWidgetState();
} }
/// This is the private State class that goes with MyStatefulWidget. /// This is the private State class that goes with MyStatefulWidget.
......
...@@ -31,7 +31,7 @@ class MyStatefulWidget extends StatefulWidget { ...@@ -31,7 +31,7 @@ class MyStatefulWidget extends StatefulWidget {
const MyStatefulWidget({Key? key}) : super(key: key); const MyStatefulWidget({Key? key}) : super(key: key);
@override @override
_MyStatefulWidgetState createState() => _MyStatefulWidgetState(); State<MyStatefulWidget> createState() => _MyStatefulWidgetState();
} }
/// This is the private State class that goes with MyStatefulWidget. /// This is the private State class that goes with MyStatefulWidget.
......
...@@ -31,7 +31,7 @@ class MyStatefulWidget extends StatefulWidget { ...@@ -31,7 +31,7 @@ class MyStatefulWidget extends StatefulWidget {
const MyStatefulWidget({Key? key}) : super(key: key); const MyStatefulWidget({Key? key}) : super(key: key);
@override @override
_MyStatefulWidgetState createState() => _MyStatefulWidgetState(); State<MyStatefulWidget> createState() => _MyStatefulWidgetState();
} }
/// This is the private State class that goes with MyStatefulWidget. /// This is the private State class that goes with MyStatefulWidget.
......
...@@ -34,7 +34,7 @@ class MyStatefulWidget extends StatefulWidget { ...@@ -34,7 +34,7 @@ class MyStatefulWidget extends StatefulWidget {
final String? restorationId; final String? restorationId;
@override @override
_MyStatefulWidgetState createState() => _MyStatefulWidgetState(); State<MyStatefulWidget> createState() => _MyStatefulWidgetState();
} }
/// This is the private State class that goes with MyStatefulWidget. /// This is the private State class that goes with MyStatefulWidget.
......
...@@ -34,7 +34,7 @@ class MyStatefulWidget extends StatefulWidget { ...@@ -34,7 +34,7 @@ class MyStatefulWidget extends StatefulWidget {
final String? restorationId; final String? restorationId;
@override @override
_MyStatefulWidgetState createState() => _MyStatefulWidgetState(); State<MyStatefulWidget> createState() => _MyStatefulWidgetState();
} }
/// This is the private State class that goes with MyStatefulWidget. /// This is the private State class that goes with MyStatefulWidget.
......
...@@ -34,7 +34,7 @@ class MyStatefulWidget extends StatefulWidget { ...@@ -34,7 +34,7 @@ class MyStatefulWidget extends StatefulWidget {
final String? restorationId; final String? restorationId;
@override @override
_MyStatefulWidgetState createState() => _MyStatefulWidgetState(); State<MyStatefulWidget> createState() => _MyStatefulWidgetState();
} }
/// This is the private State class that goes with MyStatefulWidget. /// This is the private State class that goes with MyStatefulWidget.
......
...@@ -34,7 +34,7 @@ class MyStatefulWidget extends StatefulWidget { ...@@ -34,7 +34,7 @@ class MyStatefulWidget extends StatefulWidget {
const MyStatefulWidget({Key? key}) : super(key: key); const MyStatefulWidget({Key? key}) : super(key: key);
@override @override
_MyStatefulWidgetState createState() => _MyStatefulWidgetState(); State<MyStatefulWidget> createState() => _MyStatefulWidgetState();
} }
/// This is the private State class that goes with MyStatefulWidget. /// This is the private State class that goes with MyStatefulWidget.
......
...@@ -36,7 +36,7 @@ class MyStatefulWidget extends StatefulWidget { ...@@ -36,7 +36,7 @@ class MyStatefulWidget extends StatefulWidget {
const MyStatefulWidget({Key? key}) : super(key: key); const MyStatefulWidget({Key? key}) : super(key: key);
@override @override
_MyStatefulWidgetState createState() => _MyStatefulWidgetState(); State<MyStatefulWidget> createState() => _MyStatefulWidgetState();
} }
/// This is the private State class that goes with MyStatefulWidget. /// This is the private State class that goes with MyStatefulWidget.
......
...@@ -36,7 +36,7 @@ class MyStatefulWidget extends StatefulWidget { ...@@ -36,7 +36,7 @@ class MyStatefulWidget extends StatefulWidget {
const MyStatefulWidget({Key? key}) : super(key: key); const MyStatefulWidget({Key? key}) : super(key: key);
@override @override
_MyStatefulWidgetState createState() => _MyStatefulWidgetState(); State<MyStatefulWidget> createState() => _MyStatefulWidgetState();
} }
/// This is the private State class that goes with MyStatefulWidget. /// This is the private State class that goes with MyStatefulWidget.
......
...@@ -30,7 +30,7 @@ class MyStatefulWidget extends StatefulWidget { ...@@ -30,7 +30,7 @@ class MyStatefulWidget extends StatefulWidget {
const MyStatefulWidget({Key? key}) : super(key: key); const MyStatefulWidget({Key? key}) : super(key: key);
@override @override
_MyStatefulWidgetState createState() => _MyStatefulWidgetState(); State<MyStatefulWidget> createState() => _MyStatefulWidgetState();
} }
/// This is the private State class that goes with MyStatefulWidget. /// This is the private State class that goes with MyStatefulWidget.
......
...@@ -60,7 +60,7 @@ class SnippetGenerator { ...@@ -60,7 +60,7 @@ class SnippetGenerator {
/// Injects the [injections] into the [template], and turning the /// Injects the [injections] into the [template], and turning the
/// "description" injection into a comment. Only used for /// "description" injection into a comment. Only used for
/// [SnippetType.sample] snippets. /// [SnippetType.sample] snippets.
String interpolateTemplate(List<_ComponentTuple> injections, String template, Map<String, Object?> metadata) { String _interpolateTemplate(List<_ComponentTuple> injections, String template, Map<String, Object?> metadata) {
final RegExp moustacheRegExp = RegExp('{{([^}]+)}}'); final RegExp moustacheRegExp = RegExp('{{([^}]+)}}');
final String interpolated = template.replaceAllMapped(moustacheRegExp, (Match match) { final String interpolated = template.replaceAllMapped(moustacheRegExp, (Match match) {
if (match[1] == 'description') { if (match[1] == 'description') {
...@@ -158,7 +158,7 @@ class SnippetGenerator { ...@@ -158,7 +158,7 @@ class SnippetGenerator {
/// ///
/// Takes into account the [type] and doesn't substitute in the id and the app /// Takes into account the [type] and doesn't substitute in the id and the app
/// if not a [SnippetType.sample] snippet. /// if not a [SnippetType.sample] snippet.
String interpolateSkeleton( String _interpolateSkeleton(
SnippetType type, SnippetType type,
List<_ComponentTuple> injections, List<_ComponentTuple> injections,
String skeleton, String skeleton,
...@@ -215,7 +215,7 @@ class SnippetGenerator { ...@@ -215,7 +215,7 @@ class SnippetGenerator {
/// Parses the input for the various code and description segments, and /// Parses the input for the various code and description segments, and
/// returns them in the order found. /// returns them in the order found.
List<_ComponentTuple> parseInput(String input) { List<_ComponentTuple> _parseInput(String input) {
bool inCodeBlock = false; bool inCodeBlock = false;
input = input.trim(); input = input.trim();
final List<String> description = <String>[]; final List<String> description = <String>[];
...@@ -298,7 +298,7 @@ class SnippetGenerator { ...@@ -298,7 +298,7 @@ class SnippetGenerator {
assert(template != null || type != SnippetType.sample); assert(template != null || type != SnippetType.sample);
assert(metadata['id'] != null); assert(metadata['id'] != null);
assert(!showDartPad || type == SnippetType.sample, 'Only application samples work with dartpad.'); assert(!showDartPad || type == SnippetType.sample, 'Only application samples work with dartpad.');
final List<_ComponentTuple> snippetData = parseInput(_loadFileAsUtf8(input)); final List<_ComponentTuple> snippetData = _parseInput(_loadFileAsUtf8(input));
switch (type) { switch (type) {
case SnippetType.sample: case SnippetType.sample:
final Directory templatesDir = configuration.templatesDirectory; final Directory templatesDir = configuration.templatesDirectory;
...@@ -312,7 +312,7 @@ class SnippetGenerator { ...@@ -312,7 +312,7 @@ class SnippetGenerator {
exit(1); exit(1);
} }
final String templateContents = _loadFileAsUtf8(templateFile); final String templateContents = _loadFileAsUtf8(templateFile);
String app = interpolateTemplate(snippetData, templateContents, metadata); String app = _interpolateTemplate(snippetData, templateContents, metadata);
try { try {
app = formatter.format(app); app = formatter.format(app);
...@@ -343,6 +343,6 @@ class SnippetGenerator { ...@@ -343,6 +343,6 @@ class SnippetGenerator {
} }
final String skeleton = final String skeleton =
_loadFileAsUtf8(configuration.getHtmlSkeletonFile(type, showDartPad: showDartPad)); _loadFileAsUtf8(configuration.getHtmlSkeletonFile(type, showDartPad: showDartPad));
return interpolateSkeleton(type, snippetData, skeleton, metadata); return _interpolateSkeleton(type, snippetData, skeleton, metadata);
} }
} }
...@@ -206,7 +206,7 @@ List<SvgPath> _interpretSvgGroup(List<XmlNode> children, _Transform transform) { ...@@ -206,7 +206,7 @@ List<SvgPath> _interpretSvgGroup(List<XmlNode> children, _Transform transform) {
final XmlElement element = node as XmlElement; final XmlElement element = node as XmlElement;
if (element.name.local == 'path') { if (element.name.local == 'path') {
paths.add(SvgPath.fromElement(element).applyTransform(transform)); paths.add(SvgPath.fromElement(element)._applyTransform(transform));
} }
if (element.name.local == 'g') { if (element.name.local == 'g') {
...@@ -313,9 +313,9 @@ class SvgPath { ...@@ -313,9 +313,9 @@ class SvgPath {
return SvgPath(id, commands); return SvgPath(id, commands);
} }
SvgPath applyTransform(_Transform transform) { SvgPath _applyTransform(_Transform transform) {
final List<SvgPathCommand> transformedCommands = final List<SvgPathCommand> transformedCommands =
commands.map<SvgPathCommand>((SvgPathCommand c) => c.applyTransform(transform)).toList(); commands.map<SvgPathCommand>((SvgPathCommand c) => c._applyTransform(transform)).toList();
return SvgPath(id, transformedCommands, opacity: opacity * transform.opacity); return SvgPath(id, transformedCommands, opacity: opacity * transform.opacity);
} }
...@@ -359,7 +359,7 @@ class SvgPathCommand { ...@@ -359,7 +359,7 @@ class SvgPathCommand {
/// List of points used by this command. /// List of points used by this command.
final List<Point<double>> points; final List<Point<double>> points;
SvgPathCommand applyTransform(_Transform transform) { SvgPathCommand _applyTransform(_Transform transform) {
final List<Point<double>> transformedPoints = final List<Point<double>> transformedPoints =
_vector3ArrayToPoints( _vector3ArrayToPoints(
transform.transformMatrix.applyToVector3Array( transform.transformMatrix.applyToVector3Array(
......
...@@ -29,7 +29,7 @@ class MyHomePage extends StatefulWidget { ...@@ -29,7 +29,7 @@ class MyHomePage extends StatefulWidget {
const MyHomePage({Key? key}) : super(key: key); const MyHomePage({Key? key}) : super(key: key);
@override @override
_MyHomePageState createState() => _MyHomePageState(); State<MyHomePage> createState() => _MyHomePageState();
} }
class _MyHomePageState extends State<MyHomePage> { class _MyHomePageState extends State<MyHomePage> {
......
...@@ -146,7 +146,7 @@ class MyHomePage extends StatefulWidget { ...@@ -146,7 +146,7 @@ class MyHomePage extends StatefulWidget {
final int port; final int port;
@override @override
_MyHomePageState createState() => _MyHomePageState(); State<MyHomePage> createState() => _MyHomePageState();
} }
class _MyHomePageState extends State<MyHomePage> with TickerProviderStateMixin { class _MyHomePageState extends State<MyHomePage> with TickerProviderStateMixin {
......
...@@ -8,7 +8,7 @@ class LifecycleWatcher extends StatefulWidget { ...@@ -8,7 +8,7 @@ class LifecycleWatcher extends StatefulWidget {
const LifecycleWatcher({ Key? key }) : super(key: key); const LifecycleWatcher({ Key? key }) : super(key: key);
@override @override
_LifecycleWatcherState createState() => _LifecycleWatcherState(); State<LifecycleWatcher> createState() => _LifecycleWatcherState();
} }
class _LifecycleWatcherState extends State<LifecycleWatcher> class _LifecycleWatcherState extends State<LifecycleWatcher>
......
...@@ -8,7 +8,7 @@ class SpinningSquare extends StatefulWidget { ...@@ -8,7 +8,7 @@ class SpinningSquare extends StatefulWidget {
const SpinningSquare({Key? key}) : super(key: key); const SpinningSquare({Key? key}) : super(key: key);
@override @override
_SpinningSquareState createState() => _SpinningSquareState(); State<SpinningSquare> createState() => _SpinningSquareState();
} }
class _SpinningSquareState extends State<SpinningSquare> with SingleTickerProviderStateMixin { class _SpinningSquareState extends State<SpinningSquare> with SingleTickerProviderStateMixin {
......
...@@ -78,7 +78,7 @@ class StyledTextDemo extends StatefulWidget { ...@@ -78,7 +78,7 @@ class StyledTextDemo extends StatefulWidget {
const StyledTextDemo({Key? key}) : super(key: key); const StyledTextDemo({Key? key}) : super(key: key);
@override @override
_StyledTextDemoState createState() => _StyledTextDemoState(); State<StyledTextDemo> createState() => _StyledTextDemoState();
} }
class _StyledTextDemoState extends State<StyledTextDemo> { class _StyledTextDemoState extends State<StyledTextDemo> {
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
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