66 lines
1.9 KiB
Dart
66 lines
1.9 KiB
Dart
import 'package:flutter/material.dart';
|
|
import 'package:shadcn_ui/shadcn_ui.dart';
|
|
|
|
import 'app_buttons.dart';
|
|
import 'states.dart';
|
|
|
|
Future<void> showLoginSheet(
|
|
BuildContext context, {
|
|
String reason = '登录后保存当前动作',
|
|
}) {
|
|
return showShadSheet<void>(
|
|
context: context,
|
|
side: ShadSheetSide.bottom,
|
|
builder: (context) => ShadSheet(
|
|
title: const Text('登录研听'),
|
|
description: Text(reason),
|
|
child: Column(
|
|
mainAxisSize: MainAxisSize.min,
|
|
children: [
|
|
AppButton(
|
|
label: '使用手机号继续',
|
|
icon: Icons.phone_iphone,
|
|
expand: true,
|
|
onPressed: () {
|
|
Navigator.pop(context);
|
|
showAppToast(context, '登录接口待接入,已保留当前页面');
|
|
},
|
|
),
|
|
const SizedBox(height: 8),
|
|
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 showShadSheet<void>(
|
|
context: context,
|
|
side: ShadSheetSide.bottom,
|
|
builder: (context) => ShadSheet(
|
|
title: const Text('即将打开外部服务'),
|
|
description: Text('$title\n外跳仅用于了解原文或相关服务,本内容不构成投资建议。'),
|
|
child: AppButton(
|
|
label: '确认并记录占位事件',
|
|
icon: Icons.open_in_new,
|
|
kind: AppButtonKind.accent,
|
|
expand: true,
|
|
onPressed: () {
|
|
Navigator.pop(context);
|
|
showAppToast(context, '外跳事件接口待接入');
|
|
},
|
|
),
|
|
),
|
|
);
|
|
}
|