import 'package:flutter/material.dart';
import 'package:zhiying_comm/zhiying_comm.dart';

///
/// 优惠券说明
///
class CounponDescriptionWidget extends StatelessWidget {
  final Map<String, dynamic> model;

  const CounponDescriptionWidget(this.model);

  @override
  Widget build(BuildContext context) {
    return Container(
      margin: const EdgeInsets.symmetric(horizontal: 12.5),
      width: double.infinity,
      child:_getMainWidget(),
    );
  }

  /// 主widget
  Widget _getMainWidget() {
    return Row(
      mainAxisAlignment: MainAxisAlignment.start,
      children: <Widget>[

        /// 领券立减
        Padding(padding: const EdgeInsets.only(right: 5), child: _getButtom1Widget()),


        /// 收货后返现
        Padding(padding: const EdgeInsets.only(right: 5), child: _getButtom2Widget()),


      ],
    );
  }

  /// 领券立减
  Widget _getButtom1Widget() {
    return Container(
        decoration: BoxDecoration(
          color: HexColor.fromHex('#FFE0E0'),
          borderRadius: BorderRadius.circular(50),
        ),
        padding: const EdgeInsets.only(left: 14, right: 14, top: 3, bottom: 3),
        child: Text('领券立减100元', style: TextStyle(color: HexColor.fromHex('#FF4242'), fontSize: 11)));
  }


  /// 收货后返现
  Widget _getButtom2Widget() {
    return Container(
        decoration: BoxDecoration(
          color: HexColor.fromHex('#FFEFDA'),
          borderRadius: BorderRadius.circular(50),
        ),
        padding: const EdgeInsets.only(left: 14, right: 14, top: 3, bottom: 3),
        child: Text('收货后返现5.5元', style: TextStyle(color: HexColor.fromHex('#B78107'), fontSize: 11)));
  }
}
