added prj editing page, must change to dialog bcz page too big
This commit is contained in:
@@ -14,8 +14,6 @@ class EditorCard extends StatelessWidget {
|
||||
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,
|
||||
@@ -28,7 +26,7 @@ class EditorCard extends StatelessWidget {
|
||||
|
||||
child: Row(
|
||||
children: [
|
||||
Text("$icon", style: TextStyle(fontSize: 50)),
|
||||
Text("${edt.sname}", style: TextStyle(fontSize: 50)),
|
||||
VerticalDivider(width: 20, thickness: 2),
|
||||
Flexible(
|
||||
child: Column(
|
||||
|
||||
@@ -10,6 +10,7 @@ class ProjFAB extends StatelessWidget {
|
||||
Widget build(BuildContext context) {
|
||||
TextEditingController nameController = TextEditingController();
|
||||
TextEditingController locationController = TextEditingController();
|
||||
TextEditingController languageController = TextEditingController();
|
||||
return FloatingActionButton(
|
||||
onPressed: () {
|
||||
showDialog(
|
||||
@@ -33,6 +34,13 @@ class ProjFAB extends StatelessWidget {
|
||||
decoration: InputDecoration(labelText: "Path"),
|
||||
),
|
||||
),
|
||||
Padding(
|
||||
padding: const EdgeInsets.all(8.0),
|
||||
child: TextField(
|
||||
controller: languageController,
|
||||
decoration: InputDecoration(labelText: "Language"),
|
||||
),
|
||||
),
|
||||
|
||||
Row(
|
||||
mainAxisAlignment: .end,
|
||||
@@ -47,7 +55,7 @@ class ProjFAB extends StatelessWidget {
|
||||
Provider.of<GlobalModel>(context, listen: false).addPrj(
|
||||
Project.newValidated(
|
||||
nameController.text,
|
||||
"Rust",
|
||||
languageController.text,
|
||||
locationController.text,
|
||||
[],
|
||||
true,
|
||||
|
||||
@@ -23,10 +23,14 @@ class ProjectCard extends StatelessWidget {
|
||||
),
|
||||
onHover: (st) => gm.setHoverShow(id, st),
|
||||
onTap: () {
|
||||
var shell = Shell();
|
||||
Editor edt1 = gm.editors[0];
|
||||
String comm = edt1.commandTemplate.replaceAll("\$path", prj.path.path);
|
||||
shell.run(comm);
|
||||
// var shell = Shell();
|
||||
// Editor edt1 = gm.editors[0];
|
||||
// String comm = edt1.commandTemplate.replaceAll("\$path", prj.path.path);
|
||||
// shell.run(comm);
|
||||
// ScaffoldMessenger.of(context).showSnackBar(
|
||||
// SnackBar(content: Text("Launched "), duration: Duration(seconds: 3)),
|
||||
// );
|
||||
Navigator.pushNamed(context, "/manageprj", arguments: id);
|
||||
},
|
||||
child: Center(
|
||||
child: Column(
|
||||
@@ -46,15 +50,15 @@ class ProjectCard extends StatelessWidget {
|
||||
],
|
||||
),
|
||||
gm.getHoverShow(id) ? Text("${prj.path.path}") : Container(),
|
||||
gm.getHoverShow(id)
|
||||
? IconButton(
|
||||
icon: Icon(Icons.close),
|
||||
onPressed: () => gm.delPrj(id),
|
||||
style: IconButton.styleFrom(
|
||||
overlayColor: Color(0xffff0000),
|
||||
),
|
||||
)
|
||||
: Container(),
|
||||
// gm.getHoverShow(id)
|
||||
// ? IconButton(
|
||||
// icon: Icon(Icons.close),
|
||||
// onPressed: () => gm.delPrj(id),
|
||||
// style: IconButton.styleFrom(
|
||||
// overlayColor: Color(0xffff0000),
|
||||
// ),
|
||||
// )
|
||||
// : Container(),
|
||||
],
|
||||
),
|
||||
),
|
||||
|
||||
Reference in New Issue
Block a user