pub struct DatePickerStrings {Show 18 fields
pub months: [&'static str; 12],
pub month_abbreviations: [&'static str; 12],
pub weekday_initials: [&'static str; 7],
pub weekday_abbreviations: [&'static str; 7],
pub first_day_of_week: u32,
pub help_text: &'static str,
pub no_date_selected: &'static str,
pub cancel_label: &'static str,
pub confirm_label: &'static str,
pub field_label: &'static str,
pub field_hint: &'static str,
pub error_format: &'static str,
pub error_invalid: &'static str,
pub previous_month: &'static str,
pub next_month: &'static str,
pub select_year: &'static str,
pub input_mode: &'static str,
pub calendar_mode: &'static str,
}Expand description
Every user-visible string and the first-day-of-week index the date-picker family reads.
Copy and &'static str-valued, so a widget holds one by value with no
allocation. Override by struct update:
use frust_material::DatePickerStrings;
const FRENCH: DatePickerStrings = DatePickerStrings {
months: [
"janvier", "février", "mars", "avril", "mai", "juin",
"juillet", "août", "septembre", "octobre", "novembre", "décembre",
],
first_day_of_week: 1, // Monday
cancel_label: "Annuler",
..DatePickerStrings::ENGLISH
};
assert_eq!(FRENCH.months[0], "janvier");
assert_eq!(FRENCH.confirm_label, "OK");See the module docs’ localization note for why this replaces the
reference’s MaterialLocalizations lookup, and what it does not cover
(the mm/dd/yyyy input format).
Fields§
§months: [&'static str; 12]Full month names, January first (M3ECalendarLabels.months).
month_abbreviations: [&'static str; 12]Abbreviated month names, January first — the MMM field of
Self::medium_date.
weekday_initials: [&'static str; 7]One-letter weekday headers, Sunday first regardless of
Self::first_day_of_week (M3ECalendarLabels.weekdayInitials /
MaterialLocalizations.narrowWeekdays).
weekday_abbreviations: [&'static str; 7]Abbreviated weekday names, Sunday first — the EEE field of
Self::medium_date.
first_day_of_week: u32Which weekday a week starts on: 0 Sunday .. 6 Saturday
(MaterialLocalizations.firstDayOfWeekIndex).
help_text: &'static strThe dialog header’s help line (datePickerHelpText).
no_date_selected: &'static strThe dialog headline shown before any date is picked
(unspecifiedDate).
cancel_label: &'static strThe dialog’s dismiss action (cancelButtonLabel).
confirm_label: &'static strThe dialog’s confirm action (okButtonLabel).
field_label: &'static strThe input field’s label (dateInputLabel).
field_hint: &'static strThe input field’s supporting/hint line (dateHelpText).
error_format: &'static strThe error for text that is not a date at all
(invalidDateFormatLabel).
error_invalid: &'static strThe error for a real date outside the selectable bounds
(invalidDateRangeLabel).
previous_month: &'static strThe previous-month affordance’s accessibility label
(previousMonthTooltip).
next_month: &'static strThe next-month affordance’s accessibility label (nextMonthTooltip).
select_year: &'static strThe year-selector toggle’s accessibility label
(selectYearSemanticsLabel).
input_mode: &'static strThe switch-to-input affordance’s accessibility label
(inputDateModeButtonLabel).
calendar_mode: &'static strThe switch-to-calendar affordance’s accessibility label
(calendarModeButtonLabel).
Implementations§
Source§impl DatePickerStrings
impl DatePickerStrings
Sourcepub const ENGLISH: Self
pub const ENGLISH: Self
Flutter MaterialLocalizations’ own en_US values — what the reference
resolves on an English device, and what
M3ECalendarLabels’s hard-coded fallback table already carries.
Sourcepub fn weekday_initial(&self, column: usize) -> &'static str
pub fn weekday_initial(&self, column: usize) -> &'static str
The header initial for grid column column (0 = the leftmost), which
Self::first_day_of_week rotates — the reference’s
narrowWeekdays[(firstDayOfWeekIndex + i) % 7].
Sourcepub fn month_year(&self, date: MaterialDate) -> String
pub fn month_year(&self, date: MaterialDate) -> String
"March 2026" — MaterialLocalizations.formatMonthYear.
Sourcepub fn medium_date(&self, date: MaterialDate) -> String
pub fn medium_date(&self, date: MaterialDate) -> String
"Thu, Aug 20" — MaterialLocalizations.formatMediumDate’s en_US
EEE, MMM d pattern, which is what the dialog headline shows.
Trait Implementations§
Source§impl Clone for DatePickerStrings
impl Clone for DatePickerStrings
impl Copy for DatePickerStrings
Source§impl Debug for DatePickerStrings
impl Debug for DatePickerStrings
Source§impl Default for DatePickerStrings
impl Default for DatePickerStrings
impl Eq for DatePickerStrings
Source§impl PartialEq for DatePickerStrings
impl PartialEq for DatePickerStrings
impl StructuralPartialEq for DatePickerStrings
Auto Trait Implementations§
impl Freeze for DatePickerStrings
impl RefUnwindSafe for DatePickerStrings
impl Send for DatePickerStrings
impl Sync for DatePickerStrings
impl Unpin for DatePickerStrings
impl UnsafeUnpin for DatePickerStrings
impl UnwindSafe for DatePickerStrings
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<T> Brush for T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.