This commit is contained in:
zoe 2022-09-23 23:47:30 +02:00
parent 1265136030
commit 7d4b3160a8
6 changed files with 86 additions and 99 deletions

View File

@ -24,7 +24,7 @@ const List<String> bad = [
];
double getWidth(context) {
return (MediaQuery.of(context).size.width * settings!.postWidth) - 56;
return (MediaQuery.of(context).size.width * settings!.postWidth) - 24;
}
BoxConstraints getConstraints(context) {

View File

@ -132,8 +132,8 @@ class _NotificationsState extends State<Notifications> {
controller: _controller,
addSemanticIndexes: true,
itemBuilder: ((context, index) => notifs[index]),
separatorBuilder: (context, index) => const SizedBox(
height: 8,
separatorBuilder: (context, index) => const Divider(
color: Colors.transparent,
),
itemCount: notifs.length),
),

View File

@ -13,87 +13,78 @@ class SingleNotif extends StatelessWidget {
@override
Widget build(BuildContext context) {
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,
return Align(
child: Container(
width: global.getWidth(context),
constraints: global.getConstraints(context),
padding: const EdgeInsets.all(24),
decoration: BoxDecoration(
color: Theme.of(context).colorScheme.surface,
border: Border.all(
color: Theme.of(context).colorScheme.secondary,
width: 2,
),
padding: const EdgeInsets.all(24),
decoration: BoxDecoration(
color: Theme.of(context).colorScheme.surface,
border: Border.all(
color: Theme.of(context).colorScheme.secondary,
width: 2,
),
borderRadius: BorderRadius.circular(8),
),
child: Material(
child: Column(
children: [
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)
],
),
),
],
),
),
Icon(
model.type.icon,
size: 64,
),
],
),
borderRadius: BorderRadius.circular(8),
),
child: Material(
child: Column(
children: [
InkWell(
onTap: () => showDialog(
context: context,
builder: (context) => ProfileView(model: model.account),
),
const SizedBox(
height: 8,
),
(model.post != null)
? (Post(
reblogVisible: false,
model: model.post!,
))
: const SizedBox(
width: 0,
height: 0,
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)
],
),
),
],
),
],
),
),
Icon(
model.type.icon,
size: 64,
),
],
),
),
const SizedBox(
height: 8,
),
(model.post != null)
? (Post(
reblogVisible: false,
model: model.post!,
))
: const SizedBox(
width: 0,
height: 0,
),
],
),
),
),

View File

@ -215,7 +215,6 @@ class TimelineState extends State<Timeline> {
);
},
itemCount: children.length,
padding: const EdgeInsets.fromLTRB(24, 0, 24, 64),
addAutomaticKeepAlives: false,
),
),

View File

@ -309,7 +309,9 @@ class _PostActionBarState extends State<PostActionBar> {
@override
Widget build(BuildContext context) {
return Wrap(
spacing: 8,
alignment: WrapAlignment.spaceAround,
crossAxisAlignment: WrapCrossAlignment.center,
children: [
IconButton(
onPressed: () {

View File

@ -78,21 +78,18 @@ class _ThreadState extends State<Thread> {
}
if (!widget.constrained) {
return Padding(
padding: const EdgeInsets.all(4),
child: Container(
padding: const EdgeInsets.all(24),
decoration: BoxDecoration(
color: Theme.of(context).colorScheme.surface,
border: Border.all(
color: Theme.of(context).colorScheme.secondary,
width: 2,
),
borderRadius: BorderRadius.circular(8),
),
child: Column(
children: c,
return Container(
padding: const EdgeInsets.all(8),
decoration: BoxDecoration(
color: Theme.of(context).colorScheme.surface,
border: Border.all(
color: Theme.of(context).colorScheme.secondary,
width: 2,
),
borderRadius: BorderRadius.circular(8),
),
child: Column(
children: c,
),
);
}
@ -109,9 +106,7 @@ class _ThreadState extends State<Thread> {
color: Theme.of(context).colorScheme.secondary,
),
),
width:
(MediaQuery.of(context).size.width * global.settings!.postWidth) -
56,
width: global.getWidth(context),
constraints: global.getConstraints(context),
child: Material(
borderRadius: const BorderRadius.all(Radius.circular(8)),