You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
aku_new_community/lib/pages/fitup_manage/fitup_manage_page.dart

89 lines
2.5 KiB

4 years ago
import 'package:akuCommunity/widget/bee_scaffold.dart';
import 'package:flutter/material.dart';
import 'package:flutter/cupertino.dart';
4 years ago
import 'package:akuCommunity/utils/headers.dart';
import 'package:akuCommunity/base/base_style.dart';
import 'package:akuCommunity/widget/sliver_app_bar_delegate.dart';
import 'widget/owner_manage.dart';
import 'widget/director_manage.dart';
class FitupManagePage extends StatefulWidget {
FitupManagePage({Key key}) : super(key: key);
@override
_FitupManagePageState createState() => _FitupManagePageState();
}
class _FitupManagePageState extends State<FitupManagePage>
with TickerProviderStateMixin {
TabController _controller;
//导航标签
List<Map<String, dynamic>> treeList = [
{'name': '业主'},
{'name': '装修负责人'},
];
@override
void initState() {
_controller = TabController(length: 2, vsync: this);
super.initState();
}
@override
void dispose() {
_controller.dispose();
super.dispose();
}
List<Widget> _silverBuilder(BuildContext context, bool innerBoxIsScrolled) {
return <Widget>[
SliverPersistentHeader(
pinned: true,
delegate: SliverAppBarDelegate(
minHeight: 56,
maxHeight: 56,
child: Container(
color: Colors.white,
child: TabBar(
unselectedLabelStyle: TextStyle(
fontSize: BaseStyle.fontSize28,
),
labelStyle: TextStyle(
fontWeight: FontWeight.w600,
fontSize: BaseStyle.fontSize28,
),
4 years ago
labelPadding: EdgeInsets.symmetric(horizontal: (131.5).w),
indicatorColor: Color(0xffffc40c),
indicatorSize: TabBarIndicatorSize.label,
4 years ago
indicatorPadding: EdgeInsets.symmetric(horizontal: 21.w),
isScrollable: true,
controller: _controller,
tabs: List.generate(
treeList.length,
(index) => Tab(text: treeList[index]['name']),
),
),
),
),
),
];
}
@override
Widget build(BuildContext context) {
4 years ago
return BeeScaffold(
title: '装修管理',
body: NestedScrollView(
headerSliverBuilder: _silverBuilder,
body: TabBarView(
controller: _controller,
children: List.generate(
treeList.length,
(index) => index == 0 ? OwnerManage() : DirectorManage(),
),
),
),
);
}
}