Приложение на флаторе, настройки
This commit is contained in:
@@ -0,0 +1,35 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_bloc/flutter_bloc.dart';
|
||||
import '../bloc/chat_bloc.dart';
|
||||
import '../bloc/chat_state.dart';
|
||||
|
||||
class ChatsPage extends StatelessWidget {
|
||||
const ChatsPage({super.key});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return BlocBuilder<ChatBloc, ChatState>(
|
||||
builder: (context, state) {
|
||||
return state.when(
|
||||
initial: () => const Center(child: CircularProgressIndicator()),
|
||||
loading: () => const Center(child: CircularProgressIndicator()),
|
||||
chatsLoaded: (_) => const Center(
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
Icon(Icons.chat_bubble_outline, size: 64, color: Colors.grey),
|
||||
SizedBox(height: 16),
|
||||
Text('У вас пока нет чатов'),
|
||||
],
|
||||
),
|
||||
),
|
||||
chatSelected: (_, __) => const Center(child: Text('Chat selected')),
|
||||
messagesLoaded: (_) => const Center(child: Text('Messages loaded')),
|
||||
messageSent: () => const Center(child: Text('Message sent')),
|
||||
error: (message) => Center(child: Text('Ошибка: $message')),
|
||||
);
|
||||
},
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user