responsive_layout_builder
화면 크기와 방향에 따라 반응형 레이아웃을 구축하기 위한 Flutter 패키지입니다. 손목 시계, 소형/중형/대형 모바일, 소형/대형 태블릿 또는 데스크톱에 사용할 수 있습니다.
화면 크기와 방향에 따라 반응형 레이아웃을 구축하기 위한 Flutter 패키지입니다. 손목 시계, 소형/중형/대형 모바일, 소형/대형 태블릿 또는 데스크톱에 사용할 수 있습니다.
{"sdk":"flutter"}^1.11.0{"sdk":"flutter"}아래는 영문 원문 스냅샷입니다. 최신 내용은 GitHub에서 확인하세요.
Flutter package for building responsive layout based on screen sizes and orientation. It could be wristwatch, small/medium/large mobile, small/large tablet or desktop.
ResponsiveLayoutBuilder could be used as usual widget builder such as LayoutBuilder or OrientationBuilder, etc.
ResponsiveLayoutBuilder(
builder: (context, screenSize) {
// Use size argument to build size dependent widgets
},
),
size property within screenSize stores LayoutSize which could be watch, mobile, tablet, desktop or tv.
mobile property within screenSize stores MobileLayoutSize which could be small, medium or large.
tablet property within screenSize stores TabletLayoutSize which could be small or large.
For using functional approach to retrieve current size use following:
// for getting mobile layout size
getMobileLayoutSize(width: MediaQuery.of(context).size.width);
// for getting tablet layout size
getTabletLayoutSize(width: MediaQuery.of(context).size.width);
// for getting screen size based on width
getScreenSize(width: MediaQuery.of(context).size.width);
// for getting screen size based on context
getContextualScreenSize(context: context);
If you need to specify ScreenSizeSettings for all above functions sizes argument is needed to be passed, like this:
sizes: ScreenSizeSettings(...)
For getScreenSize and getContextualScreenSize could be specified also orientation and defaultSize.