112 lines
3.7 KiB
Dart
112 lines
3.7 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 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 InkWell(
|
|
onHover: (st) => gm.setHoverShow(id, st),
|
|
borderRadius: .circular(kYaruContainerRadius),
|
|
onTap: () async {
|
|
await Navigator.pushNamed(context, "/manageprj", arguments: id);
|
|
},
|
|
child: Card(
|
|
// decoration: BoxDecoration(
|
|
// border: Border.all(color: Theme.of(context).dividerColor),
|
|
// borderRadius: .circular(kYaruContainerRadius),
|
|
// ),
|
|
shape: RoundedRectangleBorder(
|
|
borderRadius: BorderRadius.circular(
|
|
kYaruContainerRadius,
|
|
).inner(const EdgeInsets.all(4)),
|
|
side: BorderSide(color: Theme.of(context).dividerColor, width: 0),
|
|
),
|
|
color: Colors.white,
|
|
shadowColor: Colors.transparent,
|
|
child: Row(
|
|
mainAxisAlignment: .spaceBetween,
|
|
children: [
|
|
Container(
|
|
padding: .only(
|
|
top: kYaruPagePadding * 0.5,
|
|
left: kYaruPagePadding * 0.5,
|
|
),
|
|
child: Column(
|
|
mainAxisAlignment: .start,
|
|
crossAxisAlignment: .start,
|
|
children: [
|
|
Text(
|
|
"${prj.name}",
|
|
style: TextStyle(fontSize: 30),
|
|
overflow: .ellipsis,
|
|
),
|
|
Row(
|
|
spacing: 10,
|
|
children: [
|
|
Text("${prj.language}", overflow: .ellipsis),
|
|
prj.isGit ? Icon(Icons.commit) : Container(),
|
|
],
|
|
),
|
|
gm.getHoverShow(id)
|
|
? Text("${prj.path.path}", overflow: .ellipsis)
|
|
: Container(),
|
|
// gm.getHoverShow(id)
|
|
// ? IconButton(
|
|
// icon: Icon(Icons.close),
|
|
// onPressed: () => gm.delPrj(id),
|
|
// style: IconButton.styleFrom(
|
|
// overlayColor: Color(0xffff0000),
|
|
// ),
|
|
// )
|
|
// : Container(),
|
|
],
|
|
),
|
|
),
|
|
Row(
|
|
children: [
|
|
Column(
|
|
children: [
|
|
Expanded(
|
|
flex: 1,
|
|
child: TextButton(child: Text("Ze"), onPressed: () {}),
|
|
),
|
|
Expanded(
|
|
flex: 1,
|
|
child: TextButton(child: Text("Ze"), onPressed: () {}),
|
|
),
|
|
],
|
|
),
|
|
Column(
|
|
children: [
|
|
Expanded(
|
|
child: TextButton(child: Text("Ze"), onPressed: () {}),
|
|
),
|
|
true
|
|
? Expanded(
|
|
child: TextButton(
|
|
child: Text("Ze"),
|
|
onPressed: () {},
|
|
),
|
|
)
|
|
: Container(),
|
|
],
|
|
),
|
|
],
|
|
),
|
|
],
|
|
),
|
|
),
|
|
);
|
|
}
|
|
}
|