File tree 5 files changed +33
-3
lines changed
5 files changed +33
-3
lines changed Original file line number Diff line number Diff line change
1
+ import 'package:flutter/material.dart' ;
2
+
3
+ class SnackBarNotification extends StatelessWidget {
4
+ final String message;
5
+
6
+ const SnackBarNotification ({
7
+ super .key,
8
+ required this .message,
9
+ });
10
+
11
+ @override
12
+ Widget build (BuildContext context) {
13
+ return SnackBar (
14
+ content: Text (message),
15
+ );
16
+ }
17
+
18
+ static void show (BuildContext context, {required String message}) {
19
+ ScaffoldMessenger .of (context).showSnackBar (
20
+ SnackBar (
21
+ content: Text (message),
22
+ ),
23
+ );
24
+ }
25
+ }
Original file line number Diff line number Diff line change @@ -21,6 +21,7 @@ import 'package:saber/components/canvas/canvas_preview.dart';
21
21
import 'package:saber/components/canvas/image/editor_image.dart' ;
22
22
import 'package:saber/components/canvas/save_indicator.dart' ;
23
23
import 'package:saber/components/navbar/responsive_navbar.dart' ;
24
+ import 'package:saber/components/notifs/snackbar.dart' ;
24
25
import 'package:saber/components/theming/adaptive_alert_dialog.dart' ;
25
26
import 'package:saber/components/theming/adaptive_icon.dart' ;
26
27
import 'package:saber/components/theming/dynamic_material_app.dart' ;
@@ -1731,9 +1732,7 @@ class EditorState extends State<Editor> {
1731
1732
1732
1733
void snackBarNeedsToSaveBeforeExiting () {
1733
1734
if (! mounted) return ;
1734
- ScaffoldMessenger .of (context).showSnackBar (SnackBar (
1735
- content: Text (t.editor.needsToSaveBeforeExiting),
1736
- ));
1735
+ SnackBarNotification .show (context, message: t.editor.needsToSaveBeforeExiting);
1737
1736
}
1738
1737
1739
1738
Widget bottomSheet (BuildContext context) {
Original file line number Diff line number Diff line change @@ -6,6 +6,7 @@ import FlutterMacOS
6
6
import Foundation
7
7
8
8
import audioplayers_darwin
9
+ import connectivity_plus
9
10
import desktop_webview_window
10
11
import device_info_plus
11
12
import dynamic_color
@@ -24,6 +25,7 @@ import window_to_front
24
25
25
26
func RegisterGeneratedPlugins( registry: FlutterPluginRegistry ) {
26
27
AudioplayersDarwinPlugin . register ( with: registry. registrar ( forPlugin: " AudioplayersDarwinPlugin " ) )
28
+ ConnectivityPlusPlugin . register ( with: registry. registrar ( forPlugin: " ConnectivityPlusPlugin " ) )
27
29
DesktopWebviewWindowPlugin . register ( with: registry. registrar ( forPlugin: " DesktopWebviewWindowPlugin " ) )
28
30
DeviceInfoPlusMacosPlugin . register ( with: registry. registrar ( forPlugin: " DeviceInfoPlusMacosPlugin " ) )
29
31
DynamicColorPlugin . register ( with: registry. registrar ( forPlugin: " DynamicColorPlugin " ) )
Original file line number Diff line number Diff line change 7
7
#include " generated_plugin_registrant.h"
8
8
9
9
#include < audioplayers_windows/audioplayers_windows_plugin.h>
10
+ #include < connectivity_plus/connectivity_plus_windows_plugin.h>
10
11
#include < desktop_webview_window/desktop_webview_window_plugin.h>
11
12
#include < dynamic_color/dynamic_color_plugin_c_api.h>
12
13
#include < flutter_secure_storage_windows/flutter_secure_storage_windows_plugin.h>
23
24
void RegisterPlugins (flutter::PluginRegistry* registry) {
24
25
AudioplayersWindowsPluginRegisterWithRegistrar (
25
26
registry->GetRegistrarForPlugin (" AudioplayersWindowsPlugin" ));
27
+ ConnectivityPlusWindowsPluginRegisterWithRegistrar (
28
+ registry->GetRegistrarForPlugin (" ConnectivityPlusWindowsPlugin" ));
26
29
DesktopWebviewWindowPluginRegisterWithRegistrar (
27
30
registry->GetRegistrarForPlugin (" DesktopWebviewWindowPlugin" ));
28
31
DynamicColorPluginCApiRegisterWithRegistrar (
Original file line number Diff line number Diff line change 4
4
5
5
list (APPEND FLUTTER_PLUGIN_LIST
6
6
audioplayers_windows
7
+ connectivity_plus
7
8
desktop_webview_window
8
9
dynamic_color
9
10
flutter_secure_storage_windows
You can’t perform that action at this time.
0 commit comments