87 lines
2.9 KiB
Dart
87 lines
2.9 KiB
Dart
import 'package:flutter/material.dart';
|
|
|
|
import '../theme/wise_tokens.dart';
|
|
import 'app_buttons.dart';
|
|
import 'states.dart';
|
|
|
|
Future<void> showLoginSheet(BuildContext context, {String reason = '登录后保存当前动作'}) {
|
|
return showModalBottomSheet<void>(
|
|
context: context,
|
|
showDragHandle: true,
|
|
backgroundColor: WiseColors.surface,
|
|
shape: const RoundedRectangleBorder(
|
|
borderRadius: BorderRadius.vertical(top: Radius.circular(WiseRadius.lg)),
|
|
),
|
|
builder: (context) => Padding(
|
|
padding: const EdgeInsets.fromLTRB(20, 4, 20, 28),
|
|
child: Column(
|
|
mainAxisSize: MainAxisSize.min,
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
children: [
|
|
Text('登录研听', style: Theme.of(context).textTheme.titleLarge),
|
|
const SizedBox(height: WiseSpacing.x2),
|
|
Text(reason, style: Theme.of(context).textTheme.bodyMedium),
|
|
const SizedBox(height: WiseSpacing.x4),
|
|
AppButton(
|
|
label: '使用手机号继续',
|
|
icon: Icons.phone_iphone,
|
|
expand: true,
|
|
onPressed: () {
|
|
Navigator.pop(context);
|
|
showAppToast(context, '登录接口待接入,已保留当前页面');
|
|
},
|
|
),
|
|
const SizedBox(height: WiseSpacing.x2),
|
|
AppButton(
|
|
label: '微信 / Apple 登录占位',
|
|
icon: Icons.account_circle_outlined,
|
|
kind: AppButtonKind.ghost,
|
|
expand: true,
|
|
onPressed: () {
|
|
Navigator.pop(context);
|
|
showAppToast(context, '真实 auth 待后端接入');
|
|
},
|
|
),
|
|
],
|
|
),
|
|
),
|
|
);
|
|
}
|
|
|
|
Future<void> showOutboundSheet(BuildContext context, {required String title}) {
|
|
return showModalBottomSheet<void>(
|
|
context: context,
|
|
showDragHandle: true,
|
|
backgroundColor: WiseColors.surface,
|
|
shape: const RoundedRectangleBorder(
|
|
borderRadius: BorderRadius.vertical(top: Radius.circular(WiseRadius.lg)),
|
|
),
|
|
builder: (context) => Padding(
|
|
padding: const EdgeInsets.fromLTRB(20, 4, 20, 28),
|
|
child: Column(
|
|
mainAxisSize: MainAxisSize.min,
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
children: [
|
|
Text('即将打开外部服务', style: Theme.of(context).textTheme.titleLarge),
|
|
const SizedBox(height: WiseSpacing.x2),
|
|
Text(
|
|
'$title\n外跳仅用于了解原文或相关服务,本内容不构成投资建议。',
|
|
style: Theme.of(context).textTheme.bodyMedium,
|
|
),
|
|
const SizedBox(height: WiseSpacing.x4),
|
|
AppButton(
|
|
label: '确认并记录占位事件',
|
|
icon: Icons.open_in_new,
|
|
kind: AppButtonKind.accent,
|
|
expand: true,
|
|
onPressed: () {
|
|
Navigator.pop(context);
|
|
showAppToast(context, '外跳事件接口待接入');
|
|
},
|
|
),
|
|
],
|
|
),
|
|
),
|
|
);
|
|
}
|