chore: Fix design for smaller screens

This commit is contained in:
Christian Pauly 2022-01-15 13:18:25 +01:00
parent de7699addb
commit af02f90a1b
3 changed files with 225 additions and 209 deletions

View File

@ -79,9 +79,11 @@ class _InviteStoryPageState extends State<InviteStoryPage> {
onPressed: () => Navigator.of(context).pop<bool>(false),
),
title: Text(L10n.of(context)!.whoCanSeeMyStories),
bottom: PreferredSize(
preferredSize: const Size.fromHeight(56),
child: ListTile(
elevation: 0,
),
body: Column(
children: [
ListTile(
title: Text(L10n.of(context)!.whoCanSeeMyStoriesDesc),
leading: CircleAvatar(
backgroundColor: Theme.of(context).secondaryHeaderColor,
@ -89,18 +91,20 @@ class _InviteStoryPageState extends State<InviteStoryPage> {
child: const Icon(Icons.lock),
),
),
),
),
body: FutureBuilder<List<User>>(
const Divider(height: 1),
Expanded(
child: FutureBuilder<List<User>>(
future: loadContacts,
builder: (context, snapshot) {
final contacts = snapshot.data;
if (contacts == null) {
final error = snapshot.error;
if (error != null) {
return Center(child: Text(error.toLocalizedString(context)));
return Center(
child: Text(error.toLocalizedString(context)));
}
return const Center(child: CircularProgressIndicator.adaptive());
return const Center(
child: CircularProgressIndicator.adaptive());
}
_undecided = contacts.map((u) => u.id).toSet();
return ListView.builder(
@ -118,6 +122,9 @@ class _InviteStoryPageState extends State<InviteStoryPage> {
),
);
}),
),
],
),
floatingActionButton: FloatingActionButton.extended(
onPressed: _inviteAction,
label: Text(L10n.of(context)!.publish),

View File

@ -28,9 +28,14 @@ class ChatEncryptionSettingsView extends StatelessWidget {
VRouter.of(context).toSegments(['rooms', controller.roomId]),
),
title: Text(L10n.of(context).tapOnDeviceToVerify),
bottom: PreferredSize(
preferredSize: const Size.fromHeight(56),
child: ListTile(
elevation: 0,
),
body: MaxWidthBody(
withScrolling: true,
child: Column(
mainAxisSize: MainAxisSize.min,
children: [
ListTile(
title: Text(L10n.of(context).deviceVerifyDescription),
leading: CircleAvatar(
backgroundColor: Theme.of(context).secondaryHeaderColor,
@ -38,11 +43,8 @@ class ChatEncryptionSettingsView extends StatelessWidget {
child: const Icon(Icons.lock),
),
),
),
),
body: MaxWidthBody(
withScrolling: true,
child: StreamBuilder(
const Divider(height: 1),
StreamBuilder(
stream: room.onUpdate.stream,
builder: (context, snapshot) {
return FutureBuilder<List<DeviceKeys>>(
@ -57,8 +59,8 @@ class ChatEncryptionSettingsView extends StatelessWidget {
}
if (!snapshot.hasData) {
return const Center(
child:
CircularProgressIndicator.adaptive(strokeWidth: 2));
child: CircularProgressIndicator.adaptive(
strokeWidth: 2));
}
final deviceKeys = snapshot.data;
return ListView.builder(
@ -119,8 +121,8 @@ class ChatEncryptionSettingsView extends StatelessWidget {
if (deviceKeys[i].blocked ||
!deviceKeys[i].verified) {
items.add(PopupMenuItem(
value:
deviceKeys[i].userId == room.client.userID
value: deviceKeys[i].userId ==
room.client.userID
? 'verify'
: 'verify_user',
child: Text(L10n.of(context).verifyStart),
@ -180,6 +182,8 @@ class ChatEncryptionSettingsView extends StatelessWidget {
},
);
}),
],
),
),
);
}

View File

@ -17,9 +17,11 @@ class SettingsStoriesView extends StatelessWidget {
return Scaffold(
appBar: AppBar(
title: Text(L10n.of(context)!.whoCanSeeMyStories),
bottom: PreferredSize(
preferredSize: const Size.fromHeight(56),
child: ListTile(
elevation: 0,
),
body: Column(
children: [
ListTile(
title: Text(L10n.of(context)!.whoCanSeeMyStoriesDesc),
leading: CircleAvatar(
backgroundColor: Theme.of(context).secondaryHeaderColor,
@ -27,9 +29,9 @@ class SettingsStoriesView extends StatelessWidget {
child: const Icon(Icons.lock),
),
),
),
),
body: FutureBuilder(
const Divider(height: 1),
Expanded(
child: FutureBuilder(
future: controller.loadUsers,
builder: (context, snapshot) {
final error = snapshot.error;
@ -59,6 +61,9 @@ class SettingsStoriesView extends StatelessWidget {
);
},
),
),
],
),
);
}
}