Remove tablet layout
This commit is contained in:
parent
0c42fe5081
commit
4eb2df053e
|
|
@ -75,8 +75,6 @@ abstract class PrefState implements Built<PrefState, PrefStateBuilder> {
|
|||
|
||||
bool get isNotDesktop => !isDesktop;
|
||||
|
||||
bool get isTablet => appLayout == AppLayout.tablet;
|
||||
|
||||
bool get isMobile => appLayout == AppLayout.mobile;
|
||||
|
||||
bool get isNotMobile => !isMobile;
|
||||
|
|
@ -135,7 +133,6 @@ class AppLayout extends EnumClass {
|
|||
static Serializer<AppLayout> get serializer => _$appLayoutSerializer;
|
||||
|
||||
static const AppLayout mobile = _$mobile;
|
||||
static const AppLayout tablet = _$tablet;
|
||||
static const AppLayout desktop = _$desktop;
|
||||
|
||||
static BuiltSet<AppLayout> get values => _$values;
|
||||
|
|
|
|||
|
|
@ -34,7 +34,7 @@ class _ChangeLayoutBannerState extends State<ChangeLayoutBanner> {
|
|||
final store = StoreProvider.of<AppState>(context);
|
||||
final localization = AppLocalization.of(context);
|
||||
|
||||
final calculatedLayout = calculateLayout(context, breakOutTablet: true);
|
||||
final calculatedLayout = calculateLayout(context);
|
||||
String message;
|
||||
|
||||
if (!_dismissedChange) {
|
||||
|
|
|
|||
|
|
@ -60,10 +60,6 @@ class _DeviceSettingsState extends State<DeviceSettings> {
|
|||
child: Text(localization.desktop),
|
||||
value: AppLayout.desktop,
|
||||
),
|
||||
DropdownMenuItem(
|
||||
child: Text(localization.tablet),
|
||||
value: AppLayout.tablet,
|
||||
),
|
||||
DropdownMenuItem(
|
||||
child: Text(localization.mobile),
|
||||
value: AppLayout.mobile,
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
||||
if (size < kMobileLayoutWidth) {
|
||||
return AppLayout.mobile;
|
||||
} else {
|
||||
if (breakOutTablet && size < kTabletLayoutWidth) {
|
||||
return AppLayout.tablet;
|
||||
}
|
||||
return AppLayout.desktop;
|
||||
}
|
||||
}
|
||||
|
|
@ -62,8 +59,6 @@ bool isMobile(BuildContext context) => getLayout(context) == AppLayout.mobile;
|
|||
|
||||
bool isNotMobile(BuildContext context) => !isMobile(context);
|
||||
|
||||
bool isTablet(BuildContext context) => getLayout(context) == AppLayout.tablet;
|
||||
|
||||
bool isDesktop(BuildContext context) => getLayout(context) == AppLayout.desktop;
|
||||
|
||||
bool isNotDesktop(BuildContext context) => !isDesktop(context);
|
||||
|
|
|
|||
Loading…
Reference in New Issue