Add settings screen for server URL and API token configuration

- New SettingsScreen with server_url and api_token fields, saved to SharedPreferences
- Add settings gear icon to HomeScreen AppBar
- Allows users to configure backend connection before first upload

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Misaka_Company
2026-05-27 20:08:35 +08:00
parent d11f33380c
commit d435de3bd0
2 changed files with 102 additions and 1 deletions

View File

@@ -4,6 +4,7 @@ import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import '../widgets/record_bottom_sheet.dart';
import 'settings_screen.dart';
class HomeScreen extends StatefulWidget {
const HomeScreen({super.key});
@@ -64,7 +65,17 @@ class _HomeScreenState extends State<HomeScreen> {
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(title: const Text('SnapLedger')),
appBar: AppBar(
title: const Text('SnapLedger'),
actions: [
IconButton(
icon: const Icon(Icons.settings),
onPressed: () => Navigator.of(context).push(
MaterialPageRoute(builder: (_) => const SettingsScreen()),
),
),
],
),
body: Center(
child: Padding(
padding: const EdgeInsets.all(32),