to_string_plus 0.0.1 copy "to_string_plus: ^0.0.1" to clipboard
to_string_plus: ^0.0.1 copied to clipboard

A tools for generating toString method for class, based on build_runner

example/example.dart

import 'package:to_string_plus/to_string_plus.dart';

part 'example.g.dart';

@ToString()
class Cat {
  Cat({this.color, this.weight, this.wings});

  final classify = "Animal";

  String? color;

  double? weight;

  String? wings;

  @ToString()
  bool get hasWings => wings != null;

  /// toString() will return like this:
  ///
  /// ```dart
  /// 'Cat{classify: Animal, color: white, weight: 1.14, wings: null, hasWings: false}';
  /// ```
  @override
  String toString() {
    return _$CatToString(this);
  }
}
0
likes
130
pub points
0%
popularity

Publisher

unverified uploader

A tools for generating toString method for class, based on build_runner

Repository (GitHub)
View/report issues

Documentation

API reference

License

BSD-3-Clause (LICENSE)

More

Packages that depend on to_string_plus