美文网首页
关于flutter dialog里面更新(如dialog套dia

关于flutter dialog里面更新(如dialog套dia

作者: 禄子_c79b | 来源:发表于2023-09-04 16:58 被阅读0次
// Displays a Material dialog above the current contents of the app, with
/// Material entrance and exit animations, modal barrier color, and modal
/// barrier behavior (dialog is dismissible with a tap on the barrier).
///
/// This function takes a `builder` which typically builds a [Dialog] widget.
/// Content below the dialog is dimmed with a [ModalBarrier]. The widget
/// returned by the `builder` does not share a context with the location that
/// [showDialog] is originally called from. Use a [StatefulBuilder] or a
/// custom [StatefulWidget] if the dialog needs to update dynamically.
///
  • 1局部更新dialog外套一层StatefulBuilder
  • 2自定义dialog StatefulWidget
  • 3强制build Element element=context as Element;
    element.markNeedsBuild();

相关文章

网友评论

      本文标题:关于flutter dialog里面更新(如dialog套dia

      本文链接:https://www.haomeiwen.com/subject/xvlcvdtx.html