feat(useragent): initial connection impl
This commit is contained in:
22
useragent/lib/providers/connection/bootstrap_token.dart
Normal file
22
useragent/lib/providers/connection/bootstrap_token.dart
Normal file
@@ -0,0 +1,22 @@
|
||||
|
||||
|
||||
import 'package:riverpod_annotation/riverpod_annotation.dart';
|
||||
|
||||
part 'bootstrap_token.g.dart';
|
||||
|
||||
@Riverpod(keepAlive: true)
|
||||
class BootstrapToken extends _$BootstrapToken {
|
||||
String? build() {
|
||||
return null;
|
||||
}
|
||||
|
||||
void set(String token) {
|
||||
state = token;
|
||||
}
|
||||
|
||||
String? take() {
|
||||
final token = state;
|
||||
state = null;
|
||||
return token;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user