fist commit ftc staff app clone
This commit is contained in:
@@ -0,0 +1,42 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:ftc_mobile_app/ftc_mobile_app.dart';
|
||||
import 'package:ftc_mobile_app/models/profileData/user_data.dart';
|
||||
import 'package:ftc_mobile_app/view/custom_widgets/my_circle_image.dart';
|
||||
|
||||
class UserCardWidget extends StatelessWidget {
|
||||
const UserCardWidget({
|
||||
super.key,
|
||||
required this.index,
|
||||
required this.userData,
|
||||
});
|
||||
|
||||
final UserData userData;
|
||||
final int index;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Container(
|
||||
padding: EdgeInsets.only(left: 20.w, top: 10.h, bottom: 10.h),
|
||||
child: Row(
|
||||
children: [
|
||||
MyCircleImage(
|
||||
imageSize: 53.r,
|
||||
url: "${WebUrls.baseUrl}${userData.profilePictureUrl ?? ""}",
|
||||
errorWidget: CustomImageWidget(
|
||||
imagePath: AssetsManager.kPersonMainIcon,
|
||||
height: 53.h,
|
||||
width: 53.w,
|
||||
),
|
||||
),
|
||||
10.horizontalSpace,
|
||||
CustomTextWidget(
|
||||
text: userData.displayName,
|
||||
fontSize: 16.sp,
|
||||
fontWeight: FontWeight.w600,
|
||||
isExpanded: false,
|
||||
)
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,57 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:ftc_mobile_app/ftc_mobile_app.dart';
|
||||
import 'package:ftc_mobile_app/models/profileData/user_data.dart';
|
||||
import 'package:pull_to_refresh_flutter3/pull_to_refresh_flutter3.dart';
|
||||
import 'client_card_widget.dart';
|
||||
|
||||
class UsersListView extends StatelessWidget {
|
||||
final RefreshController refreshController;
|
||||
final ScrollController scrollController;
|
||||
final bool canLoadMore;
|
||||
final List<UserData> list;
|
||||
final VoidCallback onRefresh;
|
||||
final VoidCallback onLoading;
|
||||
final Function(int index, UserData userData) listItemTap;
|
||||
|
||||
const UsersListView({
|
||||
super.key,
|
||||
required this.listItemTap,
|
||||
required this.refreshController,
|
||||
required this.scrollController,
|
||||
required this.canLoadMore,
|
||||
required this.onRefresh,
|
||||
required this.onLoading,
|
||||
required this.list,
|
||||
});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return SmartRefresher(
|
||||
key: const ValueKey("clients_list"),
|
||||
controller: refreshController,
|
||||
scrollController: scrollController,
|
||||
header: FrequentFunctions.waterDropHeader,
|
||||
enablePullUp: canLoadMore,
|
||||
onRefresh: onRefresh,
|
||||
onLoading: onLoading,
|
||||
child: (list.isEmpty)
|
||||
? Container(
|
||||
color: Colors.white,
|
||||
child: const Center(
|
||||
child: Text("No users found"),
|
||||
),
|
||||
)
|
||||
: ListView.builder(
|
||||
itemCount: list.length,
|
||||
itemBuilder: (BuildContext context, int index) {
|
||||
return InkWell(
|
||||
onTap: () {
|
||||
listItemTap(index, list[index]);
|
||||
},
|
||||
child: UserCardWidget(index: index, userData: list[index]),
|
||||
);
|
||||
},
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,44 @@
|
||||
import 'package:ftc_mobile_app/ftc_mobile_app.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class SearchBarWidget extends StatelessWidget {
|
||||
final TextEditingController? controller;
|
||||
final ValueChanged<String> onSearchTextChange;
|
||||
|
||||
const SearchBarWidget(
|
||||
{super.key, required this.onSearchTextChange, this.controller});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Container(
|
||||
height: 48.h,
|
||||
margin: REdgeInsets.symmetric(horizontal: 16, vertical: 10),
|
||||
decoration: BoxDecoration(
|
||||
border: Border.all(
|
||||
color: CustomAppColors.kLightGreyColor,
|
||||
),
|
||||
borderRadius: BorderRadius.circular(40.r)),
|
||||
child: Row(
|
||||
children: [
|
||||
IconButton(onPressed: () {}, icon: const Icon(Icons.search)),
|
||||
Expanded(
|
||||
child: TextField(
|
||||
controller: controller,
|
||||
onChanged: onSearchTextChange,
|
||||
autofocus: false,
|
||||
style: TextStyle(
|
||||
fontSize: 18.sp,
|
||||
fontWeight: FontWeight.w400,
|
||||
),
|
||||
decoration: const InputDecoration(
|
||||
isDense: true,
|
||||
border: InputBorder.none,
|
||||
hintText: "Search...",
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user