Compare commits

..

3 Commits

Author SHA1 Message Date
Ankit Sharma c49074b167 Resolved merge conflicts 2025-01-31 17:24:56 +05:30
Pratibha Chaudhary 47512e86d0 textstyles changes 2025-01-31 13:04:40 +05:30
Pratibha Chaudhary e12af90539 untracked fils 2025-01-31 12:44:11 +05:30
38 changed files with 1785 additions and 441 deletions

BIN
assets/images/back2.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 124 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 235 B

BIN
assets/images/login_bg.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.5 MiB

View File

@ -1,10 +1,11 @@
import 'package:flutter/cupertino.dart';
import 'package:shayog/components/styles/app_colors.dart';
import 'package:shayog/components/styles/textStyles.dart';
class CommonBtn extends StatelessWidget {
CommonBtn({super.key, this.text,
this.width, this.bkClr,
this.borderClr,this.textClr,
this.borderClr,
this.margin,
required this.clickAction,
this.style
@ -12,7 +13,7 @@ class CommonBtn extends StatelessWidget {
String? text;
Color? bkClr;
Color? textClr;
Color? borderClr;
double? width;
EdgeInsets? margin;
@ -34,10 +35,7 @@ TextStyle? style;
child: Center(
child: Text(
text ?? '',
style: style ?? TextStyle(
fontSize: 12,
color: textClr ?? AppColors.primaryClr,
fontWeight: FontWeight.w900),
style: style ?? 14.txtSBoldBlue
)),
),
);

View File

@ -90,7 +90,7 @@ class CommonButton extends StatelessWidget {
child: Text(text.tr,
maxLines: 1,
overflow: TextOverflow.ellipsis,
style: textStyle ?? 16.txtMediumWhite.copyWith(color: textColor)),
style: textStyle ?? 14.txtSBoldWhite.copyWith(color: textColor)),
),
),
// ),

View File

@ -1,6 +1,7 @@
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:shayog/components/styles/app_colors.dart';
import 'package:shayog/components/styles/textStyles.dart';
class CustomDropdown<T> extends StatefulWidget {
final List<T> items;
final String Function(T) itemLabel;
@ -185,9 +186,9 @@ class _CustomDropdownState<T> extends State<CustomDropdown<T>> {
enabled: widget.enableSearch,
controller: searchController,
style: const TextStyle(
fontSize: 12,
overflow: TextOverflow.ellipsis),
style: 12.txtSBoldGrey,
decoration: InputDecoration(
hintText: 'Search...',
contentPadding: const EdgeInsets.symmetric(
@ -217,10 +218,7 @@ class _CustomDropdownState<T> extends State<CustomDropdown<T>> {
message: widget.itemLabel(item),
child: Text(
widget.itemLabel(item),
style: const TextStyle(
fontSize: 12,
overflow: TextOverflow.ellipsis,
),
style: 12.txtSBoldGrey,
),
),
onTap: () => _selectItem(item),
@ -266,7 +264,7 @@ class _CustomDropdownState<T> extends State<CustomDropdown<T>> {
selectedItem != null
? widget.itemLabel(selectedItem!)
: widget.hintText,
style: TextStyle(fontSize: 12, color: Colors.black),
style: 12.txtSBoldGrey,
overflow: TextOverflow.ellipsis,
),
),

View File

@ -1,4 +1,5 @@
import 'package:flutter/material.dart';
import 'package:shayog/components/styles/textStyles.dart';
import '../../../components/styles/app_colors.dart';
@ -13,11 +14,7 @@ DataCell editableCell(int index, String? value,
value ?? "",
textAlign: TextAlign.center,
maxLines: 2,
style: TextStyle(
fontSize: 11,
fontWeight: FontWeight.w600,
color: isLink ? Colors.blue : AppColors.darkGrey,
),
style: isLink ? 11.txtSBoldBlue : 11.txtSBoldBlack,
),
),
),
@ -32,8 +29,9 @@ DataColumn dataColumn(String text, {Function(int, bool)? onSort}) {
text,
textAlign: TextAlign.center,
maxLines: 2,
style: TextStyle(
fontSize: 12, fontWeight: FontWeight.bold, color: Colors.black),
style: 12.txtBoldBlack,
// style: TextStyle(
// fontSize: 12, fontWeight: FontWeight.bold, color: Colors.black),
),
);
}

View File

