Last active
July 21, 2020 11:52
-
-
Save dpossas/48df49eb2583629dc5b85d7060a9e619 to your computer and use it in GitHub Desktop.
Dart - The basics in pratice
This file contains hidden or 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
class Product { | |
// Attributes with private privacy level | |
int _id; | |
String _title; | |
bool _active; | |
double _price; | |
// Function definition like a constructor | |
Product(this._title, this._active, this._price); | |
// Function definition like a getter | |
int get id => _id; | |
double get price => _price; | |
bool get active => _active; | |
String get title => _title; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment