2022-08-15 21:30:53 +00:00
|
|
|
import 'package:flutter/material.dart';
|
2022-08-22 11:32:40 +00:00
|
|
|
import 'package:loris/business_logic/notifications/notifs.dart';
|
2022-09-04 18:03:24 +00:00
|
|
|
import 'package:loris/pages/profile_view/profile_view.dart';
|
2022-08-22 11:32:40 +00:00
|
|
|
import 'package:loris/partials/post.dart';
|
|
|
|
import '../../global.dart' as global;
|
2022-08-15 21:30:53 +00:00
|
|
|
|
|
|
|
class SingleNotif extends StatelessWidget {
|
|
|
|
const SingleNotif({
|
2022-08-22 11:32:40 +00:00
|
|
|
required this.model,
|
2022-08-15 21:30:53 +00:00
|
|
|
Key? key,
|
|
|
|
}) : super(key: key);
|
2022-08-22 11:32:40 +00:00
|
|
|
final NotificationModel model;
|
2022-08-15 21:30:53 +00:00
|
|
|
|
|
|
|
@override
|
|
|
|
Widget build(BuildContext context) {
|
2022-08-22 11:32:40 +00:00
|
|
|
return Padding(
|
|
|
|
padding: const EdgeInsets.all(8),
|
|
|
|
child: Align(
|
|
|
|
child: Container(
|
|
|
|
width:
|
|
|
|
(MediaQuery.of(context).size.width * global.settings!.postWidth) -
|
|
|
|
56,
|
|
|
|
constraints: BoxConstraints(
|
|
|
|
maxWidth: global.settings!.maxPostWidth,
|
|
|
|
minWidth: 375,
|
|
|
|
),
|
|
|
|
padding: const EdgeInsets.all(24),
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
color: Theme.of(context).colorScheme.surface,
|
|
|
|
border: Border.all(color: Theme.of(context).colorScheme.secondary),
|
|
|
|
borderRadius: BorderRadius.circular(8),
|
|
|
|
),
|
|
|
|
child: Column(
|
|
|
|
children: [
|
2022-09-04 18:03:24 +00:00
|
|
|
InkWell(
|
|
|
|
onTap: () => showDialog(
|
|
|
|
context: context,
|
|
|
|
builder: (context) => ProfileView(model: model.account),
|
|
|
|
),
|
|
|
|
child: Row(
|
|
|
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
|
|
children: [
|
|
|
|
ProfilePic(url: model.account.avatar),
|
|
|
|
const SizedBox(
|
|
|
|
width: 8,
|
|
|
|
),
|
|
|
|
Expanded(
|
|
|
|
flex: 20,
|
|
|
|
child: Column(
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
children: [
|
|
|
|
SelectableText(
|
|
|
|
model.account.displayName,
|
|
|
|
style: Theme.of(context).textTheme.displaySmall,
|
|
|
|
),
|
|
|
|
SelectableText.rich(
|
|
|
|
TextSpan(
|
|
|
|
text: "${model.account.acct} ",
|
|
|
|
style: Theme.of(context).textTheme.bodySmall,
|
|
|
|
children: [
|
|
|
|
TextSpan(
|
|
|
|
text: model.type.actionName,
|
|
|
|
style:
|
|
|
|
Theme.of(context).textTheme.bodyMedium)
|
|
|
|
],
|
|
|
|
),
|
2022-08-26 22:29:36 +00:00
|
|
|
),
|
2022-09-04 18:03:24 +00:00
|
|
|
],
|
|
|
|
),
|
|
|
|
),
|
|
|
|
Icon(
|
|
|
|
model.type.icon,
|
|
|
|
size: 64,
|
2022-08-22 12:21:09 +00:00
|
|
|
),
|
2022-09-04 18:03:24 +00:00
|
|
|
],
|
|
|
|
),
|
2022-08-22 11:32:40 +00:00
|
|
|
),
|
|
|
|
const SizedBox(
|
|
|
|
height: 8,
|
|
|
|
),
|
|
|
|
(model.post != null)
|
|
|
|
? (Post(
|
2022-08-26 20:40:10 +00:00
|
|
|
reblogVisible: false,
|
2022-08-22 11:32:40 +00:00
|
|
|
model: model.post!,
|
|
|
|
))
|
|
|
|
: const SizedBox(
|
|
|
|
width: 0,
|
|
|
|
height: 0,
|
|
|
|
),
|
|
|
|
],
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
);
|
2022-08-15 21:30:53 +00:00
|
|
|
}
|
|
|
|
}
|