Skip to content

Commit

Permalink
updated table schema
Browse files Browse the repository at this point in the history
  • Loading branch information
drriguz committed Mar 29, 2024
1 parent 3027389 commit 6286f61
Show file tree
Hide file tree
Showing 11 changed files with 994 additions and 553 deletions.
966 changes: 571 additions & 395 deletions editing/lib/database/database.g.dart

Large diffs are not rendered by default.

7 changes: 6 additions & 1 deletion editing/lib/database/tables.drift
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,24 @@ CREATE TABLE notes (
format INTEGER NOT NULL,
title TEXT NOT NULL,
content TEXT NOT NULL,
abstract TEXT,
tags TEXT,
location TEXT,
weather TEXT,
mood TEXT,
encryption_type INTEGER NOT NULL,
encryption_arguments TEXT,
create_time TEXT NOT NULL,
last_update_time TEXT NOT NULL
last_update_time TEXT NOT NULL,
category_id INTEGER,
FOREIGN KEY(category_id) REFERENCES categories(id)
) As NoteEntity;

CREATE TABLE categories (
id INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
name TEXT NOT NULL,
encryption_type INTEGER NOT NULL,
encryption_arguments TEXT,
create_time TEXT NOT NULL,
last_update_time TEXT NOT NULL
) As CategoryEntity;
Expand Down
44 changes: 34 additions & 10 deletions editing/lib/ui/journal_edit_screen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import 'package:editing/database/database.dart';
import 'package:editing/store/note_list.dart';
import 'package:flutter/material.dart';
import 'package:flutter_mobx/flutter_mobx.dart';
import 'package:flutter_quill/flutter_quill.dart';
import 'package:flutter_svg/flutter_svg.dart';
import 'package:kdbx/kdbx.dart';
import 'package:logger/logger.dart';
Expand All @@ -18,6 +19,24 @@ class JournalEditScreen extends StatefulWidget {
}

