Unverified Commit 4fe41abf authored by Konstantin Scheglov's avatar Konstantin Scheglov Committed by GitHub

Add default values for optional parameters. (#27197)

parent 1811d574
...@@ -2595,7 +2595,7 @@ abstract class RenderObject extends AbstractNode with DiagnosticableTreeMixin im ...@@ -2595,7 +2595,7 @@ abstract class RenderObject extends AbstractNode with DiagnosticableTreeMixin im
} }
@override @override
String toString({ DiagnosticLevel minLevel }) => toStringShort(); String toString({ DiagnosticLevel minLevel = DiagnosticLevel.debug }) => toStringShort();
/// Returns a description of the tree rooted at this node. /// Returns a description of the tree rooted at this node.
/// If the prefix argument is provided, then every line in the output /// If the prefix argument is provided, then every line in the output
...@@ -2631,7 +2631,7 @@ abstract class RenderObject extends AbstractNode with DiagnosticableTreeMixin im ...@@ -2631,7 +2631,7 @@ abstract class RenderObject extends AbstractNode with DiagnosticableTreeMixin im
/// [toStringDeep], but does not recurse to any children. /// [toStringDeep], but does not recurse to any children.
@override @override
String toStringShallow({ String toStringShallow({
String joiner = '; ', String joiner = ', ',
DiagnosticLevel minLevel = DiagnosticLevel.debug, DiagnosticLevel minLevel = DiagnosticLevel.debug,
}) { }) {
RenderObject debugPreviousActiveLayout; RenderObject debugPreviousActiveLayout;
......
...@@ -85,7 +85,7 @@ class TestImage implements ui.Image { ...@@ -85,7 +85,7 @@ class TestImage implements ui.Image {
void dispose() { } void dispose() { }
@override @override
Future<ByteData> toByteData({ui.ImageByteFormat format}) async { Future<ByteData> toByteData({ui.ImageByteFormat format = ui.ImageByteFormat.rawRgba}) async {
throw UnsupportedError('Cannot encode test image'); throw UnsupportedError('Cannot encode test image');
} }
} }
......
...@@ -40,7 +40,7 @@ class FakeImage implements Image { ...@@ -40,7 +40,7 @@ class FakeImage implements Image {
void dispose() {} void dispose() {}
@override @override
Future<ByteData> toByteData({ImageByteFormat format}) async { Future<ByteData> toByteData({ImageByteFormat format = ImageByteFormat.rawRgba}) async {
throw UnsupportedError('Cannot encode test image'); throw UnsupportedError('Cannot encode test image');
} }
} }
......
...@@ -23,7 +23,7 @@ class TestImage implements ui.Image { ...@@ -23,7 +23,7 @@ class TestImage implements ui.Image {
void dispose() { } void dispose() { }
@override @override
Future<ByteData> toByteData({ui.ImageByteFormat format}) async { Future<ByteData> toByteData({ui.ImageByteFormat format = ui.ImageByteFormat.rawRgba}) async {
throw UnsupportedError('Cannot encode test image'); throw UnsupportedError('Cannot encode test image');
} }
} }
......
...@@ -125,7 +125,7 @@ class TestImage implements ui.Image { ...@@ -125,7 +125,7 @@ class TestImage implements ui.Image {
void dispose() { } void dispose() { }
@override @override
Future<ByteData> toByteData({ui.ImageByteFormat format}) async { Future<ByteData> toByteData({ui.ImageByteFormat format = ui.ImageByteFormat.rawRgba}) async {
throw UnsupportedError('Cannot encode test image'); throw UnsupportedError('Cannot encode test image');
} }
} }
...@@ -19,7 +19,7 @@ class SquareImage implements ui.Image { ...@@ -19,7 +19,7 @@ class SquareImage implements ui.Image {
int get height => 10; int get height => 10;
@override @override
Future<ByteData> toByteData({ui.ImageByteFormat format}) async { Future<ByteData> toByteData({ui.ImageByteFormat format = ui.ImageByteFormat.rawRgba}) async {
throw UnsupportedError('Cannot encode test image'); throw UnsupportedError('Cannot encode test image');
} }
...@@ -38,7 +38,7 @@ class WideImage implements ui.Image { ...@@ -38,7 +38,7 @@ class WideImage implements ui.Image {
int get height => 10; int get height => 10;
@override @override
Future<ByteData> toByteData({ui.ImageByteFormat format}) async { Future<ByteData> toByteData({ui.ImageByteFormat format = ui.ImageByteFormat.rawRgba}) async {
throw UnsupportedError('Cannot encode test image'); throw UnsupportedError('Cannot encode test image');
} }
...@@ -57,7 +57,7 @@ class TallImage implements ui.Image { ...@@ -57,7 +57,7 @@ class TallImage implements ui.Image {
int get height => 20; int get height => 20;
@override @override
Future<ByteData> toByteData({ui.ImageByteFormat format}) async { Future<ByteData> toByteData({ui.ImageByteFormat format = ui.ImageByteFormat.rawRgba}) async {
throw UnsupportedError('Cannot encode test image'); throw UnsupportedError('Cannot encode test image');
} }
......
...@@ -103,7 +103,7 @@ class TestRecordingPaintingContext extends ClipContext implements PaintingContex ...@@ -103,7 +103,7 @@ class TestRecordingPaintingContext extends ClipContext implements PaintingContex
} }
@override @override
void pushClipRect(bool needsCompositing, Offset offset, Rect clipRect, PaintingContextCallback painter, {Clip clipBehavior = Clip.antiAlias}) { void pushClipRect(bool needsCompositing, Offset offset, Rect clipRect, PaintingContextCallback painter, {Clip clipBehavior = Clip.hardEdge}) {
clipRectAndPaint(clipRect.shift(offset), clipBehavior, clipRect.shift(offset), () => painter(this, offset)); clipRectAndPaint(clipRect.shift(offset), clipBehavior, clipRect.shift(offset), () => painter(this, offset));
} }
......
...@@ -26,7 +26,7 @@ class TestImage implements ui.Image { ...@@ -26,7 +26,7 @@ class TestImage implements ui.Image {
void dispose() { } void dispose() { }
@override @override
Future<ByteData> toByteData({ui.ImageByteFormat format}) async { Future<ByteData> toByteData({ui.ImageByteFormat format = ui.ImageByteFormat.rawRgba}) async {
throw UnsupportedError('Cannot encode test image'); throw UnsupportedError('Cannot encode test image');
} }
} }
......
...@@ -37,7 +37,7 @@ class TestImage implements ui.Image { ...@@ -37,7 +37,7 @@ class TestImage implements ui.Image {
void dispose() { } void dispose() { }
@override @override
Future<ByteData> toByteData({ui.ImageByteFormat format}) async { Future<ByteData> toByteData({ui.ImageByteFormat format = ui.ImageByteFormat.rawRgba}) async {
throw UnsupportedError('Cannot encode test image'); throw UnsupportedError('Cannot encode test image');
} }
} }
......
...@@ -926,7 +926,7 @@ class TestImage implements ui.Image { ...@@ -926,7 +926,7 @@ class TestImage implements ui.Image {
void dispose() { } void dispose() { }
@override @override
Future<ByteData> toByteData({ui.ImageByteFormat format}) async { Future<ByteData> toByteData({ui.ImageByteFormat format = ui.ImageByteFormat.rawRgba}) async {
throw UnsupportedError('Cannot encode test image'); throw UnsupportedError('Cannot encode test image');
} }
......
...@@ -27,7 +27,7 @@ class Alive extends StatefulWidget { ...@@ -27,7 +27,7 @@ class Alive extends StatefulWidget {
AliveState createState() => AliveState(); AliveState createState() => AliveState();
@override @override
String toString({DiagnosticLevel minLevel}) => '$index $alive'; String toString({DiagnosticLevel minLevel = DiagnosticLevel.debug}) => '$index $alive';
} }
class AliveState extends State<Alive> with AutomaticKeepAliveClientMixin { class AliveState extends State<Alive> with AutomaticKeepAliveClientMixin {
......
...@@ -720,7 +720,7 @@ class AutomatedTestWidgetsFlutterBinding extends TestWidgetsFlutterBinding { ...@@ -720,7 +720,7 @@ class AutomatedTestWidgetsFlutterBinding extends TestWidgetsFlutterBinding {
@override @override
Future<T> runAsync<T>(Future<T> callback(), { Future<T> runAsync<T>(Future<T> callback(), {
Duration additionalTime = const Duration(milliseconds: 1000), Duration additionalTime = const Duration(milliseconds: 250),
}) { }) {
assert(additionalTime != null); assert(additionalTime != null);
assert(() { assert(() {
......
...@@ -33,7 +33,7 @@ class BuildKernelCompiler implements KernelCompiler { ...@@ -33,7 +33,7 @@ class BuildKernelCompiler implements KernelCompiler {
List<String> fileSystemRoots, List<String> fileSystemRoots,
String fileSystemScheme, String fileSystemScheme,
String depFilePath, String depFilePath,
TargetModel targetModel, TargetModel targetModel = TargetModel.flutter,
}) async { }) async {
if (fileSystemRoots != null || fileSystemScheme != null || depFilePath != null || targetModel != null || sdkRoot != null || packagesPath != null) { if (fileSystemRoots != null || fileSystemScheme != null || depFilePath != null || targetModel != null || sdkRoot != null || packagesPath != null) {
printTrace('fileSystemRoots, fileSystemScheme, depFilePath, targetModel,' printTrace('fileSystemRoots, fileSystemScheme, depFilePath, targetModel,'
......
...@@ -784,7 +784,7 @@ class NotifyingLogger extends Logger { ...@@ -784,7 +784,7 @@ class NotifyingLogger extends Logger {
String message, { String message, {
@required Duration timeout, @required Duration timeout,
String progressId, String progressId,
bool multilineOutput, bool multilineOutput = false,
int progressIndicatorPadding = kDefaultStatusPadding, int progressIndicatorPadding = kDefaultStatusPadding,
}) { }) {
assert(timeout != null); assert(timeout != null);
...@@ -961,8 +961,8 @@ class _AppRunLogger extends Logger { ...@@ -961,8 +961,8 @@ class _AppRunLogger extends Logger {
String message, { String message, {
@required Duration timeout, @required Duration timeout,
String progressId, String progressId,
bool multilineOutput, bool multilineOutput = false,
int progressIndicatorPadding = 52, int progressIndicatorPadding = kDefaultStatusPadding,
}) { }) {
assert(timeout != null); assert(timeout != null);
final int id = _nextProgressId++; final int id = _nextProgressId++;
......
...@@ -185,7 +185,7 @@ class FuchsiaDevice extends Device { ...@@ -185,7 +185,7 @@ class FuchsiaDevice extends Device {
Map<String, dynamic> platformArgs, Map<String, dynamic> platformArgs,
bool prebuiltApplication = false, bool prebuiltApplication = false,
bool applicationNeedsRebuild = false, bool applicationNeedsRebuild = false,
bool usesTerminalUi = false, bool usesTerminalUi = true,
bool ipv6 = false, bool ipv6 = false,
}) => Future<void>.error('unimplemented'); }) => Future<void>.error('unimplemented');
......
...@@ -55,7 +55,7 @@ class _FakeGenSnapshot implements GenSnapshot { ...@@ -55,7 +55,7 @@ class _FakeGenSnapshot implements GenSnapshot {
String packagesPath, String packagesPath,
String depfilePath, String depfilePath,
IOSArch iosArch, IOSArch iosArch,
Iterable<String> additionalArgs, Iterable<String> additionalArgs = const <String>[],
}) async { }) async {
_callCount += 1; _callCount += 1;
_snapshotType = snapshotType; _snapshotType = snapshotType;
......
...@@ -216,10 +216,10 @@ class _NoopIOSink implements IOSink { ...@@ -216,10 +216,10 @@ class _NoopIOSink implements IOSink {
void write(_) {} void write(_) {}
@override @override
void writeAll(_, [__]) {} void writeAll(_, [__ = '']) {}
@override @override
void writeln([_]) {} void writeln([_ = '']) {}
@override @override
void writeCharCode(_) {} void writeCharCode(_) {}
......
...@@ -203,8 +203,8 @@ class MockProcessManager extends Mock implements ProcessManager { ...@@ -203,8 +203,8 @@ class MockProcessManager extends Mock implements ProcessManager {
Map<String, String> environment, Map<String, String> environment,
bool includeParentEnvironment = true, bool includeParentEnvironment = true,
bool runInShell = false, bool runInShell = false,
Encoding stdoutEncoding, Encoding stdoutEncoding = systemEncoding,
Encoding stderrEncoding Encoding stderrEncoding = systemEncoding
}) { }) {
final String program = command[0]; final String program = command[0];
final List<String> args = command.sublist(1); final List<String> args = command.sublist(1);
......
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