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