feat: context menu vert

This commit is contained in:
Prateek Sunal 2024-03-29 16:07:09 +05:30
parent 71e87ef7e9
commit 056e29a5f5

View file

@ -225,50 +225,45 @@ class _CodeWidgetState extends State<CodeWidget> {
), ),
if (PlatformUtil.isDesktop()) if (PlatformUtil.isDesktop())
Row( Row(
mainAxisAlignment: MainAxisAlignment.end,
children: [ children: [
Expanded( SlideAction(
child: SlideAction( onPressed: _onShowQrPressed,
onPressed: _onShowQrPressed, backgroundColor: Colors.grey.withOpacity(0.1),
backgroundColor: Colors.grey.withOpacity(0.1), borderRadius: const BorderRadius.all(Radius.circular(12.0)),
borderRadius: const BorderRadius.all(Radius.circular(12.0)), foregroundColor:
foregroundColor: Theme.of(context).colorScheme.inverseBackgroundColor,
Theme.of(context).colorScheme.inverseBackgroundColor, icon: Icons.qr_code_2_outlined,
icon: Icons.qr_code_2_outlined, label: "QR",
label: "QR", padding: const EdgeInsets.only(left: 4, right: 0),
padding: const EdgeInsets.only(left: 4, right: 0), spacing: 8,
spacing: 8,
),
), ),
const SizedBox( const SizedBox(
width: 4, width: 4,
), ),
Expanded( SlideAction(
child: SlideAction( onPressed: _onEditPressed,
onPressed: _onEditPressed, backgroundColor: Colors.grey.withOpacity(0.1),
backgroundColor: Colors.grey.withOpacity(0.1), borderRadius: const BorderRadius.all(Radius.circular(12.0)),
borderRadius: const BorderRadius.all(Radius.circular(12.0)), foregroundColor:
foregroundColor: Theme.of(context).colorScheme.inverseBackgroundColor,
Theme.of(context).colorScheme.inverseBackgroundColor, icon: Icons.edit_outlined,
icon: Icons.edit_outlined, label: l10n.edit,
label: l10n.edit, padding: const EdgeInsets.only(left: 4, right: 0),
padding: const EdgeInsets.only(left: 4, right: 0), spacing: 8,
spacing: 8,
),
), ),
const SizedBox( const SizedBox(
width: 4, width: 4,
), ),
Expanded( SlideAction(
child: SlideAction( onPressed: _onDeletePressed,
onPressed: _onDeletePressed, backgroundColor: Colors.grey.withOpacity(0.1),
backgroundColor: Colors.grey.withOpacity(0.1), borderRadius: const BorderRadius.all(Radius.circular(12.0)),
borderRadius: const BorderRadius.all(Radius.circular(12.0)), foregroundColor: const Color(0xFFFE4A49),
foregroundColor: const Color(0xFFFE4A49), icon: Icons.delete,
icon: Icons.delete, label: l10n.delete,
label: l10n.delete, padding: const EdgeInsets.only(left: 0, right: 0),
padding: const EdgeInsets.only(left: 0, right: 0), spacing: 8,
spacing: 8,
),
), ),
], ],
), ),
@ -563,8 +558,9 @@ class SlideAction extends StatelessWidget {
onTap: () => onPressed(0), onTap: () => onPressed(0),
child: Container( child: Container(
color: backgroundColor, color: backgroundColor,
height: 32, height: 52,
child: Row( width: 52,
child: Column(
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,
children: [ children: [
Icon( Icon(
@ -573,7 +569,7 @@ class SlideAction extends StatelessWidget {
color: foregroundColor, color: foregroundColor,
), ),
const SizedBox( const SizedBox(
width: 4, height: 4,
), ),
Text( Text(
label, label,