新增网络可视化请求工具
This commit is contained in:
@@ -87,37 +87,36 @@ class _AuthPageWidgetState extends ConsumerState<AuthPageWidget> {
|
||||
],
|
||||
),
|
||||
),
|
||||
SizedBox(height: 20.h),
|
||||
Container(
|
||||
padding: EdgeInsets.symmetric(horizontal: 20.w),
|
||||
child: Column(
|
||||
children: [
|
||||
AppTextField(controller: _controller),
|
||||
SizedBox(height: 20.h),
|
||||
SizedBox(
|
||||
width: double.maxFinite,
|
||||
child: AppButton(
|
||||
label: '获取设备码',
|
||||
onPressed: () async {
|
||||
final deviceCode = await DeviceUtils.deviceCode();
|
||||
if (mounted) {
|
||||
AppDialog.confirm(
|
||||
context,
|
||||
title: '设备码',
|
||||
message: deviceCode,
|
||||
);
|
||||
}
|
||||
;
|
||||
},
|
||||
variant: AppButtonVariant.secondary,
|
||||
isLoading: authState.isLoading,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
..._buildTestArea(authState.isLoading),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
/// 测试区域
|
||||
List<Widget> _buildTestArea(bool isLoading) {
|
||||
return [
|
||||
SizedBox(height: 20.h),
|
||||
Container(
|
||||
padding: EdgeInsets.symmetric(horizontal: 20.w),
|
||||
child: Column(
|
||||
children: [
|
||||
SizedBox(
|
||||
width: double.maxFinite,
|
||||
child: AppButton(
|
||||
label: '获取设备码',
|
||||
onPressed: () async {
|
||||
DeviceUtils.deviceCode().then((code) {
|
||||
AppDialog.confirm(context, title: '设备码', message: code);
|
||||
});
|
||||
},
|
||||
variant: AppButtonVariant.secondary,
|
||||
isLoading: isLoading,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user