import 'dart:async'; import 'package:imagini/core/imagini_application.dart'; import 'package:imagini/api/imagini_api_repository.dart'; import 'package:imagini/graphql/imagini_graphql.dart'; class SplashBloc{ final ImaginiApplication _application; final _loginController = StreamController(); Stream get loginResult => _loginController.stream; SplashBloc(this._application){ _init(); } void _init(){ // Do Initial Load initializeLogin(); } void dispose(){ _loginController.close(); } initializeLogin(){ ImaginiAPIRepository imaginiAPI = _application.imaginiAPI; // TODO: This should actually attempt to load the existing Tokens, not login _loginController.addStream(imaginiAPI.login("admin", "admin")); // imaginiAPI.login("admin", "admin1").listen((LoginResponse lr) { // }); } }