Enhance Customer model to include role attribute and update related components

- Added a new `role` attribute to the `Customer` model in `customer.dart` and updated the corresponding generated files.
- Modified the `AuthViewModel` to set the user role based on the logged-in user's role.
- Updated UI components in `TenderDetailActions` and `DesktopTendersPage` to conditionally render elements based on the user's role.
- Refactored tests to validate the new role attribute in the `Customer` model.
This commit is contained in:
amirrezaghabeli
2025-10-14 09:12:24 +03:30
parent 504fa1e80a
commit 13dbb5fae5
10 changed files with 109 additions and 53 deletions
@@ -52,6 +52,7 @@ class _PageSelectionDialogState extends State<PageSelectionDialog> {
final pageNumber = index + 1;
return ListTile(
contentPadding: EdgeInsets.zero,
leading: Radio<int>(
value: pageNumber,
groupValue: selectedPage,
+26 -10
View File
@@ -1,7 +1,6 @@
import 'package:flutter/material.dart';
import 'package:go_router/go_router.dart';
import 'package:tm_app/core/utils/size_config.dart';
import 'package:tm_app/views/shared/base_button.dart';
import '../../core/constants/common_strings.dart';
import '../../core/constants/tender_submision_mode.dart';
@@ -91,18 +90,35 @@ class _SelectSubmissionDialogState extends State<SelectSubmissionDialog> {
// ),
// ),
// ),
BaseButton(
isEnabled: true,
onPressed: () {
InkWell(
highlightColor: Colors.transparent,
splashColor: Colors.transparent,
onTap: () {
context.pop();
},
width: 150,
height: 56.0,
text: CommonStrings.cancel,
backgroundColor: Colors.transparent,
textColor: AppColors.errorColor,
borderColor: AppColors.errorColor,
child: Container(
width: 150,
height: 56.0,
decoration: BoxDecoration(
color: Colors.transparent,
borderRadius: BorderRadius.circular(100),
border: Border.all(
color: AppColors.errorColor,
width: 2.0,
),
),
alignment: Alignment.center,
child: Text(
CommonStrings.cancel,
style: TextStyle(
fontSize: 14.0.sp(),
fontWeight: FontWeight.w500,
color: AppColors.errorColor,
),
),
),
),
SizedBox(width: 10.0.w()),
InkWell(