fist commit ftc staff app clone
This commit is contained in:
198
lib/view/screens/home/dashboard_screen.dart
Normal file
198
lib/view/screens/home/dashboard_screen.dart
Normal file
@@ -0,0 +1,198 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:ftc_mobile_app/ftc_mobile_app.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'home_screen.dart';
|
||||
|
||||
class DashboardScreen extends StatefulWidget {
|
||||
const DashboardScreen({Key? key}) : super(key: key);
|
||||
|
||||
@override
|
||||
State<DashboardScreen> createState() => _DashboardScreenState();
|
||||
}
|
||||
|
||||
class _DashboardScreenState extends State<DashboardScreen> {
|
||||
final controller = Get.put(DashboardScreenController());
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return CustomScaffold(
|
||||
appBar: appBar,
|
||||
sideDrawer: const CustomDrawer(),
|
||||
bottomMenu: Obx(
|
||||
() => BottomNavigationBar(
|
||||
type: BottomNavigationBarType.fixed,
|
||||
currentIndex: controller.selectedIndex.value,
|
||||
onTap: (value) {
|
||||
if (value == 0) {
|
||||
Navigator.pushNamed(
|
||||
context, CustomRouteNames.kRotaDashboardScreenRoute);
|
||||
return;
|
||||
}
|
||||
controller.selectedIndex.value = value;
|
||||
},
|
||||
items: [
|
||||
BottomNavigationBarItem(
|
||||
label: "",
|
||||
icon: Column(
|
||||
children: [
|
||||
CustomImageWidget(
|
||||
imagePath: AssetsManager.kCalendarIcon,
|
||||
height: 26.h,
|
||||
width: 26.w,
|
||||
imageColor: controller.selectedIndex.value == 0
|
||||
? CustomAppColors.kSecondaryColor
|
||||
: null,
|
||||
),
|
||||
CustomTextWidget(
|
||||
text: "Rota",
|
||||
isExpanded: false,
|
||||
fontSize: 12.sp,
|
||||
fontColor: controller.selectedIndex.value == 0
|
||||
? CustomAppColors.kSecondaryColor
|
||||
: null),
|
||||
],
|
||||
),
|
||||
),
|
||||
BottomNavigationBarItem(
|
||||
label: "",
|
||||
icon: Column(
|
||||
children: [
|
||||
CustomImageWidget(
|
||||
imagePath: AssetsManager.kHomeIcon,
|
||||
height: 26.h,
|
||||
width: 26.w,
|
||||
imageColor: controller.selectedIndex.value == 1
|
||||
? CustomAppColors.kSecondaryColor
|
||||
: null,
|
||||
),
|
||||
CustomTextWidget(
|
||||
text: "Dashboard",
|
||||
isExpanded: false,
|
||||
fontSize: 12.sp,
|
||||
fontColor: controller.selectedIndex.value == 1
|
||||
? CustomAppColors.kSecondaryColor
|
||||
: null,
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
BottomNavigationBarItem(
|
||||
label: "",
|
||||
icon: Column(
|
||||
children: [
|
||||
CustomImageWidget(
|
||||
imagePath: AssetsManager.kMessageIcon,
|
||||
height: 26.h,
|
||||
width: 26.w,
|
||||
imageColor: controller.selectedIndex.value == 2
|
||||
? CustomAppColors.kSecondaryColor
|
||||
: null,
|
||||
),
|
||||
CustomTextWidget(
|
||||
text: "Inbox",
|
||||
isExpanded: false,
|
||||
fontSize: 12.sp,
|
||||
fontColor: controller.selectedIndex.value == 2
|
||||
? CustomAppColors.kSecondaryColor
|
||||
: null,
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
BottomNavigationBarItem(
|
||||
label: "",
|
||||
icon: Column(
|
||||
children: [
|
||||
CustomImageWidget(
|
||||
imagePath: AssetsManager.kPeopleUnselectedIcon,
|
||||
height: 26.h,
|
||||
width: 26.w,
|
||||
imageColor: controller.selectedIndex.value == 3
|
||||
? CustomAppColors.kSecondaryColor
|
||||
: null,
|
||||
),
|
||||
CustomTextWidget(
|
||||
text: "Clients",
|
||||
isExpanded: false,
|
||||
fontSize: 12.sp,
|
||||
fontColor: controller.selectedIndex.value == 3
|
||||
? CustomAppColors.kSecondaryColor
|
||||
: null,
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
backgroundColor: CustomAppColors.kPrimaryColor,
|
||||
screenKey: controller.screenKey,
|
||||
onScreenTap: controller.removeFocus,
|
||||
showAppBar: true,
|
||||
body: SafeArea(
|
||||
child: Obx(() => selectedScreen()[controller.selectedIndex.value])),
|
||||
);
|
||||
}
|
||||
|
||||
PreferredSizeWidget get appBar => CustomAppBar(
|
||||
showBoxShadow: false,
|
||||
titleWidget: Row(
|
||||
children: [
|
||||
InkWell(
|
||||
onTap: () => controller.screenKey.currentState!.openDrawer(),
|
||||
child: CustomImageWidget(
|
||||
imagePath: AssetsManager.kDrawerIcon,
|
||||
height: 27.h,
|
||||
width: 27.w,
|
||||
),
|
||||
),
|
||||
Padding(
|
||||
padding: EdgeInsets.only(left: 15.0.w),
|
||||
child: Obx(() {
|
||||
return CustomTextWidget(
|
||||
text: controller.selectedIndex.value == 0
|
||||
? 'Home'
|
||||
: controller.selectedIndex.value == 1
|
||||
? 'Home'
|
||||
: controller.selectedIndex.value == 2
|
||||
? 'Inbox'
|
||||
: controller.selectedIndex.value == 3
|
||||
? 'Clients'
|
||||
: "",
|
||||
isExpanded: false,
|
||||
fontSize: 16.sp,
|
||||
fontWeight: FontWeight.w700,
|
||||
fontColor: CustomAppColors.kDarkBlueTextColor,
|
||||
);
|
||||
}),
|
||||
),
|
||||
const Spacer(),
|
||||
Obx(() {
|
||||
return Visibility(
|
||||
visible: controller.selectedIndex.value == 0,
|
||||
child: CustomImageWidget(
|
||||
imagePath: AssetsManager.kBellIcon,
|
||||
height: 23.h,
|
||||
width: 22.w,
|
||||
),
|
||||
);
|
||||
}),
|
||||
],
|
||||
),
|
||||
);
|
||||
|
||||
List<Widget> selectedScreen() {
|
||||
return <Widget>[
|
||||
const RotaDashboardScreen(),
|
||||
const HomeScreen(),
|
||||
const InboxScreen(),
|
||||
const ClientsListScreen(),
|
||||
];
|
||||
}
|
||||
|
||||
@override
|
||||
void dispose() {
|
||||
controller.dispose();
|
||||
super.dispose();
|
||||
}
|
||||
}
|
||||
3
lib/view/screens/home/export_home.dart
Normal file
3
lib/view/screens/home/export_home.dart
Normal file
@@ -0,0 +1,3 @@
|
||||
export 'dashboard_screen.dart';
|
||||
export '../chat/chat_screen.dart';
|
||||
export 'inbox_screen.dart';
|
||||
214
lib/view/screens/home/home_screen.dart
Normal file
214
lib/view/screens/home/home_screen.dart
Normal file
@@ -0,0 +1,214 @@
|
||||
import 'package:ftc_mobile_app/ftc_mobile_app.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:ftc_mobile_app/view/custom_widgets/my_circle_image.dart';
|
||||
import 'package:ftc_mobile_app/view/screens/rota/new_rota_list_widget.dart';
|
||||
import 'package:ftc_mobile_app/view/screens/webview/webview_screen.dart';
|
||||
import 'package:get/get.dart';
|
||||
|
||||
import 'widgets/home_row_items.dart';
|
||||
import 'widgets/line_row_widget.dart';
|
||||
|
||||
class HomeScreen extends StatelessWidget {
|
||||
const HomeScreen({Key? key}) : super(key: key);
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final controller = Get.find<DashboardScreenController>();
|
||||
return Stack(
|
||||
children: [
|
||||
Column(
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
60.verticalSpace,
|
||||
Container(
|
||||
height: 400.h,
|
||||
padding: EdgeInsets.only(top: 100.h),
|
||||
decoration: BoxDecoration(
|
||||
color: CustomAppColors.kSecondaryColor,
|
||||
borderRadius: BorderRadius.only(
|
||||
topLeft: Radius.circular(20.r),
|
||||
topRight: Radius.circular(20.r),
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
SizedBox(
|
||||
width: MediaQuery.of(context).size.width,
|
||||
height: MediaQuery.of(context).size.height,
|
||||
child: SingleChildScrollView(
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
16.verticalSpace,
|
||||
|
||||
//profile picture
|
||||
Obx(() {
|
||||
return MyCircleImage(
|
||||
imageSize: 80.r,
|
||||
url:
|
||||
"${WebUrls.baseUrl}${DashboardScreenController.instance.myProfileData()?.user?.profilePictureUrl ?? ""}",
|
||||
errorWidget: CircleAvatar(
|
||||
backgroundColor: Colors.white,
|
||||
child: CustomImageWidget(
|
||||
imagePath: AssetsManager.kPersonMainIcon,
|
||||
imageColor: CustomAppColors.kDarkBlueTextColor,
|
||||
height: 80.r,
|
||||
width: 80.r,
|
||||
),
|
||||
),
|
||||
);
|
||||
}),
|
||||
3.verticalSpace,
|
||||
|
||||
//Name
|
||||
Obx(
|
||||
() => CustomTextWidget(
|
||||
text: DashboardScreenController.instance
|
||||
.myProfileData()
|
||||
?.staffMemberName ??
|
||||
"",
|
||||
fontSize: 14.sp,
|
||||
fontWeight: FontWeight.w600,
|
||||
fontColor: CustomAppColors.kPrimaryColor,
|
||||
),
|
||||
),
|
||||
|
||||
//designation
|
||||
Obx(
|
||||
() => CustomTextWidget(
|
||||
text: DashboardScreenController.instance
|
||||
.myProfileData()
|
||||
?.staffDesignation ??
|
||||
"",
|
||||
fontSize: 14.sp,
|
||||
fontColor: CustomAppColors.kPrimaryColor,
|
||||
fontWeight: FontWeight.w600,
|
||||
),
|
||||
),
|
||||
16.verticalSpace,
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceAround,
|
||||
children: [
|
||||
HomeRowItems(
|
||||
iconUrl: AssetsManager.kCalendarIcon,
|
||||
textOfItem: "Rota",
|
||||
onTap: () {
|
||||
Navigator.pushNamed(
|
||||
context,
|
||||
CustomRouteNames.kRotaDashboardScreenRoute,
|
||||
);
|
||||
},
|
||||
),
|
||||
HomeRowItems(
|
||||
iconUrl: AssetsManager.kPeopleUnselectedIcon,
|
||||
textOfItem: "Clients",
|
||||
color: CustomAppColors.kLightTextColor,
|
||||
onTap: () {
|
||||
Get.find<DashboardScreenController>()
|
||||
.selectedIndex
|
||||
.value = 3;
|
||||
},
|
||||
),
|
||||
HomeRowItems(
|
||||
iconUrl: AssetsManager.kMessageIcon,
|
||||
textOfItem: "Message",
|
||||
onTap: () {
|
||||
Get.find<DashboardScreenController>()
|
||||
.selectedIndex
|
||||
.value = 2;
|
||||
},
|
||||
),
|
||||
],
|
||||
),
|
||||
10.verticalSpace,
|
||||
Container(
|
||||
height: MediaQuery.of(context).size.height / 1.5,
|
||||
decoration: BoxDecoration(
|
||||
color: CustomAppColors.kWhiteColor,
|
||||
borderRadius: BorderRadius.only(
|
||||
topLeft: Radius.circular(20.r),
|
||||
topRight: Radius.circular(20.r),
|
||||
),
|
||||
),
|
||||
child: Column(
|
||||
children: [
|
||||
Obx(() {
|
||||
return (controller.myShiftsList.isEmpty)
|
||||
? FrequentFunctions.noWidget
|
||||
: Padding(
|
||||
padding: EdgeInsets.symmetric(
|
||||
horizontal: 20.r, vertical: 10.r),
|
||||
child: Row(
|
||||
mainAxisAlignment:
|
||||
MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
CustomTextWidget(
|
||||
text: "Your next Shifts",
|
||||
isExpanded: false,
|
||||
fontWeight: FontWeight.w600,
|
||||
fontSize: 16.sp),
|
||||
InkWell(
|
||||
onTap: () {
|
||||
Navigator.pushNamed(
|
||||
context,
|
||||
CustomRouteNames
|
||||
.kYourRotaScreenRoute);
|
||||
},
|
||||
child: CustomTextWidget(
|
||||
text: "See all",
|
||||
isExpanded: false,
|
||||
fontSize: 12.sp,
|
||||
fontWeight: FontWeight.w600),
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}),
|
||||
Obx(
|
||||
() => (controller.myShiftsList.isEmpty)
|
||||
? FrequentFunctions.noWidget
|
||||
: NewRotaListWidget(
|
||||
shifts: controller.myShiftsList,
|
||||
physics: const NeverScrollableScrollPhysics(),
|
||||
),
|
||||
),
|
||||
10.verticalSpace,
|
||||
InkWell(
|
||||
onTap: () {
|
||||
Navigator.pushNamed(
|
||||
context,
|
||||
CustomRouteNames.kWebviewScreen,
|
||||
arguments: WebviewScreenArgument(
|
||||
title: 'Policies and Procedures',
|
||||
url: ConstantText.privacyUrl),
|
||||
);
|
||||
},
|
||||
child: const LineRowWidget(
|
||||
text: "Policies & Procedures",
|
||||
icon: AssetsManager.kPoliciesIcon),
|
||||
),
|
||||
InkWell(
|
||||
onTap: () {
|
||||
//Todo: uncomment when start working
|
||||
// Navigator.pushNamed(
|
||||
// context,
|
||||
// CustomRouteNames.kSettingsScreen,
|
||||
// );
|
||||
},
|
||||
child: const LineRowWidget(
|
||||
text: "Settings",
|
||||
icon: AssetsManager.kSettingsIcon),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
);
|
||||
}
|
||||
}
|
||||
202
lib/view/screens/home/inbox_screen.dart
Normal file
202
lib/view/screens/home/inbox_screen.dart
Normal file
@@ -0,0 +1,202 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:ftc_mobile_app/ftc_mobile_app.dart';
|
||||
import 'package:ftc_mobile_app/models/chat/ChatModel.dart';
|
||||
import 'package:ftc_mobile_app/view/screens/chat/arguments/chat_screen_args.dart';
|
||||
import 'package:ftc_mobile_app/web_services/chat_services.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:pull_to_refresh_flutter3/pull_to_refresh_flutter3.dart';
|
||||
import '../../custom_widgets/my_circle_image.dart';
|
||||
|
||||
class InboxScreen extends StatefulWidget {
|
||||
const InboxScreen({Key? key}) : super(key: key);
|
||||
|
||||
@override
|
||||
State<InboxScreen> createState() => _InboxScreenState();
|
||||
}
|
||||
|
||||
class _InboxScreenState extends State<InboxScreen> {
|
||||
final InboxScreenController controller = Get.put(InboxScreenController());
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return CustomScaffold(
|
||||
backgroundColor: CustomAppColors.kPrimaryColor,
|
||||
screenKey: controller.screenKey,
|
||||
// onBackButton: controller.onBackButtonPressed,
|
||||
onScreenTap: controller.removeFocus,
|
||||
showAppBar: false,
|
||||
body: Obx(() {
|
||||
final list = controller.chatsAndGroups();
|
||||
list.sort((a, b) => b.date.compareTo(a.date));
|
||||
|
||||
final canLoadMore = controller.canLoadMore.value;
|
||||
|
||||
return SmartRefresher(
|
||||
key: const ValueKey("clients_list"),
|
||||
controller: controller.listRC,
|
||||
scrollController: controller.listSC,
|
||||
header: FrequentFunctions.waterDropHeader,
|
||||
enablePullUp: canLoadMore,
|
||||
onRefresh: controller.onRefresh,
|
||||
onLoading: controller.onLoading,
|
||||
child: (list.isEmpty)
|
||||
? Container(
|
||||
color: Colors.white,
|
||||
child: const Center(
|
||||
child: Text("Your inbox is empty"),
|
||||
),
|
||||
)
|
||||
: ListView.separated(
|
||||
shrinkWrap: true,
|
||||
itemCount: list.length,
|
||||
padding: REdgeInsets.symmetric(horizontal: 20),
|
||||
separatorBuilder: (_, int index) => 8.verticalSpace,
|
||||
itemBuilder: (BuildContext context, int index) {
|
||||
return SenderListWidget(
|
||||
messagesListModel: controller.chatsAndGroups[index],
|
||||
onTap: (messagesListModel) async {
|
||||
await Navigator.pushNamed(
|
||||
context,
|
||||
CustomRouteNames.kChatScreenRoute,
|
||||
arguments: ChatScreenArgs(
|
||||
name: messagesListModel.title,
|
||||
profilePicPath: messagesListModel.image,
|
||||
otherUserId: messagesListModel.otherUserId,
|
||||
groupData: messagesListModel.groupData,
|
||||
onLastMessageUpdate: (m) =>
|
||||
_onLastMessageUpdate(index, m),
|
||||
),
|
||||
);
|
||||
},
|
||||
);
|
||||
},
|
||||
),
|
||||
);
|
||||
}),
|
||||
floatingActionButton: FloatingActionButton(
|
||||
onPressed: () {
|
||||
Navigator.pushNamed(
|
||||
context, CustomRouteNames.kSelectUserForChatScreenRoute);
|
||||
},
|
||||
child: const Icon(Icons.add),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
_onLastMessageUpdate(int index, ChatModel model) {
|
||||
if (mounted) {
|
||||
controller.chatsAndGroups[index].previewOfLastMessage =
|
||||
model.message ?? "";
|
||||
controller.chatsAndGroups[index].date =
|
||||
model.date ?? DateTime.now().millisecondsSinceEpoch;
|
||||
|
||||
controller.chatsAndGroups.refresh();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
class SenderListWidget extends StatefulWidget {
|
||||
const SenderListWidget({
|
||||
super.key,
|
||||
required this.messagesListModel,
|
||||
required this.onTap,
|
||||
});
|
||||
|
||||
final MessagesListModel messagesListModel;
|
||||
final ValueChanged<MessagesListModel> onTap;
|
||||
|
||||
@override
|
||||
State<SenderListWidget> createState() => _SenderListWidgetState();
|
||||
}
|
||||
|
||||
class _SenderListWidgetState extends State<SenderListWidget> {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return InkWell(
|
||||
onTap: () => widget.onTap(widget.messagesListModel),
|
||||
child: Container(
|
||||
padding: REdgeInsets.symmetric(vertical: 9),
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
MyCircleImage(
|
||||
imageSize: 53.r,
|
||||
url: "${WebUrls.baseUrl}${widget.messagesListModel.image}",
|
||||
errorWidget: CustomImageWidget(
|
||||
imagePath: AssetsManager.kPersonMainIcon,
|
||||
imageColor: CustomAppColors.kDarkBlueTextColor,
|
||||
height: 53.r,
|
||||
width: 53.r,
|
||||
),
|
||||
),
|
||||
12.horizontalSpace,
|
||||
Expanded(
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
children: [
|
||||
CustomTextWidget(
|
||||
text: widget.messagesListModel.title,
|
||||
fontColor: CustomAppColors.kDarkBlueTextColor,
|
||||
fontSize: 16.sp,
|
||||
fontWeight: FontWeight.w600,
|
||||
isExpanded: false,
|
||||
),
|
||||
4.verticalSpace,
|
||||
(widget.messagesListModel.messageType ==
|
||||
MessageType.message.name)
|
||||
? CustomTextWidget(
|
||||
text: widget.messagesListModel.previewOfLastMessage,
|
||||
fontColor: widget.messagesListModel.isRecent == true
|
||||
? CustomAppColors.kDarkBlueTextColor
|
||||
: CustomAppColors.kLightGreyColor,
|
||||
fontSize: 12.sp,
|
||||
maxLines: 1,
|
||||
fontWeight: FontWeight.w600,
|
||||
textAlign: TextAlign.left,
|
||||
isExpanded: false,
|
||||
)
|
||||
: FrequentFunctions.noWidget,
|
||||
],
|
||||
),
|
||||
),
|
||||
Container(
|
||||
padding: REdgeInsets.only(right: 2),
|
||||
child: Column(
|
||||
children: [
|
||||
CustomTextWidget(
|
||||
text: FrequentFunctions.toTimesAgo(
|
||||
DateTime.fromMillisecondsSinceEpoch(
|
||||
widget.messagesListModel.date)
|
||||
.toIso8601String()),
|
||||
fontColor: CustomAppColors.kLightGreyColor,
|
||||
fontSize: 12.sp,
|
||||
fontWeight: FontWeight.w600,
|
||||
isExpanded: false,
|
||||
),
|
||||
widget.messagesListModel.noOfMessages != 0
|
||||
? Padding(
|
||||
padding: EdgeInsets.only(top: 8.0.h),
|
||||
child: CircleAvatar(
|
||||
minRadius: 8.sp,
|
||||
maxRadius: 8.sp,
|
||||
backgroundColor: CustomAppColors.kBlackColor,
|
||||
child: CustomTextWidget(
|
||||
text: "${widget.messagesListModel.noOfMessages}",
|
||||
isExpanded: false,
|
||||
fontSize: 8.sp,
|
||||
fontColor: CustomAppColors.kPrimaryColor,
|
||||
),
|
||||
),
|
||||
)
|
||||
: Container(),
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
123
lib/view/screens/home/select_user_for_chat_screen.dart
Normal file
123
lib/view/screens/home/select_user_for_chat_screen.dart
Normal file
@@ -0,0 +1,123 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:ftc_mobile_app/controllers/home/select_user_for_chat_screen_controller.dart';
|
||||
import 'package:ftc_mobile_app/ftc_mobile_app.dart';
|
||||
import 'package:ftc_mobile_app/view/screens/chat/arguments/chat_screen_args.dart';
|
||||
import 'package:get/get.dart';
|
||||
import '../../../models/profileData/user_data.dart';
|
||||
import '../clientsListing/widgets/clients_list_view.dart';
|
||||
import '../clientsListing/widgets/search_bar_widget.dart';
|
||||
|
||||
class SelectUserForChatScreen extends StatefulWidget {
|
||||
const SelectUserForChatScreen({Key? key}) : super(key: key);
|
||||
|
||||
@override
|
||||
State<SelectUserForChatScreen> createState() =>
|
||||
_SelectUserForChatScreenState();
|
||||
}
|
||||
|
||||
class _SelectUserForChatScreenState extends State<SelectUserForChatScreen> {
|
||||
final controller = Get.put(SelectUserForChatScreenController());
|
||||
|
||||
// final controller =
|
||||
// Get.put(ClientsListScreenController(), tag: "select_clients");
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return CustomScaffold(
|
||||
// onBackButton: () => controller.backButtonPressed(context),
|
||||
backgroundColor: CustomAppColors.kPrimaryColor,
|
||||
screenKey: controller.screenKey,
|
||||
appBar: CustomAppBarTitleOnly(context, titleText: 'Select Contact'),
|
||||
onScreenTap: controller.removeFocus,
|
||||
showAppBar: true,
|
||||
body: SafeArea(
|
||||
child: Column(
|
||||
children: [
|
||||
SearchBarWidget(
|
||||
onSearchTextChange: controller.onSearch,
|
||||
),
|
||||
Expanded(
|
||||
child: Obx(() {
|
||||
final list = controller.staffUsersList();
|
||||
final canLoadMore = controller.canLoadMore.value;
|
||||
|
||||
return UsersListView(
|
||||
refreshController: controller.listRC,
|
||||
scrollController: controller.listSC,
|
||||
canLoadMore: canLoadMore,
|
||||
list: list,
|
||||
onRefresh: controller.onRefresh,
|
||||
onLoading: controller.onLoading,
|
||||
listItemTap: (int index, UserData userData) {
|
||||
Navigator.popAndPushNamed(
|
||||
controller.screenKey.currentContext!,
|
||||
CustomRouteNames.kChatScreenRoute,
|
||||
arguments: ChatScreenArgs(
|
||||
otherUserId: userData.id!,
|
||||
name: userData.displayName,
|
||||
profilePicPath: userData.profilePictureUrl ?? "",
|
||||
),
|
||||
);
|
||||
},
|
||||
);
|
||||
}),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
@override
|
||||
void dispose() {
|
||||
controller.dispose();
|
||||
super.dispose();
|
||||
}
|
||||
}
|
||||
|
||||
// class UserListWidgetItem extends StatelessWidget {
|
||||
// final SelectUserForChatScreenController controller =
|
||||
// Get.find<SelectUserForChatScreenController>();
|
||||
//
|
||||
// UserListWidgetItem({
|
||||
// super.key,
|
||||
// required this.nameOfPerson,
|
||||
// required this.index,
|
||||
// });
|
||||
//
|
||||
// final String nameOfPerson;
|
||||
// final int index;
|
||||
//
|
||||
// @override
|
||||
// Widget build(BuildContext context) {
|
||||
// return InkWell(
|
||||
// onTap: () {
|
||||
// // Navigator.pop(controller.screenKey.currentContext!, controller.serviceUsersList[index]);
|
||||
// Navigator.pushNamed(controller.screenKey.currentContext!,
|
||||
// CustomRouteNames.kGroupChatScreenRoute,
|
||||
// arguments: controller.serviceUsersList[index]);
|
||||
// },
|
||||
// child: Container(
|
||||
// padding: EdgeInsets.only(left: 20.w, top: 20.h),
|
||||
// child: Row(
|
||||
// children: [
|
||||
// CustomImageWidget(
|
||||
// imagePath: AssetsManager.kPersonMainIcon,
|
||||
// height: 53.h,
|
||||
// width: 53.w,
|
||||
// ),
|
||||
// SizedBox(
|
||||
// width: 10.w,
|
||||
// ),
|
||||
// CustomTextWidget(
|
||||
// text: nameOfPerson,
|
||||
// fontSize: 16.sp,
|
||||
// fontWeight: FontWeight.w600,
|
||||
// isExpanded: false,
|
||||
// )
|
||||
// ],
|
||||
// ),
|
||||
// ),
|
||||
// );
|
||||
// }
|
||||
// }
|
||||
52
lib/view/screens/home/widgets/home_row_items.dart
Normal file
52
lib/view/screens/home/widgets/home_row_items.dart
Normal file
@@ -0,0 +1,52 @@
|
||||
import 'package:ftc_mobile_app/ftc_mobile_app.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class HomeRowItems extends StatelessWidget {
|
||||
const HomeRowItems({
|
||||
super.key,
|
||||
required this.iconUrl,
|
||||
required this.textOfItem,
|
||||
this.color,
|
||||
this.onTap,
|
||||
});
|
||||
|
||||
final String iconUrl;
|
||||
final String textOfItem;
|
||||
final Color? color;
|
||||
final VoidCallback? onTap;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return InkWell(
|
||||
onTap: onTap,
|
||||
child: Container(
|
||||
padding: EdgeInsets.symmetric(vertical: 10.w, horizontal: 10.h),
|
||||
height: 80.h,
|
||||
width: 80.h,
|
||||
decoration: BoxDecoration(
|
||||
color: CustomAppColors.kPrimaryColor,
|
||||
borderRadius: BorderRadius.circular(15.r),
|
||||
),
|
||||
child: Column(
|
||||
children: [
|
||||
CustomImageWidget(
|
||||
width: 33.w,
|
||||
height: 38.h,
|
||||
imagePath: iconUrl,
|
||||
imageColor: CustomAppColors.kBlackColor,
|
||||
),
|
||||
SizedBox(
|
||||
height: 5.h,
|
||||
),
|
||||
CustomTextWidget(
|
||||
text: textOfItem,
|
||||
isExpanded: false,
|
||||
fontSize: 12.sp,
|
||||
fontWeight: FontWeight.w600,
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
42
lib/view/screens/home/widgets/line_row_widget.dart
Normal file
42
lib/view/screens/home/widgets/line_row_widget.dart
Normal file
@@ -0,0 +1,42 @@
|
||||
import 'package:ftc_mobile_app/ftc_mobile_app.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class LineRowWidget extends StatelessWidget {
|
||||
const LineRowWidget({super.key, required this.text, required this.icon});
|
||||
|
||||
final String text;
|
||||
final String icon;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Container(
|
||||
margin: EdgeInsets.symmetric(horizontal: 20.w, vertical: 5.h),
|
||||
padding: EdgeInsets.symmetric(horizontal: 10.w, vertical: 5.h),
|
||||
decoration: BoxDecoration(
|
||||
border: Border.all(color: CustomAppColors.kLightGreyColor)),
|
||||
child: Row(
|
||||
children: [
|
||||
CustomImageWidget(
|
||||
imagePath: icon,
|
||||
width: 19,
|
||||
height: 22,
|
||||
),
|
||||
SizedBox(
|
||||
width: 25.w,
|
||||
),
|
||||
CustomTextWidget(
|
||||
text: text,
|
||||
isExpanded: false,
|
||||
fontWeight: FontWeight.w600,
|
||||
fontSize: 14.sp),
|
||||
const Spacer(),
|
||||
CustomTextWidget(
|
||||
text: ">",
|
||||
isExpanded: false,
|
||||
fontSize: 15.sp,
|
||||
fontWeight: FontWeight.w500),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user