apply lint prefer_void_to_null in dev/ (#22661)
This commit is contained in:
committed by
GitHub
parent
89c5ace117
commit
d340e2f229
@@ -30,7 +30,7 @@ class MyAppState extends State<MyApp> with SingleTickerProviderStateMixin {
|
||||
IconData _icon;
|
||||
double _flutterFrameRate;
|
||||
|
||||
Future<Null> _summarizeStats() async {
|
||||
Future<void> _summarizeStats() async {
|
||||
final double framesProduced = await channel.invokeMethod('getProducedFrameRate');
|
||||
final double framesConsumed = await channel.invokeMethod('getConsumedFrameRate');
|
||||
_summary = '''
|
||||
@@ -39,7 +39,7 @@ Consumed: ${framesConsumed.toStringAsFixed(1)}fps
|
||||
Widget builds: $_widgetBuilds''';
|
||||
}
|
||||
|
||||
Future<Null> _nextState() async {
|
||||
Future<void> _nextState() async {
|
||||
switch (_state) {
|
||||
case FrameState.initial:
|
||||
debugPrint('Starting .5x speed test...');
|
||||
@@ -90,9 +90,9 @@ Widget builds: $_widgetBuilds''';
|
||||
static const int calibrationTickCount = 600;
|
||||
|
||||
/// Measures Flutter's frame rate.
|
||||
Future<Null> _calibrate() async {
|
||||
Future<void> _calibrate() async {
|
||||
debugPrint('Awaiting calm (3 second pause)...');
|
||||
await Future<Null>.delayed(const Duration(milliseconds: 3000));
|
||||
await Future<void>.delayed(const Duration(milliseconds: 3000));
|
||||
debugPrint('Calibrating...');
|
||||
DateTime startTime;
|
||||
int tickCount = 0;
|
||||
|
||||
@@ -11,7 +11,7 @@ final RegExp calibrationRegExp = RegExp('Flutter frame rate is (.*)fps');
|
||||
final RegExp statsRegExp = RegExp('Produced: (.*)fps\nConsumed: (.*)fps\nWidget builds: (.*)');
|
||||
const Duration samplingTime = Duration(seconds: 8);
|
||||
|
||||
Future<Null> main() async {
|
||||
Future<void> main() async {
|
||||
group('texture suite', () {
|
||||
FlutterDriver driver;
|
||||
|
||||
@@ -38,7 +38,7 @@ Future<Null> main() async {
|
||||
|
||||
// Texture frame stats at 0.5x Flutter frame rate
|
||||
await driver.tap(fab);
|
||||
await Future<Null>.delayed(samplingTime);
|
||||
await Future<void>.delayed(samplingTime);
|
||||
await driver.tap(fab);
|
||||
|
||||
final String statsSlow = await driver.getText(summary);
|
||||
@@ -50,7 +50,7 @@ Future<Null> main() async {
|
||||
|
||||
// Texture frame stats at 2.0x Flutter frame rate
|
||||
await driver.tap(fab);
|
||||
await Future<Null>.delayed(samplingTime);
|
||||
await Future<void>.delayed(samplingTime);
|
||||
await driver.tap(fab);
|
||||
|
||||
final String statsFast = await driver.getText(summary);
|
||||
|
||||
@@ -36,14 +36,14 @@ void main() {
|
||||
|
||||
test('waitForAbsent should resolve when text "present" disappears', () async {
|
||||
// Begin waiting for it to disappear
|
||||
final Completer<Null> whenWaitForAbsentResolves = Completer<Null>();
|
||||
final Completer<void> whenWaitForAbsentResolves = Completer<void>();
|
||||
driver.waitForAbsent(presentText).then(
|
||||
whenWaitForAbsentResolves.complete,
|
||||
onError: whenWaitForAbsentResolves.completeError,
|
||||
);
|
||||
|
||||
// Wait 1 second then make it disappear
|
||||
await Future<Null>.delayed(const Duration(seconds: 1));
|
||||
await Future<void>.delayed(const Duration(seconds: 1));
|
||||
await driver.tap(find.byValueKey('togglePresent'));
|
||||
|
||||
// Ensure waitForAbsent resolves
|
||||
@@ -61,14 +61,14 @@ void main() {
|
||||
|
||||
test('waitFor should resolve when text "present" reappears', () async {
|
||||
// Begin waiting for it to reappear
|
||||
final Completer<Null> whenWaitForResolves = Completer<Null>();
|
||||
final Completer<void> whenWaitForResolves = Completer<void>();
|
||||
driver.waitFor(presentText).then(
|
||||
whenWaitForResolves.complete,
|
||||
onError: whenWaitForResolves.completeError,
|
||||
);
|
||||
|
||||
// Wait 1 second then make it appear
|
||||
await Future<Null>.delayed(const Duration(seconds: 1));
|
||||
await Future<void>.delayed(const Duration(seconds: 1));
|
||||
await driver.tap(find.byValueKey('togglePresent'));
|
||||
|
||||
// Ensure waitFor resolves
|
||||
|
||||
@@ -33,7 +33,7 @@ void main() {
|
||||
final SerializableFinder defaultTextField = find.byValueKey(keys.kDefaultTextField);
|
||||
await driver.waitFor(defaultTextField);
|
||||
await driver.tap(defaultTextField);
|
||||
await Future<Null>.delayed(const Duration(seconds: 1));
|
||||
await Future<void>.delayed(const Duration(seconds: 1));
|
||||
|
||||
// Measure the height with keyboard displayed.
|
||||
final String heightWithKeyboardShown = await driver.getText(heightText);
|
||||
@@ -43,7 +43,7 @@ void main() {
|
||||
final SerializableFinder unfocusButton = find.byValueKey(keys.kUnfocusButton);
|
||||
await driver.waitFor(unfocusButton);
|
||||
await driver.tap(unfocusButton);
|
||||
await Future<Null>.delayed(const Duration(seconds: 1));
|
||||
await Future<void>.delayed(const Duration(seconds: 1));
|
||||
|
||||
// Measure the final height.
|
||||
final String endHeight = await driver.getText(heightText);
|
||||
|
||||
@@ -41,7 +41,7 @@ void main() {
|
||||
|
||||
// Bring up keyboard
|
||||
await driver.tap(textFieldFinder);
|
||||
await Future<Null>.delayed(const Duration(seconds: 1));
|
||||
await Future<void>.delayed(const Duration(seconds: 1));
|
||||
|
||||
// Ensure that TextField is visible again
|
||||
await driver.waitFor(textFieldFinder);
|
||||
|
||||
Reference in New Issue
Block a user