Skip to content

Commit

Permalink
更新支持 3.10
Browse files Browse the repository at this point in the history
  • Loading branch information
CarGuo committed May 16, 2023
1 parent a6e89ea commit 063172e
Show file tree
Hide file tree
Showing 13 changed files with 75 additions and 42 deletions.
17 changes: 15 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

> 目前开始逐步补全完善,主要提供一些有用或者有趣的例子,如果你也有好例子,环境提交 PR 。
>
> **运行须知:配置好Flutter开发环境(目前Flutter SDK 版本 *3.7* 以上版本)。**
> **运行须知:配置好Flutter开发环境(目前Flutter SDK 版本 *3.10* 以上版本)。**
>
> **[如果克隆太慢或者图片看不到,可尝试从码云地址下载](https://gitee.com/CarGuo/GSYFlutterDemo)**
Expand Down Expand Up @@ -597,8 +597,21 @@ Map<String, WidgetBuilder> routers = {
(context) {
return photo_gallery_demo_page.PhotoGalleryDemoPage();
});
}
},
"有趣的文本撕裂动画": (context) {
return ContainerAsyncRouterPage(tear_text_demo_page.loadLibrary(),
(context) {
return tear_text_demo_page.TearTextDemoPage();
});
},
"自适应横竖列表": (context) {
return ContainerAsyncRouterPage(un_bounded_listview.loadLibrary(),
(context) {
return un_bounded_listview.UnboundedListViewDemoPage();
});
},
};
```


Expand Down
2 changes: 1 addition & 1 deletion android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,6 @@ subprojects {
project.evaluationDependsOn(':app')
}

task clean(type: Delete) {
tasks.register("clean", Delete) {
delete rootProject.buildDir
}
7 changes: 3 additions & 4 deletions lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -900,11 +900,10 @@ Map<String, WidgetBuilder> routers = {
},
"自适应横竖列表": (context) {
return ContainerAsyncRouterPage(un_bounded_listview.loadLibrary(),
(context) {
return un_bounded_listview.UnboundedListViewDemoPage();
});
(context) {
return un_bounded_listview.UnboundedListViewDemoPage();
});
},

};

enum Cat {
Expand Down
20 changes: 16 additions & 4 deletions lib/widget/bubble/bubble_demo_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,10 @@ class BubbleDemoPage extends StatelessWidget {
if (isClient()) {
return getY(button1Key) +
getHeight(button1Key) -
MediaQueryData.fromWindow(WidgetsBinding.instance.window).padding.top;
MediaQueryData.fromView(
WidgetsBinding.instance.platformDispatcher.views.first)
.padding
.top;
} else {
return getY(button1Key) + getHeight(button1Key);
}
Expand All @@ -60,7 +63,10 @@ class BubbleDemoPage extends StatelessWidget {
if (isClient()) {
return getY(button2Key) +
getHeight(button2Key) / 2 -
MediaQueryData.fromWindow(WidgetsBinding.instance.window).padding.top;
MediaQueryData.fromView(
WidgetsBinding.instance.platformDispatcher.views.first)
.padding
.top;
} else {
return getY(button2Key) + getHeight(button2Key) / 2;
}
Expand All @@ -70,7 +76,10 @@ class BubbleDemoPage extends StatelessWidget {
if (isClient()) {
return getY(button3Key) +
getHeight(button3Key) / 2 -
MediaQueryData.fromWindow(WidgetsBinding.instance.window).padding.top;
MediaQueryData.fromView(
WidgetsBinding.instance.platformDispatcher.views.first)
.padding
.top;
} else {
return getY(button3Key) + getHeight(button3Key) / 2;
}
Expand All @@ -80,7 +89,10 @@ class BubbleDemoPage extends StatelessWidget {
if (isClient()) {
return getY(button4Key) -
bubbleHeight -
MediaQueryData.fromWindow(WidgetsBinding.instance.window).padding.top;
MediaQueryData.fromView(
WidgetsBinding.instance.platformDispatcher.views.first)
.padding
.top;
} else {
return getY(button4Key) - bubbleHeight;
}
Expand Down
6 changes: 4 additions & 2 deletions lib/widget/list_anim/header_appbar.dart
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,10 @@ class HeaderAppBar extends StatelessWidget {

@override
Widget build(BuildContext context) {
double statusBarHeight =
MediaQueryData.fromWindow(WidgetsBinding.instance.window).padding.top;
double statusBarHeight = MediaQueryData.fromView(
WidgetsBinding.instance.platformDispatcher.views.first)
.padding
.top;

double reactHeight = 30;

Expand Down
8 changes: 5 additions & 3 deletions lib/widget/list_anim/list_anim_demo_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,14 @@ class _ListAnimDemoPageState extends State<ListAnimDemoPage> {
///头部信息框高度
double headerRectHeight = 60;


///头部区域
_buildHeader() {
///状态栏高度
double statusBarHeight =
MediaQueryData.fromWindow(WidgetsBinding.instance.window).padding.top;
double statusBarHeight = MediaQueryData.fromView(
WidgetsBinding.instance.platformDispatcher.views.first)
.padding
.top;

///头部区域去除marin、appbar、状态栏之后的高度
double dynamicValue =
headerHeight - headerRectMargin - kToolbarHeight - statusBarHeight;
Expand Down
6 changes: 4 additions & 2 deletions lib/widget/list_anim_2/header_appbar.dart
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,10 @@ class HeaderAppBar2 extends StatelessWidget {

@override
Widget build(BuildContext context) {
double statusBarHeight =
MediaQueryData.fromWindow(WidgetsBinding.instance.window).padding.top;
double statusBarHeight = MediaQueryData.fromView(
WidgetsBinding.instance.platformDispatcher.views.first)
.padding
.top;

double reactHeight = 30;

Expand Down
8 changes: 5 additions & 3 deletions lib/widget/list_anim_2/list_anim_demo_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,14 @@ class _ListAnimDemoPageState2 extends State<ListAnimDemoPage2> {
///头部信息框高度
double headerRectHeight = 60;


///头部区域
_buildHeader() {
///状态栏高度
double statusBarHeight =
MediaQueryData.fromWindow(WidgetsBinding.instance.window).padding.top;
double statusBarHeight = MediaQueryData.fromView(
WidgetsBinding.instance.platformDispatcher.views.first)
.padding
.top;

///头部区域去除marin、appbar、状态栏之后的高度
double dynamicValue =
headerHeight - headerRectMargin - kToolbarHeight - statusBarHeight;
Expand Down
3 changes: 2 additions & 1 deletion lib/widget/list_link_bottomsheet_demo_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,8 @@ class _ListLinkBottomSheetDemoPageState
key: btKey,
controller: _btController,
maxHeight: MediaQuery.of(context).size.height -
MediaQueryData.fromWindow(WidgetsBinding.instance.window)
MediaQueryData.fromView(
WidgetsBinding.instance.platformDispatcher.views.first)
.padding
.top -
kToolbarHeight -
Expand Down
1 change: 0 additions & 1 deletion lib/widget/photo_gallery_demo_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -345,7 +345,6 @@ class _AnimatedCutoutOverlay extends StatelessWidget {
cutoutSize.width * (1 - scaleAmt * anim * swipeDir.dx.abs()),
cutoutSize.height * (1 - scaleAmt * anim * swipeDir.dy.abs()),
);
print("### anim ${anim} ");
return ClipPath(clipper: _CutoutClipper(size), child: child);
}
}
Expand Down
2 changes: 1 addition & 1 deletion lib/widget/rich/real_rich_text.dart
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ class RealRichText extends Text {
TextStyle? effectiveTextStyle = style;
if (style == null || style!.inherit)
effectiveTextStyle = defaultTextStyle.style.merge(style);
if (MediaQuery.boldTextOverride(context))
if (MediaQuery.boldTextOf(context))
effectiveTextStyle =
effectiveTextStyle!.merge(TextStyle(fontWeight: FontWeight.bold));

Expand Down
3 changes: 2 additions & 1 deletion lib/widget/text_size_demo_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ class _TextSizeDemoPageState extends State<TextSizeDemoPage> {
@override
Widget build(BuildContext context) {
return MediaQuery(
data: MediaQueryData.fromWindow(WidgetsBinding.instance.window)
data: MediaQueryData.fromView(
WidgetsBinding.instance.platformDispatcher.views.first)
.copyWith(textScaleFactor: textScaleFactor),
child: Scaffold(
appBar: AppBar(
Expand Down
34 changes: 17 additions & 17 deletions pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -61,10 +61,10 @@ packages:
dependency: transitive
description:
name: async
sha256: bfe67ef28df125b7dddcea62755991f807aa39a2492a23e1550161692950bbe0
sha256: "947bfcf187f74dbc5e146c9eb9c0f10c9f8b30743e341481c1e2ed3ecc18c20c"
url: "https://pub.flutter-io.cn"
source: hosted
version: "2.10.0"
version: "2.11.0"
bazel_worker:
dependency: transitive
description:
Expand Down Expand Up @@ -165,10 +165,10 @@ packages:
dependency: transitive
description:
name: characters
sha256: e6a326c8af69605aec75ed6c187d06b349707a27fbff8222ca9cc2cff167975c
sha256: "04a925763edad70e8443c99234dc3328f442e811f1d8fd1a72f1c8ad0f69a605"
url: "https://pub.flutter-io.cn"
source: hosted
version: "1.2.1"
version: "1.3.0"
charcode:
dependency: transitive
description:
Expand Down Expand Up @@ -205,10 +205,10 @@ packages:
dependency: transitive
description:
name: collection
sha256: cfc915e6923fe5ce6e153b0723c753045de46de1b4d63771530504004a45fae0
sha256: "4a07be6cb69c84d677a6c3096fcf960cc3285a8330b4603e0d463d15d9bd934c"
url: "https://pub.flutter-io.cn"
source: hosted
version: "1.17.0"
version: "1.17.1"
convert:
dependency: transitive
description:
Expand Down Expand Up @@ -343,10 +343,10 @@ packages:
dependency: transitive
description:
name: js
sha256: "5528c2f391ededb7775ec1daa69e65a2d61276f7552de2b5f7b8d34ee9fd4ab7"
sha256: f2c445dce49627136094980615a031419f7f3eb393237e4ecd97ac15dea343f3
url: "https://pub.flutter-io.cn"
source: hosted
version: "0.6.5"
version: "0.6.7"
json_annotation:
dependency: transitive
description:
Expand All @@ -367,10 +367,10 @@ packages:
dependency: transitive
description:
name: matcher
sha256: "16db949ceee371e9b99d22f88fa3a73c4e59fd0afed0bd25fc336eb76c198b72"
sha256: "6501fbd55da300384b768785b83e5ce66991266cec21af89ab9ae7f5ce1c4cbb"
url: "https://pub.flutter-io.cn"
source: hosted
version: "0.12.13"
version: "0.12.15"
material_color_utilities:
dependency: transitive
description:
Expand All @@ -391,10 +391,10 @@ packages:
dependency: transitive
description:
name: meta
sha256: "6c268b42ed578a53088d834796959e4a1814b5e9e164f147f580a386e5decf42"
sha256: "3c74dbf8763d36539f114c799d8a2d87343b5067e9d796ca22b5eb8437090ee3"
url: "https://pub.flutter-io.cn"
source: hosted
version: "1.8.0"
version: "1.9.1"
mime:
dependency: transitive
description:
Expand All @@ -415,10 +415,10 @@ packages:
dependency: transitive
description:
name: path
sha256: db9d4f58c908a4ba5953fcee2ae317c94889433e5024c27ce74a37f94267945b
sha256: "8829d8a55c13fc0e37127c29fedf290c102f4e40ae94ada574091fe0ff96c917"
url: "https://pub.flutter-io.cn"
source: hosted
version: "1.8.2"
version: "1.8.3"
polygon:
dependency: "direct main"
description:
Expand Down Expand Up @@ -588,10 +588,10 @@ packages:
dependency: transitive
description:
name: test_api
sha256: ad540f65f92caa91bf21dfc8ffb8c589d6e4dc0c2267818b4cc2792857706206
sha256: eb6ac1540b26de412b3403a163d919ba86f6a973fe6cc50ae3541b80092fdcfb
url: "https://pub.flutter-io.cn"
source: hosted
version: "0.4.16"
version: "0.5.1"
timing:
dependency: transitive
description:
Expand Down Expand Up @@ -658,5 +658,5 @@ packages:
source: git
version: "0.0.1+3"
sdks:
dart: ">=2.18.0 <3.0.0"
dart: ">=3.0.0-0 <4.0.0"
flutter: ">=3.0.0"

0 comments on commit 063172e

Please sign in to comment.