feat(flutter): 接入分类记录收藏与下载授权
This commit is contained in:
1 parent
00280ca0da
commit
cc4d7c5a9d
52 files changed
+4440
-171
No files matched your search
@@ -9,9 +9,7 @@ import '../theme/app_colors.dart';
|
||||
/// 打开登录 / 注册页(沿用现有 Navigator 风格,不引路由库)
|
||||
Future<void> openAuthPage(BuildContext context, {bool signUpMode = false}) {
|
||||
return Navigator.of(context).push(
|
||||
MaterialPageRoute<void>(
|
||||
builder: (_) => AuthPage(signUpMode: signUpMode),
|
||||
),
|
||||
MaterialPageRoute<void>(builder: (_) => AuthPage(signUpMode: signUpMode)),
|
||||
);
|
||||
}
|
||||
|
||||
@@ -81,3 +79,44 @@ Future<bool> ensureSignedIn(BuildContext context) async {
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/// 页面级登录引导,用于记录、收藏和下载等必须登录的独立页面。
|
||||
class AuthGatePanel extends StatelessWidget {
|
||||
const AuthGatePanel({super.key});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final l10n = AppLocalizations.of(context)!;
|
||||
return Center(
|
||||
key: const Key('auth-gate-panel'),
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 32),
|
||||
child: Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
Text(
|
||||
l10n.authGateTitle,
|
||||
textAlign: TextAlign.center,
|
||||
style: const TextStyle(
|
||||
color: Colors.white,
|
||||
fontSize: 18,
|
||||
fontWeight: FontWeight.w800,
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 8),
|
||||
Text(
|
||||
l10n.authGateMessage,
|
||||
textAlign: TextAlign.center,
|
||||
style: const TextStyle(color: AppColors.muted, fontSize: 13),
|
||||
),
|
||||
const SizedBox(height: 18),
|
||||
FilledButton(
|
||||
onPressed: () => openAuthPage(context),
|
||||
child: Text(l10n.authGateAction),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user