Unverified Commit 06515fe0 authored by Konstantin Scheglov's avatar Konstantin Scheglov Committed by GitHub

Ignore in _Location (#96553)

parent e912b91c
...@@ -10,7 +10,6 @@ import '../../gallery/demo.dart'; ...@@ -10,7 +10,6 @@ import '../../gallery/demo.dart';
class _InputDropdown extends StatelessWidget { class _InputDropdown extends StatelessWidget {
const _InputDropdown({ const _InputDropdown({
Key? key, Key? key,
this.child,
this.labelText, this.labelText,
this.valueText, this.valueText,
this.valueStyle, this.valueStyle,
...@@ -21,7 +20,6 @@ class _InputDropdown extends StatelessWidget { ...@@ -21,7 +20,6 @@ class _InputDropdown extends StatelessWidget {
final String? valueText; final String? valueText;
final TextStyle? valueStyle; final TextStyle? valueStyle;
final VoidCallback? onPressed; final VoidCallback? onPressed;
final Widget? child;
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
......
...@@ -245,7 +245,6 @@ class _CupertinoDesktopTextSelectionToolbar extends StatelessWidget { ...@@ -245,7 +245,6 @@ class _CupertinoDesktopTextSelectionToolbar extends StatelessWidget {
Key? key, Key? key,
required this.anchor, required this.anchor,
required this.children, required this.children,
this.toolbarBuilder = _defaultToolbarBuilder,
}) : assert(children.length > 0), }) : assert(children.length > 0),
super(key: key); super(key: key);
...@@ -260,12 +259,6 @@ class _CupertinoDesktopTextSelectionToolbar extends StatelessWidget { ...@@ -260,12 +259,6 @@ class _CupertinoDesktopTextSelectionToolbar extends StatelessWidget {
/// Mac-style text selection toolbar text button. /// Mac-style text selection toolbar text button.
final List<Widget> children; final List<Widget> children;
/// {@macro flutter.material.TextSelectionToolbar.toolbarBuilder}
///
/// The given anchor and isAbove can be used to position an arrow, as in the
/// default Cupertino toolbar.
final ToolbarBuilder toolbarBuilder;
// Builds a toolbar just like the default Mac toolbar, with the right color // Builds a toolbar just like the default Mac toolbar, with the right color
// background, padding, and rounded corners. // background, padding, and rounded corners.
static Widget _defaultToolbarBuilder(BuildContext context, Widget child) { static Widget _defaultToolbarBuilder(BuildContext context, Widget child) {
...@@ -308,7 +301,7 @@ class _CupertinoDesktopTextSelectionToolbar extends StatelessWidget { ...@@ -308,7 +301,7 @@ class _CupertinoDesktopTextSelectionToolbar extends StatelessWidget {
delegate: DesktopTextSelectionToolbarLayoutDelegate( delegate: DesktopTextSelectionToolbarLayoutDelegate(
anchor: anchor - localAdjustment, anchor: anchor - localAdjustment,
), ),
child: toolbarBuilder(context, Column( child: _defaultToolbarBuilder(context, Column(
mainAxisSize: MainAxisSize.min, mainAxisSize: MainAxisSize.min,
children: children, children: children,
)), )),
......
...@@ -1675,11 +1675,7 @@ class _ActionButtonParentDataWidget ...@@ -1675,11 +1675,7 @@ class _ActionButtonParentDataWidget
// ParentData applied to individual action buttons that report whether or not // ParentData applied to individual action buttons that report whether or not
// that button is currently pressed by the user. // that button is currently pressed by the user.
class _ActionButtonParentData extends MultiChildLayoutParentData { class _ActionButtonParentData extends MultiChildLayoutParentData {
_ActionButtonParentData({ bool isPressed = false;
this.isPressed = false,
});
bool isPressed;
} }
/// A button typically used in a [CupertinoAlertDialog]. /// A button typically used in a [CupertinoAlertDialog].
......
...@@ -16,7 +16,6 @@ import 'constants.dart'; ...@@ -16,7 +16,6 @@ import 'constants.dart';
import 'debug.dart'; import 'debug.dart';
import 'dialog.dart'; import 'dialog.dart';
import 'divider.dart'; import 'divider.dart';
import 'floating_action_button.dart';
import 'floating_action_button_location.dart'; import 'floating_action_button_location.dart';
import 'ink_decoration.dart'; import 'ink_decoration.dart';
import 'list_tile.dart'; import 'list_tile.dart';
...@@ -983,9 +982,6 @@ enum _ActionLevel { ...@@ -983,9 +982,6 @@ enum _ActionLevel {
/// Indicates the master view app bar in the lateral UI. /// Indicates the master view app bar in the lateral UI.
view, view,
/// Indicates the master page app bar in the nested UI.
composite,
} }
/// Describes which layout will be used by [_MasterDetailFlow]. /// Describes which layout will be used by [_MasterDetailFlow].
...@@ -1019,20 +1015,9 @@ class _MasterDetailFlow extends StatefulWidget { ...@@ -1019,20 +1015,9 @@ class _MasterDetailFlow extends StatefulWidget {
Key? key, Key? key,
required this.detailPageBuilder, required this.detailPageBuilder,
required this.masterViewBuilder, required this.masterViewBuilder,
this.actionBuilder,
this.automaticallyImplyLeading = true, this.automaticallyImplyLeading = true,
this.breakpoint,
this.centerTitle,
this.detailPageFABGutterWidth,
this.detailPageFABlessGutterWidth, this.detailPageFABlessGutterWidth,
this.displayMode = _LayoutMode.auto, this.displayMode = _LayoutMode.auto,
this.flexibleSpace,
this.floatingActionButton,
this.floatingActionButtonLocation,
this.floatingActionButtonMasterPageLocation,
this.leading,
this.masterPageBuilder,
this.masterViewWidth,
this.title, this.title,
}) : assert(masterViewBuilder != null), }) : assert(masterViewBuilder != null),
assert(automaticallyImplyLeading != null), assert(automaticallyImplyLeading != null),
...@@ -1046,13 +1031,6 @@ class _MasterDetailFlow extends StatefulWidget { ...@@ -1046,13 +1031,6 @@ class _MasterDetailFlow extends StatefulWidget {
/// builds the master view inside a [Scaffold] with an [AppBar]. /// builds the master view inside a [Scaffold] with an [AppBar].
final _MasterViewBuilder masterViewBuilder; final _MasterViewBuilder masterViewBuilder;
/// Builder for the master page for nested navigation.
///
/// This builder is usually a wrapper around the [masterViewBuilder] builder to provide the
/// extra UI required to make a page. However, this builder is optional, and the master page
/// can be built using the master view builder and the configuration for the lateral UI's app bar.
final _MasterViewBuilder? masterPageBuilder;
/// Builder for the detail page. /// Builder for the detail page.
/// ///
/// If scrollController == null, the page is intended for nested navigation. The lateral detail /// If scrollController == null, the page is intended for nested navigation. The lateral detail
...@@ -1061,74 +1039,22 @@ class _MasterDetailFlow extends StatefulWidget { ...@@ -1061,74 +1039,22 @@ class _MasterDetailFlow extends StatefulWidget {
/// page is scrollable. /// page is scrollable.
final _DetailPageBuilder detailPageBuilder; final _DetailPageBuilder detailPageBuilder;
/// Override the width of the master view in the lateral UI.
final double? masterViewWidth;
/// Override the width of the floating action button gutter in the lateral UI.
final double? detailPageFABGutterWidth;
/// Override the width of the gutter when there is no floating action button. /// Override the width of the gutter when there is no floating action button.
final double? detailPageFABlessGutterWidth; final double? detailPageFABlessGutterWidth;
/// Add a floating action button to the lateral UI. If no [masterPageBuilder] is supplied, this
/// floating action button is also used on the nested master page.
///
/// See [Scaffold.floatingActionButton].
final FloatingActionButton? floatingActionButton;
/// The title for the lateral UI [AppBar]. /// The title for the lateral UI [AppBar].
/// ///
/// See [AppBar.title]. /// See [AppBar.title].
final Widget? title; final Widget? title;
/// A widget to display before the title for the lateral UI [AppBar].
///
/// See [AppBar.leading].
final Widget? leading;
/// Override the framework from determining whether to show a leading widget or not. /// Override the framework from determining whether to show a leading widget or not.
/// ///
/// See [AppBar.automaticallyImplyLeading]. /// See [AppBar.automaticallyImplyLeading].
final bool automaticallyImplyLeading; final bool automaticallyImplyLeading;
/// Override the framework from determining whether to display the title in the center of the
/// app bar or not.
///
/// See [AppBar.centerTitle].
final bool? centerTitle;
/// See [AppBar.flexibleSpace].
final Widget? flexibleSpace;
/// Build actions for the lateral UI, and potentially the master page in the nested UI.
///
/// If level is [_ActionLevel.top] then the actions are for
/// the entire lateral UI page. If level is [_ActionLevel.view] the actions
/// are for the master
/// view toolbar. Finally, if the [AppBar] for the master page for the nested UI is being built
/// by [_MasterDetailFlow], then [_ActionLevel.composite] indicates the
/// actions are for the
/// nested master page.
final _ActionBuilder? actionBuilder;
/// Determine where the floating action button will go.
///
/// If null, [FloatingActionButtonLocation.endTop] is used.
///
/// Also see [Scaffold.floatingActionButtonLocation].
final FloatingActionButtonLocation? floatingActionButtonLocation;
/// Determine where the floating action button will go on the master page.
///
/// See [Scaffold.floatingActionButtonLocation].
final FloatingActionButtonLocation? floatingActionButtonMasterPageLocation;
/// Forces display mode and style. /// Forces display mode and style.
final _LayoutMode displayMode; final _LayoutMode displayMode;
/// Width at which layout changes from nested to lateral.
final double? breakpoint;
@override @override
_MasterDetailFlowState createState() => _MasterDetailFlowState(); _MasterDetailFlowState createState() => _MasterDetailFlowState();
...@@ -1222,7 +1148,7 @@ class _MasterDetailFlowState extends State<_MasterDetailFlow> implements _PageOp ...@@ -1222,7 +1148,7 @@ class _MasterDetailFlowState extends State<_MasterDetailFlow> implements _PageOp
case _LayoutMode.auto: case _LayoutMode.auto:
return LayoutBuilder(builder: (BuildContext context, BoxConstraints constraints) { return LayoutBuilder(builder: (BuildContext context, BoxConstraints constraints) {
final double availableWidth = constraints.maxWidth; final double availableWidth = constraints.maxWidth;
if (availableWidth >= (widget.breakpoint ?? _materialWideDisplayThreshold)) { if (availableWidth >= _materialWideDisplayThreshold) {
return _lateralUI(context); return _lateralUI(context);
} else { } else {
return _nestedUI(context); return _nestedUI(context);
...@@ -1275,21 +1201,13 @@ class _MasterDetailFlowState extends State<_MasterDetailFlow> implements _PageOp ...@@ -1275,21 +1201,13 @@ class _MasterDetailFlowState extends State<_MasterDetailFlow> implements _PageOp
MaterialPageRoute<void> _masterPageRoute(BuildContext context) { MaterialPageRoute<void> _masterPageRoute(BuildContext context) {
return MaterialPageRoute<dynamic>( return MaterialPageRoute<dynamic>(
builder: (BuildContext c) => BlockSemantics( builder: (BuildContext c) => BlockSemantics(
child: widget.masterPageBuilder != null child: _MasterPage(
? widget.masterPageBuilder!(c, false) leading: widget.automaticallyImplyLeading && Navigator.of(context).canPop()
: _MasterPage(
leading: widget.leading ??
(widget.automaticallyImplyLeading && Navigator.of(context).canPop()
? BackButton(onPressed: () => Navigator.of(context).pop()) ? BackButton(onPressed: () => Navigator.of(context).pop())
: null), : null,
title: widget.title, title: widget.title,
centerTitle: widget.centerTitle,
flexibleSpace: widget.flexibleSpace,
automaticallyImplyLeading: widget.automaticallyImplyLeading, automaticallyImplyLeading: widget.automaticallyImplyLeading,
floatingActionButton: widget.floatingActionButton,
floatingActionButtonLocation: widget.floatingActionButtonMasterPageLocation,
masterViewBuilder: widget.masterViewBuilder, masterViewBuilder: widget.masterViewBuilder,
actionBuilder: widget.actionBuilder,
), ),
), ),
); );
...@@ -1312,19 +1230,13 @@ class _MasterDetailFlowState extends State<_MasterDetailFlow> implements _PageOp ...@@ -1312,19 +1230,13 @@ class _MasterDetailFlowState extends State<_MasterDetailFlow> implements _PageOp
Widget _lateralUI(BuildContext context) { Widget _lateralUI(BuildContext context) {
_builtLayout = _LayoutMode.lateral; _builtLayout = _LayoutMode.lateral;
return _MasterDetailScaffold( return _MasterDetailScaffold(
actionBuilder: widget.actionBuilder ?? (_, __) => const<Widget>[], actionBuilder: (_, __) => const<Widget>[],
automaticallyImplyLeading: widget.automaticallyImplyLeading, automaticallyImplyLeading: widget.automaticallyImplyLeading,
centerTitle: widget.centerTitle,
detailPageBuilder: (BuildContext context, Object? args, ScrollController? scrollController) => detailPageBuilder: (BuildContext context, Object? args, ScrollController? scrollController) =>
widget.detailPageBuilder(context, args ?? _cachedDetailArguments, scrollController), widget.detailPageBuilder(context, args ?? _cachedDetailArguments, scrollController),
floatingActionButton: widget.floatingActionButton,
detailPageFABlessGutterWidth: widget.detailPageFABlessGutterWidth, detailPageFABlessGutterWidth: widget.detailPageFABlessGutterWidth,
detailPageFABGutterWidth: widget.detailPageFABGutterWidth,
floatingActionButtonLocation: widget.floatingActionButtonLocation,
initialArguments: _cachedDetailArguments, initialArguments: _cachedDetailArguments,
leading: widget.leading,
masterViewBuilder: (BuildContext context, bool isLateral) => widget.masterViewBuilder(context, isLateral), masterViewBuilder: (BuildContext context, bool isLateral) => widget.masterViewBuilder(context, isLateral),
masterViewWidth: widget.masterViewWidth,
title: widget.title, title: widget.title,
); );
} }
...@@ -1335,11 +1247,6 @@ class _MasterPage extends StatelessWidget { ...@@ -1335,11 +1247,6 @@ class _MasterPage extends StatelessWidget {
Key? key, Key? key,
this.leading, this.leading,
this.title, this.title,
this.actionBuilder,
this.centerTitle,
this.flexibleSpace,
this.floatingActionButton,
this.floatingActionButtonLocation,
this.masterViewBuilder, this.masterViewBuilder,
required this.automaticallyImplyLeading, required this.automaticallyImplyLeading,
}) : super(key: key); }) : super(key: key);
...@@ -1348,11 +1255,6 @@ class _MasterPage extends StatelessWidget { ...@@ -1348,11 +1255,6 @@ class _MasterPage extends StatelessWidget {
final Widget? title; final Widget? title;
final Widget? leading; final Widget? leading;
final bool automaticallyImplyLeading; final bool automaticallyImplyLeading;
final bool? centerTitle;
final Widget? flexibleSpace;
final _ActionBuilder? actionBuilder;
final FloatingActionButton? floatingActionButton;
final FloatingActionButtonLocation? floatingActionButtonLocation;
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
...@@ -1360,16 +1262,10 @@ class _MasterPage extends StatelessWidget { ...@@ -1360,16 +1262,10 @@ class _MasterPage extends StatelessWidget {
appBar: AppBar( appBar: AppBar(
title: title, title: title,
leading: leading, leading: leading,
actions: actionBuilder == null actions: const <Widget>[],
? const <Widget>[]
: actionBuilder!(context, _ActionLevel.composite),
centerTitle: centerTitle,
flexibleSpace: flexibleSpace,
automaticallyImplyLeading: automaticallyImplyLeading, automaticallyImplyLeading: automaticallyImplyLeading,
), ),
body: masterViewBuilder!(context, false), body: masterViewBuilder!(context, false),
floatingActionButton: floatingActionButton,
floatingActionButtonLocation: floatingActionButtonLocation,
); );
} }
...@@ -1386,16 +1282,10 @@ class _MasterDetailScaffold extends StatefulWidget { ...@@ -1386,16 +1282,10 @@ class _MasterDetailScaffold extends StatefulWidget {
required this.detailPageBuilder, required this.detailPageBuilder,
required this.masterViewBuilder, required this.masterViewBuilder,
this.actionBuilder, this.actionBuilder,
this.floatingActionButton,
this.floatingActionButtonLocation,
this.initialArguments, this.initialArguments,
this.leading,
this.title, this.title,
required this.automaticallyImplyLeading, required this.automaticallyImplyLeading,
this.centerTitle,
this.detailPageFABlessGutterWidth, this.detailPageFABlessGutterWidth,
this.detailPageFABGutterWidth,
this.masterViewWidth,
}) : assert(detailPageBuilder != null), }) : assert(detailPageBuilder != null),
assert(masterViewBuilder != null), assert(masterViewBuilder != null),
super(key: key); super(key: key);
...@@ -1409,16 +1299,10 @@ class _MasterDetailScaffold extends StatefulWidget { ...@@ -1409,16 +1299,10 @@ class _MasterDetailScaffold extends StatefulWidget {
/// lateral page is scrollable. /// lateral page is scrollable.
final _DetailPageBuilder detailPageBuilder; final _DetailPageBuilder detailPageBuilder;
final _ActionBuilder? actionBuilder; final _ActionBuilder? actionBuilder;
final FloatingActionButton? floatingActionButton;
final FloatingActionButtonLocation? floatingActionButtonLocation;
final Object? initialArguments; final Object? initialArguments;
final Widget? leading;
final Widget? title; final Widget? title;
final bool automaticallyImplyLeading; final bool automaticallyImplyLeading;
final bool? centerTitle;
final double? detailPageFABlessGutterWidth; final double? detailPageFABlessGutterWidth;
final double? detailPageFABGutterWidth;
final double? masterViewWidth;
@override @override
_MasterDetailScaffoldState createState() => _MasterDetailScaffoldState(); _MasterDetailScaffoldState createState() => _MasterDetailScaffoldState();
...@@ -1437,9 +1321,9 @@ class _MasterDetailScaffoldState extends State<_MasterDetailScaffold> ...@@ -1437,9 +1321,9 @@ class _MasterDetailScaffoldState extends State<_MasterDetailScaffold>
void initState() { void initState() {
super.initState(); super.initState();
detailPageFABlessGutterWidth = widget.detailPageFABlessGutterWidth ?? _kDetailPageFABlessGutterWidth; detailPageFABlessGutterWidth = widget.detailPageFABlessGutterWidth ?? _kDetailPageFABlessGutterWidth;
detailPageFABGutterWidth = widget.detailPageFABGutterWidth ?? _kDetailPageFABGutterWidth; detailPageFABGutterWidth = _kDetailPageFABGutterWidth;
masterViewWidth = widget.masterViewWidth ?? _kMasterViewWidth; masterViewWidth = _kMasterViewWidth;
floatingActionButtonLocation = widget.floatingActionButtonLocation ?? FloatingActionButtonLocation.endTop; floatingActionButtonLocation = FloatingActionButtonLocation.endTop;
} }
@override @override
...@@ -1465,9 +1349,7 @@ class _MasterDetailScaffoldState extends State<_MasterDetailScaffold> ...@@ -1465,9 +1349,7 @@ class _MasterDetailScaffoldState extends State<_MasterDetailScaffold>
appBar: AppBar( appBar: AppBar(
title: widget.title, title: widget.title,
actions: widget.actionBuilder!(context, _ActionLevel.top), actions: widget.actionBuilder!(context, _ActionLevel.top),
leading: widget.leading,
automaticallyImplyLeading: widget.automaticallyImplyLeading, automaticallyImplyLeading: widget.automaticallyImplyLeading,
centerTitle: widget.centerTitle,
bottom: PreferredSize( bottom: PreferredSize(
preferredSize: const Size.fromHeight(kToolbarHeight), preferredSize: const Size.fromHeight(kToolbarHeight),
child: Row( child: Row(
...@@ -1492,16 +1374,13 @@ class _MasterDetailScaffoldState extends State<_MasterDetailScaffold> ...@@ -1492,16 +1374,13 @@ class _MasterDetailScaffoldState extends State<_MasterDetailScaffold>
), ),
), ),
body: _masterPanel(context), body: _masterPanel(context),
floatingActionButton: widget.floatingActionButton,
), ),
// Detail view stacked above main scaffold and master view. // Detail view stacked above main scaffold and master view.
SafeArea( SafeArea(
child: Padding( child: Padding(
padding: EdgeInsetsDirectional.only( padding: EdgeInsetsDirectional.only(
start: masterViewWidth - _kCardElevation, start: masterViewWidth - _kCardElevation,
end: widget.floatingActionButton == null end: detailPageFABlessGutterWidth,
? detailPageFABlessGutterWidth
: detailPageFABGutterWidth,
), ),
child: ValueListenableBuilder<Object?>( child: ValueListenableBuilder<Object?>(
valueListenable: _detailArguments, valueListenable: _detailArguments,
...@@ -1541,9 +1420,7 @@ class _MasterDetailScaffoldState extends State<_MasterDetailScaffold> ...@@ -1541,9 +1420,7 @@ class _MasterDetailScaffoldState extends State<_MasterDetailScaffold>
appBar: AppBar( appBar: AppBar(
title: widget.title, title: widget.title,
actions: widget.actionBuilder!(context, _ActionLevel.top), actions: widget.actionBuilder!(context, _ActionLevel.top),
leading: widget.leading,
automaticallyImplyLeading: widget.automaticallyImplyLeading, automaticallyImplyLeading: widget.automaticallyImplyLeading,
centerTitle: widget.centerTitle,
), ),
body: widget.masterViewBuilder(context, true), body: widget.masterViewBuilder(context, true),
) )
......
...@@ -236,7 +236,6 @@ class _DesktopTextSelectionToolbar extends StatelessWidget { ...@@ -236,7 +236,6 @@ class _DesktopTextSelectionToolbar extends StatelessWidget {
Key? key, Key? key,
required this.anchor, required this.anchor,
required this.children, required this.children,
this.toolbarBuilder = _defaultToolbarBuilder,
}) : assert(children.length > 0), }) : assert(children.length > 0),
super(key: key); super(key: key);
...@@ -251,12 +250,6 @@ class _DesktopTextSelectionToolbar extends StatelessWidget { ...@@ -251,12 +250,6 @@ class _DesktopTextSelectionToolbar extends StatelessWidget {
/// Material-style desktop text selection toolbar text button. /// Material-style desktop text selection toolbar text button.
final List<Widget> children; final List<Widget> children;
/// {@macro flutter.material.TextSelectionToolbar.toolbarBuilder}
///
/// The given anchor and isAbove can be used to position an arrow, as in the
/// default toolbar.
final ToolbarBuilder toolbarBuilder;
// Builds a desktop toolbar in the Material style. // Builds a desktop toolbar in the Material style.
static Widget _defaultToolbarBuilder(BuildContext context, Widget child) { static Widget _defaultToolbarBuilder(BuildContext context, Widget child) {
return SizedBox( return SizedBox(
...@@ -290,7 +283,7 @@ class _DesktopTextSelectionToolbar extends StatelessWidget { ...@@ -290,7 +283,7 @@ class _DesktopTextSelectionToolbar extends StatelessWidget {
delegate: DesktopTextSelectionToolbarLayoutDelegate( delegate: DesktopTextSelectionToolbarLayoutDelegate(
anchor: anchor - localAdjustment, anchor: anchor - localAdjustment,
), ),
child: toolbarBuilder(context, Column( child: _defaultToolbarBuilder(context, Column(
mainAxisSize: MainAxisSize.min, mainAxisSize: MainAxisSize.min,
children: children, children: children,
)), )),
......
...@@ -145,7 +145,6 @@ class _BorderContainer extends StatefulWidget { ...@@ -145,7 +145,6 @@ class _BorderContainer extends StatefulWidget {
required this.fillColor, required this.fillColor,
required this.hoverColor, required this.hoverColor,
required this.isHovering, required this.isHovering,
this.child,
}) : assert(border != null), }) : assert(border != null),
assert(gap != null), assert(gap != null),
assert(fillColor != null), assert(fillColor != null),
...@@ -157,7 +156,6 @@ class _BorderContainer extends StatefulWidget { ...@@ -157,7 +156,6 @@ class _BorderContainer extends StatefulWidget {
final Color fillColor; final Color fillColor;
final Color hoverColor; final Color hoverColor;
final bool isHovering; final bool isHovering;
final Widget? child;
@override @override
_BorderContainerState createState() => _BorderContainerState(); _BorderContainerState createState() => _BorderContainerState();
...@@ -249,7 +247,6 @@ class _BorderContainerState extends State<_BorderContainer> with TickerProviderS ...@@ -249,7 +247,6 @@ class _BorderContainerState extends State<_BorderContainer> with TickerProviderS
hoverColorTween: _hoverColorTween, hoverColorTween: _hoverColorTween,
hoverAnimation: _hoverAnimation, hoverAnimation: _hoverAnimation,
), ),
child: widget.child,
); );
} }
} }
......
...@@ -151,14 +151,13 @@ class _AnimationTuple { ...@@ -151,14 +151,13 @@ class _AnimationTuple {
required this.startAnimation, required this.startAnimation,
required this.endAnimation, required this.endAnimation,
required this.gapAnimation, required this.gapAnimation,
this.gapStart = 0.0,
}); });
final AnimationController controller; final AnimationController controller;
final CurvedAnimation startAnimation; final CurvedAnimation startAnimation;
final CurvedAnimation endAnimation; final CurvedAnimation endAnimation;
final CurvedAnimation gapAnimation; final CurvedAnimation gapAnimation;
double gapStart; double gapStart = 0.0;
} }
class _MergeableMaterialState extends State<MergeableMaterial> with TickerProviderStateMixin { class _MergeableMaterialState extends State<MergeableMaterial> with TickerProviderStateMixin {
......
...@@ -898,18 +898,10 @@ class _ClampTextScaleFactor extends StatelessWidget { ...@@ -898,18 +898,10 @@ class _ClampTextScaleFactor extends StatelessWidget {
/// surrounding [child]. /// surrounding [child].
const _ClampTextScaleFactor({ const _ClampTextScaleFactor({
Key? key, Key? key,
this.lowerLimit = 0,
this.upperLimit = double.infinity, this.upperLimit = double.infinity,
required this.child, required this.child,
}) : super(key: key); }) : super(key: key);
/// The minimum amount that the text scale factor should be for the [child]
/// widget.
///
/// If this is `.5`, the textScaleFactor for child widgets will never be
/// smaller than `.5`.
final double lowerLimit;
/// The maximum amount that the text scale factor should be for the [child] /// The maximum amount that the text scale factor should be for the [child]
/// widget. /// widget.
/// ///
...@@ -926,7 +918,7 @@ class _ClampTextScaleFactor extends StatelessWidget { ...@@ -926,7 +918,7 @@ class _ClampTextScaleFactor extends StatelessWidget {
return MediaQuery( return MediaQuery(
data: MediaQuery.of(context).copyWith( data: MediaQuery.of(context).copyWith(
textScaleFactor: MediaQuery.of(context).textScaleFactor.clamp( textScaleFactor: MediaQuery.of(context).textScaleFactor.clamp(
lowerLimit, 0.0,
upperLimit, upperLimit,
), ),
), ),
......
...@@ -2869,6 +2869,7 @@ class _Location { ...@@ -2869,6 +2869,7 @@ class _Location {
required this.file, required this.file,
required this.line, required this.line,
required this.column, required this.column,
// ignore: unused_element
this.name, this.name,
}); });
......
...@@ -1020,14 +1020,6 @@ class _TestSearchDelegate extends SearchDelegate<String> { ...@@ -1020,14 +1020,6 @@ class _TestSearchDelegate extends SearchDelegate<String> {
} }
class _TestEmptySearchDelegate extends SearchDelegate<String> { class _TestEmptySearchDelegate extends SearchDelegate<String> {
_TestEmptySearchDelegate({
this.suggestions = 'Suggestions',
this.result = 'Result',
}) : super();
final String suggestions;
final String result;
@override @override
Widget? buildLeading(BuildContext context) => null; Widget? buildLeading(BuildContext context) => null;
...@@ -1040,7 +1032,7 @@ class _TestEmptySearchDelegate extends SearchDelegate<String> { ...@@ -1040,7 +1032,7 @@ class _TestEmptySearchDelegate extends SearchDelegate<String> {
onPressed: () { onPressed: () {
showResults(context); showResults(context);
}, },
child: Text(suggestions), child: const Text('Suggestions'),
); );
} }
...@@ -1057,7 +1049,7 @@ class _TestEmptySearchDelegate extends SearchDelegate<String> { ...@@ -1057,7 +1049,7 @@ class _TestEmptySearchDelegate extends SearchDelegate<String> {
tooltip: 'Close', tooltip: 'Close',
icon: const Icon(Icons.arrow_back), icon: const Icon(Icons.arrow_back),
onPressed: () { onPressed: () {
close(context, result); close(context, 'Result');
}, },
), ),
); );
......
...@@ -186,10 +186,9 @@ class TestRecordingPaintingContext extends ClipContext implements PaintingContex ...@@ -186,10 +186,9 @@ class TestRecordingPaintingContext extends ClipContext implements PaintingContex
} }
class _MethodCall implements Invocation { class _MethodCall implements Invocation {
_MethodCall(this._name, [ this._arguments = const <dynamic>[], this._typeArguments = const <Type> []]); _MethodCall(this._name, [ this._arguments = const <dynamic>[]]);
final Symbol _name; final Symbol _name;
final List<dynamic> _arguments; final List<dynamic> _arguments;
final List<Type> _typeArguments;
@override @override
bool get isAccessor => false; bool get isAccessor => false;
@override @override
...@@ -205,7 +204,7 @@ class _MethodCall implements Invocation { ...@@ -205,7 +204,7 @@ class _MethodCall implements Invocation {
@override @override
List<dynamic> get positionalArguments => _arguments; List<dynamic> get positionalArguments => _arguments;
@override @override
List<Type> get typeArguments => _typeArguments; List<Type> get typeArguments => const <Type> [];
} }
String _valueName(Object? value) { String _valueName(Object? value) {
......
...@@ -21,13 +21,11 @@ class _TestSliverPersistentHeaderDelegate extends SliverPersistentHeaderDelegate ...@@ -21,13 +21,11 @@ class _TestSliverPersistentHeaderDelegate extends SliverPersistentHeaderDelegate
this.key, this.key,
required this.minExtent, required this.minExtent,
required this.maxExtent, required this.maxExtent,
this.child,
this.vsync = const TestVSync(), this.vsync = const TestVSync(),
this.showOnScreenConfiguration = const PersistentHeaderShowOnScreenConfiguration(), this.showOnScreenConfiguration = const PersistentHeaderShowOnScreenConfiguration(),
}); });
final Key? key; final Key? key;
final Widget? child;
@override @override
final double maxExtent; final double maxExtent;
...@@ -42,7 +40,7 @@ class _TestSliverPersistentHeaderDelegate extends SliverPersistentHeaderDelegate ...@@ -42,7 +40,7 @@ class _TestSliverPersistentHeaderDelegate extends SliverPersistentHeaderDelegate
final PersistentHeaderShowOnScreenConfiguration showOnScreenConfiguration; final PersistentHeaderShowOnScreenConfiguration showOnScreenConfiguration;
@override @override
Widget build(BuildContext context, double shrinkOffset, bool overlapsContent) => child ?? SizedBox.expand(key: key); Widget build(BuildContext context, double shrinkOffset, bool overlapsContent) => SizedBox.expand(key: key);
@override @override
bool shouldRebuild(_TestSliverPersistentHeaderDelegate oldDelegate) => true; bool shouldRebuild(_TestSliverPersistentHeaderDelegate oldDelegate) => true;
......
...@@ -14,7 +14,6 @@ class _TestSliverPersistentHeaderDelegate extends SliverPersistentHeaderDelegate ...@@ -14,7 +14,6 @@ class _TestSliverPersistentHeaderDelegate extends SliverPersistentHeaderDelegate
required this.maxExtent, required this.maxExtent,
required this.child, required this.child,
this.vsync = const TestVSync(), this.vsync = const TestVSync(),
this.showOnScreenConfiguration = const PersistentHeaderShowOnScreenConfiguration(),
}); });
final Widget child; final Widget child;
...@@ -29,7 +28,7 @@ class _TestSliverPersistentHeaderDelegate extends SliverPersistentHeaderDelegate ...@@ -29,7 +28,7 @@ class _TestSliverPersistentHeaderDelegate extends SliverPersistentHeaderDelegate
final TickerProvider? vsync; final TickerProvider? vsync;
@override @override
final PersistentHeaderShowOnScreenConfiguration showOnScreenConfiguration; final PersistentHeaderShowOnScreenConfiguration showOnScreenConfiguration = const PersistentHeaderShowOnScreenConfiguration();
@override @override
Widget build(BuildContext context, double shrinkOffset, bool overlapsContent) => child; Widget build(BuildContext context, double shrinkOffset, bool overlapsContent) => child;
......
...@@ -72,8 +72,6 @@ Future<void> testImageQuality(WidgetTester tester, ui.FilterQuality? quality) as ...@@ -72,8 +72,6 @@ Future<void> testImageQuality(WidgetTester tester, ui.FilterQuality? quality) as
} }
class _TestImageStreamCompleter extends ImageStreamCompleter { class _TestImageStreamCompleter extends ImageStreamCompleter {
_TestImageStreamCompleter([this._currentImage]);
ImageInfo? _currentImage; ImageInfo? _currentImage;
final Set<ImageStreamListener> listeners = <ImageStreamListener>{}; final Set<ImageStreamListener> listeners = <ImageStreamListener>{};
......
...@@ -201,12 +201,10 @@ class _Diagonal extends RenderObjectWidget with SlottedMultiChildRenderObjectWid ...@@ -201,12 +201,10 @@ class _Diagonal extends RenderObjectWidget with SlottedMultiChildRenderObjectWid
Key? key, Key? key,
this.topLeft, this.topLeft,
this.bottomRight, this.bottomRight,
this.backgroundColor,
}) : super(key: key); }) : super(key: key);
final Widget? topLeft; final Widget? topLeft;
final Widget? bottomRight; final Widget? bottomRight;
final Color? backgroundColor;
@override @override
Iterable<_DiagonalSlot> get slots => _DiagonalSlot.values; Iterable<_DiagonalSlot> get slots => _DiagonalSlot.values;
......
...@@ -258,9 +258,7 @@ class _TickingWidgetState extends State<_TickingWidget> with SingleTickerProvide ...@@ -258,9 +258,7 @@ class _TickingWidgetState extends State<_TickingWidget> with SingleTickerProvide
} }
class _MultiTickingWidget extends StatefulWidget { class _MultiTickingWidget extends StatefulWidget {
const _MultiTickingWidget({Key? key, this.onTick}) : super(key: key); const _MultiTickingWidget({Key? key}) : super(key: key);
final VoidCallback? onTick;
@override @override
State<_MultiTickingWidget> createState() => _MultiTickingWidgetState(); State<_MultiTickingWidget> createState() => _MultiTickingWidgetState();
...@@ -274,7 +272,6 @@ class _MultiTickingWidgetState extends State<_MultiTickingWidget> with TickerPro ...@@ -274,7 +272,6 @@ class _MultiTickingWidgetState extends State<_MultiTickingWidget> with TickerPro
void initState() { void initState() {
super.initState(); super.initState();
ticker = createTicker((Duration _) { ticker = createTicker((Duration _) {
widget.onTick?.call();
})..start(); })..start();
} }
......
...@@ -809,11 +809,9 @@ class _SingleTickerTestState extends State<_SingleTickerTest> with SingleTickerP ...@@ -809,11 +809,9 @@ class _SingleTickerTestState extends State<_SingleTickerTest> with SingleTickerP
class _AlwaysAnimating extends StatefulWidget { class _AlwaysAnimating extends StatefulWidget {
const _AlwaysAnimating({ const _AlwaysAnimating({
this.child,
required this.onPaint, required this.onPaint,
}); });
final Widget? child;
final VoidCallback onPaint; final VoidCallback onPaint;
@override @override
...@@ -846,7 +844,6 @@ class _AlwaysAnimatingState extends State<_AlwaysAnimating> with SingleTickerPro ...@@ -846,7 +844,6 @@ class _AlwaysAnimatingState extends State<_AlwaysAnimating> with SingleTickerPro
builder: (BuildContext context, Widget? child) { builder: (BuildContext context, Widget? child) {
return CustomPaint( return CustomPaint(
painter: _AlwaysRepaint(widget.onPaint), painter: _AlwaysRepaint(widget.onPaint),
child: widget.child,
); );
}, },
); );
......
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