How do I stop this flutter calendar widget from overflowing in the default test surface?

I have a flutter app with an events list. I am adding a calendar view where the events can be seen as dots on a calendar grid with an events list underneath if a day with events is selected. I got a premade widget from flutter gems here: https://fluttergems.dev/packages/flutter_neat_and_clean_calendar/

src:
https://github.com/rwbr/flutter_neat_and_clean_calendar/blob/main/lib/flutter_neat_and_clean_calendar.dart

This works and looks fine in typical phone dimensions but my tests fail because the test surface that the widget is pumped on is more square. Similarly, rotating the phone will cause this overflow. I want to eventually create a different calendar page for the rotated view. For now, I would like to figure out how to get the calendar to not overflow.

I tried to wrap the calendar widget in a SingleChildScrollView but this led to the error:

 I/flutter ( 4605): ══╡ EXCEPTION CAUGHT BY RENDERING LIBRARY ╞═════════════════════════════════════════════════════════
I/flutter ( 4605): The following assertion was thrown during performLayout():
I/flutter ( 4605): RenderFlex children have non-zero flex but incoming height constraints are unbounded.
I/flutter ( 4605): When a column is in a parent that does not provide a finite height constraint, for example if it is
I/flutter ( 4605): in a vertical scrollable, it will try to shrink-wrap its children along the vertical axis. Setting a
I/flutter ( 4605): flex on a child (e.g. using Expanded) indicates that the child is to expand to fill the remaining
I/flutter ( 4605): space in the vertical direction.
I/flutter ( 4605): These two directives are mutually exclusive. If a parent is to shrink-wrap its child, the child
I/flutter ( 4605): cannot simultaneously expand to fit its parent.
I/flutter ( 4605): Consider setting mainAxisSize to MainAxisSize.min and using FlexFit.loose fits for the flexible
I/flutter ( 4605): children (using Flexible rather than Expanded). This will allow the flexible children to size
I/flutter ( 4605): themselves to less than the infinite remaining space they would otherwise be forced to take, and
I/flutter ( 4605): then will cause the RenderFlex to shrink-wrap the children rather than expanding to fit the maximum
I/flutter ( 4605): constraints provided by the parent.

I tried changing the use of Expanded’s to Flexible with fit: FlexFit.loose. Perhaps I missed some but I was getting another error that that the size was missing. I also briefly gave up and just set the test surface’s dimensions manually to get around the overflow. However I am now trying to get the widget to work on any screen (not necessarily look good, just not overflow). I tried going into the source code and changing the individual parts of the widget (it is a Container with a Column with Children: Row (for top part of calendar), GridView for the calendar days, Row for an expansion button (can collapse/expand the calendar from 30-day view to 7-day view), and then an ListView Builder’s event list. I tried wrapping the GridView in a SingleChildScrollView but it still overflows and doesnt allow scrolling. The day GridView is actually wrapped in a GestureDetector. Not sure if this needs to be accounted for.

This is my calendar page:

CalendarPage(), shows a search bar and a calendar

and this is my test code:

    testWidgets('CalendarPage shows Calendar and Search Bar',
        (WidgetTester tester) async {
      // test is fragile due to overlow of calendar when height is too low or high relative to width
      //await tester.binding.setSurfaceSize(Size(300,497));
      var numEvents = 7;
      // Mock event list for testing
      testEvent(int idx) => NeatCleanCalendarEvent("A Test Event ${idx}",
          isMultiDay: true,
          startTime: DateTime.now().add(Duration(hours: idx * idx)),
          endTime: DateTime.now()
              .add(Duration(hours: idx * idx))
              .add(Duration(hours: 25)),
          description: 'A test event',
          color: Colors.blue);
      var mockEvents = List.generate(numEvents, testEvent);

      // Pump the CalendarPage with a mocked event list
      /*
      await tester.pumpWidget(MaterialApp(
          home: Scaffold(body: SingleChildScrollView(child:
          CalendarPage(eventList: mockEvents))))
      );
      */
      await tester.pumpWidget(MaterialApp(
          home: Scaffold(body:
          CalendarPage(eventList: mockEvents)))
      );
     
    
      expect(find.byType(CalendarPage), findsOneWidget);
      await tester.pumpAndSettle(); // Rebuild the widget after the state has changed

      // Verify the search bar is present
      expect(find.byType(TextField), findsOneWidget);
      expect(find.byType(Calendar), findsOneWidget);

    });


If anyone could come up with some solutions that get around the overflow, I would really appreciate it!

( )

Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa Dịch vụ tổ chức sự kiện 5 sao Thông tin về chúng tôi Dịch vụ sinh nhật bé trai Dịch vụ sinh nhật bé gái Sự kiện trọn gói Các tiết mục giải trí Dịch vụ bổ trợ Tiệc cưới sang trọng Dịch vụ khai trương Tư vấn tổ chức sự kiện Hình ảnh sự kiện Cập nhật tin tức Liên hệ ngay Thuê chú hề chuyên nghiệp Tiệc tất niên cho công ty Trang trí tiệc cuối năm Tiệc tất niên độc đáo Sinh nhật bé Hải Đăng Sinh nhật đáng yêu bé Khánh Vân Sinh nhật sang trọng Bích Ngân Tiệc sinh nhật bé Thanh Trang Dịch vụ ông già Noel Xiếc thú vui nhộn Biểu diễn xiếc quay đĩa Dịch vụ tổ chức tiệc uy tín Khám phá dịch vụ của chúng tôi Tiệc sinh nhật cho bé trai Trang trí tiệc cho bé gái Gói sự kiện chuyên nghiệp Chương trình giải trí hấp dẫn Dịch vụ hỗ trợ sự kiện Trang trí tiệc cưới đẹp Khởi đầu thành công với khai trương Chuyên gia tư vấn sự kiện Xem ảnh các sự kiện đẹp Tin mới về sự kiện Kết nối với đội ngũ chuyên gia Chú hề vui nhộn cho tiệc sinh nhật Ý tưởng tiệc cuối năm Tất niên độc đáo Trang trí tiệc hiện đại Tổ chức sinh nhật cho Hải Đăng Sinh nhật độc quyền Khánh Vân Phong cách tiệc Bích Ngân Trang trí tiệc bé Thanh Trang Thuê dịch vụ ông già Noel chuyên nghiệp Xem xiếc khỉ đặc sắc Xiếc quay đĩa thú vị
Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa
Thiết kế website Thiết kế website Thiết kế website Cách kháng tài khoản quảng cáo Mua bán Fanpage Facebook Dịch vụ SEO Tổ chức sinh nhật