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.
101 lines
2.9 KiB
101 lines
2.9 KiB
3 years ago
|
|
||
|
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;
|
||
|
|
||
|
WebHeader(this.arguments, this.activity, this.article);
|
||
|
|
||
|
@override
|
||
|
State<StatefulWidget> createState() {
|
||
|
return _WebHeader();
|
||
|
}
|
||
|
|
||
|
}
|
||
|
|
||
|
class _WebHeader extends State<WebHeader> {
|
||
|
@override
|
||
|
Widget build(BuildContext context) {
|
||
|
return Column(
|
||
|
children: [
|
||
|
Container(
|
||
|
color: Color(0xFFF7F7F7),
|
||
|
padding: EdgeInsets.all(12),
|
||
|
alignment: Alignment.centerLeft,
|
||
|
child: Text(
|
||
|
widget.activity != null
|
||
|
? widget.activity.mainTitle
|
||
|
: widget.article != null
|
||
|
? widget.article.mainTitle
|
||
|
: "",
|
||
|
style: TextStyle(
|
||
|
fontSize: 16.sp,
|
||
|
fontWeight: FontWeight.bold,
|
||
|
color: Color(0xFF353535),
|
||
|
),
|
||
|
),
|
||
|
),
|
||
|
Container(
|
||
|
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: 14.sp,
|
||
|
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: 12.sp,
|
||
|
color: Colors.grey,
|
||
|
),
|
||
|
),
|
||
|
],
|
||
|
),
|
||
|
),
|
||
|
],
|
||
|
);
|
||
|
}
|
||
|
|
||
|
}
|
||
|
|
||
|
|
||
|
|