fix avatar circular issue

hmxc
小赖 4 years ago
parent b59f735261
commit 4944b612ad

@ -20,6 +20,8 @@ class AkuAvatar extends StatelessWidget {
return userProvider.isLogin
? Material(
color: Colors.grey,
borderRadius: BorderRadius.circular((size ?? 72.w) / 2),
clipBehavior: Clip.antiAlias,
child: FadeInImage.assetNetwork(
placeholder: R.ASSETS_PLACEHOLDER_WEBP,
image: API.image(userProvider.profileModel.firstImg?.url ?? ''),

@ -2,8 +2,11 @@
import 'dart:io';
// Package imports:
import 'package:aku_community_manager/provider/user_provider.dart';
import 'package:aku_community_manager/ui/login/login_page.dart';
import 'package:bot_toast/bot_toast.dart';
import 'package:dio/dio.dart';
import 'package:get/get.dart';
import 'package:power_logger/power_logger.dart';
// Project imports:
@ -11,6 +14,7 @@ import 'package:aku_community_manager/const/api.dart';
import 'package:aku_community_manager/utils/network/base_file_model.dart';
import 'package:aku_community_manager/utils/network/base_list_model.dart';
import 'package:aku_community_manager/utils/network/base_model.dart';
import 'package:provider/provider.dart';
class NetUtil {
Dio _dio;
@ -44,7 +48,7 @@ class NetUtil {
///call auth after login
auth(String token) {
_dio.options.headers.putIfAbsent('App-Admin-Token', () => token);
_dio.options.headers.putIfAbsent('Butler-Admin-Token', () => token);
}
/// ## alias of Dio().get
@ -155,11 +159,11 @@ class NetUtil {
}
_parseRequestError(BaseModel model, {bool showMessage = false}) {
// final userProvider = Provider.of<UserProvider>(Get.context, listen: false);
// if (!model.status && model.message == '登录失效,请登录' && userProvider.isLogin) {
// userProvider.logout();
// Get.offAll(SignInPage());
// }
final userProvider = Provider.of<UserProvider>(Get.context, listen: false);
if (!model.status && model.message == '登录失效,请登录' && userProvider.isLogin) {
userProvider.logout();
Get.offAll(LoginPage());
}
if (!model.status || showMessage) {
BotToast.showText(text: model.message);
}

Loading…
Cancel
Save