Browse Source

添加跳过指引

newdev_shunjiawei
tanlongsheng 1 year ago
parent
commit
1830801677
  1. 65
      lib/core/widgets/intro_overlay_builder.dart

65
lib/core/widgets/intro_overlay_builder.dart

@ -31,12 +31,27 @@ class IntroOverlayBuilder {
), ),
), ),
if (onNext != null) if (onNext != null)
_button( Row(
'下一步', mainAxisAlignment: MainAxisAlignment.center,
() { children: [
params.onNext!(); Padding(
onNext(); padding: EdgeInsets.only(right: 50.w),
}, child: _button(
'下一步',
() {
params.onNext!();
onNext();
},
),
),
_button(
'跳过',
() {
params.onFinish();
},
isSkip: true,
),
],
), ),
], ],
); );
@ -83,17 +98,43 @@ class IntroOverlayBuilder {
onFinish(); onFinish();
}, },
), ),
const Spacer(),
_button(
'跳过',
() {
params.onFinish();
},
isSkip: true,
),
], ],
), ),
], ],
); );
} }
static Widget _button(String text, Function() onTap) { static Widget _button(String text, Function() onTap, {bool isSkip = false}) {
return _AnimatedBorderButton( return isSkip
text: text, ? GestureDetector(
onTap: onTap, onTap: onTap,
); child: Container(
padding: EdgeInsets.symmetric(horizontal: 15.w, vertical: 5.w),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(20.r),
border: Border.all(color: Colors.white),
),
child: Text(
text,
style: TextStyle(
fontSize: 14.sp,
color: Colors.white,
),
),
),
)
: _AnimatedBorderButton(
text: text,
onTap: onTap,
);
} }
} }
@ -208,7 +249,7 @@ class _AnimatedBorderButtonState extends State<_AnimatedBorderButton>
borderRadius: 20.r, borderRadius: 20.r,
), ),
child: Container( child: Container(
padding: EdgeInsets.symmetric(horizontal: 10.w, vertical: 5.w), padding: EdgeInsets.symmetric(horizontal: 15.w, vertical: 5.w),
decoration: BoxDecoration( decoration: BoxDecoration(
borderRadius: BorderRadius.circular(20.r), borderRadius: BorderRadius.circular(20.r),
border: Border.all(color: Colors.transparent), border: Border.all(color: Colors.transparent),

Loading…
Cancel
Save