Flutter的自定义dialog

narakuyang
2023-02-28 / 0 评论 / 59 阅读 / 正在检测是否收录...
 showGeneralDialog(
                          barrierDismissible: true,
                          barrierLabel: 'open',
                          barrierColor: Colors.transparent,
                          context: context,
                          transitionDuration: Duration(milliseconds: 200),
                          transitionBuilder: (BuildContext context,
                              Animation<double> animation,
                              Animation<double> secondaryAnimation,
                              Widget child) {
                            return FadeTransition(
                                opacity: animation, child: child);
                          },
                          pageBuilder: (BuildContext buildContext,
                                  Animation<double> animation,
                                  Animation<double> secondaryAnimation) =>
                              Align(
                                  alignment: Alignment.centerRight,
                                  child: Material(
                                      color: appColor.main.withOpacity(0.5),
                                      child: Container(
                                        width: 200,
                                        child: SingleChildScrollView(
                                          child: Padding(
                                            padding: const EdgeInsets.all(8),
                                            child: Wrap(
                                              spacing: 12,
                                              runSpacing: 6,
                                              alignment: WrapAlignment.start,
                                              runAlignment: WrapAlignment.start,
                                              crossAxisAlignment:
                                                  WrapCrossAlignment.start,
                                              children: buttomListPlay(),
                                            ),
                                          ),
                                        ),
                                      ))));
0

评论

博主关闭了所有页面的评论