alter text alignment and icon sizes treewide
This commit is contained in:
parent
1fd9810b83
commit
5e3c7ffa68
5 changed files with 68 additions and 62 deletions
101
lib/main.dart
101
lib/main.dart
|
|
@ -141,57 +141,60 @@ class const App({super.key}) extends StatelessWidget {
|
|||
),
|
||||
home: child,
|
||||
),
|
||||
child: Scaffold(
|
||||
body: Consumer(
|
||||
builder: (_, ref, _) => switch (ref.watch(
|
||||
MultiProviderController.provider(
|
||||
.new([
|
||||
GomuksListenerController.provider,
|
||||
NotificationController.provider,
|
||||
UnifiedPushController.provider,
|
||||
MemberListOpenedController.provider,
|
||||
KeyController.provider(KeyController.roomKey),
|
||||
KeyController.provider(KeyController.spaceKey),
|
||||
]),
|
||||
),
|
||||
)) {
|
||||
AsyncData(value: _) || AsyncLoading(value: _?) => Consumer(
|
||||
builder: (_, ref, _) {
|
||||
final clientState = ref.watch(ClientStateController.provider);
|
||||
|
||||
if (clientState == null || !clientState.isInitialized) {
|
||||
return Loading();
|
||||
}
|
||||
|
||||
if (!clientState.isLoggedIn) {
|
||||
return SelectServerPage();
|
||||
} else if (!clientState.isVerified) {
|
||||
return VerifyPage();
|
||||
} else {
|
||||
return ChatPage();
|
||||
}
|
||||
},
|
||||
),
|
||||
|
||||
AsyncLoading _ => Scaffold(
|
||||
appBar: Appbar(
|
||||
actions: .new([
|
||||
IconButton(
|
||||
onPressed: () => showDialog(
|
||||
context: context,
|
||||
builder: (_) => SettingsPage(),
|
||||
),
|
||||
icon: Icon(Icons.settings),
|
||||
),
|
||||
child: DefaultTextHeightBehavior(
|
||||
textHeightBehavior: .new(leadingDistribution: .even),
|
||||
child: Scaffold(
|
||||
body: Consumer(
|
||||
builder: (_, ref, _) => switch (ref.watch(
|
||||
MultiProviderController.provider(
|
||||
.new([
|
||||
GomuksListenerController.provider,
|
||||
NotificationController.provider,
|
||||
UnifiedPushController.provider,
|
||||
MemberListOpenedController.provider,
|
||||
KeyController.provider(KeyController.roomKey),
|
||||
KeyController.provider(KeyController.spaceKey),
|
||||
]),
|
||||
),
|
||||
body: Loading(),
|
||||
),
|
||||
AsyncError(:final error, :final stackTrace) => ErrorDialog(
|
||||
error,
|
||||
stackTrace,
|
||||
),
|
||||
},
|
||||
)) {
|
||||
AsyncData(value: _) || AsyncLoading(value: _?) => Consumer(
|
||||
builder: (_, ref, _) {
|
||||
final clientState = ref.watch(ClientStateController.provider);
|
||||
|
||||
if (clientState == null || !clientState.isInitialized) {
|
||||
return Loading();
|
||||
}
|
||||
|
||||
if (!clientState.isLoggedIn) {
|
||||
return SelectServerPage();
|
||||
} else if (!clientState.isVerified) {
|
||||
return VerifyPage();
|
||||
} else {
|
||||
return ChatPage();
|
||||
}
|
||||
},
|
||||
),
|
||||
|
||||
AsyncLoading _ => Scaffold(
|
||||
appBar: Appbar(
|
||||
actions: .new([
|
||||
IconButton(
|
||||
onPressed: () => showDialog(
|
||||
context: context,
|
||||
builder: (_) => SettingsPage(),
|
||||
),
|
||||
icon: Icon(Icons.settings),
|
||||
),
|
||||
]),
|
||||
),
|
||||
body: Loading(),
|
||||
),
|
||||
AsyncError(:final error, :final stackTrace) => ErrorDialog(
|
||||
error,
|
||||
stackTrace,
|
||||
),
|
||||
},
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
|
|
|
|||
|
|
@ -13,9 +13,9 @@ class const EventPreview(final Event event, {super.key})
|
|||
padding: .symmetric(vertical: 4),
|
||||
child: Row(
|
||||
mainAxisSize: .min,
|
||||
spacing: 8,
|
||||
spacing: 10,
|
||||
children: [
|
||||
if (event.content is MessageContent) MessageAvatar(event, height: 28),
|
||||
if (event.content is MessageContent) MessageAvatar(event, height: 40),
|
||||
|
||||
Flexible(
|
||||
child: Column(
|
||||
|
|
|
|||
|
|
@ -123,13 +123,16 @@ class const MemberList(final String roomId, {super.key})
|
|||
members[index].stateKey!,
|
||||
overflow: .ellipsis,
|
||||
),
|
||||
leading: AvatarOrHash(
|
||||
avatarUrl,
|
||||
dimension: 36,
|
||||
displayName ??
|
||||
members[index]
|
||||
.stateKey!
|
||||
.localpart,
|
||||
leading: Transform.translate(
|
||||
offset: .new(0, 2),
|
||||
child: AvatarOrHash(
|
||||
avatarUrl,
|
||||
dimension: 40,
|
||||
displayName ??
|
||||
members[index]
|
||||
.stateKey!
|
||||
.localpart,
|
||||
),
|
||||
),
|
||||
),
|
||||
_ => throw Exception(
|
||||
|
|
|
|||
|
|
@ -209,7 +209,7 @@ class const EventRenderer(
|
|||
return Column(
|
||||
crossAxisAlignment: .start,
|
||||
children: [
|
||||
if (child != null) ...[
|
||||
if (child != null)
|
||||
if (textOnly)
|
||||
child
|
||||
else ...[
|
||||
|
|
@ -299,8 +299,8 @@ class const EventRenderer(
|
|||
),
|
||||
),
|
||||
].map((child) => Padding(padding: .only(left: 4), child: child)),
|
||||
],
|
||||
] else if (textOnly)
|
||||
]
|
||||
else if (textOnly)
|
||||
Text("Unknown event type", style: errorStyle),
|
||||
],
|
||||
);
|
||||
|
|
|
|||
|
|
@ -148,7 +148,7 @@ class const MessageRenderer(
|
|||
return Row(
|
||||
crossAxisAlignment: .start,
|
||||
mainAxisSize: .min,
|
||||
spacing: 8,
|
||||
spacing: 6,
|
||||
children: [
|
||||
if (!textOnly)
|
||||
if (isGrouped)
|
||||
|
|
@ -157,7 +157,7 @@ class const MessageRenderer(
|
|||
MessageAvatar(event, height: 40),
|
||||
Flexible(
|
||||
child: Column(
|
||||
spacing: 4,
|
||||
spacing: 2,
|
||||
crossAxisAlignment: .start,
|
||||
children: [
|
||||
if (!isGrouped && !textOnly)
|
||||
|
|
|
|||
Loading…
Reference in a new issue