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.
project_telephony/lib/ui/home/content_connect_page.dart

129 lines
4.0 KiB

import 'package:flutter/material.dart';
import 'package:flutter_easyrefresh/easy_refresh.dart';
import 'package:project_telephony/base/base_style.dart';
2 years ago
import 'package:project_telephony/ui/home/calling_idle_list.dart';
import 'package:project_telephony/ui/widget/plone_back_button.dart';
import 'package:project_telephony/utils/headers.dart';
2 years ago
import 'package:shared_preferences/shared_preferences.dart';
import 'package:tab_indicator_styler/tab_indicator_styler.dart';
class ContentConnectPage extends StatefulWidget {
const ContentConnectPage({Key? key}) : super(key: key);
@override
_ContentConnectPageState createState() => _ContentConnectPageState();
}
class _ContentConnectPageState extends State<ContentConnectPage>
with AutomaticKeepAliveClientMixin, SingleTickerProviderStateMixin {
late TabController _tabController;
2 years ago
final EasyRefreshController _answerRefreshController =
EasyRefreshController();
2 years ago
final EasyRefreshController _wasAnswerRefreshController =
EasyRefreshController();
@override
void initState() {
2 years ago
super.initState();
2 years ago
_tabController = TabController(
length: 2,
initialIndex: 0,
vsync: this,
);
}
@override
void dispose() {
_tabController.dispose();
2 years ago
_answerRefreshController.dispose();
_wasAnswerRefreshController.dispose();
super.dispose();
}
@override
Widget build(BuildContext context) {
super.build(context);
return Scaffold(
2 years ago
appBar: AppBar(
elevation: 0,
title: Text(
'选择短信内容',
style: Theme.of(context).textTheme.headline6,
),
2 years ago
leading: const CloudBackButton(isSpecial: true),
backgroundColor: kForeGroundColor,
),
backgroundColor: Colors.white,
body: Column(
children: [
Container(
width: double.infinity,
height: 88.w,
margin: EdgeInsets.symmetric(horizontal: 66.w),
padding: EdgeInsets.all(8.w),
decoration: BoxDecoration(
color: const Color(0xFFF9F9F9),
borderRadius: BorderRadius.all(Radius.circular(44.w))),
child: TabBar(
controller: _tabController,
labelColor: const Color(0xFF1890FF),
unselectedLabelColor: const Color(0xFF999999),
unselectedLabelStyle:
const TextStyle(fontWeight: FontWeight.bold),
labelStyle: const TextStyle(fontWeight: FontWeight.bold),
onTap: (num) {
if (num == 0) {
_answerRefreshController.callRefresh();
} else {
_wasAnswerRefreshController.callRefresh();
}
},
indicator: RectangularIndicator(
color: Colors.white,
bottomLeftRadius: 44.w,
bottomRightRadius: 44.w,
topLeftRadius: 44.w,
topRightRadius: 44.w,
// paintingStyle: PaintingStyle.fill,
),
tabs: const [
Tab(
text: "被叫接听",
),
Tab(
text: "主叫接听",
),
],
),
),
Expanded(
child: TabBarView(
controller: _tabController,
children: [
CallingIdleList(
refreshController: _answerRefreshController,
title: '朋友给你来电接听后所发送的短信',
status: 1,
themeColor: const Color(0xFF1890FF),
),
CallingIdleList(
refreshController: _answerRefreshController,
2 years ago
name: "callSwitch",
2 years ago
title: '您给朋友去电接听后所发送的短信',
status: 3,
themeColor: const Color(0xFF1890FF),
),
],
),
2 years ago
),
],
),
);
}
@override
bool get wantKeepAlive => true;
}