Add default values for optional parameters. (#27197)

This commit is contained in:
Konstantin Scheglov 2019-01-29 11:49:57 -08:00 committed by GitHub
parent 1811d57445
commit 4fe41abfcc
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
18 changed files with 25 additions and 25 deletions

View file

@ -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;

View file

@ -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');
}
}

View file

@ -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');
}
}

View file

@ -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');
}
}

View file

@ -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');
}
}

View file

@ -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');
}

View file

@ -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));
}

View file

@ -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');
}
}

View file

@ -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');
}
}

View file

@ -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');
}

View file

@ -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 {

View file

@ -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(() {

View file

@ -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,'

View file

@ -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++;

View file

@ -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');

View file

@ -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;

View file

@ -216,10 +216,10 @@ class _NoopIOSink implements IOSink {
void write(_) {}
@override
void writeAll(_, [__]) {}
void writeAll(_, [__ = '']) {}
@override
void writeln([_]) {}
void writeln([_ = '']) {}
@override
void writeCharCode(_) {}

View file

@ -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);