feat: 增加手动添加、邀请设置页面
This commit is contained in:
parent
7f84b06d85
commit
0659c46874
@ -2,5 +2,6 @@ class AppViewParameterKeys {
|
||||
static const String deviceList = "deviceList";
|
||||
static const String lockInfo = "lockInfo";
|
||||
static const String networkInfo = "networkInfo";
|
||||
static const String teamInfo = "teamInfo";
|
||||
|
||||
}
|
||||
@ -1,18 +1,8 @@
|
||||
import 'package:carousel_slider/carousel_controller.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:permission_handler/permission_handler.dart';
|
||||
import 'package:starcloud/entity/star_cloud_lock_list.dart';
|
||||
import 'package:starcloud/sdk/sdk_device_operate_extension.dart';
|
||||
import 'package:starcloud/sdk/starcloud.dart';
|
||||
import 'package:starwork_flutter/api/model/team/response/team_info_response.dart';
|
||||
import 'package:starwork_flutter/api/service/team_api_service.dart';
|
||||
import 'package:starwork_flutter/base/app_logger.dart';
|
||||
import 'package:starwork_flutter/base/app_permission.dart';
|
||||
import 'package:starwork_flutter/base/base_controller.dart';
|
||||
import 'package:starwork_flutter/common/events/refresh_device_list_event.dart';
|
||||
import 'package:starwork_flutter/common/utils/event_bus_util.dart';
|
||||
import 'package:starwork_flutter/routes/app_routes.dart';
|
||||
import 'package:starwork_flutter/views/main/main_controller.dart';
|
||||
|
||||
class HomeController extends BaseController {
|
||||
|
||||
@ -4,6 +4,7 @@ import 'package:flutter/widgets.dart';
|
||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:starwork_flutter/base/app_permission.dart';
|
||||
import 'package:starwork_flutter/common/constant/app_view_parameter_keys.dart';
|
||||
import 'package:starwork_flutter/routes/app_routes.dart';
|
||||
import 'package:starwork_flutter/views/home/widget/home_not_device_area.dart';
|
||||
import 'package:super_tooltip/super_tooltip.dart';
|
||||
@ -370,7 +371,9 @@ class HomeView extends GetView<HomeController> {
|
||||
Get.toNamed(AppRoutes.searchDevice);
|
||||
break;
|
||||
case 1:
|
||||
Get.toNamed(AppRoutes.teamInviteTeamMember);
|
||||
Get.toNamed(AppRoutes.teamInviteTeamMember, arguments: {
|
||||
AppViewParameterKeys.teamInfo: controller.mainController.selectedTeam.value.toJson(),
|
||||
});
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,6 +1,20 @@
|
||||
import 'package:get/get.dart';
|
||||
import 'package:starwork_flutter/api/model/team/response/team_info_response.dart';
|
||||
import 'package:starwork_flutter/base/base_controller.dart';
|
||||
import 'package:starwork_flutter/common/constant/app_view_parameter_keys.dart';
|
||||
|
||||
class InviteTeamMemberController extends BaseController {
|
||||
// TODO: 在这里添加业务逻辑
|
||||
}
|
||||
// 定义一个可观察的 Map
|
||||
var selectedTeam = TeamInfoResponse().obs;
|
||||
|
||||
@override
|
||||
void onReady() {
|
||||
super.onReady();
|
||||
// 读取参数
|
||||
final args = Get.arguments;
|
||||
if (args != null && args.containsKey(AppViewParameterKeys.teamInfo)) {
|
||||
final json = args[AppViewParameterKeys.teamInfo];
|
||||
selectedTeam.value = TeamInfoResponse.fromJson(json);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
import 'package:flutter/widgets.dart';
|
||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||
import 'package:get/get.dart';
|
||||
@ -13,6 +14,9 @@ import 'invite_team_member_controller.dart';
|
||||
class InviteTeamMemberView extends GetView<InviteTeamMemberController> {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
// 即使不使用,只是引用一下 controller 就能触发初始化
|
||||
final _ = controller; // 添加这一行
|
||||
|
||||
return Scaffold(
|
||||
appBar: CustomAppBarWidget(
|
||||
title: '邀请人员'.tr,
|
||||
@ -67,12 +71,14 @@ class InviteTeamMemberView extends GetView<InviteTeamMemberController> {
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
|
||||
children: [
|
||||
Text(
|
||||
'19210651的互联',
|
||||
style: TextStyle(
|
||||
fontSize: 16.sp,
|
||||
color: Colors.black,
|
||||
fontWeight: FontWeight.w600,
|
||||
Obx(
|
||||
() => Text(
|
||||
controller.selectedTeam.value.teamName ?? '',
|
||||
style: TextStyle(
|
||||
fontSize: 16.sp,
|
||||
color: Colors.black,
|
||||
fontWeight: FontWeight.w600,
|
||||
),
|
||||
),
|
||||
),
|
||||
SizedBox(height: 10.h),
|
||||
@ -99,26 +105,35 @@ class InviteTeamMemberView extends GetView<InviteTeamMemberController> {
|
||||
SizedBox(
|
||||
height: 5.h,
|
||||
),
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
Text(
|
||||
'19210651',
|
||||
style: TextStyle(
|
||||
fontWeight: FontWeight.w400,
|
||||
color: Colors.black,
|
||||
fontSize: 16.sp,
|
||||
GestureDetector(
|
||||
onTap: () {
|
||||
// 复制到剪切板
|
||||
Clipboard.setData(ClipboardData(text: controller.selectedTeam.value.teamNo ?? ''));
|
||||
controller.showToast('内容已复制'.tr);
|
||||
},
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
Obx(
|
||||
() => Text(
|
||||
controller.selectedTeam.value.teamCode ?? '',
|
||||
style: TextStyle(
|
||||
fontWeight: FontWeight.w400,
|
||||
color: Colors.black,
|
||||
fontSize: 16.sp,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
SizedBox(
|
||||
width: 4.w,
|
||||
),
|
||||
Icon(
|
||||
Icons.library_books_rounded,
|
||||
size: 16.sp,
|
||||
color: Colors.grey,
|
||||
)
|
||||
],
|
||||
SizedBox(
|
||||
width: 4.w,
|
||||
),
|
||||
Icon(
|
||||
Icons.library_books_rounded,
|
||||
size: 16.sp,
|
||||
color: Colors.grey,
|
||||
)
|
||||
],
|
||||
),
|
||||
)
|
||||
],
|
||||
)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user