Skip to content

A Dotnet App to create dart class from json, The dart class extends Serializable base class

Notifications You must be signed in to change notification settings

TrendingTechnology/JsonToDart

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

JsonToDart

A Dotnet App to create dart class from json, taking null-safety into consideration

The dart class extends Serializable base class

Here is the Serializable class code

import 'dart:convert';

abstract class Serializable {

  String serialize() {
    return json.encode(this.toMap());
  }

  void deserialize(String text) {
    this.fromMap(json.decode(text));
  }

  //abstract
  Map<String, dynamic> toMap();

  //abstract
  void fromMap(Map<String, dynamic> map);
}

About

A Dotnet App to create dart class from json, The dart class extends Serializable base class

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • C# 100.0%