Skip to content

Commit

Permalink
refactor: more idiomatic dialog
Browse files Browse the repository at this point in the history
  • Loading branch information
PeronGH committed Jan 9, 2024
1 parent 886787e commit b9594fd
Showing 1 changed file with 13 additions and 21 deletions.
34 changes: 13 additions & 21 deletions lib/widgets/share_conversation_dialog.dart
Original file line number Diff line number Diff line change
Expand Up @@ -12,27 +12,19 @@ class ShareConversationDialog extends StatelessWidget {
Widget build(BuildContext context) {
return AlertDialog(
title: const Text("ShareGPT URL"),
content: SingleChildScrollView(
child: ListBody(children: [
SelectableText(shareGptUrl),
const SizedBox(height: 16),
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
IconButton(
icon: const Icon(Icons.copy_rounded),
onPressed: () => copyContent(shareGptUrl),
tooltip: "Copy URL",
),
IconButton(
icon: const Icon(Icons.open_in_browser_rounded),
onPressed: () => openUrl(shareGptUrl),
tooltip: "Open URL",
)
],
)
]),
),
content: SelectableText(shareGptUrl),
actions: [
IconButton(
icon: const Icon(Icons.copy_rounded),
onPressed: () => copyContent(shareGptUrl),
tooltip: "Copy URL",
),
IconButton(
icon: const Icon(Icons.open_in_browser_rounded),
onPressed: () => openUrl(shareGptUrl),
tooltip: "Open URL",
)
],
);
}
}

0 comments on commit b9594fd

Please sign in to comment.