import 'package:flutter/material.dart';
import 'package:zhiying_base_widget/widgets/goods_details/upgrade_tip/model/upgrade_tip_model.dart';
import 'package:zhiying_comm/zhiying_comm.dart';

///
/// 更新提示widget
///
class UpgradeTipWidget extends StatelessWidget {
  final Map<String, dynamic> model;

  const UpgradeTipWidget(this.model);

  @override
  Widget build(BuildContext context) {
    return Container(
      decoration: BoxDecoration(
        color: HexColor.fromHex('#FFEFDA'),
        borderRadius: BorderRadius.circular(30),
      ),
      padding: const EdgeInsets.only(left: 10, right: 13, top: 10, bottom: 10),
      margin: const EdgeInsets.symmetric(horizontal: 12.5),
      child: Row(
        mainAxisAlignment: MainAxisAlignment.spaceBetween,
        children: <Widget>[
          _geLeftWidget(null),
          _getRightWidget(null),
        ],
      ),
    );
  }

  /// 左边的视图
  Widget _geLeftWidget(UpgradeTipModel model) {
    return Row(
      children: <Widget>[
        /// 图标
        Container(width: 15, height: 15, color: Colors.red),

        const SizedBox(width: 7.5),

        /// 文字
        Text('下载APP升级运营商，享受更多收益', style: TextStyle(color: HexColor.fromHex('#C09023'), fontSize: 11))
      ],
    );
  }

  /// 右边的视图
  Widget _getRightWidget(UpgradeTipModel model) {
    return Row(
      children: <Widget>[
        Text('前往下载', style: TextStyle(color: HexColor.fromHex('#C09023'), fontSize: 11)),
        const SizedBox(width: 4),
        Text('》', style: TextStyle(color: HexColor.fromHex('#C09023'), fontSize: 11))
      ],
    );
  }
}
