-
Notifications
You must be signed in to change notification settings - Fork 129
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
eeef512
commit 6aec7ff
Showing
6 changed files
with
20 additions
and
79 deletions.
There are no files selected for viewing
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 |
---|---|---|
@@ -1,5 +1,3 @@ | ||
// ignore_for_file: deprecated_member_use_from_same_package | ||
|
||
/* | ||
* Created by AHMED ELSAYED on 30 Nov 2021. | ||
* email: [email protected] | ||
|
@@ -669,14 +667,11 @@ class _DropdownButton2State<T> extends State<DropdownButton2<T>> | |
widget.onChanged != null; | ||
|
||
Orientation _getOrientation(BuildContext context) { | ||
// TODO(Ahmed): use maybeOrientationOf [flutter>=v3.10.0]. | ||
Orientation? result = MediaQuery.maybeOf(context)?.orientation; | ||
Orientation? result = MediaQuery.maybeOrientationOf(context); | ||
if (result == null) { | ||
// If there's no MediaQuery, then use the window aspect to determine | ||
// If there's no MediaQuery, then use the current FlutterView to determine | ||
// orientation. | ||
// TODO(Ahmed): use View.of(context) and update the comment [flutter>=v3.10.0]. | ||
// ignore: deprecated_member_use | ||
final Size size = WidgetsBinding.instance.window.physicalSize; | ||
final Size size = View.of(context).physicalSize; | ||
result = size.width > size.height | ||
? Orientation.landscape | ||
: Orientation.portrait; | ||
|
@@ -771,10 +766,7 @@ class _DropdownButton2State<T> extends State<DropdownButton2<T>> | |
alignment: widget.alignment, | ||
children: buttonHeight != null | ||
? buttonItems | ||
.mapIndexed((item, index) => item) | ||
.toList() | ||
// TODO(Ahmed): use indexed from Flutter [Dart>=v3.0.0]. | ||
: buttonItems.mapIndexed((item, index) { | ||
: buttonItems.map((item) { | ||
return Column( | ||
mainAxisSize: MainAxisSize.min, | ||
children: <Widget>[item], | ||
|
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
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
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
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
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