caller_info 0.0.5 copy "caller_info: ^0.0.5" to clipboard
caller_info: ^0.0.5 copied to clipboard

outdatedDart 1 only

Caller info (frame, source, caller, line number)

caller_info #

Caller info (frame, source, caller, line number)

import 'package:caller_info/caller_info.dart';

void main() {
  Foo.test();
  try {
    Foo.coolMethod();
  } catch(e) {
    print(e);
  }
}

class Foo {
  static void test() {
    var ci = new CallerInfo();
    print("frame: ${ci.frame}");
    print("source: ${ci.source}");
    print("caller: ${ci.caller}");
    print("line: ${ci.line}");
  }

  static void coolMethod() {
    throw new UnimplementedError(new CallerInfo().caller);
  }
}

Output:

frame: Foo.test (file:///C:/Users/user/dart/caller_info/example/example.dart:14:18)
source: file:///C:/Users/user/dart/caller_info/example/example.dart
caller: Foo.test
line: 14
UnimplementedError: Foo.coolMethod
0
likes
0
points
12
downloads

Publisher

unverified uploader

Weekly Downloads

Caller info (frame, source, caller, line number)

Repository (GitHub)
View/report issues

License

unknown (license)

More

Packages that depend on caller_info