39 lines
1.0 KiB
Dart
39 lines
1.0 KiB
Dart
import 'package:flutter/material.dart';
|
|
import 'package:google_fonts/google_fonts.dart';
|
|
import 'package:camera/camera.dart';
|
|
import 'features/auth/presentation/login_screen.dart';
|
|
|
|
// Variabel global buat nyimpen daftar kamera di HP
|
|
List<CameraDescription> cameras = [];
|
|
|
|
Future<void> main() async {
|
|
// Wajib dipanggil sebelum inisialisasi hardware
|
|
WidgetsFlutterBinding.ensureInitialized();
|
|
|
|
// Ambil daftar kamera yang ada di HP
|
|
try {
|
|
cameras = await availableCameras();
|
|
} catch (e) {
|
|
debugPrint('Error inisialisasi kamera: $e');
|
|
}
|
|
|
|
runApp(const WalkGuideApp());
|
|
}
|
|
|
|
class WalkGuideApp extends StatelessWidget {
|
|
const WalkGuideApp({super.key});
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return MaterialApp(
|
|
title: 'Walk Guide',
|
|
debugShowCheckedModeBanner: false,
|
|
theme: ThemeData(
|
|
colorScheme: ColorScheme.fromSeed(seedColor: const Color(0xFF2563EB)),
|
|
textTheme: GoogleFonts.interTextTheme(),
|
|
useMaterial3: true,
|
|
),
|
|
home: const LoginScreen(),
|
|
);
|
|
}
|
|
} |