Compare commits
6 Commits
Author | SHA1 | Date | |
---|---|---|---|
b2bff9e5c5 | |||
9d39cb09df | |||
5ea62a1216 | |||
c457b5cd5b | |||
722aa34fdf | |||
68c6dd1a95 |
BIN
android/app/src/main/res/mipmap-hdpi/ic_launcher.png
(Stored with Git LFS)
BIN
android/app/src/main/res/mipmap-hdpi/ic_launcher.png
(Stored with Git LFS)
Binary file not shown.
BIN
android/app/src/main/res/mipmap-mdpi/ic_launcher.png
(Stored with Git LFS)
BIN
android/app/src/main/res/mipmap-mdpi/ic_launcher.png
(Stored with Git LFS)
Binary file not shown.
BIN
android/app/src/main/res/mipmap-xhdpi/ic_launcher.png
(Stored with Git LFS)
BIN
android/app/src/main/res/mipmap-xhdpi/ic_launcher.png
(Stored with Git LFS)
Binary file not shown.
BIN
android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png
(Stored with Git LFS)
BIN
android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png
(Stored with Git LFS)
Binary file not shown.
BIN
android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
(Stored with Git LFS)
BIN
android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
(Stored with Git LFS)
Binary file not shown.
@@ -427,7 +427,7 @@
|
|||||||
isa = XCBuildConfiguration;
|
isa = XCBuildConfiguration;
|
||||||
buildSettings = {
|
buildSettings = {
|
||||||
ALWAYS_SEARCH_USER_PATHS = NO;
|
ALWAYS_SEARCH_USER_PATHS = NO;
|
||||||
ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES;
|
ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = AppIcon;
|
||||||
CLANG_ANALYZER_NONNULL = YES;
|
CLANG_ANALYZER_NONNULL = YES;
|
||||||
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
|
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
|
||||||
CLANG_CXX_LIBRARY = "libc++";
|
CLANG_CXX_LIBRARY = "libc++";
|
||||||
@@ -484,7 +484,7 @@
|
|||||||
isa = XCBuildConfiguration;
|
isa = XCBuildConfiguration;
|
||||||
buildSettings = {
|
buildSettings = {
|
||||||
ALWAYS_SEARCH_USER_PATHS = NO;
|
ALWAYS_SEARCH_USER_PATHS = NO;
|
||||||
ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES;
|
ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = AppIcon;
|
||||||
CLANG_ANALYZER_NONNULL = YES;
|
CLANG_ANALYZER_NONNULL = YES;
|
||||||
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
|
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
|
||||||
CLANG_CXX_LIBRARY = "libc++";
|
CLANG_CXX_LIBRARY = "libc++";
|
||||||
|
BIN
ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png
(Stored with Git LFS)
BIN
ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png
(Stored with Git LFS)
Binary file not shown.
BIN
ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png
(Stored with Git LFS)
BIN
ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png
(Stored with Git LFS)
Binary file not shown.
BIN
ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png
(Stored with Git LFS)
BIN
ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png
(Stored with Git LFS)
Binary file not shown.
BIN
ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png
(Stored with Git LFS)
BIN
ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png
(Stored with Git LFS)
Binary file not shown.
BIN
ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png
(Stored with Git LFS)
BIN
ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png
(Stored with Git LFS)
Binary file not shown.
BIN
ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png
(Stored with Git LFS)
BIN
ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png
(Stored with Git LFS)
Binary file not shown.
BIN
ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png
(Stored with Git LFS)
BIN
ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png
(Stored with Git LFS)
Binary file not shown.
BIN
ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png
(Stored with Git LFS)
BIN
ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png
(Stored with Git LFS)
Binary file not shown.
BIN
ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png
(Stored with Git LFS)
BIN
ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png
(Stored with Git LFS)
Binary file not shown.
BIN
ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png
(Stored with Git LFS)
BIN
ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png
(Stored with Git LFS)
Binary file not shown.
BIN
ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-50x50@1x.png
(Stored with Git LFS)
Normal file
BIN
ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-50x50@1x.png
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-50x50@2x.png
(Stored with Git LFS)
Normal file
BIN
ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-50x50@2x.png
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-57x57@1x.png
(Stored with Git LFS)
Normal file
BIN
ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-57x57@1x.png
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-57x57@2x.png
(Stored with Git LFS)
Normal file
BIN
ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-57x57@2x.png
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png
(Stored with Git LFS)
BIN
ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png
(Stored with Git LFS)
Binary file not shown.
BIN
ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png
(Stored with Git LFS)
BIN
ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png
(Stored with Git LFS)
Binary file not shown.
BIN
ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-72x72@1x.png
(Stored with Git LFS)
Normal file
BIN
ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-72x72@1x.png
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-72x72@2x.png
(Stored with Git LFS)
Normal file
BIN
ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-72x72@2x.png
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png
(Stored with Git LFS)
BIN
ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png
(Stored with Git LFS)
Binary file not shown.
BIN
ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png
(Stored with Git LFS)
BIN
ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png
(Stored with Git LFS)
Binary file not shown.
BIN
ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png
(Stored with Git LFS)
BIN
ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png
(Stored with Git LFS)
Binary file not shown.
103
lib/db.dart
103
lib/db.dart
@@ -33,6 +33,29 @@ CREATE TABLE IF NOT EXISTS settings (
|
|||||||
key TEXT PRIMARY KEY NOT NULL,
|
key TEXT PRIMARY KEY NOT NULL,
|
||||||
value TEXT NOT NULL
|
value TEXT NOT NULL
|
||||||
);
|
);
|
||||||
|
|
||||||
|
-- Create virtual FTS5 table for searching notes content
|
||||||
|
CREATE VIRTUAL TABLE IF NOT EXISTS notes_fts USING fts5(
|
||||||
|
content,
|
||||||
|
date,
|
||||||
|
content='notes',
|
||||||
|
content_rowid='id'
|
||||||
|
);
|
||||||
|
|
||||||
|
-- Trigger to keep FTS table in sync with notes table when inserting
|
||||||
|
CREATE TRIGGER IF NOT EXISTS notes_ai AFTER INSERT ON notes BEGIN
|
||||||
|
INSERT INTO notes_fts(rowid, content, date) VALUES (new.id, new.content, new.date);
|
||||||
|
END;
|
||||||
|
|
||||||
|
-- Trigger to keep FTS table in sync when deleting notes
|
||||||
|
CREATE TRIGGER IF NOT EXISTS notes_ad AFTER DELETE ON notes BEGIN
|
||||||
|
DELETE FROM notes_fts WHERE rowid = old.id;
|
||||||
|
END;
|
||||||
|
|
||||||
|
-- Trigger to keep FTS table in sync when updating notes
|
||||||
|
CREATE TRIGGER IF NOT EXISTS notes_au AFTER UPDATE ON notes BEGIN
|
||||||
|
UPDATE notes_fts SET content = new.content, date = new.date WHERE rowid = old.id;
|
||||||
|
END;
|
||||||
''';
|
''';
|
||||||
|
|
||||||
static Future<String> _getDatabasePath() async {
|
static Future<String> _getDatabasePath() async {
|
||||||
@@ -44,7 +67,7 @@ CREATE TABLE IF NOT EXISTS settings (
|
|||||||
if (home == null) {
|
if (home == null) {
|
||||||
throw Exception('Could not find home directory');
|
throw Exception('Could not find home directory');
|
||||||
}
|
}
|
||||||
debugPrint('Home directory found: home');
|
debugPrint('Home directory found: $home');
|
||||||
|
|
||||||
final dbDir = Directory(path.join(home, settingsDir));
|
final dbDir = Directory(path.join(home, settingsDir));
|
||||||
if (!await dbDir.exists()) {
|
if (!await dbDir.exists()) {
|
||||||
@@ -58,7 +81,7 @@ CREATE TABLE IF NOT EXISTS settings (
|
|||||||
} else {
|
} else {
|
||||||
// Default path for other platforms
|
// Default path for other platforms
|
||||||
final databasesPath = await databaseFactoryFfi.getDatabasesPath();
|
final databasesPath = await databaseFactoryFfi.getDatabasesPath();
|
||||||
debugPrint('Using default databases path: databasesPath');
|
debugPrint('Using default databases path: $databasesPath');
|
||||||
return path.join(databasesPath, dbFileName);
|
return path.join(databasesPath, dbFileName);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -68,7 +91,7 @@ CREATE TABLE IF NOT EXISTS settings (
|
|||||||
sqfliteFfiInit();
|
sqfliteFfiInit();
|
||||||
|
|
||||||
final dbPath = await _getDatabasePath();
|
final dbPath = await _getDatabasePath();
|
||||||
debugPrint('Database path: dbPath');
|
debugPrint('Database path: $dbPath');
|
||||||
|
|
||||||
try {
|
try {
|
||||||
db = await databaseFactoryFfi.openDatabase(
|
db = await databaseFactoryFfi.openDatabase(
|
||||||
@@ -84,7 +107,7 @@ CREATE TABLE IF NOT EXISTS settings (
|
|||||||
);
|
);
|
||||||
debugPrint('Database opened and initialized');
|
debugPrint('Database opened and initialized');
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
debugPrint('Failed to initialize database: e');
|
debugPrint('Failed to initialize database: $e');
|
||||||
rethrow;
|
rethrow;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -104,11 +127,73 @@ CREATE TABLE IF NOT EXISTS settings (
|
|||||||
}
|
}
|
||||||
|
|
||||||
static Future<void> setSetting(String key, String value) async {
|
static Future<void> setSetting(String key, String value) async {
|
||||||
await db.insert(
|
await db.insert('settings', {
|
||||||
'settings',
|
'key': key,
|
||||||
{'key': key, 'value': value},
|
'value': value,
|
||||||
conflictAlgorithm: ConflictAlgorithm.replace,
|
}, conflictAlgorithm: ConflictAlgorithm.replace);
|
||||||
);
|
|
||||||
debugPrint("Setting updated: $key = $value");
|
debugPrint("Setting updated: $key = $value");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Search notes using FTS
|
||||||
|
static Future<List<Map<String, dynamic>>> searchNotes(String query) async {
|
||||||
|
try {
|
||||||
|
if (query.trim().isEmpty) {
|
||||||
|
return [];
|
||||||
|
}
|
||||||
|
|
||||||
|
// Process the query for partial word matching
|
||||||
|
// Split into individual terms, filter empty ones
|
||||||
|
List<String> terms =
|
||||||
|
query
|
||||||
|
.trim()
|
||||||
|
.split(RegExp(r'\s+'))
|
||||||
|
.where((term) => term.isNotEmpty)
|
||||||
|
.toList();
|
||||||
|
|
||||||
|
if (terms.isEmpty) {
|
||||||
|
return [];
|
||||||
|
}
|
||||||
|
|
||||||
|
// Add wildcards to each term for prefix matching (e.g., "fuck*" will match "fucked")
|
||||||
|
// Join terms with AND for all-term matching (results must contain ALL terms)
|
||||||
|
String ftsQuery = terms
|
||||||
|
.map((term) {
|
||||||
|
// Remove any special characters that might break the query
|
||||||
|
String sanitizedTerm = term.replaceAll(RegExp(r'[^\w]'), '');
|
||||||
|
if (sanitizedTerm.isEmpty) return '';
|
||||||
|
|
||||||
|
// Add wildcard for stemming/prefix matching
|
||||||
|
return '$sanitizedTerm*';
|
||||||
|
})
|
||||||
|
.where((term) => term.isNotEmpty)
|
||||||
|
.join(' AND ');
|
||||||
|
|
||||||
|
if (ftsQuery.isEmpty) {
|
||||||
|
debugPrint('Query was sanitized to empty string');
|
||||||
|
return [];
|
||||||
|
}
|
||||||
|
|
||||||
|
debugPrint('FTS query: "$ftsQuery"');
|
||||||
|
|
||||||
|
// Execute the FTS query with AND logic
|
||||||
|
final List<Map<String, dynamic>> results = await db.rawQuery(
|
||||||
|
'''
|
||||||
|
SELECT n.id, n.date, n.content, snippet(notes_fts, 0, '<b>', '</b>', '...', 20) as snippet
|
||||||
|
FROM notes_fts
|
||||||
|
JOIN notes n ON notes_fts.rowid = n.id
|
||||||
|
WHERE notes_fts MATCH ?
|
||||||
|
ORDER BY n.date DESC
|
||||||
|
LIMIT 100
|
||||||
|
''',
|
||||||
|
[ftsQuery],
|
||||||
|
);
|
||||||
|
|
||||||
|
debugPrint('Search query "$ftsQuery" returned ${results.length} results');
|
||||||
|
return results;
|
||||||
|
} catch (e) {
|
||||||
|
debugPrint('Search failed: $e');
|
||||||
|
// Return empty results rather than crashing on malformed queries
|
||||||
|
return [];
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
621
lib/main.dart
621
lib/main.dart
@@ -1,4 +1,5 @@
|
|||||||
import 'dart:async';
|
import 'dart:async';
|
||||||
|
import 'dart:io';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter/services.dart';
|
import 'package:flutter/services.dart';
|
||||||
import 'package:journaler/db.dart';
|
import 'package:journaler/db.dart';
|
||||||
@@ -7,17 +8,66 @@ import 'package:system_tray/system_tray.dart';
|
|||||||
import 'package:window_manager/window_manager.dart';
|
import 'package:window_manager/window_manager.dart';
|
||||||
import 'package:audioplayers/audioplayers.dart';
|
import 'package:audioplayers/audioplayers.dart';
|
||||||
import 'package:flutter/gestures.dart';
|
import 'package:flutter/gestures.dart';
|
||||||
|
import 'dart:math';
|
||||||
|
import 'package:path/path.dart' as path;
|
||||||
|
import 'package:ps_list/ps_list.dart';
|
||||||
|
|
||||||
// TODO: Add an icon to the executable, simply use the existing tray icon
|
// TODO: Sound does not play when ran from a different workdir? Weird
|
||||||
// TODO: Implement some sort of scroll through notes
|
// TODO: Fix saving the same scratch over and over again
|
||||||
|
|
||||||
// Default values - will be replaced by DB values if they exist
|
// Default values - will be replaced by DB values if they exist
|
||||||
const Duration _defaultPopupInterval = Duration(minutes: 20);
|
const Duration _defaultPopupInterval = Duration(minutes: 20);
|
||||||
const String _defaultNotificationSound = 'MeetTheSniper.mp3';
|
const String _defaultNotificationSound = 'MeetTheSniper.mp3';
|
||||||
|
|
||||||
|
// Flag to indicate if there's a pending show request from a secondary instance
|
||||||
|
bool _pendingShowRequest = false;
|
||||||
|
|
||||||
|
// Global navigator key to access the navigator state from anywhere
|
||||||
|
final GlobalKey<NavigatorState> navigatorKey = GlobalKey<NavigatorState>();
|
||||||
|
|
||||||
|
/// Paths for IPC file in system temp directory
|
||||||
|
class AppFiles {
|
||||||
|
static String get ipcFilePath =>
|
||||||
|
path.join(Directory.systemTemp.path, 'journaler_ipc.txt');
|
||||||
|
}
|
||||||
|
|
||||||
void main() async {
|
void main() async {
|
||||||
await DB.init();
|
|
||||||
WidgetsFlutterBinding.ensureInitialized();
|
WidgetsFlutterBinding.ensureInitialized();
|
||||||
|
|
||||||
|
final ipcFile = File(AppFiles.ipcFilePath);
|
||||||
|
|
||||||
|
if (await alreadyRunning()) {
|
||||||
|
await signalPrimaryInstanceAndExit(ipcFile);
|
||||||
|
} else {
|
||||||
|
await runPrimaryInstance(ipcFile);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Future<bool> alreadyRunning() async {
|
||||||
|
final processes = await PSList.getRunningProcesses();
|
||||||
|
final executable = Platform.resolvedExecutable;
|
||||||
|
final executableName = path.basename(executable);
|
||||||
|
final journalers =
|
||||||
|
processes
|
||||||
|
.where((process) => process == executableName)
|
||||||
|
.toList();
|
||||||
|
debugPrint("Journalers: $journalers");
|
||||||
|
return journalers.length > 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Run the primary instance of the application
|
||||||
|
Future<void> runPrimaryInstance(File ipcFile) async {
|
||||||
|
debugPrint("Starting as primary instance");
|
||||||
|
|
||||||
|
// Create or clear the IPC file
|
||||||
|
if (!await ipcFile.exists()) {
|
||||||
|
await ipcFile.create();
|
||||||
|
}
|
||||||
|
// Start a watcher for the IPC file to detect signals from other instances
|
||||||
|
startIpcWatcher(ipcFile);
|
||||||
|
|
||||||
|
// Initialize the app
|
||||||
|
await DB.init();
|
||||||
await windowManager.ensureInitialized();
|
await windowManager.ensureInitialized();
|
||||||
|
|
||||||
WindowOptions windowOptions = const WindowOptions(
|
WindowOptions windowOptions = const WindowOptions(
|
||||||
@@ -33,6 +83,114 @@ void main() async {
|
|||||||
});
|
});
|
||||||
|
|
||||||
runApp(const JournalerApp());
|
runApp(const JournalerApp());
|
||||||
|
|
||||||
|
// Set up termination handlers to clean up resources
|
||||||
|
setupTerminationHandlers(ipcFile);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Handle termination signals by cleaning up IPC file
|
||||||
|
void setupTerminationHandlers(File ipcFile) {
|
||||||
|
// Handle normal termination
|
||||||
|
ProcessSignal.sigterm.watch().listen((_) async {
|
||||||
|
await cleanupFiles(ipcFile);
|
||||||
|
exit(0);
|
||||||
|
});
|
||||||
|
|
||||||
|
// Handle Windows and Linux CTRL+C termination
|
||||||
|
if (Platform.isWindows || Platform.isLinux) {
|
||||||
|
ProcessSignal.sigint.watch().listen((_) async {
|
||||||
|
await cleanupFiles(ipcFile);
|
||||||
|
exit(0);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Clean up IPC file
|
||||||
|
Future<void> cleanupFiles(File ipcFile) async {
|
||||||
|
try {
|
||||||
|
if (await ipcFile.exists()) {
|
||||||
|
await ipcFile.delete();
|
||||||
|
}
|
||||||
|
debugPrint("Removed IPC file on app termination");
|
||||||
|
} catch (e) {
|
||||||
|
debugPrint("Error cleaning up files: $e");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Signal the primary instance to show itself, then exit
|
||||||
|
Future<void> signalPrimaryInstanceAndExit(File ipcFile) async {
|
||||||
|
debugPrint(
|
||||||
|
"Another instance is already running. Signaling it to show window.",
|
||||||
|
);
|
||||||
|
|
||||||
|
try {
|
||||||
|
// Create the IPC file if it doesn't exist
|
||||||
|
if (!await ipcFile.exists()) {
|
||||||
|
await ipcFile.create();
|
||||||
|
}
|
||||||
|
|
||||||
|
// Write a 'show' command with a timestamp
|
||||||
|
final timestamp = DateTime.now().millisecondsSinceEpoch;
|
||||||
|
await ipcFile.writeAsString('show:$timestamp');
|
||||||
|
debugPrint("Signal sent to primary instance via IPC file");
|
||||||
|
|
||||||
|
// Give the primary instance a moment to process the signal
|
||||||
|
await Future.delayed(const Duration(seconds: 2));
|
||||||
|
} catch (e) {
|
||||||
|
debugPrint("Error signaling primary instance: $e");
|
||||||
|
}
|
||||||
|
|
||||||
|
// Exit this instance
|
||||||
|
debugPrint("Exiting secondary instance");
|
||||||
|
exit(0);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Start watching the IPC file for signals from other instances
|
||||||
|
void startIpcWatcher(File ipcFile) {
|
||||||
|
// Initial check of the file content
|
||||||
|
checkIpcFileContent(ipcFile);
|
||||||
|
|
||||||
|
// Set up a file watcher
|
||||||
|
final watcher = ipcFile.watch();
|
||||||
|
watcher.listen((event) {
|
||||||
|
if (event.type == FileSystemEvent.modify) {
|
||||||
|
checkIpcFileContent(ipcFile);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
// Also set up a periodic check as a fallback
|
||||||
|
Timer.periodic(const Duration(milliseconds: 200), (_) {
|
||||||
|
checkIpcFileContent(ipcFile);
|
||||||
|
});
|
||||||
|
|
||||||
|
debugPrint("IPC file watcher started");
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Check the IPC file content for commands
|
||||||
|
Future<void> checkIpcFileContent(File ipcFile) async {
|
||||||
|
try {
|
||||||
|
if (await ipcFile.exists()) {
|
||||||
|
final content = await ipcFile.readAsString();
|
||||||
|
|
||||||
|
if (content.isNotEmpty && content.startsWith('show:')) {
|
||||||
|
// Clear the file immediately to avoid processing the same command multiple times
|
||||||
|
await ipcFile.writeAsString('');
|
||||||
|
|
||||||
|
// Process the show command
|
||||||
|
if (MainPageState.instance != null) {
|
||||||
|
debugPrint("Received show command - making window visible");
|
||||||
|
MainPageState.instance!.showWindow();
|
||||||
|
} else {
|
||||||
|
debugPrint(
|
||||||
|
"MainPageState not initialized yet - setting pending flag",
|
||||||
|
);
|
||||||
|
_pendingShowRequest = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} catch (e) {
|
||||||
|
debugPrint("Error processing IPC file: $e");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
class JournalerApp extends StatelessWidget {
|
class JournalerApp extends StatelessWidget {
|
||||||
@@ -113,6 +271,7 @@ class JournalerApp extends StatelessWidget {
|
|||||||
themeMode: ThemeMode.system,
|
themeMode: ThemeMode.system,
|
||||||
home: const MainPage(),
|
home: const MainPage(),
|
||||||
debugShowCheckedModeBanner: false,
|
debugShowCheckedModeBanner: false,
|
||||||
|
navigatorKey: navigatorKey,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -125,9 +284,13 @@ class MainPage extends StatefulWidget {
|
|||||||
}
|
}
|
||||||
|
|
||||||
class MainPageState extends State<MainPage> with WindowListener {
|
class MainPageState extends State<MainPage> with WindowListener {
|
||||||
|
// Static reference to the current instance
|
||||||
|
static MainPageState? instance;
|
||||||
|
|
||||||
final SystemTray _systemTray = SystemTray();
|
final SystemTray _systemTray = SystemTray();
|
||||||
final Menu _menu = Menu();
|
final Menu _menu = Menu();
|
||||||
final AudioPlayer _audioPlayer = AudioPlayer();
|
final AudioPlayer _audioPlayer = AudioPlayer();
|
||||||
|
double _volume = 0.7; // Default volume level (0.0 to 1.0)
|
||||||
|
|
||||||
final TextEditingController _previousEntryController =
|
final TextEditingController _previousEntryController =
|
||||||
TextEditingController();
|
TextEditingController();
|
||||||
@@ -136,6 +299,7 @@ class MainPageState extends State<MainPage> with WindowListener {
|
|||||||
final TextEditingController _scratchController = TextEditingController();
|
final TextEditingController _scratchController = TextEditingController();
|
||||||
final TextEditingController _intervalController = TextEditingController();
|
final TextEditingController _intervalController = TextEditingController();
|
||||||
final TextEditingController _soundController = TextEditingController();
|
final TextEditingController _soundController = TextEditingController();
|
||||||
|
final TextEditingController _searchController = TextEditingController();
|
||||||
|
|
||||||
Note? previousNote;
|
Note? previousNote;
|
||||||
Note? _currentlyDisplayedNote;
|
Note? _currentlyDisplayedNote;
|
||||||
@@ -144,31 +308,52 @@ class MainPageState extends State<MainPage> with WindowListener {
|
|||||||
|
|
||||||
bool _canGoPrevious = false;
|
bool _canGoPrevious = false;
|
||||||
bool _canGoNext = false;
|
bool _canGoNext = false;
|
||||||
|
bool _isSearching = false;
|
||||||
|
List<Note> _searchResults = [];
|
||||||
|
|
||||||
Timer? _popupTimer;
|
Timer? _popupTimer;
|
||||||
Timer? _debounceTimer;
|
Timer? _debounceTimer;
|
||||||
|
Timer? _searchDebounceTimer;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
void initState() {
|
void initState() {
|
||||||
super.initState();
|
super.initState();
|
||||||
|
// Store reference to this instance
|
||||||
|
instance = this;
|
||||||
windowManager.addListener(this);
|
windowManager.addListener(this);
|
||||||
_initSystemTray();
|
_initSystemTray();
|
||||||
_loadData();
|
_loadData();
|
||||||
|
_loadVolume();
|
||||||
windowManager.setPreventClose(true);
|
windowManager.setPreventClose(true);
|
||||||
_setWindowConfig();
|
_setWindowConfig();
|
||||||
|
|
||||||
|
// Check if there's a pending show request from another instance
|
||||||
|
WidgetsBinding.instance.addPostFrameCallback((_) {
|
||||||
|
if (_pendingShowRequest) {
|
||||||
|
debugPrint("Processing pending show request during initialization");
|
||||||
|
_pendingShowRequest = false;
|
||||||
|
showWindow();
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
void dispose() {
|
void dispose() {
|
||||||
|
// Clear reference to this instance
|
||||||
|
if (instance == this) {
|
||||||
|
instance = null;
|
||||||
|
}
|
||||||
windowManager.removeListener(this);
|
windowManager.removeListener(this);
|
||||||
_popupTimer?.cancel();
|
_popupTimer?.cancel();
|
||||||
_debounceTimer?.cancel();
|
_debounceTimer?.cancel();
|
||||||
|
_searchDebounceTimer?.cancel();
|
||||||
_previousEntryController.dispose();
|
_previousEntryController.dispose();
|
||||||
_currentEntryController.dispose();
|
_currentEntryController.dispose();
|
||||||
_currentEntryFocusNode.dispose();
|
_currentEntryFocusNode.dispose();
|
||||||
_scratchController.dispose();
|
_scratchController.dispose();
|
||||||
_intervalController.dispose();
|
_intervalController.dispose();
|
||||||
_soundController.dispose();
|
_soundController.dispose();
|
||||||
|
_searchController.dispose();
|
||||||
_audioPlayer.dispose();
|
_audioPlayer.dispose();
|
||||||
super.dispose();
|
super.dispose();
|
||||||
}
|
}
|
||||||
@@ -201,7 +386,7 @@ class MainPageState extends State<MainPage> with WindowListener {
|
|||||||
_systemTray.registerSystemTrayEventHandler((eventName) {
|
_systemTray.registerSystemTrayEventHandler((eventName) {
|
||||||
debugPrint("System Tray Event: $eventName");
|
debugPrint("System Tray Event: $eventName");
|
||||||
if (eventName == kSystemTrayEventClick) {
|
if (eventName == kSystemTrayEventClick) {
|
||||||
_showWindow();
|
showWindow();
|
||||||
} else if (eventName == kSystemTrayEventRightClick) {
|
} else if (eventName == kSystemTrayEventRightClick) {
|
||||||
_systemTray.popUpContextMenu();
|
_systemTray.popUpContextMenu();
|
||||||
}
|
}
|
||||||
@@ -211,34 +396,80 @@ class MainPageState extends State<MainPage> with WindowListener {
|
|||||||
void _startPopupTimer() {
|
void _startPopupTimer() {
|
||||||
_popupTimer?.cancel();
|
_popupTimer?.cancel();
|
||||||
_popupTimer = Timer.periodic(_currentPopupInterval, (timer) {
|
_popupTimer = Timer.periodic(_currentPopupInterval, (timer) {
|
||||||
_showWindow();
|
showWindow();
|
||||||
});
|
});
|
||||||
debugPrint("Popup timer started with interval: ${_currentPopupInterval.inMinutes} minutes");
|
debugPrint(
|
||||||
|
"Popup timer started with interval: ${_currentPopupInterval.inMinutes} minutes",
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<void> _showWindow() async {
|
Future<void> showWindow() async {
|
||||||
_loadData();
|
_loadData();
|
||||||
|
try {
|
||||||
bool wasVisible = await windowManager.isVisible();
|
bool wasVisible = await windowManager.isVisible();
|
||||||
|
debugPrint("Current window visibility: $wasVisible");
|
||||||
|
|
||||||
if (!wasVisible) {
|
if (!wasVisible) {
|
||||||
|
// First make sure the window has the right size and position
|
||||||
await windowManager.setSize(const Size(1600, 900));
|
await windowManager.setSize(const Size(1600, 900));
|
||||||
await windowManager.center();
|
await windowManager.center();
|
||||||
|
|
||||||
|
// Now show and focus
|
||||||
|
await windowManager.show();
|
||||||
|
await Future.delayed(const Duration(milliseconds: 100)); // Short delay
|
||||||
|
await windowManager.focus();
|
||||||
|
|
||||||
|
// Set input focus
|
||||||
|
_currentEntryFocusNode.requestFocus();
|
||||||
|
|
||||||
|
// Play notification sound
|
||||||
|
await _playSound();
|
||||||
|
|
||||||
|
debugPrint("Window made visible and focused");
|
||||||
|
} else {
|
||||||
|
// Already visible, just focus
|
||||||
|
await windowManager.focus();
|
||||||
|
_currentEntryFocusNode.requestFocus();
|
||||||
|
debugPrint("Window already visible, just focused");
|
||||||
|
}
|
||||||
|
|
||||||
|
// Verify the window is now visible
|
||||||
|
bool isNowVisible = await windowManager.isVisible();
|
||||||
|
debugPrint("Window visibility after show attempt: $isNowVisible");
|
||||||
|
|
||||||
|
if (!isNowVisible) {
|
||||||
|
debugPrint(
|
||||||
|
"WARNING: Window still not visible after show attempt, trying again",
|
||||||
|
);
|
||||||
await windowManager.show();
|
await windowManager.show();
|
||||||
await windowManager.focus();
|
await windowManager.focus();
|
||||||
_currentEntryFocusNode.requestFocus();
|
|
||||||
await _playSound();
|
|
||||||
} else {
|
|
||||||
await windowManager.focus();
|
|
||||||
_currentEntryFocusNode.requestFocus();
|
|
||||||
}
|
}
|
||||||
|
} catch (e) {
|
||||||
|
debugPrint("Error showing window: $e");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Convert linear slider value (0.0-1.0) to logarithmic volume (for better human hearing perception)
|
||||||
|
double _linearToLogVolume(double linearValue) {
|
||||||
|
// Prevent log(0) which is -infinity
|
||||||
|
if (linearValue <= 0.01) return 0.0;
|
||||||
|
|
||||||
|
// This is a common audio perception formula based on the Weber-Fechner law
|
||||||
|
// Using a custom curve that gives good control at low volumes (where human hearing is most sensitive)
|
||||||
|
return pow(linearValue, 2).toDouble();
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<void> _playSound() async {
|
Future<void> _playSound() async {
|
||||||
await _audioPlayer.stop();
|
await _audioPlayer.stop();
|
||||||
try {
|
try {
|
||||||
|
// Set volume before playing (convert linear slider value to log volume)
|
||||||
|
await _audioPlayer.setVolume(_linearToLogVolume(_volume));
|
||||||
await _audioPlayer.play(AssetSource('sounds/$_currentNotificationSound'));
|
await _audioPlayer.play(AssetSource('sounds/$_currentNotificationSound'));
|
||||||
debugPrint("Played sound: $_currentNotificationSound");
|
debugPrint(
|
||||||
|
"Played sound: $_currentNotificationSound at volume: $_volume (log: ${_linearToLogVolume(_volume)})",
|
||||||
|
);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
debugPrint("Error playing sound $_currentNotificationSound: e");
|
debugPrint("Error playing sound $_currentNotificationSound: $e");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -290,7 +521,9 @@ class MainPageState extends State<MainPage> with WindowListener {
|
|||||||
String? intervalMinutesStr = await DB.getSetting('popupIntervalMinutes');
|
String? intervalMinutesStr = await DB.getSetting('popupIntervalMinutes');
|
||||||
String? soundFileStr = await DB.getSetting('notificationSound');
|
String? soundFileStr = await DB.getSetting('notificationSound');
|
||||||
|
|
||||||
int intervalMinutes = int.tryParse(intervalMinutesStr ?? '') ?? _defaultPopupInterval.inMinutes;
|
int intervalMinutes =
|
||||||
|
int.tryParse(intervalMinutesStr ?? '') ??
|
||||||
|
_defaultPopupInterval.inMinutes;
|
||||||
_currentPopupInterval = Duration(minutes: intervalMinutes);
|
_currentPopupInterval = Duration(minutes: intervalMinutes);
|
||||||
_currentNotificationSound = soundFileStr ?? _defaultNotificationSound;
|
_currentNotificationSound = soundFileStr ?? _defaultNotificationSound;
|
||||||
|
|
||||||
@@ -313,6 +546,25 @@ class MainPageState extends State<MainPage> with WindowListener {
|
|||||||
debugPrint("Data loaded.");
|
debugPrint("Data loaded.");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Load volume setting from database
|
||||||
|
Future<void> _loadVolume() async {
|
||||||
|
String? volumeStr = await DB.getSetting('notificationVolume');
|
||||||
|
if (volumeStr != null) {
|
||||||
|
setState(() {
|
||||||
|
_volume = double.tryParse(volumeStr) ?? 0.7;
|
||||||
|
_audioPlayer.setVolume(_linearToLogVolume(_volume));
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
_audioPlayer.setVolume(_linearToLogVolume(_volume));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Save volume setting to database
|
||||||
|
Future<void> _saveVolume() async {
|
||||||
|
await DB.setSetting('notificationVolume', _volume.toString());
|
||||||
|
debugPrint("Volume saved: $_volume");
|
||||||
|
}
|
||||||
|
|
||||||
void _saveData() async {
|
void _saveData() async {
|
||||||
String previousEntry = _previousEntryController.text;
|
String previousEntry = _previousEntryController.text;
|
||||||
String currentEntry = _currentEntryController.text;
|
String currentEntry = _currentEntryController.text;
|
||||||
@@ -327,7 +579,8 @@ class MainPageState extends State<MainPage> with WindowListener {
|
|||||||
await updateNote(previousNote!);
|
await updateNote(previousNote!);
|
||||||
}
|
}
|
||||||
|
|
||||||
int newIntervalMinutes = int.tryParse(intervalStr) ?? _currentPopupInterval.inMinutes;
|
int newIntervalMinutes =
|
||||||
|
int.tryParse(intervalStr) ?? _currentPopupInterval.inMinutes;
|
||||||
Duration newInterval = Duration(minutes: newIntervalMinutes);
|
Duration newInterval = Duration(minutes: newIntervalMinutes);
|
||||||
if (newInterval != _currentPopupInterval) {
|
if (newInterval != _currentPopupInterval) {
|
||||||
_currentPopupInterval = newInterval;
|
_currentPopupInterval = newInterval;
|
||||||
@@ -344,6 +597,9 @@ class MainPageState extends State<MainPage> with WindowListener {
|
|||||||
DB.setSetting('notificationSound', soundStr);
|
DB.setSetting('notificationSound', soundStr);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Also save volume
|
||||||
|
await _saveVolume();
|
||||||
|
|
||||||
debugPrint(
|
debugPrint(
|
||||||
"Saving data... Current Entry: [${currentEntry.length} chars], Scratch: [${scratchContent.length} chars]",
|
"Saving data... Current Entry: [${currentEntry.length} chars], Scratch: [${scratchContent.length} chars]",
|
||||||
);
|
);
|
||||||
@@ -353,29 +609,294 @@ class MainPageState extends State<MainPage> with WindowListener {
|
|||||||
await windowManager.setAspectRatio(16 / 9);
|
await windowManager.setAspectRatio(16 / 9);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Sanitize FTS query
|
||||||
|
String _sanitizeFtsQuery(String query) {
|
||||||
|
// Simple trimming - the DB layer will handle the complex processing
|
||||||
|
return query.trim();
|
||||||
|
}
|
||||||
|
|
||||||
|
// Build rich text with highlights for search results
|
||||||
|
List<InlineSpan> _buildHighlightedText(String highlightedText) {
|
||||||
|
List<InlineSpan> spans = [];
|
||||||
|
// The text comes with <b>highlighted parts</b>
|
||||||
|
RegExp exp = RegExp(r'<b>(.*?)</b>');
|
||||||
|
|
||||||
|
int lastIndex = 0;
|
||||||
|
for (final match in exp.allMatches(highlightedText)) {
|
||||||
|
// Add text before the highlight
|
||||||
|
if (match.start > lastIndex) {
|
||||||
|
spans.add(
|
||||||
|
TextSpan(
|
||||||
|
text: highlightedText.substring(lastIndex, match.start),
|
||||||
|
style: const TextStyle(
|
||||||
|
fontSize: 13,
|
||||||
|
), // Smaller font for regular text
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Add the highlighted text
|
||||||
|
spans.add(
|
||||||
|
TextSpan(
|
||||||
|
text: match.group(1),
|
||||||
|
style: const TextStyle(
|
||||||
|
fontWeight: FontWeight.bold,
|
||||||
|
backgroundColor: Colors.yellow,
|
||||||
|
color: Colors.black,
|
||||||
|
fontSize: 13, // Smaller font for highlighted text
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
|
||||||
|
lastIndex = match.end;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Add any remaining text
|
||||||
|
if (lastIndex < highlightedText.length) {
|
||||||
|
spans.add(
|
||||||
|
TextSpan(
|
||||||
|
text: highlightedText.substring(lastIndex),
|
||||||
|
style: const TextStyle(fontSize: 13), // Smaller font for regular text
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
return spans;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Show search dialog
|
||||||
|
void _showSearchDialog() {
|
||||||
|
_searchController.clear();
|
||||||
|
_searchResults = [];
|
||||||
|
_isSearching = false;
|
||||||
|
|
||||||
|
showDialog(
|
||||||
|
context: context,
|
||||||
|
builder: (BuildContext context) {
|
||||||
|
return StatefulBuilder(
|
||||||
|
builder: (context, dialogSetState) {
|
||||||
|
return AlertDialog(
|
||||||
|
title: const Text('Search Notes'),
|
||||||
|
content: SizedBox(
|
||||||
|
width: MediaQuery.of(context).size.width * 0.7,
|
||||||
|
height: MediaQuery.of(context).size.height * 0.7,
|
||||||
|
child: Column(
|
||||||
|
children: [
|
||||||
|
TextField(
|
||||||
|
controller: _searchController,
|
||||||
|
decoration: const InputDecoration(
|
||||||
|
labelText: 'Search Query',
|
||||||
|
hintText: 'e.g. wifi or meeting',
|
||||||
|
border: OutlineInputBorder(),
|
||||||
|
prefixIcon: Icon(Icons.search),
|
||||||
|
),
|
||||||
|
autofocus: true,
|
||||||
|
onChanged: (value) async {
|
||||||
|
// Start search and update dialog state
|
||||||
|
if (value.isEmpty) {
|
||||||
|
dialogSetState(() {
|
||||||
|
_searchResults = [];
|
||||||
|
_isSearching = false;
|
||||||
|
});
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
dialogSetState(() {
|
||||||
|
_isSearching = true;
|
||||||
|
});
|
||||||
|
|
||||||
|
// Escape special characters to prevent SQLite FTS syntax errors
|
||||||
|
String trimmedQuery = _sanitizeFtsQuery(value);
|
||||||
|
|
||||||
|
// Debounce search
|
||||||
|
_searchDebounceTimer?.cancel();
|
||||||
|
_searchDebounceTimer = Timer(
|
||||||
|
const Duration(milliseconds: 300),
|
||||||
|
() async {
|
||||||
|
try {
|
||||||
|
final results = await searchNotes(trimmedQuery);
|
||||||
|
|
||||||
|
// Important: update the dialog state after search completes
|
||||||
|
dialogSetState(() {
|
||||||
|
_searchResults = results;
|
||||||
|
_isSearching = false;
|
||||||
|
});
|
||||||
|
} catch (e) {
|
||||||
|
debugPrint('Search error: $e');
|
||||||
|
dialogSetState(() {
|
||||||
|
_searchResults = [];
|
||||||
|
_isSearching = false;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
},
|
||||||
|
);
|
||||||
|
},
|
||||||
|
),
|
||||||
|
const SizedBox(height: 16),
|
||||||
|
_isSearching
|
||||||
|
? const Center(child: CircularProgressIndicator())
|
||||||
|
: Expanded(
|
||||||
|
child:
|
||||||
|
_searchResults.isEmpty
|
||||||
|
? const Center(
|
||||||
|
child: Text(
|
||||||
|
'No results. Try a different search term.',
|
||||||
|
),
|
||||||
|
)
|
||||||
|
: ListView.builder(
|
||||||
|
itemCount: _searchResults.length,
|
||||||
|
itemBuilder: (context, index) {
|
||||||
|
final note = _searchResults[index];
|
||||||
|
return Card(
|
||||||
|
margin: const EdgeInsets.only(
|
||||||
|
bottom:
|
||||||
|
6, // Reduced margin between cards
|
||||||
|
),
|
||||||
|
child: ListTile(
|
||||||
|
dense:
|
||||||
|
true, // Makes the ListTile more compact
|
||||||
|
contentPadding:
|
||||||
|
const EdgeInsets.symmetric(
|
||||||
|
horizontal: 12,
|
||||||
|
vertical: 2,
|
||||||
|
), // Tighter padding
|
||||||
|
title: Text(
|
||||||
|
note.date,
|
||||||
|
style: const TextStyle(
|
||||||
|
fontWeight: FontWeight.bold,
|
||||||
|
fontSize:
|
||||||
|
12, // Smaller font for date
|
||||||
|
),
|
||||||
|
),
|
||||||
|
subtitle:
|
||||||
|
note.snippet != null
|
||||||
|
? Text.rich(
|
||||||
|
TextSpan(
|
||||||
|
children:
|
||||||
|
_buildHighlightedText(
|
||||||
|
note.snippet!,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
)
|
||||||
|
: Text(
|
||||||
|
note.content.length > 200
|
||||||
|
? '${note.content.substring(0, 200)}...'
|
||||||
|
: note.content,
|
||||||
|
style: const TextStyle(
|
||||||
|
fontSize: 13,
|
||||||
|
), // Smaller font for content
|
||||||
|
),
|
||||||
|
isThreeLine: true,
|
||||||
|
onTap: () {
|
||||||
|
Navigator.of(context).pop();
|
||||||
|
this.setState(() {
|
||||||
|
_currentlyDisplayedNote = note;
|
||||||
|
_previousEntryController.text =
|
||||||
|
note.content;
|
||||||
|
});
|
||||||
|
_checkNavigation();
|
||||||
|
},
|
||||||
|
),
|
||||||
|
);
|
||||||
|
},
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
actions: [
|
||||||
|
TextButton(
|
||||||
|
onPressed: () {
|
||||||
|
Navigator.of(context).pop();
|
||||||
|
},
|
||||||
|
child: const Text('Close'),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
);
|
||||||
|
},
|
||||||
|
);
|
||||||
|
},
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Volume slider widget that uses a logarithmic scale
|
||||||
|
Widget _buildVolumeSlider() {
|
||||||
|
return Row(
|
||||||
|
mainAxisSize: MainAxisSize.min,
|
||||||
|
children: [
|
||||||
|
const Icon(Icons.volume_mute, size: 16),
|
||||||
|
SizedBox(
|
||||||
|
width: 100,
|
||||||
|
child: SliderTheme(
|
||||||
|
data: SliderTheme.of(context).copyWith(
|
||||||
|
trackHeight: 4.0,
|
||||||
|
thumbShape: const RoundSliderThumbShape(enabledThumbRadius: 8.0),
|
||||||
|
overlayShape: const RoundSliderOverlayShape(overlayRadius: 14.0),
|
||||||
|
),
|
||||||
|
child: Slider(
|
||||||
|
value: _volume,
|
||||||
|
min: 0.0,
|
||||||
|
max: 1.0,
|
||||||
|
divisions: 20, // More divisions for finer control
|
||||||
|
onChanged: (value) {
|
||||||
|
setState(() {
|
||||||
|
_volume = value;
|
||||||
|
});
|
||||||
|
_audioPlayer.setVolume(_linearToLogVolume(value));
|
||||||
|
},
|
||||||
|
onChangeEnd: (value) {
|
||||||
|
_saveVolume();
|
||||||
|
},
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
const Icon(Icons.volume_up, size: 16),
|
||||||
|
],
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
// Wrap Scaffold with RawKeyboardListener as workaround for Escape key
|
// Wrap Scaffold with RawKeyboardListener as workaround for Escape key
|
||||||
return RawKeyboardListener(
|
return RawKeyboardListener(
|
||||||
focusNode: FocusNode(), // Needs its own node
|
focusNode:
|
||||||
|
FocusNode()
|
||||||
|
..requestFocus(), // Request focus to ensure keyboard events are captured
|
||||||
onKey: (RawKeyEvent event) {
|
onKey: (RawKeyEvent event) {
|
||||||
if (event is RawKeyDownEvent &&
|
if (event is RawKeyDownEvent) {
|
||||||
event.logicalKey == LogicalKeyboardKey.escape) {
|
// Handle Escape to close window
|
||||||
|
if (event.logicalKey == LogicalKeyboardKey.escape) {
|
||||||
debugPrint(
|
debugPrint(
|
||||||
"Escape pressed inside MainPage (RawKeyboardListener - Workaround)",
|
"Escape pressed inside MainPage (RawKeyboardListener - Workaround)",
|
||||||
);
|
);
|
||||||
// Call method directly since we are in the state
|
// Call method directly since we are in the state
|
||||||
FocusManager.instance.primaryFocus?.unfocus(); // Keep unfocus attempt
|
FocusManager.instance.primaryFocus
|
||||||
|
?.unfocus(); // Keep unfocus attempt
|
||||||
onWindowClose();
|
onWindowClose();
|
||||||
}
|
}
|
||||||
|
// Handle Ctrl+F to open search
|
||||||
|
else if (event.logicalKey == LogicalKeyboardKey.keyF &&
|
||||||
|
(event.isControlPressed || event.isMetaPressed)) {
|
||||||
|
debugPrint("Ctrl+F pressed, opening search dialog");
|
||||||
|
_showSearchDialog();
|
||||||
|
}
|
||||||
|
}
|
||||||
},
|
},
|
||||||
child: Scaffold(
|
child: Scaffold(
|
||||||
appBar: AppBar(
|
appBar: AppBar(
|
||||||
title: const Text('Journaler'),
|
title: const Text('Journaler'),
|
||||||
actions: <Widget>[
|
actions: <Widget>[
|
||||||
|
// Add search button
|
||||||
|
IconButton(
|
||||||
|
icon: const Icon(Icons.search),
|
||||||
|
tooltip: 'Search Notes',
|
||||||
|
onPressed: _showSearchDialog,
|
||||||
|
),
|
||||||
// Group Label and Input for Interval
|
// Group Label and Input for Interval
|
||||||
Padding(
|
Padding(
|
||||||
padding: const EdgeInsets.symmetric(vertical: 8.0).copyWith(left: 8.0), // Add padding
|
padding: const EdgeInsets.symmetric(
|
||||||
|
vertical: 8.0,
|
||||||
|
).copyWith(left: 8.0), // Add padding
|
||||||
child: Row(
|
child: Row(
|
||||||
mainAxisSize: MainAxisSize.min, // Use minimum space
|
mainAxisSize: MainAxisSize.min, // Use minimum space
|
||||||
children: [
|
children: [
|
||||||
@@ -389,11 +910,14 @@ class MainPageState extends State<MainPage> with WindowListener {
|
|||||||
decoration: const InputDecoration(
|
decoration: const InputDecoration(
|
||||||
border: OutlineInputBorder(),
|
border: OutlineInputBorder(),
|
||||||
isDense: true,
|
isDense: true,
|
||||||
contentPadding: EdgeInsets.symmetric(horizontal: 8.0, vertical: 8.0),
|
contentPadding: EdgeInsets.symmetric(
|
||||||
|
horizontal: 8.0,
|
||||||
|
vertical: 8.0,
|
||||||
|
),
|
||||||
),
|
),
|
||||||
keyboardType: TextInputType.number,
|
keyboardType: TextInputType.number,
|
||||||
inputFormatters: <TextInputFormatter>[
|
inputFormatters: <TextInputFormatter>[
|
||||||
FilteringTextInputFormatter.digitsOnly
|
FilteringTextInputFormatter.digitsOnly,
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
@@ -402,7 +926,10 @@ class MainPageState extends State<MainPage> with WindowListener {
|
|||||||
),
|
),
|
||||||
// Group Label and Input for Sound
|
// Group Label and Input for Sound
|
||||||
Padding(
|
Padding(
|
||||||
padding: const EdgeInsets.symmetric(vertical: 8.0, horizontal: 8.0),
|
padding: const EdgeInsets.symmetric(
|
||||||
|
vertical: 8.0,
|
||||||
|
horizontal: 8.0,
|
||||||
|
),
|
||||||
child: Row(
|
child: Row(
|
||||||
mainAxisSize: MainAxisSize.min,
|
mainAxisSize: MainAxisSize.min,
|
||||||
children: [
|
children: [
|
||||||
@@ -416,7 +943,10 @@ class MainPageState extends State<MainPage> with WindowListener {
|
|||||||
decoration: const InputDecoration(
|
decoration: const InputDecoration(
|
||||||
border: OutlineInputBorder(),
|
border: OutlineInputBorder(),
|
||||||
isDense: true,
|
isDense: true,
|
||||||
contentPadding: EdgeInsets.symmetric(horizontal: 8.0, vertical: 8.0),
|
contentPadding: EdgeInsets.symmetric(
|
||||||
|
horizontal: 8.0,
|
||||||
|
vertical: 8.0,
|
||||||
|
),
|
||||||
hintText: 'sound.mp3',
|
hintText: 'sound.mp3',
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
@@ -424,6 +954,11 @@ class MainPageState extends State<MainPage> with WindowListener {
|
|||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
// Volume Control Slider
|
||||||
|
Padding(
|
||||||
|
padding: const EdgeInsets.symmetric(horizontal: 8.0),
|
||||||
|
child: _buildVolumeSlider(),
|
||||||
|
),
|
||||||
// Test Sound Button
|
// Test Sound Button
|
||||||
Padding(
|
Padding(
|
||||||
padding: const EdgeInsets.symmetric(vertical: 8.0),
|
padding: const EdgeInsets.symmetric(vertical: 8.0),
|
||||||
@@ -466,16 +1001,21 @@ class MainPageState extends State<MainPage> with WindowListener {
|
|||||||
children: [
|
children: [
|
||||||
Expanded(
|
Expanded(
|
||||||
child: Text(
|
child: Text(
|
||||||
_currentlyDisplayedNote?.date == previousNote?.date
|
_currentlyDisplayedNote?.date ==
|
||||||
|
previousNote?.date
|
||||||
? 'Previous Entry (Latest)'
|
? 'Previous Entry (Latest)'
|
||||||
: 'Entry: ${_currentlyDisplayedNote?.date ?? 'N/A'}',
|
: 'Entry: ${_currentlyDisplayedNote?.date ?? 'N/A'}',
|
||||||
style: TextStyle(fontSize: 18, color: Colors.grey),
|
style: TextStyle(
|
||||||
|
fontSize: 18,
|
||||||
|
color: Colors.grey,
|
||||||
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
IconButton(
|
IconButton(
|
||||||
icon: const Icon(Icons.arrow_back),
|
icon: const Icon(Icons.arrow_back),
|
||||||
tooltip: 'Previous Note',
|
tooltip: 'Previous Note',
|
||||||
onPressed: _canGoPrevious ? _goToPreviousNote : null,
|
onPressed:
|
||||||
|
_canGoPrevious ? _goToPreviousNote : null,
|
||||||
),
|
),
|
||||||
IconButton(
|
IconButton(
|
||||||
icon: const Icon(Icons.arrow_forward),
|
icon: const Icon(Icons.arrow_forward),
|
||||||
@@ -487,17 +1027,25 @@ class MainPageState extends State<MainPage> with WindowListener {
|
|||||||
Expanded(
|
Expanded(
|
||||||
child: TextField(
|
child: TextField(
|
||||||
controller: _previousEntryController,
|
controller: _previousEntryController,
|
||||||
readOnly: _currentlyDisplayedNote?.date != previousNote?.date,
|
readOnly:
|
||||||
|
_currentlyDisplayedNote?.date !=
|
||||||
|
previousNote?.date,
|
||||||
maxLines: null,
|
maxLines: null,
|
||||||
expands: true,
|
expands: true,
|
||||||
style: Theme.of(context).textTheme.bodyMedium,
|
style: Theme.of(context).textTheme.bodyMedium,
|
||||||
decoration: InputDecoration(
|
decoration: InputDecoration(
|
||||||
hintText: _currentlyDisplayedNote?.date != previousNote?.date
|
hintText:
|
||||||
|
_currentlyDisplayedNote?.date !=
|
||||||
|
previousNote?.date
|
||||||
? 'Viewing note from ${_currentlyDisplayedNote?.date} (Read-Only)'
|
? 'Viewing note from ${_currentlyDisplayedNote?.date} (Read-Only)'
|
||||||
: 'Latest Note',
|
: 'Latest Note',
|
||||||
border: const OutlineInputBorder(),
|
border: const OutlineInputBorder(),
|
||||||
filled: _currentlyDisplayedNote?.date != previousNote?.date,
|
filled:
|
||||||
fillColor: _currentlyDisplayedNote?.date != previousNote?.date
|
_currentlyDisplayedNote?.date !=
|
||||||
|
previousNote?.date,
|
||||||
|
fillColor:
|
||||||
|
_currentlyDisplayedNote?.date !=
|
||||||
|
previousNote?.date
|
||||||
? Colors.grey.withOpacity(0.1)
|
? Colors.grey.withOpacity(0.1)
|
||||||
: null,
|
: null,
|
||||||
),
|
),
|
||||||
@@ -528,10 +1076,11 @@ class MainPageState extends State<MainPage> with WindowListener {
|
|||||||
controller: _scratchController,
|
controller: _scratchController,
|
||||||
maxLines: null,
|
maxLines: null,
|
||||||
expands: true,
|
expands: true,
|
||||||
style: Theme.of(context).textTheme.bodyMedium, // Apply theme text style
|
style:
|
||||||
decoration: const InputDecoration(
|
Theme.of(
|
||||||
labelText: 'Scratch',
|
context,
|
||||||
),
|
).textTheme.bodyMedium, // Apply theme text style
|
||||||
|
decoration: const InputDecoration(labelText: 'Scratch'),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
|
@@ -3,8 +3,10 @@ import 'package:journaler/db.dart';
|
|||||||
class Note {
|
class Note {
|
||||||
final String date;
|
final String date;
|
||||||
String content;
|
String content;
|
||||||
|
String?
|
||||||
|
snippet; // Optional field to hold highlighted snippets for search results
|
||||||
|
|
||||||
Note({required this.date, required this.content});
|
Note({required this.date, required this.content, this.snippet});
|
||||||
}
|
}
|
||||||
|
|
||||||
class Scratch {
|
class Scratch {
|
||||||
@@ -100,3 +102,25 @@ Future<Note?> getNextNote(String currentDate) async {
|
|||||||
// This handles the case where the `currentDate` might not be the absolute latest.
|
// This handles the case where the `currentDate` might not be the absolute latest.
|
||||||
return getLatestNote();
|
return getLatestNote();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Search notes using full-text search
|
||||||
|
Future<List<Note>> searchNotes(String query) async {
|
||||||
|
if (query.isEmpty) {
|
||||||
|
return [];
|
||||||
|
}
|
||||||
|
|
||||||
|
// Call DB search function
|
||||||
|
final List<Map<String, dynamic>> results = await DB.searchNotes(query);
|
||||||
|
|
||||||
|
// Convert results to Note objects
|
||||||
|
return results
|
||||||
|
.map(
|
||||||
|
(result) => Note(
|
||||||
|
date: result['date'] as String,
|
||||||
|
content: result['content'] as String,
|
||||||
|
snippet:
|
||||||
|
result['snippet'] as String?, // Highlighted snippets from FTS
|
||||||
|
),
|
||||||
|
)
|
||||||
|
.toList();
|
||||||
|
}
|
||||||
|
90
pubspec.lock
90
pubspec.lock
@@ -1,6 +1,22 @@
|
|||||||
# Generated by pub
|
# Generated by pub
|
||||||
# See https://dart.dev/tools/pub/glossary#lockfile
|
# See https://dart.dev/tools/pub/glossary#lockfile
|
||||||
packages:
|
packages:
|
||||||
|
archive:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: archive
|
||||||
|
sha256: a7f37ff061d7abc2fcf213554b9dcaca713c5853afa5c065c44888bc9ccaf813
|
||||||
|
url: "https://pub.dev"
|
||||||
|
source: hosted
|
||||||
|
version: "4.0.6"
|
||||||
|
args:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: args
|
||||||
|
sha256: d0481093c50b1da8910eb0bb301626d4d8eb7284aa739614d2b394ee09e3ea04
|
||||||
|
url: "https://pub.dev"
|
||||||
|
source: hosted
|
||||||
|
version: "2.7.0"
|
||||||
async:
|
async:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
@@ -81,6 +97,22 @@ packages:
|
|||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "1.4.0"
|
version: "1.4.0"
|
||||||
|
checked_yaml:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: checked_yaml
|
||||||
|
sha256: feb6bed21949061731a7a75fc5d2aa727cf160b91af9a3e464c5e3a32e28b5ff
|
||||||
|
url: "https://pub.dev"
|
||||||
|
source: hosted
|
||||||
|
version: "2.0.3"
|
||||||
|
cli_util:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: cli_util
|
||||||
|
sha256: ff6785f7e9e3c38ac98b2fb035701789de90154024a75b6cb926445e83197d1c
|
||||||
|
url: "https://pub.dev"
|
||||||
|
source: hosted
|
||||||
|
version: "0.4.2"
|
||||||
clock:
|
clock:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
@@ -142,6 +174,14 @@ packages:
|
|||||||
description: flutter
|
description: flutter
|
||||||
source: sdk
|
source: sdk
|
||||||
version: "0.0.0"
|
version: "0.0.0"
|
||||||
|
flutter_launcher_icons:
|
||||||
|
dependency: "direct dev"
|
||||||
|
description:
|
||||||
|
name: flutter_launcher_icons
|
||||||
|
sha256: "526faf84284b86a4cb36d20a5e45147747b7563d921373d4ee0559c54fcdbcea"
|
||||||
|
url: "https://pub.dev"
|
||||||
|
source: hosted
|
||||||
|
version: "0.13.1"
|
||||||
flutter_lints:
|
flutter_lints:
|
||||||
dependency: "direct dev"
|
dependency: "direct dev"
|
||||||
description:
|
description:
|
||||||
@@ -176,6 +216,14 @@ packages:
|
|||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "4.1.2"
|
version: "4.1.2"
|
||||||
|
image:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: image
|
||||||
|
sha256: "4e973fcf4caae1a4be2fa0a13157aa38a8f9cb049db6529aa00b4d71abc4d928"
|
||||||
|
url: "https://pub.dev"
|
||||||
|
source: hosted
|
||||||
|
version: "4.5.4"
|
||||||
json_annotation:
|
json_annotation:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
@@ -241,7 +289,7 @@ packages:
|
|||||||
source: hosted
|
source: hosted
|
||||||
version: "1.16.0"
|
version: "1.16.0"
|
||||||
path:
|
path:
|
||||||
dependency: transitive
|
dependency: "direct main"
|
||||||
description:
|
description:
|
||||||
name: path
|
name: path
|
||||||
sha256: "75cca69d1490965be98c73ceaea117e8a04dd21217b37b292c9ddbec0d955bc5"
|
sha256: "75cca69d1490965be98c73ceaea117e8a04dd21217b37b292c9ddbec0d955bc5"
|
||||||
@@ -296,6 +344,14 @@ packages:
|
|||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "2.3.0"
|
version: "2.3.0"
|
||||||
|
petitparser:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: petitparser
|
||||||
|
sha256: "07c8f0b1913bcde1ff0d26e57ace2f3012ccbf2b204e070290dad3bb22797646"
|
||||||
|
url: "https://pub.dev"
|
||||||
|
source: hosted
|
||||||
|
version: "6.1.0"
|
||||||
platform:
|
platform:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
@@ -312,6 +368,22 @@ packages:
|
|||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "2.1.8"
|
version: "2.1.8"
|
||||||
|
posix:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: posix
|
||||||
|
sha256: f0d7856b6ca1887cfa6d1d394056a296ae33489db914e365e2044fdada449e62
|
||||||
|
url: "https://pub.dev"
|
||||||
|
source: hosted
|
||||||
|
version: "6.0.2"
|
||||||
|
ps_list:
|
||||||
|
dependency: "direct main"
|
||||||
|
description:
|
||||||
|
name: ps_list
|
||||||
|
sha256: "19d32f6c643313cf4f5101bb144b8978b9ba3dc42c9a01b247e8ed90581bc0ab"
|
||||||
|
url: "https://pub.dev"
|
||||||
|
source: hosted
|
||||||
|
version: "0.0.5"
|
||||||
screen_retriever:
|
screen_retriever:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
@@ -501,6 +573,22 @@ packages:
|
|||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "1.1.0"
|
version: "1.1.0"
|
||||||
|
xml:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: xml
|
||||||
|
sha256: b015a8ad1c488f66851d762d3090a21c600e479dc75e68328c52774040cf9226
|
||||||
|
url: "https://pub.dev"
|
||||||
|
source: hosted
|
||||||
|
version: "6.5.0"
|
||||||
|
yaml:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: yaml
|
||||||
|
sha256: b9da305ac7c39faa3f030eccd175340f968459dae4af175130b3fc47e40d76ce
|
||||||
|
url: "https://pub.dev"
|
||||||
|
source: hosted
|
||||||
|
version: "3.1.3"
|
||||||
sdks:
|
sdks:
|
||||||
dart: ">=3.7.2 <4.0.0"
|
dart: ">=3.7.2 <4.0.0"
|
||||||
flutter: ">=3.27.0"
|
flutter: ">=3.27.0"
|
||||||
|
12
pubspec.yaml
12
pubspec.yaml
@@ -38,10 +38,13 @@ dependencies:
|
|||||||
window_manager: ^0.4.3
|
window_manager: ^0.4.3
|
||||||
audioplayers: ^6.4.0
|
audioplayers: ^6.4.0
|
||||||
sqflite_common_ffi: ^2.3.5
|
sqflite_common_ffi: ^2.3.5
|
||||||
|
path: ^1.8.0
|
||||||
|
ps_list: ^0.0.5
|
||||||
|
|
||||||
dev_dependencies:
|
dev_dependencies:
|
||||||
flutter_test:
|
flutter_test:
|
||||||
sdk: flutter
|
sdk: flutter
|
||||||
|
flutter_launcher_icons: ^0.13.1
|
||||||
|
|
||||||
# The "flutter_lints" package below contains a set of recommended lints to
|
# The "flutter_lints" package below contains a set of recommended lints to
|
||||||
# encourage good coding practices. The lint set provided by the package is
|
# encourage good coding practices. The lint set provided by the package is
|
||||||
@@ -93,3 +96,12 @@ flutter:
|
|||||||
#
|
#
|
||||||
# For details regarding fonts from package dependencies,
|
# For details regarding fonts from package dependencies,
|
||||||
# see https://flutter.dev/to/font-from-package
|
# see https://flutter.dev/to/font-from-package
|
||||||
|
|
||||||
|
flutter_launcher_icons:
|
||||||
|
android: true
|
||||||
|
ios: true
|
||||||
|
image_path: "assets/app_icon.ico"
|
||||||
|
windows:
|
||||||
|
generate: true
|
||||||
|
image_path: "assets/app_icon.ico"
|
||||||
|
icon_size: 256 # min: 48, max: 256, default: 48
|
||||||
|
BIN
windows/runner/resources/app_icon.ico
(Stored with Git LFS)
BIN
windows/runner/resources/app_icon.ico
(Stored with Git LFS)
Binary file not shown.
Reference in New Issue
Block a user