Skip to content

Commit 91fd9bf

Browse files
authored
Merge branch 'main' into vs_squashed
2 parents 39bf897 + df88c81 commit 91fd9bf

File tree

81 files changed

+30452
-10273
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

81 files changed

+30452
-10273
lines changed

.ci/flutter_master.version

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
303f222e17e3aede60f12dadc37b4d626ced48de
1+
2d30fe448cd41eaf4778a735e852ec7a7bb6eaf9

packages/extension_google_sign_in_as_googleapis_auth/example/pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ dependencies:
1717
flutter:
1818
sdk: flutter
1919
google_sign_in: ^6.0.0
20-
googleapis: ^10.1.0
20+
googleapis: ">=10.1.0 <14.0.0"
2121
googleapis_auth: ^1.1.0
2222

2323
dev_dependencies:

packages/file_selector/file_selector_android/example/android/app/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ android {
4141
// You can update the following values to match your application needs.
4242
// For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-gradle-build-configuration.
4343
minSdkVersion 21
44-
targetSdkVersion 33
44+
targetSdkVersion 34
4545
versionCode flutterVersionCode.toInteger()
4646
versionName flutterVersionName
4747
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"

packages/flutter_adaptive_scaffold/CHANGELOG.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,14 @@
1+
## 0.3.1
2+
3+
* Use improved MediaQuery methods.
4+
5+
## 0.3.0
6+
7+
* Adds `inDuration`, `outDuration`, `inCurve`, and `outCurve` parameters for
8+
configuring additional `SlotLayoutConfig` animation behavior.
9+
* **BREAKING CHANGES**:
10+
* Removes `duration` parameter from `SlotLayoutConfig`.
11+
112
## 0.2.6
213

314
* Add new sample for using AdaptiveScaffold with GoRouter.

packages/flutter_adaptive_scaffold/example/lib/main.dart

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -693,7 +693,7 @@ class _ItemListTile extends StatelessWidget {
693693
style: Theme.of(context).textTheme.bodyLarge),
694694
const SizedBox(height: 9),
695695
SizedBox(
696-
width: MediaQuery.of(context).size.width,
696+
width: MediaQuery.sizeOf(context).width,
697697
child: (email.bodyImage != '')
698698
? Image.asset(email.bodyImage)
699699
: Container(),
@@ -717,7 +717,7 @@ class _DetailTile extends StatelessWidget {
717717
return Padding(
718718
padding: const EdgeInsets.all(8.0),
719719
child: SizedBox(
720-
height: MediaQuery.of(context).size.height,
720+
height: MediaQuery.sizeOf(context).height,
721721
child: Container(
722722
decoration: const BoxDecoration(
723723
color: Color.fromARGB(255, 245, 241, 248),
@@ -891,7 +891,7 @@ class _EmailTile extends StatelessWidget {
891891
color: Colors.grey[700], height: 1.35, fontSize: 14.5)),
892892
const SizedBox(height: 9),
893893
SizedBox(
894-
width: MediaQuery.of(context).size.width,
894+
width: MediaQuery.sizeOf(context).width,
895895
child:
896896
(bodyImage != '') ? Image.asset(bodyImage) : Container()),
897897
const SizedBox(height: 10),

packages/flutter_adaptive_scaffold/lib/src/adaptive_layout.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -293,7 +293,7 @@ class _AdaptiveLayoutState extends State<AdaptiveLayout>
293293
});
294294

295295
Rect? hinge;
296-
for (final DisplayFeature e in MediaQuery.of(context).displayFeatures) {
296+
for (final DisplayFeature e in MediaQuery.displayFeaturesOf(context)) {
297297
if (e.type == DisplayFeatureType.hinge ||
298298
e.type == DisplayFeatureType.fold) {
299299
if (e.bounds.left != 0) {

packages/flutter_adaptive_scaffold/lib/src/adaptive_scaffold.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -362,7 +362,7 @@ class AdaptiveScaffold extends StatefulWidget {
362362
padding: padding,
363363
child: SizedBox(
364364
width: width,
365-
height: MediaQuery.of(context).size.height,
365+
height: MediaQuery.sizeOf(context).height,
366366
child: LayoutBuilder(
367367
builder: (BuildContext context, BoxConstraints constraints) {
368368
return SingleChildScrollView(

packages/flutter_adaptive_scaffold/lib/src/slot_layout.dart

Lines changed: 32 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -72,14 +72,20 @@ class SlotLayout extends StatefulWidget {
7272
WidgetBuilder? builder,
7373
Widget Function(Widget, Animation<double>)? inAnimation,
7474
Widget Function(Widget, Animation<double>)? outAnimation,
75-
Duration? duration,
75+
Duration? inDuration,
76+
Duration? outDuration,
77+
Curve? inCurve,
78+
Curve? outCurve,
7679
required Key key,
7780
}) =>
7881
SlotLayoutConfig._(
7982
builder: builder,
8083
inAnimation: inAnimation,
8184
outAnimation: outAnimation,
82-
duration: duration,
85+
inDuration: inDuration,
86+
outDuration: outDuration,
87+
inCurve: inCurve,
88+
outCurve: outCurve,
8389
key: key,
8490
);
8591

@@ -96,7 +102,11 @@ class _SlotLayoutState extends State<SlotLayout>
96102
chosenWidget = SlotLayout.pickWidget(context, widget.config);
97103
bool hasAnimation = false;
98104
return AnimatedSwitcher(
99-
duration: chosenWidget?.duration ?? const Duration(milliseconds: 1000),
105+
duration:
106+
chosenWidget?.inDuration ?? const Duration(milliseconds: 1000),
107+
reverseDuration: chosenWidget?.outDuration,
108+
switchInCurve: chosenWidget?.inCurve ?? Curves.linear,
109+
switchOutCurve: chosenWidget?.outCurve ?? Curves.linear,
100110
layoutBuilder: (Widget? currentChild, List<Widget> previousChildren) {
101111
final Stack elements = Stack(
102112
children: <Widget>[
@@ -137,7 +147,10 @@ class SlotLayoutConfig extends StatelessWidget {
137147
required this.builder,
138148
this.inAnimation,
139149
this.outAnimation,
140-
this.duration,
150+
this.inDuration,
151+
this.outDuration,
152+
this.inCurve,
153+
this.outCurve,
141154
});
142155

143156
/// The child Widget that [SlotLayout] eventually returns with an animation.
@@ -161,8 +174,21 @@ class SlotLayoutConfig extends StatelessWidget {
161174
/// as the returned widget.
162175
final Widget Function(Widget, Animation<double>)? outAnimation;
163176

164-
/// The amount of time taken by the execution of the in and out animations.
165-
final Duration? duration;
177+
/// The duration of the transition from the old child to the new one during
178+
/// a switch in [SlotLayout].
179+
final Duration? inDuration;
180+
181+
/// The duration of the transition from the new child to the old one during
182+
/// a switch in [SlotLayout].
183+
final Duration? outDuration;
184+
185+
/// The animation curve to use when transitioning in a new child during a
186+
/// switch in [SlotLayout].
187+
final Curve? inCurve;
188+
189+
/// The animation curve to use when transitioning a previous slot out during
190+
/// a switch in [SlotLayout].
191+
final Curve? outCurve;
166192

167193
/// An empty [SlotLayoutConfig] to be placed in a slot to indicate that the slot
168194
/// should show nothing.

packages/flutter_adaptive_scaffold/pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: flutter_adaptive_scaffold
22
description: Widgets to easily build adaptive layouts, including navigation elements.
3-
version: 0.2.6
3+
version: 0.3.1
44
issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+flutter_adaptive_scaffold%22
55
repository: https://github.com/flutter/packages/tree/main/packages/flutter_adaptive_scaffold
66

packages/flutter_adaptive_scaffold/test/adaptive_layout_test.dart

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -443,35 +443,35 @@ void main() {
443443
class TestBreakpoint0 extends Breakpoint {
444444
@override
445445
bool isActive(BuildContext context) {
446-
return MediaQuery.of(context).size.width >= 0;
446+
return MediaQuery.sizeOf(context).width >= 0;
447447
}
448448
}
449449

450450
class TestBreakpoint400 extends Breakpoint {
451451
@override
452452
bool isActive(BuildContext context) {
453-
return MediaQuery.of(context).size.width > 400;
453+
return MediaQuery.sizeOf(context).width > 400;
454454
}
455455
}
456456

457457
class TestBreakpoint800 extends Breakpoint {
458458
@override
459459
bool isActive(BuildContext context) {
460-
return MediaQuery.of(context).size.width > 800;
460+
return MediaQuery.sizeOf(context).width > 800;
461461
}
462462
}
463463

464464
class TestBreakpoint1200 extends Breakpoint {
465465
@override
466466
bool isActive(BuildContext context) {
467-
return MediaQuery.of(context).size.width > 1200;
467+
return MediaQuery.sizeOf(context).width > 1200;
468468
}
469469
}
470470

471471
class TestBreakpoint1600 extends Breakpoint {
472472
@override
473473
bool isActive(BuildContext context) {
474-
return MediaQuery.of(context).size.width > 1600;
474+
return MediaQuery.sizeOf(context).width > 1600;
475475
}
476476
}
477477

@@ -664,35 +664,35 @@ MediaQuery slot(double width, Duration duration, WidgetTester tester) {
664664
TestBreakpoint0(): SlotLayout.from(
665665
inAnimation: leftOutIn,
666666
outAnimation: leftInOut,
667-
duration: duration,
667+
inDuration: duration,
668668
key: const Key('0'),
669669
builder: (_) => const SizedBox(width: 10, height: 10),
670670
),
671671
TestBreakpoint400(): SlotLayout.from(
672672
inAnimation: leftOutIn,
673673
outAnimation: leftInOut,
674-
duration: duration,
674+
inDuration: duration,
675675
key: const Key('400'),
676676
builder: (_) => const SizedBox(width: 10, height: 10),
677677
),
678678
TestBreakpoint800(): SlotLayout.from(
679679
inAnimation: leftOutIn,
680680
outAnimation: leftInOut,
681-
duration: duration,
681+
inDuration: duration,
682682
key: const Key('800'),
683683
builder: (_) => const SizedBox(width: 10, height: 10),
684684
),
685685
TestBreakpoint1200(): SlotLayout.from(
686686
inAnimation: leftOutIn,
687687
outAnimation: leftInOut,
688-
duration: duration,
688+
inDuration: duration,
689689
key: const Key('1200'),
690690
builder: (_) => const SizedBox(width: 10, height: 10),
691691
),
692692
TestBreakpoint1600(): SlotLayout.from(
693693
inAnimation: leftOutIn,
694694
outAnimation: leftInOut,
695-
duration: duration,
695+
inDuration: duration,
696696
key: const Key('1600'),
697697
builder: (_) => const SizedBox(width: 10, height: 10),
698698
),

0 commit comments

Comments
 (0)