spotube/lib/provider/Auth.dart
Kingkor Roy Tirtho 799e13c376 Flutter app added
2022-01-03 10:27:25 +06:00

31 lines
741 B
Dart

import 'package:flutter/cupertino.dart';
class Auth with ChangeNotifier {
String? _clientId;
String? _clientSecret;
bool _isLoggedIn = false;
String? get cliendId => _clientId;
String? get clientSecret => _clientSecret;
bool get isLoggedIn => _isLoggedIn;
void setAuthState({
bool? isLoggedIn,
bool safe = true,
String? clientId,
String? clientSecret,
String? refresh_token,
String? access_token,
}) {
if (safe) {
if (clientId != null) _clientId = clientId;
if (clientSecret != null) _clientSecret = clientSecret;
if (isLoggedIn != null) _isLoggedIn = isLoggedIn;
} else {
_clientId = clientId;
_clientSecret = clientSecret;
}
notifyListeners();
}
}