mirror of
https://github.com/gabehf/Fladder.git
synced 2026-03-16 02:35:59 -07:00
feature: More info playback state (#219)
Co-authored-by: PartyDonut <PartyDonut@users.noreply.github.com>
This commit is contained in:
parent
cf53f02d90
commit
f259151336
7 changed files with 112 additions and 186 deletions
|
|
@ -1,5 +1,4 @@
|
|||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
|
||||
import 'package:ficonsax/ficonsax.dart';
|
||||
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
||||
|
|
@ -7,7 +6,7 @@ import 'package:flutter_riverpod/flutter_riverpod.dart';
|
|||
import 'package:fladder/models/information_model.dart';
|
||||
import 'package:fladder/models/item_base_model.dart';
|
||||
import 'package:fladder/providers/items/information_provider.dart';
|
||||
import 'package:fladder/screens/shared/fladder_snackbar.dart';
|
||||
import 'package:fladder/util/clipboard_helper.dart';
|
||||
import 'package:fladder/util/localization_helper.dart';
|
||||
import 'package:fladder/widgets/shared/clickable_text.dart';
|
||||
|
||||
|
|
@ -79,12 +78,7 @@ class ItemInfoScreenState extends ConsumerState<ItemInfoScreen> {
|
|||
const Spacer(),
|
||||
const SizedBox(width: 6),
|
||||
IconButton(
|
||||
onPressed: () async {
|
||||
await Clipboard.setData(ClipboardData(text: info.model.toString()));
|
||||
if (context.mounted) {
|
||||
fladderSnackbar(context, title: "Copied to clipboard");
|
||||
}
|
||||
},
|
||||
onPressed: () => context.copyToClipboard(info.model.toString()),
|
||||
icon: const Icon(Icons.copy_all_rounded)),
|
||||
const SizedBox(width: 6),
|
||||
IconButton(
|
||||
|
|
@ -171,10 +165,7 @@ class ItemInfoScreenState extends ConsumerState<ItemInfoScreen> {
|
|||
Flexible(
|
||||
child: ClickableText(
|
||||
text: title,
|
||||
onTap: () async {
|
||||
await Clipboard.setData(ClipboardData(text: value));
|
||||
fladderSnackbar(context, title: "Copied to clipboard");
|
||||
},
|
||||
onTap: () => context.copyToClipboard(value),
|
||||
style: Theme.of(context).textTheme.titleMedium?.copyWith(fontWeight: FontWeight.bold),
|
||||
),
|
||||
),
|
||||
|
|
@ -211,10 +202,7 @@ class ItemInfoScreenState extends ConsumerState<ItemInfoScreen> {
|
|||
),
|
||||
),
|
||||
IconButton(
|
||||
onPressed: () async {
|
||||
await Clipboard.setData(ClipboardData(text: InformationModel.mapToString(map)));
|
||||
fladderSnackbar(context, title: "Copied to clipboard");
|
||||
},
|
||||
onPressed: () => context.copyToClipboard(InformationModel.mapToString(map)),
|
||||
icon: const Icon(Icons.copy_all_rounded))
|
||||
],
|
||||
),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue