64 lines
2.0 KiB
Dart
64 lines
2.0 KiB
Dart
import "package:flutter/material.dart";
|
|
import "package:prod/models/editor.dart";
|
|
import "package:prod/models/globalModel.dart";
|
|
import "package:prod/models/project.dart";
|
|
import "package:provider/provider.dart";
|
|
import "package:yaru/yaru.dart";
|
|
import "package:process_run/shell.dart";
|
|
|
|
class EditorCard extends StatelessWidget {
|
|
const EditorCard(this.id, {super.key});
|
|
final int id;
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
GlobalModel gm = Provider.of<GlobalModel>(context);
|
|
final Editor edt = gm.nthEdt(id);
|
|
final String icon =
|
|
"${edt.name.substring(0, 1).toUpperCase()}${edt.name.substring(1, 2).toLowerCase()}";
|
|
return YaruBanner(
|
|
padding: .only(
|
|
left: kYaruPagePadding,
|
|
top: kYaruPagePadding * 0.5,
|
|
bottom: kYaruPagePadding,
|
|
right: kYaruPagePadding,
|
|
),
|
|
|
|
onTap: () => gm.delEdt(id),
|
|
|
|
child: Row(
|
|
children: [
|
|
Text("$icon", style: TextStyle(fontSize: 50)),
|
|
VerticalDivider(width: 20, thickness: 2),
|
|
Flexible(
|
|
child: Column(
|
|
mainAxisAlignment: .center,
|
|
crossAxisAlignment: .start,
|
|
children: [
|
|
Flexible(
|
|
child: Text(
|
|
"${edt.name}",
|
|
style: TextStyle(fontSize: 25),
|
|
overflow: .ellipsis,
|
|
),
|
|
),
|
|
Text("${edt.commandTemplate}", overflow: .ellipsis),
|
|
// gm.getHoverShow(id) ? Text("${edt.path.path}") : Container(),
|
|
// gm.getHoverShow(id)
|
|
// ? IconButton(
|
|
// icon: Icon(Icons.close),
|
|
// onPressed: () => gm.deledt(id),
|
|
// style: IconButton.styleFrom(
|
|
// overlayColor: Color(0xffff0000),
|
|
// ),
|
|
// )
|
|
// : Container(),
|
|
],
|
|
),
|
|
),
|
|
],
|
|
),
|
|
);
|
|
}
|
|
}
|