|
|
@ -1,15 +1,14 @@
|
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
|
|
|
|
|
|
|
import 'package:get/get.dart';
|
|
|
|
|
|
|
|
import 'package:velocity_x/velocity_x.dart';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import 'package:aku_new_community/ui/service/hall/hall_view.dart';
|
|
|
|
import 'package:aku_new_community/ui/service/hall/hall_view.dart';
|
|
|
|
import 'package:aku_new_community/ui/service/my_take_task/my_take_task_view.dart';
|
|
|
|
import 'package:aku_new_community/ui/service/my_take_task/my_take_task_view.dart';
|
|
|
|
import 'package:aku_new_community/ui/service/my_task/my_task_view.dart';
|
|
|
|
import 'package:aku_new_community/ui/service/my_task/my_task_view.dart';
|
|
|
|
import 'package:aku_new_community/ui/service/publish_task_page.dart';
|
|
|
|
import 'package:aku_new_community/ui/service/publish_task_page.dart';
|
|
|
|
import 'package:aku_new_community/widget/bee_scaffold.dart';
|
|
|
|
import 'package:aku_new_community/widget/bee_scaffold.dart';
|
|
|
|
import 'package:aku_new_community/widget/painter/tab_indicator.dart';
|
|
|
|
import 'package:aku_new_community/widget/painter/tab_indicator.dart';
|
|
|
|
|
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
|
|
|
|
import 'package:flutter_easyrefresh/easy_refresh.dart';
|
|
|
|
|
|
|
|
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
|
|
|
|
|
|
|
import 'package:get/get.dart';
|
|
|
|
|
|
|
|
import 'package:velocity_x/velocity_x.dart';
|
|
|
|
|
|
|
|
|
|
|
|
class TaskPage extends StatefulWidget {
|
|
|
|
class TaskPage extends StatefulWidget {
|
|
|
|
const TaskPage({Key? key}) : super(key: key);
|
|
|
|
const TaskPage({Key? key}) : super(key: key);
|
|
|
@ -22,13 +21,25 @@ class _TaskPageState extends State<TaskPage> with TickerProviderStateMixin {
|
|
|
|
late TabController _tabController;
|
|
|
|
late TabController _tabController;
|
|
|
|
|
|
|
|
|
|
|
|
List<String> _tabs = ['大厅', '我服务的', '我发布的'];
|
|
|
|
List<String> _tabs = ['大厅', '我服务的', '我发布的'];
|
|
|
|
|
|
|
|
List<String> _types = ['跑腿', '家政', '维修', '家教', '其他'];
|
|
|
|
|
|
|
|
List<EasyRefreshController> _refreshControllers = [];
|
|
|
|
|
|
|
|
int _currentType = 0;
|
|
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
@override
|
|
|
|
void initState() {
|
|
|
|
void initState() {
|
|
|
|
_tabController = TabController(length: _tabs.length, vsync: this);
|
|
|
|
_tabController = TabController(length: _tabs.length, vsync: this);
|
|
|
|
|
|
|
|
_refreshControllers = _tabs.map((e) => EasyRefreshController()).toList();
|
|
|
|
super.initState();
|
|
|
|
super.initState();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
|
|
|
|
void dispose() {
|
|
|
|
|
|
|
|
_refreshControllers.forEach((element) {
|
|
|
|
|
|
|
|
element.dispose();
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
super.dispose();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
@override
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
return BeeScaffold(
|
|
|
|
return BeeScaffold(
|
|
|
@ -45,20 +56,46 @@ class _TaskPageState extends State<TaskPage> with TickerProviderStateMixin {
|
|
|
|
))
|
|
|
|
))
|
|
|
|
],
|
|
|
|
],
|
|
|
|
appBarBottom: PreferredSize(
|
|
|
|
appBarBottom: PreferredSize(
|
|
|
|
preferredSize: Size.fromHeight(88.w),
|
|
|
|
preferredSize: Size.fromHeight((88 + 50 + 48).w),
|
|
|
|
|
|
|
|
child: Column(
|
|
|
|
|
|
|
|
mainAxisSize: MainAxisSize.min,
|
|
|
|
|
|
|
|
children: [
|
|
|
|
|
|
|
|
Padding(
|
|
|
|
|
|
|
|
padding: EdgeInsets.symmetric(horizontal: 16.w),
|
|
|
|
child: Row(
|
|
|
|
child: Row(
|
|
|
|
children: [
|
|
|
|
children: [
|
|
|
|
..._tabs
|
|
|
|
..._tabs
|
|
|
|
.mapIndexed(
|
|
|
|
.mapIndexed((currentValue, index) =>
|
|
|
|
(currentValue, index) => _tabCard(currentValue, index))
|
|
|
|
_tabCard(currentValue, index))
|
|
|
|
|
|
|
|
.toList(),
|
|
|
|
|
|
|
|
],
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
Padding(
|
|
|
|
|
|
|
|
padding: EdgeInsets.symmetric(vertical: 24.w, horizontal: 32.w),
|
|
|
|
|
|
|
|
child: Row(
|
|
|
|
|
|
|
|
children: _types
|
|
|
|
|
|
|
|
.mapIndexed((currentValue, index) =>
|
|
|
|
|
|
|
|
_typeBar(currentValue, index))
|
|
|
|
.toList(),
|
|
|
|
.toList(),
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
)
|
|
|
|
],
|
|
|
|
],
|
|
|
|
)),
|
|
|
|
)),
|
|
|
|
body: SafeArea(
|
|
|
|
body: SafeArea(
|
|
|
|
child: TabBarView(controller: _tabController, children: [
|
|
|
|
child: TabBarView(controller: _tabController, children: [
|
|
|
|
HallView(),
|
|
|
|
HallView(
|
|
|
|
MyTakeTaskView(),
|
|
|
|
refreshController: _refreshControllers[0],
|
|
|
|
MyTaskView(),
|
|
|
|
type: _currentType,
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
MyTakeTaskView(
|
|
|
|
|
|
|
|
refreshController: _refreshControllers[1],
|
|
|
|
|
|
|
|
type: _currentType,
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
MyTaskView(
|
|
|
|
|
|
|
|
refreshController: _refreshControllers[2],
|
|
|
|
|
|
|
|
type: _currentType,
|
|
|
|
|
|
|
|
),
|
|
|
|
])),
|
|
|
|
])),
|
|
|
|
);
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -90,4 +127,36 @@ class _TaskPageState extends State<TaskPage> with TickerProviderStateMixin {
|
|
|
|
),
|
|
|
|
),
|
|
|
|
);
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Widget _typeBar(String text, int index) {
|
|
|
|
|
|
|
|
return GestureDetector(
|
|
|
|
|
|
|
|
onTap: () {
|
|
|
|
|
|
|
|
_currentType = index;
|
|
|
|
|
|
|
|
_refreshControllers[_tabController.index].callRefresh();
|
|
|
|
|
|
|
|
setState(() {});
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
child: Material(
|
|
|
|
|
|
|
|
color: Colors.transparent,
|
|
|
|
|
|
|
|
child: _currentType == index
|
|
|
|
|
|
|
|
? Container(
|
|
|
|
|
|
|
|
padding: EdgeInsets.symmetric(vertical: 8.w, horizontal: 24.w),
|
|
|
|
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
|
|
|
|
borderRadius: BorderRadius.circular(30.w),
|
|
|
|
|
|
|
|
color: Color(0xFFFAC058).withOpacity(0.5),
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
child: text.text
|
|
|
|
|
|
|
|
.size(24.sp)
|
|
|
|
|
|
|
|
.color(Colors.black.withOpacity(0.65))
|
|
|
|
|
|
|
|
.make(),
|
|
|
|
|
|
|
|
)
|
|
|
|
|
|
|
|
: Container(
|
|
|
|
|
|
|
|
padding: EdgeInsets.symmetric(vertical: 8.w, horizontal: 24.w),
|
|
|
|
|
|
|
|
child: text.text
|
|
|
|
|
|
|
|
.size(24.sp)
|
|
|
|
|
|
|
|
.color(Colors.black.withOpacity(0.45))
|
|
|
|
|
|
|
|
.make(),
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
);
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|