The ultimate harness for coding agents and beyond. All your agents. All your machines. One command center. Start with code, then follow your curiosity and build across disciplines: CAD, circuits, robots, games and music.
TypeScript 3d-modelingagent-frameworkagent-harnessai-agentscadclaude-codecodexcoding-agentsdeveloper-toolsesp32game-developmentmcp-servermulti-agentopen-hardwareopencodeopenharnesspcbroboticsterminaltmux
import 'package:flutter/widgets.dart';
class KeyboardVisibilty extends StatefulWidget {
const KeyboardVisibilty({
super.key,
required this.child,
this.onKeyboardShow,
this.onKeyboardHide,
});
final Widget child;
final VoidCallback? onKeyboardShow;
final VoidCallback? onKeyboardHide;
@override
KeyboardVisibiltyState createState() => KeyboardVisibiltyState();
}
class KeyboardVisibiltyState extends State<KeyboardVisibilty>
with WidgetsBindingObserver {
@override
void initState() {
super.initState();
WidgetsBinding.instance.addObserver(this);
}
@override
void dispose() {
WidgetsBinding.instance.removeObserver(this);
super.dispose();
}
@override
void didChangeMetrics() {
final bottomInset = View.of(context).viewInsets.bottom;
if (bottomInset != _lastBottomInset) {
if (bottomInset > 0) {
widget.onKeyboardShow?.call();
} else {
widget.onKeyboardHide?.call();
}
}
_lastBottomInset = bottomInset;
super.didChangeMetrics();
}
var _lastBottomInset = 0.0;
@override
Widget build(BuildContext context) {
return widget.child;
}
}