Added Share Functionality in the Code section by implementing a share-tray by using share_plus package

This commit is contained in:
Mrudul-2
2025-02-13 17:06:22 +05:30
parent d67ea653e5
commit aa9e95df95
4 changed files with 7 additions and 0 deletions

View File

@ -421,6 +421,7 @@ const kLabelSend = "Send";
const kLabelSending = "Sending..";
const kLabelBusy = "Busy";
const kLabelCopy = "Copy";
const kLabelShare = "Share";
const kLabelSave = "Save";
const kLabelDownload = "Download";
const kLabelSaving = "Saving";

View File

@ -1,6 +1,7 @@
import 'package:apidash_design_system/apidash_design_system.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:flutter/foundation.dart';
import 'package:apidash/consts.dart';
class CopyButton extends StatelessWidget {
@ -39,3 +40,5 @@ class CopyButton extends StatelessWidget {
);
}
}

View File

@ -1,3 +1,4 @@
import 'package:apidash/widgets/button_share.dart';
import 'package:apidash_design_system/apidash_design_system.dart';
import 'package:flutter/material.dart';
import 'package:highlighter/highlighter.dart' show highlight;
@ -150,6 +151,7 @@ class ViewCodePane extends StatelessWidget {
toCopy: code,
showLabel: showLabel,
),
ShareButton(toShare: code),
SaveInDownloadsButton(
content: stringToBytes(code),
ext: codegenLanguage.ext,

View File

@ -67,6 +67,7 @@ dependencies:
git:
url: https://github.com/google/flutter-desktop-embedding.git
path: plugins/window_size
share_plus: ^10.1.4
dependency_overrides:
extended_text_field: ^16.0.0