|
|
@ -151,14 +151,17 @@ class CalendarContainerState extends State<CalendarContainer>
|
|
|
|
MediaQueryData mediaQueryData =
|
|
|
|
MediaQueryData mediaQueryData =
|
|
|
|
MediaQueryData.fromWindow(WidgetsBinding.instance.window);
|
|
|
|
MediaQueryData.fromWindow(WidgetsBinding.instance.window);
|
|
|
|
|
|
|
|
|
|
|
|
itemHeight = calendarProvider.calendarConfiguration.itemSize ??
|
|
|
|
print("mediaQueryData.orientation:${mediaQueryData}");
|
|
|
|
mediaQueryData.orientation == Orientation.landscape
|
|
|
|
//如果itemSize为空,默认是宽度/7。网页版的话是高度/7
|
|
|
|
? mediaQueryData.size.height / 10
|
|
|
|
itemHeight = calendarProvider.calendarConfiguration.itemSize != null
|
|
|
|
: mediaQueryData.size.width / 7;
|
|
|
|
? calendarProvider.calendarConfiguration.itemSize
|
|
|
|
if (calendarProvider.totalHeight == null) {
|
|
|
|
: mediaQueryData.orientation == Orientation.landscape
|
|
|
|
calendarProvider.totalHeight = itemHeight * 6 +
|
|
|
|
? mediaQueryData.size.height / 7
|
|
|
|
calendarProvider.calendarConfiguration.verticalSpacing * (6 - 1);
|
|
|
|
: mediaQueryData.size.width / 7;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
calendarProvider.totalHeight = itemHeight * 6 +
|
|
|
|
|
|
|
|
calendarProvider.calendarConfiguration.verticalSpacing * (6 - 1);
|
|
|
|
|
|
|
|
totalHeight = calendarProvider.totalHeight;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
@override
|
|
|
@ -172,10 +175,6 @@ class CalendarContainerState extends State<CalendarContainer>
|
|
|
|
//暂时先这样写死,提前计算布局的高度,不然会出现问题:a horizontal viewport was given an unlimited amount of I/flutter ( 6759): vertical space in which to expand.
|
|
|
|
//暂时先这样写死,提前计算布局的高度,不然会出现问题:a horizontal viewport was given an unlimited amount of I/flutter ( 6759): vertical space in which to expand.
|
|
|
|
// itemHeight = calendarProvider.calendarConfiguration.itemSize ??
|
|
|
|
// itemHeight = calendarProvider.calendarConfiguration.itemSize ??
|
|
|
|
// MediaQuery.of(context).size.width / 7;
|
|
|
|
// MediaQuery.of(context).size.width / 7;
|
|
|
|
if (totalHeight == null) {
|
|
|
|
|
|
|
|
totalHeight = itemHeight * 6 +
|
|
|
|
|
|
|
|
calendarProvider.calendarConfiguration.verticalSpacing * (6 - 1);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
return Container(
|
|
|
|
return Container(
|
|
|
|
width: itemHeight * 7,
|
|
|
|
width: itemHeight * 7,
|
|
|
|
child: new Column(
|
|
|
|
child: new Column(
|
|
|
|