tbib_gen_timezone_serializable

Creator: coderz1093

Last updated:

0 purchases

TODO
Add to Cart

Description:

tbib gen timezone serializable

Tbib Gen Timezone Serializable #
Setup #
Use it for make json serializable support TZDateTime Field
step 1 #

note use flutter_timezone to get Local Timezone

String location=FlutterTimezone.getLocalTimezone();
JsonTimezoneSerializable.init = location;
copied to clipboard
step 2 #


use @JsonTimezoneConverter() above TZDateTime
@JsonSerializable()
class GenerateTimezone {
@JsonTimezoneConverter()
final TZDateTime timezone;

GenerateTimezone(this.date, this.timezone);
factory GenerateTimezone.fromJson(Map<String, dynamic> json) =>
_$GenerateTimezoneFromJson(json);
}

copied to clipboard


Note #

don't use timezone.toIso8601String();
but use timezone.toIso8601();
in version 0.0.2 can format date
click here to more details

License

For personal and professional use. You cannot resell or redistribute these repositories in their original state.

Files In This Product:

Customer Reviews

There are no reviews.