anchor.diff:      });
   
       testWithoutContext('Does not set single char mode when a terminal is not attached', () {
  -      final Stdio stdio = MockStdio();
  -      when(stdio.stdin).thenThrow(StateError('This should not be called'));
  -      when(stdio.stdinHasTerminal).thenReturn(false);
  +      final Stdio stdio = FakeStdio()
  +        ..stdinHasTerminal = false;
         final AnsiTerminal ansiTerminal = AnsiTerminal(
           stdio: stdio,
           platform: const LocalPlatform()
  
positive.code:   bool singleCharMode = false;
  }
  
  class MockStdio extends Mock implements Stdio {}
  
negative.code: import 'package:flutter_tools/src/base/logger.dart';
  import 'package:flutter_tools/src/base/platform.dart';
  import 'package:flutter_tools/src/base/terminal.dart';
  import 'package:test/fake.dart';
  
  import '../../src/common.dart';
  
  