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