Add examples to documentation of TimeOfDay class. (#23452)
This commit is contained in:
parent
10bcddcc5c
commit
d8bf21a3b7
@ -19,7 +19,20 @@ enum DayPeriod {
|
||||
/// A value representing a time during the day, independent of the date that
|
||||
/// day might fall on or the time zone.
|
||||
///
|
||||
/// The time is represented by [hour] and [minute] pair.
|
||||
/// The time is represented by [hour] and [minute] pair. Once created, both
|
||||
/// values cannot be changed.
|
||||
///
|
||||
/// You can create TimeOfDay using the constructor which requires both hour and
|
||||
/// minute or using [DateTime] object.
|
||||
/// Hours are specified between 0 and 23, as in a 24-hour clock.
|
||||
///
|
||||
/// ### Sample code
|
||||
///
|
||||
/// ```dart
|
||||
/// TimeOfDay now = TimeOfDay.now();
|
||||
/// TimeOfDay releaseTime = TimeOfDay(hour: 15, minute: 0); // 3:00pm
|
||||
/// TimeOfDay roomBooked = TimeOfDay.fromDateTime(DateTime.parse('2018-10-20 16:30:04Z')); // 4:30pm
|
||||
/// ```
|
||||
///
|
||||
/// See also:
|
||||
///
|
||||
|
Loading…
x
Reference in New Issue
Block a user