refactor: create separate BLoCs for each screen with comprehensive tests
- Created 8 separate BLoCs (Home, Library, BookDetails, AddBook, Scanner, Categories, Wishlist, Settings) - Each BLoC has its own event, state, and bloc files - Added 70 comprehensive tests covering all BLoC functionality - All tests passing (70/70) - Fixed linting issues and updated deprecated APIs - Improved code organization and maintainability
This commit is contained in:
43
bookshelf_flutter/lib/main.dart
Normal file
43
bookshelf_flutter/lib/main.dart
Normal file
@@ -0,0 +1,43 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_bloc/flutter_bloc.dart';
|
||||
import 'bloc/app_bloc.dart';
|
||||
import 'screens/home_screen.dart';
|
||||
|
||||
void main() {
|
||||
runApp(const BookshelfApp());
|
||||
}
|
||||
|
||||
class BookshelfApp extends StatelessWidget {
|
||||
const BookshelfApp({super.key});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return MaterialApp(
|
||||
title: 'Книжная полка',
|
||||
debugShowCheckedModeBanner: false,
|
||||
theme: ThemeData(
|
||||
useMaterial3: true,
|
||||
brightness: Brightness.dark,
|
||||
scaffoldBackgroundColor: const Color(0xFF112116),
|
||||
colorScheme: ColorScheme.dark(
|
||||
primary: const Color(0xFF17CF54),
|
||||
surface: const Color(0xFF1A3222),
|
||||
surfaceContainer: const Color(0xFF244730),
|
||||
onSurface: Colors.white,
|
||||
onSurfaceVariant: const Color(0xFF93C8A5),
|
||||
),
|
||||
appBarTheme: const AppBarTheme(
|
||||
backgroundColor: Color(0xFF112116),
|
||||
elevation: 0,
|
||||
centerTitle: true,
|
||||
),
|
||||
cardColor: const Color(0xFF1A3023),
|
||||
fontFamily: 'Inter',
|
||||
),
|
||||
home: BlocProvider(
|
||||
create: (context) => AppBloc(),
|
||||
child: const HomeScreen(),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user