import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; class CommentWidget extends StatefulWidget { final String commentId; final String commenterId; final String commenterName; final String commentBody; final String commenterImageUrl; const CommentWidget({ required this.commentId, required this.commenterId, required this.commentBody, required this.commenterImageUrl, required this.commenterName, }); @override State createState() => _CommentWidgetState(); } class _CommentWidgetState extends State { @override Widget build(BuildContext context) { return InkWell( onTap: () {}, child: Container( decoration: BoxDecoration( border: Border.all(color: Colors.grey), borderRadius: BorderRadius.circular(10.0), ), padding: const EdgeInsets.all(10.0), child: Row( children: [ CircleAvatar( backgroundImage: NetworkImage(widget.commenterImageUrl), radius: 20.0, ), const SizedBox(width: 10.0), Flexible( child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ Text( widget.commenterName, style: const TextStyle( fontWeight: FontWeight.bold, fontSize: 16.0, ), ), const SizedBox(height: 5.0), Text(widget.commentBody), ], ), ), ], ), ), ); } }