feat: add elastic glass dock motion and Android tablet layouts

This commit is contained in:
david1465833828
2026-10-28 11:09:43 +08:00
parent fbcb7fb637
commit 9da5864d29
16 changed files with 1321 additions and 874 deletions
+28
View File
@@ -0,0 +1,28 @@
import 'dart:math' as math;
import 'package:flutter/widgets.dart';
/// Fits the current window, retaining child state during split-screen resizing.
class AdaptivePage extends StatelessWidget {
const AdaptivePage({super.key, required this.child, this.maxWidth = 840});
final Widget child;
final double maxWidth;
@override
Widget build(BuildContext context) => LayoutBuilder(
builder: (context, constraints) {
final width = constraints.maxWidth;
final contentWidth = width >= 600
? math.min(maxWidth, width - 32)
: width;
return Align(
alignment: Alignment.topCenter,
child: SizedBox(
width: contentWidth,
height: constraints.maxHeight,
child: child,
),
);
},
);
}