beautified project editing window, added theme
All checks were successful
Build CI / AMD64 Build (push) Successful in 2m23s

This commit is contained in:
2026-03-19 13:55:04 +05:30
parent a8d397a53e
commit 823690aed3
5 changed files with 137 additions and 83 deletions

View File

@@ -22,7 +22,7 @@ class MyApp extends StatelessWidget {
return YaruTheme(
builder: (context, yaru, child) {
return MaterialApp(
theme: yaru.theme,
theme: yaruLight,
themeMode: .system,
darkTheme: yaru.darkTheme,
routes: {

View File

@@ -3,7 +3,6 @@ import 'package:prod/models/editor.dart';
import 'package:prod/models/project.dart';
import "package:shared_preferences/shared_preferences.dart";
import "package:prod/models/constants.dart";
// import "package:json_annotation/json_annotation.dart";
import "dart:convert";
class GlobalModel extends ChangeNotifier {

View File

@@ -1,5 +1,4 @@
import "package:flutter/material.dart";
import "package:prod/models/editor.dart";
import "package:prod/models/globalModel.dart";
import "package:prod/widgets/editorCard.dart";
import "package:prod/widgets/edtFAB.dart";

View File

@@ -21,16 +21,17 @@ class ManageProject extends StatelessWidget {
pathController.text = prj.path.path;
langController.text = prj.language;
return SimpleDialog(
backgroundColor: Color(0xfff6f6f6),
title: Row(
mainAxisAlignment: .spaceBetween,
children: [
OutlinedButton(
FilledButton(
child: Text("Cancel"),
onPressed: () => Navigator.pop(context),
),
Text("Edit Project"),
FilledButton(
child: Text("Save"),
ElevatedButton(
child: Text(" Save "),
onPressed: () {
prj.name = nameController.text;
prj.path = File(pathController.text);
@@ -38,7 +39,9 @@ class ManageProject extends StatelessWidget {
gm.updatePrj(id, prj);
ScaffoldMessenger.of(context).showSnackBar(
SnackBar(
content: Text("Updated Project Details"),
content: Text(
"Project Details Updated ✅",
), // The empty space as rendered by Zed is a green check mark. Dont remove it.
duration: Duration(milliseconds: 2000),
),
);
@@ -48,52 +51,109 @@ class ManageProject extends StatelessWidget {
),
],
),
children: [
Padding(
padding: const EdgeInsets.all(8.0),
child: Card(
shape: RoundedRectangleBorder(
side: BorderSide(width: 1, color: Colors.grey[350]!),
borderRadius: BorderRadius.circular(10),
),
color: Color(0xffffffff),
child: Column(
children: [
TextField(
style: TextStyle(fontSize: 50),
style: TextStyle(fontSize: 35),
controller: nameController,
textAlign: .center,
// onEditingComplete: () => gm.updateEdited(true),
textAlign: .left,
decoration: InputDecoration(
border: .none,
label: Text(
"Name",
style: TextStyle(color: Colors.grey[700]),
),
// border: .none,
enabledBorder: .none,
fillColor: Colors.transparent,
focusedBorder: OutlineInputBorder(
borderSide: BorderSide(color: Colors.transparent),
gapPadding: 0,
),
border: OutlineInputBorder(
borderSide: BorderSide(color: Colors.transparent),
gapPadding: 0,
),
),
),
Divider(thickness: 1),
TextField(
style: TextStyle(fontSize: 30),
style: TextStyle(fontSize: 20),
controller: pathController,
textAlign: .center,
// onEditingComplete: () => gm.updateEdited(true),
textAlign: .left,
decoration: InputDecoration(
labelText: "Path",
border: .none,
// enabledBorder: .none,
fillColor: Colors.transparent,
label: Text(
"Path",
style: TextStyle(color: Colors.grey[700]),
),
),
TextField(
style: TextStyle(fontSize: 30),
controller: langController,
textAlign: .center,
// onEditingComplete: () => gm.updateEdited(true),
decoration: InputDecoration(
labelText: "Language",
border: .none,
isCollapsed: false,
// border: .none,
enabledBorder: .none,
fillColor: Colors.transparent,
focusedBorder: OutlineInputBorder(
borderSide: BorderSide(color: Colors.transparent),
gapPadding: 0,
),
border: OutlineInputBorder(
borderSide: BorderSide(color: Colors.transparent),
gapPadding: 0,
),
),
),
Divider(thickness: 1),
TextField(
style: TextStyle(fontSize: 20),
controller: langController,
textAlign: .left,
decoration: InputDecoration(
label: Text(
"Language",
style: TextStyle(color: Colors.grey[700]),
),
// border: .none,
enabledBorder: .none,
fillColor: Colors.transparent,
focusedBorder: OutlineInputBorder(
borderSide: BorderSide(color: Colors.transparent),
gapPadding: 0,
),
border: OutlineInputBorder(
borderSide: BorderSide(color: Colors.transparent),
gapPadding: 0,
),
),
),
],
),
),
),
Padding(
padding: const EdgeInsets.all(8.0),
child: Card(
shape: RoundedRectangleBorder(
side: BorderSide(width: 1, color: Colors.grey[350]!),
borderRadius: BorderRadius.circular(10),
),
color: Color(0xffffffff),
child: Padding(
padding: const EdgeInsets.all(8.0),
child: Column(
mainAxisAlignment: .spaceEvenly,
crossAxisAlignment: .start,
children: [
Text("Select Editors:"),
Padding(
padding: const EdgeInsets.symmetric(horizontal: 8.0),
child: Text("Editors:", style: TextStyle(fontSize: 20)),
),
SizedBox(height: 10),
Row(
mainAxisAlignment: .spaceEvenly,
@@ -117,23 +177,20 @@ class ManageProject extends StatelessWidget {
),
),
),
// Row(
// children: [
// OutlinedButton(
// child: Text("Delete"),
// onPressed: () {
// Navigator.pop(context);
// gm.delPrj(id);
// ScaffoldMessenger.of(context).showSnackBar(
// SnackBar(
// content: Text("Deleted ${prj.name}"),
// duration: Duration(milliseconds: 2350),
// ),
// );
// },
// ),
// ],
// ),
Padding(
padding: const EdgeInsets.symmetric(horizontal: 13.0),
child: ElevatedButton(
style: ElevatedButton.styleFrom(
backgroundColor: Colors.red[100],
foregroundColor: Colors.red[900],
),
onPressed: () {
gm.delPrj(id);
Navigator.pop(context);
},
child: Row(mainAxisAlignment: .center, children: [Text("Delete")]),
),
),
],
);
}

View File

@@ -17,7 +17,30 @@ class EditorFAB extends StatelessWidget {
showDialog(
context: context,
builder: (context) => SimpleDialog(
title: Text("Add Editor"),
title: Row(
mainAxisAlignment: .spaceBetween,
children: [
FilledButton(
child: Text("Cancel"),
onPressed: () => Navigator.pop(context),
),
Text("Add Editor"),
ElevatedButton(
child: Text(" Add "),
onPressed: () {
Provider.of<GlobalModel>(context, listen: false).addEdt(
Editor.create(
nameController.text,
commandController.text,
commandTemplateController.text,
),
);
Navigator.pop(context);
},
),
],
),
children: [
Padding(
padding: const EdgeInsets.all(8.0),
@@ -45,30 +68,6 @@ class EditorFAB extends StatelessWidget {
child: const Text("Example: zed -n \$path"),
padding: const EdgeInsets.all(9.0),
),
Row(
mainAxisAlignment: .end,
children: [
TextButton(
child: Text("Cancel"),
onPressed: () => Navigator.pop(context),
),
TextButton(
child: Text("Add"),
onPressed: () {
Provider.of<GlobalModel>(context, listen: false).addEdt(
Editor.create(
nameController.text,
commandController.text,
commandTemplateController.text,
),
);
Navigator.pop(context);
},
),
],
),
],
),
);