fix size
This commit is contained in:
parent
1265136030
commit
7d4b3160a8
|
@ -24,7 +24,7 @@ const List<String> bad = [
|
||||||
];
|
];
|
||||||
|
|
||||||
double getWidth(context) {
|
double getWidth(context) {
|
||||||
return (MediaQuery.of(context).size.width * settings!.postWidth) - 56;
|
return (MediaQuery.of(context).size.width * settings!.postWidth) - 24;
|
||||||
}
|
}
|
||||||
|
|
||||||
BoxConstraints getConstraints(context) {
|
BoxConstraints getConstraints(context) {
|
||||||
|
|
|
@ -132,8 +132,8 @@ class _NotificationsState extends State<Notifications> {
|
||||||
controller: _controller,
|
controller: _controller,
|
||||||
addSemanticIndexes: true,
|
addSemanticIndexes: true,
|
||||||
itemBuilder: ((context, index) => notifs[index]),
|
itemBuilder: ((context, index) => notifs[index]),
|
||||||
separatorBuilder: (context, index) => const SizedBox(
|
separatorBuilder: (context, index) => const Divider(
|
||||||
height: 8,
|
color: Colors.transparent,
|
||||||
),
|
),
|
||||||
itemCount: notifs.length),
|
itemCount: notifs.length),
|
||||||
),
|
),
|
||||||
|
|
|
@ -13,87 +13,78 @@ class SingleNotif extends StatelessWidget {
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return Padding(
|
return Align(
|
||||||
padding: const EdgeInsets.all(8),
|
child: Container(
|
||||||
child: Align(
|
width: global.getWidth(context),
|
||||||
child: Container(
|
constraints: global.getConstraints(context),
|
||||||
width:
|
padding: const EdgeInsets.all(24),
|
||||||
(MediaQuery.of(context).size.width * global.settings!.postWidth) -
|
decoration: BoxDecoration(
|
||||||
56,
|
color: Theme.of(context).colorScheme.surface,
|
||||||
constraints: BoxConstraints(
|
border: Border.all(
|
||||||
maxWidth: global.settings!.maxPostWidth,
|
color: Theme.of(context).colorScheme.secondary,
|
||||||
minWidth: 375,
|
width: 2,
|
||||||
),
|
),
|
||||||
padding: const EdgeInsets.all(24),
|
borderRadius: BorderRadius.circular(8),
|
||||||
decoration: BoxDecoration(
|
),
|
||||||
color: Theme.of(context).colorScheme.surface,
|
child: Material(
|
||||||
border: Border.all(
|
child: Column(
|
||||||
color: Theme.of(context).colorScheme.secondary,
|
children: [
|
||||||
width: 2,
|
InkWell(
|
||||||
),
|
onTap: () => showDialog(
|
||||||
borderRadius: BorderRadius.circular(8),
|
context: context,
|
||||||
),
|
builder: (context) => ProfileView(model: model.account),
|
||||||
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,
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
const SizedBox(
|
child: Row(
|
||||||
height: 8,
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||||
),
|
children: [
|
||||||
(model.post != null)
|
ProfilePic(url: model.account.avatar),
|
||||||
? (Post(
|
const SizedBox(
|
||||||
reblogVisible: false,
|
width: 8,
|
||||||
model: model.post!,
|
),
|
||||||
))
|
Expanded(
|
||||||
: const SizedBox(
|
flex: 20,
|
||||||
width: 0,
|
child: Column(
|
||||||
height: 0,
|
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,
|
||||||
|
),
|
||||||
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|
|
@ -215,7 +215,6 @@ class TimelineState extends State<Timeline> {
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
itemCount: children.length,
|
itemCount: children.length,
|
||||||
padding: const EdgeInsets.fromLTRB(24, 0, 24, 64),
|
|
||||||
addAutomaticKeepAlives: false,
|
addAutomaticKeepAlives: false,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|
|
@ -309,7 +309,9 @@ class _PostActionBarState extends State<PostActionBar> {
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return Wrap(
|
return Wrap(
|
||||||
|
spacing: 8,
|
||||||
alignment: WrapAlignment.spaceAround,
|
alignment: WrapAlignment.spaceAround,
|
||||||
|
crossAxisAlignment: WrapCrossAlignment.center,
|
||||||
children: [
|
children: [
|
||||||
IconButton(
|
IconButton(
|
||||||
onPressed: () {
|
onPressed: () {
|
||||||
|
|
|
@ -78,21 +78,18 @@ class _ThreadState extends State<Thread> {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!widget.constrained) {
|
if (!widget.constrained) {
|
||||||
return Padding(
|
return Container(
|
||||||
padding: const EdgeInsets.all(4),
|
padding: const EdgeInsets.all(8),
|
||||||
child: Container(
|
decoration: BoxDecoration(
|
||||||
padding: const EdgeInsets.all(24),
|
color: Theme.of(context).colorScheme.surface,
|
||||||
decoration: BoxDecoration(
|
border: Border.all(
|
||||||
color: Theme.of(context).colorScheme.surface,
|
color: Theme.of(context).colorScheme.secondary,
|
||||||
border: Border.all(
|
width: 2,
|
||||||
color: Theme.of(context).colorScheme.secondary,
|
|
||||||
width: 2,
|
|
||||||
),
|
|
||||||
borderRadius: BorderRadius.circular(8),
|
|
||||||
),
|
|
||||||
child: Column(
|
|
||||||
children: c,
|
|
||||||
),
|
),
|
||||||
|
borderRadius: BorderRadius.circular(8),
|
||||||
|
),
|
||||||
|
child: Column(
|
||||||
|
children: c,
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -109,9 +106,7 @@ class _ThreadState extends State<Thread> {
|
||||||
color: Theme.of(context).colorScheme.secondary,
|
color: Theme.of(context).colorScheme.secondary,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
width:
|
width: global.getWidth(context),
|
||||||
(MediaQuery.of(context).size.width * global.settings!.postWidth) -
|
|
||||||
56,
|
|
||||||
constraints: global.getConstraints(context),
|
constraints: global.getConstraints(context),
|
||||||
child: Material(
|
child: Material(
|
||||||
borderRadius: const BorderRadius.all(Radius.circular(8)),
|
borderRadius: const BorderRadius.all(Radius.circular(8)),
|
||||||
|
|
Loading…
Reference in New Issue