fbmobile/lib/ui/views/tabbar_container_view.dart
2022-12-16 16:30:07 +01:00

22 lines
633 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 {
@override
Widget build(BuildContext context) {
Session? currentSession = Provider.of<Session?>(context);
bool isAuthenticated = currentSession != null ? currentSession.apiKey.isNotEmpty : false;
if (isAuthenticated) {
return AuthenticatedNavBarView();
}
return Container(
child: LoginView(),
);
}
}