Skip to content

Commit

Permalink
Add width to save to clipboard text
Browse files Browse the repository at this point in the history
  • Loading branch information
CodeDoctorDE committed Sep 29, 2024
1 parent 2bee5ba commit 1771b73
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions packages/material_leap/lib/src/api/save.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,17 @@ import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:material_leap/l10n/leap_localizations.dart';

void saveToClipboard(BuildContext context, String text,
{Widget? leading, SnackBarBehavior? behavior}) {
void saveToClipboard(
BuildContext context,
String text, {
Widget? leading,
SnackBarBehavior behavior = SnackBarBehavior.floating,
double? width = 300,
}) {
Clipboard.setData(ClipboardData(text: text));
ScaffoldMessenger.of(context).showSnackBar(SnackBar(
behavior: behavior ?? SnackBarBehavior.floating,
behavior: behavior,
width: width,
content: Row(mainAxisSize: MainAxisSize.min, children: [
if (leading != null) ...[
leading,
Expand Down

0 comments on commit 1771b73

Please sign in to comment.