我是 flutter 的初学者,我找到了这个我想使用的包https://pub.dev/packages/flutter_calendar_carousel。我正在尝试将它用于颤振网络应用程序。我去运行了这个例子,它可以工作,但是当我最大化窗口时出现问题,它看起来不太好;大圆圈,与在小窗口中时看起来不一样(大小问题,缩放不好):
我尝试使用 AspectRatio 小部件,它看起来更好,但它仍然太大。我不确定如何正确使用纵横比,但还有其他方法可以解决吗?TLDR;我希望日历可读并根据屏幕大小进行缩放。这是示例 btw 中的代码:
import 'package:flutter_calendar_carousel/flutter_calendar_carousel.dart'
show CalendarCarousel;
import 'package:flutter_calendar_carousel/classes/event.dart';
import 'package:flutter_calendar_carousel/classes/event_list.dart';
import 'package:intl/intl.dart' show DateFormat;
void main() => runApp(new MyApp());
class MyApp extends StatelessWidget {
// This widget is the root of your application.
@override
Widget build(BuildContext context) {
return new MaterialApp(
title: 'dooboolab flutter calendar',
theme: new ThemeData(
// This is the theme of your application.
//
// Try running your application with "flutter run". You'll see the
// application has a …Run Code Online (Sandbox Code Playgroud)