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
| @library_en | |
| import 'package:intlx/src/locale/plural/en.dart' as plural_locale_en; | |
| @library_de | |
| import 'package:intlx/src/locale/plural/de.dart' as plural_locale_de; | |
| // ... | |
| Future<bool> loadLocale([String locale]) { | |
| const library_en = const DeferredLibrary('plural_locale_en'); | |
| const library_de = const DeferredLibrary('plural_locale_de'); |
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
| // Month constants returned by [DateTime.month]. | |
| library month; | |
| const int JANUARY = 1; | |
| const int FEBRUARY = 2; | |
| const int MARCH = 3; | |
| const int APRIL = 4; | |
| const int MAY = 5; | |
| const int JUNE = 6; | |
| const int JULY = 7; |
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 Polygon { | |
| Polygon(List<Point> vertices); | |
| Polygon.regular(Point centroid, num sideCount, num sideLength, {num radians = 0}); | |
| Point get centroid; | |
| List<Point> get vertices; | |
| Path get perimeter; | |
| Polygon translate(Point vector); | |
| // by default [about] is the first vertex |
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
| function foo() { | |
| alert('hi') | |
| } |
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
| /// A contiguous interval of [Comparable]s, by default inclusive of it's [min] and exclusive of it's [max] | |
| class Interval<T extends Comparable> { | |
| const Interval(this.min, this.max, {this.containsMin = true, this.containsMax = false}); | |
| final T min, max; | |
| final bool containsMin, containsMax; | |
| bool contains(T test) { |
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
| interface Duration default DurationImplementation { | |
| // exact | |
| static final int MONTHS_PER_YEAR = 12; | |
| static final int DAYS_PER_WEEK = 7; | |
| static final int MINUTES_PER_HOUR = 60; | |
| static final int SECONDS_PER_MINUTE = 60; | |
| static final int SECONDS_PER_HOUR = SECONDS_PER_MINUTE * MINUTES_PER_HOUR; | |
| static final int MILLISECONDS_PER_HOUR = MILLISECONDS_PER_MINUTE * MINUTES_PER_HOUR; | |
| static final int MILLISECONDS_PER_MINUTE = MILLISECONDS_PER_SECOND * SECONDS_PER_MINUTE; |
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
| interface Command { | |
| const Command(this.executable, [this.arguments, this.workingDirectory, this.environment]); | |
| String get executable(); | |
| List get arguments(); // toString() will get called on each argument | |
| String get workingDirectory(); | |
| Map<String, String> get environment(); | |
| Future<CommandResult> run([ | |
| Encoding stdoutEncoding, |
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
| interface FileNode { | |
| String get path(); | |
| Future<Path> get fullPath(); | |
| Future<Directory> get parent(); // renames File#directory | |
| Future<void> set parent(Directory d); | |
| Future<void> create(); | |
| Future<void> delete(); |
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
| #library("num") | |
| #import("dart:core", prefix: "c"); | |
| class num implements c.num { | |
| num.wrap(c.num this._wrapped); | |
| num operator +(c.num other) => _wrapped + other; | |
| num operator -(c.num other) => _wrapped - other; | |
| num operator *(c.num other) => _wrapped * other; | |
| num operator %(c.num other) => _wrapped % other; |
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
| #library("time"); | |
| // "Date" implies only the year, month, and day, use "Time" instead | |
| class Time implements Comparable { | |
| // make all arguments except year optional, default to smallest possible | |
| Time( | |
| int year, [ | |
| int month = 1, | |
| int day = 1, |