import 'package:flutter/material.dart'; import 'package:flutter_bloc/flutter_bloc.dart'; import '../bloc/navigation_bloc.dart'; import '../models/models.dart'; class ScannerScreen extends StatelessWidget { const ScannerScreen({super.key}); @override Widget build(BuildContext context) { return Scaffold( backgroundColor: Colors.black, body: Stack( children: [ // Camera placeholder Container(color: Colors.black87), // Scan frame Center( child: FractionallySizedBox( widthFactor: 0.75, child: AspectRatio( aspectRatio: 2 / 3, child: Container( decoration: BoxDecoration( border: Border.all(color: Colors.white30, width: 2), borderRadius: BorderRadius.circular(12), ), child: const Center( child: Text( 'Камера недоступна\n(заглушка)', textAlign: TextAlign.center, style: TextStyle(color: Colors.white38), ), ), ), ), ), ), // Header SafeArea( child: Padding( padding: const EdgeInsets.all(8), child: Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ IconButton( icon: const Icon(Icons.close, color: Colors.white), onPressed: () => context.read().add( NavigateTo(AppScreen.addBook), ), ), Container( padding: const EdgeInsets.symmetric( horizontal: 12, vertical: 6, ), decoration: BoxDecoration( color: const Color(0xFF17CF54), borderRadius: BorderRadius.circular(8), ), child: const Text( 'СКАНЕР', style: TextStyle( fontWeight: FontWeight.bold, fontSize: 12, ), ), ), const SizedBox(width: 48), ], ), ), ), // Instructions Positioned( bottom: 140, left: 0, right: 0, child: Text( 'Поместите обложку в рамку', textAlign: TextAlign.center, style: TextStyle(color: Colors.grey.shade400), ), ), // Capture button Positioned( bottom: 50, left: 0, right: 0, child: Center( child: GestureDetector( onTap: () { // Placeholder - no actual camera capture ScaffoldMessenger.of(context).showSnackBar( const SnackBar( content: Text('Камера не подключена (заглушка)'), ), ); }, child: Container( width: 80, height: 80, decoration: BoxDecoration( shape: BoxShape.circle, border: Border.all(color: Colors.white, width: 4), ), child: Center( child: Container( width: 64, height: 64, decoration: const BoxDecoration( shape: BoxShape.circle, color: Colors.white, ), ), ), ), ), ), ), ], ), ); } }