From 823690aed3779688b91d1b1935ece66ec01ab7ab Mon Sep 17 00:00:00 2001 From: Phani Pavan K Date: Thu, 19 Mar 2026 13:55:04 +0530 Subject: [PATCH] beautified project editing window, added theme --- lib/main.dart | 2 +- lib/models/globalModel.dart | 1 - lib/views/editors.dart | 1 - lib/views/managePrj.dart | 167 ++++++++++++++++++++++++------------ lib/widgets/edtFAB.dart | 49 ++++++----- 5 files changed, 137 insertions(+), 83 deletions(-) diff --git a/lib/main.dart b/lib/main.dart index ad11545..babbf56 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -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: { diff --git a/lib/models/globalModel.dart b/lib/models/globalModel.dart index 1e8c909..a94c5e0 100644 --- a/lib/models/globalModel.dart +++ b/lib/models/globalModel.dart @@ -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 { diff --git a/lib/views/editors.dart b/lib/views/editors.dart index 3a354ad..aa3b677 100644 --- a/lib/views/editors.dart +++ b/lib/views/editors.dart @@ -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"; diff --git a/lib/views/managePrj.dart b/lib/views/managePrj.dart index a7a9f77..fdb4aba 100644 --- a/lib/views/managePrj.dart +++ b/lib/views/managePrj.dart @@ -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), ), ); @@ -49,51 +52,108 @@ class ManageProject extends StatelessWidget { ], ), children: [ - TextField( - style: TextStyle(fontSize: 50), - controller: nameController, - textAlign: .center, - // onEditingComplete: () => gm.updateEdited(true), - decoration: InputDecoration( - border: .none, - enabledBorder: .none, - fillColor: Colors.transparent, - ), - ), - TextField( - style: TextStyle(fontSize: 30), - controller: pathController, - textAlign: .center, - // onEditingComplete: () => gm.updateEdited(true), - decoration: InputDecoration( - labelText: "Path", - border: .none, - // enabledBorder: .none, - fillColor: Colors.transparent, - ), - ), - TextField( - style: TextStyle(fontSize: 30), - controller: langController, - textAlign: .center, - // onEditingComplete: () => gm.updateEdited(true), - decoration: InputDecoration( - labelText: "Language", - border: .none, - enabledBorder: .none, - fillColor: Colors.transparent, + 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: 35), + controller: nameController, + textAlign: .left, + decoration: InputDecoration( + 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: 20), + controller: pathController, + textAlign: .left, + decoration: InputDecoration( + label: Text( + "Path", + style: TextStyle(color: Colors.grey[700]), + ), + 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")]), + ), + ), ], ); } diff --git a/lib/widgets/edtFAB.dart b/lib/widgets/edtFAB.dart index 56e24b7..a964f78 100644 --- a/lib/widgets/edtFAB.dart +++ b/lib/widgets/edtFAB.dart @@ -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(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(context, listen: false).addEdt( - Editor.create( - nameController.text, - commandController.text, - commandTemplateController.text, - ), - ); - - Navigator.pop(context); - }, - ), - ], - ), ], ), );