Skip to content

Commit

Permalink
feat: Remove buttons from Wallet metadata for issuers page #3133
Browse files Browse the repository at this point in the history
  • Loading branch information
bibash28 committed Dec 3, 2024
1 parent 264b9e1 commit 10d50c4
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 32 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ class Oidc4vcSettingMenuView extends StatelessWidget {
JsonViewerPage.route(
title: 'Wallet metadata for issuers',
data: value,
showButton: false,
),
);
},
Expand Down
73 changes: 41 additions & 32 deletions lib/dashboard/json_viewer/view/json_viewer_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -9,19 +9,23 @@ class JsonViewerPage extends StatelessWidget {
super.key,
required this.title,
required this.data,
required this.showButton,
});

final String title;
final String data;
final bool showButton;

static Route<dynamic> route({
required String title,
required String data,
bool showButton = true,
}) =>
MaterialPageRoute<void>(
builder: (_) => JsonViewerPage(
title: title,
data: data,
showButton: showButton,
),
settings: const RouteSettings(name: '/JsonViewerPage'),
);
Expand All @@ -31,6 +35,7 @@ class JsonViewerPage extends StatelessWidget {
return JsonViewerView(
title: title,
data: data,
showButton: showButton,
);
}
}
Expand All @@ -40,10 +45,12 @@ class JsonViewerView extends StatelessWidget {
super.key,
required this.title,
required this.data,
required this.showButton,
});

final String title;
final String data;
final bool showButton;

@override
Widget build(BuildContext context) {
Expand All @@ -59,40 +66,42 @@ class JsonViewerView extends StatelessWidget {
),
padding: const EdgeInsets.symmetric(horizontal: 10),
body: JsonViewWidget(data: data),
navigation: Padding(
padding: const EdgeInsets.all(
Sizes.spaceSmall,
),
child: Column(
mainAxisSize: MainAxisSize.min,
children: [
MyElevatedButton(
text: l10n.continueString,
onPressed: () {
Navigator.of(context).pop(true);
},
),
const SizedBox(height: 8),
MyElevatedButton(
text: l10n.download,
verticalSpacing: 14,
fontSize: 15,
elevation: 0,
onPressed: () {
final box = context.findRenderObject() as RenderBox?;
final subject = l10n.shareWith;
navigation: !showButton
? null
: Padding(
padding: const EdgeInsets.all(
Sizes.spaceSmall,
),
child: Column(
mainAxisSize: MainAxisSize.min,
children: [
MyElevatedButton(
text: l10n.continueString,
onPressed: () {
Navigator.of(context).pop(true);
},
),
const SizedBox(height: 8),
MyElevatedButton(
text: l10n.download,
verticalSpacing: 14,
fontSize: 15,
elevation: 0,
onPressed: () {
final box = context.findRenderObject() as RenderBox?;
final subject = l10n.shareWith;

Share.share(
data,
subject: subject,
sharePositionOrigin:
box!.localToGlobal(Offset.zero) & box.size,
);
},
Share.share(
data,
subject: subject,
sharePositionOrigin:
box!.localToGlobal(Offset.zero) & box.size,
);
},
),
],
),
),
],
),
),
);
}
}

0 comments on commit 10d50c4

Please sign in to comment.