Skip to content

Commit e402fe7

Browse files
committed
Merge branch 'develop_2.0.1'
2 parents 8e3751d + 13dc057 commit e402fe7

File tree

11 files changed

+700
-1
lines changed

11 files changed

+700
-1
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ Package/Plugin|Description|Link
5050
---|:--:|---:
5151
[airoute](https://github.com/pdliuw/airoute)|Airoute:Solve the frequent problems caused by context in development, and break through the limitation of the scope of use of built-in routing|[![pub package](https://img.shields.io/pub/v/airoute.svg)](https://pub.dev/packages/airoute)
5252
[ai_barcode](https://github.com/pdliuw/ai_barcode)|AiBarcode:Scan and create barcode plugins that support customizable areas and styles|[![pub package](https://img.shields.io/pub/v/ai_barcode.svg)](https://pub.dev/packages/ai_barcode)
53+
[ai_progress](https://github.com/pdliuw/ai_progress)|support: 'Circular、Linear、Arc、Step、Dashboard'multiple style progress |[![pub package](https://img.shields.io/pub/v/ai_progress.svg)](https://pub.dev/packages/ai_progress)
5354
[ai_awesome_message](https://github.com/pdliuw/ai_awesome_message)|AiAwesomeMessage:Replaces Toast and SnackBar and can be used across multiple messaging libraries|[![pub package](https://img.shields.io/pub/v/ai_awesome_message.svg)](https://pub.dev/packages/ai_awesome_message)
5455

5556
Package/Plugin|Description|Link

README_CH.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ Package/Plugin|Description|Link
4747
---|:--:|---:
4848
[airoute](https://github.com/pdliuw/airoute)|爱路由:解决开发中由于context引起的经常性问题,突破了自带路由的使用范围的限制|[![pub package](https://img.shields.io/pub/v/airoute.svg)](https://pub.dev/packages/airoute)
4949
[ai_barcode](https://github.com/pdliuw/ai_barcode)|爱条码:支持可自定义区域及样式的可扫描、创建的的条码插件|[![pub package](https://img.shields.io/pub/v/ai_barcode.svg)](https://pub.dev/packages/ai_barcode)
50+
[ai_progress](https://github.com/pdliuw/ai_progress)|支持: '圆环、线性、扇形、步进、仪表盘'多种样式的进度组件|[![pub package](https://img.shields.io/pub/v/ai_progress.svg)](https://pub.dev/packages/ai_progress)
5051
[ai_awesome_message](https://github.com/pdliuw/ai_awesome_message)|消息提示:可替代Toast和SnackBar并可跨多端使用的消息库|[![pub package](https://img.shields.io/pub/v/ai_awesome_message.svg)](https://pub.dev/packages/ai_awesome_message)
5152

5253
Package/Plugin|Description|Link

README_CH_v2.0.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ Package/Plugin|Description|Link
4747
---|:--:|---:
4848
[airoute](https://github.com/pdliuw/airoute)|爱路由:解决开发中由于context引起的经常性问题,突破了自带路由的使用范围的限制|[![pub package](https://img.shields.io/pub/v/airoute.svg)](https://pub.dev/packages/airoute)
4949
[ai_barcode](https://github.com/pdliuw/ai_barcode)|爱条码:支持可自定义区域及样式的可扫描、创建的的条码插件|[![pub package](https://img.shields.io/pub/v/ai_barcode.svg)](https://pub.dev/packages/ai_barcode)
50+
[ai_progress](https://github.com/pdliuw/ai_progress)|支持: '圆环、线性、扇形、步进、仪表盘'多种样式的进度组件|[![pub package](https://img.shields.io/pub/v/ai_progress.svg)](https://pub.dev/packages/ai_progress)
5051
[ai_awesome_message](https://github.com/pdliuw/ai_awesome_message)|消息提示:可替代Toast和SnackBar并可跨多端使用的消息库|[![pub package](https://img.shields.io/pub/v/ai_awesome_message.svg)](https://pub.dev/packages/ai_awesome_message)
5152

5253
Package/Plugin|Description|Link

README_v2.0.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ Package/Plugin|Description|Link
5050
---|:--:|---:
5151
[airoute](https://github.com/pdliuw/airoute)|Airoute:Solve the frequent problems caused by context in development, and break through the limitation of the scope of use of built-in routing|[![pub package](https://img.shields.io/pub/v/airoute.svg)](https://pub.dev/packages/airoute)
5252
[ai_barcode](https://github.com/pdliuw/ai_barcode)|AiBarcode:Scan and create barcode plugins that support customizable areas and styles|[![pub package](https://img.shields.io/pub/v/ai_barcode.svg)](https://pub.dev/packages/ai_barcode)
53+
[ai_progress](https://github.com/pdliuw/ai_progress)|support: 'Circular、Linear、Arc、Step、Dashboard'multiple style progress |[![pub package](https://img.shields.io/pub/v/ai_progress.svg)](https://pub.dev/packages/ai_progress)
5354
[ai_awesome_message](https://github.com/pdliuw/ai_awesome_message)|AiAwesomeMessage:Replaces Toast and SnackBar and can be used across multiple messaging libraries|[![pub package](https://img.shields.io/pub/v/ai_awesome_message.svg)](https://pub.dev/packages/ai_awesome_message)
5455

5556
Package/Plugin|Description|Link

lib/component/main/MainPage.dart

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ class _MainState extends State<MainPage> {
6666
"Popup",
6767
"Wave",
6868
"IconAnim",
69+
"Overlay",
6970
];
7071
return _sortTitles;
7172
}
@@ -92,6 +93,7 @@ class _MainState extends State<MainPage> {
9293
"/MainPopupPage",
9394
"/MainWavePage",
9495
"/MainIconAnimPage",
96+
"/MainOverlayPage",
9597
];
9698
return _sortRouteNames;
9799
}

lib/main.dart

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,8 @@ import 'sample/anim/snappable_page.dart';
3535
import 'sample/chart/chart_page.dart';
3636
import 'sample/clip/clip_main_page.dart';
3737
import 'sample/navigation/curved_navigation_bar_page.dart';
38+
import 'sample/overlay/main_overlay_page.dart';
39+
import 'sample/overlay/simple_overlay_page.dart';
3840
import 'sample/picker/main_picker_page.dart';
3941
import 'sample/progress/main_progress_page.dart';
4042
import 'sample/segment/drop_down_page.dart';
@@ -132,6 +134,8 @@ class Test extends StatelessWidget {
132134
"/MainPopupPage": (_) => MainPopupPage(),
133135
"/MainWavePage": (_) => MainWavePage(),
134136
"/MainIconAnimPage": (_) => MainIconAnimPage(),
137+
"/MainOverlayPage": (_) => MainOverlayPage(),
138+
"/SimpleOverlayPage": (_) => SimpleOverlayPage(),
135139
},
136140
);
137141
},
Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
import 'dart:ui';
2+
3+
import 'package:flutter/cupertino.dart';
4+
import 'package:flutter/material.dart';
5+
6+
class LoadingModalPopupRoute<T> extends PopupRoute<T> {
7+
LoadingModalPopupRoute({
8+
this.barrierColor,
9+
this.barrierLabel,
10+
this.builder,
11+
bool semanticsDismissible,
12+
ImageFilter filter,
13+
RouteSettings settings,
14+
}) : super(
15+
filter: filter,
16+
settings: settings,
17+
) {
18+
_semanticsDismissible = semanticsDismissible;
19+
}
20+
21+
final WidgetBuilder builder;
22+
bool _semanticsDismissible;
23+
24+
@override
25+
final String barrierLabel;
26+
27+
@override
28+
final Color barrierColor;
29+
30+
@override
31+
bool get barrierDismissible => true;
32+
33+
@override
34+
bool get semanticsDismissible => _semanticsDismissible ?? false;
35+
36+
@override
37+
Duration get transitionDuration => Duration(milliseconds: 300);
38+
39+
Animation<double> _animation;
40+
41+
Tween<Offset> _offsetTween;
42+
43+
@override
44+
Animation<double> createAnimation() {
45+
assert(_animation == null);
46+
_animation = CurvedAnimation(
47+
parent: super.createAnimation(),
48+
49+
// These curves were initially measured from native iOS horizontal page
50+
// route animations and seemed to be a good match here as well.
51+
curve: Curves.linearToEaseOut,
52+
reverseCurve: Curves.linearToEaseOut.flipped,
53+
);
54+
_offsetTween = Tween<Offset>(
55+
begin: const Offset(0.0, 1.0),
56+
end: const Offset(0.0, 0.0),
57+
);
58+
return _animation;
59+
}
60+
61+
@override
62+
Widget buildPage(BuildContext context, Animation<double> animation,
63+
Animation<double> secondaryAnimation) {
64+
return CupertinoUserInterfaceLevel(
65+
data: CupertinoUserInterfaceLevelData.elevated,
66+
child: Builder(builder: builder),
67+
);
68+
}
69+
70+
@override
71+
Widget buildTransitions(BuildContext context, Animation<double> animation,
72+
Animation<double> secondaryAnimation, Widget child) {
73+
return Align(
74+
alignment: Alignment.center,
75+
child: FractionalTranslation(
76+
translation: _offsetTween.evaluate(_animation),
77+
child: child,
78+
),
79+
);
80+
}
81+
}
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
import 'package:airoute/airoute.dart';
2+
import 'package:flutter/material.dart';
3+
4+
/// MainOverlayPage
5+
class MainOverlayPage extends StatefulWidget {
6+
@override
7+
State<StatefulWidget> createState() {
8+
return _MainOverlayState();
9+
}
10+
}
11+
12+
/// _MainOverlayState
13+
class _MainOverlayState extends State<MainOverlayPage> {
14+
static final Map<String, String> _overlay = {
15+
//displayName: routeName
16+
"SimpleOverlay": "/SimpleOverlayPage",
17+
};
18+
19+
List<String> _overlayDisplayName = _overlay.keys.toList();
20+
21+
List<String> _overlayRouteName = _overlay.values.toList();
22+
23+
@override
24+
Widget build(BuildContext context) {
25+
return Scaffold(
26+
appBar: AppBar(
27+
title: Text("Overlay"),
28+
),
29+
body: ListView.builder(
30+
itemCount: _overlayDisplayName.length,
31+
itemBuilder: (context, index) {
32+
String displayName = _overlayDisplayName.elementAt(index);
33+
String routeName = _overlayRouteName.elementAt(index);
34+
return GestureDetector(
35+
onTap: () {
36+
Airoute.pushNamedWithAnimation(
37+
routeName: routeName,
38+
routePageAnimation: AirouteTransition.Slide,
39+
);
40+
},
41+
child: Card(
42+
child: ListTile(
43+
leading: Text("$displayName"),
44+
)),
45+
);
46+
},
47+
));
48+
}
49+
}

0 commit comments

Comments
 (0)