-
Notifications
You must be signed in to change notification settings - Fork 57
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
45 changed files
with
2,836 additions
and
24 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import 'package:flutter/services.dart'; | ||
|
||
extension KeyEventExtension on KeyEvent { | ||
bool isCtrlF(Set<LogicalKeyboardKey> logicalKeysPressed) { | ||
if (physicalKey != PhysicalKeyboardKey.keyF || | ||
logicalKey != LogicalKeyboardKey.keyF) { | ||
return false; | ||
} | ||
|
||
final isMetaOrControlPressed = | ||
logicalKeysPressed.contains(LogicalKeyboardKey.metaLeft) || | ||
logicalKeysPressed.contains(LogicalKeyboardKey.metaRight) || | ||
logicalKeysPressed.contains(LogicalKeyboardKey.controlLeft) || | ||
logicalKeysPressed.contains(LogicalKeyboardKey.controlRight); | ||
|
||
return isMetaOrControlPressed; | ||
} | ||
} |
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,18 @@ | ||
import 'package:flutter/material.dart'; | ||
|
||
import '../code_controller.dart'; | ||
|
||
class CustomDismissAction extends Action<DismissIntent> { | ||
final CodeController controller; | ||
|
||
CustomDismissAction({ | ||
required this.controller, | ||
}); | ||
|
||
@override | ||
Object? invoke(DismissIntent intent) { | ||
controller.dismiss(); | ||
|
||
return null; | ||
} | ||
} |
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,20 @@ | ||
import 'package:flutter/material.dart'; | ||
|
||
import '../code_controller.dart'; | ||
|
||
class EnterKeyIntent extends Intent { | ||
const EnterKeyIntent(); | ||
} | ||
|
||
class EnterKeyAction extends Action<EnterKeyIntent> { | ||
final CodeController controller; | ||
EnterKeyAction({ | ||
required this.controller, | ||
}); | ||
|
||
@override | ||
Object? invoke(EnterKeyIntent intent) { | ||
controller.onEnterKeyAction(); | ||
return null; | ||
} | ||
} |
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,22 @@ | ||
import 'package:flutter/cupertino.dart'; | ||
|
||
import '../code_controller.dart'; | ||
|
||
class SearchIntent extends Intent { | ||
const SearchIntent(); | ||
} | ||
|
||
class SearchAction extends Action<SearchIntent> { | ||
final CodeController controller; | ||
|
||
SearchAction({ | ||
required this.controller, | ||
}); | ||
|
||
@override | ||
Object? invoke(SearchIntent intent) { | ||
controller.showSearch(); | ||
|
||
return null; | ||
} | ||
} |
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.