简体   繁体   English

是否可以在 flutter 中添加浮动操作按钮所需的参数?

[英]Is it possible to add required parameter for Floating action button in flutter?

If you see some E-commerce apps it prompts a size or color required to be selected,if you click on add to cart button without selecting a color or size.When the user clicks on add to cart button i want a required parameter, where the user should select a size and only then the function in onPressed should work.如果您看到一些电子商务应用程序,它会提示需要选择尺寸或颜色,如果您单击添加到购物车按钮而不选择颜色或尺寸。当用户单击添加到购物车按钮时,我需要一个必需的参数,其中用户应该 select 一个大小,然后 onPressed 中的 function 应该工作。 .How do i add that required parameter with FloatingActionButton? .如何使用 FloatingActionButton 添加所需的参数?

Then you can use an expanded Floating action button which displays the size and on clicking the size it can add the item to cart.然后,您可以使用显示尺寸的扩展浮动操作按钮,单击该尺寸可以将商品添加到购物车。 Or else you can have a dialog box to select the size and after that, it can be added to cart.或者你可以有一个对话框来 select 的大小,然后,它可以被添加到购物车。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM