fix localprofile button
This commit is contained in:
parent
b8c2aab73c
commit
6e100c84ce
|
@ -21,13 +21,18 @@ class LocalProfileComponentWidget extends StatefulWidget {
|
|||
}
|
||||
|
||||
class _LocalProfileComponentWidgetState extends State<LocalProfileComponentWidget> {
|
||||
bool _isLoading = false;
|
||||
|
||||
Future retrieveProfileInfo() async {
|
||||
|
||||
setState(() {_isLoading = true;});
|
||||
|
||||
Future callback() async {
|
||||
await StorageHelper().set(KeychainStorageKey.clientUUID.value, '');
|
||||
LocalsRepositoryImpl.license.add(false);
|
||||
final response = await LocalsRepositoryImpl().update(context);
|
||||
LocalsRepositoryImpl.license.add(response);
|
||||
|
||||
setState(() {_isLoading = false;});
|
||||
}
|
||||
|
||||
@override
|
||||
|
@ -58,7 +63,7 @@ class _LocalProfileComponentWidgetState extends State<LocalProfileComponentWidge
|
|||
|
||||
return BlocBuilder<LocalProfileBloc, LocalProfileState>(
|
||||
builder: (context, state) {
|
||||
return _buildAsyncLocalProfile(context, state, limitedFontSize, callback);
|
||||
return _buildAsyncLocalProfile(context, state, limitedFontSize);
|
||||
},
|
||||
);
|
||||
|
||||
|
@ -96,12 +101,7 @@ class _LocalProfileComponentWidgetState extends State<LocalProfileComponentWidge
|
|||
focusColor: Colors.transparent,
|
||||
hoverColor: Colors.transparent,
|
||||
highlightColor: Colors.transparent,
|
||||
onTap: () async {
|
||||
await StorageHelper().set(KeychainStorageKey.clientUUID.value, '');
|
||||
LocalsRepositoryImpl.license.add(false);
|
||||
final response = await LocalsRepositoryImpl().update(context);
|
||||
LocalsRepositoryImpl.license.add(response);
|
||||
},
|
||||
onTap: _isLoading ? null : retrieveProfileInfo,
|
||||
child: ClipRRect(
|
||||
borderRadius: BorderRadius.circular(200.0),
|
||||
child: CachedNetworkImage(
|
||||
|
@ -157,7 +157,7 @@ class _LocalProfileComponentWidgetState extends State<LocalProfileComponentWidge
|
|||
);
|
||||
}
|
||||
|
||||
Container _buildAsyncLocalProfile(BuildContext context, LocalProfileState state, double limitedFontSize, Future Function() callback) {
|
||||
Container _buildAsyncLocalProfile(BuildContext context, LocalProfileState state, double limitedFontSize) {
|
||||
return Container(
|
||||
decoration: const BoxDecoration(),
|
||||
child: Align(
|
||||
|
@ -186,7 +186,7 @@ class _LocalProfileComponentWidgetState extends State<LocalProfileComponentWidge
|
|||
focusColor: Colors.transparent,
|
||||
hoverColor: Colors.transparent,
|
||||
highlightColor: Colors.transparent,
|
||||
onTap: callback,
|
||||
onTap: _isLoading ? null : retrieveProfileInfo,
|
||||
child: ClipRRect(
|
||||
borderRadius: BorderRadius.circular(200.0),
|
||||
child: CachedNetworkImage(
|
||||
|
|
Loading…
Reference in New Issue