import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'messages_inbox.dart';
import 'messages_outbox.dart';

class MessagesManagePage extends StatefulWidget {
  MessagesManagePage({Key key}) : super(key: key);

  @override
  _MessagesManagePageState createState() => _MessagesManagePageState();
}

class _MessagesManagePageState extends State<MessagesManagePage> {
  @override
  Widget build(BuildContext context) {
    return DefaultTabController(
      length: 2,
      child: Scaffold(
        appBar: AppBar(
          title: Text('消息管理'),
          centerTitle: true,
          bottom: TabBar(
            labelColor: Colors.blueAccent,
            unselectedLabelColor: Colors.black26,
            tabs: <Widget>[Tab(text: "收件箱"), Tab(text: "已发送")],
          ),
        ),
        body: TabBarView(
          //flutter tabbar禁止手势滑动-OK
          physics: new NeverScrollableScrollPhysics(),
          children: <Widget>[
            MessagesInbox(),
            MessagesOutbox(),
          ],
        ),
      ),
      // theme: ThemeData(
      //     primarySwatch: Colors.yellow
      // ),
    );
  }
}
