Skip to content

This is a package that allows you to run Dart scripts that have Flutter-specific dependencies such as "dart:ui".

License

Notifications You must be signed in to change notification settings

molotochok/dart_ui_script_executor

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

This is a package that allows you to run Dart scripts that have Flutter-specific dependencies such as "dart:ui".

Features

If you tried to run a script which has a dependency on "dart:ui" you may encountered a lot of errors. It happens because of Flutter-specific dependencies.

This package aims to solve this issue. It uses a hacky solution to execute the target script as a part of a widget unit test.

Getting started

  1. To start using the package install it by running:
flutter pub add dart_ui_script_executor
  1. Create a Dart script that you want to run with the entrypoint function main.

Usage

To run your script you need to execute the wrapper called dart_ui_script_executor and pass as an input the file path of your script together with the arguments.

Command template:

 dart run dart_ui_script_executor <path to your script> [<list of arguments>]

or:

 flutter packages pub run dart_ui_script_executor <path-to-your-script> [<list of arguments>]

Examples:

flutter packages pub run dart_ui_script_executor lib/scripts/script_with_0_args.dart
flutter packages pub run dart_ui_script_executor lib/scripts/script_with_2_args.dart arg1 arg2

About

This is a package that allows you to run Dart scripts that have Flutter-specific dependencies such as "dart:ui".

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages