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.
96 lines
2.7 KiB
96 lines
2.7 KiB
4 years ago
|
import 'package:flutter/material.dart';
|
||
|
import 'package:flutter/cupertino.dart';
|
||
|
import 'package:akuCommunity/utils/screenutil.dart';
|
||
|
import 'package:akuCommunity/base/base_style.dart';
|
||
|
import 'package:akuCommunity/widget/sliver_app_bar_delegate.dart';
|
||
|
import 'package:akuCommunity/widget/common_app_bar.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,
|
||
|
),
|
||
|
labelPadding:
|
||
|
EdgeInsets.symmetric(horizontal: Screenutil.length(131.5)),
|
||
|
indicatorColor: Color(0xffffc40c),
|
||
|
indicatorSize: TabBarIndicatorSize.label,
|
||
|
indicatorPadding:
|
||
|
EdgeInsets.symmetric(horizontal: Screenutil.length(21)),
|
||
|
isScrollable: true,
|
||
|
controller: _controller,
|
||
|
tabs: List.generate(
|
||
|
treeList.length,
|
||
|
(index) => Tab(text: treeList[index]['name']),
|
||
|
),
|
||
|
),
|
||
|
),
|
||
|
),
|
||
|
),
|
||
|
];
|
||
|
}
|
||
|
|
||
|
@override
|
||
|
Widget build(BuildContext context) {
|
||
|
return Scaffold(
|
||
|
appBar: PreferredSize(
|
||
|
child: CommonAppBar(
|
||
|
title: '装修管理',
|
||
|
),
|
||
|
preferredSize: Size.fromHeight(kToolbarHeight),
|
||
|
),
|
||
|
body: NestedScrollView(
|
||
|
headerSliverBuilder: _silverBuilder,
|
||
|
body: TabBarView(
|
||
|
controller: _controller,
|
||
|
children: List.generate(
|
||
|
treeList.length,
|
||
|
(index) => index == 0 ? OwnerManage() : DirectorManage(),
|
||
|
),
|
||
|
),
|
||
|
),
|
||
|
);
|
||
|
}
|
||
|
}
|