Skip to content

Instantly share code, notes, and snippets.

@dpossas
Last active July 21, 2020 11:52
Show Gist options
  • Save dpossas/48df49eb2583629dc5b85d7060a9e619 to your computer and use it in GitHub Desktop.
Save dpossas/48df49eb2583629dc5b85d7060a9e619 to your computer and use it in GitHub Desktop.
Dart - The basics in pratice
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