Remove tablet layout

This commit is contained in:
Hillel Coren 2020-06-09 18:27:45 +03:00
parent 0c42fe5081
commit 4eb2df053e
4 changed files with 2 additions and 14 deletions

View File

@ -75,8 +75,6 @@ abstract class PrefState implements Built<PrefState, PrefStateBuilder> {
bool get isNotDesktop => !isDesktop; bool get isNotDesktop => !isDesktop;
bool get isTablet => appLayout == AppLayout.tablet;
bool get isMobile => appLayout == AppLayout.mobile; bool get isMobile => appLayout == AppLayout.mobile;
bool get isNotMobile => !isMobile; bool get isNotMobile => !isMobile;
@ -135,7 +133,6 @@ class AppLayout extends EnumClass {
static Serializer<AppLayout> get serializer => _$appLayoutSerializer; static Serializer<AppLayout> get serializer => _$appLayoutSerializer;
static const AppLayout mobile = _$mobile; static const AppLayout mobile = _$mobile;
static const AppLayout tablet = _$tablet;
static const AppLayout desktop = _$desktop; static const AppLayout desktop = _$desktop;
static BuiltSet<AppLayout> get values => _$values; static BuiltSet<AppLayout> get values => _$values;

View File

@ -34,7 +34,7 @@ class _ChangeLayoutBannerState extends State<ChangeLayoutBanner> {
final store = StoreProvider.of<AppState>(context); final store = StoreProvider.of<AppState>(context);
final localization = AppLocalization.of(context); final localization = AppLocalization.of(context);
final calculatedLayout = calculateLayout(context, breakOutTablet: true); final calculatedLayout = calculateLayout(context);
String message; String message;
if (!_dismissedChange) { if (!_dismissedChange) {

View File

@ -60,10 +60,6 @@ class _DeviceSettingsState extends State<DeviceSettings> {
child: Text(localization.desktop), child: Text(localization.desktop),
value: AppLayout.desktop, value: AppLayout.desktop,
), ),
DropdownMenuItem(
child: Text(localization.tablet),
value: AppLayout.tablet,
),
DropdownMenuItem( DropdownMenuItem(
child: Text(localization.mobile), child: Text(localization.mobile),
value: AppLayout.mobile, value: AppLayout.mobile,

View File

@ -41,15 +41,12 @@ String getAppURL(BuildContext context) {
} }
AppLayout calculateLayout(BuildContext context, {bool breakOutTablet = false}) { AppLayout calculateLayout(BuildContext context) {
final size = MediaQuery.of(context).size.width; final size = MediaQuery.of(context).size.width;
if (size < kMobileLayoutWidth) { if (size < kMobileLayoutWidth) {
return AppLayout.mobile; return AppLayout.mobile;
} else { } else {
if (breakOutTablet && size < kTabletLayoutWidth) {
return AppLayout.tablet;
}
return AppLayout.desktop; return AppLayout.desktop;
} }
} }
@ -62,8 +59,6 @@ bool isMobile(BuildContext context) => getLayout(context) == AppLayout.mobile;
bool isNotMobile(BuildContext context) => !isMobile(context); bool isNotMobile(BuildContext context) => !isMobile(context);
bool isTablet(BuildContext context) => getLayout(context) == AppLayout.tablet;
bool isDesktop(BuildContext context) => getLayout(context) == AppLayout.desktop; bool isDesktop(BuildContext context) => getLayout(context) == AppLayout.desktop;
bool isNotDesktop(BuildContext context) => !isDesktop(context); bool isNotDesktop(BuildContext context) => !isDesktop(context);