From 3e4bacb7b939b1de98a2fb07115f638750637357 Mon Sep 17 00:00:00 2001 From: Paul Buetow Date: Fri, 8 May 2026 00:05:39 +0300 Subject: Rewrite as Flutter app and rename to Quicklog Drop the Go/Fyne implementation and replace it with a native Flutter app targeting Android (primary) and Linux desktop (development). Rename quicklogger -> quicklog throughout (project, applicationId, MethodChannel, cache filename, AppBar title, Linux binary). Storage on Android moves to /Android/data/org.buetow.quicklog/files/ so MANAGE_EXTERNAL_STORAGE is no longer required. Share-intent receive is preserved via a Kotlin ShareActivity that writes shared text to the app cache, which Dart reads through a MethodChannel on app resume; MainActivity also accepts SEND directly so launchers that prefer the main target work. New since the Fyne version: an entry browser screen with read-only viewer and long-press delete. Cross-compiling to Android ARM from amd64 Linux no longer needs Docker / fyne-cross / NDK -- flutter build apk emits ARM binaries directly. Co-Authored-By: Claude Opus 4.7 --- lib/screens/preferences_screen.dart | 96 +++++++++++++++++++++++++++++++++++++ 1 file changed, 96 insertions(+) create mode 100644 lib/screens/preferences_screen.dart (limited to 'lib/screens/preferences_screen.dart') diff --git a/lib/screens/preferences_screen.dart b/lib/screens/preferences_screen.dart new file mode 100644 index 0000000..842b6cc --- /dev/null +++ b/lib/screens/preferences_screen.dart @@ -0,0 +1,96 @@ +import 'package:flutter/material.dart'; + +import '../services/preferences.dart'; +import '../services/storage.dart'; + +class PreferencesScreen extends StatefulWidget { + const PreferencesScreen({super.key}); + + @override + State createState() => _PreferencesScreenState(); +} + +class _PreferencesScreenState extends State { + final PreferencesService _prefs = PreferencesService(); + final TextEditingController _dirController = TextEditingController(); + bool _autoLog = false; + bool _loaded = false; + + @override + void initState() { + super.initState(); + _load(); + } + + Future _load() async { + _dirController.text = await _prefs.directory(); + _autoLog = await _prefs.autoLogSharedText(); + if (!mounted) return; + setState(() => _loaded = true); + } + + Future _resetToDefault() async { + _dirController.text = await defaultLogDirectory(); + setState(() {}); + } + + Future _save() async { + await _prefs.setDirectory(_dirController.text); + await _prefs.setAutoLogSharedText(_autoLog); + if (!mounted) return; + Navigator.of(context).pop(); + } + + @override + void dispose() { + _dirController.dispose(); + super.dispose(); + } + + @override + Widget build(BuildContext context) { + if (!_loaded) { + return const Scaffold(body: Center(child: CircularProgressIndicator())); + } + return Scaffold( + appBar: AppBar( + title: const Text('Preferences'), + actions: [ + IconButton( + tooltip: 'Save', + icon: const Icon(Icons.check), + onPressed: _save, + ), + ], + ), + body: ListView( + padding: const EdgeInsets.all(12), + children: [ + const Text('Directory:', style: TextStyle(fontWeight: FontWeight.bold)), + const SizedBox(height: 4), + TextField( + controller: _dirController, + decoration: InputDecoration( + border: const OutlineInputBorder(), + suffixIcon: IconButton( + tooltip: 'Reset to default', + icon: const Icon(Icons.restore), + onPressed: _resetToDefault, + ), + ), + ), + const SizedBox(height: 16), + SwitchListTile( + title: const Text('Auto-log shared text'), + subtitle: const Text( + 'When enabled, text shared from other apps is logged immediately ' + 'instead of prefilled into the editor.', + ), + value: _autoLog, + onChanged: (v) => setState(() => _autoLog = v), + ), + ], + ), + ); + } +} -- cgit v1.2.3