2022-12-16 13:40:55 +00:00
|
|
|
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 {
|
|
|
|
@override
|
|
|
|
Widget build(BuildContext context) {
|
2021-11-29 23:44:22 +00:00
|
|
|
Session? currentSession = Provider.of<Session?>(context);
|
2022-06-22 22:44:08 +00:00
|
|
|
bool isAuthenticated = currentSession != null ? currentSession.apiKey.isNotEmpty : false;
|
2021-02-02 14:33:23 +00:00
|
|
|
|
|
|
|
if (isAuthenticated) {
|
2022-12-16 13:40:55 +00:00
|
|
|
return AuthenticatedNavBarView();
|
2021-02-02 14:33:23 +00:00
|
|
|
}
|
|
|
|
|
2022-12-16 13:40:55 +00:00
|
|
|
return Container(
|
|
|
|
child: LoginView(),
|
|
|
|
);
|
2021-02-02 14:33:23 +00:00
|
|
|
}
|
|
|
|
}
|