xmapper 1.0.1 copy "xmapper: ^1.0.1" to clipboard
xmapper: ^1.0.1 copied to clipboard

outdated

A starting point for Dart libraries or applications.

example/xmapper_example.dart

import 'package:xmapper/xmapper.dart';

class A {
  late int fd1;
  late String fd2;
  late bool fd3;
  late B sub;
  A({this.fd1 = 0, this.fd2 = '', this.fd3 = false, required this.sub});
  @override
  String toString() => '$fd1 - $fd2 - $fd3 -$sub';
}

class B {
  late String testS;
  late double fee;
  B({this.testS = '', this.fee = 0.0});
  @override
  String toString() => '$testS - $fee';
}

void main() {
  final obj = Mapper<A>().object({
    'fd1': 1,
    'fd2': 'hahahah',
    'sub': {'testS': 'hahah'}
  });
  print('obj: $obj');
  final map = Mapper<A>().toMap(obj!);
  print('map: $map');
}
0
likes
0
pub points
0%
popularity

Publisher

unverified uploader

A starting point for Dart libraries or applications.

License

unknown (LICENSE)

More

Packages that depend on xmapper