From d3d99e16e2f5b737b4f5ee122fcb71fe599fda4c Mon Sep 17 00:00:00 2001 From: star Date: Tue, 1 Aug 2023 04:21:07 +0900 Subject: [PATCH] fix: schedule shown twice, overflow on small device --- lib/pages/main_page.dart | 113 +++++++++++++++++++++++++++------------ 1 file changed, 79 insertions(+), 34 deletions(-) diff --git a/lib/pages/main_page.dart b/lib/pages/main_page.dart index c8fcdf50..96b1bd8b 100644 --- a/lib/pages/main_page.dart +++ b/lib/pages/main_page.dart @@ -153,42 +153,87 @@ class _MainPageState extends State { borderRadius: BorderRadius.vertical(top: Radius.circular(16.0)), child: Container( - constraints: const BoxConstraints.expand(), - child: ColoredBox( - color: Colors.white, - child: Padding( - padding: const EdgeInsets.symmetric( - horizontal: 16.0, - vertical: 16.0, - ), - child: Column( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - Column( - children: [ - _buildTimetable(infoModel.user, semester, now), - const SizedBox(height: 24.0), - _buildDivider(), - const SizedBox(height: 24.0), - _buildSchedule(now, infoModel.currentSchedule), - _buildSchedule(now, infoModel.currentSchedule), - const SizedBox(height: 24.0), - _buildDivider(), - ], + constraints: const BoxConstraints.expand(), + child: CustomScrollView( + reverse: true, + slivers: [ + SliverFillRemaining( + hasScrollBody: false, + child: ColoredBox( + color: Colors.white, + child: Padding( + padding: const EdgeInsets.symmetric( + horizontal: 16.0, + vertical: 16.0, + ), + child: Column( + children: [ + Column( + children: [ + _buildTimetable( + infoModel.user, semester, now), + const SizedBox(height: 24.0), + _buildDivider(), + const SizedBox(height: 24.0), + _buildSchedule( + now, infoModel.currentSchedule), + const SizedBox(height: 24.0), + _buildDivider(), + ], + ), + Spacer(), + Column( + children: [ + _buildLogo(), + const SizedBox(height: 4.0), + _buildCopyRight(), + _buildTextButtons(context), + ], + ) + ], + ), + ), ), - Column( - children: [ - _buildLogo(), - const SizedBox(height: 4.0), - _buildCopyRight(), - _buildTextButtons(context), - ], - ) - ], - ), + ), + ], + ) + + // SingleChildScrollView( + // child: ColoredBox( + // color: Colors.white, + // child: Padding( + // padding: const EdgeInsets.symmetric( + // horizontal: 16.0, + // vertical: 16.0, + // ), + // child: Column( + // mainAxisAlignment: MainAxisAlignment.spaceBetween, + // children: [ + // Column( + // children: [ + // _buildTimetable(infoModel.user, semester, now), + // const SizedBox(height: 24.0), + // _buildDivider(), + // const SizedBox(height: 24.0), + // _buildSchedule(now, infoModel.currentSchedule), + // const SizedBox(height: 24.0), + // _buildDivider(), + // ], + // ), + // Column( + // children: [ + // _buildLogo(), + // const SizedBox(height: 4.0), + // _buildCopyRight(), + // _buildTextButtons(context), + // ], + // ) + // ], + // ), + // ), + // ), + // ), ), - ), - ), ), ), ],