Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR DART

dart const constructor

// If your class produces objects that never change
class ImmutablePoint {
  const ImmutablePoint(this.x, this.y);

  final int x;
  final int y;

  static const ImmutablePoint origin = ImmutablePoint(0, 0);
}
Source by dart.dev #
 
PREVIOUS NEXT
Tagged: #dart #const #constructor
ADD COMMENT
Topic
Name
5+2 =