mirror of
https://github.com/flutter/packages.git
synced 2025-06-03 09:41:19 +08:00

Removes the legacy analysis options override and fixes all resulting issues. This is a combination of dart fix and manual changes (mostly mechanical, but some small restructuring to address warnings more cleanly, such as creating typed structs from args when they are used repeatedly to avoid repeated casting, or making things that were unnecessarily public private). One small opportunistic extra cleanup is that the handling of null-safety prerelease versions is removed, as any new plugin would be written null-safe from the start, so we no longer need to allow those versions. Part of flutter/flutter#76229
38 lines
1.0 KiB
Dart
38 lines
1.0 KiB
Dart
// Copyright 2013 The Flutter Authors. All rights reserved.
|
|
// Use of this source code is governed by a BSD-style license that can be
|
|
// found in the LICENSE file.
|
|
|
|
import 'dart:async';
|
|
import 'dart:io' as io;
|
|
|
|
import 'package:file/file.dart';
|
|
import 'package:mockito/mockito.dart';
|
|
|
|
class MockProcess extends Mock implements io.Process {
|
|
final Completer<int> exitCodeCompleter = Completer<int>();
|
|
final StreamController<List<int>> stdoutController =
|
|
StreamController<List<int>>();
|
|
final StreamController<List<int>> stderrController =
|
|
StreamController<List<int>>();
|
|
final MockIOSink stdinMock = MockIOSink();
|
|
|
|
@override
|
|
Future<int> get exitCode => exitCodeCompleter.future;
|
|
|
|
@override
|
|
Stream<List<int>> get stdout => stdoutController.stream;
|
|
|
|
@override
|
|
Stream<List<int>> get stderr => stderrController.stream;
|
|
|
|
@override
|
|
IOSink get stdin => stdinMock;
|
|
}
|
|
|
|
class MockIOSink extends Mock implements IOSink {
|
|
List<String> lines = <String>[];
|
|
|
|
@override
|
|
void writeln([Object obj = '']) => lines.add(obj.toString());
|
|
}
|