增加支持web预览

develop
xiaodong 5 years ago
parent d0da3b9e90
commit 9da491cba7

@ -0,0 +1,10 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>flutter_demo</title>
</head>
<body>
<script src="main.dart.js" type="application/javascript"></script>
</body>
</html>

@ -147,9 +147,14 @@ 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.
MediaQueryData mediaQueryData =
MediaQueryData.fromWindow(WidgetsBinding.instance.window);
itemHeight = calendarProvider.calendarConfiguration.itemSize ?? itemHeight = calendarProvider.calendarConfiguration.itemSize ??
MediaQueryData.fromWindow(WidgetsBinding.instance.window).size.width / mediaQueryData.orientation == Orientation.landscape
7; ? mediaQueryData.size.height / 10
: mediaQueryData.size.width / 7;
if (calendarProvider.totalHeight == null) { if (calendarProvider.totalHeight == null) {
calendarProvider.totalHeight = itemHeight * 6 + calendarProvider.totalHeight = itemHeight * 6 +
calendarProvider.calendarConfiguration.verticalSpacing * (6 - 1); calendarProvider.calendarConfiguration.verticalSpacing * (6 - 1);
@ -165,8 +170,8 @@ class CalendarContainerState extends State<CalendarContainer>
Widget build(BuildContext context) { Widget build(BuildContext context) {
LogUtil.log(TAG: this.runtimeType, message: "CalendarContainerState build"); LogUtil.log(TAG: this.runtimeType, message: "CalendarContainerState build");
//,,: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) { if (totalHeight == null) {
totalHeight = itemHeight * 6 + totalHeight = itemHeight * 6 +
calendarProvider.calendarConfiguration.verticalSpacing * (6 - 1); calendarProvider.calendarConfiguration.verticalSpacing * (6 - 1);

Loading…
Cancel
Save