import 'package:flutter/material.dart';
import 'package:gmalpha_flutter/model/message/message.dart';

class MessageNotificationItem extends StatelessWidget {
  final NotificationItem notification;
  VoidCallback onPressed;

  MessageNotificationItem({Key key, this.notification, this.onPressed}) : super(key: key);
  @override
  Widget build(BuildContext context) {
    
    var icon = new Container(
     child:  new Padding(
      padding: EdgeInsets.only(left: 40),
      child: ImageIcon(
        AssetImage(notification.icon),
        size: 30,
      ),
     )
    );

     var titleRow = new Row (
      children: <Widget>[
        new Row (
           mainAxisAlignment: MainAxisAlignment.start,
           children: <Widget>[ 
              Text(notification.title, style: TextStyle(color: Color(0xff323232), fontWeight: FontWeight.bold, fontSize: 13)),
              new Padding (
              padding: EdgeInsets.only(left: 8, right: 50),
              child:   Text(notification.content, style: TextStyle(color: Color(0xff323232), fontSize: 13)),
             )
           ],
         ),
      ],
    );
    var arrow = new Row(
      children: <Widget>[
        new Container(
          color: Color(0xff323232),
          child: new Padding(
            padding: EdgeInsets.only(top: 6, bottom: 6, right: 9, left: 9),
            child: Text('9', style: TextStyle(color: Color(0xffffffff), fontSize: 11)),
          ),
        ),
        new Icon(Icons.arrow_right)
    
      ],
    );
  

    return new GestureDetector(
      onTap: onPressed,
      // onTap: timeStr(),
      child: new Container(
          child: new Column(
            children: <Widget>[
              new Row(
                children: <Widget>[
                    new Padding(
                      padding: const EdgeInsets.only(right: 16),
                      child: new Container(
                        child: new Center(
                            child: icon,
                            // child: contentImg,
                        ),
                      ),
                    ),
                    new Expanded(
                      child: titleRow,
                    ),
                    new Expanded(
                      child: arrow,
                    ),
                  ],
              ),
              titleRow

            ],
          ),
      ),
    );
  }
}