Browse Source

Merge branch 'new_dev' of https://github.com/deepcloud2048/deep_voice into new_dev

weicu
lxm 1 year ago
parent
commit
7507fbd1c4
  1. 65
      lib/core/widgets/intro_overlay_builder.dart
  2. 5
      lib/data/services/novice_guide_service.dart
  3. 4
      lib/modules/agent/views/agent_view.dart

65
lib/core/widgets/intro_overlay_builder.dart

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

5
lib/data/services/novice_guide_service.dart

@ -28,7 +28,6 @@ class NoviceGuideService extends GetxService {
'end': '小言能实时为你播报天气,试试其他指令吧',
'method': () async {
// 天气查询需要位置权限
await PermissionUtil.instance.requestPermission(
permissionType: Permission.location,
permissionName: 'locationInfo'.tr, // 位置信息
@ -128,8 +127,8 @@ class NoviceGuideService extends GetxService {
@override
void onInit() {
super.onInit();
// isHomeGuide = _storage.read('home_guide') ?? false;
// isAIGuide = _storage.read('ai_guide') ?? false;
isHomeGuide = _storage.read('home_guide') ?? false;
isAIGuide = _storage.read('ai_guide') ?? false;
}
@override

4
lib/modules/agent/views/agent_view.dart

@ -212,7 +212,9 @@ class _AgentViewState extends State<AgentView> with WidgetsBindingObserver {
() => IntroOverlayBuilder.homeBuilder(
params,
false,
title: '小言正在思考中~',
title: controller.newAIReplyCompleted.value
? '小言已经完成了回答!'
: '小言正在思考中~',
onNext: controller.newAIReplyCompleted.value ? () {} : null,
),
);

Loading…
Cancel
Save