1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071 |
- import 'package:flutter/material.dart';
- class FollowListHead extends StatelessWidget {
- final String title;
- final String avatarUrl;
- final String description;
- const FollowListHead({Key? key, this.title, this.avatarUrl, this.description})
- : super(key: key);
- @override
- Widget build(BuildContext context) {
- var ivAvatar = CircleAvatar(
- backgroundImage: NetworkImage(avatarUrl),
- );
- var tvTitle = Text(
- title,
- style: TextStyle(
- fontSize: 14,
- color: Color(0xff333333),
- fontFamily: 'NotoSansHans-Medium',
- ),
- );
- var tvSubtitle = Text(
- description,
- maxLines: 1,
- overflow: TextOverflow.ellipsis,
- style: TextStyle(
- fontSize: 12,
- color: Color(0xff666666),
- ),
- );
- var btnFollow = Container(
- width: 40,
- height: 20,
- child: TextButton(
- child: Text(
- '+关注',
- style: TextStyle(
- fontSize: 12,
- fontFamily: 'NotoSansHans-Regular',
- color: Color(0xff666666),
- ),
- ),
- // borderSide: BorderSide(
- // color: Color(0xff333333),
- // width: 0.5,
- // style: BorderStyle.solid,
- // ),
- style: ButtonStyle(
- padding: MaterialStateProperty.all(EdgeInsets.all(0)),
- ),
- onPressed: () => null,
- ),
- );
- return ListTile(
- leading: ivAvatar,
- contentPadding: EdgeInsets.zero,
- title: tvTitle,
- subtitle: tvSubtitle,
- trailing: btnFollow,
- enabled: false,
- onTap: () {},
- );
- }
- }
|