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]
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
|
tags:
|
||||||
|
- "v*"
|
||||||
branches:
|
branches:
|
||||||
- master
|
- master
|
||||||
paths:
|
paths:
|
||||||
- "lib/**"
|
- "lib/**"
|
||||||
|
- ".gitea/**"
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
AMD64:
|
AMD64:
|
||||||
name: AMD64 Build
|
name: AMD64 Build
|
||||||
runs-on: linux-amd64
|
runs-on: linux-amd64
|
||||||
|
env:
|
||||||
|
RUNNER_TOOL_CACHE: /toolcache
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout code
|
- name: Checkout code
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
channel: master
|
channel: master
|
||||||
|
|
||||||
- uses: actions/cache@v4
|
- uses: actions/setup-go@v3
|
||||||
with:
|
with:
|
||||||
path: /tmp/.buildx-cache
|
go-version: '1.20'
|
||||||
key: ${{ runner.os }}-buildx-${{ gitea.sha }}
|
|
||||||
|
- 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: |
|
restore-keys: |
|
||||||
${{ runner.os }}-buildx-
|
${{ runner.os }}-pub-${{ steps.pub-hash.outputs.hash }}
|
||||||
|
|
||||||
- name: Install Framework Dependencies
|
- name: Install Framework Dependencies
|
||||||
run: |
|
run: |
|
||||||
sudo apt-get update -y
|
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
|
- name: Install Flutter
|
||||||
uses: subosito/flutter-action@v2
|
uses: subosito/flutter-action@v2
|
||||||
with:
|
with:
|
||||||
channel: master
|
channel: master
|
||||||
flutter-version: 3.38.9
|
flutter-version: 3.38.9
|
||||||
|
cache: true
|
||||||
|
|
||||||
- name: Check Flutter Installation
|
- name: Check Flutter Installation
|
||||||
run: flutter doctor -v
|
run: flutter doctor -v
|
||||||
@@ -48,66 +65,25 @@ jobs:
|
|||||||
# - name: Test project
|
# - name: Test project
|
||||||
# run: flutter test
|
# run: flutter test
|
||||||
|
|
||||||
- name: Build
|
- name: Build App
|
||||||
run: flutter build linux
|
run: flutter build linux
|
||||||
|
|
||||||
- name: Copy Build Files
|
- name: Build AppImage
|
||||||
run: cp -r build/linux/*/release/bundle prod/
|
uses: AppImageCrafters/build-appimage-action@master
|
||||||
|
with:
|
||||||
|
recipe: configs/AppImageBuilder_amd64.yml
|
||||||
|
|
||||||
|
- name: print built images
|
||||||
|
run: ls -hla
|
||||||
|
|
||||||
- name: Save Artifacts
|
- name: Save Artifacts
|
||||||
uses: actions/upload-artifact@v3
|
uses: actions/upload-artifact@v3
|
||||||
with:
|
with:
|
||||||
name: PROD.amd64
|
name: Prod-${{ github.ref_type == 'v*' && github.ref_name || 'master' }}-x86_64.AppImage
|
||||||
path: prod/
|
path: Prod-latest-x86_64.AppImage
|
||||||
|
|
||||||
ARM64:
|
- name: Create New Release
|
||||||
name: ARM64 Build
|
uses: akkuman/gitea-release-action@v1
|
||||||
runs-on: linux-arm64
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- name: Checkout code
|
|
||||||
uses: actions/checkout@v4
|
|
||||||
with:
|
with:
|
||||||
channel: master
|
files: Prod-latest-x86_64.AppImage
|
||||||
|
prerelease: ${{ github.ref_type != 'v*' }}
|
||||||
- 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/
|
|
||||||
|
|||||||
@@ -26,5 +26,3 @@ linter:
|
|||||||
|
|
||||||
# Additional information about this file can be found at
|
# Additional information about this file can be found at
|
||||||
# https://dart.dev/guides/language/analysis-options
|
# 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(
|
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: {
|
||||||
"/": (context) => HomePage(),
|
"/": (context) => HomePage(),
|
||||||
"/editors": (context) => EditorEditor(),
|
"/editors": (context) => EditorEditor(),
|
||||||
"/manageprj": (context) => ManageProject(),
|
|
||||||
},
|
},
|
||||||
initialRoute: "/",
|
initialRoute: "/",
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -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 {
|
||||||
@@ -17,22 +16,20 @@ class GlobalModel extends ChangeNotifier {
|
|||||||
|
|
||||||
GlobalModel() {
|
GlobalModel() {
|
||||||
SharedPreferences.getInstance().then((a) {
|
SharedPreferences.getInstance().then((a) {
|
||||||
print("Loaded sp");
|
|
||||||
prefs = a;
|
prefs = a;
|
||||||
editors = [Editor("", "None", "NANII", "", "")];
|
editors = [];
|
||||||
id2EdtMap = {"NANII": 0};
|
id2EdtMap = {};
|
||||||
if (prefs.containsKey(kEditorsKey)) {
|
if (prefs.containsKey(kEditorsKey)) {
|
||||||
String edtData = prefs.getString(kEditorsKey)!;
|
String edtData = prefs.getString(kEditorsKey)!;
|
||||||
List<dynamic> data = jsonDecode(edtData);
|
List<dynamic> data = jsonDecode(edtData);
|
||||||
for (var (i, d) in data.indexed) {
|
for (var (i, d) in data.indexed) {
|
||||||
var localEdt = Editor.fromJson(d);
|
var localEdt = Editor.fromJson(d);
|
||||||
editors.add(localEdt);
|
editors.add(localEdt);
|
||||||
id2EdtMap[localEdt.id] = i + 1;
|
id2EdtMap[localEdt.id] = i;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
prefs.setString(kEditorsKey, jsonEncode(editors));
|
prefs.setString(kEditorsKey, jsonEncode(editors));
|
||||||
}
|
}
|
||||||
print(id2EdtMap);
|
|
||||||
final List<String> idList = id2EdtMap.keys.toList();
|
final List<String> idList = id2EdtMap.keys.toList();
|
||||||
|
|
||||||
projects = [];
|
projects = [];
|
||||||
@@ -45,6 +42,7 @@ class GlobalModel extends ChangeNotifier {
|
|||||||
} else {
|
} else {
|
||||||
prefs.setString(kProjectsKey, jsonEncode(projects));
|
prefs.setString(kProjectsKey, jsonEncode(projects));
|
||||||
}
|
}
|
||||||
|
print("Project List:");
|
||||||
print(projects);
|
print(projects);
|
||||||
|
|
||||||
hoverShow = List.filled(projects.length, false, growable: true);
|
hoverShow = List.filled(projects.length, false, growable: true);
|
||||||
@@ -61,7 +59,6 @@ class GlobalModel extends ChangeNotifier {
|
|||||||
|
|
||||||
void saveEditorState() {
|
void saveEditorState() {
|
||||||
var tempEditors = editors;
|
var tempEditors = editors;
|
||||||
tempEditors.removeWhere((a) => a.id == "");
|
|
||||||
List<Map<String, dynamic>> arst = tempEditors
|
List<Map<String, dynamic>> arst = tempEditors
|
||||||
.map((a) => a.toJson())
|
.map((a) => a.toJson())
|
||||||
.toList();
|
.toList();
|
||||||
@@ -115,8 +112,7 @@ class GlobalModel extends ChangeNotifier {
|
|||||||
|
|
||||||
void addEdt(Editor edt) {
|
void addEdt(Editor edt) {
|
||||||
editors.add(edt);
|
editors.add(edt);
|
||||||
print(editors);
|
rebuildIndex();
|
||||||
id2EdtMap[edt.id] = editors.length - 1;
|
|
||||||
saveEditorState();
|
saveEditorState();
|
||||||
notifyListeners();
|
notifyListeners();
|
||||||
}
|
}
|
||||||
@@ -124,11 +120,19 @@ class GlobalModel extends ChangeNotifier {
|
|||||||
void delEdt(int index) {
|
void delEdt(int index) {
|
||||||
Editor removed = editors.removeAt(index);
|
Editor removed = editors.removeAt(index);
|
||||||
int remmedID = id2EdtMap.remove(removed.id)!;
|
int remmedID = id2EdtMap.remove(removed.id)!;
|
||||||
assert(index == remmedID);
|
assert(index == remmedID, "Index: $index removedID: $remmedID");
|
||||||
|
rebuildIndex();
|
||||||
saveEditorState();
|
saveEditorState();
|
||||||
notifyListeners();
|
notifyListeners();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void rebuildIndex() {
|
||||||
|
id2EdtMap.clear();
|
||||||
|
for (var (i, e) in editors.indexed) {
|
||||||
|
id2EdtMap[e.id] = i;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
int get lenEdt {
|
int get lenEdt {
|
||||||
return editors.length;
|
return editors.length;
|
||||||
}
|
}
|
||||||
@@ -138,7 +142,7 @@ class GlobalModel extends ChangeNotifier {
|
|||||||
}
|
}
|
||||||
|
|
||||||
int getEdtPosFromID(String id) {
|
int getEdtPosFromID(String id) {
|
||||||
return id2EdtMap[id] ?? 0;
|
return id2EdtMap[id] ?? -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Editing controller
|
// Editing controller
|
||||||
|
|||||||
@@ -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";
|
||||||
@@ -14,7 +13,7 @@ class EditorEditor extends StatelessWidget {
|
|||||||
return Scaffold(
|
return Scaffold(
|
||||||
appBar: AppBar(title: Text("/ PROject Dashboard / Editors")),
|
appBar: AppBar(title: Text("/ PROject Dashboard / Editors")),
|
||||||
floatingActionButton: EditorFAB(),
|
floatingActionButton: EditorFAB(),
|
||||||
body: gm.lenEdt - 1 > 0
|
body: gm.lenEdt > 0
|
||||||
? LayoutBuilder(
|
? LayoutBuilder(
|
||||||
builder: (context, constraints) {
|
builder: (context, constraints) {
|
||||||
int cols = (constraints.maxWidth / 250).floor();
|
int cols = (constraints.maxWidth / 250).floor();
|
||||||
@@ -25,7 +24,7 @@ class EditorEditor extends StatelessWidget {
|
|||||||
mainAxisSpacing: 10,
|
mainAxisSpacing: 10,
|
||||||
childAspectRatio: 1.5,
|
childAspectRatio: 1.5,
|
||||||
),
|
),
|
||||||
itemCount: gm.lenEdt - 1,
|
itemCount: gm.lenEdt,
|
||||||
itemBuilder: (context, index) => EditorCard(index),
|
itemBuilder: (context, index) => EditorCard(index),
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -7,11 +7,11 @@ import "package:prod/widgets/editorSelector.dart";
|
|||||||
import "package:provider/provider.dart";
|
import "package:provider/provider.dart";
|
||||||
|
|
||||||
class ManageProject extends StatelessWidget {
|
class ManageProject extends StatelessWidget {
|
||||||
const ManageProject({super.key});
|
const ManageProject(this.id, {super.key});
|
||||||
|
final int id;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
final id = ModalRoute.of(context)?.settings.arguments as int;
|
|
||||||
GlobalModel gm = Provider.of(context);
|
GlobalModel gm = Provider.of(context);
|
||||||
final Project prj = gm.nthPrj(id);
|
final Project prj = gm.nthPrj(id);
|
||||||
TextEditingController nameController = TextEditingController();
|
TextEditingController nameController = TextEditingController();
|
||||||
@@ -20,136 +20,178 @@ class ManageProject extends StatelessWidget {
|
|||||||
nameController.text = prj.name;
|
nameController.text = prj.name;
|
||||||
pathController.text = prj.path.path;
|
pathController.text = prj.path.path;
|
||||||
langController.text = prj.language;
|
langController.text = prj.language;
|
||||||
return Scaffold(
|
return SimpleDialog(
|
||||||
appBar: AppBar(title: Text("/ PROject Dashboard / Editing ${prj.name} ")),
|
backgroundColor: Color(0xfff6f6f6),
|
||||||
body: Container(
|
title: Row(
|
||||||
// constraints: BoxConstraints(maxWidth: 500),
|
mainAxisAlignment: .spaceBetween,
|
||||||
child: CustomScrollView(
|
children: [
|
||||||
slivers: [
|
FilledButton(
|
||||||
SliverAppBar(
|
child: Text("Cancel"),
|
||||||
// title: gm.isEdited ? Text("Unsaved Changes") : null,
|
onPressed: () => Navigator.pop(context),
|
||||||
pinned: false,
|
),
|
||||||
snap: false,
|
Text("Edit Project"),
|
||||||
floating: false,
|
ElevatedButton(
|
||||||
automaticallyImplyLeading: false,
|
child: Text(" Save "),
|
||||||
automaticallyImplyActions: false,
|
onPressed: () {
|
||||||
backgroundColor: Colors.transparent,
|
prj.name = nameController.text;
|
||||||
shape: LinearBorder(),
|
prj.path = File(pathController.text);
|
||||||
),
|
prj.language = langController.text;
|
||||||
SliverToBoxAdapter(
|
gm.updatePrj(id, prj);
|
||||||
child: TextField(
|
ScaffoldMessenger.of(context).showSnackBar(
|
||||||
style: TextStyle(fontSize: 50),
|
SnackBar(
|
||||||
controller: nameController,
|
content: Text(
|
||||||
textAlign: .center,
|
"Project Details Updated ✅",
|
||||||
// onEditingComplete: () => gm.updateEdited(true),
|
), // The empty space as rendered by Zed is a green check mark. Dont remove it.
|
||||||
decoration: InputDecoration(
|
duration: Duration(milliseconds: 2000),
|
||||||
border: .none,
|
|
||||||
enabledBorder: .none,
|
|
||||||
fillColor: Colors.transparent,
|
|
||||||
),
|
),
|
||||||
),
|
);
|
||||||
|
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(
|
color: Color(0xffffffff),
|
||||||
child: Padding(
|
child: Column(
|
||||||
padding: const EdgeInsets.all(8.0),
|
children: [
|
||||||
child: TextField(
|
TextField(
|
||||||
style: TextStyle(fontSize: 30),
|
style: TextStyle(fontSize: 35),
|
||||||
controller: pathController,
|
controller: nameController,
|
||||||
textAlign: .center,
|
textAlign: .left,
|
||||||
// onEditingComplete: () => gm.updateEdited(true),
|
|
||||||
decoration: InputDecoration(
|
decoration: InputDecoration(
|
||||||
labelText: "Path",
|
label: Text(
|
||||||
border: .none,
|
"Name",
|
||||||
// enabledBorder: .none,
|
style: TextStyle(color: Colors.grey[700]),
|
||||||
|
),
|
||||||
|
// border: .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(
|
||||||
SliverToBoxAdapter(
|
style: TextStyle(fontSize: 20),
|
||||||
child: TextField(
|
controller: pathController,
|
||||||
style: TextStyle(fontSize: 30),
|
textAlign: .left,
|
||||||
controller: langController,
|
decoration: InputDecoration(
|
||||||
textAlign: .center,
|
label: Text(
|
||||||
// onEditingComplete: () => gm.updateEdited(true),
|
"Path",
|
||||||
decoration: InputDecoration(
|
style: TextStyle(color: Colors.grey[700]),
|
||||||
labelText: "Language",
|
),
|
||||||
border: .none,
|
isCollapsed: false,
|
||||||
enabledBorder: .none,
|
// border: .none,
|
||||||
fillColor: Colors.transparent,
|
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(
|
||||||
SliverList.list(
|
style: TextStyle(fontSize: 20),
|
||||||
children: [
|
controller: langController,
|
||||||
Row(
|
textAlign: .left,
|
||||||
mainAxisAlignment: .spaceEvenly,
|
decoration: InputDecoration(
|
||||||
children: [
|
label: Text(
|
||||||
EditorSelector(0, id),
|
"Language",
|
||||||
EditorSelector(1, id),
|
style: TextStyle(color: Colors.grey[700]),
|
||||||
EditorSelector(2, id),
|
),
|
||||||
EditorSelector(3, id),
|
// 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:flutter/material.dart";
|
||||||
import "package:prod/models/editor.dart";
|
import "package:prod/models/editor.dart";
|
||||||
import "package:prod/models/globalModel.dart";
|
import "package:prod/models/globalModel.dart";
|
||||||
import "package:prod/models/project.dart";
|
|
||||||
import "package:provider/provider.dart";
|
import "package:provider/provider.dart";
|
||||||
import "package:yaru/yaru.dart";
|
import "package:yaru/yaru.dart";
|
||||||
import "package:process_run/shell.dart";
|
|
||||||
|
|
||||||
class EditorCard extends StatelessWidget {
|
class EditorCard extends StatelessWidget {
|
||||||
const EditorCard(id, {super.key}) : id = id + 1;
|
const EditorCard(this.id, {super.key});
|
||||||
final int id;
|
final int id;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
|
|||||||
@@ -3,7 +3,6 @@ import "package:prod/models/editor.dart";
|
|||||||
import "package:prod/models/globalModel.dart";
|
import "package:prod/models/globalModel.dart";
|
||||||
import "package:prod/models/project.dart";
|
import "package:prod/models/project.dart";
|
||||||
import "package:provider/provider.dart";
|
import "package:provider/provider.dart";
|
||||||
import "package:yaru/yaru.dart";
|
|
||||||
|
|
||||||
class EditorSelector extends StatelessWidget {
|
class EditorSelector extends StatelessWidget {
|
||||||
const EditorSelector(this.turns, this.id, {super.key});
|
const EditorSelector(this.turns, this.id, {super.key});
|
||||||
@@ -23,25 +22,28 @@ class EditorSelector extends StatelessWidget {
|
|||||||
quarterTurns: turns,
|
quarterTurns: turns,
|
||||||
),
|
),
|
||||||
onSelected: (a) {
|
onSelected: (a) {
|
||||||
// print("$a");
|
|
||||||
prj.setEditor(turns, a ?? "");
|
prj.setEditor(turns, a ?? "");
|
||||||
gm.updatePrj(id, prj);
|
gm.updatePrj(id, prj);
|
||||||
},
|
},
|
||||||
|
|
||||||
dropdownMenuEntries: Provider.of<GlobalModel>(context).editors.map((a) {
|
dropdownMenuEntries:
|
||||||
return DropdownMenuEntry(
|
[
|
||||||
label: a.name,
|
const Editor("", "None", "", "", ""),
|
||||||
labelWidget: Column(
|
...Provider.of<GlobalModel>(context).editors,
|
||||||
crossAxisAlignment: .start,
|
].map((a) {
|
||||||
mainAxisAlignment: .center,
|
return DropdownMenuEntry(
|
||||||
children: [
|
label: a.name,
|
||||||
Text("${a.name}", style: TextStyle(fontSize: 20)),
|
labelWidget: Column(
|
||||||
Text("${a.commandTemplate}", style: TextStyle(fontSize: 12)),
|
crossAxisAlignment: .start,
|
||||||
],
|
mainAxisAlignment: .center,
|
||||||
),
|
children: [
|
||||||
value: a.id,
|
Text("${a.name}", style: TextStyle(fontSize: 20)),
|
||||||
);
|
Text("${a.commandTemplate}", style: TextStyle(fontSize: 12)),
|
||||||
}).toList(),
|
],
|
||||||
|
),
|
||||||
|
value: a.id,
|
||||||
|
);
|
||||||
|
}).toList(),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -10,15 +10,6 @@ class EditorFAB extends StatelessWidget {
|
|||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return FloatingActionButton(
|
return FloatingActionButton(
|
||||||
onPressed: () {
|
onPressed: () {
|
||||||
// gm.add(
|
|
||||||
// Project.validated(
|
|
||||||
// "Kimi",
|
|
||||||
// "Rust",
|
|
||||||
// "/home/arrow/Gitted/cowin",
|
|
||||||
// [],
|
|
||||||
// true,
|
|
||||||
// ),
|
|
||||||
// );
|
|
||||||
TextEditingController nameController = TextEditingController();
|
TextEditingController nameController = TextEditingController();
|
||||||
TextEditingController commandController = TextEditingController();
|
TextEditingController commandController = TextEditingController();
|
||||||
TextEditingController commandTemplateController =
|
TextEditingController commandTemplateController =
|
||||||
@@ -26,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),
|
||||||
@@ -54,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);
|
|
||||||
},
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -13,7 +13,11 @@ class LauncherButton extends StatelessWidget {
|
|||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
// print("EDITOR ID: $eid");
|
// print("EDITOR ID: $eid");
|
||||||
GlobalModel gm = Provider.of<GlobalModel>(context, listen: false);
|
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}");
|
// print("GRABBED EDITOR: ${edt.name}");
|
||||||
return eid == ""
|
return eid == ""
|
||||||
? Container()
|
? Container()
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ import "package:flutter/material.dart";
|
|||||||
import "package:prod/models/editor.dart";
|
import "package:prod/models/editor.dart";
|
||||||
import "package:prod/models/globalModel.dart";
|
import "package:prod/models/globalModel.dart";
|
||||||
import "package:prod/models/project.dart";
|
import "package:prod/models/project.dart";
|
||||||
|
import "package:prod/views/managePrj.dart";
|
||||||
import "package:prod/widgets/launcherButton.dart";
|
import "package:prod/widgets/launcherButton.dart";
|
||||||
import "package:provider/provider.dart";
|
import "package:provider/provider.dart";
|
||||||
import "package:yaru/yaru.dart";
|
import "package:yaru/yaru.dart";
|
||||||
@@ -18,8 +19,9 @@ class ProjectCard extends StatelessWidget {
|
|||||||
return InkWell(
|
return InkWell(
|
||||||
onHover: (st) => gm.setHoverShow(id, st),
|
onHover: (st) => gm.setHoverShow(id, st),
|
||||||
borderRadius: .circular(kYaruContainerRadius),
|
borderRadius: .circular(kYaruContainerRadius),
|
||||||
onTap: () async {
|
onTap: () {
|
||||||
await Navigator.pushNamed(context, "/manageprj", arguments: id);
|
// await Navigator.pushNamed(context, "/manageprj", arguments: id);
|
||||||
|
showDialog(context: context, builder: (context) => ManageProject(id));
|
||||||
},
|
},
|
||||||
child: Card(
|
child: Card(
|
||||||
// decoration: BoxDecoration(
|
// decoration: BoxDecoration(
|
||||||
@@ -77,14 +79,14 @@ class ProjectCard extends StatelessWidget {
|
|||||||
children: [
|
children: [
|
||||||
Column(
|
Column(
|
||||||
children: [
|
children: [
|
||||||
LauncherButton(prj.e0, prj.path.path),
|
LauncherButton(prj.e3, prj.path.path),
|
||||||
LauncherButton(prj.e1, prj.path.path),
|
LauncherButton(prj.e2, prj.path.path),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
Column(
|
Column(
|
||||||
children: [
|
children: [
|
||||||
LauncherButton(prj.e2, prj.path.path),
|
LauncherButton(prj.e0, prj.path.path),
|
||||||
LauncherButton(prj.e3, prj.path.path),
|
LauncherButton(prj.e1, prj.path.path),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
|
|||||||
76
pubspec.yaml
76
pubspec.yaml
@@ -1,39 +1,15 @@
|
|||||||
name: prod
|
name: prod
|
||||||
description: "A new Flutter project."
|
description: "Simple Dashboard to bookmark projects with custom editors."
|
||||||
# The following line prevents the package from being accidentally published to
|
publish_to: "none"
|
||||||
# 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
|
|
||||||
|
|
||||||
# The following defines the version and build number for your application.
|
version: 0.0.1
|
||||||
# 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
|
|
||||||
|
|
||||||
environment:
|
environment:
|
||||||
sdk: ^3.10.8
|
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:
|
dependencies:
|
||||||
flutter:
|
flutter:
|
||||||
sdk: 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
|
process_run: ^1.3.0
|
||||||
yaru: ^9.0.1
|
yaru: ^9.0.1
|
||||||
path: ^1.9.1
|
path: ^1.9.1
|
||||||
@@ -45,49 +21,5 @@ dev_dependencies:
|
|||||||
flutter_test:
|
flutter_test:
|
||||||
sdk: flutter
|
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:
|
flutter:
|
||||||
# The following line ensures that the Material Icons font is
|
uses-material-design: true
|
||||||
# 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
|
|
||||||
Reference in New Issue
Block a user