feat(mobile-next): 工号登录与目录薄适配,并完成登录/会话/聊天/通讯录第一批界面
Co-authored-by: Cursor <cursoragent@cursor.com> Co-authored-by: multica-agent <github@multica.ai>
This commit is contained in:
co-authored by
Cursor
multica-agent
parent
d787c0a477
commit
60b6590409
@@ -0,0 +1,80 @@
|
||||
import 'package:dio/dio.dart';
|
||||
|
||||
import '../config/app_endpoints.dart';
|
||||
|
||||
class AuthResult {
|
||||
final String userID;
|
||||
final String imToken;
|
||||
final String nickname;
|
||||
|
||||
AuthResult({required this.userID, required this.imToken, required this.nickname});
|
||||
|
||||
factory AuthResult.fromJson(Map<String, dynamic> json) => AuthResult(
|
||||
userID: json['userID']?.toString() ?? '',
|
||||
imToken: json['imToken']?.toString() ?? '',
|
||||
nickname: json['nickname']?.toString() ?? '',
|
||||
);
|
||||
}
|
||||
|
||||
class AuthException implements Exception {
|
||||
final String message;
|
||||
final bool network;
|
||||
|
||||
AuthException(this.message, {this.network = false});
|
||||
|
||||
@override
|
||||
String toString() => message;
|
||||
}
|
||||
|
||||
/// 公司工号登录。只走账号服务 POST /api/login,不改 OpenIM Server。
|
||||
class AuthApi {
|
||||
AuthApi({Dio? dio})
|
||||
: _dio = dio ??
|
||||
Dio(BaseOptions(
|
||||
baseUrl: AppEndpoints.authApiBase,
|
||||
connectTimeout: const Duration(seconds: 10),
|
||||
receiveTimeout: const Duration(seconds: 10),
|
||||
));
|
||||
|
||||
final Dio _dio;
|
||||
|
||||
Map<String, dynamic> _unwrap(dynamic body) {
|
||||
if (body is Map<String, dynamic>) {
|
||||
if (body['code'] == 0 && body['data'] is Map) {
|
||||
return Map<String, dynamic>.from(body['data'] as Map);
|
||||
}
|
||||
final msg = body['msg']?.toString() ?? '';
|
||||
throw AuthException(msg.isNotEmpty ? msg : '工号或密码不正确');
|
||||
}
|
||||
throw AuthException('工号或密码不正确');
|
||||
}
|
||||
|
||||
Future<AuthResult> login({
|
||||
required String staffNo,
|
||||
required String password,
|
||||
required int platformID,
|
||||
}) async {
|
||||
try {
|
||||
final resp = await _dio.post('/api/login', data: {
|
||||
'staffNo': staffNo,
|
||||
'password': password,
|
||||
'platformID': platformID,
|
||||
});
|
||||
final result = AuthResult.fromJson(_unwrap(resp.data));
|
||||
if (result.userID.isEmpty || result.imToken.isEmpty) {
|
||||
throw AuthException('工号或密码不正确');
|
||||
}
|
||||
return result;
|
||||
} on DioException catch (e) {
|
||||
final data = e.response?.data;
|
||||
if (data is Map && data['msg'] != null && data['msg'].toString().isNotEmpty) {
|
||||
throw AuthException(data['msg'].toString());
|
||||
}
|
||||
throw AuthException('网络异常,请稍后重试', network: true);
|
||||
} on AuthException {
|
||||
rethrow;
|
||||
} catch (_) {
|
||||
throw AuthException('网络异常,请稍后重试', network: true);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,69 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:openim/core/controller/im_controller.dart';
|
||||
import 'package:openim/pages/conversation/conversation_logic.dart';
|
||||
import 'package:openim/routes/app_navigator.dart';
|
||||
import 'package:openim_common/openim_common.dart';
|
||||
|
||||
import 'auth_api.dart';
|
||||
|
||||
class CompanyLoginLogic extends GetxController {
|
||||
final staffCtrl = TextEditingController();
|
||||
final pwdCtrl = TextEditingController();
|
||||
final obscure = true.obs;
|
||||
final submitting = false.obs;
|
||||
final staffError = RxnString();
|
||||
final pwdError = RxnString();
|
||||
final toast = RxnString();
|
||||
|
||||
final _auth = AuthApi();
|
||||
final _im = Get.find<IMController>();
|
||||
|
||||
@override
|
||||
void onClose() {
|
||||
staffCtrl.dispose();
|
||||
pwdCtrl.dispose();
|
||||
super.onClose();
|
||||
}
|
||||
|
||||
void toggleObscure() => obscure.toggle();
|
||||
|
||||
Future<void> submit() async {
|
||||
if (submitting.value) return;
|
||||
final staffNo = staffCtrl.text.trim();
|
||||
final password = pwdCtrl.text;
|
||||
staffError.value = staffNo.isEmpty ? '请输入工号' : null;
|
||||
pwdError.value = password.isEmpty ? '请输入密码' : null;
|
||||
if (staffNo.isEmpty || password.isEmpty) return;
|
||||
|
||||
submitting.value = true;
|
||||
toast.value = null;
|
||||
try {
|
||||
final result = await _auth.login(
|
||||
staffNo: staffNo,
|
||||
password: password,
|
||||
platformID: IMUtils.getPlatform(),
|
||||
);
|
||||
final cert = LoginCertificate.fromJson({
|
||||
'userID': result.userID,
|
||||
'imToken': result.imToken,
|
||||
'chatToken': result.imToken,
|
||||
});
|
||||
await DataSp.putLoginCertificate(cert);
|
||||
await DataSp.putLoginAccount({'phoneNumber': staffNo, 'loginType': 2});
|
||||
await DataSp.putLoginType(2);
|
||||
Logger.print('company login : ${result.userID}');
|
||||
await _im.login(result.userID, result.imToken);
|
||||
final conversations = await ConversationLogic.getConversationFirstPage();
|
||||
Get.find<CacheController>().resetCache();
|
||||
AppNavigator.startMain(conversations: conversations);
|
||||
} on AuthException catch (e) {
|
||||
toast.value = e.network ? '网络异常,请稍后重试' : '工号或密码不正确';
|
||||
} catch (e, s) {
|
||||
Logger.print('company login e: $e $s');
|
||||
toast.value = '网络异常,请稍后重试';
|
||||
} finally {
|
||||
submitting.value = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,73 @@
|
||||
import 'package:dio/dio.dart';
|
||||
import 'package:openim_common/openim_common.dart';
|
||||
|
||||
import '../auth/auth_api.dart';
|
||||
import '../config/app_endpoints.dart';
|
||||
|
||||
class DirectoryUser {
|
||||
final String userID;
|
||||
final String nickname;
|
||||
final String department;
|
||||
final String title;
|
||||
final String faceURL;
|
||||
|
||||
DirectoryUser({
|
||||
required this.userID,
|
||||
required this.nickname,
|
||||
required this.department,
|
||||
required this.title,
|
||||
required this.faceURL,
|
||||
});
|
||||
|
||||
factory DirectoryUser.fromJson(Map<String, dynamic> json) => DirectoryUser(
|
||||
userID: json['userID']?.toString() ?? '',
|
||||
nickname: json['nickname']?.toString() ?? '',
|
||||
department: json['department']?.toString() ?? '',
|
||||
title: json['title']?.toString() ?? '',
|
||||
faceURL: json['faceURL']?.toString() ?? '',
|
||||
);
|
||||
}
|
||||
|
||||
/// 员工目录。数据来自账号服务 GET /api/directory,发起好友仍走官方 SDK。
|
||||
class DirectoryApi {
|
||||
DirectoryApi({Dio? dio})
|
||||
: _dio = dio ??
|
||||
Dio(BaseOptions(
|
||||
baseUrl: AppEndpoints.authApiBase,
|
||||
connectTimeout: const Duration(seconds: 10),
|
||||
receiveTimeout: const Duration(seconds: 10),
|
||||
));
|
||||
|
||||
final Dio _dio;
|
||||
|
||||
Future<List<DirectoryUser>> search({String keyword = '', int limit = 20}) async {
|
||||
final token = DataSp.imToken;
|
||||
if (token == null || token.isEmpty) {
|
||||
throw AuthException('登录已过期,请重新登录');
|
||||
}
|
||||
try {
|
||||
final resp = await _dio.get(
|
||||
'/api/directory',
|
||||
queryParameters: {'keyword': keyword, 'limit': limit},
|
||||
options: Options(headers: {'Authorization': 'Bearer $token'}),
|
||||
);
|
||||
final body = resp.data;
|
||||
if (body is Map && body['code'] == 0 && body['data'] is Map) {
|
||||
final items = (body['data']['items'] as List?) ?? const [];
|
||||
return items
|
||||
.whereType<Map>()
|
||||
.map((e) => DirectoryUser.fromJson(Map<String, dynamic>.from(e)))
|
||||
.where((e) => e.userID.isNotEmpty)
|
||||
.toList();
|
||||
}
|
||||
final msg = body is Map ? body['msg']?.toString() : null;
|
||||
throw AuthException((msg != null && msg.isNotEmpty) ? msg : '员工目录暂不可用');
|
||||
} on DioException catch (e) {
|
||||
final data = e.response?.data;
|
||||
if (data is Map && data['msg'] != null && data['msg'].toString().isNotEmpty) {
|
||||
throw AuthException(data['msg'].toString());
|
||||
}
|
||||
throw AuthException('网络异常,请稍后重试', network: true);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,194 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_openim_sdk/flutter_openim_sdk.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:openim_common/openim_common.dart';
|
||||
|
||||
import '../auth/auth_api.dart';
|
||||
import '../brand/app_tokens.dart';
|
||||
import '../directory/directory_api.dart';
|
||||
|
||||
class AddColleagueLogic extends GetxController {
|
||||
final staffCtrl = TextEditingController();
|
||||
final msgCtrl = TextEditingController(text: '你好,我想加你为同事');
|
||||
final sending = false.obs;
|
||||
final staffError = RxnString();
|
||||
final directoryHint = RxnString();
|
||||
|
||||
final _directory = DirectoryApi();
|
||||
|
||||
@override
|
||||
void onClose() {
|
||||
staffCtrl.dispose();
|
||||
msgCtrl.dispose();
|
||||
super.onClose();
|
||||
}
|
||||
|
||||
Future<void> lookupDirectory() async {
|
||||
final id = staffCtrl.text.trim();
|
||||
if (id.isEmpty) {
|
||||
directoryHint.value = null;
|
||||
return;
|
||||
}
|
||||
try {
|
||||
final items = await _directory.search(keyword: id, limit: 5);
|
||||
final hit = items.where((e) => e.userID == id).toList();
|
||||
if (hit.isNotEmpty) {
|
||||
directoryHint.value = hit.first.nickname;
|
||||
} else if (items.isNotEmpty) {
|
||||
directoryHint.value = items.map((e) => '${e.nickname}(${e.userID})').join('、');
|
||||
} else {
|
||||
directoryHint.value = null;
|
||||
}
|
||||
} catch (_) {
|
||||
directoryHint.value = null;
|
||||
}
|
||||
}
|
||||
|
||||
Future<void> send() async {
|
||||
if (sending.value) return;
|
||||
final id = staffCtrl.text.trim();
|
||||
if (id.isEmpty) {
|
||||
staffError.value = '请输入对方工号';
|
||||
return;
|
||||
}
|
||||
staffError.value = null;
|
||||
sending.value = true;
|
||||
try {
|
||||
await OpenIM.iMManager.friendshipManager.addFriend(
|
||||
userID: id,
|
||||
reason: msgCtrl.text.trim().isEmpty ? '你好,我想加你为同事' : msgCtrl.text.trim(),
|
||||
);
|
||||
IMViews.showToast('申请已发送,等对方通过');
|
||||
Get.back();
|
||||
} on AuthException catch (e) {
|
||||
IMViews.showToast(e.message);
|
||||
} catch (_) {
|
||||
IMViews.showToast('发送失败,请确认工号正确、网络正常');
|
||||
} finally {
|
||||
sending.value = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
class AddColleaguePage extends StatelessWidget {
|
||||
const AddColleaguePage({super.key});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final logic = Get.put(AddColleagueLogic());
|
||||
return Scaffold(
|
||||
backgroundColor: AppColors.pageBg,
|
||||
appBar: AppBar(
|
||||
title: const Text('添加同事'),
|
||||
leading: IconButton(
|
||||
icon: const Icon(Icons.arrow_back_ios_new, size: AppIconSize.md),
|
||||
onPressed: Get.back,
|
||||
),
|
||||
),
|
||||
body: Padding(
|
||||
padding: const EdgeInsets.all(AppGap.x4),
|
||||
child: Column(
|
||||
children: [
|
||||
Obx(() => _box(
|
||||
controller: logic.staffCtrl,
|
||||
hint: '请输入对方工号',
|
||||
height: 48,
|
||||
error: logic.staffError.value,
|
||||
enabled: !logic.sending.value,
|
||||
onChanged: (_) {
|
||||
logic.staffError.value = null;
|
||||
logic.lookupDirectory();
|
||||
},
|
||||
)),
|
||||
Obx(() {
|
||||
final hint = logic.directoryHint.value;
|
||||
if (hint == null) return const SizedBox.shrink();
|
||||
return Padding(
|
||||
padding: const EdgeInsets.only(top: AppGap.x2),
|
||||
child: Align(
|
||||
alignment: Alignment.centerLeft,
|
||||
child: Text(hint, style: const TextStyle(fontSize: AppFont.sub, color: AppColors.textSecondary)),
|
||||
),
|
||||
);
|
||||
}),
|
||||
const SizedBox(height: AppGap.x3),
|
||||
_box(
|
||||
controller: logic.msgCtrl,
|
||||
hint: '你好,我想加你为同事',
|
||||
height: 96,
|
||||
maxLines: 4,
|
||||
enabled: !logic.sending.value,
|
||||
),
|
||||
const Spacer(),
|
||||
Obx(() {
|
||||
final busy = logic.sending.value;
|
||||
return SizedBox(
|
||||
width: double.infinity,
|
||||
height: 48,
|
||||
child: FilledButton(
|
||||
onPressed: busy ? null : logic.send,
|
||||
style: FilledButton.styleFrom(
|
||||
backgroundColor: AppColors.primary,
|
||||
disabledBackgroundColor: AppColors.primary.withOpacity(0.4),
|
||||
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(AppRadius.control)),
|
||||
),
|
||||
child: busy
|
||||
? const SizedBox(
|
||||
width: 16,
|
||||
height: 16,
|
||||
child: CircularProgressIndicator(strokeWidth: 2, color: Colors.white),
|
||||
)
|
||||
: const Text('发送申请', style: TextStyle(fontSize: AppFont.body, color: Colors.white)),
|
||||
),
|
||||
);
|
||||
}),
|
||||
const SizedBox(height: AppGap.x4),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Widget _box({
|
||||
required TextEditingController controller,
|
||||
required String hint,
|
||||
required double height,
|
||||
int maxLines = 1,
|
||||
String? error,
|
||||
bool enabled = true,
|
||||
ValueChanged<String>? onChanged,
|
||||
}) {
|
||||
return Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Container(
|
||||
height: height,
|
||||
padding: const EdgeInsets.symmetric(horizontal: AppGap.x3, vertical: AppGap.x2),
|
||||
decoration: BoxDecoration(
|
||||
color: AppColors.searchBg,
|
||||
borderRadius: BorderRadius.circular(AppRadius.control),
|
||||
border: Border.all(color: error != null ? AppColors.danger : Colors.transparent),
|
||||
),
|
||||
child: TextField(
|
||||
controller: controller,
|
||||
maxLines: maxLines,
|
||||
enabled: enabled,
|
||||
onChanged: onChanged,
|
||||
style: const TextStyle(fontSize: AppFont.body, color: AppColors.textPrimary),
|
||||
decoration: InputDecoration(
|
||||
isDense: true,
|
||||
border: InputBorder.none,
|
||||
hintText: hint,
|
||||
hintStyle: const TextStyle(fontSize: AppFont.body, color: AppColors.textSecondary),
|
||||
),
|
||||
),
|
||||
),
|
||||
if (error != null)
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(top: AppGap.x1),
|
||||
child: Text(error, style: const TextStyle(fontSize: AppFont.small, color: AppColors.danger)),
|
||||
),
|
||||
],
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,202 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:openim_common/openim_common.dart';
|
||||
|
||||
import '../auth/company_login_logic.dart';
|
||||
import '../brand/app_tokens.dart';
|
||||
import '../feature_flags.dart';
|
||||
|
||||
/// 登录页第一批:v2 布局 + Token,保留 OpenIM 标识,不做畅联换标。
|
||||
class CompanyLoginPage extends StatelessWidget {
|
||||
const CompanyLoginPage({super.key});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final logic = Get.find<CompanyLoginLogic>();
|
||||
return Scaffold(
|
||||
backgroundColor: AppColors.pageBg,
|
||||
body: SafeArea(
|
||||
child: LayoutBuilder(
|
||||
builder: (context, constraints) {
|
||||
return SingleChildScrollView(
|
||||
padding: const EdgeInsets.symmetric(horizontal: AppGap.x8),
|
||||
child: ConstrainedBox(
|
||||
constraints: BoxConstraints(minHeight: constraints.maxHeight),
|
||||
child: IntrinsicHeight(
|
||||
child: Column(
|
||||
children: [
|
||||
const Spacer(flex: 2),
|
||||
_logo(),
|
||||
const SizedBox(height: AppGap.x4),
|
||||
Text(
|
||||
FeatureFlags.brandMigration ? '畅联' : 'OpenIM',
|
||||
style: const TextStyle(
|
||||
fontSize: 22,
|
||||
fontWeight: FontWeight.w700,
|
||||
color: AppColors.textPrimary,
|
||||
),
|
||||
),
|
||||
const SizedBox(height: AppGap.x1),
|
||||
const Text(
|
||||
'企业内部通讯',
|
||||
style: TextStyle(fontSize: AppFont.sub, color: AppColors.textSecondary),
|
||||
),
|
||||
const SizedBox(height: AppGap.x8),
|
||||
Obx(() => _field(
|
||||
controller: logic.staffCtrl,
|
||||
hint: '请输入工号',
|
||||
icon: Icons.person_outline,
|
||||
error: logic.staffError.value,
|
||||
enabled: !logic.submitting.value,
|
||||
)),
|
||||
const SizedBox(height: AppGap.x3),
|
||||
Obx(() => _field(
|
||||
controller: logic.pwdCtrl,
|
||||
hint: '请输入密码',
|
||||
icon: Icons.lock_outline,
|
||||
obscure: logic.obscure.value,
|
||||
onToggleObscure: logic.toggleObscure,
|
||||
error: logic.pwdError.value,
|
||||
enabled: !logic.submitting.value,
|
||||
onSubmitted: (_) => logic.submit(),
|
||||
)),
|
||||
const SizedBox(height: AppGap.x4),
|
||||
Obx(() => _loginButton(logic)),
|
||||
const SizedBox(height: AppGap.x3),
|
||||
const Text(
|
||||
'登录即代表同意内部使用规范',
|
||||
style: TextStyle(fontSize: AppFont.small, color: AppColors.textSecondary),
|
||||
),
|
||||
Obx(() {
|
||||
final msg = logic.toast.value;
|
||||
if (msg == null) return const SizedBox.shrink();
|
||||
return Padding(
|
||||
padding: const EdgeInsets.only(top: AppGap.x3),
|
||||
child: Text(
|
||||
msg,
|
||||
style: const TextStyle(fontSize: AppFont.sub, color: AppColors.danger),
|
||||
),
|
||||
);
|
||||
}),
|
||||
const Spacer(flex: 3),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
},
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Widget _logo() {
|
||||
return ClipRRect(
|
||||
borderRadius: BorderRadius.circular(AppRadius.logo),
|
||||
child: Container(
|
||||
width: 72,
|
||||
height: 72,
|
||||
color: AppColors.primary,
|
||||
alignment: Alignment.center,
|
||||
child: ImageRes.loginLogo.toImage
|
||||
..width = 48
|
||||
..height = 48,
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Widget _field({
|
||||
required TextEditingController controller,
|
||||
required String hint,
|
||||
required IconData icon,
|
||||
String? error,
|
||||
bool obscure = false,
|
||||
VoidCallback? onToggleObscure,
|
||||
bool enabled = true,
|
||||
ValueChanged<String>? onSubmitted,
|
||||
}) {
|
||||
final borderColor = error != null ? AppColors.danger : Colors.transparent;
|
||||
return Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Container(
|
||||
height: 48,
|
||||
decoration: BoxDecoration(
|
||||
color: AppColors.searchBg,
|
||||
borderRadius: BorderRadius.circular(AppRadius.control),
|
||||
border: Border.all(color: borderColor, width: error != null ? 1 : 0),
|
||||
),
|
||||
padding: const EdgeInsets.symmetric(horizontal: AppGap.x3),
|
||||
child: Row(
|
||||
children: [
|
||||
Icon(icon, size: AppIconSize.sm, color: AppColors.textSecondary),
|
||||
const SizedBox(width: AppGap.x2),
|
||||
Expanded(
|
||||
child: TextField(
|
||||
controller: controller,
|
||||
enabled: enabled,
|
||||
obscureText: obscure,
|
||||
onSubmitted: onSubmitted,
|
||||
inputFormatters: [LengthLimitingTextInputFormatter(32)],
|
||||
style: const TextStyle(fontSize: AppFont.body, color: AppColors.textPrimary),
|
||||
decoration: InputDecoration(
|
||||
isDense: true,
|
||||
border: InputBorder.none,
|
||||
hintText: hint,
|
||||
hintStyle: const TextStyle(fontSize: AppFont.body, color: AppColors.textSecondary),
|
||||
),
|
||||
),
|
||||
),
|
||||
if (onToggleObscure != null)
|
||||
IconButton(
|
||||
onPressed: onToggleObscure,
|
||||
icon: Icon(
|
||||
obscure ? Icons.visibility_off_outlined : Icons.visibility_outlined,
|
||||
size: AppIconSize.sm,
|
||||
color: AppColors.textSecondary,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
if (error != null)
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(top: AppGap.x1, left: AppGap.x1),
|
||||
child: Text(error, style: const TextStyle(fontSize: AppFont.small, color: AppColors.danger)),
|
||||
),
|
||||
],
|
||||
);
|
||||
}
|
||||
|
||||
Widget _loginButton(CompanyLoginLogic logic) {
|
||||
final busy = logic.submitting.value;
|
||||
return SizedBox(
|
||||
width: double.infinity,
|
||||
height: 48,
|
||||
child: FilledButton(
|
||||
onPressed: busy ? null : logic.submit,
|
||||
style: FilledButton.styleFrom(
|
||||
backgroundColor: AppColors.primary,
|
||||
disabledBackgroundColor: AppColors.primary.withOpacity(0.4),
|
||||
foregroundColor: Colors.white,
|
||||
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(AppRadius.control)),
|
||||
),
|
||||
child: busy
|
||||
? const Row(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
SizedBox(
|
||||
width: 16,
|
||||
height: 16,
|
||||
child: CircularProgressIndicator(strokeWidth: 2, color: Colors.white),
|
||||
),
|
||||
SizedBox(width: AppGap.x2),
|
||||
Text('登录中', style: TextStyle(fontSize: AppFont.body, color: Colors.white)),
|
||||
],
|
||||
)
|
||||
: const Text('登 录', style: TextStyle(fontSize: AppFont.body, color: Colors.white)),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user