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/widget/app_bar_action.dart

60 lines
1.7 KiB

4 years ago
import 'package:akuCommunity/pages/market/market_cart_page/market_cart_page.dart';
import 'package:akuCommunity/pages/market_class/market_class_page.dart';
import 'package:akuCommunity/pages/message_center_page/message_center_page.dart';
import 'package:flutter/material.dart';
import 'package:flutter/cupertino.dart';
4 years ago
import 'package:akuCommunity/utils/headers.dart';
import 'package:akuCommunity/routers/page_routers.dart';
class AppBarAction extends StatefulWidget {
final IconData icon;
final String title;
AppBarAction({Key key, this.icon, this.title}) : super(key: key);
@override
_AppBarActionState createState() => _AppBarActionState();
}
class _AppBarActionState extends State<AppBarAction> {
@override
Widget build(BuildContext context) {
return Container(
4 years ago
margin: EdgeInsets.only(right: 32.w),
child: InkWell(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Icon(
widget.icon,
color: Color(0xff333333),
),
4 years ago
SizedBox(height: 4.w),
Text(
widget.title,
style: TextStyle(
4 years ago
fontSize: 20.sp,
color: Color(0xff333333),
),
)
],
),
onTap: () {
switch (widget.title) {
case '扫一扫':
break;
case '消息':
4 years ago
MessageCenterPage().to;
break;
case '购物车':
4 years ago
MarketCartPage().to;
break;
case '分类':
4 years ago
MarketClassPage().to;
break;
default:
}
}),
);
}
}