-
-
Notifications
You must be signed in to change notification settings - Fork 4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* fix: lose focus in editor on open settings dialog * fix: support CTRL+. for sidebar toggle * fix: make notify method private * fix: copy for video block * fix: copy for notification setting * fix: add libmpv to appimage builder * fix: missing tabs bloc from context * ci: add libmpv-dev to missing workflows * fix: do not depend on inherited widget in dispose * test: add media kit ensureInitialized to integration tests * fix: use maybeOf for AFFocusManager * fix: use pattern matching for youtube error * fix: missed null-promise on convertion
- Loading branch information
Showing
15 changed files
with
221 additions
and
111 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
40 changes: 40 additions & 0 deletions
40
frontend/appflowy_flutter/lib/workspace/presentation/home/af_focus_manager.dart
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
import 'package:flutter/material.dart'; | ||
|
||
/// Simple ChangeNotifier that can be listened to, notifies the | ||
/// application on events that should trigger focus loss. | ||
/// | ||
/// Eg. lose focus in AppFlowyEditor | ||
/// | ||
abstract class ShouldLoseFocus with ChangeNotifier {} | ||
|
||
/// Private implementation to allow the [AFFocusManager] to | ||
/// call [notifyListeners] without being directly invokable. | ||
/// | ||
class _ShouldLoseFocusImpl extends ShouldLoseFocus { | ||
void notify() => notifyListeners(); | ||
} | ||
|
||
class AFFocusManager extends InheritedWidget { | ||
AFFocusManager({super.key, required super.child}); | ||
|
||
final ShouldLoseFocus loseFocusNotifier = _ShouldLoseFocusImpl(); | ||
|
||
void notifyLoseFocus() { | ||
(loseFocusNotifier as _ShouldLoseFocusImpl).notify(); | ||
} | ||
|
||
@override | ||
bool updateShouldNotify(covariant InheritedWidget oldWidget) => false; | ||
|
||
static AFFocusManager of(BuildContext context) { | ||
final AFFocusManager? result = | ||
context.dependOnInheritedWidgetOfExactType<AFFocusManager>(); | ||
|
||
assert(result != null, "AFFocusManager could not be found"); | ||
return result!; | ||
} | ||
|
||
static AFFocusManager? maybeOf(BuildContext context) { | ||
return context.dependOnInheritedWidgetOfExactType<AFFocusManager>(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.