initial commit
This commit is contained in:
58
lib/widgets/projectCard.dart
Normal file
58
lib/widgets/projectCard.dart
Normal file
@@ -0,0 +1,58 @@
|
||||
import "package:flutter/material.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 ProjectCard extends StatelessWidget {
|
||||
const ProjectCard(this.id, {super.key});
|
||||
final int id;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
GlobalModel gm = Provider.of<GlobalModel>(context);
|
||||
final Project prj = gm.nthPrj(id);
|
||||
return YaruBanner(
|
||||
padding: .only(
|
||||
left: kYaruPagePadding,
|
||||
top: kYaruPagePadding,
|
||||
bottom: kYaruPagePadding,
|
||||
right: kYaruPagePadding,
|
||||
),
|
||||
onHover: (st) => gm.setHoverShow(id, st),
|
||||
onTap: () {
|
||||
var shell = Shell();
|
||||
shell.run("konsole -e nvim ${prj.path.path}");
|
||||
},
|
||||
child: Center(
|
||||
child: Column(
|
||||
mainAxisAlignment: .start,
|
||||
crossAxisAlignment: .start,
|
||||
children: [
|
||||
Row(
|
||||
mainAxisAlignment: .spaceBetween,
|
||||
children: [
|
||||
Text("${prj.name}", style: TextStyle(fontSize: 30)),
|
||||
gm.getHoverShow(id)
|
||||
? ElevatedButton(
|
||||
child: Icon(Icons.close),
|
||||
onPressed: () => print("pressed delete"),
|
||||
)
|
||||
: Container(),
|
||||
],
|
||||
),
|
||||
Row(
|
||||
spacing: 10,
|
||||
children: [
|
||||
Text("${prj.language}"),
|
||||
prj.isGit ? Icon(Icons.commit) : Container(),
|
||||
],
|
||||
),
|
||||
gm.getHoverShow(id) ? Text("${prj.path.path}") : Container(),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user