pub struct IndexedStack {
pub key: Option<KeyRef>,
pub alignment: AlignmentGeometry,
pub text_direction: Option<TextDirection>,
pub clip_behavior: Clip,
pub sizing: StackFit,
pub index: Option<i32>,
pub children: Vec<WidgetRef>,
}Expand description
A Stack that shows a single child from a list of children.
The displayed child is the one with the given index. The stack is always as
big as the largest child.
If the index is None, then nothing is displayed.
See also:
Stack, for more details about stacks.- The catalog of layout widgets.
Flutter’s widgets/indexed_stack.dart; it lives here until that file has a home of its own.
Fields§
§key: Option<KeyRef>§alignment: AlignmentGeometryHow to align the non-positioned and partially-positioned children in the stack.
Defaults to AlignmentGeometry::TOP_START. See Stack::alignment.
text_direction: Option<TextDirection>The text direction with which to resolve alignment.
Defaults to the ambient Directionality.
clip_behavior: ClipDefaults to Clip::HardEdge.
sizing: StackFitHow to size the non-positioned children in the stack.
Defaults to StackFit::Loose. See Stack::fit.
index: Option<i32>The index of the child to show.
If this is None, none of the children will be shown.
children: Vec<WidgetRef>The child widgets of the stack.
Only the child at index index will be shown.
Implementations§
Source§impl IndexedStack
impl IndexedStack
Sourcepub fn new() -> IndexedStack
pub fn new() -> IndexedStack
Creates a Stack widget that paints a single child; Dart’s named arguments are the
setters.
Sourcepub fn key(self, key: KeyRef) -> IndexedStack
pub fn key(self, key: KeyRef) -> IndexedStack
Dart IndexedStack(key:).
Sourcepub fn alignment(self, alignment: AlignmentGeometry) -> IndexedStack
pub fn alignment(self, alignment: AlignmentGeometry) -> IndexedStack
Dart IndexedStack(alignment:).
Sourcepub fn text_direction(self, text_direction: TextDirection) -> IndexedStack
pub fn text_direction(self, text_direction: TextDirection) -> IndexedStack
Dart IndexedStack(textDirection:).
Sourcepub fn clip_behavior(self, clip_behavior: Clip) -> IndexedStack
pub fn clip_behavior(self, clip_behavior: Clip) -> IndexedStack
Dart IndexedStack(clipBehavior:).
Sourcepub fn sizing(self, sizing: StackFit) -> IndexedStack
pub fn sizing(self, sizing: StackFit) -> IndexedStack
Dart IndexedStack(sizing:).
Sourcepub fn index(self, index: Option<i32>) -> IndexedStack
pub fn index(self, index: Option<i32>) -> IndexedStack
Dart IndexedStack(index:); None shows no child, which the default (Some(0)) does
not express.
Sourcepub fn children(
self,
children: impl IntoIterator<Item = WidgetRef>,
) -> IndexedStack
pub fn children( self, children: impl IntoIterator<Item = WidgetRef>, ) -> IndexedStack
Dart IndexedStack(children:).
Trait Implementations§
Source§impl Debug for IndexedStack
impl Debug for IndexedStack
Source§impl Default for IndexedStack
impl Default for IndexedStack
Source§fn default() -> IndexedStack
fn default() -> IndexedStack
Source§impl StatelessWidget for IndexedStack
impl StatelessWidget for IndexedStack
Source§fn build(&self, _app: &mut App, _context: BuildContext) -> WidgetRef
fn build(&self, _app: &mut App, _context: BuildContext) -> WidgetRef
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 debug_check_constructor(&self)
fn debug_check_constructor(&self)
Source§fn as_preferred_size_widget(&self) -> Option<&dyn PreferredSizeWidget>
fn as_preferred_size_widget(&self) -> Option<&dyn PreferredSizeWidget>
this is PreferredSizeWidget: a widget that implements PreferredSizeWidget
answers with itself, which is what a parent asking an erased child for its preferred
size reads.Auto Trait Implementations§
impl !RefUnwindSafe for IndexedStack
impl !Send for IndexedStack
impl !Sync for IndexedStack
impl !UnwindSafe for IndexedStack
impl Forget for IndexedStack
impl Freeze for IndexedStack
impl Move for IndexedStack
impl Unpin for IndexedStack
impl UnsafeUnpin for IndexedStackwhere
*const RcInner<dyn Key> is !null: UnsafeUnpin,
PhantomData<RcInner<dyn Key>>: UnsafeUnpin,
*const u8 is !null: UnsafeUnpin,
PhantomData<Rc<dyn Widget>>: 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<StatelessKind> for Wwhere
W: StatelessWidget,
impl<W> IntoWidget<StatelessKind> for Wwhere
W: StatelessWidget,
Source§fn into_widget(self) -> Rc<dyn Widget>
fn into_widget(self) -> Rc<dyn Widget>
creation_location.