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.
 
 
 
 
 
 

100 lines
3.5 KiB

import 'package:flutter/material.dart';
import 'package:huixiang/data/activity.dart';
import 'package:huixiang/data/article.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
class WebHeader extends StatefulWidget {
final Map? arguments;
final Activity? activity;
final Article? article;
final double fontSize;
WebHeader(this.arguments, this.activity, this.article, this.fontSize);
@override
State<StatefulWidget> createState() {
return _WebHeader();
}
}
class _WebHeader extends State<WebHeader> {
@override
Widget build(BuildContext context) {
return Column(
children: [
Container(
color: Colors.white,
padding: EdgeInsets.all(12),
alignment: Alignment.centerLeft,
child: Text(
widget.activity?.mainTitle ?? widget.article?.mainTitle ?? "",
style: TextStyle(
fontSize: widget.fontSize,
fontWeight: FontWeight.bold,
color: Color(0xFF353535),
),
),
),
Container(
color: Colors.white,
padding: EdgeInsets.symmetric(horizontal: 12.w),
child: Row(
children: [
InkWell(
child: Text(
"${widget.activity != null ? (widget.activity!.storeName ?? "")
: ((widget.article?.author != null)
? (widget.article?.author?.name ?? "") : "")}",
style: TextStyle(
fontWeight: FontWeight.normal,
fontSize: widget.fontSize - 2,
color: Colors.blue,
),
),
onTap: () {
if (widget.arguments?["source"] != null &&
widget.arguments?["source"] == widget.activity?.storeId) {
Navigator.of(context).pop();
} else {
// Navigator.of(context).pushNamed(
// '/router/union_detail_page',
// arguments: {
// "id": widget.activity.storeId,
// "source": widget.arguments["activityId"]
// },
// );
///TODO: 进入店铺
// if(widget.stores[selectIndex].posType.code == "NORMALSTORE") {
// toScan(widget.stores[selectIndex]);
// } else {
// Navigator.of(context).pushNamed(
// '/router/store_order',
// arguments: {
// "id": widget.activity.storeId,
// "tenant": widget.stores[selectIndex].tenantCode,
// "storeName": widget.activity.storeName
// },
// );
// }
}
},
),
if((widget.activity?.storeName ?? "") != "" || (widget.article?.author?.name ?? "") != "")
SizedBox(
width: 10.w,
),
Text(
widget.activity?.createTime ?? widget.article?.createTime ?? "",
style: TextStyle(
fontWeight: FontWeight.normal,
fontSize: widget.fontSize - 4,
color: Colors.grey,
),
),
],
),
),
],
);
}
}