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( return YaruTheme(
builder: (context, yaru, child) { builder: (context, yaru, child) {
return MaterialApp( return MaterialApp(
theme: yaru.theme, theme: yaruLight,
themeMode: .system, themeMode: .system,
darkTheme: yaru.darkTheme, darkTheme: yaru.darkTheme,
routes: { routes: {

View File

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

View File

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

View File

@@ -21,15 +21,16 @@ class ManageProject extends StatelessWidget {
pathController.text = prj.path.path; pathController.text = prj.path.path;
langController.text = prj.language; langController.text = prj.language;
return SimpleDialog( return SimpleDialog(
backgroundColor: Color(0xfff6f6f6),
title: Row( title: Row(
mainAxisAlignment: .spaceBetween, mainAxisAlignment: .spaceBetween,
children: [ children: [
OutlinedButton( FilledButton(
child: Text("Cancel"), child: Text("Cancel"),
onPressed: () => Navigator.pop(context), onPressed: () => Navigator.pop(context),
), ),
Text("Edit Project"), Text("Edit Project"),
FilledButton( ElevatedButton(
child: Text(" Save "), child: Text(" Save "),
onPressed: () { onPressed: () {
prj.name = nameController.text; prj.name = nameController.text;
@@ -38,7 +39,9 @@ class ManageProject extends StatelessWidget {
gm.updatePrj(id, prj); gm.updatePrj(id, prj);
ScaffoldMessenger.of(context).showSnackBar( ScaffoldMessenger.of(context).showSnackBar(
SnackBar( 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), 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: [ children: [
TextField( TextField(
style: TextStyle(fontSize: 50), style: TextStyle(fontSize: 35),
controller: nameController, controller: nameController,
textAlign: .center, textAlign: .left,
// onEditingComplete: () => gm.updateEdited(true),
decoration: InputDecoration( decoration: InputDecoration(
border: .none, label: Text(
"Name",
style: TextStyle(color: Colors.grey[700]),
),
// border: .none,
enabledBorder: .none, enabledBorder: .none,
fillColor: Colors.transparent, 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( TextField(
style: TextStyle(fontSize: 30), style: TextStyle(fontSize: 20),
controller: pathController, controller: pathController,
textAlign: .center, textAlign: .left,
// onEditingComplete: () => gm.updateEdited(true),
decoration: InputDecoration( decoration: InputDecoration(
labelText: "Path", label: Text(
border: .none, "Path",
// enabledBorder: .none, style: TextStyle(color: Colors.grey[700]),
fillColor: Colors.transparent,
), ),
), isCollapsed: false,
TextField( // border: .none,
style: TextStyle(fontSize: 30),
controller: langController,
textAlign: .center,
// onEditingComplete: () => gm.updateEdited(true),
decoration: InputDecoration(
labelText: "Language",
border: .none,
enabledBorder: .none, enabledBorder: .none,
fillColor: Colors.transparent, 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(
padding: const EdgeInsets.all(8.0), padding: const EdgeInsets.all(8.0),
child: Card( child: Card(
shape: RoundedRectangleBorder(
side: BorderSide(width: 1, color: Colors.grey[350]!),
borderRadius: BorderRadius.circular(10),
),
color: Color(0xffffffff),
child: Padding( child: Padding(
padding: const EdgeInsets.all(8.0), padding: const EdgeInsets.all(8.0),
child: Column( child: Column(
mainAxisAlignment: .spaceEvenly, mainAxisAlignment: .spaceEvenly,
crossAxisAlignment: .start, crossAxisAlignment: .start,
children: [ children: [
Text("Select Editors:"), Padding(
padding: const EdgeInsets.symmetric(horizontal: 8.0),
child: Text("Editors:", style: TextStyle(fontSize: 20)),
),
SizedBox(height: 10), SizedBox(height: 10),
Row( Row(
mainAxisAlignment: .spaceEvenly, mainAxisAlignment: .spaceEvenly,
@@ -117,23 +177,20 @@ class ManageProject extends StatelessWidget {
), ),
), ),
), ),
// Row( Padding(
// children: [ padding: const EdgeInsets.symmetric(horizontal: 13.0),
// OutlinedButton( child: ElevatedButton(
// child: Text("Delete"), style: ElevatedButton.styleFrom(
// onPressed: () { backgroundColor: Colors.red[100],
// Navigator.pop(context); foregroundColor: Colors.red[900],
// gm.delPrj(id); ),
// ScaffoldMessenger.of(context).showSnackBar( onPressed: () {
// SnackBar( gm.delPrj(id);
// content: Text("Deleted ${prj.name}"), Navigator.pop(context);
// duration: Duration(milliseconds: 2350), },
// ), child: Row(mainAxisAlignment: .center, children: [Text("Delete")]),
// ); ),
// }, ),
// ),
// ],
// ),
], ],
); );
} }

View File

@@ -17,7 +17,30 @@ class EditorFAB extends StatelessWidget {
showDialog( showDialog(
context: context, context: context,
builder: (context) => SimpleDialog( 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: [ children: [
Padding( Padding(
padding: const EdgeInsets.all(8.0), padding: const EdgeInsets.all(8.0),
@@ -45,30 +68,6 @@ class EditorFAB extends StatelessWidget {
child: const Text("Example: zed -n \$path"), child: const Text("Example: zed -n \$path"),
padding: const EdgeInsets.all(9.0), 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);
},
),
],
),
], ],
), ),
); );