|
|
|
import 'package:flutter/material.dart';
|
|
|
|
import 'package:huixiang/retrofit/data/activity.dart';
|
|
|
|
import 'package:huixiang/retrofit/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: Color(0xFFFFFFFF),
|
|
|
|
padding: EdgeInsets.all(12),
|
|
|
|
alignment: Alignment.centerLeft,
|
|
|
|
child: Text(
|
|
|
|
widget.activity != null
|
|
|
|
? widget.activity.mainTitle
|
|
|
|
: widget.article != null
|
|
|
|
? widget.article.mainTitle
|
|
|
|
: "",
|
|
|
|
style: TextStyle(
|
|
|
|
fontSize: widget.fontSize,
|
|
|
|
fontWeight: FontWeight.bold,
|
|
|
|
color: Color(0xFF353535),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
Container(
|
|
|
|
color: Color(0xFFFFFFFF),
|
|
|
|
padding: EdgeInsets.symmetric(horizontal: 12.w),
|
|
|
|
child: Row(
|
|
|
|
children: [
|
|
|
|
InkWell(
|
|
|
|
child: Text(
|
|
|
|
"${widget.activity != null ? (widget.activity.storeName ?? "")
|
|
|
|
: (widget.article != null && widget.article.author != null)
|
|
|
|
? (widget.article.author.name ?? "") : ""}",
|
|
|
|
style: TextStyle(
|
|
|
|
fontWeight: FontWeight.normal,
|
|
|
|
fontSize: widget.fontSize - 2,
|
|
|
|
color: Colors.blue,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
onTap: () {
|
|
|
|
if (widget.activity != null) {
|
|
|
|
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"]
|
|
|
|
},
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
),
|
|
|
|
SizedBox(
|
|
|
|
width: 10.w,
|
|
|
|
),
|
|
|
|
Text(
|
|
|
|
widget.activity != null
|
|
|
|
? widget.activity.createTime
|
|
|
|
: widget.article != null
|
|
|
|
? widget.article.createTime
|
|
|
|
: "",
|
|
|
|
style: TextStyle(
|
|
|
|
fontWeight: FontWeight.normal,
|
|
|
|
fontSize: widget.fontSize - 4,
|
|
|
|
color: Colors.grey,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
],
|
|
|
|
),
|
|
|
|
),
|
|
|
|
],
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|