flutter 在发布的apk中使用datePicker有问题

pftdvrlh  于 2023-08-07  发布在  Flutter
关注(0)|答案(1)|浏览(128)

你好,伙计们,你能帮助我解决这个问题,我面临的发布apk我使用datePicker小部件来显示日期在我的应用程序,它在调试apk工作得很好,但当我尝试发布apk有时容器出现空.
enter image description here
这是显示datePicker小部件的代码

_addDateBar() {

    return Container(

      margin: EdgeInsets.only(

        top: 2.4.h,

        left: 5.6.w,

      ),

      child: DatePicker(

        height: 12.6.h,

        DateTime.now(),

        selectedTextColor: Colors.white,

        initialSelectedDate: DateTime.now(),

        selectionColor: primaryClr,

        dateTextStyle: TextStyle(

            fontWeight: FontWeight.w600, fontSize: 16.sp, color: Colors.grey),

        dayTextStyle: TextStyle(

            fontWeight: FontWeight.w600, fontSize: 12.sp, color: Colors.grey),

        monthTextStyle: TextStyle(

            fontWeight: FontWeight.w600, fontSize: 12.sp, color: Colors.grey),

        onDateChange: (date) {

          setState(() {

            _selectedDate = date;

          });

        },

      ),

    );

  }

字符串

tyky79it

tyky79it1#

我已经解决了这个问题,只是将fontSize设置为简单的double,而不在DatePicker中使用的所有文本中使用.sp

相关问题