statham 0.1.0

SDKflutter
Platformandroidioswindowslinuxmacosweb

A package to provide Json support, KISS (Keep It Simple & Stupid) style.

statham

Json support with a KISS (Keep It Simple & Stupid) approach. Gives some ability to parse and export into json, without the need of a package that requires annotations in order to do the "magic" in part files.

Features

  • Json alias for representing Map<String, dynamic> json
  • T toJson<T>([String? key]) added to bool, DateTime, int and String

Getting started

Import the package:

import 'package:statham/statham.dart';

Usage

See /example for a longer example.

final startedAt = DateTime.timestamp();
final int duration = 2;
final fakeNews = false;

final Json json = {
...startedAt.toJson("started_at"),
...duration.toJson("duration"),
...fakeNews.toJson("is_fakes_news"),
};

print(json);

Additional information

Reach out to me on Github if anything.