delete sh*t Common AppBar

hmxc
小赖 4 years ago
parent 43dd340f0f
commit 76037dce38

@ -39,50 +39,6 @@ class _TrendCardState extends State<TrendCard> {
_isLike = widget.isLike ?? false;
}
// void _showDialog(String url) {
// showCupertinoDialog(
// context: context,
// builder: (context) {
// return CupertinoAlertDialog(
// title: Text(
// '是否$url\?',
// style: TextStyle(
// fontSize: 34.sp,
// color: Color(0xff030303),
// ),
// ),
// actions: <Widget>[
// CupertinoDialogAction(
// child: Text(
// '取消',
// style: TextStyle(
// fontSize: 34.sp,
// color: Color(0xff333333),
// ),
// ),
// onPressed: () {
// Get.back();
// },
// ),
// CupertinoDialogAction(
// child: Text(
// '确定',
// style: TextStyle(
// fontWeight: FontWeight.w600,
// fontSize: 34.sp,
// color: Color(0xffff8200),
// ),
// ),
// onPressed: () {
// Get.back();
// },
// ),
// ],
// );
// },
// );
// }
TextStyle _textStyleName() {
return TextStyle(
fontSize: 36.sp,

@ -6,6 +6,8 @@ import 'package:flutter/cupertino.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:url_launcher/url_launcher.dart';
import 'package:velocity_x/velocity_x.dart';
import 'package:akuCommunity/const/resource.dart';
@ -50,12 +52,28 @@ class _ConvenientPhonePageState extends State<ConvenientPhonePage> {
],
).expand(),
IconButton(
icon: Image.asset(
R.ASSETS_ICONS_PHONE_PNG,
width: 40.w,
height: 40.w,
),
onPressed: () {})
icon: Image.asset(
R.ASSETS_ICONS_PHONE_PNG,
width: 40.w,
height: 40.w,
),
onPressed: () async {
bool result = await Get.dialog(CupertinoAlertDialog(
title: model.tel.text.isIntrinsic.make(),
actions: [
CupertinoDialogAction(
child: '取消'.text.isIntrinsic.make(),
onPressed: () => Get.back(),
),
CupertinoDialogAction(
child: '确定'.text.isIntrinsic.make(),
onPressed: () => Get.back(result: true),
),
],
));
if (result == true) launch('tel:${model.tel}');
},
)
],
),
],
@ -63,20 +81,6 @@ class _ConvenientPhonePageState extends State<ConvenientPhonePage> {
);
}
// Widget _buildCard(String title, List tableList) {
// return Material(
// child: Padding(
// padding: EdgeInsets.symmetric(horizontal: 32.w, vertical: 40.w),
// child: Column(
// children: [
// title.text.black.size(32.sp).make(),
// 45.w.heightBox,
// ],
// ),
// ),
// );
// }
@override
Widget build(BuildContext context) {
return BeeScaffold(
@ -138,7 +142,7 @@ class _ConvenientPhonePageState extends State<ConvenientPhonePage> {
padding: EdgeInsets.symmetric(vertical: 20.w),
child: Divider(
thickness: 1.w,
height: 0,
height: 1.w,
color: Color(0xFFD8D8D8),
),
);

@ -166,9 +166,9 @@ class _HomePageState extends State<HomePage>
crossCount: 4,
),
),
SingleAdSpace(
imagePath: R.ASSETS_EXAMPLE_GUANGGAO2_PNG,
),
// SingleAdSpace(
// imagePath: R.ASSETS_EXAMPLE_GUANGGAO2_PNG,
// ),
HomeTagBar(
title: '物业收费标准请查收~',
tag: '公告',

@ -286,11 +286,11 @@ class _PersonalIndexState extends State<PersonalIndex>
// ),
// ),
// ),
SliverToBoxAdapter(
child: SingleAdSpace(
imagePath: 'assets/example/guanggao7.png',
),
),
// SliverToBoxAdapter(
// child: SingleAdSpace(
// imagePath: 'assets/example/guanggao7.png',
// ),
// ),
SliverToBoxAdapter(
child: Container(
decoration: BoxDecoration(

@ -1,5 +1,5 @@
import 'package:akuCommunity/pages/manager_func.dart';
import 'package:akuCommunity/pages/visitor_access_page/visitor_record_page.dart';
import 'package:akuCommunity/ui/manager/visitor/visitor_record_page.dart';
import 'package:akuCommunity/provider/user_provider.dart';
import 'package:akuCommunity/widget/bee_scaffold.dart';
import 'package:flutter/material.dart';

@ -1,56 +0,0 @@
import 'package:flutter/material.dart';
import 'package:flutter/cupertino.dart';
import 'package:akuCommunity/widget/common_app_bar.dart';
import 'widget/record_list.dart';
class VisitorRecordPage extends StatefulWidget {
VisitorRecordPage({Key key}) : super(key: key);
@override
_VisitorRecordPageState createState() => _VisitorRecordPageState();
}
class _VisitorRecordPageState extends State<VisitorRecordPage>
with TickerProviderStateMixin {
TabController _controller;
//
List<Map<String, dynamic>> treeList = [
{'name': '未到访客'},
{'name': '已到访客'},
];
@override
void initState() {
_controller = TabController(length: treeList.length, vsync: this);
super.initState();
}
@override
void dispose() {
_controller.dispose();
super.dispose();
}
Widget build(BuildContext context) {
return DefaultTabController(
length: treeList.length,
child: Scaffold(
appBar: PreferredSize(
child: CommonAppBar(
title: '访客记录',
tabController: _controller,
treeList: treeList,
),
preferredSize: Size.fromHeight(kToolbarHeight * 1.8),
),
body: TabBarView(
controller: _controller,
children: List.generate(
treeList.length,
(index) => RecordList(),
),
),
),
);
}
}

@ -0,0 +1,48 @@
import 'package:akuCommunity/widget/bee_scaffold.dart';
import 'package:akuCommunity/widget/tab_bar/bee_tab_bar.dart';
import 'package:flutter/material.dart';
import 'package:flutter/cupertino.dart';
import '../../../pages/visitor_access_page/widget/record_list.dart';
class VisitorRecordPage extends StatefulWidget {
VisitorRecordPage({Key key}) : super(key: key);
@override
_VisitorRecordPageState createState() => _VisitorRecordPageState();
}
class _VisitorRecordPageState extends State<VisitorRecordPage>
with TickerProviderStateMixin {
TabController _controller;
//
List<String> _tabs = ['未到访客', '已到访客'];
@override
void initState() {
_controller = TabController(length: _tabs.length, vsync: this);
super.initState();
}
@override
void dispose() {
_controller.dispose();
super.dispose();
}
Widget build(BuildContext context) {
return BeeScaffold(
title: '访客记录',
appBarBottom: BeeTabBar(
controller: _controller,
tabs: _tabs,
),
body: TabBarView(
controller: _controller,
children: List.generate(
_tabs.length,
(index) => RecordList(),
),
),
);
}
}

@ -1,169 +0,0 @@
import 'package:akuCommunity/pages/address_page/address_edit_page.dart';
import 'package:akuCommunity/pages/goods_manage_page/mine_goods_page/mine_goods_page.dart';
import 'package:akuCommunity/pages/life_pay/life_pay_record_page/life_pay_record_page.dart';
import 'package:akuCommunity/pages/things_page/things_evaluate_page/things_evaluate_page.dart';
import 'package:akuCommunity/pages/visitor_access_page/visitor_record_page.dart';
import 'package:flutter/material.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter_beautiful_popup/main.dart';
import 'package:flutter_icons/flutter_icons.dart';
import 'package:akuCommunity/utils/headers.dart';
import 'package:akuCommunity/routers/page_routers.dart';
import 'package:akuCommunity/pages/one_alarm/widget/explain_template.dart';
import 'package:get/get.dart';
//TODO CLEAN BOTTOM CODES.
@Deprecated("sh*t common_app_bar need to be cleaned.")
class CommonAppBar extends StatelessWidget {
final String title, subtitle;
final List<Map<String, dynamic>> treeList;
final TabController tabController;
const CommonAppBar({
Key key,
@required this.title,
this.subtitle,
this.treeList,
this.tabController,
}) : super(key: key);
void showExplain(BuildContext context) {
final popup = BeautifulPopup.customize(
context: context,
build: (options) => ExplainTemplate(options),
);
popup.show(
title: Text(
'功能说明',
style: TextStyle(
fontWeight: FontWeight.bold,
fontSize: 32.sp,
color: Color(0xff15c0ec),
),
),
content: Text(
'点击“呼叫110”后,您可以直接拨打本地110。页面中提供了您当前所在位置,以便您与警方沟通。(GPS信号弱时位置可能存在偏移)',
style: TextStyle(
fontSize: 28.sp,
color: Color(0xff666666),
),
),
actions: [
MaterialButton(
color: Color(0xff15c0ec),
textColor: Colors.white,
shape: RoundedRectangleBorder(
side: BorderSide.none,
borderRadius: BorderRadius.all(Radius.circular(50))),
child: Text('关闭'),
onPressed: Navigator.of(context).pop,
)
],
close: SizedBox());
}
@override
Widget build(BuildContext context) {
return Container(
child: AppBar(
elevation: 0,
backgroundColor: (title == '访客通行证' || title == '出户二维码')
? Color(0xff333333)
: Colors.white,
leading: InkWell(
onTap: () => Get.back(),
child: Icon(
AntDesign.left,
size: 45.sp,
color: (title == '访客通行证' || title == '出户二维码')
? Colors.white
: Color(0xff333333),
),
),
centerTitle: true,
title: Text(
title,
style: TextStyle(
color: (title == '访客通行证' || title == '出户二维码')
? Colors.white
: Color(0xff333333),
fontSize: 32.sp,
fontWeight: FontWeight.w600,
),
),
actions: [
subtitle != null
? InkWell(
onTap: () {
switch (subtitle) {
case '访客记录':
VisitorRecordPage().to;
break;
case '缴费记录':
LifePayRecordPage().to;
break;
case '我的借还物品':
MineGoodsPage().to;
break;
case '添加新地址':
AddressEditPage(
bundle: Bundle()
..putMap('details',
{'title': '添加新地址', 'isDelete': false}),
).to;
break;
case '功能说明':
showExplain(context);
break;
case '评价':
ThingsEvaluatePage(
bundle: Bundle()
..putMap(
'details', {'title': '评价', 'isShow': true}),
).to;
break;
default:
}
},
child: Container(
height: kToolbarHeight,
alignment: Alignment.center,
margin: EdgeInsets.only(right: 32.w),
child: Text(
subtitle,
style: TextStyle(
fontSize: 28.sp,
color: Color(0xff333333),
),
),
),
)
: SizedBox(),
],
bottom: treeList != null
? TabBar(
unselectedLabelStyle: TextStyle(
fontSize: 28.sp,
),
labelStyle: TextStyle(
fontWeight: FontWeight.w600,
fontSize: 28.sp,
),
labelPadding: EdgeInsets.symmetric(horizontal: 131.5.w),
indicatorColor: Color(0xffffc40c),
indicatorSize: TabBarIndicatorSize.label,
indicatorPadding: EdgeInsets.symmetric(horizontal: 21.w),
isScrollable: true,
controller: tabController,
tabs: List.generate(
treeList.length,
(index) => Tab(text: treeList[index]['name']),
),
)
: PreferredSize(
child: SizedBox(),
preferredSize: Size.fromHeight(0),
),
),
);
}
}

@ -2,7 +2,8 @@ import 'package:flutter/material.dart';
import 'package:akuCommunity/utils/headers.dart';
//TODO one day we need to remove those.😕
// ignore: must_be_immutable
//TODO CLEAN BOTTOM CODES.
@Deprecated("sh*t round_check_box need to be cleaned.")
class RoundCheckBox extends StatefulWidget {
var value = false;

Loading…
Cancel
Save