1234567891011121314151617181920212223242526272829303132 |
- import 'package:flowy_editor/service/render_plugin_service.dart';
- import 'package:flowy_editor/service/toolbar_service.dart';
- import 'package:flowy_editor/service/selection_service.dart';
- import 'package:flutter/material.dart';
- class FlowyService {
- // selection service
- final selectionServiceKey = GlobalKey(debugLabel: 'flowy_selection_service');
- FlowySelectionService get selectionService {
- assert(selectionServiceKey.currentState != null &&
- selectionServiceKey.currentState is FlowySelectionService);
- return selectionServiceKey.currentState! as FlowySelectionService;
- }
- // keyboard service
- final keyboardServiceKey = GlobalKey(debugLabel: 'flowy_keyboard_service');
- // input service
- final inputServiceKey = GlobalKey(debugLabel: 'flowy_input_service');
- // render plugin service
- late FlowyRenderPlugin renderPluginService;
- // floating shortcut service
- final toolbarServiceKey =
- GlobalKey(debugLabel: 'flowy_floating_shortcut_service');
- ToolbarService get toolbarService {
- assert(toolbarServiceKey.currentState != null &&
- toolbarServiceKey.currentState is ToolbarService);
- return toolbarServiceKey.currentState! as ToolbarService;
- }
- }
|