This repository has been archived on 2023-11-13. You can view files and clone it, but cannot push or open issues or pull requests.
imagini/web_native/lib/blocs/splash_bloc.dart

36 lines
820 B
Dart
Raw Normal View History

import 'dart:async';
import 'package:imagini/core/imagini_application.dart';
import 'package:imagini/api/imagini_api_repository.dart';
2021-02-10 22:42:57 +00:00
import 'package:imagini/graphql/imagini_graphql.dart';
class SplashBloc{
final ImaginiApplication _application;
2021-02-10 22:42:57 +00:00
final _loginController = StreamController<Login$Query$AuthResponse>();
Stream<Login$Query$AuthResponse> get loginResult => _loginController.stream;
SplashBloc(this._application){
_init();
}
void _init(){
// Do Initial Load
initializeLogin();
}
void dispose(){
_loginController.close();
}
initializeLogin(){
ImaginiAPIRepository imaginiAPI = _application.imaginiAPI;
_loginController.addStream(imaginiAPI.login("admin", "admin2"));
// imaginiAPI.login("admin", "admin1").listen((LoginResponse lr) {
// });
}
}