Skip to content

Commit

Permalink
more renaming to fit dart file conventions
Browse files Browse the repository at this point in the history
  • Loading branch information
richtwin567 committed Sep 1, 2020
1 parent 4db41e1 commit 85559b7
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion lib/models/enums/device_screen_type.dart
Original file line number Diff line number Diff line change
@@ -1 +1 @@
enum DeviceScreenType { Mobile, Tablet, Desktop }
enum DeviceScreenType { mobile, tablet, desktop }
6 changes: 3 additions & 3 deletions lib/utils/get_device_screen_type.dart
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@ DeviceScreenType getDeviceType(MediaQueryData mediaQuery) {
double deviceWidth = mediaQuery.size.shortestSide;

if (deviceWidth > 950) {
return DeviceScreenType.Desktop;
return DeviceScreenType.desktop;
}

if (deviceWidth > 600) {
return DeviceScreenType.Tablet;
return DeviceScreenType.tablet;
}

return DeviceScreenType.Mobile;
return DeviceScreenType.mobile;
}
4 changes: 2 additions & 2 deletions lib/widgets/screen_type_layout.dart
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,14 @@ class ScreenTypeLayout extends StatelessWidget {
Widget build(BuildContext context) {
return ResponsiveBuilder(builder: (context, sizingInformation) {
// If sizing indicates Tablet and we have a tablet widget then return
if (sizingInformation.deviceScreenType == DeviceScreenType.Tablet) {
if (sizingInformation.deviceScreenType == DeviceScreenType.tablet) {
if (tablet != null) {
return tablet;
}
}

// If sizing indicates desktop and we have a desktop widget then return
if (sizingInformation.deviceScreenType == DeviceScreenType.Desktop) {
if (sizingInformation.deviceScreenType == DeviceScreenType.desktop) {
if (desktop != null) {
return desktop;
}
Expand Down

0 comments on commit 85559b7

Please sign in to comment.