/*
 * @Author: WuWei
 * @Date: 2020-06-05 10:21:39
 * @LastEditors: XianKaiQun
 * @LastEditTime: 2020-07-08 13:34:43
 * @Description:
 */

// part of '../index.dart';
import 'package:flutter/widgets.dart';
import 'package:wisdom_cli/wisdom_cli.dart';

// ignore: must_be_immutable
class InfoItem extends StatelessWidget {
  InfoItem({
    Key? key,

    /// [title]标题
    required this.title,

    /// [content] 对应内容
    required this.content,
    this.isRight,
  }) : super(key: key);

  /// [title]标题
  final String title;

  /// [content] 对应内容
  final String content;

  bool? isRight = false;

  @override
  Widget build(BuildContext context) {
    return Expanded(
        child: Wisdom.row(
            crossAxisAlignment: CrossAxisAlignment.center,
            mainAxisAlignment: MainAxisAlignment.spaceBetween,
            margin: isRight!
                ? EdgeInsets.only(left: 16.pt)
                : EdgeInsets.only(right: 16.pt),
            children: <Widget>[
          WisText.c999(
            '$title',
            size: 14.pt,
          ),
          Wisdom(
            maxWidth: 90.pt,
            child: WisText.c333(
              '$content',
              size: 14.pt,
              overflow: TextOverflow.ellipsis,
            ),
          )
        ]));
  }
}
