Files
Prod/lib/widgets/launcherButton.dart
Phani Pavan K ce25d26f70
All checks were successful
Build CI / AMD64 Build (push) Successful in 1m54s
moved editing page to popup
2026-03-11 01:10:25 +05:30

37 lines
1.0 KiB
Dart

import "package:flutter/material.dart";
import "package:prod/models/editor.dart";
import "package:prod/models/globalModel.dart";
import "package:provider/provider.dart";
import "package:process_run/shell.dart";
class LauncherButton extends StatelessWidget {
const LauncherButton(this.eid, this.path, {super.key});
final String eid;
final String path;
@override
Widget build(BuildContext context) {
// print("EDITOR ID: $eid");
GlobalModel gm = Provider.of<GlobalModel>(context, listen: false);
final int enumb = gm.getEdtPosFromID(eid);
if (enumb == -1) {
return Container();
}
final Editor edt = gm.nthEdt(enumb);
// print("GRABBED EDITOR: ${edt.name}");
return eid == ""
? Container()
: Expanded(
flex: 1,
child: TextButton(
child: Text("${edt.sname}"),
onPressed: () {
Shell().run(
"${edt.commandTemplate.replaceAll('\$path', path)}",
);
},
),
);
}
}