界面部分阶段性达成效果
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import '../services/webdav_service.dart';
|
||||
import 'webdav_file_list_page.dart';
|
||||
|
||||
class WebDAVSetupPage extends StatefulWidget {
|
||||
const WebDAVSetupPage({super.key});
|
||||
@@ -38,7 +39,6 @@ class _WebDAVSetupPageState extends State<WebDAVSetupPage> {
|
||||
_statusText = hasCred ? '已连接' : '未连接';
|
||||
if (hasCred) {
|
||||
_baseUrlController.text = WebDAVService.instance.baseUrl ?? '';
|
||||
// 用户名不显示,保持隐私
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -55,7 +55,7 @@ class _WebDAVSetupPageState extends State<WebDAVSetupPage> {
|
||||
_passwordController.text.trim(),
|
||||
);
|
||||
|
||||
// 尝试列出文件以验证连接
|
||||
// 验证连接
|
||||
await WebDAVService.instance.getMusicFiles();
|
||||
|
||||
setState(() {
|
||||
@@ -71,7 +71,13 @@ class _WebDAVSetupPageState extends State<WebDAVSetupPage> {
|
||||
backgroundColor: Color(0xFF4CAF50),
|
||||
),
|
||||
);
|
||||
Navigator.pop(context, true);
|
||||
// ✅ 登录成功 → 直接跳转到文件列表页
|
||||
Navigator.pushReplacement(
|
||||
context,
|
||||
MaterialPageRoute(
|
||||
builder: (_) => const WebDAVFileListPage(),
|
||||
),
|
||||
);
|
||||
}
|
||||
} catch (e) {
|
||||
setState(() {
|
||||
@@ -103,6 +109,7 @@ class _WebDAVSetupPageState extends State<WebDAVSetupPage> {
|
||||
backgroundColor: Colors.grey,
|
||||
),
|
||||
);
|
||||
Navigator.pop(context);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -115,6 +122,10 @@ class _WebDAVSetupPageState extends State<WebDAVSetupPage> {
|
||||
backgroundColor: Colors.transparent,
|
||||
elevation: 0,
|
||||
foregroundColor: Colors.white,
|
||||
leading: IconButton(
|
||||
icon: const Icon(Icons.arrow_back_ios_new),
|
||||
onPressed: () => Navigator.pop(context),
|
||||
),
|
||||
),
|
||||
body: Padding(
|
||||
padding: const EdgeInsets.all(24),
|
||||
|
||||
Reference in New Issue
Block a user