pub struct SimpleDialog {Show 17 fields
pub key: Option<KeyRef>,
pub title: Option<WidgetRef>,
pub title_padding: EdgeInsetsGeometry,
pub title_text_style: Option<TextStyle>,
pub children: Option<Vec<WidgetRef>>,
pub content_padding: EdgeInsetsGeometry,
pub background_color: Option<Color>,
pub elevation: Option<f64>,
pub shadow_color: Option<Color>,
pub surface_tint_color: Option<Color>,
pub content_text_style: Option<TextStyle>,
pub semantic_label: Option<String>,
pub inset_padding: Option<EdgeInsets>,
pub clip_behavior: Option<Clip>,
pub shape: Option<ShapeBorderRef>,
pub alignment: Option<AlignmentGeometry>,
pub constraints: Option<BoxConstraints>,
}Expand description
A simple Material Design dialog.
A simple dialog offers the user a choice between several options. A simple dialog has an optional title that is displayed above the choices.
Choices are normally represented using SimpleDialogOption widgets. If
other widgets are used, see content_padding for notes
regarding the conventions for obtaining the spacing expected by Material
Design.
For dialogs that inform the user about a situation, consider using an
AlertDialog.
Typically passed as the child widget to ShowDialog, which displays the
dialog.
See also:
SimpleDialogOption, which are options used in this type of dialog.AlertDialog, for dialogs that have a row of buttons below the body.Dialog, on whichSimpleDialogandAlertDialogare based.ShowDialog, which actually displays the dialog and returns its result.- https://material.io/design/components/dialogs.html#simple-dialog
Fields§
§key: Option<KeyRef>§title: Option<WidgetRef>The (optional) title of the dialog is displayed in a large font at the top of the dialog.
Typically a Text widget.
title_padding: EdgeInsetsGeometryPadding around the title.
If there is no title, no padding will be provided.
By default, this provides the recommend Material Design padding of 24 pixels around the left, top, and right edges of the title.
See content_padding for the conventions regarding
padding between the title and the children.
title_text_style: Option<TextStyle>Style for the text in the title of this SimpleDialog.
If null, DialogThemeData::title_text_style is used. If that’s null,
defaults to TextTheme::title_large of ThemeData::text_theme.
children: Option<Vec<WidgetRef>>The (optional) content of the dialog is displayed in a
SingleChildScrollView underneath the title.
Typically a list of SimpleDialogOptions.
content_padding: EdgeInsetsGeometryPadding around the content.
By default, this is 12 pixels on the top and 16 pixels on the bottom. This is intended to be combined with children that have 24 pixels of padding on the left and right, and 8 pixels of padding on the top and bottom, so that the content ends up being indented 20 pixels from the title, 24 pixels from the bottom, and 24 pixels from the sides.
The SimpleDialogOption widget uses such padding.
If there is no title, the content_padding
should be adjusted so that the top padding ends up being 24 pixels.
background_color: Option<Color>§elevation: Option<f64>See Dialog::elevation.
shadow_color: Option<Color>See Dialog::shadow_color.
surface_tint_color: Option<Color>§content_text_style: Option<TextStyle>Style for the text in the children of this SimpleDialog.
If null, DialogThemeData::content_text_style is used. If that’s null,
defaults to TextTheme::title_medium of ThemeData::text_theme.
semantic_label: Option<String>The semantic label of the dialog used by accessibility frameworks to announce screen transitions when the dialog is opened and closed.
If this label is not provided, a semantic label will be inferred from the
title if it is not null. If there is no title, the label will be
taken from MaterialLocalizations::dialog_label.
inset_padding: Option<EdgeInsets>§clip_behavior: Option<Clip>§shape: Option<ShapeBorderRef>See Dialog::shape.
alignment: Option<AlignmentGeometry>See Dialog::alignment.
constraints: Option<BoxConstraints>See Dialog::constraints.
Implementations§
Source§impl SimpleDialog
impl SimpleDialog
Sourcepub fn new() -> SimpleDialog
pub fn new() -> SimpleDialog
Creates a simple dialog.
Typically used in conjunction with ShowDialog.
Sourcepub fn key(self, key: KeyRef) -> SimpleDialog
pub fn key(self, key: KeyRef) -> SimpleDialog
Dart SimpleDialog(key:).
Sourcepub fn title<K>(self, title: impl IntoWidget<K>) -> SimpleDialog
pub fn title<K>(self, title: impl IntoWidget<K>) -> SimpleDialog
Dart SimpleDialog(title:).
Sourcepub fn title_padding(
self,
title_padding: impl Into<EdgeInsetsGeometry>,
) -> SimpleDialog
pub fn title_padding( self, title_padding: impl Into<EdgeInsetsGeometry>, ) -> SimpleDialog
Dart SimpleDialog(titlePadding:).
Sourcepub fn title_text_style(self, title_text_style: TextStyle) -> SimpleDialog
pub fn title_text_style(self, title_text_style: TextStyle) -> SimpleDialog
Dart SimpleDialog(titleTextStyle:).
Sourcepub fn children(
self,
children: impl IntoIterator<Item = WidgetRef>,
) -> SimpleDialog
pub fn children( self, children: impl IntoIterator<Item = WidgetRef>, ) -> SimpleDialog
Dart SimpleDialog(children:).
Sourcepub fn content_padding(
self,
content_padding: impl Into<EdgeInsetsGeometry>,
) -> SimpleDialog
pub fn content_padding( self, content_padding: impl Into<EdgeInsetsGeometry>, ) -> SimpleDialog
Dart SimpleDialog(contentPadding:).
Sourcepub fn content_text_style(self, content_text_style: TextStyle) -> SimpleDialog
pub fn content_text_style(self, content_text_style: TextStyle) -> SimpleDialog
Dart SimpleDialog(contentTextStyle:).
Sourcepub fn background_color(self, background_color: Color) -> SimpleDialog
pub fn background_color(self, background_color: Color) -> SimpleDialog
Dart SimpleDialog(backgroundColor:).
Sourcepub fn elevation(self, elevation: f64) -> SimpleDialog
pub fn elevation(self, elevation: f64) -> SimpleDialog
Dart SimpleDialog(elevation:).
Sourcepub fn shadow_color(self, shadow_color: Color) -> SimpleDialog
pub fn shadow_color(self, shadow_color: Color) -> SimpleDialog
Dart SimpleDialog(shadowColor:).
Sourcepub fn surface_tint_color(self, surface_tint_color: Color) -> SimpleDialog
pub fn surface_tint_color(self, surface_tint_color: Color) -> SimpleDialog
Dart SimpleDialog(surfaceTintColor:).
Sourcepub fn semantic_label(self, semantic_label: impl Into<String>) -> SimpleDialog
pub fn semantic_label(self, semantic_label: impl Into<String>) -> SimpleDialog
Dart SimpleDialog(semanticLabel:).
Sourcepub fn inset_padding(self, inset_padding: EdgeInsets) -> SimpleDialog
pub fn inset_padding(self, inset_padding: EdgeInsets) -> SimpleDialog
Dart SimpleDialog(insetPadding:).
Sourcepub fn clip_behavior(self, clip_behavior: Clip) -> SimpleDialog
pub fn clip_behavior(self, clip_behavior: Clip) -> SimpleDialog
Dart SimpleDialog(clipBehavior:).
Sourcepub fn shape(self, shape: impl Into<ShapeBorderRef>) -> SimpleDialog
pub fn shape(self, shape: impl Into<ShapeBorderRef>) -> SimpleDialog
Dart SimpleDialog(shape:).
Sourcepub fn alignment(self, alignment: AlignmentGeometry) -> SimpleDialog
pub fn alignment(self, alignment: AlignmentGeometry) -> SimpleDialog
Dart SimpleDialog(alignment:).
Sourcepub fn constraints(self, constraints: BoxConstraints) -> SimpleDialog
pub fn constraints(self, constraints: BoxConstraints) -> SimpleDialog
Dart SimpleDialog(constraints:).
Trait Implementations§
Source§impl Debug for SimpleDialog
impl Debug for SimpleDialog
Source§impl Default for SimpleDialog
impl Default for SimpleDialog
Source§fn default() -> SimpleDialog
fn default() -> SimpleDialog
Source§impl StatelessWidget for SimpleDialog
impl StatelessWidget for SimpleDialog
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 + 'static)>
fn as_preferred_size_widget( &self, ) -> Option<&(dyn PreferredSizeWidget + 'static)>
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 SimpleDialog
impl !Send for SimpleDialog
impl !Sync for SimpleDialog
impl !UnwindSafe for SimpleDialog
impl Forget for SimpleDialog
impl Freeze for SimpleDialogwhere
*const RcInner<dyn Key> is !null: Freeze,
PhantomData<RcInner<dyn Key>>: Freeze,
*const RcInner<dyn Widget> is !null: Freeze,
PhantomData<RcInner<dyn Widget>>: Freeze,
&'static dyn ColorExtension: Freeze,
*const RcInner<dyn ColorExtension> is !null: Freeze,
PhantomData<RcInner<dyn ColorExtension>>: Freeze,
*const u8 is !null: Freeze,
PhantomData<u8>: Freeze,
PhantomData<String>: Freeze,
*const RcInner<Paint> is !null: Freeze,
PhantomData<RcInner<Paint>>: Freeze,
PhantomData<Shadow>: Freeze,
PhantomData<FontFeature>: Freeze,
PhantomData<FontVariation>: Freeze,
PhantomData<Rc<dyn Widget>>: Freeze,
*const RcInner<dyn ShapeBorder> is !null: Freeze,
PhantomData<RcInner<dyn ShapeBorder>>: Freeze,
impl Move for SimpleDialog
impl Unpin for SimpleDialog
impl UnsafeUnpin for SimpleDialogwhere
*const RcInner<dyn Key> is !null: UnsafeUnpin,
PhantomData<RcInner<dyn Key>>: UnsafeUnpin,
*const RcInner<dyn Widget> is !null: UnsafeUnpin,
PhantomData<RcInner<dyn Widget>>: UnsafeUnpin,
&'static dyn ColorExtension: UnsafeUnpin,
*const RcInner<dyn ColorExtension> is !null: UnsafeUnpin,
PhantomData<RcInner<dyn ColorExtension>>: UnsafeUnpin,
*const u8 is !null: UnsafeUnpin,
PhantomData<u8>: UnsafeUnpin,
PhantomData<String>: UnsafeUnpin,
*const RcInner<Paint> is !null: UnsafeUnpin,
PhantomData<RcInner<Paint>>: UnsafeUnpin,
PhantomData<Shadow>: UnsafeUnpin,
PhantomData<FontFeature>: UnsafeUnpin,
PhantomData<FontVariation>: UnsafeUnpin,
PhantomData<Rc<dyn Widget>>: UnsafeUnpin,
*const RcInner<dyn ShapeBorder> is !null: UnsafeUnpin,
PhantomData<RcInner<dyn ShapeBorder>>: 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.