Skip to content

Commit 6d44bd9

Browse files
committed
Ok
1 parent 85e77ce commit 6d44bd9

File tree

3 files changed

+8
-3
lines changed

3 files changed

+8
-3
lines changed

lib/main.dart

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,12 @@ import 'presentation/pages/product_page.dart';
99
Future<void> main() async {
1010
WidgetsFlutterBinding.ensureInitialized();
1111
await di.init();
12-
runApp(MyApp());
12+
runApp(const MyApp());
1313
}
1414

1515
class MyApp extends StatelessWidget {
16+
const MyApp({super.key});
17+
1618
@override
1719
Widget build(BuildContext context) {
1820
return MultiProvider(

lib/presentation/bloc/product_bloc.dart

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11

22
import 'package:clean_architecture_using_bloc/presentation/bloc/product_event.dart';
3+
import 'package:flutter/foundation.dart';
34
import 'package:flutter_bloc/flutter_bloc.dart';
45
import '../../domain/usecases/GetProducts.dart';
56
import 'bloc_state.dart';
@@ -24,7 +25,9 @@ class ProductBloc extends Bloc<ProductEvent, ProductState> {
2425
final products = await getProducts();
2526
emit(ProductLoaded(products));
2627
} catch (e) {
27-
print('Error in ProductBloc: $e'); // Log the error
28+
if (kDebugMode) {
29+
print('Error in ProductBloc: $e');
30+
} // Log the error
2831
emit(ProductError('Failed to fetch products'));
2932
}
3033
});

lib/presentation/widgets/product_list.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ class ProductList extends StatelessWidget {
2525
itemBuilder: (context, index) {
2626
final product = state.products[index];
2727
return Card(
28-
elevation: 2.0,
28+
elevation: 1.0,
2929
child: Column(
3030
children: [
3131
Expanded(

0 commit comments

Comments
 (0)