Unverified Commit fd12db07 authored by Denis Grafov's avatar Denis Grafov Committed by GitHub

Replace all BorderRadius.circular with const BorderRadius.all (#91239)

parent f25b833f
......@@ -1157,7 +1157,7 @@ class _ContextMenuSheet extends StatelessWidget {
flex: 2,
child: IntrinsicHeight(
child: ClipRRect(
borderRadius: BorderRadius.circular(13.0),
borderRadius: const BorderRadius.all(Radius.circular(13.0)),
child: Column(
crossAxisAlignment: CrossAxisAlignment.stretch,
children: actions,
......
......@@ -458,7 +458,7 @@ class CupertinoPopupSurface extends StatelessWidget {
@override
Widget build(BuildContext context) {
return ClipRRect(
borderRadius: BorderRadius.circular(_kCornerRadius),
borderRadius: const BorderRadius.all(Radius.circular(_kCornerRadius)),
child: BackdropFilter(
filter: ImageFilter.blur(sigmaX: _kBlurAmount, sigmaY: _kBlurAmount),
child: Container(
......@@ -686,7 +686,7 @@ class CupertinoActionSheet extends StatelessWidget {
final List<Widget> children = <Widget>[
Flexible(child: ClipRRect(
borderRadius: BorderRadius.circular(12.0),
borderRadius: const BorderRadius.all(Radius.circular(12.0)),
child: BackdropFilter(
filter: ImageFilter.blur(sigmaX: _kBlurAmount, sigmaY: _kBlurAmount),
child: _CupertinoDialogRenderWidget(
......@@ -858,7 +858,7 @@ class _CupertinoActionSheetCancelButtonState extends State<_CupertinoActionSheet
child: Container(
decoration: BoxDecoration(
color: CupertinoDynamicColor.resolve(backgroundColor, context),
borderRadius: BorderRadius.circular(_kCornerRadius),
borderRadius: const BorderRadius.all(Radius.circular(_kCornerRadius)),
),
child: widget.child,
),
......
......@@ -576,7 +576,7 @@ class _NavigationIndicator extends StatelessWidget {
width: 64.0,
height: 32.0,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(16.0),
borderRadius: const BorderRadius.all(Radius.circular(16.0)),
color: color ?? colorScheme.secondary.withOpacity(.24),
),
),
......
......@@ -528,7 +528,7 @@ class _SnackBarState extends State<SnackBar> {
final Color backgroundColor = widget.backgroundColor ?? snackBarTheme.backgroundColor ?? inverseTheme.colorScheme.background;
final ShapeBorder? shape = widget.shape
?? snackBarTheme.shape
?? (isFloatingSnackBar ? RoundedRectangleBorder(borderRadius: BorderRadius.circular(4.0)) : null);
?? (isFloatingSnackBar ? const RoundedRectangleBorder(borderRadius: BorderRadius.all(Radius.circular(4.0))) : null);
snackBar = Material(
shape: shape,
......
......@@ -28,7 +28,7 @@ void main() {
expect(
decoration.borderRadius,
BorderRadius.circular(9),
const BorderRadius.all(Radius.circular(9)),
);
},
);
......
......@@ -500,7 +500,7 @@ void main() {
expect(
decoration.borderRadius,
BorderRadius.circular(5),
const BorderRadius.all(Radius.circular(5)),
);
expect(
decoration.border!.bottom.color.value,
......@@ -526,7 +526,7 @@ void main() {
expect(
decoration.borderRadius,
BorderRadius.circular(5),
const BorderRadius.all(Radius.circular(5)),
);
expect(
decoration.border!.bottom.color.value,
......
......@@ -57,14 +57,14 @@ void main() {
onPressed: () { },
),
floatingActionButtonLocation: location,
bottomNavigationBar: BottomAppBar(
bottomNavigationBar: const BottomAppBar(
shape: AutomaticNotchedShape(
BeveledRectangleBorder(borderRadius: BorderRadius.circular(50.0)),
ContinuousRectangleBorder(borderRadius: BorderRadius.circular(30.0)),
BeveledRectangleBorder(borderRadius: BorderRadius.all(Radius.circular(50.0))),
ContinuousRectangleBorder(borderRadius: BorderRadius.all(Radius.circular(30.0))),
),
notchMargin: 10.0,
color: Colors.green,
child: const SizedBox(height: 100.0),
child: SizedBox(height: 100.0),
),
),
),
......
......@@ -527,7 +527,7 @@ void main() {
final GlobalKey<ScaffoldState> scaffoldKey = GlobalKey<ScaffoldState>();
const Color color = Colors.pink;
const double elevation = 9.0;
final ShapeBorder shape = BeveledRectangleBorder(borderRadius: BorderRadius.circular(12));
const ShapeBorder shape = BeveledRectangleBorder(borderRadius: BorderRadius.all(Radius.circular(12)));
const Clip clipBehavior = Clip.antiAlias;
const Color barrierColor = Colors.red;
......
......@@ -35,12 +35,12 @@ void main() {
testWidgets('BottomSheetThemeData implements debugFillProperties', (WidgetTester tester) async {
final DiagnosticPropertiesBuilder builder = DiagnosticPropertiesBuilder();
BottomSheetThemeData(
backgroundColor: const Color(0xFFFFFFFF),
const BottomSheetThemeData(
backgroundColor: Color(0xFFFFFFFF),
elevation: 2.0,
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(2.0)),
shape: RoundedRectangleBorder(borderRadius: BorderRadius.all(Radius.circular(2.0))),
clipBehavior: Clip.antiAlias,
constraints: const BoxConstraints(minWidth: 200, maxWidth: 640),
constraints: BoxConstraints(minWidth: 200, maxWidth: 640),
).debugFillProperties(builder);
final List<String> description = builder.properties
......@@ -329,10 +329,10 @@ Widget bottomSheetWithElevations(BottomSheetThemeData bottomSheetTheme) {
}
BottomSheetThemeData _bottomSheetTheme() {
return BottomSheetThemeData(
return const BottomSheetThemeData(
backgroundColor: Colors.orange,
elevation: 12.0,
shape: BeveledRectangleBorder(borderRadius: BorderRadius.circular(12)),
shape: BeveledRectangleBorder(borderRadius: BorderRadius.all(Radius.circular(12))),
clipBehavior: Clip.antiAlias,
);
}
......@@ -890,8 +890,8 @@ void main() {
});
testWidgets('Checkbox respects shape and side', (WidgetTester tester) async {
final RoundedRectangleBorder roundedRectangleBorder =
RoundedRectangleBorder(borderRadius: BorderRadius.circular(5));
const RoundedRectangleBorder roundedRectangleBorder =
RoundedRectangleBorder(borderRadius: BorderRadius.all(Radius.circular(5)));
const BorderSide side = BorderSide(
width: 4,
......
......@@ -26,11 +26,11 @@ void main() {
testWidgets('Custom debugFillProperties', (WidgetTester tester) async {
final DiagnosticPropertiesBuilder builder = DiagnosticPropertiesBuilder();
DrawerThemeData(
backgroundColor: const Color(0x00000099),
scrimColor: const Color(0x00000098),
const DrawerThemeData(
backgroundColor: Color(0x00000099),
scrimColor: Color(0x00000098),
elevation: 5.0,
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(2.0)),
shape: RoundedRectangleBorder(borderRadius: BorderRadius.all(Radius.circular(2.0))),
).debugFillProperties(builder);
final List<String> description = builder.properties
......
......@@ -41,7 +41,7 @@ void main() {
expect(material.color, colorScheme.primary);
expect(material.elevation, 2);
expect(material.shadowColor, const Color(0xff000000));
expect(material.shape, RoundedRectangleBorder(borderRadius: BorderRadius.circular(4)));
expect(material.shape, const RoundedRectangleBorder(borderRadius: BorderRadius.all(Radius.circular(4))));
expect(material.textStyle!.color, colorScheme.onPrimary);
expect(material.textStyle!.fontFamily, 'Roboto');
expect(material.textStyle!.fontSize, 14);
......@@ -67,7 +67,7 @@ void main() {
expect(material.color, colorScheme.primary);
expect(material.elevation, 8);
expect(material.shadowColor, const Color(0xff000000));
expect(material.shape, RoundedRectangleBorder(borderRadius: BorderRadius.circular(4)));
expect(material.shape, const RoundedRectangleBorder(borderRadius: BorderRadius.all(Radius.circular(4))));
expect(material.textStyle!.color, colorScheme.onPrimary);
expect(material.textStyle!.fontFamily, 'Roboto');
expect(material.textStyle!.fontSize, 14);
......@@ -106,7 +106,7 @@ void main() {
expect(material.color, colorScheme.primary);
expect(material.elevation, 2);
expect(material.shadowColor, const Color(0xff000000));
expect(material.shape, RoundedRectangleBorder(borderRadius: BorderRadius.circular(4)));
expect(material.shape, const RoundedRectangleBorder(borderRadius: BorderRadius.all(Radius.circular(4))));
expect(material.textStyle!.color, colorScheme.onPrimary);
expect(material.textStyle!.fontFamily, 'Roboto');
expect(material.textStyle!.fontSize, 14);
......@@ -137,7 +137,7 @@ void main() {
expect(material.color, colorScheme.onSurface.withOpacity(0.12));
expect(material.elevation, 0.0);
expect(material.shadowColor, const Color(0xff000000));
expect(material.shape, RoundedRectangleBorder(borderRadius: BorderRadius.circular(4)));
expect(material.shape, const RoundedRectangleBorder(borderRadius: BorderRadius.all(Radius.circular(4))));
expect(material.textStyle!.color, colorScheme.onSurface.withOpacity(0.38));
expect(material.textStyle!.fontFamily, 'Roboto');
expect(material.textStyle!.fontSize, 14);
......@@ -1203,9 +1203,9 @@ void main() {
home: Center(
child: ElevatedButton(
style: ElevatedButton.styleFrom(
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(16),
side: const BorderSide(width: 4, color: borderColor),
shape: const RoundedRectangleBorder(
borderRadius: BorderRadius.all(Radius.circular(16)),
side: BorderSide(width: 4, color: borderColor),
),
),
onPressed: () { },
......
......@@ -33,7 +33,7 @@ void main() {
expect(material.color, colorScheme.primary);
expect(material.elevation, 2);
expect(material.shadowColor, const Color(0xff000000));
expect(material.shape, RoundedRectangleBorder(borderRadius: BorderRadius.circular(4.0)));
expect(material.shape, const RoundedRectangleBorder(borderRadius: BorderRadius.all(Radius.circular(4.0))));
expect(material.textStyle!.color, colorScheme.onPrimary);
expect(material.textStyle!.fontFamily, 'Roboto');
expect(material.textStyle!.fontSize, 14);
......
......@@ -35,7 +35,7 @@ void main() {
expect(material.color, null);
expect(material.elevation, 0.0);
expect(material.shadowColor, null);
expect(material.shape, RoundedRectangleBorder(borderRadius: BorderRadius.circular(2.0)));
expect(material.shape, const RoundedRectangleBorder(borderRadius: BorderRadius.all(Radius.circular(2.0))));
expect(material.textStyle!.color, const Color(0xdd000000));
expect(material.textStyle!.fontFamily, 'Roboto');
expect(material.textStyle!.fontSize, 14);
......@@ -55,7 +55,7 @@ void main() {
expect(material.color, null);
expect(material.elevation, 0.0);
expect(material.shadowColor, null);
expect(material.shape, RoundedRectangleBorder(borderRadius: BorderRadius.circular(2.0)));
expect(material.shape, const RoundedRectangleBorder(borderRadius: BorderRadius.all(Radius.circular(2.0))));
expect(material.textStyle!.color, const Color(0xdd000000));
expect(material.textStyle!.fontFamily, 'Roboto');
expect(material.textStyle!.fontSize, 14);
......@@ -80,7 +80,7 @@ void main() {
expect(material.color, null);
expect(material.elevation, 0.0);
expect(material.shadowColor, null);
expect(material.shape, RoundedRectangleBorder(borderRadius: BorderRadius.circular(2.0)));
expect(material.shape, const RoundedRectangleBorder(borderRadius: BorderRadius.all(Radius.circular(2.0))));
expect(material.textStyle!.color, const Color(0x61000000));
expect(material.textStyle!.fontFamily, 'Roboto');
expect(material.textStyle!.fontSize, 14);
......
......@@ -38,7 +38,7 @@ void main() {
testWidgets('The InkWell widget renders an ink splash', (WidgetTester tester) async {
const Color highlightColor = Color(0xAAFF0000);
const Color splashColor = Color(0xAA0000FF);
final BorderRadius borderRadius = BorderRadius.circular(6.0);
const BorderRadius borderRadius = BorderRadius.all(Radius.circular(6.0));
await tester.pumpWidget(
Directionality(
......@@ -87,7 +87,7 @@ void main() {
testWidgets('The InkWell widget renders an ink ripple', (WidgetTester tester) async {
const Color highlightColor = Color(0xAAFF0000);
const Color splashColor = Color(0xB40000FF);
final BorderRadius borderRadius = BorderRadius.circular(6.0);
const BorderRadius borderRadius = BorderRadius.all(Radius.circular(6.0));
await tester.pumpWidget(
Directionality(
......@@ -254,7 +254,7 @@ void main() {
testWidgets('The InkWell widget renders an SelectAction or ActivateAction-induced ink ripple', (WidgetTester tester) async {
const Color highlightColor = Color(0xAAFF0000);
const Color splashColor = Color(0xB40000FF);
final BorderRadius borderRadius = BorderRadius.circular(6.0);
const BorderRadius borderRadius = BorderRadius.all(Radius.circular(6.0));
final FocusNode focusNode = FocusNode(debugLabel: 'Test Node');
Future<void> buildTest(Intent intent) async {
......
......@@ -871,9 +871,9 @@ void main() {
labelText: 'label',
alignLabelWithHint: alignLabelWithHint,
hintText: 'hint',
border: OutlineInputBorder(
borderSide: const BorderSide(width: 1, color: Colors.black, style: BorderStyle.solid),
borderRadius: BorderRadius.circular(0),
border: const OutlineInputBorder(
borderSide: BorderSide(width: 1, color: Colors.black, style: BorderStyle.solid),
borderRadius: BorderRadius.zero,
),
),
),
......@@ -3775,11 +3775,11 @@ void main() {
buildInputDecorator(
// isEmpty: false (default)
// isFocused: false (default)
decoration: InputDecoration(
decoration: const InputDecoration(
filled: true,
fillColor: const Color(0xFF00FF00),
fillColor: Color(0xFF00FF00),
border: OutlineInputBorder(
borderRadius: BorderRadius.circular(12.0),
borderRadius: BorderRadius.all(Radius.circular(12.0)),
),
),
),
......
......@@ -39,7 +39,7 @@ void main() {
expect(material.color, null);
expect(material.elevation, 2.0);
expect(material.shadowColor, null);
expect(material.shape, RoundedRectangleBorder(borderRadius: BorderRadius.circular(2.0)));
expect(material.shape, const RoundedRectangleBorder(borderRadius: BorderRadius.all(Radius.circular(2.0))));
expect(material.textStyle!.color, const Color(0xdd000000));
expect(material.textStyle!.fontFamily, 'Roboto');
expect(material.textStyle!.fontSize, 14);
......@@ -59,7 +59,7 @@ void main() {
expect(material.color, null);
expect(material.elevation, 8.0);
expect(material.shadowColor, null);
expect(material.shape, RoundedRectangleBorder(borderRadius: BorderRadius.circular(2.0)));
expect(material.shape, const RoundedRectangleBorder(borderRadius: BorderRadius.all(Radius.circular(2.0))));
expect(material.textStyle!.color, const Color(0xdd000000));
expect(material.textStyle!.fontFamily, 'Roboto');
expect(material.textStyle!.fontSize, 14);
......@@ -84,7 +84,7 @@ void main() {
expect(material.color, null);
expect(material.elevation, 0.0);
expect(material.shadowColor, null);
expect(material.shape, RoundedRectangleBorder(borderRadius: BorderRadius.circular(2.0)));
expect(material.shape, const RoundedRectangleBorder(borderRadius: BorderRadius.all(Radius.circular(2.0))));
expect(material.textStyle!.color, const Color(0x61000000));
expect(material.textStyle!.fontFamily, 'Roboto');
expect(material.textStyle!.fontSize, 14);
......
......@@ -797,9 +797,9 @@ void main() {
child: Material(
clipBehavior: Clip.hardEdge,
elevation: 0,
shape: RoundedRectangleBorder(
side: const BorderSide(color: Colors.grey, width: 6),
borderRadius: BorderRadius.circular(8),
shape: const RoundedRectangleBorder(
side: BorderSide(color: Colors.grey, width: 6),
borderRadius: BorderRadius.all(Radius.circular(8)),
),
child: Column(
children: <Widget>[
......@@ -836,9 +836,9 @@ void main() {
child: Material(
clipBehavior: Clip.hardEdge,
elevation: 0,
shape: RoundedRectangleBorder(
side: const BorderSide(color: Colors.grey, width: 6),
borderRadius: BorderRadius.circular(8),
shape: const RoundedRectangleBorder(
side: BorderSide(color: Colors.grey, width: 6),
borderRadius: BorderRadius.all(Radius.circular(8)),
),
borderOnForeground: false,
child: Column(
......
......@@ -44,7 +44,7 @@ void main() {
expect(material.shape, isInstanceOf<RoundedRectangleBorder>());
RoundedRectangleBorder materialShape = material.shape! as RoundedRectangleBorder;
expect(materialShape.side, BorderSide(width: 1, color: colorScheme.onSurface.withOpacity(0.12)));
expect(materialShape.borderRadius, BorderRadius.circular(4.0));
expect(materialShape.borderRadius, const BorderRadius.all(Radius.circular(4.0)));
expect(material.textStyle!.color, colorScheme.primary);
expect(material.textStyle!.fontFamily, 'Roboto');
......@@ -77,7 +77,7 @@ void main() {
expect(material.shape, isInstanceOf<RoundedRectangleBorder>());
materialShape = material.shape! as RoundedRectangleBorder;
expect(materialShape.side, BorderSide(width: 1, color: colorScheme.onSurface.withOpacity(0.12)));
expect(materialShape.borderRadius, BorderRadius.circular(4.0));
expect(materialShape.borderRadius, const BorderRadius.all(Radius.circular(4.0)));
expect(material.textStyle!.color, colorScheme.primary);
expect(material.textStyle!.fontFamily, 'Roboto');
......@@ -118,7 +118,7 @@ void main() {
expect(material.shape, isInstanceOf<RoundedRectangleBorder>());
materialShape = material.shape! as RoundedRectangleBorder;
expect(materialShape.side, BorderSide(width: 1, color: colorScheme.onSurface.withOpacity(0.12)));
expect(materialShape.borderRadius, BorderRadius.circular(4.0));
expect(materialShape.borderRadius, const BorderRadius.all(Radius.circular(4.0)));
expect(material.textStyle!.color, colorScheme.primary);
expect(material.textStyle!.fontFamily, 'Roboto');
......@@ -151,7 +151,7 @@ void main() {
expect(material.shape, isInstanceOf<RoundedRectangleBorder>());
materialShape = material.shape! as RoundedRectangleBorder;
expect(materialShape.side, BorderSide(width: 1, color: colorScheme.onSurface.withOpacity(0.12)));
expect(materialShape.borderRadius, BorderRadius.circular(4.0));
expect(materialShape.borderRadius, const BorderRadius.all(Radius.circular(4.0)));
expect(material.textStyle!.color, colorScheme.onSurface.withOpacity(0.38));
expect(material.textStyle!.fontFamily, 'Roboto');
......
......@@ -37,7 +37,7 @@ void main() {
expect(material.shape, isInstanceOf<RoundedRectangleBorder>());
final RoundedRectangleBorder materialShape = material.shape! as RoundedRectangleBorder;
expect(materialShape.side, BorderSide(width: 1, color: colorScheme.onSurface.withOpacity(0.12)));
expect(materialShape.borderRadius, BorderRadius.circular(4.0));
expect(materialShape.borderRadius, const BorderRadius.all(Radius.circular(4.0)));
expect(material.textStyle!.color, colorScheme.primary);
expect(material.textStyle!.fontFamily, 'Roboto');
......
......@@ -505,7 +505,7 @@ void main() {
final GlobalKey<ScaffoldState> scaffoldKey = GlobalKey<ScaffoldState>();
const Color color = Colors.pink;
const double elevation = 9.0;
final ShapeBorder shape = BeveledRectangleBorder(borderRadius: BorderRadius.circular(12));
const ShapeBorder shape = BeveledRectangleBorder(borderRadius: BorderRadius.all(Radius.circular(12)));
const Clip clipBehavior = Clip.antiAlias;
await tester.pumpWidget(MaterialApp(
......
......@@ -7,11 +7,11 @@ import 'package:flutter/rendering.dart';
import 'package:flutter_test/flutter_test.dart';
PopupMenuThemeData _popupMenuTheme() {
return PopupMenuThemeData(
return const PopupMenuThemeData(
color: Colors.orange,
shape: BeveledRectangleBorder(borderRadius: BorderRadius.circular(12)),
shape: BeveledRectangleBorder(borderRadius: BorderRadius.all(Radius.circular(12))),
elevation: 12.0,
textStyle: const TextStyle(color: Color(0xffffffff), textBaseline: TextBaseline.alphabetic),
textStyle: TextStyle(color: Color(0xffffffff), textBaseline: TextBaseline.alphabetic),
);
}
......@@ -43,11 +43,11 @@ void main() {
testWidgets('PopupMenuThemeData implements debugFillProperties', (WidgetTester tester) async {
final DiagnosticPropertiesBuilder builder = DiagnosticPropertiesBuilder();
PopupMenuThemeData(
color: const Color(0xFFFFFFFF),
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(2.0)),
const PopupMenuThemeData(
color: Color(0xFFFFFFFF),
shape: RoundedRectangleBorder(borderRadius: BorderRadius.all(Radius.circular(2.0))),
elevation: 2.0,
textStyle: const TextStyle(color: Color(0xffffffff)),
textStyle: TextStyle(color: Color(0xffffffff)),
).debugFillProperties(builder);
final List<String> description = builder.properties
......@@ -259,11 +259,11 @@ void main() {
child: Column(
children: <Widget>[
PopupMenuTheme(
data: PopupMenuThemeData(
data: const PopupMenuThemeData(
color: Colors.pink,
shape: BeveledRectangleBorder(borderRadius: BorderRadius.circular(10)),
shape: BeveledRectangleBorder(borderRadius: BorderRadius.all(Radius.circular(10))),
elevation: 6.0,
textStyle: const TextStyle(color: Color(0xfffff000), textBaseline: TextBaseline.alphabetic),
textStyle: TextStyle(color: Color(0xfffff000), textBaseline: TextBaseline.alphabetic),
),
child: PopupMenuButton<void>(
key: popupButtonKey,
......@@ -296,7 +296,7 @@ void main() {
).last,
);
expect(button.color, Colors.pink);
expect(button.shape, BeveledRectangleBorder(borderRadius: BorderRadius.circular(10)));
expect(button.shape, const BeveledRectangleBorder(borderRadius: BorderRadius.all(Radius.circular(10))));
expect(button.elevation, 6.0);
/// The last DefaultTextStyle widget under popupItemKey is the
......
......@@ -35,7 +35,7 @@ void main() {
expect(material.color, const Color(0xffe0e0e0));
expect(material.elevation, 2.0);
expect(material.shadowColor, null);
expect(material.shape, RoundedRectangleBorder(borderRadius: BorderRadius.circular(2.0)));
expect(material.shape, const RoundedRectangleBorder(borderRadius: BorderRadius.all(Radius.circular(2.0))));
expect(material.textStyle!.color, const Color(0xdd000000));
expect(material.textStyle!.fontFamily, 'Roboto');
expect(material.textStyle!.fontSize, 14);
......@@ -55,7 +55,7 @@ void main() {
expect(material.color, const Color(0xffe0e0e0));
expect(material.elevation, 8.0);
expect(material.shadowColor, null);
expect(material.shape, RoundedRectangleBorder(borderRadius: BorderRadius.circular(2.0)));
expect(material.shape, const RoundedRectangleBorder(borderRadius: BorderRadius.all(Radius.circular(2.0))));
expect(material.textStyle!.color, const Color(0xdd000000));
expect(material.textStyle!.fontFamily, 'Roboto');
expect(material.textStyle!.fontSize, 14);
......@@ -80,7 +80,7 @@ void main() {
expect(material.color, const Color(0x61000000));
expect(material.elevation, 0.0);
expect(material.shadowColor, null);
expect(material.shape, RoundedRectangleBorder(borderRadius: BorderRadius.circular(2.0)));
expect(material.shape, const RoundedRectangleBorder(borderRadius: BorderRadius.all(Radius.circular(2.0))));
expect(material.textStyle!.color, const Color(0x61000000));
expect(material.textStyle!.fontFamily, 'Roboto');
expect(material.textStyle!.fontSize, 14);
......
......@@ -37,13 +37,13 @@ void main() {
testWidgets('SnackBarThemeData implements debugFillProperties', (WidgetTester tester) async {
final DiagnosticPropertiesBuilder builder = DiagnosticPropertiesBuilder();
SnackBarThemeData(
backgroundColor: const Color(0xFFFFFFFF),
actionTextColor: const Color(0xFF0000AA),
disabledActionTextColor: const Color(0xFF00AA00),
contentTextStyle: const TextStyle(color: Color(0xFF123456)),
const SnackBarThemeData(
backgroundColor: Color(0xFFFFFFFF),
actionTextColor: Color(0xFF0000AA),
disabledActionTextColor: Color(0xFF00AA00),
contentTextStyle: TextStyle(color: Color(0xFF123456)),
elevation: 2.0,
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(2.0)),
shape: RoundedRectangleBorder(borderRadius: BorderRadius.all(Radius.circular(2.0))),
behavior: SnackBarBehavior.floating,
).debugFillProperties(builder);
......@@ -365,12 +365,12 @@ void main() {
}
SnackBarThemeData _snackBarTheme() {
return SnackBarThemeData(
return const SnackBarThemeData(
backgroundColor: Colors.orange,
actionTextColor: Colors.green,
contentTextStyle: const TextStyle(color: Colors.blue),
contentTextStyle: TextStyle(color: Colors.blue),
elevation: 12.0,
shape: BeveledRectangleBorder(borderRadius: BorderRadius.circular(12)),
shape: BeveledRectangleBorder(borderRadius: BorderRadius.all(Radius.circular(12))),
);
}
......
......@@ -304,9 +304,9 @@ void main() {
});
testWidgets('Tab bar theme - beveled rect indicator', (WidgetTester tester) async {
final TabBarTheme tabBarTheme = TabBarTheme(
const TabBarTheme tabBarTheme = TabBarTheme(
indicator: ShapeDecoration(
shape: BeveledRectangleBorder(borderRadius: BorderRadius.circular(20.0)),
shape: BeveledRectangleBorder(borderRadius: BorderRadius.all(Radius.circular(20.0))),
color: Colors.black,
),
);
......
......@@ -40,7 +40,7 @@ void main() {
expect(material.color, Colors.transparent);
expect(material.elevation, 0.0);
expect(material.shadowColor, const Color(0xff000000));
expect(material.shape, RoundedRectangleBorder(borderRadius: BorderRadius.circular(4.0)));
expect(material.shape, const RoundedRectangleBorder(borderRadius: BorderRadius.all(Radius.circular(4.0))));
expect(material.textStyle!.color, colorScheme.primary);
expect(material.textStyle!.fontFamily, 'Roboto');
expect(material.textStyle!.fontSize, 14);
......@@ -68,7 +68,7 @@ void main() {
expect(material.color, Colors.transparent);
expect(material.elevation, 0.0);
expect(material.shadowColor, const Color(0xff000000));
expect(material.shape, RoundedRectangleBorder(borderRadius: BorderRadius.circular(4.0)));
expect(material.shape, const RoundedRectangleBorder(borderRadius: BorderRadius.all(Radius.circular(4.0))));
expect(material.textStyle!.color, colorScheme.primary);
expect(material.textStyle!.fontFamily, 'Roboto');
expect(material.textStyle!.fontSize, 14);
......@@ -104,7 +104,7 @@ void main() {
expect(material.color, Colors.transparent);
expect(material.elevation, 0.0);
expect(material.shadowColor, const Color(0xff000000));
expect(material.shape, RoundedRectangleBorder(borderRadius: BorderRadius.circular(4.0)));
expect(material.shape, const RoundedRectangleBorder(borderRadius: BorderRadius.all(Radius.circular(4.0))));
expect(material.textStyle!.color, colorScheme.primary);
expect(material.textStyle!.fontFamily, 'Roboto');
expect(material.textStyle!.fontSize, 14);
......@@ -132,7 +132,7 @@ void main() {
expect(material.color, Colors.transparent);
expect(material.elevation, 0.0);
expect(material.shadowColor, const Color(0xff000000));
expect(material.shape, RoundedRectangleBorder(borderRadius: BorderRadius.circular(4.0)));
expect(material.shape, const RoundedRectangleBorder(borderRadius: BorderRadius.all(Radius.circular(4.0))));
expect(material.textStyle!.color, colorScheme.onSurface.withOpacity(0.38));
expect(material.textStyle!.fontFamily, 'Roboto');
expect(material.textStyle!.fontSize, 14);
......
......@@ -33,7 +33,7 @@ void main() {
expect(material.color, Colors.transparent);
expect(material.elevation, 0.0);
expect(material.shadowColor, const Color(0xff000000));
expect(material.shape, RoundedRectangleBorder(borderRadius: BorderRadius.circular(4.0)));
expect(material.shape, const RoundedRectangleBorder(borderRadius: BorderRadius.all(Radius.circular(4.0))));
expect(material.textStyle!.color, colorScheme.primary);
expect(material.textStyle!.fontFamily, 'Roboto');
expect(material.textStyle!.fontSize, 14);
......
......@@ -32,9 +32,9 @@ void main() {
});
test('BeveledRectangleBorder scale and lerp', () {
final BeveledRectangleBorder c10 = BeveledRectangleBorder(side: const BorderSide(width: 10.0), borderRadius: BorderRadius.circular(100.0));
final BeveledRectangleBorder c15 = BeveledRectangleBorder(side: const BorderSide(width: 15.0), borderRadius: BorderRadius.circular(150.0));
final BeveledRectangleBorder c20 = BeveledRectangleBorder(side: const BorderSide(width: 20.0), borderRadius: BorderRadius.circular(200.0));
const BeveledRectangleBorder c10 = BeveledRectangleBorder(side: BorderSide(width: 10.0), borderRadius: BorderRadius.all(Radius.circular(100.0)));
const BeveledRectangleBorder c15 = BeveledRectangleBorder(side: BorderSide(width: 15.0), borderRadius: BorderRadius.all(Radius.circular(150.0)));
const BeveledRectangleBorder c20 = BeveledRectangleBorder(side: BorderSide(width: 20.0), borderRadius: BorderRadius.all(Radius.circular(200.0)));
expect(c10.dimensions, const EdgeInsets.all(10.0));
expect(c10.scale(2.0), c20);
expect(c20.scale(0.5), c10);
......
......@@ -37,9 +37,9 @@ void main() {
});
test('ContinuousRectangleBorder scale and lerp', () {
final ContinuousRectangleBorder c10 = ContinuousRectangleBorder(side: const BorderSide(width: 10.0), borderRadius: BorderRadius.circular(100.0));
final ContinuousRectangleBorder c15 = ContinuousRectangleBorder(side: const BorderSide(width: 15.0), borderRadius: BorderRadius.circular(150.0));
final ContinuousRectangleBorder c20 = ContinuousRectangleBorder(side: const BorderSide(width: 20.0), borderRadius: BorderRadius.circular(200.0));
const ContinuousRectangleBorder c10 = ContinuousRectangleBorder(side: BorderSide(width: 10.0), borderRadius: BorderRadius.all(Radius.circular(100.0)));
const ContinuousRectangleBorder c15 = ContinuousRectangleBorder(side: BorderSide(width: 15.0), borderRadius: BorderRadius.all(Radius.circular(150.0)));
const ContinuousRectangleBorder c20 = ContinuousRectangleBorder(side: BorderSide(width: 20.0), borderRadius: BorderRadius.all(Radius.circular(200.0)));
expect(c10.dimensions, const EdgeInsets.all(10.0));
expect(c10.scale(2.0), c20);
expect(c20.scale(0.5), c10);
......@@ -113,8 +113,8 @@ void main() {
await tester.pumpWidget(RepaintBoundary(
child: Material(
color: Colors.blueAccent[400],
shape: ContinuousRectangleBorder(
borderRadius: BorderRadius.circular(28.0),
shape: const ContinuousRectangleBorder(
borderRadius: BorderRadius.all(Radius.circular(28.0)),
),
),
));
......@@ -234,8 +234,8 @@ void main() {
await tester.pumpWidget(RepaintBoundary(
child: Material(
color: Colors.redAccent[400],
shape: ContinuousRectangleBorder(
borderRadius: BorderRadius.circular(50.0),
shape: const ContinuousRectangleBorder(
borderRadius: BorderRadius.all(Radius.circular(50.0)),
),
),
));
......
......@@ -34,9 +34,9 @@ void main() {
});
test('RoundedRectangleBorder', () {
final RoundedRectangleBorder c10 = RoundedRectangleBorder(side: const BorderSide(width: 10.0), borderRadius: BorderRadius.circular(100.0));
final RoundedRectangleBorder c15 = RoundedRectangleBorder(side: const BorderSide(width: 15.0), borderRadius: BorderRadius.circular(150.0));
final RoundedRectangleBorder c20 = RoundedRectangleBorder(side: const BorderSide(width: 20.0), borderRadius: BorderRadius.circular(200.0));
const RoundedRectangleBorder c10 = RoundedRectangleBorder(side: BorderSide(width: 10.0), borderRadius: BorderRadius.all(Radius.circular(100.0)));
const RoundedRectangleBorder c15 = RoundedRectangleBorder(side: BorderSide(width: 15.0), borderRadius: BorderRadius.all(Radius.circular(150.0)));
const RoundedRectangleBorder c20 = RoundedRectangleBorder(side: BorderSide(width: 20.0), borderRadius: BorderRadius.all(Radius.circular(200.0)));
expect(c10.dimensions, const EdgeInsets.all(10.0));
expect(c10.scale(2.0), c20);
expect(c20.scale(0.5), c10);
......@@ -44,8 +44,8 @@ void main() {
expect(ShapeBorder.lerp(c10, c20, 0.5), c15);
expect(ShapeBorder.lerp(c10, c20, 1.0), c20);
final RoundedRectangleBorder c1 = RoundedRectangleBorder(side: const BorderSide(width: 1.0), borderRadius: BorderRadius.circular(1.0));
final RoundedRectangleBorder c2 = RoundedRectangleBorder(side: const BorderSide(width: 1.0), borderRadius: BorderRadius.circular(2.0));
const RoundedRectangleBorder c1 = RoundedRectangleBorder(side: BorderSide(width: 1.0), borderRadius: BorderRadius.all(Radius.circular(1.0)));
const RoundedRectangleBorder c2 = RoundedRectangleBorder(side: BorderSide(width: 1.0), borderRadius: BorderRadius.all(Radius.circular(2.0)));
expect(c2.getInnerPath(Rect.fromCircle(center: Offset.zero, radius: 2.0)), isUnitCircle);
expect(c1.getOuterPath(Rect.fromCircle(center: Offset.zero, radius: 1.0)), isUnitCircle);
const Rect rect = Rect.fromLTRB(10.0, 20.0, 80.0, 190.0);
......@@ -69,7 +69,7 @@ void main() {
});
test('RoundedRectangleBorder and CircleBorder', () {
final RoundedRectangleBorder r = RoundedRectangleBorder(side: BorderSide.none, borderRadius: BorderRadius.circular(10.0));
const RoundedRectangleBorder r = RoundedRectangleBorder(side: BorderSide.none, borderRadius: BorderRadius.all(Radius.circular(10.0)));
const CircleBorder c = CircleBorder(side: BorderSide.none);
const Rect rect = Rect.fromLTWH(0.0, 0.0, 100.0, 20.0); // center is x=40..60 y=10
final Matcher looksLikeR = isPathThat(
......
......@@ -129,8 +129,8 @@ void main() {
});
test('TableBorder.all with a borderRadius', () {
final TableBorder tableA = TableBorder.all(borderRadius: BorderRadius.circular(8.0));
expect(tableA.borderRadius, BorderRadius.circular(8.0));
final TableBorder tableA = TableBorder.all(borderRadius: const BorderRadius.all(Radius.circular(8.0)));
expect(tableA.borderRadius, const BorderRadius.all(Radius.circular(8.0)));
});
}
......@@ -257,7 +257,7 @@ void main() {
test('Table paints a borderRadius', () {
final RenderTable table = RenderTable(
textDirection: TextDirection.ltr,
border: TableBorder.all(borderRadius: BorderRadius.circular(8.0)),
border: TableBorder.all(borderRadius: const BorderRadius.all(Radius.circular(8.0))),
);
layout(table);
table.setFlatChildren(2, <RenderBox>[
......
......@@ -354,7 +354,7 @@ Future<void> main() async {
key: key,
width: 100.0,
height: 50.0,
decoration: BoxDecoration(border: border, shape: BoxShape.rectangle, borderRadius: BorderRadius.circular(20.0)),
decoration: BoxDecoration(border: border, shape: BoxShape.rectangle, borderRadius: const BorderRadius.all(Radius.circular(20.0))),
),
onTap: () {
itemsTapped.add(1);
......
......@@ -529,9 +529,9 @@ void main() {
child: Transform.rotate(
angle: 1.0, // radians
child: ClipPath(
clipper: ShapeBorderClipper(
clipper: const ShapeBorderClipper(
shape: BeveledRectangleBorder(
borderRadius: BorderRadius.circular(20.0),
borderRadius: BorderRadius.all(Radius.circular(20.0)),
),
),
child: Container(
......@@ -576,7 +576,7 @@ void main() {
child: Transform.rotate(
angle: 1.0, // radians
child: PhysicalModel(
borderRadius: BorderRadius.circular(20.0),
borderRadius: const BorderRadius.all(Radius.circular(20.0)),
color: Colors.red,
clipBehavior: clipBehavior,
child: Container(
......@@ -640,7 +640,7 @@ void main() {
child: Transform.rotate(
angle: 1.0, // radians
child: PhysicalModel(
borderRadius: BorderRadius.circular(20.0),
borderRadius: const BorderRadius.all(Radius.circular(20.0)),
color: Colors.red,
child: Container(
color: Colors.white,
......@@ -681,9 +681,9 @@ void main() {
child: Transform.rotate(
angle: 1.0, // radians
child: PhysicalShape(
clipper: ShapeBorderClipper(
clipper: const ShapeBorderClipper(
shape: BeveledRectangleBorder(
borderRadius: BorderRadius.circular(20.0),
borderRadius: BorderRadius.all(Radius.circular(20.0)),
),
),
clipBehavior: clipBehavior,
......@@ -747,9 +747,9 @@ void main() {
child: Transform.rotate(
angle: 1.0, // radians
child: PhysicalShape(
clipper: ShapeBorderClipper(
clipper: const ShapeBorderClipper(
shape: BeveledRectangleBorder(
borderRadius: BorderRadius.circular(20.0),
borderRadius: BorderRadius.all(Radius.circular(20.0)),
),
),
color: Colors.red,
......
......@@ -520,8 +520,8 @@ void main() {
testWidgets('giving clipBehaviour Clip.None, will not add a ClipPath to the tree', (WidgetTester tester) async {
await tester.pumpWidget(Container(
clipBehavior: Clip.none,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(1),
decoration: const BoxDecoration(
borderRadius: BorderRadius.all(Radius.circular(1)),
),
child: const SizedBox(),
));
......@@ -535,8 +535,8 @@ void main() {
testWidgets('giving clipBehaviour not a Clip.None, will add a ClipPath to the tree', (WidgetTester tester) async {
final Container container = Container(
clipBehavior: Clip.hardEdge,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(1),
decoration: const BoxDecoration(
borderRadius: BorderRadius.all(Radius.circular(1)),
),
child: const SizedBox(),
);
......@@ -636,10 +636,10 @@ void main() {
testWidgets('using clipBehaviour and shadow, should not clip the shadow', (WidgetTester tester) async {
final Container container = Container(
clipBehavior: Clip.hardEdge,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(30),
decoration: const BoxDecoration(
borderRadius: BorderRadius.all(Radius.circular(30)),
color: Colors.red,
boxShadow: const <BoxShadow>[
boxShadow: <BoxShadow>[
BoxShadow(
color: Colors.blue,
offset: Offset.zero,
......
......@@ -50,7 +50,7 @@ void main() {
child: Container(
margin: const EdgeInsets.all(150.0),
decoration: ShapeDecoration(
shape: BeveledRectangleBorder(borderRadius: BorderRadius.circular(20.0)),
shape: const BeveledRectangleBorder(borderRadius: BorderRadius.all(Radius.circular(20.0))),
shadows: kElevationToShadow[elevation],
),
height: 100.0,
......@@ -114,9 +114,9 @@ void main() {
color: Colors.yellow[200],
child: PhysicalShape(
color: Colors.green[900]!,
clipper: ShapeBorderClipper(
clipper: const ShapeBorderClipper(
shape: BeveledRectangleBorder(
borderRadius: BorderRadius.circular(20.0),
borderRadius: BorderRadius.all(Radius.circular(20.0)),
),
),
elevation: elevation,
......
......@@ -42,7 +42,7 @@ void main() {
style: BorderStyle.solid,
width: 1.0,
),
borderRadius: BorderRadius.circular(10.0),
borderRadius: const BorderRadius.all(Radius.circular(10.0)),
shape: BoxShape.rectangle,
// No shadow.
),
......@@ -85,7 +85,7 @@ void main() {
expect(border.left.width, 2.5);
expect(border.left.style, BorderStyle.solid);
expect(border.left.color, const Color(0xFF101010));
expect(actualDecoration.borderRadius, BorderRadius.circular(5.0));
expect(actualDecoration.borderRadius, const BorderRadius.all(Radius.circular(5.0)));
expect(actualDecoration.shape, BoxShape.rectangle);
expect(actualDecoration.boxShadow![0].blurRadius, 5.0);
expect(actualDecoration.boxShadow![0].spreadRadius, 2.0);
......
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