import 'package:flutter/material.dart'; import 'package:zhiying_comm/zhiying_comm.dart'; /// /// 我的团队 - 我的推荐人 /// class TeamRecommendWidget extends StatefulWidget { final Map data; const TeamRecommendWidget(this.data); @override _TeamRecommendWidgetState createState() => _TeamRecommendWidgetState(); } class _TeamRecommendWidgetState extends State { @override Widget build(BuildContext context) { return Container(); } /// 按钮点击事件 void _onClickListener() {} /// 主体Widget Widget _getMainWidget() { return Container( decoration: BoxDecoration(borderRadius: BorderRadius.circular(10), color: Colors.white), child: Column( children: [ /// 左上角的Icon /// 数据视图 ], ), ); } /// 我的推荐人IconWidget(左上角的ICON) Widget _getLeftTopWidget() { return Container(width: 73.5, height: 23.5, color: Colors.red); } /// 输入框 Widget _getInputWidget() { return Container( decoration: BoxDecoration( borderRadius: BorderRadius.circular(30), color: HexColor.fromHex('#F7F7F7'), ), child: Column( children: [ /// 输入框 Row( children: [ /// 输入框 Expanded( child: TextField( decoration: InputDecoration( border: InputBorder.none, focusedBorder: InputBorder.none, focusedErrorBorder: InputBorder.none, errorBorder: InputBorder.none, disabledBorder: InputBorder.none, enabledBorder: InputBorder.none, filled: true, fillColor: Colors.transparent), ), ), /// 按钮 _getAddButtomWidget(), ], ), const SizedBox(height: 10.5), /// 文字提示 Text('还没有填写邀请人ID,填写后双方都可以获得奖励', style: TextStyle(color: HexColor.fromHex('#909090'), fontSize: 11)), ], ), ); } /// 添加的按钮 Widget _getAddButtomWidget() { return Material( child: Container( height: 24, width: double.infinity, color: Colors.white, child: RaisedButton( child: Text('添加', style: TextStyle(fontSize: 13)), textColor: HexColor.fromHex('#FFFFFF'), color: HexColor.fromHex('#F94B47'), disabledColor: HexColor.fromHex('#F94B47'), disabledTextColor: HexColor.fromHex('#FFFFFF'), elevation: 5, shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(24 / 2)), onPressed: () => _onClickListener(), ), ), ); } /// 数据视图 Widget _getDataWidget() { return Row( children: [ /// 头像widget _getAvatarWidget(), const SizedBox(width: 12), /// 数据 _getDataRightWidget(), ], ); } /// 头像widget Widget _getAvatarWidget() { return Container( width: 55, height: 55, color: Colors.red, ); } /// 数据右边视图,头像右边的widget Widget _getDataRightWidget() { return Column( children: [ /// 昵称 _getNickNameWidget(), /// 手机号 _getPhoneNumberWidget(), /// 微信号 _getWXWidget() ], ); } /// 昵称 Widget _getNickNameWidget() { return Row( children: [ /// 昵称 Text('毛毛虫', style: TextStyle(fontSize: 14, color: HexColor.fromHex('#000000'), fontWeight: FontWeight.bold)), const SizedBox(width: 6), Text('邀请码:', style: TextStyle(fontSize: 11, color: HexColor.fromHex('#909090'))), Text('123456', style: TextStyle(fontSize: 11, color: HexColor.fromHex('#909090'))), ], ); } /// 手机号 Widget _getPhoneNumberWidget() { return Row( children: [ Text('手机号:', style: TextStyle(fontSize: 11, color: HexColor.fromHex('#AFAFAF'))), Text('12354678910', style: TextStyle(fontSize: 11, color: HexColor.fromHex('#AFAFAF'))), const SizedBox(width: 6), /// 拷贝按钮 _getCustomCopyWidget(), ], ); } /// 微信号 Widget _getWXWidget() { return Row( children: [ Text('微信号:', style: TextStyle(fontSize: 11, color: HexColor.fromHex('#AFAFAF'))), Text('12354678910', style: TextStyle(fontSize: 11, color: HexColor.fromHex('#AFAFAF'))), const SizedBox(width: 6), /// 拷贝按钮 _getCustomCopyWidget(), ], ); } /// 自定义复制按钮的Widget Widget _getCustomCopyWidget() { return Container( padding: const EdgeInsets.only(left: 4, bottom: 2, top: 2, right: 6), decoration: BoxDecoration( color: HexColor.fromHex('#FFF2F2'), borderRadius: BorderRadius.circular(30), ), child: Row( crossAxisAlignment: CrossAxisAlignment.center, children: [ Container(width: 11, height: 11, color: Colors.red), const SizedBox(width: 4.5), Text('复制', style: TextStyle(fontSize: 8, color: HexColor.fromHex('#F94B47'))) ], ), ); } }