Flutter中日期选择器的大小 [英] Size of the Date Picker in Flutter

查看:428
本文介绍了Flutter中日期选择器的大小的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使ipad陷入困境.我有一个日期选择器.但从景观上看,它显示得很大.

I am making an ipad in flutter. I have a date picker. But in landscape it is showing pretty big.

有什么方法可以调整日期选择器对话框的大小?

Is there any way to resize the date picker dialog

推荐答案

是的,您可以在Builder中使用Container(),SizedBox()等来调整日期选择器对话框的大小,但前提是您将其放在类似Column的东西中(),例如:

Yes, you can resize date picker dialog by Container(), SizedBox() etc. using it in builder, but only if you put it in something like Column(), for example:

return showDatePicker(
  context: context,
  initialDate: DateTime.now(),
  firstDate: DateTime.now(),
  lastDate: DateTime.now().add(Duration(days: 356)),
  builder: (context, child) {
    return Column(
      children: <Widget>[
        Padding(
          padding: const EdgeInsets.only(top: 50.0),
          child: Container(
            height: 450,
            width: 700,
            child: child,
          ),
        ),
      ],
    );
  },
);

这篇关于Flutter中日期选择器的大小的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