go router 3

This commit is contained in:
mso7nueh
2024-06-06 13:50:00 +03:00
parent 4e62ebe60d
commit 7b55204659
19 changed files with 65 additions and 59 deletions

View File

@@ -1,8 +1,10 @@
import 'package:eatvio_app/app_router.dart';
import 'package:equatable/equatable.dart';
import 'package:flutter/material.dart';
import 'package:flutter_dotenv/flutter_dotenv.dart';
import 'package:hive/hive.dart';
import 'package:http/http.dart' as http;
import 'package:go_router/go_router.dart';
import 'dart:convert';
import '/core/app_export.dart';
import 'package:eatvio_app/presentation/chat/chat_screen/models/chat_model.dart';
@@ -24,7 +26,7 @@ class ChatBloc extends Bloc<ChatEvent, ChatState> {
final box = await Hive.openBox('token');
final token = box.get('token');
if (token == null) {
// go to auth screen
AppRouter.navigatorKey.currentContext?.goNamed('authScreen');
}
final String? chatID = state.chatModelObj?.chatID;
final response = await http.get(