@ -1,5 +1,6 @@
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:shayog/components/styles/textStyles.dart';
import '../../../components/styles/app_colors.dart';
@ -37,10 +38,11 @@ class InputField extends StatelessWidget {
contextMenuBuilder: (context, editableTextState) {
return Container(height: 0, color: Colors.transparent);
},
style: TextStyle(fontSize: 12, color: AppColors.black),
style: 12.txtSBoldBlack,
decoration: InputDecoration(
isDense: true,
hintStyle: TextStyle(fontSize: 12, color: AppColors.darkGrey),
hintStyle: 11.txtSBoldGrey,
maintainHintHeight: true,
contentPadding: edgesInsects ??
EdgeInsets.symmetric(vertical: 12.0, horizontal: 12.0),
@ -51,8 +53,9 @@ class InputField extends StatelessWidget {
focusedBorder: underLineBorder ?? inputBorder,
focusedErrorBorder: underLineBorder ?? inputBorder,
filled: true,
labelText: title ?? "",
labelStyle: TextStyle(fontSize: 12, color: AppColors.darkGrey),
hintText: title ?? "",
labelStyle: 12.txtSBoldGrey,
fillColor: AppColors.clrD9,
errorStyle: TextStyle(
fontSize: 10.0,

View File

@ -11,6 +11,7 @@ class AppImages {
static String refresh = "${path}refresh.png";
static String download = "${path}download.png";
static String filter = "${path}filter.png";
static String exportIcon = '${path}export_icon.png';
static String inVoiceManage = '${path}invoice_manage.png';

View File

@ -81,4 +81,8 @@ class AppStrings {
static const String plantName = "Plant Name";
static const String fromLocDesc = "From Location Desc.";
static const String remark = "Remark";
static const String viewInvoice = "View Invoice";
static const String cancelledInvoice = "Cancelled Invoice";
static const String ccnView = "CCN View";
static const String transporterInbound = "Transporter Inbound Transaction";
}

View File

@ -23,7 +23,12 @@ extension TextStyles on num{
//Semi bold
TextStyle get txtSBoldBlackText => _textStyle(this,AppColors.black,Family.semiBold);
TextStyle get txtSBoldBlack => _textStyle(this,AppColors.black,Family.semiBold);
TextStyle get txtSBoldGrey => _textStyle(this,AppColors.darkGrey,Family.semiBold);
TextStyle get txtSBoldBlue => _textStyle(this,AppColors.primaryClr,Family.semiBold);
TextStyle get txtSBoldRed => _textStyle(this,Colors.red,Family.semiBold);
TextStyle get txtSBoldWhite => _textStyle(this,Colors.white,Family.semiBold);
@ -31,6 +36,7 @@ extension TextStyles on num{
//bold
TextStyle get txtBoldWhite => _textStyle(this,AppColors.white,Family.bold);
TextStyle get txtBoldBlack => _textStyle(this,AppColors.black,Family.bold);
TextStyle get txtBoldBlue => _textStyle(this,AppColors.primaryClr,Family.bold);
}
@ -53,7 +59,7 @@ TextStyle _textStyle(num size, color, family) => TextStyle(
fontFamily: family
);
class Family{
static const String light = ' AnekLatin-Light';
static const String light = 'AnekLatin-Light';
static const String regular = 'AnekLatin-Regular';
static const String medium = 'AnekLatin-Medium';
static const String semiBold = ' AnekLatin-SemiBold';

View File

@ -1,5 +1,6 @@
import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:shayog/components/styles/textStyles.dart';
import '../../../../../components/common/common_btn.dart';
import '../../../../../components/common/input_field.dart';
@ -310,7 +311,7 @@ class FreightBillScreen extends StatelessWidget {
SizedBox(width: 16),
CommonBtn(
text: AppStrings.submit,
textClr: Colors.white, clickAction: () { },
style: 14.txtBoldWhite, clickAction: () { },
),
],
),

View File

@ -35,8 +35,8 @@ class AddInternalUser extends StatelessWidget {
children: [
TextView(
text: AppStrings.firstName,
style: TextStyle(
fontSize: 12, fontWeight: FontWeight.bold)),
),
SizedBox(height: 8),
InputField(
controller: ctrl.nameCtrl,
@ -52,8 +52,7 @@ class AddInternalUser extends StatelessWidget {
children: [
TextView(
text: AppStrings.lastName,
style: TextStyle(
fontSize: 12, fontWeight: FontWeight.bold)),
),
SizedBox(height: 8),
InputField(
validator: Validations.checkLastName,
@ -70,8 +69,7 @@ class AddInternalUser extends StatelessWidget {
children: [
TextView(
text: AppStrings.employeeCode,
style: TextStyle(
fontSize: 12, fontWeight: FontWeight.bold)),
),
SizedBox(height: 8),
InputField(
controller: ctrl.employeeCodeCtrl,
@ -92,14 +90,13 @@ class AddInternalUser extends StatelessWidget {
children: [
TextView(
text: AppStrings.userType,
style: TextStyle(
fontSize: 12, fontWeight: FontWeight.bold)),
),
SizedBox(height: 8),
CustomDropdown(
initialValue: ctrl.selectUserVal.value,
backClr: AppColors.clrD9,
borderClr: AppColors.clrGrey,
items: ctrl.items,
items: ctrl.userTypeList,
itemLabel: (item) => item,
onSelected: (selected) {
if (selected != null) {
@ -107,18 +104,18 @@ class AddInternalUser extends StatelessWidget {
}
},
hintText: 'Select User Type'),
Obx(() {
return ctrl.errorText.value.isNotEmpty
? Padding(
padding: const EdgeInsets.only(top: 8.0),
child: Text(
ctrl.errorText.value,
style: TextStyle(
color: Colors.red, fontSize: 12),
),
)
: SizedBox.shrink();
}),
// Obx(() {
// return ctrl.errorText.value.isNotEmpty
// ? Padding(
// padding: const EdgeInsets.only(top: 8.0),
// child: Text(
// ctrl.errorText.value,
// style: TextStyle(
// color: Colors.red, fontSize: 12),
// ),
// )
// : SizedBox.shrink();
// }),
],
)),
SizedBox(width: 16),
@ -129,8 +126,7 @@ class AddInternalUser extends StatelessWidget {
children: [
TextView(
text: AppStrings.status,
style: TextStyle(
fontSize: 12, fontWeight: FontWeight.bold)),
),
SizedBox(height: 8),
CustomDropdown(
initialValue: ctrl.selectedStatus.value,
@ -154,8 +150,7 @@ class AddInternalUser extends StatelessWidget {
children: [
TextView(
text: AppStrings.emailAddress,
style: TextStyle(
fontSize: 12, fontWeight: FontWeight.bold)),
),
SizedBox(height: 8),
InputField(
controller: ctrl.emailCtrl,
@ -170,8 +165,7 @@ class AddInternalUser extends StatelessWidget {
padding: const EdgeInsets.only(top: 16.0, bottom: 8),
child: TextView(
text: AppStrings.mobileNo,
style:
TextStyle(fontSize: 12, fontWeight: FontWeight.bold)),
),
),
Row(
children: [
@ -207,11 +201,8 @@ class AddInternalUser extends StatelessWidget {
text: ctrl.employeeCodeCtrl.text.isEmpty
? AppStrings.add
: AppStrings.edit,
textStyle: TextStyle(
fontSize: 12,
fontWeight: FontWeight.bold,
color: Colors.white),
// textClr: Colors.white,
clickAction: () {
ctrl.employeeCodeCtrl.text.isEmpty
? ctrl.createUser()

View File

@ -1,9 +1,11 @@
import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:shayog/components/common/common_button.dart';
import 'package:shayog/components/common/custom_drop_down.dart';
import 'package:shayog/components/styles/textStyles.dart';
import 'package:shayog/feature/presentation/screens/dashboard/controller/dashboard_ctrl.dart';
import 'package:shayog/feature/presentation/screens/transporter/widgets/common_card.dart';
import 'package:sizer/sizer.dart';
import 'package:shayog/feature/presentation/widgets/text_view.dart';
import '../../../../../components/common/common_btn.dart';
import '../../../../../components/styles/app_colors.dart';
import '../../../../../components/styles/app_strings.dart';
@ -39,7 +41,7 @@ class InternalUserRoleMapping extends StatelessWidget {
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
_commonText(
TextView(text:
"Employee Code",
),
SizedBox(height: 8),
@ -63,7 +65,7 @@ class InternalUserRoleMapping extends StatelessWidget {
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
_commonText(
TextView(text:
"Email Address",
),
SizedBox(height: 8),
@ -86,7 +88,7 @@ class InternalUserRoleMapping extends StatelessWidget {
//flex: 2,
child: Column(
children: [
_commonText(
TextView(text:
"",
),
Padding(
@ -100,9 +102,12 @@ class InternalUserRoleMapping extends StatelessWidget {
clickAction: () {},
),
SizedBox(width: 16),
CommonBtn(
CommonButton(
borderRadius: 4,
height: 30,
width: 100,
text: AppStrings.submit,
textClr: Colors.white,
clickAction: () {
ctrl.getRoleMappingData();
},
@ -128,13 +133,9 @@ class InternalUserRoleMapping extends StatelessWidget {
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.start,
children: [
Text(
'User Type: Admin',
style: TextStyle(
color: Colors.black,
fontSize: 12.sp,
fontWeight: FontWeight.bold,
),
TextView(
text: 'User Type: Admin',
),
const SizedBox(
height: 10,
@ -170,10 +171,9 @@ class InternalUserRoleMapping extends StatelessWidget {
MaterialTapTargetSize.shrinkWrap,
),
),
Text(
TextView(text:
fetchRole.roleName ?? "",
style: TextStyle(
fontSize: 12, color: Colors.black),
),
],
);
@ -188,12 +188,9 @@ class InternalUserRoleMapping extends StatelessWidget {
const SizedBox(
height: 8,
),
Text(
TextView(text:
'*Note- If user type is transporter, by default all the plants would be selected for the first time.',
style: TextStyle(
color: Colors.red,
fontSize: 13.sp,
),
style: 13.txtSBoldRed,
),
const SizedBox(
height: 12,
@ -209,9 +206,13 @@ class InternalUserRoleMapping extends StatelessWidget {
clickAction: () {},
),
SizedBox(width: 16),
CommonBtn(
CommonButton(
borderRadius: 4,
height: 30,
width: 100,
text: AppStrings.submit,
textClr: Colors.white,
clickAction: () {
CommonAlertDialog.showDialog(
message:
@ -260,20 +261,12 @@ class InternalUserRoleMapping extends StatelessWidget {
),
Text(
descRole,
style: TextStyle(
color: Colors.black,
fontSize: 12.sp,
),
style:12.txtSBoldBlack
),
],
);
}
_commonText(String title) {
return Text(
title,
style: TextStyle(
fontSize: 13, color: Colors.black, fontWeight: FontWeight.w900),
);
}
}

View File

@ -1,5 +1,8 @@
import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:intl/intl.dart';
import 'package:shayog/components/common/common_button.dart';
import 'package:shayog/components/styles/textStyles.dart';
import '../../../../../components/common/common_btn.dart';
import '../../../../../components/common/data_cell.dart';
import '../../../../../components/styles/app_colors.dart';
@ -12,116 +15,157 @@ class ManageUser extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Obx(() {
if (controller.userLoading.value) {
return Center(child: CircularProgressIndicator());
}
return Column(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Obx(() {
if (controller.userLoading.value) {
return Center(child: CircularProgressIndicator());
}
return Scrollbar(
thumbVisibility: true,
controller: controller.verticalScrollController,
child: SingleChildScrollView(
controller: controller.verticalScrollController,
child: Scrollbar(
thumbVisibility: true,
controller: controller.horizontalScrollController,
child: SingleChildScrollView(
scrollDirection: Axis.horizontal,
controller: controller.horizontalScrollController,
child: Container(
margin: EdgeInsets.only(top: 16),
decoration: BoxDecoration(
border: Border.all(
color: Colors.grey.shade400,
width: 1.0,
),
),
child: DataTable(
dataRowHeight: 28,
headingRowHeight: 40,
headingRowColor: WidgetStateProperty.all(AppColors.clrF2),
border: TableBorder(
horizontalInside: BorderSide(color: AppColors.clrGrey),
verticalInside: BorderSide(color: AppColors.clrGrey),
bottom: BorderSide(color: AppColors.clrGrey),
left: BorderSide(color: AppColors.clrGrey),
right: BorderSide(color: AppColors.clrGrey),
top: BorderSide(color: AppColors.clrGrey),
),
columns: [
dataColumn("Sr.No."),
dataColumn("User Name"),
dataColumn("Email ID"),
dataColumn("Employee/\nTransporter Code"),
dataColumn("Mobile No."),
dataColumn("User Type"),
dataColumn("Created By"),
dataColumn("Created Date"),
dataColumn("Last Updated By"),
dataColumn("Last Update Date"),
dataColumn("Status"),
dataColumn("Action"),
],
rows: List<DataRow>.generate(controller.getAllUser.length,
(index) {
final stoppage = controller.getAllUser[index];
return Column(
children: [
Scrollbar(
thumbVisibility: true,
controller: controller.verticalScrollController,
child: SingleChildScrollView(
controller: controller.verticalScrollController,
child: Scrollbar(
thumbVisibility: true,
controller: controller.horizontalScrollController,
child: SingleChildScrollView(
scrollDirection: Axis.horizontal,
controller: controller.horizontalScrollController,
child: Container(
margin: EdgeInsets.only(top: 16),
decoration: BoxDecoration(
border: Border.all(
color: Colors.grey.shade400,
width: 1.0,
),
),
child: DataTable(
dataRowHeight: 28,
headingRowHeight: 40,
headingRowColor:
WidgetStateProperty.all(AppColors.clrF2),
border: TableBorder(
horizontalInside:
BorderSide(color: AppColors.clrGrey),
verticalInside:
BorderSide(color: AppColors.clrGrey),
bottom: BorderSide(color: AppColors.clrGrey),
left: BorderSide(color: AppColors.clrGrey),
right: BorderSide(color: AppColors.clrGrey),
top: BorderSide(color: AppColors.clrGrey),
),
columns: [
dataColumn("Sr.No."),
dataColumn("User Name"),
dataColumn("Email ID"),
dataColumn("Employee/\nTransporter Code"),
dataColumn("Mobile No."),
dataColumn("User Type"),
dataColumn("Created By"),
dataColumn("Created Date"),
dataColumn("Last Updated By"),
dataColumn("Last Update Date"),
dataColumn("Status"),
dataColumn("Action"),
],
rows: List<DataRow>.generate(
controller.getAllUser.length, (index) {
final stoppage = controller.getAllUser[index];
return DataRow(
selected: stoppage.isSelected,
// onSelectChanged: (value) {
// controller.toggleSelection(index, value ?? false);
// },
cells: [
editableCell(index, "0${index + 1}"),
editableCell(index, stoppage.userName ?? ""),
editableCell(index, stoppage.userEmail ?? ""),
editableCell(index, stoppage.userEmpTransCode ?? ""),
editableCell(index, stoppage.userMobile ?? ""),
editableCell(index, stoppage.usertypeName ?? ""),
editableCell(index, stoppage.createdBy.toString()),
editableCell(index, stoppage.createdOn.toString()),
editableCell(index, stoppage.lastUpdatedBy.toString()),
editableCell(index, stoppage.lastUpdatedOn.toString()),
editableCell(index, stoppage.status.toString()),
DataCell(CommonBtn(
style: TextStyle(
fontSize: 8,
color: Colors.white,
fontWeight: FontWeight.bold),
margin: EdgeInsets.symmetric(vertical: 6),
width: 35,
text: "Edit",
textClr: Colors.white,
clickAction: () {
controller.nameCtrl.text = stoppage.userFname ?? '';
controller.lastNCtrl.text =
stoppage.userLname ?? '';
controller.mobileCtrl.text =
stoppage.userMobile ?? '';
controller.emailCtrl.text =
stoppage.userEmail ?? '';
controller.userTypeId.value =
stoppage.usertypeId.toString();
controller.selectedValue.value =
stoppage.userAddedChannel ?? '';
controller.selectedStatus.value =
stoppage.status ?? '';
controller.employeeCodeCtrl.text =
stoppage.userEmpTransCode ?? '';
controller.selectUserVal.value =
stoppage.usertypeName ?? '';
controller.selectedUser.value = 1;
},
)),
],
);
}),
return DataRow(
selected: stoppage.isSelected,
// onSelectChanged: (value) {
// controller.toggleSelection(index, value ?? false);
// },
cells: [
editableCell(index, ""
"${index + 1}"),
editableCell(index, stoppage.userName ?? ""),
editableCell(index, stoppage.userEmail ?? ""),
editableCell(
index, stoppage.userEmpTransCode ?? ""),
editableCell(index, stoppage.userMobile ?? ""),
editableCell(
index, stoppage.usertypeName ?? ""),
editableCell(
index, stoppage.createdBy.toString()),
editableCell(
index,
DateFormat("d MMMM yyyy").format(
DateTime.parse(
'${stoppage.createdOn}'))),
editableCell(
index, stoppage.lastUpdatedBy.toString()),
editableCell(
index,
DateFormat("d MMMM yyyy").format(
DateTime.parse(
'${stoppage.lastUpdatedOn}'))),
editableCell(index, stoppage.status.toString()),
DataCell(CommonBtn(
style: 8.txtSBoldWhite,
margin: EdgeInsets.symmetric(vertical: 6),
width: 35,
text: "Edit",
clickAction: () {
controller.nameCtrl.text =
stoppage.userFname ?? '';
controller.lastNCtrl.text =
stoppage.userLname ?? '';
controller.mobileCtrl.text =
stoppage.userMobile ?? '';
controller.emailCtrl.text =
stoppage.userEmail ?? '';
controller.userTypeId.value =
stoppage.usertypeId.toString();
controller.selectedValue.value =
stoppage.userAddedChannel ?? '';
controller.selectedStatus.value =
stoppage.status ?? '';
controller.employeeCodeCtrl.text =
stoppage.userEmpTransCode ?? '';
controller.selectUserVal.value =
stoppage.usertypeName ?? '';
controller.selectedUser.value = 1;
},
)),
],
);
}),
),
),
),
),
),
),
),
),
),
);
});
SizedBox(height: 16),
Row(
mainAxisAlignment: MainAxisAlignment.end,
children: [
CommonButton(
height: 30,
width: 100,
text: "Previous",
clickAction: controller.previousPage),
Text(
'Page ${controller.currentPage.value} of ${controller.totalPages.value}'),
CommonButton(
height: 30,
width: 100,
text: "Next",
clickAction: controller.nextPage),
],
),
],
);
}),
],
);
}
}

View File

@ -1,9 +1,12 @@
import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:shayog/components/styles/textStyles.dart';
import 'package:shayog/feature/presentation/screens/dashboard/controller/dashboard_ctrl.dart';
import 'package:shayog/feature/presentation/screens/transporter/widgets/common_card.dart';
import 'package:shayog/feature/presentation/widgets/text_view.dart';
import '../../../../../components/common/common_btn.dart';
import '../../../../../components/common/common_button.dart';
import '../../../../../components/common/custom_drop_down.dart';
import '../../../../../components/styles/app_colors.dart';
import '../../../../../components/styles/app_strings.dart';
@ -29,8 +32,8 @@ class UserPlantMapping extends StatelessWidget {
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
_commonText(
"Employee/Transporter Code",
TextView(
text: "Employee/Transporter Code",style: 13.txtBoldBlack,
),
SizedBox(height: 8),
CustomDropdown(
@ -53,8 +56,8 @@ class UserPlantMapping extends StatelessWidget {
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
_commonText(
"Email Address",
TextView(text:
"Email Address",style:13.txtBoldBlack
),
SizedBox(height: 8),
CustomDropdown(
@ -76,7 +79,7 @@ class UserPlantMapping extends StatelessWidget {
//flex: 2,
child: Column(
children: [
_commonText(
TextView(text:
"",
),
Padding(
@ -90,9 +93,12 @@ class UserPlantMapping extends StatelessWidget {
clickAction: () {},
),
SizedBox(width: 16),
CommonBtn(
CommonButton(
borderRadius: 4,
height: 30,
width: 100,
text: AppStrings.submit,
textClr: Colors.white,
clickAction: () {
ctrl.getPlantMapping();
},
@ -110,12 +116,9 @@ class UserPlantMapping extends StatelessWidget {
ctrl.plantMapping.isNotEmpty
? Padding(
padding: const EdgeInsets.only(top: 16.0),
child: Text(
"User Type: Admin",
style: TextStyle(
fontWeight: FontWeight.bold,
fontSize: 14,
color: Colors.black),
child: TextView(
text: "User Type: Admin",
),
)
: SizedBox(),
@ -147,9 +150,9 @@ class UserPlantMapping extends StatelessWidget {
.shrinkWrap,
),
),
Text(
ctrl.plantMapping[index].plantPan ?? "",
style: TextStyle(fontSize: 12, color: Colors.black),
TextView(
text: ctrl.plantMapping[index].plantPan ?? "",
style:12.txtRegularBlack,
),
],
);
@ -162,12 +165,10 @@ class UserPlantMapping extends StatelessWidget {
Obx(
() =>
ctrl.plantMapping.isNotEmpty
? Text(
? TextView( text:
"*Note-If user type is a transporter,by default all the plants would be selected for the frist time",
style: TextStyle(
fontWeight: FontWeight.bold,
fontSize: 12,
color: Colors.red),
style:12.txtSBoldRed
)
: SizedBox(),
),
@ -188,9 +189,13 @@ class UserPlantMapping extends StatelessWidget {
clickAction: () {},
),
SizedBox(width: 16),
CommonBtn(
CommonButton(
borderRadius: 4,
height: 30,
width: 100,
text: AppStrings.submit,
textClr: Colors.white,
clickAction: () {
CommonAlertDialog.showDialog(
message: 'Are you sure you want to do this action?',
@ -216,11 +221,5 @@ class UserPlantMapping extends StatelessWidget {
);
}
_commonText(String title) {
return Text(
title,
style: TextStyle(
fontSize: 13, color: Colors.black, fontWeight: FontWeight.w900),
);
}
}

View File

@ -1,9 +1,11 @@
import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:shayog/components/common/input_field.dart';
import 'package:shayog/components/styles/textStyles.dart';
import 'package:shayog/feature/presentation/screens/admin/user_management/user_plant_mapping.dart';
import 'package:shayog/feature/presentation/widgets/text_view.dart';
import '../../../../../components/common/common_btn.dart';
import '../../../../../components/common/custom_drop_down.dart';
import '../../../../../components/common/common_button.dart';
import '../../../../../components/styles/app_colors.dart';
import '../../../../../components/styles/app_images.dart';
import '../../../../../components/styles/app_strings.dart';
@ -106,7 +108,6 @@ class UserScreen extends StatelessWidget {
onTap:(){
ctrl.toggleContainer();
},
child: Image.asset(AppImages.filter,
height: 16, width: 16)),
),
@ -151,6 +152,13 @@ class UserScreen extends StatelessWidget {
text: "User Name",
),
SizedBox(height: 8),
InputField(
title: "Enter User Name",
controller: ctrl.userTypeCtrl
),
// CustomDropdown(
// backClr: AppColors.clrD9,
// borderClr: AppColors.clrGrey,
@ -176,6 +184,11 @@ class UserScreen extends StatelessWidget {
text: "User Type",
),
SizedBox(height: 8),
InputField(
title: "Enter User Type",
controller: ctrl.userTypeCtrl
),
// CustomDropdown(
// backClr: AppColors.clrD9,
// borderClr: AppColors.clrGrey,
@ -201,6 +214,10 @@ class UserScreen extends StatelessWidget {
text: "Email Address",
),
SizedBox(height: 8),
InputField(
title: "Enter Email Address",
controller: ctrl.emailCtrl
),
// CustomDropdown(
// backClr: AppColors.clrD9,
// borderClr: AppColors.clrGrey,
@ -219,7 +236,7 @@ class UserScreen extends StatelessWidget {
),
Padding(
padding: const EdgeInsets.only(
top: 16.0, left: 8, right: 8),
top: 16.0),
child: Row(
children: [
Expanded(
@ -233,6 +250,10 @@ class UserScreen extends StatelessWidget {
text: "Employee/Transporter Code",
),
SizedBox(height: 8),
InputField(
title: "Enter Employee Code",
controller: ctrl.employeeCodeCtrl
),
// CustomDropdown(
// backClr: AppColors.clrD9,
// borderClr: AppColors.clrGrey,
@ -260,6 +281,10 @@ class UserScreen extends StatelessWidget {
"Status",
),
SizedBox(height: 8),
InputField(
title: "Enter Status",
controller: ctrl.statusCtrl
),
// CustomDropdown(
// backClr: AppColors.clrD9,
// borderClr: AppColors.clrGrey,
@ -294,11 +319,14 @@ class UserScreen extends StatelessWidget {
},
),
SizedBox(width: 16),
CommonBtn(
CommonButton(
borderRadius: 4,
width: 100,height:30,
text: AppStrings.submit,
textClr: Colors.white,
textStyle: 14.txtSBoldWhite,
clickAction: () {
ctrl.isSelected.value = false;
ctrl.getAllUser();
},
),
],

View File

@ -1,7 +1,9 @@
import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:shayog/components/common/common_button.dart';
import 'package:shayog/components/styles/textStyles.dart';
import 'package:shayog/feature/presentation/screens/transporter/widgets/common_card.dart';
import 'package:shayog/feature/presentation/widgets/text_view.dart';
import '../../../../../components/common/common_btn.dart';
import '../../../../../components/common/custom_drop_down.dart';
import '../../../../../components/common/data_cell.dart';
@ -30,7 +32,7 @@ class UserType extends StatelessWidget {
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
_commonText(
TextView(text:
"Add User Type",
),
SizedBox(height: 8),
@ -46,7 +48,8 @@ class UserType extends StatelessWidget {
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
_commonText(
TextView(
text:
"Status Type",
),
SizedBox(height: 8),
@ -69,7 +72,7 @@ class UserType extends StatelessWidget {
//flex: 2,
child: Column(
children: [
_commonText(
TextView(text:
"",
),
Padding(
@ -89,11 +92,8 @@ class UserType extends StatelessWidget {
borderRadius: 4,
width: 100,
text: AppStrings.submit,
textStyle: TextStyle(
fontSize: 12,
color: Colors.white,
fontWeight: FontWeight.bold),
//textClr: Colors.white,
clickAction: () {
controller.createUserType();
},
@ -111,9 +111,9 @@ class UserType extends StatelessWidget {
margin: const EdgeInsets.only(top: 24.0, bottom: 8),
width: MediaQuery.of(context).size.width,
color: AppColors.primaryClr,
child: Text(
child: TextView(text:
AppStrings.userTypes,
style: TextStyle(fontSize: 14, color: Colors.white),
style: 14.txtBoldWhite,
),
),
Obx(() {
@ -229,11 +229,5 @@ class UserType extends StatelessWidget {
);
}
_commonText(String title) {
return Text(
title,
style: TextStyle(
fontSize: 13, color: Colors.black, fontWeight: FontWeight.w900),
);
}
}

View File

@ -27,6 +27,9 @@ class DashboardCtrl extends GetxController {
final emailCtrl = TextEditingController();
final mobileCtrl = TextEditingController();
final userTypeCtrl = TextEditingController();
final statusCtrl = TextEditingController();
var selectedIndex = 0.obs;
var selectUserType = 0.obs;
var selectedUser = 0.obs;
@ -42,7 +45,7 @@ class DashboardCtrl extends GetxController {
print("isSelected.value..${isSelected.value}");
}
var items =
var userTypeList =
['Admin', 'Sub Admin', 'Internal Audit', 'Raw material', 'MIS User'].obs;
RxList tabs = <CommonModel>[
@ -79,17 +82,17 @@ class DashboardCtrl extends GetxController {
super.onInit();
}
//*****************************************************************
final formKey = GlobalKey<FormState>();
var userData = [].obs;
//**************************Manage-User************************************
var currentPage = 1.obs;
var totalPages = 3.obs;
final int limit = 10;
var getAllUser = <AllUser>[].obs;
var userLoading = false.obs;
@ -105,7 +108,7 @@ class DashboardCtrl extends GetxController {
"status": ""
};
var response = await PostRequests.getAllUser(requestBody);
var response = await PostRequests.getAllUser(requestBody,currentPage.value,limit);
if (response != null) {
getAllUser.assignAll(response.data?.content ?? []);
}
@ -113,7 +116,18 @@ class DashboardCtrl extends GetxController {
userLoading.value = false;
}
}
void nextPage() {
if (currentPage.value < totalPages.value) {
currentPage.value++;
getManageUser(); // Fetch data for the next page
}
}
void previousPage() {
if (currentPage.value > 1) {
currentPage.value--;
getManageUser(); // Fetch data for the previous page
}
}
//********************************edit User****************************//
var editLoading = false.obs;
Rx<Data> editUserResModel = Data().obs;
@ -204,9 +218,7 @@ class DashboardCtrl extends GetxController {
isLoading.value = false;
}
}
//**************************Internal User Role Mapping*********************
//**************************User Plant Mapping*****************************
//**************************Create User Type*******************************
void updateSelectedRoleIds(int roleId, bool isSelected) {
if (isSelected) {
@ -265,11 +277,8 @@ class DashboardCtrl extends GetxController {
showPlantRolesSection.value = false;
}
//************************getAllUser*****************************
//************************editAllUser*****************************
//************************-createUserType-*****************************
var userTypeLoading = false.obs;

View File

@ -1,6 +1,7 @@
import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:shayog/components/styles/app_strings.dart';
import 'package:shayog/components/styles/textStyles.dart';
import 'package:shayog/feature/presentation/screens/transporter/view/transport_view.dart';
import '../../../../components/styles/app_colors.dart';
@ -29,17 +30,12 @@ class _DashboardScreenState extends State<DashboardScreen> {
textAlign: TextAlign.center,
text: TextSpan(
text: AppStrings.appName,
style: TextStyle(
fontSize: 20,
color: AppColors.primaryClr,
fontWeight: FontWeight.w900),
style: 20.txtBoldBlue,
children: [
TextSpan(
text: '\n${AppStrings.cement}',
style: TextStyle(
fontSize: 15,
color: AppColors.primaryClr,
fontWeight: FontWeight.w900))
text: '\n${AppStrings.cement}',
style: 20.txtBoldBlue,
)
])),
actions: [
Padding(
@ -53,7 +49,7 @@ class _DashboardScreenState extends State<DashboardScreen> {
child: Center(
child: Text(
"A",
style: TextStyle(fontSize: 18, color: AppColors.primaryClr),
style: 20.txtBoldBlue,
)),
)),
),
@ -62,10 +58,7 @@ class _DashboardScreenState extends State<DashboardScreen> {
ctrl.selectUserType.value == 0
? AppStrings.adminUser
: AppStrings.transportVendor,
style: TextStyle(
fontSize: 12,
color: Colors.black,
fontWeight: FontWeight.w900),
style: 12.txtBoldBlack,
),
),
PopupMenuButton(
@ -84,9 +77,11 @@ class _DashboardScreenState extends State<DashboardScreen> {
onTap: () {
ctrl.selectUserType.value = index;
},
child: Text(index == 0
? AppStrings.adminUser
: AppStrings.transportVendor),
child: Text(
index == 0
? AppStrings.adminUser
: AppStrings.transportVendor,
style: 12.txtSBoldGrey),
);
},
);
@ -98,85 +93,83 @@ class _DashboardScreenState extends State<DashboardScreen> {
body: Obx(
() => ctrl.selectUserType.value == 0
? ListView(
physics: NeverScrollableScrollPhysics(),
children: [
Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Container(
height: MediaQuery.of(context).size.height,
width: 80,
color: AppColors.primaryClr,
child: ListView.separated(
shrinkWrap: true,
padding: EdgeInsets.zero,
scrollDirection: Axis.vertical,
itemBuilder: (context, index) {
return Obx(
() => InkWell(
onTap: () {
ctrl.selectedIndex.value = index;
physics: NeverScrollableScrollPhysics(),
children: [
Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Container(
height: MediaQuery.of(context).size.height,
width: 80,
color: AppColors.primaryClr,
child: ListView.separated(
shrinkWrap: true,
padding: EdgeInsets.zero,
scrollDirection: Axis.vertical,
itemBuilder: (context, index) {
return Obx(
() => InkWell(
onTap: () {
ctrl.selectedIndex.value = index;
},
child: Column(
mainAxisAlignment: MainAxisAlignment.start,
children: [
Container(
margin: EdgeInsets.symmetric(
horizontal: 16),
height: 80,
decoration: BoxDecoration(
shape: BoxShape.circle,
color:
ctrl.selectedIndex.value == index
? Colors.white
: AppColors.primaryClr,
),
child: Padding(
padding: const EdgeInsets.all(8.0),
child: Image.asset(
ctrl.selectedIndex.value == index
? ctrl
.tabs[index].selectionImg
: ctrl.tabs[index].image),
),
),
Text(
ctrl.tabs[index].title ?? "",
textAlign: TextAlign.center,
style: 10.txtBoldWhite,
},
child: Column(
mainAxisAlignment: MainAxisAlignment.start,
children: [
Container(
margin: EdgeInsets.symmetric(
horizontal: 16),
height: 80,
decoration: BoxDecoration(
shape: BoxShape.circle,
color:
ctrl.selectedIndex.value == index
? Colors.white
: AppColors.primaryClr,
),
child: Padding(
padding: const EdgeInsets.all(8.0),
child: Image.asset(
ctrl.selectedIndex.value == index
? ctrl
.tabs[index].selectionImg
: ctrl.tabs[index].image),
),
),
Text(
ctrl.tabs[index].title ?? "",
textAlign: TextAlign.center,
style: TextStyle(
fontSize: 10,
color: Colors.white,
fontWeight: FontWeight.w900),
)
],
)
],
),
),
),
);
},
separatorBuilder: (context, index) {
return SizedBox(height: 0);
},
itemCount: 4),
),
Expanded(
child: Obx(() {
switch (ctrl.selectedIndex.value) {
case 0:
return UserScreen();
case 1:
return ConfigurationScreen();
case 2:
return MasterScreen();
default:
return FreightBillScreen();
}
}),
)
],
),
],
)
);
},
separatorBuilder: (context, index) {
return SizedBox(height: 0);
},
itemCount: 4),
),
Expanded(
child: Obx(() {
switch (ctrl.selectedIndex.value) {
case 0:
return UserScreen();
case 1:
return ConfigurationScreen();
case 2:
return MasterScreen();
default:
return FreightBillScreen();
}
}),
)
],
),
],
)
: TransportView(),
),
);

View File

@ -0,0 +1,167 @@
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import '../../../../../components/styles/app_colors.dart';
import '../../../../../components/styles/app_strings.dart';
import '../../../../../navigation/page_routes.dart';
class LoginScreen extends StatefulWidget {
@override
_LoginScreenState createState() => _LoginScreenState();
}
class _LoginScreenState extends State<LoginScreen> {
final _formKey = GlobalKey<FormState>();
final TextEditingController _usernameController = TextEditingController();
final TextEditingController _passwordController = TextEditingController();
bool _obscurePassword = true;
// void _login() {
// // if (_formKey.currentState?.validate() ?? false) {
// // // Handle login logic here
// // Navigator.pushNamed(
// // context, PageRoutes.dashboard);
// // }
// Navigator.pushNamed(
// context, PageRoutes.dashboard);
// }
@override
Widget build(BuildContext context) {
return Scaffold(
body: Container(
decoration: BoxDecoration(
color: AppColors.black,
image: DecorationImage(
image: AssetImage("assets/images/login_bg.png"),
fit: BoxFit.cover,
)),
child: Center(
child: SizedBox(
width: 380,
height: 500,
child: Card(
color: Colors.white60,
elevation: 10.0,
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
mainAxisSize: MainAxisSize.min,
children: [
RichText(
textAlign: TextAlign.center,
text: TextSpan(
text: 'Inbound Portal',
style: TextStyle(
fontSize: 30,
color: AppColors.primaryClr,
fontWeight: FontWeight.w900),
)),
Container(
height: 100,
width: 150,
child: Image.asset("assets/images/back2.png")),
SizedBox(height: 8),
RichText(
textAlign: TextAlign.center,
text: TextSpan(
text: AppStrings.appName,
style: TextStyle(
fontSize: 30,
color: AppColors.primaryClr,
fontWeight: FontWeight.w900),
children: [
TextSpan(
text: '\n${AppStrings.cement}',
style: TextStyle(
fontSize: 25,
color: AppColors.primaryClr,
fontWeight: FontWeight.w900))
])),
SizedBox(height: 10),
Form(
key: _formKey,
child: Padding(
padding: const EdgeInsets.symmetric(horizontal: 16),
child: Center(
child: Column(
children: [
TextFormField(
controller: _usernameController,
decoration: InputDecoration(
labelText: 'Username',
border: OutlineInputBorder(),
),
// validator: (value) {
// if (value == null || value.isEmpty) {
// return 'Please enter your username';
// }
// return null;
// },
),
SizedBox(height: 16),
TextFormField(
controller: _passwordController,
obscureText: _obscurePassword,
decoration: InputDecoration(
labelText: 'Password',
border: OutlineInputBorder(),
suffixIcon: IconButton(
icon: Icon(
_obscurePassword
? Icons.visibility_off
: Icons.visibility,
),
onPressed: () {
setState(() {
_obscurePassword = !_obscurePassword;
});
},
),
),
// validator: (value) {
// if (value == null || value.isEmpty) {
// return 'Please enter your password';
// }
// return null;
// },
),
SizedBox(height: 20.0),
GestureDetector(
child: ElevatedButton(
onPressed: (){
Navigator.of(context)
.pushNamed(PageRoutes.dashboard);
},
child: Text('Continue'),
style: ElevatedButton.styleFrom(
minimumSize: Size(double.infinity, 45),
),
),
),
SizedBox(height: 10),
Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Text('Forget Password?'),
TextButton(
onPressed: () {
// Handle navigate to registration screen
},
child: Text('Click Here'),
),
],
),
],
),
),
),
),
],
),
),
),
),
),
);
}
}

View File

@ -0,0 +1,45 @@
import 'package:get/get.dart';
import '../../../../../../components/common/common_model.dart';
import '../../../../../../components/styles/app_strings.dart';
class InvoiceManagementController extends GetxController{
var selectedState = 0.obs;
RxBool isSelected = false.obs;
RxList userTabs = <CommonModel>[
CommonModel(title: AppStrings.viewInvoice),
CommonModel(title: AppStrings.cancelledInvoice),
CommonModel(title: AppStrings.ccnView),
].obs;
var selectedInvoice = '41896424644'.obs; // Default value
var selectedFreightNo = '9841651635426'.obs; // Default value
void toggleContainer() {
isSelected.value = true;
print("isSelected.value..${isSelected.value}");
}
var invoiceNoItems = ['41896424644', '41896424644',
'41896424644', '41896424644','41896424644'].obs;
var freightBillNoItems = ['9841651635426','9841651635426','9841651635426','9841651635426','9841651635426'];
// var items = ['Admin', 'Sub Admin',
// 'Internal Audit', 'Raw material','MIS User'].obs;
// var status = ['STO','In-Bound'];
// RxList tabs = <CommonModel>[
// CommonModel(
// title: "User\nManagement",
// image: AppImages.userMgmt,
// selectionImg: AppImages.userMgmtBlue),
// CommonModel(
// title: "Configuration\nManagement",
// image: AppImages.configuration,
// selectionImg: AppImages.configurationBlue),
// CommonModel(
// title: "Masters",
// image: AppImages.masters,
// selectionImg: AppImages.mastersBlue),
// CommonModel(
// title: "Freight Bill & \n Invoice",
// image: AppImages.bills,
// selectionImg: AppImages.billsBlue),
// ].obs;
}

View File

@ -0,0 +1,15 @@
import 'package:flutter/cupertino.dart';
import 'package:get/get.dart';
import '../../../../../../components/common/common_model.dart';
import '../../../../../../components/styles/app_strings.dart';
class ReportController extends GetxController{
final ScrollController horizontalScrollController = ScrollController();
final ScrollController verticalScrollController = ScrollController();
var selectedState = 0.obs;
RxList reportTabs = <CommonModel>[
CommonModel(title: AppStrings.transporterInbound),
].obs;
}

View File

@ -246,7 +246,7 @@ class GenerateFrightBill extends StatelessWidget {
SizedBox(width: 16),
CommonBtn(
text: AppStrings.submit,
textClr: Colors.white,
style: 14.txtBoldWhite,
clickAction: () {
controller.postData();
},
@ -274,7 +274,7 @@ class GenerateFrightBill extends StatelessWidget {
CommonBtn(
bkClr: AppColors.white,
borderClr: AppColors.primaryClr,
textClr: AppColors.primaryClr,
style: 14.txtBoldBlue,
text: AppStrings.save,
clickAction: () {
bool hasSelectedRows = controller.grnDetails

View File

@ -0,0 +1,468 @@
import 'package:flutter/material.dart';
import 'package:get/get.dart';
import '../../../../../../components/common/common_btn.dart';
import '../../../../../../components/common/input_field.dart';
import '../../../../../../components/styles/app_colors.dart';
import '../../../../../../components/styles/app_images.dart';
import '../../../../../../components/styles/app_strings.dart';
import '../ctrl/invoice_management_controller.dart';
class InvoiceManagement extends StatefulWidget {
const InvoiceManagement({super.key});
@override
State<InvoiceManagement> createState() => _TransportViewState();
}
class _TransportViewState extends State<InvoiceManagement> {
final ctrl = Get.put(InvoiceManagementController());
@override
Widget build(BuildContext context) {
return Column(
children: [
Container(
padding: EdgeInsets.only(bottom: 4),
margin: EdgeInsets.all(16),
child: Column(
children: [
Container(
margin: EdgeInsets.only(bottom: 12),
height: 55,
color: AppColors.primaryClr,
child: Row(
children: [
ListView.separated(
padding: EdgeInsets.symmetric(horizontal: 16),
scrollDirection: Axis.horizontal,
shrinkWrap: true,
itemBuilder: (context, index) {
return Obx(
() => InkWell(
onTap: () {},
child: Container(
margin: EdgeInsets.only(bottom: 10, top: 10),
decoration: BoxDecoration(
border: Border(
bottom: BorderSide(
color:
ctrl.selectedState.value == index
? Colors.white
: AppColors.primaryClr,
width: 3))),
child: Center(
child: Text(
ctrl.userTabs[index].title ?? "",
style: TextStyle(
fontSize: 12,
fontWeight: FontWeight.w900,
color: Colors.white),
),
),
),
),
);
},
separatorBuilder: (context, index) {
return SizedBox(width: 16);
},
itemCount: ctrl.userTabs.length),
Spacer(),
InkWell(
child: Image.asset(AppImages.refresh,
height: 10, width: 10)),
Padding(
padding: const EdgeInsets.all(8.0),
child: Text(
AppStrings.refresh,
style: TextStyle(
color: AppColors.white,
fontSize: 10,
fontWeight: FontWeight.normal),
),
),
InkWell(
onTap: ctrl.toggleContainer,
child: Image.asset(AppImages.filter,
height: 12, width: 12)),
Padding(
padding: const EdgeInsets.all(8.0),
child: Text(
AppStrings.filter,
style: TextStyle(
color: AppColors.white,
fontSize: 10,
fontWeight: FontWeight.normal),
),
),
],
),
),
],
),
),
Obx(
() => ctrl.isSelected.value
? Container(
padding: EdgeInsets.all(16),
color: AppColors.clrF2,
child: Column(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Row(
children: [
Expanded(
child: Column(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
_commonText(
"Invoice No.",
),
SizedBox(height: 8),
InputField(
title: "Select Invoice No. ",
),
// Obx(
// () => Container(
// padding: EdgeInsets.only(left: 8),
// height: 35,
// decoration: BoxDecoration(
// borderRadius:
// BorderRadius.circular(4.0),
// color: AppColors.clrD9,
// border: Border.all(
// color: AppColors.clrGrey)),
// child: DropdownButton<String>(
// icon: Icon(
// Icons
// .keyboard_arrow_down_outlined,
// size: 20,
// color: AppColors.darkGrey),
//
// isExpanded: true,
// underline: SizedBox(),
//
// value: ctrl
// .selectedInvoice.value,
// // Use the selected value
// onChanged: (String? newValue) {
// if (newValue != null) {
// ctrl.selectedInvoice.value =
// newValue; // Update the selected value
// }
// },
// items: ctrl.invoiceNoItems
// .map((String value) {
// return DropdownMenuItem<String>(
// value: value.toString(),
// child: Text(
// value,
// style: TextStyle(
// fontSize: 12,
// color:
// AppColors.darkGrey),
// ),
// );
// }).toList(),
// ),
// ),
// ),
],
)),
SizedBox(width: 16),
Expanded(
child: Column(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
_commonText(
"Invoice date",
),
SizedBox(height: 8),
InputField(
title: "Select Invoice Date",
),
],
)),
SizedBox(width: 16),
Expanded(
child: Column(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
_commonText(
"Freight Bill No.",
),
SizedBox(height: 8),
InputField(
title: "Select Freight Bill No. ",
),
// Obx(
// () => Container(
// padding: EdgeInsets.only(left: 8),
// height: 35,
// decoration: BoxDecoration(
// borderRadius:
// BorderRadius.circular(4.0),
// color: AppColors.clrD9,
// border: Border.all(
// color: AppColors.clrGrey)),
// child: DropdownButton<String>(
// icon: Icon(
// Icons
// .keyboard_arrow_down_outlined,
// size: 20,
// color: AppColors.darkGrey),
//
// isExpanded: true,
// underline: SizedBox(),
//
// value: ctrl
// .selectedFreightNo.value,
// // Use the selected value
// onChanged: (String? newValue) {
// if (newValue != null) {
// ctrl
// .selectedFreightNo.value =
// newValue; // Update the selected value
// }
// },
// items: ctrl.freightBillNoItems
// .map((String value) {
// return DropdownMenuItem<String>(
// value: value.toString(),
// child: Text(
// value,
// style: TextStyle(
// fontSize: 12,
// color:
// AppColors.darkGrey),
// ),
// );
// }).toList(),
// ),
// ),
// ),
],
)),
],
),
Padding(
padding:
const EdgeInsets.only(top: 16.0, left: 0, right: 8),
child: Row(
children: [
Expanded(
child: Column(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
_commonText(
"Freight Bill Date",
),
SizedBox(height: 8),
InputField(
title: "Select Bill Date",
),
],
)),
],
),
),
Padding(
padding: const EdgeInsets.all(16.0),
child: Row(
mainAxisAlignment: MainAxisAlignment.end,
children: [
CommonBtn(
bkClr: Colors.white,
text: AppStrings.cancel,
clickAction: () {},
),
SizedBox(width: 16),
CommonBtn(
text: AppStrings.submit,
clickAction: () {},
),
],
),
),
],
),
)
: SizedBox(),
),
Obx(() {
switch (ctrl.selectedState.value) {
case 0:
return _tableView();
case 1:
return _tableView();
case 2:
return _tableView();
default:
return _tableView();
}
}),
],
);
}
_tableView() {
return Padding(
padding: const EdgeInsets.symmetric(horizontal: 16),
child:
Table(border: TableBorder.all(color: AppColors.clrGrey), children: [
TableRow(
decoration: BoxDecoration(color: AppColors.secondaryClr),
children: [
_cellText(
text: "SR. No.",
clr: Colors.black,
fontWeight: FontWeight.bold),
_cellText(
text: "Reference No.",
clr: Colors.black,
fontWeight: FontWeight.bold),
_cellText(
text: "Freight Bill No.",
clr: Colors.black,
fontWeight: FontWeight.bold),
_cellText(
text: "Freight Bill Date",
clr: Colors.black,
fontWeight: FontWeight.bold),
_cellText(
text: "Invoice No.",
clr: Colors.black,
fontWeight: FontWeight.bold),
_cellText(
text: "Invoice Date",
clr: Colors.black,
fontWeight: FontWeight.bold),
_cellText(
text: "Invoice Amount",
clr: Colors.black,
fontWeight: FontWeight.bold),
_cellText(
text: "CCN Amount",
clr: Colors.black,
fontWeight: FontWeight.bold),
_cellText(
text: "View CCN",
clr: Colors.black,
fontWeight: FontWeight.bold),
_cellText(
text: "Product Type",
clr: Colors.black,
fontWeight: FontWeight.bold),
_cellText(
text: "View Invoice",
clr: Colors.black,
fontWeight: FontWeight.bold),
// _cellText(
// text: "Add Signature",
// clr: Colors.black,
// fontWeight: FontWeight.bold),
]),
TableRow(children: [
_cellText(
text: "01",
),
_cellText(text: "7894651231"),
_cellText(text: "9841651635426"),
_cellText(text: "1 August 2024"),
_cellText(text: "41918542634"),
_cellText(text: "5 Aug 2024"),
_cellText(text: "XXXXXXXX"),
_cellText(text: "XXXXXXXX"),
_cellText(text: "78646646", clr: AppColors.primaryClr),
_cellText(text: "Z-FUL"),
_cellText(text: "View Invoice", clr: AppColors.primaryClr),
]),
TableRow(children: [
_cellText(text: "02"),
_cellText(text: "7894651231"),
_cellText(text: "9841651635426"),
_cellText(text: "1 August 2024"),
_cellText(text: "41918542634"),
_cellText(text: "5 Aug 2024"),
_cellText(text: "XXXXXXXX"),
_cellText(text: "-"),
_cellText(text: "78646646", clr: AppColors.primaryClr),
_cellText(text: "Z-FUL"),
_cellText(text: "View Invoice", clr: AppColors.primaryClr),
]),
TableRow(children: [
_cellText(text: "03"),
_cellText(text: "7894651231"),
_cellText(text: "9841651635426"),
_cellText(text: "1 August 2024"),
_cellText(text: "41918542634"),
_cellText(text: "5 Aug 2024"),
_cellText(text: "XXXXXXXX"),
_cellText(text: "-"),
_cellText(text: "-", clr: AppColors.primaryClr),
_cellText(text: "Z-FUL"),
_cellText(text: "View Invoice", clr: AppColors.primaryClr),
]),
TableRow(children: [
_cellText(text: "04"),
_cellText(text: "7894651231"),
_cellText(text: "9841651635426"),
_cellText(text: "1 August 2024"),
_cellText(text: "41918542634"),
_cellText(text: "5 Aug 2024"),
_cellText(text: "XXXXXXXX"),
_cellText(text: "XXXXXXXX"),
_cellText(text: "78646646", clr: AppColors.primaryClr),
_cellText(text: "Z-FUL"),
_cellText(text: "View Invoice", clr: AppColors.primaryClr),
]),
TableRow(children: [
_cellText(text: "05"),
_cellText(text: "7894651231"),
_cellText(text: "9841651635426"),
_cellText(text: "1 August 2024"),
_cellText(text: "41918542634"),
_cellText(text: "5 Aug 2024"),
_cellText(text: "XXXXXXXX"),
_cellText(text: "-"),
_cellText(text: "-", clr: AppColors.primaryClr),
_cellText(text: "Z-FUL"),
_cellText(text: "View Invoice", clr: AppColors.primaryClr),
]),
]),
);
}
_cellText({String? text, Color? clr, FontWeight? fontWeight}) {
return Center(
child: Padding(
padding: const EdgeInsets.symmetric(vertical: 8.0, horizontal: 4),
child: Text(
text ?? '',
textAlign: TextAlign.center,
style: TextStyle(
color: clr ?? AppColors.darkGrey,
fontSize: 12,
fontWeight: fontWeight ?? FontWeight.normal),
),
),
);
}
_commonText(String title) {
return Text(
title,
style: TextStyle(
fontSize: 13, color: Colors.black, fontWeight: FontWeight.w900),
);
}
}

View File

@ -0,0 +1,563 @@
import 'package:flutter/material.dart';
import 'package:get/get.dart';
import '../../../../../../components/styles/app_colors.dart';
import '../../../../../../components/styles/app_images.dart';
import '../../../../../../components/styles/app_strings.dart';
import '../ctrl/report_controller.dart';
class ReportScreen extends StatefulWidget {
const ReportScreen({super.key});
@override
State<ReportScreen> createState() => _ReportScreenState();
}
class _ReportScreenState extends State<ReportScreen> {
final reportCtrl = Get.put(ReportController());
@override
Widget build(BuildContext context) {
return Column(
children: [
Container(
padding: EdgeInsets.only(bottom: 4),
margin: EdgeInsets.all(16),
child: Column(
children: [
Container(
margin: EdgeInsets.only(bottom: 12),
height: 50,
color: AppColors.primaryClr,
child: Row(
children: [
ListView.separated(
padding: EdgeInsets.symmetric(horizontal: 16),
scrollDirection: Axis.horizontal,
shrinkWrap: true,
itemBuilder: (context, index) {
return Obx(
() => InkWell(
onTap: () {},
child: Container(
margin: EdgeInsets.only(bottom: 10, top: 10),
decoration: BoxDecoration(
border: Border(
bottom: BorderSide(
color: reportCtrl
.selectedState.value ==
index
? Colors.white
: AppColors.primaryClr,
width: 3))),
child: Center(
child: Text(
reportCtrl.reportTabs[index].title ?? "",
style: TextStyle(
fontSize: 12,
fontWeight: FontWeight.w900,
color: Colors.white),
),
),
),
),
);
},
separatorBuilder: (context, index) {
return SizedBox(width: 16);
},
itemCount: reportCtrl.reportTabs.length),
Spacer(),
InkWell(
child: Image.asset(AppImages.refresh,
height: 10, width: 10)),
Padding(
padding: const EdgeInsets.all(8.0),
child: Text(
AppStrings.refresh,
style: TextStyle(
color: AppColors.white,
fontSize: 10,
fontWeight: FontWeight.normal),
),
),
InkWell(
child: Image.asset(AppImages.filter,
height: 12, width: 12)),
Padding(
padding: const EdgeInsets.all(8.0),
child: Text(
AppStrings.filter,
style: TextStyle(
color: AppColors.white,
fontSize: 10,
fontWeight: FontWeight.normal),
),
),
InkWell(
child: Image.asset(AppImages.exportIcon,
height: 12, width: 12)),
Padding(
padding: const EdgeInsets.all(8.0),
child: Text(
AppStrings.export,
style: TextStyle(
color: AppColors.white,
fontSize: 10,
fontWeight: FontWeight.normal),
),
),
],
),
),
],
),
),
Obx(() {
switch (reportCtrl.selectedState.value) {
case 0:
return _tableView();
default:
return _tableView();
}
}),
],
);
}
_tableView() {
return Scrollbar(
thumbVisibility: true,
controller: reportCtrl.verticalScrollController,
child: SingleChildScrollView(
scrollDirection: Axis.vertical,
controller: reportCtrl.verticalScrollController,
physics: AlwaysScrollableScrollPhysics(),
child: Scrollbar(
thumbVisibility: true,
controller: reportCtrl.horizontalScrollController,
child: SingleChildScrollView(
scrollDirection: Axis.horizontal,
controller: reportCtrl.horizontalScrollController,
child: SizedBox(
// height: MediaQuery.sizeOf(context).height * 0.68,
width: MediaQuery.sizeOf(context).width * 2.2,
child: Padding(
padding:
const EdgeInsets.symmetric(horizontal: 16, vertical: 0),
child: Table(
border: TableBorder.all(color: AppColors.clrGrey),
children: [
TableRow(
decoration:
BoxDecoration(color: AppColors.secondaryClr),
children: [
_cellText(
text: "SR. No.",
clr: Colors.black,
fontWeight: FontWeight.bold),
_cellText(
text: "Transporter LR No.",
clr: Colors.black,
fontWeight: FontWeight.bold),
_cellText(
text: "FTransporter LR No. Date",
clr: Colors.black,
fontWeight: FontWeight.bold),
_cellText(
text: "Vehicle No.",
clr: Colors.black,
fontWeight: FontWeight.bold),
_cellText(
text: "From Location Desc.",
clr: Colors.black,
fontWeight: FontWeight.bold),
_cellText(
text: "Plant",
clr: Colors.black,
fontWeight: FontWeight.bold),
_cellText(
text: "Product Name",
clr: Colors.black,
fontWeight: FontWeight.bold),
_cellText(
text: "Date(MIGO)",
clr: Colors.black,
fontWeight: FontWeight.bold),
_cellText(
text: "Disp Qty",
clr: Colors.black,
fontWeight: FontWeight.bold),
_cellText(
text: "Net Qty",
clr: Colors.black,
fontWeight: FontWeight.bold),
_cellText(
text: "Billing Qty",
clr: Colors.black,
fontWeight: FontWeight.bold),
_cellText(
text: "UOM",
clr: Colors.black,
fontWeight: FontWeight.bold),
_cellText(
text: "Freight Rate",
clr: Colors.black,
fontWeight: FontWeight.bold),
_cellText(
text: "Freight Amount",
clr: Colors.black,
fontWeight: FontWeight.bold),
_cellText(
text: "CGST",
clr: Colors.black,
fontWeight: FontWeight.bold),
_cellText(
text: "SGST",
clr: Colors.black,
fontWeight: FontWeight.bold),
_cellText(
text: "IGST",
clr: Colors.black,
fontWeight: FontWeight.bold),
_cellText(
text: "Total GST",
clr: Colors.black,
fontWeight: FontWeight.bold),
_cellText(
text: "Total Invoice Amount",
clr: Colors.black,
fontWeight: FontWeight.bold),
_cellText(
text: "Freight Bill No.",
clr: Colors.black,
fontWeight: FontWeight.bold),
_cellText(
text: "Freight Bill Date",
clr: Colors.black,
fontWeight: FontWeight.bold),
_cellText(
text: "Freight MIRO Status",
clr: Colors.black,
fontWeight: FontWeight.bold),
_cellText(
text: "CCN No.",
clr: Colors.black,
fontWeight: FontWeight.bold),
_cellText(
text: "CCN Date",
clr: Colors.black,
fontWeight: FontWeight.bold),
_cellText(
text: "CCN Qty",
clr: Colors.black,
fontWeight: FontWeight.bold),
_cellText(
text: "CCN Amount",
clr: Colors.black,
fontWeight: FontWeight.bold),
_cellText(
text: "CCN MIRO Status",
clr: Colors.black,
fontWeight: FontWeight.bold),
_cellText(
text: "UTR No.",
clr: Colors.black,
fontWeight: FontWeight.bold),
_cellText(
text: "UTR Date",
clr: Colors.black,
fontWeight: FontWeight.bold),
_cellText(
text: "Amount",
clr: Colors.black,
fontWeight: FontWeight.bold),
_cellText(
text: "UTR No. 1",
clr: Colors.black,
fontWeight: FontWeight.bold),
_cellText(
text: "UTR Date",
clr: Colors.black,
fontWeight: FontWeight.bold),
_cellText(
text: "Amount 1",
clr: Colors.black,
fontWeight: FontWeight.bold),
_cellText(
text: "UTR No. 2",
clr: Colors.black,
fontWeight: FontWeight.bold),
_cellText(
text: "UTR Date",
clr: Colors.black,
fontWeight: FontWeight.bold),
_cellText(
text: "Amount 2",
clr: Colors.black,
fontWeight: FontWeight.bold),
]),
TableRow(children: [
_cellText(
text: "01",
),
_cellText(text: "0000"),
_cellText(text: "5 Aug 2024"),
_cellText(text: "0000"),
_cellText(text: "78549-Plant 1"),
_cellText(text: "78549-Plant 1"),
_cellText(text: "Product 1"),
_cellText(text: "5 Aug 2024"),
_cellText(text: "0000"),
_cellText(text: "0000"),
_cellText(text: "0000"),
_cellText(text: "0000"),
_cellText(text: "0000"),
_cellText(text: "0000"),
_cellText(text: "0000"),
_cellText(text: "0000"),
_cellText(text: "0000"),
_cellText(text: "0000"),
_cellText(text: "0000"),
_cellText(text: "7894651231"),
_cellText(text: "5 Aug 2024"),
_cellText(
text: "Parked",
clr: AppColors.black,
fontWeight: FontWeight.bold),
_cellText(text: "56484654", clr: AppColors.primaryClr),
_cellText(text: "1 Aug 2024"),
_cellText(text: "0000"),
_cellText(text: "0000"),
_cellText(
text: "Parked",
clr: AppColors.black,
fontWeight: FontWeight.bold),
_cellText(text: "0000"),
_cellText(text: "5 Aug 2024"),
_cellText(text: "0000"),
_cellText(text: "5 Aug 2024"),
_cellText(text: "0000"),
_cellText(text: "0000"),
_cellText(text: "0000"),
_cellText(text: "5 Aug 2024"),
_cellText(text: "0000"),
]),
TableRow(children: [
_cellText(
text: "02",
),
_cellText(text: "0000"),
_cellText(text: "5 Aug 2024"),
_cellText(text: "0000"),
_cellText(text: "78549-Plant 1"),
_cellText(text: "78549-Plant 1"),
_cellText(text: "Product 1"),
_cellText(text: "5 Aug 2024"),
_cellText(text: "0000"),
_cellText(text: "0000"),
_cellText(text: "0000"),
_cellText(text: "0000"),
_cellText(text: "0000"),
_cellText(text: "0000"),
_cellText(text: "0000"),
_cellText(text: "0000"),
_cellText(text: "0000"),
_cellText(text: "0000"),
_cellText(text: "0000"),
_cellText(text: "7894651231"),
_cellText(text: "5 Aug 2024"),
_cellText(
text: "Parked",
clr: AppColors.black,
fontWeight: FontWeight.bold),
_cellText(text: "56484654", clr: AppColors.primaryClr),
_cellText(text: "1 Aug 2024"),
_cellText(text: "0000"),
_cellText(text: "0000"),
_cellText(
text: "Parked",
clr: AppColors.black,
fontWeight: FontWeight.bold),
_cellText(text: "0000"),
_cellText(text: "5 Aug 2024"),
_cellText(text: "0000"),
_cellText(text: "5 Aug 2024"),
_cellText(text: "0000"),
_cellText(text: "0000"),
_cellText(text: "0000"),
_cellText(text: "5 Aug 2024"),
_cellText(text: "0000"),
]),
TableRow(children: [
_cellText(
text: "03",
),
_cellText(text: "0000"),
_cellText(text: "5 Aug 2024"),
_cellText(text: "0000"),
_cellText(text: "78549-Plant 1"),
_cellText(text: "78549-Plant 1"),
_cellText(text: "Product 1"),
_cellText(text: "5 Aug 2024"),
_cellText(text: "0000"),
_cellText(text: "0000"),
_cellText(text: "0000"),
_cellText(text: "0000"),
_cellText(text: "0000"),
_cellText(text: "0000"),
_cellText(text: "0000"),
_cellText(text: "0000"),
_cellText(text: "0000"),
_cellText(text: "0000"),
_cellText(text: "0000"),
_cellText(text: "7894651231"),
_cellText(text: "5 Aug 2024"),
_cellText(
text: "Parked",
clr: AppColors.black,
fontWeight: FontWeight.bold),
_cellText(text: "56484654", clr: AppColors.primaryClr),
_cellText(text: "1 Aug 2024"),
_cellText(text: "0000"),
_cellText(text: "0000"),
_cellText(
text: "Parked",
clr: AppColors.black,
fontWeight: FontWeight.bold),
_cellText(text: "0000"),
_cellText(text: "5 Aug 2024"),
_cellText(text: "0000"),
_cellText(text: "5 Aug 2024"),
_cellText(text: "0000"),
_cellText(text: "0000"),
_cellText(text: "0000"),
_cellText(text: "5 Aug 2024"),
_cellText(text: "0000"),
]),
TableRow(children: [
_cellText(
text: "04",
),
_cellText(text: "0000"),
_cellText(text: "5 Aug 2024"),
_cellText(text: "0000"),
_cellText(text: "78549-Plant 1"),
_cellText(text: "78549-Plant 1"),
_cellText(text: "Product 1"),
_cellText(text: "5 Aug 2024"),
_cellText(text: "0000"),
_cellText(text: "0000"),
_cellText(text: "0000"),
_cellText(text: "0000"),
_cellText(text: "0000"),
_cellText(text: "0000"),
_cellText(text: "0000"),
_cellText(text: "0000"),
_cellText(text: "0000"),
_cellText(text: "0000"),
_cellText(text: "0000"),
_cellText(text: "7894651231"),
_cellText(text: "5 Aug 2024"),
_cellText(
text: "Pending",
clr: AppColors.black,
fontWeight: FontWeight.bold),
_cellText(text: "-"),
_cellText(text: "-"),
_cellText(text: "0000"),
_cellText(text: "0000"),
_cellText(
text: "Pending",
clr: AppColors.black,
fontWeight: FontWeight.bold),
_cellText(text: "0000"),
_cellText(text: "5 Aug 2024"),
_cellText(text: "0000"),
_cellText(text: "5 Aug 2024"),
_cellText(text: "0000"),
_cellText(text: "0000"),
_cellText(text: "0000"),
_cellText(text: "5 Aug 2024"),
_cellText(text: "0000"),
]),
TableRow(children: [
_cellText(
text: "05",
),
_cellText(text: "0000"),
_cellText(text: "5 Aug 2024"),
_cellText(text: "0000"),
_cellText(text: "78549-Plant 1"),
_cellText(text: "78549-Plant 1"),
_cellText(text: "Product 1"),
_cellText(text: "5 Aug 2024"),
_cellText(text: "0000"),
_cellText(text: "0000"),
_cellText(text: "0000"),
_cellText(text: "0000"),
_cellText(text: "0000"),
_cellText(text: "0000"),
_cellText(text: "0000"),
_cellText(text: "0000"),
_cellText(text: "0000"),
_cellText(text: "0000"),
_cellText(text: "0000"),
_cellText(text: "7894651231"),
_cellText(text: "5 Aug 2024"),
_cellText(
text: "Pending",
clr: AppColors.black,
fontWeight: FontWeight.bold),
_cellText(text: "-", clr: AppColors.primaryClr),
_cellText(text: "-"),
_cellText(text: "0000"),
_cellText(text: "0000"),
_cellText(
text: "Pending",
clr: AppColors.black,
fontWeight: FontWeight.bold),
_cellText(text: "0000"),
_cellText(text: "5 Aug 2024"),
_cellText(text: "0000"),
_cellText(text: "5 Aug 2024"),
_cellText(text: "0000"),
_cellText(text: "0000"),
_cellText(text: "0000"),
_cellText(text: "5 Aug 2024"),
_cellText(text: "0000"),
]),
]),
),
),
),
),
),
);
}
_cellText({String? text, Color? clr, FontWeight? fontWeight}) {
return Center(
child: Padding(
padding: const EdgeInsets.symmetric(vertical: 8.0, horizontal: 4),
child: Text(
text ?? '',
textAlign: TextAlign.center,
style: TextStyle(
color: clr ?? AppColors.darkGrey,
fontSize: 12,
fontWeight: fontWeight ?? FontWeight.normal),
),
),
);
}
_commonText(String title) {
return Text(
title,
style: TextStyle(
fontSize: 13, color: Colors.black, fontWeight: FontWeight.w900),
);
}
}

View File

@ -1,9 +1,9 @@
import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:shayog/components/common/common_btn.dart';
import 'package:shayog/components/common/common_button.dart';
import 'package:shayog/feature/presentation/screens/transporter/model/view_freight_bill_res_model.dart';
import 'package:shayog/feature/presentation/screens/transporter/widgets/freightbill_dialog.dart';
import '../../../../../../../components/common/data_cell.dart';
@ -190,7 +190,7 @@ class ViewFreightBill extends StatelessWidget {
children: [
IconButton(
icon: Icon(Icons.chevron_left),
onPressed: ctrl.currentPage > 0
onPressed: ctrl.currentPage.value > 0
? () => ctrl.previousPage()
: null,
),
@ -202,14 +202,15 @@ class ViewFreightBill extends StatelessWidget {
SizedBox(width: 16),
IconButton(
icon: Icon(Icons.chevron_right),
onPressed: ctrl.currentPage < ctrl.totalPages.value - 1
onPressed: ctrl.currentPage.value < ctrl.totalPages.value - 1
? () => ctrl.nextPage()
: null,
),
],
),
),
),
)
],
);
}

View File

@ -1,6 +1,10 @@
import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:shayog/components/common/custom_drop_down.dart';
import 'package:shayog/components/styles/textStyles.dart';
import 'package:shayog/feature/presentation/screens/transporter/view/sub_views/invoice_management_screen.dart';
import 'package:shayog/feature/presentation/screens/transporter/view/sub_views/report_screen.dart';
import 'package:shayog/feature/presentation/widgets/text_view.dart';
import '../../../../../../components/common/common_btn.dart';
@ -63,13 +67,11 @@ class _TransportViewState extends State<TransportView> {
: ctrl.tabs[index].image),
),
),
Text(
ctrl.tabs[index].title ?? "",
TextView(
text: ctrl.tabs[index].title ?? "",
textAlign: TextAlign.center,
style: TextStyle(
fontSize: 10,
color: Colors.white,
fontWeight: FontWeight.w900),
style: 10.txtBoldWhite,
)
],
),
@ -89,10 +91,10 @@ class _TransportViewState extends State<TransportView> {
return _dashboardView();
case 1:
return Center(child: Text(''));
return InvoiceManagement();
default:
return Center(child: Text(''));
return ReportScreen();
}
}),
)
@ -136,12 +138,11 @@ class _TransportViewState extends State<TransportView> {
: AppColors.primaryClr,
width: 3))),
child: Center(
child: Text(
child: TextView(
text:
ctrl.userTabs[index].title ?? "",
style: TextStyle(
fontSize: 12,
fontWeight: FontWeight.w900,
color: Colors.white),
style: 12.txtBoldWhite,
),
),
),
@ -162,10 +163,8 @@ class _TransportViewState extends State<TransportView> {
padding: const EdgeInsets.all(8.0),
child: Text(
AppStrings.refresh,
style: TextStyle(
color: AppColors.white,
fontSize: 12,
fontWeight: FontWeight.bold),
style: 12.txtBoldWhite,
),
),
Obx(() =>
@ -181,12 +180,11 @@ class _TransportViewState extends State<TransportView> {
visible: ctrl.selectedUser.value >= 1,
child: Padding(
padding: const EdgeInsets.all(8.0),
child: Text(
AppStrings.filter,
style: TextStyle(
color: AppColors.white,
fontSize: 12,
fontWeight: FontWeight.bold),
child: TextView(
text:AppStrings.filter,
style: 12.txtBoldWhite,
),
),
),
@ -210,7 +208,8 @@ class _TransportViewState extends State<TransportView> {
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
_commonText(
TextView(
text:
"Plant",
),
SizedBox(height: 8),
@ -233,8 +232,8 @@ class _TransportViewState extends State<TransportView> {
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
_commonText(
"Freight Bill No.",
TextView(
text: "Freight Bill No.",
),
SizedBox(height: 8),
CustomDropdown(
@ -256,7 +255,8 @@ class _TransportViewState extends State<TransportView> {
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
_commonText(
TextView(
text:
"Product Name",
),
SizedBox(height: 8),
@ -286,7 +286,8 @@ class _TransportViewState extends State<TransportView> {
crossAxisAlignment:
CrossAxisAlignment.start,
children: [
_commonText(
TextView(
text:
"Plant",
),
SizedBox(height: 8),
@ -312,8 +313,9 @@ class _TransportViewState extends State<TransportView> {
crossAxisAlignment:
CrossAxisAlignment.start,
children: [
_commonText(
"Trancastion Type",
TextView(
text:
"Transaction Type",
),
SizedBox(height: 8),
CustomDropdown(
@ -335,7 +337,8 @@ class _TransportViewState extends State<TransportView> {
Expanded(
child: Column(
children: [
_commonText(
TextView(
text:
"" ,
),
SizedBox(height: 8),
@ -351,7 +354,7 @@ class _TransportViewState extends State<TransportView> {
SizedBox(width: 16),
CommonBtn(
text: AppStrings.submit,
textClr: Colors.white, clickAction: () {
style: 14.txtBoldWhite, clickAction: () {
ctrl.isSelected.value = false;
},
),
@ -386,12 +389,6 @@ class _TransportViewState extends State<TransportView> {
],
);
}
_commonText(String title) {
return Text(
title,
style: TextStyle(
fontSize: 13, color: Colors.black, fontWeight: FontWeight.w900),
);
}
}

View File

@ -197,7 +197,7 @@ class TransportController extends GetxController {
}
}
/////////////////////// PRIYA ////////////////////
////////////////////////////////////////// PRIYA ///////////////////////////////////////////////
var freightBillData = <FreightBill>[].obs;
var currentPage = 0.obs;
var totalPages = 0.obs;
@ -205,7 +205,6 @@ class TransportController extends GetxController {
var pageSize = 2.obs;
var sortField = "grn_date".obs;
var sortDirection = "desc".obs;
viewFreightView({int? page, String? sort, String? direction}) async {
try {
freightViewLoader.value = true;
@ -227,7 +226,8 @@ class TransportController extends GetxController {
"sort": "${sortField.value},${sortDirection.value}"
};
var response = await PostRequests.viewFreightBill(requestBody);
var response = await PostRequests.viewFreightBill(requestBody,
currentPage.value, pageSize.value, '$sortField', '$sortDirection');
if (response != null) {
List<FreightBill> flattenedContent =
response.content!.expand((list) => list).toList();
@ -240,19 +240,16 @@ class TransportController extends GetxController {
freightViewLoader.value = false;
}
}
void nextPage() {
if (currentPage < totalPages.value - 1) {
viewFreightView(page: currentPage.value + 1);
}
}
void previousPage() {
if (currentPage > 0) {
viewFreightView(page: currentPage.value - 1);
}
}
void changeSort(String field) {
if (field == sortField.value) {
sortDirection.value = sortDirection.value == "asc" ? "desc" : "asc";

View File

@ -95,19 +95,17 @@ class CommonDialogContent extends StatelessWidget {
child: Text(
message.tr,
textAlign: TextAlign.center,
style: TextStyle(
fontWeight: FontWeight.bold, fontSize: 12, color: Colors.black),
// style: 14.txtBoldBlack,
style: 14.txtBoldBlack,
),
),
Row(
children: [
Expanded(
child: CommonButton(
textStyle: TextStyle(
fontSize: 10,
color: AppColors.primaryClr,
fontWeight: FontWeight.bold),
textStyle: 10.txtBoldBlue,
borderColor: AppColors.primaryClr,
backgroundColor: Colors.white,
borderRadius: 4,
@ -122,10 +120,7 @@ class CommonDialogContent extends StatelessWidget {
),
Expanded(
child: CommonButton(
textStyle: TextStyle(
fontSize: 10,
color: AppColors.primaryClr,
fontWeight: FontWeight.bold),
textStyle: 10.txtBoldBlue,
borderColor: AppColors.primaryClr,
backgroundColor: Colors.white,
borderRadius: 4,

View File

@ -1,5 +1,6 @@
import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:shayog/components/styles/textStyles.dart';
import '../../../../../../components/common/common_btn.dart';
import '../../../../../../components/common/data_cell.dart';
import '../../../../../../components/styles/app_colors.dart';
@ -265,7 +266,7 @@ void showFreightBill(BuildContext context) {
Align(
alignment: Alignment.bottomRight,
child: CommonBtn(
textClr: AppColors.primaryClr,
style: 14.txtBoldBlue,
borderClr: AppColors.primaryClr,
bkClr: Colors.white,
margin: EdgeInsets.only(top: 24),

View File

@ -37,7 +37,7 @@ Widget build(BuildContext context) {
onTap: onTap, child: Text(
capitalise != null && capitalise! ? text.toUpperCase() : text, maxLines: maxlines,
overflow: maxlines != null ? TextOverflow.ellipsis : null, textAlign: textAlign,
style: style ?? 14.txtRegularBlack,
style: style ?? 12.txtBoldBlack,
), ),
);

View File

@ -1,5 +1,7 @@
import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:shayog/navigation/navigation.dart';
import 'package:shayog/navigation/page_routes.dart';
import 'package:sizer/sizer.dart';
import 'feature/presentation/screens/dashboard/dashboard_screen.dart';
@ -18,7 +20,9 @@ class MyApp extends StatelessWidget {
return GetMaterialApp(
debugShowCheckedModeBanner: false,
title: 'Shayog',
home: DashboardScreen(),
initialRoute: PageRoutes.login,
onGenerateRoute: Navigation.onGenerateRoutes,
// home: DashboardScreen(),
);
});
}

View File

@ -0,0 +1,26 @@
import 'package:flutter/material.dart';
import 'package:shayog/feature/presentation/screens/dashboard/dashboard_screen.dart';
import 'package:shayog/navigation/page_routes.dart';
import '../feature/presentation/screens/onbaord/view/login_screen.dart';
class Navigation {
static Route<dynamic>? onGenerateRoutes(RouteSettings routeSettings) {
final arguments = routeSettings.arguments;
switch (routeSettings.name) {
// case PageRoutes.splash:
// return MaterialPageRoute(
// settings: routeSettings,
// builder: (context) => const SplashScreen());
case PageRoutes.login:
return MaterialPageRoute(
settings: routeSettings, builder: (context) => LoginScreen());
case PageRoutes.dashboard:
return MaterialPageRoute(
settings: routeSettings, builder: (context) => DashboardScreen());
}
return null;
}
}

View File

@ -0,0 +1,5 @@
class PageRoutes {
static const String splash = "/";
static const String login = "login";
static const String dashboard = "dashboard";
}

View File

@ -13,10 +13,10 @@ class ApiUrls {
static const editUser =
'http://localhost:9090/api/users/update?userEmpTransCode=';
static const getAllUser =
'http://localhost:9090/api/users/userdetails?page=0&size=8&sort=last_updated_on,desc';
'http://localhost:9090/api/users/userdetails?page=';
static const viewFreightBill =
'http://localhost:9098/bill/freightbill?page=0&size=20&sort=grn_date,desc';
'http://localhost:9098/bill/freightbill?page';
static const addUserType =
'http://localhost:9090/api/user-types/createUserType';
static const dropDownList =

View File

@ -66,9 +66,9 @@ class PostRequests {
}
static Future<GetAllUserResModel?> getAllUser(
Map<String, String> requestBody) async {
Map<String, String> requestBody,int page, int limit) async {
var apiResponse =
await RemoteService.postUser(requestBody, ApiUrls.getAllUser);
await RemoteService.postUser(requestBody, "${ApiUrls.getAllUser}$page&size=$limit&sort=last_updated_on,desc");
if (apiResponse != null) {
return getAllUserResModelFromJson(apiResponse.response!);
@ -91,9 +91,9 @@ class PostRequests {
}
static Future<ViewFreightBillResModel?> viewFreightBill(
Map<String, String> requestBody) async {
Map<String, String> requestBody, int page, int size,String sort,String dir) async {
var apiResponse =
await RemoteService.postUser(requestBody, ApiUrls.viewFreightBill);
await RemoteService.postUser(requestBody, '${ApiUrls.viewFreightBill}=$page&size=$size&sort=$sort,$dir' );
if (apiResponse != null) {
return viewFreightBillResModelFromJson(apiResponse.response!);

View File

@ -81,25 +81,25 @@ flutter:
# list giving the asset and other descriptors for the font. For
# example:
fonts:
- family: Anek_Latin-Bold
- family: AnekLatin-Bold
fonts:
- asset: assets/fonts/AnekLatin-Bold.ttf
- family: Anek_Latin-ExtraBold
- family: AnekLatin-ExtraBold
fonts:
- asset: assets/fonts/AnekLatin-ExtraBold.ttf
- family: Anek_Latin-SemiBold
- family: AnekLatin-SemiBold
fonts:
- asset: assets/fonts/AnekLatin-SemiBold.ttf
- family: Anek_Latin-Medium
- family: AnekLatin-Medium
fonts:
- asset: assets/fonts/AnekLatin-Medium.ttf
- family: Anek_Latin-Regular
- family: AnekLatin-Regular
fonts:
- asset: assets/fonts/AnekLatin-Regular.ttf
- family: Anek_Latin-Light
- family: AnekLatin-Light
fonts:
- asset: assets/fonts/AnekLatin-Light.ttf
- family: Anek_Latin-Thin
- family: AnekLatin-Thin
fonts:
- asset: assets/fonts/AnekLatin-Thin.ttf
#