Compare commits
29 Commits
4f0503ca50
...
master
| Author | SHA1 | Date | |
|---|---|---|---|
| 823690aed3 | |||
| a8d397a53e | |||
| d2ef640bc8 | |||
| e118648a37 | |||
| ce25d26f70 | |||
| cee48b3e4b | |||
| 9c1e4e9100 | |||
| fd701fb2af | |||
| b84580ed1f | |||
| ba727713d0 | |||
| 05e09552be | |||
| 86e4cf78d1 | |||
| dd0ba72cc1 | |||
| ec336ef1c2 | |||
| 582e5134f8 | |||
| 64257e8ea3 | |||
| 5a28fd621c | |||
| 7eae2d34e7 | |||
| f5bd5beb82 | |||
| 112d608b7b | |||
| 7826a955a8 | |||
| 776aa5600c | |||
| e8117866ae | |||
| 282278b3ea | |||
| 74e9a73892 | |||
| bb3d78f3a0 | |||
| 4c898430c6 | |||
| e44a5b658a | |||
| 327d62070b |
@@ -2,39 +2,56 @@ name: Build CI
|
||||
# on: [push]
|
||||
on:
|
||||
push:
|
||||
tags:
|
||||
- "v*"
|
||||
branches:
|
||||
- master
|
||||
paths:
|
||||
- "lib/**"
|
||||
- ".gitea/**"
|
||||
|
||||
jobs:
|
||||
AMD64:
|
||||
name: AMD64 Build
|
||||
runs-on: linux-amd64
|
||||
|
||||
env:
|
||||
RUNNER_TOOL_CACHE: /toolcache
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
channel: master
|
||||
|
||||
- uses: actions/cache@v4
|
||||
- uses: actions/setup-go@v3
|
||||
with:
|
||||
path: /tmp/.buildx-cache
|
||||
key: ${{ runner.os }}-buildx-${{ gitea.sha }}
|
||||
go-version: '1.20'
|
||||
|
||||
- name: Generate Pub Hash
|
||||
uses: https://gitea.com/actions/go-hashfiles@v0.0.1
|
||||
id: pub-hash
|
||||
with:
|
||||
patterns: pubspec.lock
|
||||
|
||||
- name: Cache Pub Dependencies
|
||||
uses: actions/cache@v3
|
||||
with:
|
||||
path: |
|
||||
~/.pub-cache
|
||||
key: ${{ runner.os }}-pub-${{ steps.pub-hash.outputs.hash }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-buildx-
|
||||
${{ runner.os }}-pub-${{ steps.pub-hash.outputs.hash }}
|
||||
|
||||
- name: Install Framework Dependencies
|
||||
run: |
|
||||
sudo apt-get update -y
|
||||
sudo apt install -y ninja-build cmake clang libgtk-3-dev
|
||||
sudo apt install -y ninja-build cmake clang libgtk-3-dev
|
||||
|
||||
- name: Install Flutter
|
||||
uses: subosito/flutter-action@v2
|
||||
with:
|
||||
channel: master
|
||||
flutter-version: 3.38.9
|
||||
cache: true
|
||||
|
||||
- name: Check Flutter Installation
|
||||
run: flutter doctor -v
|
||||
@@ -48,66 +65,25 @@ jobs:
|
||||
# - name: Test project
|
||||
# run: flutter test
|
||||
|
||||
- name: Build
|
||||
- name: Build App
|
||||
run: flutter build linux
|
||||
|
||||
- name: Copy Build Files
|
||||
run: cp -r build/linux/*/release/bundle prod/
|
||||
|
||||
- name: Build AppImage
|
||||
uses: AppImageCrafters/build-appimage-action@master
|
||||
with:
|
||||
recipe: configs/AppImageBuilder_amd64.yml
|
||||
|
||||
- name: print built images
|
||||
run: ls -hla
|
||||
|
||||
- name: Save Artifacts
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: PROD.amd64
|
||||
path: prod/
|
||||
name: Prod-${{ github.ref_type == 'v*' && github.ref_name || 'master' }}-x86_64.AppImage
|
||||
path: Prod-latest-x86_64.AppImage
|
||||
|
||||
ARM64:
|
||||
name: ARM64 Build
|
||||
runs-on: linux-arm64
|
||||
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v4
|
||||
- name: Create New Release
|
||||
uses: akkuman/gitea-release-action@v1
|
||||
with:
|
||||
channel: master
|
||||
|
||||
- uses: actions/cache@v4
|
||||
with:
|
||||
path: /tmp/.buildx-cache
|
||||
key: ${{ runner.os }}-buildx-${{ gitea.sha }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-buildx-
|
||||
|
||||
- name: Install Framework Dependencies
|
||||
run: |
|
||||
sudo apt-get update -y
|
||||
sudo apt install -y ninja-build cmake clang libgtk-3-dev
|
||||
|
||||
- name: Install Flutter
|
||||
uses: subosito/flutter-action@v2
|
||||
with:
|
||||
channel: master
|
||||
flutter-version: 3.38.9
|
||||
|
||||
- name: Check Flutter Installation
|
||||
run: flutter doctor -v
|
||||
|
||||
- name: Get Project Dependencies
|
||||
run: flutter pub get
|
||||
|
||||
# - name: Analyze project
|
||||
# run: flutter analyze
|
||||
|
||||
# - name: Test project
|
||||
# run: flutter test
|
||||
|
||||
- name: Build
|
||||
run: flutter build linux
|
||||
|
||||
- name: Copy Build Files
|
||||
run: cp -r build/linux/*/release/bundle prod/
|
||||
|
||||
- name: Save Artifacts
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: PROD.arm64
|
||||
path: prod/
|
||||
files: Prod-latest-x86_64.AppImage
|
||||
prerelease: ${{ github.ref_type != 'v*' }}
|
||||
|
||||
@@ -26,5 +26,3 @@ linter:
|
||||
|
||||
# Additional information about this file can be found at
|
||||
# https://dart.dev/guides/language/analysis-options
|
||||
plugins:
|
||||
riverpod_lint: ^3.1.3
|
||||
|
||||
27
configs/AppImageBuilder_amd64.yml
Normal file
27
configs/AppImageBuilder_amd64.yml
Normal file
@@ -0,0 +1,27 @@
|
||||
# appimage-builder recipe see https://appimage-builder.readthedocs.io for details
|
||||
version: 1
|
||||
script:
|
||||
- which mksquashfs || apt install squashfs-tools
|
||||
- rm -rf AppDir | true
|
||||
- cp -r build/linux/x64/release/bundle AppDir
|
||||
- mkdir -p AppDir/usr/share/icons/hicolor/64x64/apps/
|
||||
- cp configs/prodIcon.png AppDir/usr/share/icons/hicolor/64x64/apps/
|
||||
AppDir:
|
||||
path: ./AppDir
|
||||
app_info:
|
||||
id: net.inaph.prod
|
||||
name: Prod
|
||||
icon: prodIcon
|
||||
version: latest
|
||||
exec: prod
|
||||
exec_args: $@
|
||||
files:
|
||||
exclude:
|
||||
- usr/share/man
|
||||
- usr/share/doc/*/README.*
|
||||
- usr/share/doc/*/changelog.*
|
||||
- usr/share/doc/*/NEWS.*
|
||||
- usr/share/doc/*/TODO.*
|
||||
AppImage:
|
||||
arch: x86_64
|
||||
update-information: guess
|
||||
BIN
configs/prodIcon.png
Normal file
BIN
configs/prodIcon.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 13 KiB |
@@ -1,6 +0,0 @@
|
||||
FROM ghcr.io/cirruslabs/flutter:3.38.9
|
||||
COPY ./ /build
|
||||
WORKDIR /build
|
||||
RUN apt update -y && apt install clang cmake ninja-build pkg-config libgtk-3-dev libstdc++-12-dev -y
|
||||
RUN flutter build linux --release
|
||||
RUN cp build/linux/*/release/bundle/prod /prod
|
||||
@@ -22,13 +22,12 @@ class MyApp extends StatelessWidget {
|
||||
return YaruTheme(
|
||||
builder: (context, yaru, child) {
|
||||
return MaterialApp(
|
||||
theme: yaru.theme,
|
||||
theme: yaruLight,
|
||||
themeMode: .system,
|
||||
darkTheme: yaru.darkTheme,
|
||||
routes: {
|
||||
"/": (context) => HomePage(),
|
||||
"/editors": (context) => EditorEditor(),
|
||||
"/manageprj": (context) => ManageProject(),
|
||||
},
|
||||
initialRoute: "/",
|
||||
);
|
||||
|
||||
@@ -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 {
|
||||
@@ -17,22 +16,20 @@ class GlobalModel extends ChangeNotifier {
|
||||
|
||||
GlobalModel() {
|
||||
SharedPreferences.getInstance().then((a) {
|
||||
print("Loaded sp");
|
||||
prefs = a;
|
||||
editors = [Editor("", "None", "NANII", "", "")];
|
||||
id2EdtMap = {"NANII": 0};
|
||||
editors = [];
|
||||
id2EdtMap = {};
|
||||
if (prefs.containsKey(kEditorsKey)) {
|
||||
String edtData = prefs.getString(kEditorsKey)!;
|
||||
List<dynamic> data = jsonDecode(edtData);
|
||||
for (var (i, d) in data.indexed) {
|
||||
var localEdt = Editor.fromJson(d);
|
||||
editors.add(localEdt);
|
||||
id2EdtMap[localEdt.id] = i + 1;
|
||||
id2EdtMap[localEdt.id] = i;
|
||||
}
|
||||
} else {
|
||||
prefs.setString(kEditorsKey, jsonEncode(editors));
|
||||
}
|
||||
print(id2EdtMap);
|
||||
final List<String> idList = id2EdtMap.keys.toList();
|
||||
|
||||
projects = [];
|
||||
@@ -45,6 +42,7 @@ class GlobalModel extends ChangeNotifier {
|
||||
} else {
|
||||
prefs.setString(kProjectsKey, jsonEncode(projects));
|
||||
}
|
||||
print("Project List:");
|
||||
print(projects);
|
||||
|
||||
hoverShow = List.filled(projects.length, false, growable: true);
|
||||
@@ -61,7 +59,6 @@ class GlobalModel extends ChangeNotifier {
|
||||
|
||||
void saveEditorState() {
|
||||
var tempEditors = editors;
|
||||
tempEditors.removeWhere((a) => a.id == "");
|
||||
List<Map<String, dynamic>> arst = tempEditors
|
||||
.map((a) => a.toJson())
|
||||
.toList();
|
||||
@@ -115,8 +112,7 @@ class GlobalModel extends ChangeNotifier {
|
||||
|
||||
void addEdt(Editor edt) {
|
||||
editors.add(edt);
|
||||
print(editors);
|
||||
id2EdtMap[edt.id] = editors.length - 1;
|
||||
rebuildIndex();
|
||||
saveEditorState();
|
||||
notifyListeners();
|
||||
}
|
||||
@@ -124,11 +120,19 @@ class GlobalModel extends ChangeNotifier {
|
||||
void delEdt(int index) {
|
||||
Editor removed = editors.removeAt(index);
|
||||
int remmedID = id2EdtMap.remove(removed.id)!;
|
||||
assert(index == remmedID);
|
||||
assert(index == remmedID, "Index: $index removedID: $remmedID");
|
||||
rebuildIndex();
|
||||
saveEditorState();
|
||||
notifyListeners();
|
||||
}
|
||||
|
||||
void rebuildIndex() {
|
||||
id2EdtMap.clear();
|
||||
for (var (i, e) in editors.indexed) {
|
||||
id2EdtMap[e.id] = i;
|
||||
}
|
||||
}
|
||||
|
||||
int get lenEdt {
|
||||
return editors.length;
|
||||
}
|
||||
@@ -138,7 +142,7 @@ class GlobalModel extends ChangeNotifier {
|
||||
}
|
||||
|
||||
int getEdtPosFromID(String id) {
|
||||
return id2EdtMap[id] ?? 0;
|
||||
return id2EdtMap[id] ?? -1;
|
||||
}
|
||||
|
||||
// Editing controller
|
||||
|
||||
@@ -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";
|
||||
@@ -14,7 +13,7 @@ class EditorEditor extends StatelessWidget {
|
||||
return Scaffold(
|
||||
appBar: AppBar(title: Text("/ PROject Dashboard / Editors")),
|
||||
floatingActionButton: EditorFAB(),
|
||||
body: gm.lenEdt - 1 > 0
|
||||
body: gm.lenEdt > 0
|
||||
? LayoutBuilder(
|
||||
builder: (context, constraints) {
|
||||
int cols = (constraints.maxWidth / 250).floor();
|
||||
@@ -25,7 +24,7 @@ class EditorEditor extends StatelessWidget {
|
||||
mainAxisSpacing: 10,
|
||||
childAspectRatio: 1.5,
|
||||
),
|
||||
itemCount: gm.lenEdt - 1,
|
||||
itemCount: gm.lenEdt,
|
||||
itemBuilder: (context, index) => EditorCard(index),
|
||||
);
|
||||
},
|
||||
|
||||
@@ -7,11 +7,11 @@ import "package:prod/widgets/editorSelector.dart";
|
||||
import "package:provider/provider.dart";
|
||||
|
||||
class ManageProject extends StatelessWidget {
|
||||
const ManageProject({super.key});
|
||||
const ManageProject(this.id, {super.key});
|
||||
final int id;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final id = ModalRoute.of(context)?.settings.arguments as int;
|
||||
GlobalModel gm = Provider.of(context);
|
||||
final Project prj = gm.nthPrj(id);
|
||||
TextEditingController nameController = TextEditingController();
|
||||
@@ -20,136 +20,178 @@ class ManageProject extends StatelessWidget {
|
||||
nameController.text = prj.name;
|
||||
pathController.text = prj.path.path;
|
||||
langController.text = prj.language;
|
||||
return Scaffold(
|
||||
appBar: AppBar(title: Text("/ PROject Dashboard / Editing ${prj.name} ")),
|
||||
body: Container(
|
||||
// constraints: BoxConstraints(maxWidth: 500),
|
||||
child: CustomScrollView(
|
||||
slivers: [
|
||||
SliverAppBar(
|
||||
// title: gm.isEdited ? Text("Unsaved Changes") : null,
|
||||
pinned: false,
|
||||
snap: false,
|
||||
floating: false,
|
||||
automaticallyImplyLeading: false,
|
||||
automaticallyImplyActions: false,
|
||||
backgroundColor: Colors.transparent,
|
||||
shape: LinearBorder(),
|
||||
),
|
||||
SliverToBoxAdapter(
|
||||
child: TextField(
|
||||
style: TextStyle(fontSize: 50),
|
||||
controller: nameController,
|
||||
textAlign: .center,
|
||||
// onEditingComplete: () => gm.updateEdited(true),
|
||||
decoration: InputDecoration(
|
||||
border: .none,
|
||||
enabledBorder: .none,
|
||||
fillColor: Colors.transparent,
|
||||
return SimpleDialog(
|
||||
backgroundColor: Color(0xfff6f6f6),
|
||||
title: Row(
|
||||
mainAxisAlignment: .spaceBetween,
|
||||
children: [
|
||||
FilledButton(
|
||||
child: Text("Cancel"),
|
||||
onPressed: () => Navigator.pop(context),
|
||||
),
|
||||
Text("Edit Project"),
|
||||
ElevatedButton(
|
||||
child: Text(" Save "),
|
||||
onPressed: () {
|
||||
prj.name = nameController.text;
|
||||
prj.path = File(pathController.text);
|
||||
prj.language = langController.text;
|
||||
gm.updatePrj(id, prj);
|
||||
ScaffoldMessenger.of(context).showSnackBar(
|
||||
SnackBar(
|
||||
content: Text(
|
||||
"Project Details Updated ✅",
|
||||
), // The empty space as rendered by Zed is a green check mark. Dont remove it.
|
||||
duration: Duration(milliseconds: 2000),
|
||||
),
|
||||
),
|
||||
);
|
||||
Navigator.pop(context);
|
||||
},
|
||||
// gm.updateEdited(false);
|
||||
),
|
||||
],
|
||||
),
|
||||
children: [
|
||||
Padding(
|
||||
padding: const EdgeInsets.all(8.0),
|
||||
child: Card(
|
||||
shape: RoundedRectangleBorder(
|
||||
side: BorderSide(width: 1, color: Colors.grey[350]!),
|
||||
borderRadius: BorderRadius.circular(10),
|
||||
),
|
||||
SliverToBoxAdapter(
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(8.0),
|
||||
child: TextField(
|
||||
style: TextStyle(fontSize: 30),
|
||||
controller: pathController,
|
||||
textAlign: .center,
|
||||
// onEditingComplete: () => gm.updateEdited(true),
|
||||
color: Color(0xffffffff),
|
||||
child: Column(
|
||||
children: [
|
||||
TextField(
|
||||
style: TextStyle(fontSize: 35),
|
||||
controller: nameController,
|
||||
textAlign: .left,
|
||||
decoration: InputDecoration(
|
||||
labelText: "Path",
|
||||
border: .none,
|
||||
// enabledBorder: .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,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
SliverToBoxAdapter(
|
||||
child: TextField(
|
||||
style: TextStyle(fontSize: 30),
|
||||
controller: langController,
|
||||
textAlign: .center,
|
||||
// onEditingComplete: () => gm.updateEdited(true),
|
||||
decoration: InputDecoration(
|
||||
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,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
SliverList.list(
|
||||
children: [
|
||||
Row(
|
||||
mainAxisAlignment: .spaceEvenly,
|
||||
children: [
|
||||
EditorSelector(0, id),
|
||||
EditorSelector(1, id),
|
||||
EditorSelector(2, id),
|
||||
EditorSelector(3, id),
|
||||
],
|
||||
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,
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
|
||||
SliverList.list(
|
||||
children: [
|
||||
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),
|
||||
),
|
||||
);
|
||||
},
|
||||
),
|
||||
|
||||
OutlinedButton(
|
||||
child: Text("Cancel"),
|
||||
onPressed: () => Navigator.pop(context),
|
||||
),
|
||||
OutlinedButton(
|
||||
child: Text("Save"),
|
||||
onPressed: () {
|
||||
gm.updatePrj(
|
||||
id,
|
||||
Project(
|
||||
nameController.text,
|
||||
langController.text,
|
||||
File(pathController.text),
|
||||
prj.isGit,
|
||||
),
|
||||
);
|
||||
ScaffoldMessenger.of(context).showSnackBar(
|
||||
SnackBar(
|
||||
content: Text("Updated Project Details"),
|
||||
duration: Duration(milliseconds: 2500),
|
||||
),
|
||||
);
|
||||
},
|
||||
// gm.updateEdited(false);
|
||||
),
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
// SliverList.builder(
|
||||
// itemCount: 3,
|
||||
// itemBuilder: (context, index) {
|
||||
// return Placeholder();
|
||||
// },
|
||||
// ),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
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: [
|
||||
Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 8.0),
|
||||
child: Text("Editors:", style: TextStyle(fontSize: 20)),
|
||||
),
|
||||
SizedBox(height: 10),
|
||||
Row(
|
||||
mainAxisAlignment: .spaceEvenly,
|
||||
children: [
|
||||
EditorSelector(3, id),
|
||||
SizedBox(width: 10),
|
||||
EditorSelector(0, id),
|
||||
],
|
||||
),
|
||||
SizedBox(height: 10),
|
||||
Row(
|
||||
mainAxisAlignment: .spaceEvenly,
|
||||
children: [
|
||||
EditorSelector(2, id),
|
||||
SizedBox(width: 10),
|
||||
EditorSelector(1, id),
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
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")]),
|
||||
),
|
||||
),
|
||||
],
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,13 +1,11 @@
|
||||
import "package:flutter/material.dart";
|
||||
import "package:prod/models/editor.dart";
|
||||
import "package:prod/models/globalModel.dart";
|
||||
import "package:prod/models/project.dart";
|
||||
import "package:provider/provider.dart";
|
||||
import "package:yaru/yaru.dart";
|
||||
import "package:process_run/shell.dart";
|
||||
|
||||
class EditorCard extends StatelessWidget {
|
||||
const EditorCard(id, {super.key}) : id = id + 1;
|
||||
const EditorCard(this.id, {super.key});
|
||||
final int id;
|
||||
|
||||
@override
|
||||
|
||||
@@ -3,7 +3,6 @@ import "package:prod/models/editor.dart";
|
||||
import "package:prod/models/globalModel.dart";
|
||||
import "package:prod/models/project.dart";
|
||||
import "package:provider/provider.dart";
|
||||
import "package:yaru/yaru.dart";
|
||||
|
||||
class EditorSelector extends StatelessWidget {
|
||||
const EditorSelector(this.turns, this.id, {super.key});
|
||||
@@ -23,25 +22,28 @@ class EditorSelector extends StatelessWidget {
|
||||
quarterTurns: turns,
|
||||
),
|
||||
onSelected: (a) {
|
||||
// print("$a");
|
||||
prj.setEditor(turns, a ?? "");
|
||||
gm.updatePrj(id, prj);
|
||||
},
|
||||
|
||||
dropdownMenuEntries: Provider.of<GlobalModel>(context).editors.map((a) {
|
||||
return DropdownMenuEntry(
|
||||
label: a.name,
|
||||
labelWidget: Column(
|
||||
crossAxisAlignment: .start,
|
||||
mainAxisAlignment: .center,
|
||||
children: [
|
||||
Text("${a.name}", style: TextStyle(fontSize: 20)),
|
||||
Text("${a.commandTemplate}", style: TextStyle(fontSize: 12)),
|
||||
],
|
||||
),
|
||||
value: a.id,
|
||||
);
|
||||
}).toList(),
|
||||
dropdownMenuEntries:
|
||||
[
|
||||
const Editor("", "None", "", "", ""),
|
||||
...Provider.of<GlobalModel>(context).editors,
|
||||
].map((a) {
|
||||
return DropdownMenuEntry(
|
||||
label: a.name,
|
||||
labelWidget: Column(
|
||||
crossAxisAlignment: .start,
|
||||
mainAxisAlignment: .center,
|
||||
children: [
|
||||
Text("${a.name}", style: TextStyle(fontSize: 20)),
|
||||
Text("${a.commandTemplate}", style: TextStyle(fontSize: 12)),
|
||||
],
|
||||
),
|
||||
value: a.id,
|
||||
);
|
||||
}).toList(),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -10,15 +10,6 @@ class EditorFAB extends StatelessWidget {
|
||||
Widget build(BuildContext context) {
|
||||
return FloatingActionButton(
|
||||
onPressed: () {
|
||||
// gm.add(
|
||||
// Project.validated(
|
||||
// "Kimi",
|
||||
// "Rust",
|
||||
// "/home/arrow/Gitted/cowin",
|
||||
// [],
|
||||
// true,
|
||||
// ),
|
||||
// );
|
||||
TextEditingController nameController = TextEditingController();
|
||||
TextEditingController commandController = TextEditingController();
|
||||
TextEditingController commandTemplateController =
|
||||
@@ -26,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),
|
||||
@@ -54,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);
|
||||
},
|
||||
),
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
|
||||
@@ -13,7 +13,11 @@ class LauncherButton extends StatelessWidget {
|
||||
Widget build(BuildContext context) {
|
||||
// print("EDITOR ID: $eid");
|
||||
GlobalModel gm = Provider.of<GlobalModel>(context, listen: false);
|
||||
final Editor edt = gm.nthEdt(gm.getEdtPosFromID(eid));
|
||||
final int enumb = gm.getEdtPosFromID(eid);
|
||||
if (enumb == -1) {
|
||||
return Container();
|
||||
}
|
||||
final Editor edt = gm.nthEdt(enumb);
|
||||
// print("GRABBED EDITOR: ${edt.name}");
|
||||
return eid == ""
|
||||
? Container()
|
||||
|
||||
@@ -2,6 +2,7 @@ import "package:flutter/material.dart";
|
||||
import "package:prod/models/editor.dart";
|
||||
import "package:prod/models/globalModel.dart";
|
||||
import "package:prod/models/project.dart";
|
||||
import "package:prod/views/managePrj.dart";
|
||||
import "package:prod/widgets/launcherButton.dart";
|
||||
import "package:provider/provider.dart";
|
||||
import "package:yaru/yaru.dart";
|
||||
@@ -18,8 +19,9 @@ class ProjectCard extends StatelessWidget {
|
||||
return InkWell(
|
||||
onHover: (st) => gm.setHoverShow(id, st),
|
||||
borderRadius: .circular(kYaruContainerRadius),
|
||||
onTap: () async {
|
||||
await Navigator.pushNamed(context, "/manageprj", arguments: id);
|
||||
onTap: () {
|
||||
// await Navigator.pushNamed(context, "/manageprj", arguments: id);
|
||||
showDialog(context: context, builder: (context) => ManageProject(id));
|
||||
},
|
||||
child: Card(
|
||||
// decoration: BoxDecoration(
|
||||
@@ -77,14 +79,14 @@ class ProjectCard extends StatelessWidget {
|
||||
children: [
|
||||
Column(
|
||||
children: [
|
||||
LauncherButton(prj.e0, prj.path.path),
|
||||
LauncherButton(prj.e1, prj.path.path),
|
||||
LauncherButton(prj.e3, prj.path.path),
|
||||
LauncherButton(prj.e2, prj.path.path),
|
||||
],
|
||||
),
|
||||
Column(
|
||||
children: [
|
||||
LauncherButton(prj.e2, prj.path.path),
|
||||
LauncherButton(prj.e3, prj.path.path),
|
||||
LauncherButton(prj.e0, prj.path.path),
|
||||
LauncherButton(prj.e1, prj.path.path),
|
||||
],
|
||||
),
|
||||
],
|
||||
|
||||
76
pubspec.yaml
76
pubspec.yaml
@@ -1,39 +1,15 @@
|
||||
name: prod
|
||||
description: "A new Flutter project."
|
||||
# The following line prevents the package from being accidentally published to
|
||||
# pub.dev using `flutter pub publish`. This is preferred for private packages.
|
||||
publish_to: "none" # Remove this line if you wish to publish to pub.dev
|
||||
description: "Simple Dashboard to bookmark projects with custom editors."
|
||||
publish_to: "none"
|
||||
|
||||
# The following defines the version and build number for your application.
|
||||
# A version number is three numbers separated by dots, like 1.2.43
|
||||
# followed by an optional build number separated by a +.
|
||||
# Both the version and the builder number may be overridden in flutter
|
||||
# build by specifying --build-name and --build-number, respectively.
|
||||
# In Android, build-name is used as versionName while build-number used as versionCode.
|
||||
# Read more about Android versioning at https://developer.android.com/studio/publish/versioning
|
||||
# In iOS, build-name is used as CFBundleShortVersionString while build-number is used as CFBundleVersion.
|
||||
# Read more about iOS versioning at
|
||||
# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
|
||||
# In Windows, build-name is used as the major, minor, and patch parts
|
||||
# of the product and file versions while build-number is used as the build suffix.
|
||||
version: 1.0.0+1
|
||||
version: 0.0.1
|
||||
|
||||
environment:
|
||||
sdk: ^3.10.8
|
||||
|
||||
# Dependencies specify other packages that your package needs in order to work.
|
||||
# To automatically upgrade your package dependencies to the latest versions
|
||||
# consider running `flutter pub upgrade --major-versions`. Alternatively,
|
||||
# dependencies can be manually updated by changing the version numbers below to
|
||||
# the latest version available on pub.dev. To see which dependencies have newer
|
||||
# versions available, run `flutter pub outdated`.
|
||||
dependencies:
|
||||
flutter:
|
||||
sdk: flutter
|
||||
|
||||
# The following adds the Cupertino Icons font to your application.
|
||||
# Use with the CupertinoIcons class for iOS style icons.
|
||||
cupertino_icons: ^1.0.8
|
||||
process_run: ^1.3.0
|
||||
yaru: ^9.0.1
|
||||
path: ^1.9.1
|
||||
@@ -45,49 +21,5 @@ dev_dependencies:
|
||||
flutter_test:
|
||||
sdk: flutter
|
||||
|
||||
# The "flutter_lints" package below contains a set of recommended lints to
|
||||
# encourage good coding practices. The lint set provided by the package is
|
||||
# activated in the `analysis_options.yaml` file located at the root of your
|
||||
# package. See that file for information about deactivating specific lint
|
||||
# rules and activating additional ones.
|
||||
|
||||
# For information on the generic Dart part of this file, see the
|
||||
# following page: https://dart.dev/tools/pub/pubspec
|
||||
|
||||
# The following section is specific to Flutter packages.
|
||||
flutter:
|
||||
# The following line ensures that the Material Icons font is
|
||||
# included with your application, so that you can use the icons in
|
||||
# the material Icons class.
|
||||
uses-material-design: true
|
||||
|
||||
# To add assets to your application, add an assets section, like this:
|
||||
# assets:
|
||||
# - images/a_dot_burr.jpeg
|
||||
# - images/a_dot_ham.jpeg
|
||||
|
||||
# An image asset can refer to one or more resolution-specific "variants", see
|
||||
# https://flutter.dev/to/resolution-aware-images
|
||||
|
||||
# For details regarding adding assets from package dependencies, see
|
||||
# https://flutter.dev/to/asset-from-package
|
||||
|
||||
# To add custom fonts to your application, add a fonts section here,
|
||||
# in this "flutter" section. Each entry in this list should have a
|
||||
# "family" key with the font family name, and a "fonts" key with a
|
||||
# list giving the asset and other descriptors for the font. For
|
||||
# example:
|
||||
# fonts:
|
||||
# - family: Schyler
|
||||
# fonts:
|
||||
# - asset: fonts/Schyler-Regular.ttf
|
||||
# - asset: fonts/Schyler-Italic.ttf
|
||||
# style: italic
|
||||
# - family: Trajan Pro
|
||||
# fonts:
|
||||
# - asset: fonts/TrajanPro.ttf
|
||||
# - asset: fonts/TrajanPro_Bold.ttf
|
||||
# weight: 700
|
||||
#
|
||||
# For details regarding fonts from package dependencies,
|
||||
# see https://flutter.dev/to/font-from-package
|
||||
uses-material-design: true
|
||||
Reference in New Issue
Block a user