[flutter]: config initial scrren size

This commit is contained in:
appflowy 2021-10-11 09:05:53 +08:00
parent ae82e052f2
commit 1a10f58e6f
4 changed files with 25 additions and 6 deletions

View File

@ -29,7 +29,9 @@ class ApplicationWidget extends StatelessWidget {
@override
Widget build(BuildContext context) {
setWindowMinSize(const Size(500, 500));
const ratio = 1.73;
setWindowMinSize(const Size(500, 500 / ratio));
setWindowFrame(const Rect.fromLTRB(0, 0, 1310, 1310 / ratio));
final theme = AppTheme.fromType(ThemeType.light);
return Provider.value(

View File

@ -17,8 +17,7 @@ class HomeLayout {
late double homePageROffset;
late Duration animDuration;
HomeLayout(BuildContext context, BoxConstraints homeScreenConstraint,
bool forceCollapse) {
HomeLayout(BuildContext context, BoxConstraints homeScreenConstraint, bool forceCollapse) {
final homeBlocState = context.read<HomeBloc>().state;
showEditPannel = homeBlocState.editContext.isSome();

View File

@ -86,6 +86,26 @@ class FlowyNavigation extends StatelessWidget {
}
}
class IconNaviItemWidget extends StatelessWidget {
final NavigationItem item;
const IconNaviItemWidget(this.item, {Key? key}) : super(key: key);
@override
Widget build(BuildContext context) {
return SizedBox(
height: 24,
child: FlowyTextButton(
item.title,
padding: const EdgeInsets.symmetric(horizontal: 8, vertical: 2),
fontSize: 12,
onPressed: () {
debugPrint('show app document');
},
),
);
}
}
class NaviItemWidget extends StatelessWidget {
final NavigationItem item;
const NaviItemWidget(this.item, {Key? key}) : super(key: key);

View File

@ -52,9 +52,7 @@ class Sizes {
static double get iconMed => 20;
static double get sideBarSm => 200 * hitScale;
static double get sideBarMed => 240 * hitScale;
static double get sideBarMed => 225 * hitScale;
static double get sideBarLg => 290 * hitScale;
}