From c7509a789ff4e58b271416ec0862f293fd901ed1 Mon Sep 17 00:00:00 2001 From: datang Date: Wed, 25 May 2022 11:14:31 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BB=BB=E5=8A=A1=E5=8F=91=E5=B8=83tab?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../function_and_service/task/task_page.dart | 22 +++++++++++-------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/lib/ui/function_and_service/task/task_page.dart b/lib/ui/function_and_service/task/task_page.dart index 36e33e70..cc96a211 100644 --- a/lib/ui/function_and_service/task/task_page.dart +++ b/lib/ui/function_and_service/task/task_page.dart @@ -69,14 +69,7 @@ class _TaskPageState extends State with TickerProviderStateMixin { children: [ Padding( padding: EdgeInsets.symmetric(horizontal: 16.w), - child: Row( - children: [ - ...TaskMap.taskMode.values - .mapIndexed((currentValue, index) => - _tabCard(currentValue, index)) - .toList(), - ], - ), + child: _tabChange() ), Padding( padding: EdgeInsets.symmetric(vertical: 24.w, horizontal: 32.w), @@ -91,7 +84,7 @@ class _TaskPageState extends State with TickerProviderStateMixin { )), body: SafeArea( child: TabBarView( - //physics: NeverScrollableScrollPhysics(), + physics: NeverScrollableScrollPhysics(), controller: _tabController, children: [ HallView( @@ -110,6 +103,17 @@ class _TaskPageState extends State with TickerProviderStateMixin { ); } + Row _tabChange(){ + return Row( + children: [ + ...TaskMap.taskMode.values + .mapIndexed((currentValue, index) => + _tabCard(currentValue, index)) + .toList(), + ], + ); + } + Widget _tabCard(String title, int index) { var select = index == _tabController.index; return GestureDetector(