format and fix

This commit is contained in:
2026-02-24 23:01:11 +01:00
parent 1bb9241116
commit 81a6daaa75
17 changed files with 133 additions and 59 deletions

View File

@@ -31,12 +31,14 @@ type FlutterViewProps = {
state: Record<string, unknown>;
onEvent: (event: { type: string; payload?: Record<string, unknown> }) => void;
className?: string;
height?: number;
};
export function FlutterView({
state,
onEvent,
className,
height,
}: FlutterViewProps) {
const containerRef = useRef<HTMLDivElement>(null);
const [status, setStatus] = useState<"loading" | "ready" | "error">(
@@ -142,7 +144,7 @@ export function FlutterView({
}, [state]);
return (
<div className={className} style={{ height: "100%", position: "relative" }}>
<div className={className} style={{ position: "relative" }}>
{status === "loading" && (
<div
style={{
@@ -170,7 +172,10 @@ export function FlutterView({
Failed to load Flutter view
</div>
)}
<div ref={containerRef} style={{ width: "100%", height: "100%" }} />
<div
ref={containerRef}
style={{ width: "100%", height: height ?? 400 }}
/>
</div>
);
}