From 85bc4450f9e0c8768d42b508c052e8d994028cc0 Mon Sep 17 00:00:00 2001 From: Phani Pavan K Date: Fri, 13 Feb 2026 19:54:31 +0530 Subject: [PATCH] beautified editor list --- devtools_options.yaml | 3 ++ lib/models/editor.dart | 20 +++++++++++-- lib/views/editors.dart | 3 +- lib/widgets/editorCard.dart | 55 +++++++++++++++++++++++++++--------- lib/widgets/projectCard.dart | 9 ------ 5 files changed, 64 insertions(+), 26 deletions(-) create mode 100644 devtools_options.yaml diff --git a/devtools_options.yaml b/devtools_options.yaml new file mode 100644 index 0000000..fa0b357 --- /dev/null +++ b/devtools_options.yaml @@ -0,0 +1,3 @@ +description: This file stores settings for Dart & Flutter DevTools. +documentation: https://docs.flutter.dev/tools/devtools/extensions#configure-extension-enablement-states +extensions: diff --git a/lib/models/editor.dart b/lib/models/editor.dart index 8509995..9103e8f 100644 --- a/lib/models/editor.dart +++ b/lib/models/editor.dart @@ -4,15 +4,28 @@ import "package:prod/models/rand.dart"; class Editor { final String id; + final String sname; final String name; final String command; final String commandTemplate; // final Icon icon; - const Editor(this.name, this.command, this.commandTemplate, this.id); + const Editor( + this.sname, + this.name, + this.command, + this.commandTemplate, + this.id, + ); factory Editor.create(String name, String command, String commandTemplate) { - return Editor(name, command, commandTemplate, getRandomString(5)); + return Editor( + "${name.substring(0, 1).toUpperCase()}${name.substring(1, 2).toLowerCase()}", + name, + command, + commandTemplate, + getRandomString(5), + ); } bool validateCommand() { @@ -39,9 +52,10 @@ class Editor { !data.containsKey("commandTemplate") || !data.containsKey("id")) { print("Found invalid editor config when parsing: $data"); - return Editor("null", "null", "null", "null"); + return Editor("!!", "null", "null", "null", "null"); } return Editor( + data["sname"] as String, data["name"] as String, data["command"] as String, data["commandTemplate"] as String, diff --git a/lib/views/editors.dart b/lib/views/editors.dart index 6578451..3a354ad 100644 --- a/lib/views/editors.dart +++ b/lib/views/editors.dart @@ -17,12 +17,13 @@ class EditorEditor extends StatelessWidget { body: gm.lenEdt > 0 ? LayoutBuilder( builder: (context, constraints) { - int cols = (constraints.maxWidth / 200).floor(); + int cols = (constraints.maxWidth / 250).floor(); return GridView.builder( gridDelegate: SliverGridDelegateWithFixedCrossAxisCount( crossAxisCount: cols, crossAxisSpacing: 10, mainAxisSpacing: 10, + childAspectRatio: 1.5, ), itemCount: gm.lenEdt, itemBuilder: (context, index) => EditorCard(index), diff --git a/lib/widgets/editorCard.dart b/lib/widgets/editorCard.dart index d552d0b..7fc3f15 100644 --- a/lib/widgets/editorCard.dart +++ b/lib/widgets/editorCard.dart @@ -14,20 +14,49 @@ class EditorCard extends StatelessWidget { Widget build(BuildContext context) { GlobalModel gm = Provider.of(context); final Editor edt = gm.nthEdt(id); + final String icon = + "${edt.name.substring(0, 1).toUpperCase()}${edt.name.substring(1, 2).toLowerCase()}"; return YaruBanner( - onTap: () { - gm.delEdt(id); - }, - child: Center( - child: Column( - mainAxisAlignment: .start, - crossAxisAlignment: .start, - children: [ - Text("${edt.name}", style: TextStyle(fontSize: 30)), - Text("${edt.command}"), - Text("${edt.commandTemplate}"), - ], - ), + padding: .only( + left: kYaruPagePadding, + top: kYaruPagePadding * 0.5, + bottom: kYaruPagePadding, + right: kYaruPagePadding, + ), + + onTap: () => gm.delEdt(id), + + child: Row( + children: [ + Text("$icon", style: TextStyle(fontSize: 50)), + VerticalDivider(width: 20, thickness: 2), + Flexible( + child: Column( + mainAxisAlignment: .center, + crossAxisAlignment: .start, + children: [ + Flexible( + child: Text( + "${edt.name}", + style: TextStyle(fontSize: 25), + overflow: .ellipsis, + ), + ), + Text("${edt.commandTemplate}", overflow: .ellipsis), + // gm.getHoverShow(id) ? Text("${edt.path.path}") : Container(), + // gm.getHoverShow(id) + // ? IconButton( + // icon: Icon(Icons.close), + // onPressed: () => gm.deledt(id), + // style: IconButton.styleFrom( + // overlayColor: Color(0xffff0000), + // ), + // ) + // : Container(), + ], + ), + ), + ], ), ); } diff --git a/lib/widgets/projectCard.dart b/lib/widgets/projectCard.dart index 14260a9..7720014 100644 --- a/lib/widgets/projectCard.dart +++ b/lib/widgets/projectCard.dart @@ -38,15 +38,6 @@ class ProjectCard extends StatelessWidget { style: TextStyle(fontSize: 30), overflow: .ellipsis, ), - // Row( - // mainAxisAlignment: .spaceBetween, - // children: [ - // Flexible( - // child: Container( - // ), - // ), - // ], - // ), Row( spacing: 10, children: [