pub struct YearPicker {
pub key: Option<KeyRef>,
pub current_date: Option<DateTime>,
pub first_date: DateTime,
pub last_date: DateTime,
pub selected_date: Option<DateTime>,
pub on_changed: ValueChanged<DateTime>,
pub drag_start_behavior: DragStartBehavior,
pub calendar_delegate: Rc<dyn CalendarDelegate>,
}Expand description
A scrollable grid of years to allow picking a year.
The year picker widget is rarely used directly. Instead, consider using
CalendarDatePicker, or showDatePicker which create full date pickers.
See also:
showDatePicker, which shows a dialog that contains a Material Design date picker.
Fields§
§key: Option<KeyRef>§current_date: Option<DateTime>The current date.
This date is subtly highlighted in the picker. Defaults to today; None: not given.
first_date: DateTimeThe earliest date the user is permitted to pick.
last_date: DateTimeThe latest date the user is permitted to pick.
selected_date: Option<DateTime>The currently selected date.
This date is highlighted in the picker.
on_changed: ValueChanged<DateTime>Called when the user picks a year.
drag_start_behavior: DragStartBehaviorDetermines the way that drag start behavior is handled.
If set to DragStartBehavior::Start, the drag behavior used for scrolling this widget
will begin at the position where the drag gesture won the arena. If set to
DragStartBehavior::Down it will begin at the position where a down event is first
detected.
Defaults to DragStartBehavior::Start.
calendar_delegate: Rc<dyn CalendarDelegate>The calendar system to use.
Defaults to GregorianCalendarDelegate.
Implementations§
Source§impl YearPicker
impl YearPicker
Sourcepub fn new(
first_date: DateTime,
last_date: DateTime,
selected_date: Option<DateTime>,
on_changed: ValueChanged<DateTime>,
) -> YearPicker
pub fn new( first_date: DateTime, last_date: DateTime, selected_date: Option<DateTime>, on_changed: ValueChanged<DateTime>, ) -> YearPicker
Creates a year picker; Dart’s optional named arguments are the setters.
The first_date is the earliest date the user may pick, and the last_date the
latest. Dart’s deprecated, ineffective initialDate has no counterpart.
Sourcepub fn effective_current_date(&self, app: &App) -> DateTime
pub fn effective_current_date(&self, app: &App) -> DateTime
Dart’s currentDate field, as its constructor fills it: the day of the date given, or of
DateTime.now().
Sourcepub fn key(self, key: KeyRef) -> YearPicker
pub fn key(self, key: KeyRef) -> YearPicker
Dart YearPicker(key:).
Sourcepub fn current_date(self, current_date: DateTime) -> YearPicker
pub fn current_date(self, current_date: DateTime) -> YearPicker
Dart YearPicker(currentDate:).
Sourcepub fn drag_start_behavior(
self,
drag_start_behavior: DragStartBehavior,
) -> YearPicker
pub fn drag_start_behavior( self, drag_start_behavior: DragStartBehavior, ) -> YearPicker
Dart YearPicker(dragStartBehavior:).
Sourcepub fn calendar_delegate(
self,
calendar_delegate: Rc<dyn CalendarDelegate>,
) -> YearPicker
pub fn calendar_delegate( self, calendar_delegate: Rc<dyn CalendarDelegate>, ) -> YearPicker
Dart YearPicker(calendarDelegate:).
Trait Implementations§
Source§impl Debug for YearPicker
impl Debug for YearPicker
Source§impl StatefulWidget for YearPicker
impl StatefulWidget for YearPicker
Source§type State = YearPickerState
type State = YearPickerState
Source§fn create_state(&self) -> YearPickerState
fn create_state(&self) -> YearPickerState
Source§fn debug_fill_properties(
&self,
_app: &App,
properties: &mut DiagnosticPropertiesBuilder,
)
fn debug_fill_properties( &self, _app: &App, properties: &mut DiagnosticPropertiesBuilder, )
debugFillProperties: the properties a dump shows for this widget, in Dart’s
order. Dart’s Widget base only sets the dense tree style, which the framework does.Source§fn as_preferred_size_widget(
&self,
) -> Option<&(dyn PreferredSizeWidget + 'static)>
fn as_preferred_size_widget( &self, ) -> Option<&(dyn PreferredSizeWidget + 'static)>
Source§fn type_name(&self) -> &'static str
fn type_name(&self) -> &'static str
Widget::type_name. A stateful form another widget kind becomes (an animated or
status transition widget) names the widget it wraps.Auto Trait Implementations§
impl !RefUnwindSafe for YearPicker
impl !Send for YearPicker
impl !Sync for YearPicker
impl !UnwindSafe for YearPicker
impl Forget for YearPicker
impl Freeze for YearPickerwhere
*const RcInner<dyn Key> is !null: Freeze,
PhantomData<RcInner<dyn Key>>: Freeze,
*const RcInner<dyn Fn(&mut App, DateTime)> is !null: Freeze,
PhantomData<RcInner<dyn Fn(&mut App, DateTime)>>: Freeze,
*const RcInner<dyn CalendarDelegate> is !null: Freeze,
PhantomData<RcInner<dyn CalendarDelegate>>: Freeze,
impl Move for YearPicker
impl Unpin for YearPicker
impl UnsafeUnpin for YearPickerwhere
*const RcInner<dyn Key> is !null: UnsafeUnpin,
PhantomData<RcInner<dyn Key>>: UnsafeUnpin,
*const RcInner<dyn Fn(&mut App, DateTime)> is !null: UnsafeUnpin,
PhantomData<RcInner<dyn Fn(&mut App, DateTime)>>: UnsafeUnpin,
*const RcInner<dyn CalendarDelegate> is !null: UnsafeUnpin,
PhantomData<RcInner<dyn CalendarDelegate>>: UnsafeUnpin,
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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<W> IntoWidget<StatefulKind> for Wwhere
W: StatefulWidget,
impl<W> IntoWidget<StatefulKind> for Wwhere
W: StatefulWidget,
Source§fn into_widget(self) -> Rc<dyn Widget>
fn into_widget(self) -> Rc<dyn Widget>
creation_location.