Browse Source

修改

null_safety
哈哈哈 3 years ago
parent
commit
72429998a8
  1. BIN
      assets/image/2x/ic_splash_bg.png
  2. BIN
      assets/image/3x/ic_splash_bg.png
  3. BIN
      assets/image/ic_splash_bg.png
  4. 100
      lib/login/login_page.dart

BIN
assets/image/2x/ic_splash_bg.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 80 KiB

BIN
assets/image/3x/ic_splash_bg.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 144 KiB

BIN
assets/image/ic_splash_bg.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 29 KiB

100
lib/login/login_page.dart

@ -289,7 +289,8 @@ class _MyLoginPageState extends State<LoginPage> 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<LoginPage> 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: <Widget>[
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<LoginPage> 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<LoginPage> 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<LoginPage> 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<LoginPage> 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<LoginPage> 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: <Widget>[
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;

Loading…
Cancel
Save