class _JournalEditScreenState extends State<JournalEditScreen> {
final _controller = QuillController.basic();
final _editorFocusNode = FocusNode();
final _editorScrollController = ScrollController();
var _isReadOnly = false;

@override
void initState() {
super.initState();
}

@override
void dispose() {
_controller.dispose();
_editorFocusNode.dispose();
_editorScrollController.dispose();
super.dispose();
}

@override
Widget build(BuildContext context) {
AppStore _appStore = Provider.of<AppStore>(context);
Expand All @@ -30,6 +49,8 @@ class _JournalEditScreenState extends State<JournalEditScreen> {
icon: const Icon(Icons.check_outlined),
tooltip: 'Save',
onPressed: () async {
final data = _controller.document.toDelta().toJson();
print(data);
await _noteStore.insert();
if (context.mounted) {
Navigator.of(context).pop();
Expand All @@ -40,17 +61,20 @@ class _JournalEditScreenState extends State<JournalEditScreen> {
),
body: Column(
children: <Widget>[
QuillToolbar.simple(
configurations: QuillSimpleToolbarConfigurations(
toolbarIconAlignment: WrapAlignment.start,
controller: _controller,
sharedConfigurations: const QuillSharedConfigurations(
locale: Locale('en'),
),
),
),
Expanded(
child: Padding(
padding: const EdgeInsets.all(15.0),
child: TextField(
style: const TextStyle(color: Colors.grey),
expands: true,
autofocus: true,
keyboardType: TextInputType.multiline,
maxLines: null,
maxLength: 1024,
decoration: InputDecoration.collapsed(hintText: '在这里输入文字'),
child: QuillEditor.basic(
configurations: QuillEditorConfigurations(
controller: _controller,
readOnly: _isReadOnly,
),
),
),
Expand Down
12 changes: 12 additions & 0 deletions editing/linux/flutter/generated_plugin_registrant.cc
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,29 @@

#include "generated_plugin_registrant.h"

#include <irondash_engine_context/irondash_engine_context_plugin.h>
#include <screen_retriever/screen_retriever_plugin.h>
#include <sqlcipher_flutter_libs/sqlite3_flutter_libs_plugin.h>
#include <super_native_extensions/super_native_extensions_plugin.h>
#include <url_launcher_linux/url_launcher_plugin.h>
#include <window_manager/window_manager_plugin.h>

void fl_register_plugins(FlPluginRegistry* registry) {
g_autoptr(FlPluginRegistrar) irondash_engine_context_registrar =
fl_plugin_registry_get_registrar_for_plugin(registry, "IrondashEngineContextPlugin");
irondash_engine_context_plugin_register_with_registrar(irondash_engine_context_registrar);
g_autoptr(FlPluginRegistrar) screen_retriever_registrar =
fl_plugin_registry_get_registrar_for_plugin(registry, "ScreenRetrieverPlugin");
screen_retriever_plugin_register_with_registrar(screen_retriever_registrar);
g_autoptr(FlPluginRegistrar) sqlcipher_flutter_libs_registrar =
fl_plugin_registry_get_registrar_for_plugin(registry, "Sqlite3FlutterLibsPlugin");
sqlite3_flutter_libs_plugin_register_with_registrar(sqlcipher_flutter_libs_registrar);
g_autoptr(FlPluginRegistrar) super_native_extensions_registrar =
fl_plugin_registry_get_registrar_for_plugin(registry, "SuperNativeExtensionsPlugin");
super_native_extensions_plugin_register_with_registrar(super_native_extensions_registrar);
g_autoptr(FlPluginRegistrar) url_launcher_linux_registrar =
fl_plugin_registry_get_registrar_for_plugin(registry, "UrlLauncherPlugin");
url_launcher_plugin_register_with_registrar(url_launcher_linux_registrar);
g_autoptr(FlPluginRegistrar) window_manager_registrar =
fl_plugin_registry_get_registrar_for_plugin(registry, "WindowManagerPlugin");
window_manager_plugin_register_with_registrar(window_manager_registrar);
Expand Down
3 changes: 3 additions & 0 deletions editing/linux/flutter/generated_plugins.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,11 @@
#

list(APPEND FLUTTER_PLUGIN_LIST
irondash_engine_context
screen_retriever
sqlcipher_flutter_libs
super_native_extensions
url_launcher_linux
window_manager
)

Expand Down
8 changes: 8 additions & 0 deletions editing/macos/Flutter/GeneratedPluginRegistrant.swift
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,24 @@
import FlutterMacOS
import Foundation

import device_info_plus
import irondash_engine_context
import path_provider_foundation
import rive_common
import screen_retriever
import sqlcipher_flutter_libs
import super_native_extensions
import url_launcher_macos
import window_manager

func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) {
DeviceInfoPlusMacosPlugin.register(with: registry.registrar(forPlugin: "DeviceInfoPlusMacosPlugin"))
IrondashEngineContextPlugin.register(with: registry.registrar(forPlugin: "IrondashEngineContextPlugin"))
PathProviderPlugin.register(with: registry.registrar(forPlugin: "PathProviderPlugin"))
RivePlugin.register(with: registry.registrar(forPlugin: "RivePlugin"))
ScreenRetrieverPlugin.register(with: registry.registrar(forPlugin: "ScreenRetrieverPlugin"))
Sqlite3FlutterLibsPlugin.register(with: registry.registrar(forPlugin: "Sqlite3FlutterLibsPlugin"))
SuperNativeExtensionsPlugin.register(with: registry.registrar(forPlugin: "SuperNativeExtensionsPlugin"))
UrlLauncherPlugin.register(with: registry.registrar(forPlugin: "UrlLauncherPlugin"))
WindowManagerPlugin.register(with: registry.registrar(forPlugin: "WindowManagerPlugin"))
}
24 changes: 24 additions & 0 deletions editing/macos/Podfile.lock
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
PODS:
- device_info_plus (0.0.1):
- FlutterMacOS
- FlutterMacOS (1.0.0)
- irondash_engine_context (0.0.1):
- FlutterMacOS
- path_provider_foundation (0.0.1):
- Flutter
- FlutterMacOS
Expand All @@ -15,24 +19,36 @@ PODS:
- sqlcipher_flutter_libs (0.0.1):
- FlutterMacOS
- SQLCipher (~> 4.5.6)
- super_native_extensions (0.0.1):
- FlutterMacOS
- url_launcher_macos (0.0.1):
- FlutterMacOS
- window_manager (0.2.0):
- FlutterMacOS

DEPENDENCIES:
- device_info_plus (from `Flutter/ephemeral/.symlinks/plugins/device_info_plus/macos`)
- FlutterMacOS (from `Flutter/ephemeral`)
- irondash_engine_context (from `Flutter/ephemeral/.symlinks/plugins/irondash_engine_context/macos`)
- path_provider_foundation (from `Flutter/ephemeral/.symlinks/plugins/path_provider_foundation/darwin`)
- rive_common (from `Flutter/ephemeral/.symlinks/plugins/rive_common/macos`)
- screen_retriever (from `Flutter/ephemeral/.symlinks/plugins/screen_retriever/macos`)
- sqlcipher_flutter_libs (from `Flutter/ephemeral/.symlinks/plugins/sqlcipher_flutter_libs/macos`)
- super_native_extensions (from `Flutter/ephemeral/.symlinks/plugins/super_native_extensions/macos`)
- url_launcher_macos (from `Flutter/ephemeral/.symlinks/plugins/url_launcher_macos/macos`)
- window_manager (from `Flutter/ephemeral/.symlinks/plugins/window_manager/macos`)

SPEC REPOS:
trunk:
- SQLCipher

EXTERNAL SOURCES:
device_info_plus:
:path: Flutter/ephemeral/.symlinks/plugins/device_info_plus/macos
FlutterMacOS:
:path: Flutter/ephemeral
irondash_engine_context:
:path: Flutter/ephemeral/.symlinks/plugins/irondash_engine_context/macos
path_provider_foundation:
:path: Flutter/ephemeral/.symlinks/plugins/path_provider_foundation/darwin
rive_common:
Expand All @@ -41,16 +57,24 @@ EXTERNAL SOURCES:
:path: Flutter/ephemeral/.symlinks/plugins/screen_retriever/macos
sqlcipher_flutter_libs:
:path: Flutter/ephemeral/.symlinks/plugins/sqlcipher_flutter_libs/macos
super_native_extensions:
:path: Flutter/ephemeral/.symlinks/plugins/super_native_extensions/macos
url_launcher_macos:
:path: Flutter/ephemeral/.symlinks/plugins/url_launcher_macos/macos
window_manager:
:path: Flutter/ephemeral/.symlinks/plugins/window_manager/macos

SPEC CHECKSUMS:
device_info_plus: ce1b7762849d3ec103d0e0517299f2db7ad60720
FlutterMacOS: 8f6f14fa908a6fb3fba0cd85dbd81ec4b251fb24
irondash_engine_context: da62996ee25616d2f01bbeb85dc115d813359478
path_provider_foundation: 3784922295ac71e43754bd15e0653ccfd36a147c
rive_common: acedcab7802c0ece4b0d838b71d7deb637e1309a
screen_retriever: 59634572a57080243dd1bf715e55b6c54f241a38
SQLCipher: 838309284f29953a28ad2e81d87d55ea6b7c74fd
sqlcipher_flutter_libs: eba6362bc0c24c4db90855bc06507ab25093f6d7
super_native_extensions: 85efee3a7495b46b04befcfc86ed12069264ebf3
url_launcher_macos: d2691c7dd33ed713bf3544850a623080ec693d95
window_manager: 3a1844359a6295ab1e47659b1a777e36773cd6e8

PODFILE CHECKSUM: 236401fc2c932af29a9fcf0e97baeeb2d750d367
Expand Down
Loading

0 comments on commit 6286f61

Please sign in to comment.