mirror of
https://gitlab.com/veilid/veilidchat.git
synced 2024-10-01 06:55:46 -04:00
use non-bounce scroll physics because a lot of views want 'stick to bottom' scroll behavior
fix creating new accounts
This commit is contained in:
parent
551eedee6f
commit
4271fb51c6
@ -281,15 +281,33 @@ class AccountRepository {
|
|||||||
parent: parent))
|
parent: parent))
|
||||||
.scope((r) async => r.recordPointer);
|
.scope((r) async => r.recordPointer);
|
||||||
|
|
||||||
|
final groupChatRecords = await (await DHTShortArray.create(
|
||||||
|
debugName: 'AccountRepository::_newLocalAccount::GroupChats',
|
||||||
|
parent: parent))
|
||||||
|
.scope((r) async => r.recordPointer);
|
||||||
|
|
||||||
// Make account object
|
// Make account object
|
||||||
|
final profile = proto.Profile()
|
||||||
|
..name = accountSpec.name
|
||||||
|
..pronouns = accountSpec.pronouns
|
||||||
|
..about = accountSpec.about
|
||||||
|
..status = accountSpec.status
|
||||||
|
..availability = accountSpec.availability
|
||||||
|
..timestamp = Veilid.instance.now().toInt64();
|
||||||
|
|
||||||
final account = proto.Account()
|
final account = proto.Account()
|
||||||
..profile.name = accountSpec.name
|
..profile = profile
|
||||||
..profile.pronouns = accountSpec.pronouns
|
..invisible = accountSpec.invisible
|
||||||
..profile.about = accountSpec.about
|
..autoAwayTimeoutMin = accountSpec.autoAwayTimeout
|
||||||
..profile.status = accountSpec.status
|
|
||||||
..contactList = contactList.toProto()
|
..contactList = contactList.toProto()
|
||||||
..contactInvitationRecords = contactInvitationRecords.toProto()
|
..contactInvitationRecords = contactInvitationRecords.toProto()
|
||||||
..chatList = chatRecords.toProto();
|
..chatList = chatRecords.toProto()
|
||||||
|
..groupChatList = groupChatRecords.toProto()
|
||||||
|
..freeMessage = accountSpec.freeMessage
|
||||||
|
..awayMessage = accountSpec.awayMessage
|
||||||
|
..busyMessage = accountSpec.busyMessage
|
||||||
|
..autodetectAway = accountSpec.autoAway;
|
||||||
|
|
||||||
return account.writeToBuffer();
|
return account.writeToBuffer();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -30,6 +30,13 @@ class AttachDetachIntent extends Intent {
|
|||||||
const AttachDetachIntent();
|
const AttachDetachIntent();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
class ScrollBehaviorModified extends ScrollBehavior {
|
||||||
|
const ScrollBehaviorModified();
|
||||||
|
@override
|
||||||
|
ScrollPhysics getScrollPhysics(BuildContext context) =>
|
||||||
|
const ClampingScrollPhysics();
|
||||||
|
}
|
||||||
|
|
||||||
class VeilidChatApp extends StatelessWidget {
|
class VeilidChatApp extends StatelessWidget {
|
||||||
const VeilidChatApp({
|
const VeilidChatApp({
|
||||||
required this.initialThemeData,
|
required this.initialThemeData,
|
||||||
@ -159,6 +166,7 @@ class VeilidChatApp extends StatelessWidget {
|
|||||||
return DecoratedBox(
|
return DecoratedBox(
|
||||||
decoration: BoxDecoration(gradient: gradient),
|
decoration: BoxDecoration(gradient: gradient),
|
||||||
child: MaterialApp.router(
|
child: MaterialApp.router(
|
||||||
|
scrollBehavior: const ScrollBehaviorModified(),
|
||||||
debugShowCheckedModeBanner: false,
|
debugShowCheckedModeBanner: false,
|
||||||
routerConfig: context.read<RouterCubit>().router(),
|
routerConfig: context.read<RouterCubit>().router(),
|
||||||
title: translate('app.title'),
|
title: translate('app.title'),
|
||||||
|
Loading…
Reference in New Issue
Block a user