4 changed files with 325 additions and 147 deletions
@ -0,0 +1,71 @@ |
|||||
|
import 'package:flutter/material.dart'; |
||||
|
import 'package:flutter_intro/flutter_intro.dart'; |
||||
|
import 'package:flutter_screenutil/flutter_screenutil.dart'; |
||||
|
|
||||
|
class IntroOverlayBuilder { |
||||
|
static Widget aiBuilder( |
||||
|
StepWidgetParams params, |
||||
|
String text, { |
||||
|
bool alignment = true, |
||||
|
Function? onNext, |
||||
|
Function? onFinish, |
||||
|
}) { |
||||
|
return Column( |
||||
|
crossAxisAlignment: |
||||
|
alignment ? CrossAxisAlignment.start : CrossAxisAlignment.end, |
||||
|
children: [ |
||||
|
Padding( |
||||
|
padding: EdgeInsets.only(bottom: 10.w), |
||||
|
child: Text( |
||||
|
text, |
||||
|
style: TextStyle( |
||||
|
fontSize: 15.sp, |
||||
|
color: Colors.white, |
||||
|
fontWeight: FontWeight.bold, |
||||
|
), |
||||
|
), |
||||
|
), |
||||
|
Row( |
||||
|
children: [ |
||||
|
if (onNext != null) |
||||
|
_button( |
||||
|
'确定输入', |
||||
|
() { |
||||
|
params.onNext!(); |
||||
|
onNext(); |
||||
|
}, |
||||
|
), |
||||
|
if (onFinish != null) |
||||
|
_button( |
||||
|
'下一步', |
||||
|
() { |
||||
|
params.onFinish(); |
||||
|
onFinish(); |
||||
|
}, |
||||
|
), |
||||
|
], |
||||
|
), |
||||
|
], |
||||
|
); |
||||
|
} |
||||
|
|
||||
|
static Widget _button(String text, Function() onTap) { |
||||
|
return GestureDetector( |
||||
|
onTap: onTap, |
||||
|
child: Container( |
||||
|
padding: EdgeInsets.symmetric(horizontal: 10.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, |
||||
|
), |
||||
|
), |
||||
|
), |
||||
|
); |
||||
|
} |
||||
|
} |
||||
@ -1,15 +0,0 @@ |
|||||
import 'package:flutter/material.dart'; |
|
||||
|
|
||||
class SelectLocationMap extends StatefulWidget { |
|
||||
const SelectLocationMap({super.key}); |
|
||||
|
|
||||
@override |
|
||||
State<SelectLocationMap> createState() => _SelectLocationMapState(); |
|
||||
} |
|
||||
|
|
||||
class _SelectLocationMapState extends State<SelectLocationMap> { |
|
||||
@override |
|
||||
Widget build(BuildContext context) { |
|
||||
return const Placeholder(); |
|
||||
} |
|
||||
} |
|
||||
Loading…
Reference in new issue