Enable library_private_types_in_public_api lint (#81578)
This commit is contained in:
committed by
GitHub
parent
b878b11f0c
commit
b8a2456737
@@ -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> {
|
||||
|
||||
Reference in New Issue
Block a user