fbmobile/lib/ui/views/tabbar_container_view.dart
2023-01-16 01:44:51 +01:00

23 lines
659 B
Dart

import 'package:fbmobile/ui/views/login_view.dart';
import 'package:fbmobile/ui/views/navbar_authenticated.dart';
import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
import '../../core/models/session.dart';
class TabBarContainerView extends StatelessWidget {
const TabBarContainerView({super.key});
@override
Widget build(BuildContext context) {
Session? currentSession = Provider.of<Session?>(context);
bool isAuthenticated =
currentSession != null ? currentSession.apiKey.isNotEmpty : false;
if (isAuthenticated) {
return const AuthenticatedNavBarView();
}
return LoginView();
}
}