Skip to content

Commit

Permalink
add something
Browse files Browse the repository at this point in the history
  • Loading branch information
DargonLee committed Jan 8, 2025
1 parent 02105d5 commit f3ab016
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 2 deletions.
1 change: 1 addition & 0 deletions devtools_options.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
description: This file stores settings for Dart & Flutter DevTools.
documentation: https://docs.flutter.dev/tools/devtools/extensions#configure-extension-enablement-states
extensions:
- provider: true
3 changes: 2 additions & 1 deletion lib/db/database_helper.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import 'dart:io';
import 'dart:developer' as developer;
import 'package:path_provider/path_provider.dart';
import 'package:sqflite_common_ffi/sqflite_ffi.dart';
import 'package:easy_pasta/model/pasteboard_model.dart';
Expand Down Expand Up @@ -65,7 +66,7 @@ class DatabaseHelper implements IDatabaseHelper {
try {
sqfliteFfiInit();
final path = await _getDatabasePath();
print('db path: $path');
developer.log('db path: $path');
final databaseFactory = databaseFactoryFfi;

return await databaseFactory.openDatabase(
Expand Down
6 changes: 6 additions & 0 deletions lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,12 @@ import 'package:provider/provider.dart';
void main() async {
WidgetsFlutterBinding.ensureInitialized();

// 添加错误处理
FlutterError.onError = (FlutterErrorDetails details) {
debugPrint('Flutter error: ${details.exception}');
debugPrint('Stack trace: ${details.stack}');
};

final windowService = WindowService();
await windowService.init();

Expand Down
4 changes: 3 additions & 1 deletion lib/page/home_page_view.dart
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,9 @@ class _MyHomePageState extends State<MyHomePage>
}

@override
void onTrayIconMouseDown() => WindowService().showWindow();
void onTrayIconMouseDown() {
WindowService().showWindow();
}

@override
void onWindowBlur() => WindowService().hideWindow();
Expand Down

0 comments on commit f3ab016

Please sign in to comment.