♻️ Better image loading animation and more commonly used blurhash
This commit is contained in:
@@ -183,8 +183,8 @@ class RealmDetailScreen extends HookConsumerWidget {
|
||||
flexibleSpace: Stack(
|
||||
children: [
|
||||
Positioned.fill(
|
||||
child: realm!.background?.id != null
|
||||
? CloudImageWidget(fileId: realm.background!.id)
|
||||
child: realm!.background != null
|
||||
? CloudImageWidget(file: realm.background!)
|
||||
: Container(
|
||||
color: Theme.of(
|
||||
context,
|
||||
@@ -281,8 +281,8 @@ class RealmDetailScreen extends HookConsumerWidget {
|
||||
flexibleSpace: Stack(
|
||||
children: [
|
||||
Positioned.fill(
|
||||
child: realm!.background?.id != null
|
||||
? CloudImageWidget(fileId: realm.background!.id)
|
||||
child: realm!.background != null
|
||||
? CloudImageWidget(file: realm.background!)
|
||||
: Container(
|
||||
color: Theme.of(
|
||||
context,
|
||||
@@ -604,7 +604,7 @@ class _RealmMemberListSheet extends HookConsumerWidget {
|
||||
leading: AccountPfcGestureDetector(
|
||||
uname: member.account!.name,
|
||||
child: ProfilePictureWidget(
|
||||
fileId: member.account!.profile.picture?.id,
|
||||
file: member.account!.profile.picture,
|
||||
),
|
||||
),
|
||||
title: Row(
|
||||
|
||||
@@ -90,14 +90,10 @@ class EditRealmScreen extends HookConsumerWidget {
|
||||
showLoadingModal(context);
|
||||
submitting.value = true;
|
||||
try {
|
||||
final cloudFile =
|
||||
await FileUploader.createCloudFile(
|
||||
ref: ref,
|
||||
fileData: UniversalFile(
|
||||
data: result,
|
||||
type: UniversalFileType.image,
|
||||
),
|
||||
).future;
|
||||
final cloudFile = await FileUploader.createCloudFile(
|
||||
ref: ref,
|
||||
fileData: UniversalFile(data: result, type: UniversalFileType.image),
|
||||
).future;
|
||||
if (cloudFile == null) {
|
||||
throw ArgumentError('Failed to upload the file...');
|
||||
}
|
||||
@@ -162,13 +158,12 @@ class EditRealmScreen extends HookConsumerWidget {
|
||||
GestureDetector(
|
||||
child: Container(
|
||||
color: Theme.of(context).colorScheme.surfaceContainerHigh,
|
||||
child:
|
||||
background.value != null
|
||||
? CloudFileWidget(
|
||||
item: background.value!,
|
||||
fit: BoxFit.cover,
|
||||
)
|
||||
: const SizedBox.shrink(),
|
||||
child: background.value != null
|
||||
? CloudFileWidget(
|
||||
item: background.value!,
|
||||
fit: BoxFit.cover,
|
||||
)
|
||||
: const SizedBox.shrink(),
|
||||
),
|
||||
onTap: () {
|
||||
setPicture('background');
|
||||
@@ -179,7 +174,7 @@ class EditRealmScreen extends HookConsumerWidget {
|
||||
bottom: -32,
|
||||
child: GestureDetector(
|
||||
child: ProfilePictureWidget(
|
||||
fileId: picture.value?.id,
|
||||
file: picture.value,
|
||||
radius: 40,
|
||||
fallbackIcon: Symbols.group,
|
||||
),
|
||||
@@ -202,15 +197,15 @@ class EditRealmScreen extends HookConsumerWidget {
|
||||
labelText: 'slug'.tr(),
|
||||
helperText: 'slugHint'.tr(),
|
||||
),
|
||||
onTapOutside:
|
||||
(_) => FocusManager.instance.primaryFocus?.unfocus(),
|
||||
onTapOutside: (_) =>
|
||||
FocusManager.instance.primaryFocus?.unfocus(),
|
||||
),
|
||||
const SizedBox(height: 16),
|
||||
TextFormField(
|
||||
controller: nameController,
|
||||
decoration: InputDecoration(labelText: 'name'.tr()),
|
||||
onTapOutside:
|
||||
(_) => FocusManager.instance.primaryFocus?.unfocus(),
|
||||
onTapOutside: (_) =>
|
||||
FocusManager.instance.primaryFocus?.unfocus(),
|
||||
),
|
||||
const SizedBox(height: 16),
|
||||
TextFormField(
|
||||
@@ -221,8 +216,8 @@ class EditRealmScreen extends HookConsumerWidget {
|
||||
),
|
||||
minLines: 3,
|
||||
maxLines: null,
|
||||
onTapOutside:
|
||||
(_) => FocusManager.instance.primaryFocus?.unfocus(),
|
||||
onTapOutside: (_) =>
|
||||
FocusManager.instance.primaryFocus?.unfocus(),
|
||||
),
|
||||
const SizedBox(height: 16),
|
||||
Card(
|
||||
|
||||
@@ -213,7 +213,7 @@ class _RealmInviteSheet extends HookConsumerWidget {
|
||||
final invite = items[index];
|
||||
return ListTile(
|
||||
leading: ProfilePictureWidget(
|
||||
fileId: invite.realm!.picture?.id,
|
||||
file: invite.realm!.picture,
|
||||
fallbackIcon: Symbols.group,
|
||||
),
|
||||
title: Text(invite.realm!.name),
|
||||
|
||||
Reference in New Issue
Block a user