flutter_daemon 1.0.1 copy "flutter_daemon: ^1.0.1" to clipboard
flutter_daemon: ^1.0.1 copied to clipboard

A programmable interface around the Flutter daemon protocol.

example/main.dart

import 'package:flutter_daemon/flutter_daemon.dart';

/// You can run this example using the following command:
/// ```sh
/// # First parameter has to be the working directory, everything else is normal
/// # Flutter arguments.
/// dart example/main.dart ../path/to/flutter/app/ --target lib/main.dart --flavor development
/// ```
void main(List<String> arguments) async {
  final daemon = FlutterDaemon();
  daemon.events.listen(print);

  final workingDirectory = arguments.removeAt(0);
  final application = await daemon.run(
    arguments: arguments,
    workingDirectory: workingDirectory,
  );

  print('started');
  await Future<void>.delayed(const Duration(seconds: 10));

  print('restarting');
  print(await application.restart());
  await Future<void>.delayed(const Duration(seconds: 10));

  print('stopping');
  await application.stop();
  await daemon.dispose();
}
14
likes
160
points
30
downloads

Publisher

verified publisherwolfenra.in

Weekly Downloads

A programmable interface around the Flutter daemon protocol.

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (license)

Dependencies

process

More

Packages that depend on flutter_daemon