Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added a media query extension to calculate the dialog width to use
- Loading branch information
Showing
2 changed files
with
14 additions
and
1 deletion.
There are no files selected for viewing
9 changes: 9 additions & 0 deletions
9
lib/presentation/shared/extensions/media_query_extensions.dart
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import 'package:flutter/cupertino.dart'; | ||
|
||
extension MediaQueryExtensions on MediaQueryData { | ||
double getWidthForDialogs() { | ||
final take = orientation == Orientation.portrait ? 2 : 3; | ||
final width = size.width / take; | ||
return width; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters