Change PIN to 1451
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
78
apps/captain-mobile-v2/flutter/lib/main.dart
Normal file
78
apps/captain-mobile-v2/flutter/lib/main.dart
Normal file
@@ -0,0 +1,78 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
import 'providers/auth_provider.dart';
|
||||
import 'providers/chat_provider.dart';
|
||||
import 'screens/login_screen.dart';
|
||||
import 'screens/chat_screen.dart';
|
||||
|
||||
void main() {
|
||||
WidgetsFlutterBinding.ensureInitialized();
|
||||
SystemChrome.setSystemUIOverlayStyle(
|
||||
const SystemUiOverlayStyle(
|
||||
statusBarColor: Colors.transparent,
|
||||
statusBarIconBrightness: Brightness.light,
|
||||
),
|
||||
);
|
||||
runApp(const CaptainClaudeApp());
|
||||
}
|
||||
|
||||
class CaptainClaudeApp extends StatelessWidget {
|
||||
const CaptainClaudeApp({super.key});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return MultiProvider(
|
||||
providers: [
|
||||
ChangeNotifierProvider(create: (_) => AuthProvider()..init()),
|
||||
ChangeNotifierProvider(create: (_) => ChatProvider()),
|
||||
],
|
||||
child: MaterialApp(
|
||||
title: 'Captain Claude',
|
||||
debugShowCheckedModeBanner: false,
|
||||
theme: ThemeData(
|
||||
brightness: Brightness.dark,
|
||||
primaryColor: Colors.orange.shade700,
|
||||
scaffoldBackgroundColor: const Color(0xFF1A1A1A),
|
||||
colorScheme: ColorScheme.dark(
|
||||
primary: Colors.orange.shade700,
|
||||
secondary: Colors.orange.shade400,
|
||||
surface: const Color(0xFF2D2D2D),
|
||||
),
|
||||
appBarTheme: const AppBarTheme(
|
||||
backgroundColor: Color(0xFF2D2D2D),
|
||||
elevation: 0,
|
||||
),
|
||||
fontFamily: 'Roboto',
|
||||
),
|
||||
home: const AuthWrapper(),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
class AuthWrapper extends StatelessWidget {
|
||||
const AuthWrapper({super.key});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Consumer<AuthProvider>(
|
||||
builder: (context, auth, _) {
|
||||
if (auth.isLoading) {
|
||||
return const Scaffold(
|
||||
backgroundColor: Color(0xFF1A1A1A),
|
||||
body: Center(
|
||||
child: CircularProgressIndicator(color: Colors.orange),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
if (auth.isAuthenticated) {
|
||||
return const ChatScreen();
|
||||
}
|
||||
|
||||
return const LoginScreen();
|
||||
},
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user