cpd_job_app/lib/Widgets/comments_widget.dart

69 lines
1.9 KiB
Dart
Raw Permalink Normal View History

2023-06-18 16:56:38 +02:00
import 'package:cpd_ss23/Search/profile_company.dart';
2023-06-18 15:24:44 +02:00
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<CommentWidget> createState() => _CommentWidgetState();
}
class _CommentWidgetState extends State<CommentWidget> {
@override
Widget build(BuildContext context) {
return InkWell(
2023-06-18 16:56:38 +02:00
onTap: () {
2023-06-20 03:23:54 +02:00
Navigator.push(
context,
MaterialPageRoute(
builder: (context) =>
ProfileScreen(userID: widget.commenterId)));
2023-06-18 16:56:38 +02:00
},
2023-06-18 15:24:44 +02:00
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),
],
),
),
],
),
),
);
}
}