import 'package:flutter/cupertino.dart'; import 'package:flutter_smart_dialog/flutter_smart_dialog.dart'; import 'package:huixiang/retrofit/retrofit_api.dart'; import 'package:huixiang/utils/flutter_utils.dart'; miniLogin(ApiService apiService, String storeId, Function(String token) callback) async { apiService.minLogin(storeId).then((baseData) async { if (baseData?.isSuccess ?? false) { callback.call(baseData.data["token"]); } }, onError: (error) { SmartDialog.showToast( AppUtils.dioErrorTypeToString(error.type), alignment: Alignment.center, ); debugPrint("${error}"); return Future.value(null); }).catchError((onError) { SmartDialog.showToast( AppUtils.dioErrorTypeToString(onError.type), alignment: Alignment.center, ); debugPrint("${onError}"); return Future.value(null); }); }