What is Dartivemon
Dartivemon is a CLI tool that allows running a Dart application and a Flutter application simultaneously. It was created to fill the need for a tool similar to nodemon in the Node.js environment, which could watch for changes in dart files and automatically run them.
Dartivemon supports hot-reload functionality, which means that it will restart the Dart or Flutter application whenever a change is detected. This tool is especially beneficial when used in conjunction with the Dartive framework, allowing for an improved development experience with automatic reloading of changes.
Installation
To install Dartivemon, use the dart pub global activate
command:
dart pub global activate dartivemon
Usage
Run Dartivemon from the command line by specifying a .dart
file, fe
for running a Flutter application, or be
followed by a .dart
file to watch and run the file:
To update Dartivemon, use the same command again.
Run Dartivemon with one of the following commands:
dartivemon fe: Runs Flutter app.
dartivemon be <filename>: Watches and runs Dart backend file.
dartivemon <filename>: Watches and runs Dart file.
dartivemon --version: Displays the current version of Dartivemon.
You can also display the help message with -help command:
dartivemon -help
How it Works
-
watchAndRunDartFile: Starts your Dart app and watches for any changes. If changes are detected, it automatically restarts your app.
-
runFlutterApp: Asks for your device ID and starts your Flutter app on the specified device.
-
displayHelpMessage: Displays a help message with usage instructions.
Notes
- The Flutter app is started using the device ID entered by the user. Make sure to enter the correct device ID.
- If the Dart app file is modified, the Dart server/app will be restarted automatically.
- If you enter 'r' or 'R' into the console, it will be sent to the Flutter process.
- If you enter 'q' or 'Q' into the console, it will be sent to the Flutter process.