imckl
imckl

Reputation: 738

How to test Dart code snippet in Flutter development?

Description:

For example:

Upvotes: 1

Views: 1212

Answers (2)

lvingstone
lvingstone

Reputation: 239

you can run your code on android studio terminal, there is no need tempering with your configurations. Make sure you are in the same folder with the testing.dart. Then run dart testing.dart

Upvotes: 1

Erdi
Erdi

Reputation: 140

There are two easy ways as I know for this situation.

First is in browser solution; DartPad https://dartpad.dartlang.org/

Second is in Android Studio;

enter image description here

Create a test.dart file under your project folder. Click down arrow near main.dart seen in image. Select "Edit Configurations". Then new screen pops up. Click + sign and "Dart Command Line App". Browse and select your test.dart file. Click apply and close window. Now you can run your test.dart file and see results in console.

Upvotes: 4

Related Questions