beautified project editing window, added theme
All checks were successful
Build CI / AMD64 Build (push) Successful in 2m23s
All checks were successful
Build CI / AMD64 Build (push) Successful in 2m23s
This commit is contained in:
@@ -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: {
|
||||||
|
|||||||
@@ -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 {
|
||||||
|
|||||||
@@ -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";
|
||||||
|
|||||||
@@ -21,16 +21,17 @@ 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;
|
||||||
prj.path = File(pathController.text);
|
prj.path = File(pathController.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),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
@@ -49,51 +52,108 @@ class ManageProject extends StatelessWidget {
|
|||||||
],
|
],
|
||||||
),
|
),
|
||||||
children: [
|
children: [
|
||||||
TextField(
|
Padding(
|
||||||
style: TextStyle(fontSize: 50),
|
padding: const EdgeInsets.all(8.0),
|
||||||
controller: nameController,
|
child: Card(
|
||||||
textAlign: .center,
|
shape: RoundedRectangleBorder(
|
||||||
// onEditingComplete: () => gm.updateEdited(true),
|
side: BorderSide(width: 1, color: Colors.grey[350]!),
|
||||||
decoration: InputDecoration(
|
borderRadius: BorderRadius.circular(10),
|
||||||
border: .none,
|
),
|
||||||
enabledBorder: .none,
|
color: Color(0xffffffff),
|
||||||
fillColor: Colors.transparent,
|
child: Column(
|
||||||
),
|
children: [
|
||||||
),
|
TextField(
|
||||||
TextField(
|
style: TextStyle(fontSize: 35),
|
||||||
style: TextStyle(fontSize: 30),
|
controller: nameController,
|
||||||
controller: pathController,
|
textAlign: .left,
|
||||||
textAlign: .center,
|
decoration: InputDecoration(
|
||||||
// onEditingComplete: () => gm.updateEdited(true),
|
label: Text(
|
||||||
decoration: InputDecoration(
|
"Name",
|
||||||
labelText: "Path",
|
style: TextStyle(color: Colors.grey[700]),
|
||||||
border: .none,
|
),
|
||||||
// enabledBorder: .none,
|
// border: .none,
|
||||||
fillColor: Colors.transparent,
|
enabledBorder: .none,
|
||||||
),
|
fillColor: Colors.transparent,
|
||||||
),
|
focusedBorder: OutlineInputBorder(
|
||||||
TextField(
|
borderSide: BorderSide(color: Colors.transparent),
|
||||||
style: TextStyle(fontSize: 30),
|
gapPadding: 0,
|
||||||
controller: langController,
|
),
|
||||||
textAlign: .center,
|
border: OutlineInputBorder(
|
||||||
// onEditingComplete: () => gm.updateEdited(true),
|
borderSide: BorderSide(color: Colors.transparent),
|
||||||
decoration: InputDecoration(
|
gapPadding: 0,
|
||||||
labelText: "Language",
|
),
|
||||||
border: .none,
|
),
|
||||||
enabledBorder: .none,
|
),
|
||||||
fillColor: Colors.transparent,
|
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(
|
||||||
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")]),
|
||||||
// );
|
),
|
||||||
// },
|
),
|
||||||
// ),
|
|
||||||
// ],
|
|
||||||
// ),
|
|
||||||
],
|
],
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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);
|
|
||||||
},
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
|||||||
Reference in New Issue
Block a user