Skip to content

Commit

Permalink
drawer metadataState
Browse files Browse the repository at this point in the history
  • Loading branch information
leo-lox committed Nov 20, 2024
1 parent c36a579 commit 8756c61
Showing 1 changed file with 8 additions and 12 deletions.
20 changes: 8 additions & 12 deletions lib/presentation_layer/routes/nostr/nostr_page/nostr_page.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import 'dart:async';

import 'package:camelus/presentation_layer/providers/metadata_state_provider.dart';
import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
import 'package:flutter_svg/flutter_svg.dart';
Expand Down Expand Up @@ -143,21 +144,16 @@ class LeadingWidget extends ConsumerWidget {

@override
Widget build(BuildContext context, WidgetRef ref) {
final metadataP = ref.watch(metadataProvider);
final myMetadata = ref.watch(metadataStateProvider(pubkey)).userMetadata;
return InkWell(
borderRadius: BorderRadius.circular(100),
onTap: () => parentScaffoldKey.currentState!.openDrawer(),
child: FutureBuilder<UserMetadata?>(
future: metadataP.getMetadataByPubkey(pubkey).first,
builder: (context, snapshot) {
return Padding(
padding: const EdgeInsets.all(9.0),
child: UserImage(
imageUrl: snapshot.data?.picture,
pubkey: pubkey,
),
);
},
child: Padding(
padding: const EdgeInsets.all(9.0),
child: UserImage(
imageUrl: myMetadata?.picture,
pubkey: pubkey,
),
),
);
}
Expand Down

0 comments on commit 8756c61

Please sign in to comment.