Skip to content

Commit

Permalink
feat: updated isDesktop to not include 1024 width
Browse files Browse the repository at this point in the history
  • Loading branch information
AbhishekDoshi26 committed Dec 28, 2023
1 parent 2a53519 commit 241d0f1
Show file tree
Hide file tree
Showing 9 changed files with 43 additions and 40 deletions.
5 changes: 4 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,7 @@
* Fix pipeline and updated documentations

## 0.0.6
* Fixed static analysis and few bugs
* Fixed static analysis and few bugs

## 0.0.7
* Updated isTablet breakpoint
52 changes: 26 additions & 26 deletions example/pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -93,10 +93,10 @@ packages:
dependency: transitive
description:
name: collection
sha256: "4a07be6cb69c84d677a6c3096fcf960cc3285a8330b4603e0d463d15d9bd934c"
sha256: ee67cb0715911d28db6bf4af1026078bd6f0128b07a5f66fb2ed94ec6783c09a
url: "https://pub.dev"
source: hosted
version: "1.17.1"
version: "1.18.0"
convert:
dependency: transitive
description:
Expand Down Expand Up @@ -179,14 +179,6 @@ packages:
url: "https://pub.dev"
source: hosted
version: "2.1.2"
js:
dependency: transitive
description:
name: js
sha256: f2c445dce49627136094980615a031419f7f3eb393237e4ecd97ac15dea343f3
url: "https://pub.dev"
source: hosted
version: "0.6.7"
lints:
dependency: transitive
description:
Expand All @@ -207,26 +199,26 @@ packages:
dependency: transitive
description:
name: matcher
sha256: "6501fbd55da300384b768785b83e5ce66991266cec21af89ab9ae7f5ce1c4cbb"
sha256: "1803e76e6653768d64ed8ff2e1e67bea3ad4b923eb5c56a295c3e634bad5960e"
url: "https://pub.dev"
source: hosted
version: "0.12.15"
version: "0.12.16"
material_color_utilities:
dependency: transitive
description:
name: material_color_utilities
sha256: d92141dc6fe1dad30722f9aa826c7fbc896d021d792f80678280601aff8cf724
sha256: "9528f2f296073ff54cb9fee677df673ace1218163c3bc7628093e7eed5203d41"
url: "https://pub.dev"
source: hosted
version: "0.2.0"
version: "0.5.0"
meta:
dependency: transitive
description:
name: meta
sha256: "3c74dbf8763d36539f114c799d8a2d87343b5067e9d796ca22b5eb8437090ee3"
sha256: a6e590c838b18133bb482a2745ad77c5bb7715fb0451209e1a7567d416678b8e
url: "https://pub.dev"
source: hosted
version: "1.9.1"
version: "1.10.0"
mockito:
dependency: transitive
description:
Expand Down Expand Up @@ -276,26 +268,26 @@ packages:
dependency: transitive
description:
name: source_span
sha256: dd904f795d4b4f3b870833847c461801f6750a9fa8e61ea5ac53f9422b31f250
sha256: "53e943d4206a5e30df338fd4c6e7a077e02254531b138a15aec3bd143c1a8b3c"
url: "https://pub.dev"
source: hosted
version: "1.9.1"
version: "1.10.0"
stack_trace:
dependency: transitive
description:
name: stack_trace
sha256: c3c7d8edb15bee7f0f74debd4b9c5f3c2ea86766fe4178eb2a18eb30a0bdaed5
sha256: "73713990125a6d93122541237550ee3352a2d84baad52d375a4cad2eb9b7ce0b"
url: "https://pub.dev"
source: hosted
version: "1.11.0"
version: "1.11.1"
stream_channel:
dependency: transitive
description:
name: stream_channel
sha256: "83615bee9045c1d322bbbd1ba209b7a749c2cbcdcb3fdd1df8eb488b3279c1c8"
sha256: ba2aa5d8cc609d96bbb2899c28934f9e1af5cddbd60a827822ea467161eb54e7
url: "https://pub.dev"
source: hosted
version: "2.1.1"
version: "2.1.2"
string_scanner:
dependency: transitive
description:
Expand All @@ -310,7 +302,7 @@ packages:
path: ".."
relative: true
source: path
version: "0.0.6"
version: "0.0.7"
term_glyph:
dependency: transitive
description:
Expand All @@ -323,10 +315,10 @@ packages:
dependency: transitive
description:
name: test_api
sha256: eb6ac1540b26de412b3403a163d919ba86f6a973fe6cc50ae3541b80092fdcfb
sha256: "5c2f730018264d276c20e4f1503fd1308dfbbae39ec8ee63c5236311ac06954b"
url: "https://pub.dev"
source: hosted
version: "0.5.1"
version: "0.6.1"
typed_data:
dependency: transitive
description:
Expand All @@ -351,6 +343,14 @@ packages:
url: "https://pub.dev"
source: hosted
version: "1.1.0"
web:
dependency: transitive
description:
name: web
sha256: afe077240a270dcfd2aafe77602b4113645af95d0ad31128cc02bce5ac5d5152
url: "https://pub.dev"
source: hosted
version: "0.3.0"
yaml:
dependency: transitive
description:
Expand All @@ -360,5 +360,5 @@ packages:
source: hosted
version: "3.1.2"
sdks:
dart: ">=3.0.0 <4.0.0"
dart: ">=3.2.0-194.0.dev <4.0.0"
flutter: ">=1.17.0"
4 changes: 2 additions & 2 deletions ios/Flutter/Generated.xcconfig
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ FLUTTER_APPLICATION_PATH=/Users/abhishekdoshi/Desktop/flutter_projects/super_ext
COCOAPODS_PARALLEL_CODE_SIGN=true
FLUTTER_TARGET=lib/main.dart
FLUTTER_BUILD_DIR=build
FLUTTER_BUILD_NAME=0.0.4
FLUTTER_BUILD_NUMBER=0.0.4
FLUTTER_BUILD_NAME=0.0.7
FLUTTER_BUILD_NUMBER=0.0.7
EXCLUDED_ARCHS[sdk=iphonesimulator*]=i386
EXCLUDED_ARCHS[sdk=iphoneos*]=armv7
DART_OBFUSCATION=false
Expand Down
4 changes: 2 additions & 2 deletions ios/Flutter/flutter_export_environment.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ export "FLUTTER_APPLICATION_PATH=/Users/abhishekdoshi/Desktop/flutter_projects/s
export "COCOAPODS_PARALLEL_CODE_SIGN=true"
export "FLUTTER_TARGET=lib/main.dart"
export "FLUTTER_BUILD_DIR=build"
export "FLUTTER_BUILD_NAME=0.0.4"
export "FLUTTER_BUILD_NUMBER=0.0.4"
export "FLUTTER_BUILD_NAME=0.0.7"
export "FLUTTER_BUILD_NUMBER=0.0.7"
export "DART_OBFUSCATION=false"
export "TRACK_WIDGET_CREATION=true"
export "TREE_SHAKE_ICONS=false"
Expand Down
6 changes: 3 additions & 3 deletions lib/src/context_extensions.dart
Original file line number Diff line number Diff line change
Expand Up @@ -68,17 +68,17 @@ extension ContextExtension on BuildContext {

///Extension method on BuildContext that returns whether the screen
///size is of tablet or not.
///It returns true if 1024>MediaQuery.of(context).size.width>=650, else returns false.
///It returns true if 1024=>MediaQuery.of(context).size.width>=650, else returns false.
///
bool get isTablet =>
MediaQuery.sizeOf(this).width < 1024 &&
MediaQuery.sizeOf(this).width <= 1024 &&
MediaQuery.sizeOf(this).width >= 650;

///Extension method on BuildContext that returns whether the screen
///size is of desktop or not.
///It returns true if MediaQuery.of(context).size.width>=1024, else returns false.
///
bool get isDesktop => MediaQuery.sizeOf(this).width >= 1024;
bool get isDesktop => MediaQuery.sizeOf(this).width > 1024;

///Extension method on BuildContext to push to [className]
///using Navigator 1.0
Expand Down
4 changes: 2 additions & 2 deletions macos/Flutter/ephemeral/Flutter-Generated.xcconfig
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ FLUTTER_ROOT=/Users/abhishekdoshi/Desktop/flutter
FLUTTER_APPLICATION_PATH=/Users/abhishekdoshi/Desktop/flutter_projects/super_extensions
COCOAPODS_PARALLEL_CODE_SIGN=true
FLUTTER_BUILD_DIR=build
FLUTTER_BUILD_NAME=0.0.4
FLUTTER_BUILD_NUMBER=0.0.4
FLUTTER_BUILD_NAME=0.0.7
FLUTTER_BUILD_NUMBER=0.0.7
DART_OBFUSCATION=false
TRACK_WIDGET_CREATION=true
TREE_SHAKE_ICONS=false
Expand Down
4 changes: 2 additions & 2 deletions macos/Flutter/ephemeral/flutter_export_environment.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ export "FLUTTER_ROOT=/Users/abhishekdoshi/Desktop/flutter"
export "FLUTTER_APPLICATION_PATH=/Users/abhishekdoshi/Desktop/flutter_projects/super_extensions"
export "COCOAPODS_PARALLEL_CODE_SIGN=true"
export "FLUTTER_BUILD_DIR=build"
export "FLUTTER_BUILD_NAME=0.0.4"
export "FLUTTER_BUILD_NUMBER=0.0.4"
export "FLUTTER_BUILD_NAME=0.0.7"
export "FLUTTER_BUILD_NUMBER=0.0.7"
export "DART_OBFUSCATION=false"
export "TRACK_WIDGET_CREATION=true"
export "TREE_SHAKE_ICONS=false"
Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: super_extensions
description: A package that supports most commonly used extension methods
version: 0.0.6
version: 0.0.7
repository: 'https://github.com/AbhishekDoshi26/super_extensions'

environment:
Expand Down
2 changes: 1 addition & 1 deletion test/widget_tests/context_extension_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,7 @@ void main() {
testWidgets(
'Check if device is desktop using size constraints',
(tester) async {
binding.window.physicalSizeTestValue = const Size(1024, 1500);
binding.window.physicalSizeTestValue = const Size(1028, 1500);
binding.window.devicePixelRatioTestValue = 1.0;

await tester.pumpWidget(
Expand Down

0 comments on commit 241d0f1

Please sign in to comment.