diff --git a/assets/image/2x/ic_splash_bg.png b/assets/image/2x/ic_splash_bg.png new file mode 100644 index 00000000..eae093e9 Binary files /dev/null and b/assets/image/2x/ic_splash_bg.png differ diff --git a/assets/image/3x/ic_splash_bg.png b/assets/image/3x/ic_splash_bg.png new file mode 100644 index 00000000..9c14a22a Binary files /dev/null and b/assets/image/3x/ic_splash_bg.png differ diff --git a/assets/image/ic_splash_bg.png b/assets/image/ic_splash_bg.png new file mode 100644 index 00000000..4198ace5 Binary files /dev/null and b/assets/image/ic_splash_bg.png differ diff --git a/lib/login/login_page.dart b/lib/login/login_page.dart index 786d6884..66d5a688 100644 --- a/lib/login/login_page.dart +++ b/lib/login/login_page.dart @@ -289,7 +289,8 @@ class _MyLoginPageState extends State with TickerProviderStateMixin { xgFlutterPlugin.bindWithIdentifier( identify: mobile, bindType: XGBindType.account); - Navigator.of(context).pushNamedAndRemoveUntil('/router/main_page', (route) => false); + Navigator.of(context) + .pushNamedAndRemoveUntil('/router/main_page', (route) => false); } else { SmartDialog.showToast("${value.msg}", alignment: Alignment.center); } @@ -362,6 +363,45 @@ class _MyLoginPageState extends State with TickerProviderStateMixin { if (!animatedContainer.isAnimating) { animatedContainer.forward(); } + return AnimatedCrossFade( + firstChild: Container( + child: Image.asset( + "assets/image/ic_splash_bg.png", + fit: BoxFit.fill, + ), + ), + layoutBuilder: (widgetFirst, keyFirst, widgetSecond, keySecond) { + return Stack( + clipBehavior: Clip.none, + children: [ + Positioned( + key: keySecond, + left: 0.0, + top: 0.0, + right: 0.0, + bottom: 0.0, + child: widgetSecond, + ), + Positioned( + key: keyFirst, + left: 0.0, + top: 0.0, + right: 0.0, + bottom: 0.0, + child: widgetFirst, + ), + ], + ); + }, + secondChild: uiPage(), + firstCurve: Curves.easeInOut, + secondCurve: Curves.easeInOut, + crossFadeState: isShowLogin ? CrossFadeState.showSecond : CrossFadeState.showFirst, + duration: Duration(milliseconds: 200), + ); + } + + Widget uiPage() { return Scaffold( resizeToAvoidBottomInset: false, backgroundColor: Colors.white, @@ -378,7 +418,7 @@ class _MyLoginPageState extends State with TickerProviderStateMixin { children: [ PhotoView( imageProvider: AssetImage("assets/image/laoban.png"), - initialScale: Platform.isAndroid ? 1.02 : 1.2, + initialScale: Platform.isAndroid ? 1.02 : 1.15, basePosition: alignmentProgress, ), Positioned( @@ -457,16 +497,13 @@ class _MyLoginPageState extends State with TickerProviderStateMixin { top: 0, ), Positioned( - top: - MediaQuery.of(context).size.height * 0.1039, + top: MediaQuery.of(context).size.height * 0.1039, bottom: 0, child: Container( - padding: - EdgeInsets.symmetric(horizontal: 40.w), + padding: EdgeInsets.symmetric(horizontal: 40.w), child: Column( mainAxisAlignment: MainAxisAlignment.start, - crossAxisAlignment: - CrossAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, children: [ Opacity( opacity: (255 - changeAlpha) / 255, @@ -535,8 +572,8 @@ class _MyLoginPageState extends State with TickerProviderStateMixin { (offsetBtn > 50.h ? 50.h : offsetBtn < 0 - ? 0 - : offsetBtn)), + ? 0 + : offsetBtn)), left: 40.w, right: 40.w, ), @@ -547,8 +584,7 @@ class _MyLoginPageState extends State with TickerProviderStateMixin { if (widget.arguments != null) { Navigator.of(context).pop(); } else { - Navigator.of(context) - .popAndPushNamed('/router/main_page'); + Navigator.of(context).popAndPushNamed('/router/main_page'); } }, child: Visibility( @@ -596,45 +632,7 @@ class _MyLoginPageState extends State with TickerProviderStateMixin { ], ), ), - )/*AnimatedCrossFade( - firstChild: Container( - color: Colors.white, - child: Platform.isAndroid - ? Container() - : Container( - // child: Image.asset("name"), - ), - ), - layoutBuilder: (widgetFirst, keyFirst, widgetSecond, keySecond) { - return Stack( - clipBehavior: Clip.none, - children: [ - Positioned( - key: keySecond, - left: 0.0, - top: 0.0, - right: 0.0, - bottom: 0.0, - child: widgetSecond, - ), - Positioned( - key: keyFirst, - left: 0.0, - top: 0.0, - right: 0.0, - bottom: 0.0, - child: widgetFirst, - ), - ], - ); - }, - secondChild: , - firstCurve: Curves.easeInOut, - secondCurve: Curves.easeInOut, - crossFadeState: - isShowLogin ? CrossFadeState.showSecond : CrossFadeState.showFirst, - duration: Duration(milliseconds: 500), - )*/; + ); } bool isShowLogin = false;