-
-
Save heftekharm/ad915cc353440354a2bf5256e9271dcb to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//with static | |
class Circle { | |
final int size; | |
Circle(this.size); | |
static Circle fromJson(String json) => Circle(jsonDecode(json)["size"]); | |
} | |
void main(){ | |
var circle=Circle.fromJson(""" {"size":10} """); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment