fbmobile/lib/ui/views/tabbar_container_view.dart

24 lines
659 B
Dart
Raw Normal View History

import 'package:fbmobile/ui/views/login_view.dart';
import 'package:fbmobile/ui/views/navbar_authenticated.dart';
2021-02-02 14:33:23 +00:00
import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
import '../../core/models/session.dart';
class TabBarContainerView extends StatelessWidget {
2023-01-04 20:17:54 +00:00
const TabBarContainerView({super.key});
2021-02-02 14:33:23 +00:00
@override
Widget build(BuildContext context) {
Session? currentSession = Provider.of<Session?>(context);
2023-01-16 00:44:34 +00:00
bool isAuthenticated =
currentSession != null ? currentSession.apiKey.isNotEmpty : false;
2021-02-02 14:33:23 +00:00
if (isAuthenticated) {
2023-01-04 20:17:54 +00:00
return const AuthenticatedNavBarView();
2021-02-02 14:33:23 +00:00
}
2023-01-04 20:17:54 +00:00
return LoginView();
2021-02-02 14:33:23 +00:00
}
}