Skip to content

Instantly share code, notes, and snippets.

@Sampath-Lokuge
Last active June 30, 2022 15:51
Show Gist options
  • Select an option

  • Save Sampath-Lokuge/7f3fcea985c008a93688d37ae7d9d549 to your computer and use it in GitHub Desktop.

Select an option

Save Sampath-Lokuge/7f3fcea985c008a93688d37ae7d9d549 to your computer and use it in GitHub Desktop.

Revisions

  1. Sampath-Lokuge revised this gist Jun 30, 2022. 1 changed file with 4 additions and 5 deletions.
    9 changes: 4 additions & 5 deletions main.dart
    Original file line number Diff line number Diff line change
    @@ -4,11 +4,10 @@ void main() {
    }


    class User {

    class User {

    final int id = 0;
    final String name = '';
    final int id;
    final String name;

    const User({int id = 0, String name = "anonymous"});
    const User({this.id=0, this.name = "anonymous"});
    }
  2. Sampath-Lokuge created this gist Jun 30, 2022.
    14 changes: 14 additions & 0 deletions main.dart
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,14 @@
    void main() {
    const vicki = User(id: 24, name: 'Vicki');
    print(vicki.id);
    }


    class User {


    final int id = 0;
    final String name = '';

    const User({int id = 0, String name = "anonymous"});
    }