|
|
|
|
@ -4,14 +4,17 @@ import 'package:mc_common_app/classes/consts.dart';
|
|
|
|
|
import 'package:mc_common_app/extensions/int_extensions.dart';
|
|
|
|
|
import 'package:mc_common_app/extensions/string_extensions.dart';
|
|
|
|
|
import 'package:mc_common_app/theme/colors.dart';
|
|
|
|
|
import 'package:mc_common_app/utils/navigator.dart';
|
|
|
|
|
import 'package:mc_common_app/view_models/requests_view_model.dart';
|
|
|
|
|
import 'package:mc_common_app/views/requests/widget/request_item.dart';
|
|
|
|
|
|
|
|
|
|
import 'package:mc_common_app/widgets/button/show_fill_button.dart';
|
|
|
|
|
import 'package:mc_common_app/widgets/common_widgets/app_bar.dart';
|
|
|
|
|
import 'package:mc_common_app/widgets/common_widgets/categories_list.dart';
|
|
|
|
|
import 'package:mc_common_app/widgets/dropdown/dropdow_field.dart';
|
|
|
|
|
import 'package:mc_common_app/widgets/extensions/extensions_widget.dart';
|
|
|
|
|
|
|
|
|
|
import 'package:mc_common_app/widgets/tab/menu_tabs.dart';
|
|
|
|
|
import 'package:mc_common_app/widgets/tab/role_type_tab.dart';
|
|
|
|
|
|
|
|
|
|
import '../widget/request_list_card_widget.dart';
|
|
|
|
|
import 'package:provider/provider.dart';
|
|
|
|
|
|
|
|
|
|
class RequestListFragment extends StatelessWidget {
|
|
|
|
|
VoidCallback onBackButtonTapped;
|
|
|
|
|
@ -36,37 +39,70 @@ class RequestListFragment extends StatelessWidget {
|
|
|
|
|
body: SizedBox(
|
|
|
|
|
width: double.infinity,
|
|
|
|
|
height: double.infinity,
|
|
|
|
|
child: SingleChildScrollView(
|
|
|
|
|
child: Column(
|
|
|
|
|
children: [
|
|
|
|
|
21.height,
|
|
|
|
|
MenuTabs(
|
|
|
|
|
0,
|
|
|
|
|
[
|
|
|
|
|
DropValue(0, "Special Request", ""),
|
|
|
|
|
DropValue(1, "My Offers", ""),
|
|
|
|
|
],
|
|
|
|
|
onSelect: (DropValue dropValue) {},
|
|
|
|
|
selectedColor: MyColors.darkPrimaryColor,
|
|
|
|
|
),
|
|
|
|
|
12.height,
|
|
|
|
|
MenuTabs(
|
|
|
|
|
0,
|
|
|
|
|
[
|
|
|
|
|
DropValue(0, "Cars", ""),
|
|
|
|
|
DropValue(1, "Spare Parts", ""),
|
|
|
|
|
],
|
|
|
|
|
onSelect: (DropValue dropValue) {},
|
|
|
|
|
),
|
|
|
|
|
12.height,
|
|
|
|
|
const Padding(
|
|
|
|
|
padding: EdgeInsets.symmetric(horizontal: 21),
|
|
|
|
|
child: RequestListCardWidget(
|
|
|
|
|
count: 12,
|
|
|
|
|
),
|
|
|
|
|
)
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
child: Column(
|
|
|
|
|
children: [
|
|
|
|
|
21.height,
|
|
|
|
|
MenuTabs(
|
|
|
|
|
0,
|
|
|
|
|
[
|
|
|
|
|
DropValue(0, "Special Request", ""),
|
|
|
|
|
DropValue(1, "My Offers", ""),
|
|
|
|
|
],
|
|
|
|
|
onSelect: (DropValue dropValue) {},
|
|
|
|
|
selectedColor: MyColors.darkPrimaryColor,
|
|
|
|
|
),
|
|
|
|
|
12.height,
|
|
|
|
|
Expanded(
|
|
|
|
|
child: Consumer(builder: (BuildContext context, RequestsVM requestsVM, Widget? child) {
|
|
|
|
|
return Column(
|
|
|
|
|
children: [
|
|
|
|
|
ShowFillButton(
|
|
|
|
|
title: "title",
|
|
|
|
|
onPressed: () {
|
|
|
|
|
context.read<RequestsVM>().getRequests();
|
|
|
|
|
}),
|
|
|
|
|
16.height,
|
|
|
|
|
FiltersList(
|
|
|
|
|
filterList: requestsVM.requestsFilterOptions,
|
|
|
|
|
onFilterTapped: (index, selectedFilterId) => requestsVM.applyFilterOnRequestsVM(index: index),
|
|
|
|
|
),
|
|
|
|
|
8.height,
|
|
|
|
|
Expanded(
|
|
|
|
|
child: requestsVM.isRequestLoading
|
|
|
|
|
? const Center(child: CircularProgressIndicator())
|
|
|
|
|
: requestsVM.requests.isEmpty
|
|
|
|
|
? Center(
|
|
|
|
|
child: "No Request Available".toText(
|
|
|
|
|
isBold: true,
|
|
|
|
|
),
|
|
|
|
|
)
|
|
|
|
|
: ListView.separated(
|
|
|
|
|
itemBuilder: (context, index) {
|
|
|
|
|
return RequestItem(requestsVM.requests[index]);
|
|
|
|
|
},
|
|
|
|
|
separatorBuilder: (context, index) {
|
|
|
|
|
return 16.height;
|
|
|
|
|
},
|
|
|
|
|
itemCount: requestsVM.requests.length,
|
|
|
|
|
padding: const EdgeInsets.only(
|
|
|
|
|
left: 16,
|
|
|
|
|
right: 16,
|
|
|
|
|
bottom: 16,
|
|
|
|
|
top: 8,
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
)
|
|
|
|
|
],
|
|
|
|
|
);
|
|
|
|
|
}),
|
|
|
|
|
),
|
|
|
|
|
// const Padding(
|
|
|
|
|
// padding: EdgeInsets.symmetric(horizontal: 21),
|
|
|
|
|
// child: RequestListCardWidget(
|
|
|
|
|
// count: 12,
|
|
|
|
|
// ),
|
|
|
|
|
// )
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
);
|
|
|
|
|
|