icecream 0.1.1 copy "icecream: ^0.1.1" to clipboard
icecream: ^0.1.1 copied to clipboard

outdatedDart 1 only

A simple debuger tool

#

icecream

iceream for Dart is a flavor of a good tasting debugger #

It is a library inspired by the python icecream library

The purpose is to to make debugging over the console easy again.

Instead of print() or window.console.log(), ic helps to make developing much sweeter.

icecream without Arguments #

Ic comes in handy to determine which part of code is being executed and where. So if no arguments are passed to ic, it prints out the filem, line and the parent function it is being executed in.

import 'package:icecream/icecream.dart' show ic;

void foo() {
  ic();
}

void main() {
  ic();

  foo();
}

Output:

🍦  example.dart:8 in main()
🍦  example.dart:4 in foo()

icecream with arguments #

ic with arguments inspects them and return its arguments with the returning value


import 'package:icecream/icecream.dart' show ic;

num bar(num x, num y) {
  return x + y;
}

void main() {
  ic(foo(1, 2));
}

Output:

🍦  bar(1, 2): 3

Returning ic value

ic returns its value async while the output will still be printed out


import 'package:icecream/icecream.dart' show ic;

void main() async {
  var output = await ic("Hello");
}

TODO: #

  1. Extensive testing
  2. Proper documentation
  3. Provide all icecream flavors with a juicy icon
  4. Provide own configuration for flexible use of ic
1
likes
0
pub points
13%
popularity

Publisher

unverified uploader

A simple debuger tool

Repository (GitHub)
View/report issues

License

unknown (LICENSE)

Dependencies

inspect, test

More

Packages that depend on icecream