|
|
|
@ -3,6 +3,7 @@ import 'dart:math';
|
|
|
|
|
|
|
|
|
|
import 'package:dio/dio.dart'; |
|
|
|
|
import 'package:flutter/material.dart'; |
|
|
|
|
import 'package:flutter_screenutil/flutter_screenutil.dart'; |
|
|
|
|
|
|
|
|
|
import '../../retrofit/retrofit_api.dart'; |
|
|
|
|
import '../../utils/captcha_util.dart'; |
|
|
|
@ -58,7 +59,7 @@ class _BlockPuzzleCaptchaPageState extends State<BlockPuzzleCaptchaPage>
|
|
|
|
|
|
|
|
|
|
//滑块 |
|
|
|
|
GlobalKey _slideImageKey = new GlobalKey(); |
|
|
|
|
double _bottomSliderSize = 60; |
|
|
|
|
double _bottomSliderSize = 60.h; |
|
|
|
|
|
|
|
|
|
//------------动画------------ |
|
|
|
|
|
|
|
|
@ -293,7 +294,7 @@ class _BlockPuzzleCaptchaPageState extends State<BlockPuzzleCaptchaPage>
|
|
|
|
|
child: Container( |
|
|
|
|
key: _containerKey, |
|
|
|
|
width: dialogWidth, |
|
|
|
|
height: 340, |
|
|
|
|
height: 340.h, |
|
|
|
|
color: Colors.white, |
|
|
|
|
child: Column( |
|
|
|
|
mainAxisAlignment: MainAxisAlignment.start, |
|
|
|
@ -312,10 +313,10 @@ class _BlockPuzzleCaptchaPageState extends State<BlockPuzzleCaptchaPage>
|
|
|
|
|
///顶部,提示+关闭 |
|
|
|
|
_topContainer() { |
|
|
|
|
return Container( |
|
|
|
|
height: 50, |
|
|
|
|
padding: EdgeInsets.fromLTRB(10, 0, 10, 0), |
|
|
|
|
height: 50.h, |
|
|
|
|
padding: EdgeInsets.fromLTRB(10.w, 0, 10.w, 0), |
|
|
|
|
decoration: BoxDecoration( |
|
|
|
|
border: Border(bottom: BorderSide(width: 1, color: Color(0xffe5e5e5))), |
|
|
|
|
border: Border(bottom: BorderSide(width: 1.w, color: Color(0xffe5e5e5))), |
|
|
|
|
), |
|
|
|
|
child: Row( |
|
|
|
|
mainAxisAlignment: MainAxisAlignment.spaceBetween, |
|
|
|
@ -340,7 +341,7 @@ class _BlockPuzzleCaptchaPageState extends State<BlockPuzzleCaptchaPage>
|
|
|
|
|
_middleContainer() { |
|
|
|
|
////显示验证码 |
|
|
|
|
return Container( |
|
|
|
|
margin: EdgeInsets.symmetric(vertical: 10), |
|
|
|
|
margin: EdgeInsets.symmetric(vertical: 10.h), |
|
|
|
|
child: Stack( |
|
|
|
|
children: <Widget>[ |
|
|
|
|
///底图 310*155 |
|
|
|
@ -352,14 +353,14 @@ class _BlockPuzzleCaptchaPageState extends State<BlockPuzzleCaptchaPage>
|
|
|
|
|
gaplessPlayback: true, |
|
|
|
|
) |
|
|
|
|
: Container( |
|
|
|
|
width: 310, |
|
|
|
|
height: 155, |
|
|
|
|
width: 310.w, |
|
|
|
|
height: 155.h, |
|
|
|
|
alignment: Alignment.center, |
|
|
|
|
child: CircularProgressIndicator(), |
|
|
|
|
), |
|
|
|
|
|
|
|
|
|
///滑块图 |
|
|
|
|
slideImageBase64.length > 0 |
|
|
|
|
(baseImageBase64.length > 0 && slideImageBase64.length > 0) |
|
|
|
|
? Container( |
|
|
|
|
margin: EdgeInsets.fromLTRB(sliderXMoved, 0, 0, 0), |
|
|
|
|
child: Image.memory( |
|
|
|
@ -386,15 +387,15 @@ class _BlockPuzzleCaptchaPageState extends State<BlockPuzzleCaptchaPage>
|
|
|
|
|
), |
|
|
|
|
Positioned( |
|
|
|
|
bottom: 0, |
|
|
|
|
left: -10, |
|
|
|
|
right: -10, |
|
|
|
|
left: -10.w, |
|
|
|
|
right: -10.w, |
|
|
|
|
child: Offstage( |
|
|
|
|
offstage: !_showTimeLine, |
|
|
|
|
child: FractionalTranslation( |
|
|
|
|
translation: Offset(0, offsetAnimation.value), |
|
|
|
|
child: Container( |
|
|
|
|
margin: EdgeInsets.only(left: 10, right: 10), |
|
|
|
|
height: 40, |
|
|
|
|
margin: EdgeInsets.only(left: 10.w, right: 10.w), |
|
|
|
|
height: 40.h, |
|
|
|
|
color: _checkSuccess |
|
|
|
|
? Color(0x7F66BB6A) |
|
|
|
|
: Color.fromRGBO(200, 100, 100, 0.4), |
|
|
|
@ -409,14 +410,14 @@ class _BlockPuzzleCaptchaPageState extends State<BlockPuzzleCaptchaPage>
|
|
|
|
|
), |
|
|
|
|
)), |
|
|
|
|
Positioned( |
|
|
|
|
bottom: -20, |
|
|
|
|
bottom: -20.h, |
|
|
|
|
left: 0, |
|
|
|
|
right: 0, |
|
|
|
|
child: Offstage( |
|
|
|
|
offstage: !_showTimeLine, |
|
|
|
|
child: Container( |
|
|
|
|
margin: EdgeInsets.only(left: 10, right: 10), |
|
|
|
|
height: 20, |
|
|
|
|
margin: EdgeInsets.only(left: 10.w, right: 10.w), |
|
|
|
|
height: 20.h, |
|
|
|
|
color: Colors.white, |
|
|
|
|
), |
|
|
|
|
)) |
|
|
|
@ -429,7 +430,7 @@ class _BlockPuzzleCaptchaPageState extends State<BlockPuzzleCaptchaPage>
|
|
|
|
|
_bottomContainer() { |
|
|
|
|
return baseSize.width > 0 |
|
|
|
|
? Container( |
|
|
|
|
height: 70, |
|
|
|
|
height: 70.h, |
|
|
|
|
width: baseSize.width, |
|
|
|
|
// color: Colors.cyanAccent, |
|
|
|
|
child: Stack( |
|
|
|
@ -439,7 +440,7 @@ class _BlockPuzzleCaptchaPageState extends State<BlockPuzzleCaptchaPage>
|
|
|
|
|
height: _bottomSliderSize, |
|
|
|
|
decoration: BoxDecoration( |
|
|
|
|
border: Border.all( |
|
|
|
|
width: 1, |
|
|
|
|
width: 1.w, |
|
|
|
|
color: Color(0xffe5e5e5), |
|
|
|
|
), |
|
|
|
|
color: Color(0xfff8f9fb), |
|
|
|
@ -449,12 +450,12 @@ class _BlockPuzzleCaptchaPageState extends State<BlockPuzzleCaptchaPage>
|
|
|
|
|
alignment: Alignment.center, |
|
|
|
|
child: Text( |
|
|
|
|
'向右拖动滑块填充拼图', |
|
|
|
|
style: TextStyle(fontSize: 16), |
|
|
|
|
style: TextStyle(fontSize: 16.sp), |
|
|
|
|
), |
|
|
|
|
), |
|
|
|
|
Container( |
|
|
|
|
width: sliderXMoved, |
|
|
|
|
height: _bottomSliderSize - 2, |
|
|
|
|
height: _bottomSliderSize - 2.h, |
|
|
|
|
decoration: BoxDecoration( |
|
|
|
|
border: Border.all( |
|
|
|
|
width: sliderXMoved > 0 ? 1 : 0, |
|
|
|
@ -506,15 +507,15 @@ class _BlockPuzzleCaptchaPageState extends State<BlockPuzzleCaptchaPage>
|
|
|
|
|
decoration: BoxDecoration( |
|
|
|
|
border: Border( |
|
|
|
|
top: BorderSide( |
|
|
|
|
width: 1, |
|
|
|
|
width: 1.w, |
|
|
|
|
color: Color(0xffe5e5e5), |
|
|
|
|
), |
|
|
|
|
right: BorderSide( |
|
|
|
|
width: 1, |
|
|
|
|
width: 1.w, |
|
|
|
|
color: Color(0xffe5e5e5), |
|
|
|
|
), |
|
|
|
|
bottom: BorderSide( |
|
|
|
|
width: 1, |
|
|
|
|
width: 1.w, |
|
|
|
|
color: Color(0xffe5e5e5), |
|
|
|
|
), |
|
|
|
|
), |
|
|
|
|