Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
Sai Srinivas
gen_rentals
Commits
b8c2cae9
Commit
b8c2cae9
authored
Oct 18, 2025
by
Sai Srinivas
Browse files
Some Changes
parent
5ac94fe2
Changes
22
Expand all
Hide whitespace changes
Inline
Side-by-side
android/app/src/main/AndroidManifest.xml
View file @
b8c2cae9
...
...
@@ -2,10 +2,15 @@
<uses-permission
android:name=
"android.permission.CAMERA"
/>
<uses-permission
android:name=
"android.permission.READ_EXTERNAL_STORAGE"
/>
<uses-permission
android:name=
"android.permission.WRITE_EXTERNAL_STORAGE"
/>
<uses-permission
android:name=
"android.permission.ACCESS_NETWORK_STATE"
/>
<uses-permission
android:name=
"android.permission.INTERNET"
/>
<uses-permission
android:name=
"android.permission.ACCESS_WIFI_STATE"
/>
<application
android:label=
"Gen Rentals"
android:name=
"${applicationName}"
android:icon=
"@mipmap/ic_launcher"
android:usesCleartextTraffic=
"true"
android:enableOnBackInvokedCallback=
"true"
>
<!-- Fixed: Removed extra quote and corrected placement -->
<activity
android:name=
".MainActivity"
...
...
assets/fonts/Poppins/Poppins-Bold.ttf
0 → 100644
View file @
b8c2cae9
File added
assets/fonts/Poppins/Poppins-Medium.ttf
0 → 100644
View file @
b8c2cae9
File added
assets/fonts/Poppins/Poppins-Regular.ttf
0 → 100644
View file @
b8c2cae9
File added
lib/Models/SubscribeOrderDetailsResponse.dart
View file @
b8c2cae9
...
...
@@ -2,9 +2,14 @@ class SubscribeOrderDetailsResponse {
String
?
orderid
;
String
?
orderNum
;
String
?
rentedDate
;
String
?
fromDate
;
String
?
toDate
;
String
?
accName
;
String
?
adress
;
String
?
expiringInColor
;
String
?
expiringText
;
List
<
Products
>?
products
;
List
<
PurchasedItm
>?
purchasedItm
;
String
?
error
;
String
?
message
;
...
...
@@ -12,9 +17,14 @@ class SubscribeOrderDetailsResponse {
{
this
.
orderid
,
this
.
orderNum
,
this
.
rentedDate
,
this
.
fromDate
,
this
.
toDate
,
this
.
accName
,
this
.
adress
,
this
.
expiringInColor
,
this
.
expiringText
,
this
.
products
,
this
.
purchasedItm
,
this
.
error
,
this
.
message
});
...
...
@@ -22,6 +32,10 @@ class SubscribeOrderDetailsResponse {
orderid
=
json
[
'orderid'
];
orderNum
=
json
[
'order_num'
];
rentedDate
=
json
[
'rentedDate'
];
fromDate
=
json
[
'from_date'
];
toDate
=
json
[
'to_date'
];
accName
=
json
[
'acc_name'
];
adress
=
json
[
'adress'
];
expiringInColor
=
json
[
'ExpiringInColor'
];
expiringText
=
json
[
'expiringText'
];
if
(
json
[
'products'
]
!=
null
)
{
...
...
@@ -30,6 +44,12 @@ class SubscribeOrderDetailsResponse {
products
!.
add
(
new
Products
.
fromJson
(
v
));
});
}
if
(
json
[
'purchased_itm'
]
!=
null
)
{
purchasedItm
=
<
PurchasedItm
>[];
json
[
'purchased_itm'
].
forEach
((
v
)
{
purchasedItm
!.
add
(
new
PurchasedItm
.
fromJson
(
v
));
});
}
error
=
json
[
'error'
];
message
=
json
[
'message'
];
}
...
...
@@ -39,11 +59,19 @@ class SubscribeOrderDetailsResponse {
data
[
'orderid'
]
=
this
.
orderid
;
data
[
'order_num'
]
=
this
.
orderNum
;
data
[
'rentedDate'
]
=
this
.
rentedDate
;
data
[
'from_date'
]
=
this
.
fromDate
;
data
[
'to_date'
]
=
this
.
toDate
;
data
[
'acc_name'
]
=
this
.
accName
;
data
[
'adress'
]
=
this
.
adress
;
data
[
'ExpiringInColor'
]
=
this
.
expiringInColor
;
data
[
'expiringText'
]
=
this
.
expiringText
;
if
(
this
.
products
!=
null
)
{
data
[
'products'
]
=
this
.
products
!.
map
((
v
)
=>
v
.
toJson
()).
toList
();
}
if
(
this
.
purchasedItm
!=
null
)
{
data
[
'purchased_itm'
]
=
this
.
purchasedItm
!.
map
((
v
)
=>
v
.
toJson
()).
toList
();
}
data
[
'error'
]
=
this
.
error
;
data
[
'message'
]
=
this
.
message
;
return
data
;
...
...
@@ -90,3 +118,28 @@ class Products {
return
data
;
}
}
class
PurchasedItm
{
String
?
id
;
String
?
prodName
;
String
?
qty
;
String
?
totalPrice
;
PurchasedItm
({
this
.
id
,
this
.
prodName
,
this
.
qty
,
this
.
totalPrice
});
PurchasedItm
.
fromJson
(
Map
<
String
,
dynamic
>
json
)
{
id
=
json
[
'id'
];
prodName
=
json
[
'prod_name'
];
qty
=
json
[
'qty'
];
totalPrice
=
json
[
'total_price'
];
}
Map
<
String
,
dynamic
>
toJson
()
{
final
Map
<
String
,
dynamic
>
data
=
new
Map
<
String
,
dynamic
>();
data
[
'id'
]
=
this
.
id
;
data
[
'prod_name'
]
=
this
.
prodName
;
data
[
'qty'
]
=
this
.
qty
;
data
[
'total_price'
]
=
this
.
totalPrice
;
return
data
;
}
}
lib/Notifier/HelpAndEnquiryProvider.dart
View file @
b8c2cae9
import
'dart:io'
;
import
'package:flutter/material.dart'
;
import
'package:gen_rentals/Services/api_calling.dart'
;
import
'../Models/HelpAndEnquiryModels/TicketChatDisplayResponse.dart'
;
import
'../Models/HelpAndEnquiryModels/ticketListResponse.dart'
;
import
'../Utility/CustomSnackbar.dart'
;
...
...
@@ -157,8 +155,7 @@ class HelpAndEnquiryProvider extends ChangeNotifier {
notifyListeners
();
}
/// Send a Message Provider fun
bool
_isSending
=
false
;
bool
get
isSending
=>
_isSending
;
...
...
@@ -222,6 +219,59 @@ class HelpAndEnquiryProvider extends ChangeNotifier {
_setSending
(
false
);
}
}
/// Create New Ticket Provider fun
bool
_isCreatingTicket
=
false
;
bool
get
isCreatingTicket
=>
_isCreatingTicket
;
void
_setCreatingTicket
(
bool
value
)
{
_isCreatingTicket
=
value
;
notifyListeners
();
}
Future
<
void
>
createTicket
({
required
BuildContext
context
,
required
String
sessionId
,
required
String
accId
,
required
String
type
,
required
String
description
,
required
String
orderId
,
required
List
<
File
>
images
,
})
async
{
_setCreatingTicket
(
true
);
try
{
final
response
=
await
ApiCalling
.
addTicketApi
(
sessionId
,
accId
,
type
,
description
,
orderId
,
images
,
);
if
(
response
!=
null
&&
response
.
error
==
"0"
)
{
CustomSnackBar
.
showInfo
(
context:
context
,
message:
response
.
message
??
"Ticket created successfully!"
,
);
Navigator
.
pop
(
context
);
// close bottom sheet or dialog if open
}
else
{
CustomSnackBar
.
showError
(
context:
context
,
message:
response
?.
message
??
"Failed to create ticket"
,
);
}
}
catch
(
e
)
{
debugPrint
(
"❌ createTicket error:
$e
"
);
CustomSnackBar
.
showWarning
(
context:
context
,
message:
"Something went wrong. Please try again."
,
);
}
finally
{
_setCreatingTicket
(
false
);
}
}
}
...
...
@@ -230,3 +280,4 @@ class HelpAndEnquiryProvider extends ChangeNotifier {
lib/Screens/BillDetailListScreen.dart
View file @
b8c2cae9
...
...
@@ -34,7 +34,7 @@ class _BillDetailListScreenState extends State<BillDetailListScreen> {
style:
TextStyle
(
fontSize:
16
,
fontFamily:
"Plus Jakarta Sans"
,
fontWeight:
FontWeight
.
w
6
00
,
fontWeight:
FontWeight
.
w
4
00
,
color:
Colors
.
black87
,
),
),
...
...
@@ -47,7 +47,16 @@ class _BillDetailListScreenState extends State<BillDetailListScreen> {
child:
Column
(
crossAxisAlignment:
CrossAxisAlignment
.
start
,
children:
[
SectionHeading
(
title:
'Latest Bill'
,
padding:
EdgeInsets
.
symmetric
(
horizontal:
0
,
vertical:
6
),),
SectionHeading
(
title:
'Latest Bill'
,
textStyle:
TextStyle
(
fontFamily:
"Poppins"
,
color:
AppColors
.
normalText
,
fontSize:
14
,
fontWeight:
FontWeight
.
w500
,
),
padding:
EdgeInsets
.
symmetric
(
horizontal:
10
,
vertical:
4
),
),
const
SizedBox
(
height:
12
),
...
...
@@ -103,6 +112,7 @@ class _BillDetailListScreenState extends State<BillDetailListScreen> {
fontFamily:
"Poppins"
,
color:
const
Color
(
0xFF212121
),
fontSize:
14
,
fontStyle:
FontStyle
.
normal
,
fontWeight:
FontWeight
.
w400
,
),
),
...
...
@@ -128,18 +138,20 @@ class _BillDetailListScreenState extends State<BillDetailListScreen> {
"Invoice raised against"
,
style:
TextStyle
(
fontFamily:
"Poppins"
,
fontStyle:
FontStyle
.
normal
,
color:
AppColors
.
normalText
,
fontWeight:
FontWeight
.
w400
,
fontSize:
1
2
,
fontSize:
1
4
,
),
),
Text
(
"#1253"
,
// Fixed date range
style:
TextStyle
(
fontFamily:
"Poppins"
,
fontStyle:
FontStyle
.
normal
,
color:
AppColors
.
amountText
,
fontWeight:
FontWeight
.
w400
,
// Medium for dates
fontSize:
1
2
,
fontSize:
1
4
,
),
),
],
...
...
@@ -153,18 +165,20 @@ class _BillDetailListScreenState extends State<BillDetailListScreen> {
"order ID: 1253"
,
style:
TextStyle
(
fontFamily:
"Poppins"
,
fontStyle:
FontStyle
.
normal
,
color:
AppColors
.
normalText
,
fontWeight:
FontWeight
.
w400
,
fontSize:
1
2
,
fontSize:
1
4
,
),
),
Text
(
"7th Oct 2025"
,
// Fixed date range
style:
TextStyle
(
fontStyle:
FontStyle
.
normal
,
fontFamily:
"Poppins"
,
color:
AppColors
.
normalText
,
fontWeight:
FontWeight
.
w400
,
// Medium for dates
fontSize:
1
2
,
fontSize:
1
4
,
),
),
],
...
...
@@ -175,11 +189,17 @@ class _BillDetailListScreenState extends State<BillDetailListScreen> {
),
const
SizedBox
(
height:
24
),
const
SectionHeading
(
SectionHeading
(
title:
'All Previous Bills'
,
padding:
EdgeInsets
.
symmetric
(
vertical:
8
),
textStyle:
TextStyle
(
fontFamily:
"Poppins"
,
color:
AppColors
.
normalText
,
fontSize:
14
,
fontWeight:
FontWeight
.
w500
,
),
padding:
EdgeInsets
.
symmetric
(
horizontal:
10
,
vertical:
4
),
),
const
SizedBox
(
height:
8
),
// Bill List
...
...
@@ -247,7 +267,8 @@ class _BillDetailListScreenState extends State<BillDetailListScreen> {
fontFamily:
"Poppins"
,
color:
AppColors
.
amountText
,
fontWeight:
FontWeight
.
w400
,
fontSize:
12
,
fontStyle:
FontStyle
.
normal
,
fontSize:
14
,
),
),
const
SizedBox
(
height:
2
),
...
...
@@ -266,12 +287,13 @@ class _BillDetailListScreenState extends State<BillDetailListScreen> {
),
Text
(
"
₹
$amount
"
,
"
5th Oct, 2025
"
,
style:
TextStyle
(
fontFamily:
"Poppins"
,
color:
AppColors
.
amountText
,
fontSize:
18
,
fontWeight:
FontWeight
.
w500
,
color:
AppColors
.
subtitleText
,
fontSize:
12
,
fontStyle:
FontStyle
.
normal
,
fontWeight:
FontWeight
.
w400
,
),
),
...
...
@@ -282,7 +304,7 @@ class _BillDetailListScreenState extends State<BillDetailListScreen> {
mainAxisAlignment:
MainAxisAlignment
.
spaceBetween
,
children:
[
Text
(
"
$fromDate
-
$toDate
"
,
"
Order ID : 1253
"
,
style:
TextStyle
(
fontFamily:
"Poppins"
,
color:
AppColors
.
normalText
,
...
...
@@ -296,9 +318,10 @@ class _BillDetailListScreenState extends State<BillDetailListScreen> {
"₹
$amount
"
,
style:
TextStyle
(
fontFamily:
"Poppins"
,
color:
AppColors
.
amountText
,
fontSize:
18
,
fontWeight:
FontWeight
.
w500
,
color:
AppColors
.
cardAmountText
,
fontSize:
14
,
fontStyle:
FontStyle
.
normal
,
fontWeight:
FontWeight
.
w400
,
),
),
...
...
lib/Screens/DashboardScreen.dart
View file @
b8c2cae9
This diff is collapsed.
Click to expand it.
lib/Screens/HelpScreens/CreateTicketScreen.dart
View file @
b8c2cae9
import
'dart:io'
;
import
'package:flutter/material.dart'
;
import
'package:flutter_svg/flutter_svg.dart'
;
import
'package:gen_rentals/Utility/CustomSnackbar.dart'
;
import
'package:image_picker/image_picker.dart'
;
import
'package:provider/provider.dart'
;
import
'../../Notifier/HelpAndEnquiryProvider.dart'
;
import
'../../Utility/AppColors.dart'
;
import
'../../Utility/Reusablewidgets.dart'
;
class
HelpTicketScreen
extends
StatefulWidget
{
final
String
?
reason
;
const
HelpTicketScreen
({
super
.
key
,
this
.
reason
});
final
String
sessionId
;
final
String
accId
;
final
String
orderId
;
const
HelpTicketScreen
({
super
.
key
,
this
.
reason
,
required
this
.
sessionId
,
required
this
.
accId
,
required
this
.
orderId
});
@override
State
<
HelpTicketScreen
>
createState
()
=>
_HelpTicketScreenState
();
...
...
@@ -14,10 +29,10 @@ class HelpTicketScreen extends StatefulWidget {
class
_HelpTicketScreenState
extends
State
<
HelpTicketScreen
>
{
final
TextEditingController
_issueController
=
TextEditingController
();
final
TextEditingController
_otherReasonController
=
TextEditingController
();
List
<
String
>
_selectedImages
=
[];
String
_selectedReason
=
'Payment Issue'
;
final
ImagePicker
_picker
=
ImagePicker
();
List
<
File
>
_selectedImages
=
[];
String
_selectedReason
=
'Payment Issues'
;
// Dummy data for help - with proper null safety
final
List
<
Map
<
String
,
dynamic
>>
createNewTickets
=
[
{
'title'
:
'Payment Issues'
,
...
...
@@ -50,6 +65,7 @@ class _HelpTicketScreenState extends State<HelpTicketScreen> {
@override
Widget
build
(
BuildContext
context
)
{
final
showOtherReasonField
=
_selectedReason
==
'Other Issues'
;
final
helpProvider
=
Provider
.
of
<
HelpAndEnquiryProvider
>(
context
);
return
SafeArea
(
top:
false
,
...
...
@@ -86,11 +102,13 @@ class _HelpTicketScreenState extends State<HelpTicketScreen> {
child:
Column
(
crossAxisAlignment:
CrossAxisAlignment
.
start
,
children:
[
/// Section Title
Row
(
mainAxisAlignment:
MainAxisAlignment
.
spaceBetween
,
children:
[
SectionHeading
(
title:
'Create New Ticket'
),
SectionHeading
(
title:
'Create New Ticket'
,
textStyle:
TextStyle
(
fontSize:
16
,
fontWeight:
FontWeight
.
w500
),
),
Container
(
padding:
const
EdgeInsets
.
symmetric
(
horizontal:
14
,
vertical:
10
),
...
...
@@ -98,12 +116,12 @@ class _HelpTicketScreenState extends State<HelpTicketScreen> {
color:
Colors
.
blue
.
shade50
,
borderRadius:
BorderRadius
.
circular
(
10
),
),
child:
Text
(
child:
const
Text
(
"order #1235"
,
style:
TextStyle
(
fontSize:
1
4
,
fontSize:
1
2
,
fontFamily:
"Plus Jakarta Sans"
,
fontWeight:
FontWeight
.
w
5
00
,
fontWeight:
FontWeight
.
w
4
00
,
color:
Colors
.
black87
,
),
),
...
...
@@ -112,18 +130,16 @@ class _HelpTicketScreenState extends State<HelpTicketScreen> {
),
const
SizedBox
(
height:
12
),
/// Reason Label
_fieldLabel
(
"Reason"
),
const
SizedBox
(
height:
6
),
/// Reason Selection Button - Opens Bottom Sheet
GestureDetector
(
onTap:
_showReasonBottomSheet
,
child:
Container
(
width:
200
,
padding:
const
EdgeInsets
.
symmetric
(
horizontal:
16
,
vertical:
12
),
padding:
const
EdgeInsets
.
symmetric
(
horizontal:
16
,
vertical:
12
),
decoration:
BoxDecoration
(
color:
Color
(
0xffFFF3D1
),
color:
const
Color
(
0xffFFF3D1
),
borderRadius:
BorderRadius
.
circular
(
12
),
),
child:
Row
(
...
...
@@ -131,10 +147,10 @@ class _HelpTicketScreenState extends State<HelpTicketScreen> {
children:
[
Text
(
_selectedReason
,
style:
const
TextStyle
(
style:
TextStyle
(
fontSize:
14
,
font
Family:
"Plus Jakarta Sans"
,
fontWeight:
FontWeight
.
w
5
00
,
font
Style:
FontStyle
.
normal
,
fontWeight:
FontWeight
.
w
4
00
,
color:
Colors
.
black87
,
),
),
...
...
@@ -148,7 +164,6 @@ class _HelpTicketScreenState extends State<HelpTicketScreen> {
),
const
SizedBox
(
height:
16
),
/// Other Reason Field
if
(
showOtherReasonField
)
...[
_fieldLabel
(
"Enter Reason"
),
const
SizedBox
(
height:
6
),
...
...
@@ -159,7 +174,6 @@ class _HelpTicketScreenState extends State<HelpTicketScreen> {
const
SizedBox
(
height:
16
),
],
/// Issue Description
_fieldLabel
(
"Tell us your issue?"
),
const
SizedBox
(
height:
6
),
_textField
(
...
...
@@ -169,7 +183,6 @@ class _HelpTicketScreenState extends State<HelpTicketScreen> {
),
const
SizedBox
(
height:
16
),
/// Attachments
_fieldLabel
(
"Add Screenshot (optional)"
),
const
SizedBox
(
height:
6
),
Container
(
...
...
@@ -183,7 +196,6 @@ class _HelpTicketScreenState extends State<HelpTicketScreen> {
child:
Column
(
crossAxisAlignment:
CrossAxisAlignment
.
start
,
children:
[
// Add Image Button
Container
(
width:
60
,
height:
60
,
...
...
@@ -192,7 +204,7 @@ class _HelpTicketScreenState extends State<HelpTicketScreen> {
borderRadius:
BorderRadius
.
circular
(
8
),
),
child:
IconButton
(
onPressed:
_
add
Image
,
onPressed:
_
pick
Image
,
icon:
Icon
(
Icons
.
add
,
size:
24
,
...
...
@@ -201,8 +213,6 @@ class _HelpTicketScreenState extends State<HelpTicketScreen> {
),
),
const
SizedBox
(
height:
8
),
// Selected Images Grid
if
(
_selectedImages
.
isNotEmpty
)
GridView
.
builder
(
shrinkWrap:
true
,
...
...
@@ -219,7 +229,7 @@ class _HelpTicketScreenState extends State<HelpTicketScreen> {
children:
[
ClipRRect
(
borderRadius:
BorderRadius
.
circular
(
8
),
child:
Image
.
network
(
child:
Image
.
file
(
_selectedImages
[
index
],
fit:
BoxFit
.
cover
,
width:
double
.
infinity
,
...
...
@@ -254,11 +264,10 @@ class _HelpTicketScreenState extends State<HelpTicketScreen> {
),
const
SizedBox
(
height:
24
),
/// Submit Button
SizedBox
(
width:
double
.
infinity
,
child:
ElevatedButton
(
onPressed:
_submitTicket
,
onPressed:
helpProvider
.
isLoading
?
null
:
_submitTicket
,
style:
ElevatedButton
.
styleFrom
(
backgroundColor:
AppColors
.
buttonColor
,
foregroundColor:
Colors
.
white
,
...
...
@@ -268,12 +277,20 @@ class _HelpTicketScreenState extends State<HelpTicketScreen> {
),
elevation:
0
,
),
child:
const
Text
(
child:
helpProvider
.
isLoading
?
const
SizedBox
(
height:
22
,
width:
22
,
child:
CircularProgressIndicator
(
color:
Colors
.
white
,
strokeWidth:
2
,
),
)
:
Text
(
'Submit'
,
style:
TextStyle
(
fontSize:
16
,
fontFamily:
"Plus Jakarta Sans"
,
fontWeight:
FontWeight
.
w600
,
fontSize:
14
,
fontWeight:
FontWeight
.
w400
,
),
),
),
...
...
@@ -285,20 +302,16 @@ class _HelpTicketScreenState extends State<HelpTicketScreen> {
);
}
/// Custom label widget (no shadow, minimal)
Widget
_fieldLabel
(
String
text
)
{
return
Text
(
text
,
style:
TextStyle
(
fontSize:
14
,
fontFamily:
"Plus Jakarta Sans"
,
fontWeight:
FontWeight
.
w500
,
color:
Colors
.
grey
[
700
],
),
);
}
Widget
_fieldLabel
(
String
text
)
=>
Text
(
text
,
style:
TextStyle
(
fontSize:
14
,
fontStyle:
FontStyle
.
normal
,
fontWeight:
FontWeight
.
w400
,
color:
Colors
.
black87
,
),
);
/// Clean text field (no border or shadow)
Widget
_textField
({
required
TextEditingController
controller
,
required
String
hint
,
...
...
@@ -314,7 +327,6 @@ class _HelpTicketScreenState extends State<HelpTicketScreen> {
maxLines:
maxLines
,
style:
const
TextStyle
(
fontSize:
14
,
fontFamily:
"Plus Jakarta Sans"
,
fontWeight:
FontWeight
.
w400
,
color:
Colors
.
black87
,
),
...
...
@@ -322,7 +334,6 @@ class _HelpTicketScreenState extends State<HelpTicketScreen> {
hintText:
hint
,
hintStyle:
TextStyle
(
fontSize:
14
,
fontFamily:
"Plus Jakarta Sans"
,
fontWeight:
FontWeight
.
w400
,
color:
Colors
.
grey
[
400
],
),
...
...
@@ -334,11 +345,14 @@ class _HelpTicketScreenState extends State<HelpTicketScreen> {
);
}
/// Add image (demo)
void
_addImage
()
{
setState
(()
{
_selectedImages
.
add
(
'https://via.placeholder.com/100'
);
});
Future
<
void
>
_pickImage
()
async
{
final
pickedFile
=
await
_picker
.
pickImage
(
source
:
ImageSource
.
gallery
,
imageQuality:
70
);
if
(
pickedFile
!=
null
)
{
setState
(()
{
_selectedImages
.
add
(
File
(
pickedFile
.
path
));
});
}
}
void
_removeImage
(
int
index
)
{
...
...
@@ -347,22 +361,41 @@ class _HelpTicketScreenState extends State<HelpTicketScreen> {
});
}
void
_submitTicket
()
{
Future
<
void
>
_submitTicket
()
async
{
final
issue
=
_issueController
.
text
.
trim
();
final
otherReason
=
_otherReasonController
.
text
.
trim
();
if
(
issue
.
isEmpty
)
{
CustomSnackBar
.
showWarning
(
context:
context
,
message:
"Please describe your issue"
);
return
;
}
if
(
_selectedReason
==
'Other Issues'
&&
otherReason
.
isEmpty
)
{
CustomSnackBar
.
showWarning
(
context:
context
,
message:
"Please enter your reason"
);
return
;
}
if
(
issue
.
isEmpty
)
return
;
if
(
_selectedReason
==
'Other Issues'
&&
otherReason
.
isEmpty
)
return
;
final
helpProvider
=
Provider
.
of
<
HelpAndEnquiryProvider
>(
context
,
listen:
false
)
;
print
(
'Submitting ticket with reason:
$_selectedReason
'
);
print
(
'Issue:
$issue
'
)
;
}
final
reason
=
_selectedReason
==
'Other Issues'
?
otherReason
:
_selectedReason
;
debugPrint
(
"Reason=========
$reason
"
);
@override
void
dispose
()
{
_issueController
.
dispose
();
_otherReasonController
.
dispose
();
super
.
dispose
();
await
helpProvider
.
createTicket
(
sessionId:
widget
.
sessionId
,
accId:
widget
.
accId
,
type:
reason
,
description:
issue
,
orderId:
"1235"
,
images:
_selectedImages
,
context:
context
,
);
}
void
_showReasonBottomSheet
()
{
...
...
@@ -392,7 +425,6 @@ class _HelpTicketScreenState extends State<HelpTicketScreen> {
),
),
const
SizedBox
(
height:
16
),
GridView
.
builder
(
shrinkWrap:
true
,
physics:
const
NeverScrollableScrollPhysics
(),
...
...
@@ -405,14 +437,10 @@ class _HelpTicketScreenState extends State<HelpTicketScreen> {
itemCount:
createNewTickets
.
length
,
itemBuilder:
(
context
,
index
)
{
final
ticket
=
createNewTickets
[
index
];
final
String
title
=
ticket
[
'title'
]
??
'Unknown'
;
final
String
icon
=
ticket
[
'icon'
]
??
'assets/svg/help_ic.svg'
;
final
Color
color
=
ticket
[
'color'
]
??
Colors
.
grey
;
return
_buildReasonCard
(
title:
title
,
icon:
icon
,
color:
color
,
title:
ticket
[
'
title
'
]
,
icon:
ticket
[
'
icon
'
]
,
color:
ticket
[
'
color
'
]
,
);
},
),
...
...
@@ -431,47 +459,38 @@ class _HelpTicketScreenState extends State<HelpTicketScreen> {
})
{
return
GestureDetector
(
onTap:
()
{
setState
(()
{
_selectedReason
=
title
;
});
Navigator
.
pop
(
context
);
// Close the bottom sheet
setState
(()
=>
_selectedReason
=
title
);
Navigator
.
pop
(
context
);
},
child:
Container
(
padding:
const
EdgeInsets
.
symmetric
(
horizontal:
2
,
vertical:
1
),
child:
Column
(
crossAxisAlignment:
CrossAxisAlignment
.
center
,
children:
[
// Icon container
Container
(
width:
88
,
height:
88
,
decoration:
BoxDecoration
(
color:
color
.
withOpacity
(
0.12
),
// Fixed opacity
color:
color
.
withOpacity
(
0.12
),
borderRadius:
BorderRadius
.
circular
(
12
),
),
child:
Center
(
child:
SizedBox
(
height:
40
,
width:
40
,
child:
SvgPicture
.
asset
(
icon
,
fit:
BoxFit
.
fitWidth
,
),
child:
SvgPicture
.
asset
(
icon
,
fit:
BoxFit
.
fitWidth
),
),
),
),
const
SizedBox
(
height:
8
),
// Title
SizedBox
(
child:
Text
(
title
,
textAlign:
TextAlign
.
center
,
style:
TextStyle
(
color:
AppColors
.
nearDarkText
,
fontSize:
14
,
fontWeight:
FontWeight
.
w400
,
fontFamily:
"Plus Jakarta Sans"
,
),
Text
(
title
,
textAlign:
TextAlign
.
center
,
style:
TextStyle
(
color:
AppColors
.
nearDarkText
,
fontSize:
14
,
fontWeight:
FontWeight
.
w400
,
fontFamily:
"Plus Jakarta Sans"
,
),
),
const
SizedBox
(
height:
4
),
...
...
@@ -480,4 +499,11 @@ class _HelpTicketScreenState extends State<HelpTicketScreen> {
),
);
}
}
\ No newline at end of file
@override
void
dispose
()
{
_issueController
.
dispose
();
_otherReasonController
.
dispose
();
super
.
dispose
();
}
}
lib/Screens/HelpScreens/EnquiryScreen.dart
View file @
b8c2cae9
...
...
@@ -54,8 +54,8 @@ class _EnquiryScreenState extends State<EnquiryScreen> {
"Enquiry"
,
style:
TextStyle
(
fontSize:
16
,
font
Family:
"Plus Jakarta Sans"
,
fontWeight:
FontWeight
.
w
6
00
,
font
Style:
FontStyle
.
normal
,
fontWeight:
FontWeight
.
w
4
00
,
color:
Colors
.
black87
,
),
),
...
...
@@ -198,9 +198,8 @@ class _EnquiryScreenState extends State<EnquiryScreen> {
:
const
Text
(
"Submit"
,
style:
TextStyle
(
fontSize:
16
,
fontFamily:
"Plus Jakarta Sans"
,
fontWeight:
FontWeight
.
w600
,
fontSize:
15
,
fontWeight:
FontWeight
.
w400
,
),
),
),
...
...
@@ -218,9 +217,9 @@ class _EnquiryScreenState extends State<EnquiryScreen> {
return
Text
(
title
,
style:
const
TextStyle
(
fontSize:
1
3
,
font
Family:
"Plus Jakarta Sans"
,
fontWeight:
FontWeight
.
w
5
00
,
fontSize:
1
4
,
font
Style:
FontStyle
.
normal
,
fontWeight:
FontWeight
.
w
4
00
,
color:
Colors
.
black
,
),
);
...
...
@@ -266,7 +265,8 @@ class _EnquiryScreenState extends State<EnquiryScreen> {
hintStyle:
TextStyle
(
fontSize:
14
,
color:
Colors
.
grey
[
400
],
fontFamily:
"Plus Jakarta Sans"
,
fontStyle:
FontStyle
.
normal
,
fontWeight:
FontWeight
.
w400
,
),
contentPadding:
const
EdgeInsets
.
symmetric
(
horizontal:
12
,
vertical:
14
),
...
...
@@ -282,7 +282,6 @@ class _EnquiryScreenState extends State<EnquiryScreen> {
style:
const
TextStyle
(
color:
Colors
.
red
,
fontSize:
12
,
fontFamily:
"Plus Jakarta Sans"
,
),
),
),
...
...
lib/Screens/HelpScreens/HelpScreen.dart
View file @
b8c2cae9
import
'package:flutter/material.dart'
;
import
'package:flutter_svg/flutter_svg.dart'
;
import
'package:gen_rentals/Screens/HelpScreens/OrderHelpScreen.dart'
;
import
'package:gen_rentals/Screens/HelpScreens/
Process
TicketScreen.dart'
;
import
'package:gen_rentals/Screens/HelpScreens/Ticket
Chat
Screen.dart'
;
import
'package:gen_rentals/Utility/Reusablewidgets.dart'
;
import
'../../Notifier/HelpAndEnquiryProvider.dart'
;
import
'../../Utility/AppColors.dart'
;
...
...
@@ -74,7 +74,7 @@ class _HelpScreenState extends State<HelpScreen> {
onTap:
()
=>
Navigator
.
pop
(
context
,
true
),
child:
SvgPicture
.
asset
(
"assets/svg/continue_left_ic.svg"
,
height:
25
,
height:
30
,
),
),
const
SizedBox
(
width:
10
),
...
...
@@ -83,7 +83,7 @@ class _HelpScreenState extends State<HelpScreen> {
style:
TextStyle
(
fontSize:
16
,
fontFamily:
"Plus Jakarta Sans"
,
fontWeight:
FontWeight
.
w
6
00
,
fontWeight:
FontWeight
.
w
4
00
,
color:
Colors
.
black87
,
),
),
...
...
@@ -115,8 +115,9 @@ class _HelpScreenState extends State<HelpScreen> {
crossAxisAlignment:
CrossAxisAlignment
.
start
,
children:
[
// Create New Ticket Section
const
SectionHeading
(
SectionHeading
(
title:
'Create New Ticket'
,
textStyle:
TextStyle
(
fontSize:
14
,
fontWeight:
FontWeight
.
w500
),
padding:
EdgeInsets
.
symmetric
(
horizontal:
2
,
vertical:
4
),
),
const
SizedBox
(
height:
12
),
...
...
@@ -124,8 +125,9 @@ class _HelpScreenState extends State<HelpScreen> {
const
SizedBox
(
height:
12
),
// Processing Tickets Section
const
SectionHeading
(
SectionHeading
(
title:
'Processing Tickets'
,
textStyle:
TextStyle
(
fontSize:
14
,
fontWeight:
FontWeight
.
w500
),
padding:
EdgeInsets
.
symmetric
(
horizontal:
2
,
vertical:
4
),
),
const
SizedBox
(
height:
2
),
...
...
@@ -133,10 +135,12 @@ class _HelpScreenState extends State<HelpScreen> {
const
SizedBox
(
height:
10
),
// Closed Tickets Section
const
SectionHeading
(
SectionHeading
(
title:
'Closed Tickets'
,
textStyle:
TextStyle
(
fontSize:
14
,
fontWeight:
FontWeight
.
w500
),
padding:
EdgeInsets
.
symmetric
(
horizontal:
2
,
vertical:
4
),
),
const
SizedBox
(
height:
2
),
_buildClosedTicketsSection
(
closedTickets
),
],
...
...
@@ -175,7 +179,7 @@ class _HelpScreenState extends State<HelpScreen> {
),
),
const
SizedBox
(
width:
12
),
const
Expanded
(
Expanded
(
child:
Column
(
crossAxisAlignment:
CrossAxisAlignment
.
start
,
children:
[
...
...
@@ -185,6 +189,8 @@ class _HelpScreenState extends State<HelpScreen> {
style:
TextStyle
(
fontFamily:
"Poppins"
,
fontSize:
14
,
fontStyle:
FontStyle
.
normal
,
fontWeight:
FontWeight
.
w400
,
color:
Colors
.
black
,
),
),
...
...
@@ -194,6 +200,8 @@ class _HelpScreenState extends State<HelpScreen> {
style:
TextStyle
(
fontFamily:
"Poppins"
,
fontSize:
12
,
fontStyle:
FontStyle
.
normal
,
fontWeight:
FontWeight
.
w400
,
color:
Colors
.
grey
,
),
),
...
...
@@ -329,9 +337,9 @@ class CommonListItem extends StatelessWidget {
children:
[
Text
(
"#
${orderId}
"
,
style:
const
TextStyle
(
style:
TextStyle
(
fontSize:
12
,
font
Family:
"Plus Jakarta Sans"
,
font
Style:
FontStyle
.
normal
,
fontWeight:
FontWeight
.
w400
,
color:
AppColors
.
subtitleText
,
),
...
...
@@ -343,10 +351,10 @@ class CommonListItem extends StatelessWidget {
children:
[
Text
(
title
,
style:
const
TextStyle
(
style:
TextStyle
(
fontSize:
14
,
font
Family:
"Plus Jakarta Sans"
,
fontWeight:
FontWeight
.
w
5
00
,
font
Style:
FontStyle
.
normal
,
fontWeight:
FontWeight
.
w
4
00
,
color:
Colors
.
black87
,
),
),
...
...
@@ -356,6 +364,7 @@ class CommonListItem extends StatelessWidget {
date
,
style:
TextStyle
(
fontSize:
12
,
fontStyle:
FontStyle
.
normal
,
fontFamily:
"Plus Jakarta Sans"
,
fontWeight:
FontWeight
.
w400
,
color:
Colors
.
grey
[
600
],
...
...
@@ -373,10 +382,10 @@ class CommonListItem extends StatelessWidget {
),
child:
Text
(
status
,
style:
const
TextStyle
(
style:
TextStyle
(
fontSize:
12
,
font
Family:
"Plus Jakarta Sans"
,
font
Weight:
FontWeight
.
w500
,
font
Weight:
FontWeight
.
w400
,
font
Style:
FontStyle
.
normal
,
color:
Colors
.
black87
,
),
),
...
...
@@ -386,7 +395,7 @@ class CommonListItem extends StatelessWidget {
date
,
style:
TextStyle
(
fontSize:
12
,
font
Family:
"Plus Jakarta Sans"
,
font
Style:
FontStyle
.
normal
,
fontWeight:
FontWeight
.
w400
,
color:
Colors
.
grey
[
600
],
),
...
...
lib/Screens/HelpScreens/OrderHelpScreen.dart
View file @
b8c2cae9
import
'package:flutter/material.dart'
;
import
'package:flutter_svg/flutter_svg.dart'
;
import
'package:gen_rentals/Screens/HelpScreens/
Process
TicketScreen.dart'
;
import
'package:gen_rentals/Screens/HelpScreens/Ticket
Chat
Screen.dart'
;
import
'package:gen_rentals/Utility/Reusablewidgets.dart'
;
import
'../../Models/DashboardResponse.dart'
;
import
'../../Notifier/DashboardProvider.dart'
;
...
...
@@ -93,7 +93,7 @@ class _OrderHelpScreenState extends State<OrderHelpScreen> {
style:
TextStyle
(
fontSize:
16
,
fontFamily:
"Plus Jakarta Sans"
,
fontWeight:
FontWeight
.
w
6
00
,
fontWeight:
FontWeight
.
w
4
00
,
color:
Colors
.
black87
,
),
),
...
...
@@ -125,14 +125,15 @@ class _OrderHelpScreenState extends State<OrderHelpScreen> {
crossAxisAlignment:
CrossAxisAlignment
.
start
,
children:
[
// Create New Ticket Section
const
SectionHeading
(
SectionHeading
(
title:
'Select the order you are having issues with'
,
padding:
EdgeInsets
.
symmetric
(
horizontal:
2
,
vertical:
4
),
textStyle:
TextStyle
(
fontSize:
14
,
fontWeight:
FontWeight
.
w500
),
padding:
EdgeInsets
.
symmetric
(
horizontal:
4
,
vertical:
2
),
),
Container
(
width:
double
.
infinity
,
padding:
const
EdgeInsets
.
symmetric
(
horizontal:
2
,
vertical:
10
),
padding:
const
EdgeInsets
.
symmetric
(
horizontal:
2
,
vertical:
4
),
child:
Column
(
crossAxisAlignment:
CrossAxisAlignment
.
start
,
children:
[
...
...
@@ -146,7 +147,7 @@ class _OrderHelpScreenState extends State<OrderHelpScreen> {
// fontWeight: FontWeight.w600,
// ),
// ),
const
SizedBox
(
height:
1
6
),
const
SizedBox
(
height:
6
),
// Show loading or products list
if
(
dashboardProvider
.
isLoading
&&
dashboardData
==
null
)
...
...
@@ -169,7 +170,7 @@ class _OrderHelpScreenState extends State<OrderHelpScreen> {
return
Column
(
children:
[
InkResponse
(
onTap:
()
=>
_showReasonBottomSheet
(),
onTap:
()
=>
_showReasonBottomSheet
(
product
),
child:
_buildProductItemFromApi
(
product
),
),
const
SizedBox
(
height:
16
),
...
...
@@ -268,15 +269,15 @@ class _OrderHelpScreenState extends State<OrderHelpScreen> {
Row
(
children:
[
Container
(
padding:
const
EdgeInsets
.
all
(
14
),
padding:
const
EdgeInsets
.
all
(
8.5
),
decoration:
BoxDecoration
(
color:
const
Color
(
0xffF2F2F2
),
borderRadius:
BorderRadius
.
circular
(
16
),
),
child:
Image
.
network
(
product
.
productImage
??
""
,
height:
4
0
,
width:
4
0
,
height:
4
2
,
width:
4
2
,
fit:
BoxFit
.
contain
,
errorBuilder:
(
context
,
error
,
stack
)
=>
Image
.
asset
(
'assets/images/gene_png.png'
,
...
...
@@ -292,17 +293,19 @@ class _OrderHelpScreenState extends State<OrderHelpScreen> {
style:
const
TextStyle
(
fontFamily:
"Poppins"
,
color:
Color
(
0xFF008CDE
),
fontSize:
1
6
,
fontWeight:
FontWeight
.
w
5
00
,
fontSize:
1
4
,
fontWeight:
FontWeight
.
w
4
00
,
height:
1.2
,
),
),
SizedBox
(
height:
2
,),
Text
(
product
.
rentedDate
??
"Rented date not available"
,
style:
TextStyle
(
fontFamily:
"Poppins"
,
fontWeight:
FontWeight
.
w400
,
color:
Colors
.
grey
.
shade600
,
fontSize:
1
2
,
fontSize:
1
4
,
),
),
],
...
...
@@ -325,7 +328,7 @@ class _OrderHelpScreenState extends State<OrderHelpScreen> {
style:
const
TextStyle
(
color:
Colors
.
black87
,
fontSize:
12
,
fontWeight:
FontWeight
.
w
5
00
,
fontWeight:
FontWeight
.
w
4
00
,
),
),
),
...
...
@@ -366,7 +369,7 @@ class _OrderHelpScreenState extends State<OrderHelpScreen> {
visibleItems
[
i
],
style:
const
TextStyle
(
color:
Colors
.
black
,
fontSize:
1
6
,
fontSize:
1
4
,
fontWeight:
FontWeight
.
w400
,
),
),
...
...
@@ -428,7 +431,9 @@ class _OrderHelpScreenState extends State<OrderHelpScreen> {
}
void
_showReasonBottomSheet
()
{
void
_showReasonBottomSheet
(
Orders
product
,
)
{
// Your existing bottom sheet implementation
showModalBottomSheet
(
context:
context
,
...
...
@@ -446,12 +451,23 @@ class _OrderHelpScreenState extends State<OrderHelpScreen> {
mainAxisSize:
MainAxisSize
.
min
,
crossAxisAlignment:
CrossAxisAlignment
.
start
,
children:
[
const
Text
(
Center
(
child:
Container
(
height:
2.5
,
width:
55
,
decoration:
BoxDecoration
(
color:
AppColors
.
subtitleText
,
borderRadius:
BorderRadius
.
circular
(
20
)
),
),
),
SizedBox
(
height:
12
,),
Text
(
"Select Your Reason"
,
style:
TextStyle
(
fontSize:
1
8
,
fontSize:
1
6
,
fontFamily:
"Poppins"
,
fontWeight:
FontWeight
.
w
6
00
,
fontWeight:
FontWeight
.
w
5
00
,
color:
Colors
.
black87
,
),
),
...
...
@@ -477,6 +493,7 @@ class _OrderHelpScreenState extends State<OrderHelpScreen> {
return
_buildFeatureCard
(
title:
title
,
description:
description
,
orderId:
product
.
orderid
.
toString
(),
icon:
icon
,
color:
color
,
);
...
...
@@ -494,13 +511,19 @@ class _OrderHelpScreenState extends State<OrderHelpScreen> {
required
String
title
,
required
String
description
,
required
String
icon
,
required
String
orderId
,
required
Color
color
,
})
{
return
GestureDetector
(
onTap:
()
{
Navigator
.
push
(
context
,
MaterialPageRoute
(
builder:
(
context
)
=>
HelpTicketScreen
(
reason:
title
,))
MaterialPageRoute
(
builder:
(
context
)
=>
HelpTicketScreen
(
reason:
title
,
sessionId:
widget
.
sessionId
,
accId:
widget
.
accId
,
orderId:
orderId
,
))
);
},
child:
Container
(
...
...
@@ -537,7 +560,7 @@ class _OrderHelpScreenState extends State<OrderHelpScreen> {
color:
AppColors
.
nearDarkText
,
fontSize:
14
,
fontWeight:
FontWeight
.
w400
,
font
Family:
"Plus Jakarta Sans"
,
font
Style:
FontStyle
.
normal
),
),
),
...
...
lib/Screens/HelpScreens/
Process
TicketScreen.dart
→
lib/Screens/HelpScreens/Ticket
Chat
Screen.dart
View file @
b8c2cae9
...
...
@@ -77,7 +77,7 @@ class _TicketChatScreenState extends State<TicketChatScreen> {
style:
TextStyle
(
fontSize:
16
,
fontFamily:
"Plus Jakarta Sans"
,
fontWeight:
FontWeight
.
w
6
00
,
fontWeight:
FontWeight
.
w
4
00
,
color:
Colors
.
black87
,
),
),
...
...
@@ -93,8 +93,7 @@ class _TicketChatScreenState extends State<TicketChatScreen> {
widget
.
status
,
style:
TextStyle
(
fontSize:
12
,
fontFamily:
"Plus Jakarta Sans"
,
fontWeight:
FontWeight
.
w500
,
fontWeight:
FontWeight
.
w400
,
color:
status
?
Colors
.
green
:
Colors
.
red
,
),
),
...
...
@@ -138,7 +137,7 @@ class _TicketChatScreenState extends State<TicketChatScreen> {
Container
(
width:
double
.
infinity
,
padding:
const
EdgeInsets
.
all
(
16
),
color:
Color
s
.
white
,
color:
Color
(
0x66FFFFFF
)
,
child:
ElevatedButton
(
onPressed:
()
=>
_openMessageSheet
(
ticketId:
chatData
.
ticketId
.
toString
()),
style:
ElevatedButton
.
styleFrom
(
...
...
@@ -154,9 +153,9 @@ class _TicketChatScreenState extends State<TicketChatScreen> {
child:
const
Text
(
"Send a Message"
,
style:
TextStyle
(
fontSize:
1
6
,
font
Family:
"Plus Jakarta Sans"
,
fontWeight:
FontWeight
.
w
6
00
,
fontSize:
1
4
,
font
Style:
FontStyle
.
normal
,
fontWeight:
FontWeight
.
w
4
00
,
),
),
),
...
...
@@ -228,10 +227,9 @@ class _TicketChatScreenState extends State<TicketChatScreen> {
Text
(
name
,
style:
const
TextStyle
(
fontSize:
14
,
fontFamily:
"Plus Jakarta Sans"
,
fontWeight:
FontWeight
.
w600
,
color:
Colors
.
black
,
fontSize:
16
,
fontWeight:
FontWeight
.
w500
,
color:
Colors
.
black87
,
),
),
const
SizedBox
(
height:
2
),
...
...
@@ -239,7 +237,7 @@ class _TicketChatScreenState extends State<TicketChatScreen> {
date
,
style:
TextStyle
(
fontSize:
12
,
font
Family:
"Plus Jakarta Sans"
,
font
Style:
FontStyle
.
normal
,
fontWeight:
FontWeight
.
w400
,
color:
Colors
.
grey
[
600
],
),
...
...
@@ -248,8 +246,8 @@ class _TicketChatScreenState extends State<TicketChatScreen> {
Text
(
message
,
style:
const
TextStyle
(
fontSize:
1
3
,
font
Family:
"Plus Jakarta Sans"
,
fontSize:
1
4
,
font
Style:
FontStyle
.
normal
,
fontWeight:
FontWeight
.
w400
,
color:
Colors
.
black87
,
height:
1.5
,
...
...
@@ -374,10 +372,10 @@ class _TicketChatScreenState extends State<TicketChatScreen> {
Text
(
"Message"
,
style:
TextStyle
(
fontSize:
1
2
,
fontSize:
1
4
,
fontFamily:
"Plus Jakarta Sans"
,
fontWeight:
FontWeight
.
w
5
00
,
color:
Colors
.
grey
[
700
]
,
fontWeight:
FontWeight
.
w
4
00
,
color:
App
Colors
.
normalText
,
),
),
const
SizedBox
(
height:
6
),
...
...
@@ -395,7 +393,7 @@ class _TicketChatScreenState extends State<TicketChatScreen> {
hintStyle:
TextStyle
(
fontSize:
14
,
color:
Colors
.
grey
[
400
],
font
Family:
"Plus Jakarta Sans"
,
font
Weight:
FontWeight
.
w400
),
border:
InputBorder
.
none
,
contentPadding:
const
EdgeInsets
.
all
(
12
),
...
...
@@ -407,10 +405,10 @@ class _TicketChatScreenState extends State<TicketChatScreen> {
Text
(
"Attach Screenshot (optional)"
,
style:
TextStyle
(
fontSize:
1
2
,
fontSize:
1
4
,
fontFamily:
"Plus Jakarta Sans"
,
fontWeight:
FontWeight
.
w
5
00
,
color:
Colors
.
grey
[
700
]
,
fontWeight:
FontWeight
.
w
4
00
,
color:
App
Colors
.
normalText
,
),
),
const
SizedBox
(
height:
8
),
...
...
@@ -421,6 +419,7 @@ class _TicketChatScreenState extends State<TicketChatScreen> {
children:
[
// Add Image Button with multiple options
PopupMenuButton
<
String
>(
color:
Colors
.
white
,
onSelected:
(
source
)
async
{
if
(
source
==
'camera'
)
{
final
XFile
?
image
=
await
_picker
.
pickImage
(
...
...
@@ -609,9 +608,9 @@ class _TicketChatScreenState extends State<TicketChatScreen> {
child:
const
Text
(
"Send Message"
,
style:
TextStyle
(
fontSize:
1
6
,
font
Family:
"Plus Jakarta Sans"
,
fontWeight:
FontWeight
.
w
6
00
,
fontSize:
1
4
,
font
Style:
FontStyle
.
normal
,
fontWeight:
FontWeight
.
w
4
00
,
),
),
),
...
...
lib/Screens/ProductsDetailScreen.dart
View file @
b8c2cae9
import
'package:flutter/material.dart'
;
import
'package:flutter_svg/flutter_svg.dart'
;
import
'package:gen_rentals/Screens/BillDetailListScreen.dart'
;
import
'package:gen_rentals/Utility/Reusablewidgets.dart'
;
import
'package:provider/provider.dart'
;
import
'../Models/SubscribeOrderDetailsResponse.dart'
;
import
'../Notifier/SubscribeOrderDetailsProvider.dart'
;
...
...
@@ -84,7 +85,7 @@ class _ProductsDetailScreenState extends State<ProductsDetailScreen> {
onTap:
()
=>
Navigator
.
pop
(
context
,
true
),
child:
SvgPicture
.
asset
(
"assets/svg/continue_left_ic.svg"
,
height:
25
,
height:
30
,
),
),
const
SizedBox
(
width:
10
),
...
...
@@ -92,8 +93,7 @@ class _ProductsDetailScreenState extends State<ProductsDetailScreen> {
"Bill List"
,
style:
TextStyle
(
fontSize:
16
,
fontFamily:
"Plus Jakarta Sans"
,
fontWeight:
FontWeight
.
w600
,
fontWeight:
FontWeight
.
w400
,
color:
Colors
.
black87
,
),
),
...
...
@@ -104,7 +104,7 @@ class _ProductsDetailScreenState extends State<ProductsDetailScreen> {
body:
_buildBody
(
provider
,
screenHeight
,
bottomPadding
),
bottomNavigationBar:
Container
(
height:
80
,
padding:
EdgeInsets
.
symmetric
(
horizontal:
1
4
,
vertical:
10
),
padding:
EdgeInsets
.
symmetric
(
horizontal:
1
6
,
vertical:
10
),
width:
double
.
infinity
,
child:
ElevatedButton
(
onPressed:
()
{
...
...
@@ -127,9 +127,9 @@ class _ProductsDetailScreenState extends State<ProductsDetailScreen> {
child:
const
Text
(
"View Bill"
,
style:
TextStyle
(
fontSize:
1
6
,
font
Family:
"Plus Jakarta Sans"
,
font
Weight:
FontWeight
.
w600
,
fontSize:
1
4
,
font
Weight:
FontWeight
.
w400
,
font
Style:
FontStyle
.
normal
,
),
),
),
...
...
@@ -191,66 +191,118 @@ class _ProductsDetailScreenState extends State<ProductsDetailScreen> {
child:
SingleChildScrollView
(
child:
Column
(
children:
[
SizedBox
(
height:
1
,),
// Order header (not in card)
Container
(
width:
double
.
infinity
,
margin:
const
EdgeInsets
.
all
(
16
),
padding:
const
EdgeInsets
.
all
(
16
),
child:
Column
(
crossAxisAlignment:
CrossAxisAlignment
.
center
,
children:
[
Row
(
mainAxisAlignment:
MainAxisAlignment
.
center
,
children:
[
const
Text
(
"# Order ID "
,
style:
TextStyle
(
fontSize:
24
,
fontFamily:
"Poppins"
,
fontWeight:
FontWeight
.
w400
,
color:
Colors
.
black87
,
margin:
const
EdgeInsets
.
all
(
0
),
padding:
const
EdgeInsets
.
all
(
0
),
decoration:
BoxDecoration
(
borderRadius:
BorderRadius
.
circular
(
2
),
gradient:
LinearGradient
(
begin:
Alignment
.
topCenter
,
end:
Alignment
.
bottomCenter
,
colors:
[
Color
(
0xDDFFFFFF
),
Color
(
0xAAFFFFFF
),
Color
(
0x88FFFFFF
),
Color
(
0x66FFFFFF
),
Color
(
0x44FFFFFF
),
Color
(
0x11FFFFFF
),
]
)
),
child:
Padding
(
padding:
const
EdgeInsets
.
all
(
18
),
child:
Column
(
crossAxisAlignment:
CrossAxisAlignment
.
center
,
children:
[
Row
(
mainAxisAlignment:
MainAxisAlignment
.
center
,
children:
[
const
Text
(
"Order ID "
,
style:
TextStyle
(
fontSize:
24
,
fontFamily:
"Poppins"
,
fontWeight:
FontWeight
.
w400
,
color:
Colors
.
black87
,
),
),
Text
(
"#
${order.orderNum ?? order.orderid ?? 'N/A'}
"
,
style:
TextStyle
(
fontSize:
24
,
fontFamily:
"Poppins"
,
fontWeight:
FontWeight
.
w400
,
color:
AppColors
.
amountText
,
),
),
],
),
const
SizedBox
(
height:
12
),
//
Text
(
"Duration"
,
style:
TextStyle
(
fontSize:
12
,
fontFamily:
"Poppins"
,
fontWeight:
FontWeight
.
w400
,
color:
Colors
.
black87
,
),
Text
(
"#
${order.orderNum ?? order.orderid ?? 'N/A'}
"
,
style:
TextStyle
(
fontSize:
24
,
),
const
SizedBox
(
height:
2
),
Text
(
"
${order.fromDate}
-
${order.toDate ?? 'Duration unavailable'}
"
,
style:
TextStyle
(
fontSize:
12
,
fontFamily:
"Poppins"
,
fontWeight:
FontWeight
.
w400
,
color:
AppColors
.
subtitleText
,
),
),
const
SizedBox
(
height:
12
),
Container
(
padding:
const
EdgeInsets
.
symmetric
(
horizontal:
10
,
vertical:
6
),
decoration:
BoxDecoration
(
gradient:
_getGradientByColor
(
order
.
expiringInColor
),
borderRadius:
BorderRadius
.
circular
(
8
),
),
child:
Text
(
order
.
expiringText
??
'Expiring info not available'
,
style:
const
TextStyle
(
fontSize:
12
,
fontFamily:
"Poppins"
,
fontWeight:
FontWeight
.
w400
,
color:
App
Colors
.
amountText
,
color:
Colors
.
black87
,
),
),
],
),
const
SizedBox
(
height:
8
),
Text
(
order
.
rentedDate
??
'Date not available'
,
style:
TextStyle
(
fontSize:
14
,
fontFamily:
"Poppins"
,
fontWeight:
FontWeight
.
w400
,
color:
AppColors
.
subtitleText
,
),
),
const
SizedBox
(
height:
14
),
Container
(
padding:
const
EdgeInsets
.
symmetric
(
horizontal:
10
,
vertical:
6
),
decoration:
BoxDecoration
(
gradient:
_getGradientByColor
(
order
.
expiringInColor
),
borderRadius:
BorderRadius
.
circular
(
8
),
),
child:
Text
(
order
.
expiringText
??
'Expiring info not available'
,
style:
const
TextStyle
(
const
SizedBox
(
height:
14
),
//
Text
(
order
.
accName
??
' A/c not available'
,
style:
TextStyle
(
fontSize:
12
,
fontFamily:
"Poppins"
,
fontWeight:
FontWeight
.
w
5
00
,
fontWeight:
FontWeight
.
w
4
00
,
color:
Colors
.
black87
,
),
),
),
],
const
SizedBox
(
height:
10
),
Text
(
order
.
adress
??
"Address unavailable"
,
style:
TextStyle
(
fontSize:
12
,
fontFamily:
"Poppins"
,
fontWeight:
FontWeight
.
w400
,
color:
AppColors
.
subtitleText
,
),
textAlign:
TextAlign
.
center
,
),
],
),
),
),
...
...
@@ -263,16 +315,16 @@ class _ProductsDetailScreenState extends State<ProductsDetailScreen> {
child:
Column
(
crossAxisAlignment:
CrossAxisAlignment
.
start
,
children:
[
const
Text
(
"Product
s"
,
s
tyle:
TextStyle
(
fontSize:
1
8
,
SectionHeading
(
title:
"Rental Item
s"
,
textS
tyle:
TextStyle
(
fontSize:
1
4
,
fontFamily:
"Poppins"
,
fontWeight:
FontWeight
.
w
6
00
,
fontWeight:
FontWeight
.
w
5
00
,
color:
Colors
.
black87
,
),
),
const
SizedBox
(
height:
1
6
),
const
SizedBox
(
height:
1
2
),
// Product list using ListView.builder
ListView
.
separated
(
...
...
@@ -285,7 +337,31 @@ class _ProductsDetailScreenState extends State<ProductsDetailScreen> {
},
),
const
SizedBox
(
height:
16
),
const
SizedBox
(
height:
24
),
SectionHeading
(
title:
"Purchased Items"
,
textStyle:
TextStyle
(
fontSize:
14
,
fontFamily:
"Poppins"
,
fontWeight:
FontWeight
.
w500
,
color:
Colors
.
black87
,
),
),
const
SizedBox
(
height:
12
),
// Product list using ListView.builder
ListView
.
separated
(
physics:
const
NeverScrollableScrollPhysics
(),
shrinkWrap:
true
,
itemCount:
order
.
purchasedItm
!.
length
,
separatorBuilder:
(
context
,
index
)
=>
const
SizedBox
(
height:
16
),
itemBuilder:
(
context
,
index
)
{
return
_buildPurchasedItem
(
order
.
purchasedItm
![
index
]);
},
),
const
SizedBox
(
height:
14
),
// Divider
const
Divider
(
color:
Color
(
0xFFE5E5E5
),
...
...
@@ -295,7 +371,7 @@ class _ProductsDetailScreenState extends State<ProductsDetailScreen> {
// Help section
InkResponse
(
onTap:
()
=>
_showReasonBottomSheet
(),
onTap:
()
=>
_showReasonBottomSheet
(
order
.
orderid
.
toString
()
),
child:
Row
(
children:
[
SvgPicture
.
asset
(
...
...
@@ -363,7 +439,7 @@ class _ProductsDetailScreenState extends State<ProductsDetailScreen> {
style:
TextStyle
(
fontSize:
14
,
fontFamily:
"Poppins"
,
fontWeight:
FontWeight
.
w
5
00
,
fontWeight:
FontWeight
.
w
4
00
,
color:
AppColors
.
amountText
,
),
),
...
...
@@ -371,9 +447,10 @@ class _ProductsDetailScreenState extends State<ProductsDetailScreen> {
Text
(
product
.
prodName
??
'Product name not available'
,
style:
const
TextStyle
(
fontSize:
1
6
,
fontSize:
1
4
,
fontFamily:
"Poppins"
,
fontWeight:
FontWeight
.
w600
,
fontWeight:
FontWeight
.
w400
,
fontStyle:
FontStyle
.
normal
,
color:
Colors
.
black87
,
),
),
...
...
@@ -409,8 +486,8 @@ class _ProductsDetailScreenState extends State<ProductsDetailScreen> {
style:
TextStyle
(
fontSize:
12
,
fontFamily:
"Poppins"
,
fontWeight:
FontWeight
.
w
5
00
,
color:
Colors
.
black
87
,
fontWeight:
FontWeight
.
w
4
00
,
color:
Colors
.
black
54
,
),
),
),
...
...
@@ -437,12 +514,13 @@ class _ProductsDetailScreenState extends State<ProductsDetailScreen> {
alignment:
Alignment
.
centerRight
,
child:
Text
(
product
.
totalPrice
!=
null
?
"
${product.totalPrice!}
/
${product.per ?? 'mo'}
"
:
"
${product.totalPrice!}${product.per ?? 'mo'}
"
:
'Price not available'
,
style:
const
TextStyle
(
fontSize:
14
,
fontFamily:
"Poppins"
,
fontWeight:
FontWeight
.
w600
,
fontStyle:
FontStyle
.
normal
,
fontWeight:
FontWeight
.
w400
,
color:
Colors
.
black87
,
),
),
...
...
@@ -475,7 +553,66 @@ class _ProductsDetailScreenState extends State<ProductsDetailScreen> {
}
}
void
_showReasonBottomSheet
()
{
Widget
_buildPurchasedItem
(
PurchasedItm
product
)
{
return
Container
(
padding:
const
EdgeInsets
.
symmetric
(
horizontal:
18
,
vertical:
16
),
decoration:
BoxDecoration
(
color:
Colors
.
white
,
borderRadius:
BorderRadius
.
circular
(
18
),
// border: Border.all(
// color: const Color(0xFFE5E5E5),
// width: 1,
// ),
),
child:
Column
(
crossAxisAlignment:
CrossAxisAlignment
.
start
,
children:
[
// Product Name
const
SizedBox
(
height:
2
),
Row
(
mainAxisAlignment:
MainAxisAlignment
.
spaceBetween
,
children:
[
Text
(
product
.
prodName
??
'Unavailable'
,
style:
const
TextStyle
(
fontSize:
14
,
fontFamily:
"Poppins"
,
fontWeight:
FontWeight
.
w400
,
color:
Colors
.
black87
,
),
),
Text
(
"Qty.
${product.qty ?? 'Unavailable'}
"
,
style:
TextStyle
(
fontSize:
12
,
fontFamily:
"Poppins"
,
fontStyle:
FontStyle
.
normal
,
fontWeight:
FontWeight
.
w400
,
color:
AppColors
.
subtitleText
,
),
),
Text
(
"₹
${product.totalPrice ?? 'Unavailable'}
"
,
style:
const
TextStyle
(
fontSize:
14
,
fontStyle:
FontStyle
.
normal
,
fontFamily:
"Poppins"
,
fontWeight:
FontWeight
.
w400
,
color:
AppColors
.
cardAmountText
,
),
),
],
),
const
SizedBox
(
height:
2
),
],
),
);
}
void
_showReasonBottomSheet
(
String
orderId
)
{
// Your existing bottom sheet implementation
showModalBottomSheet
(
context:
context
,
...
...
@@ -488,21 +625,32 @@ class _ProductsDetailScreenState extends State<ProductsDetailScreen> {
),
builder:
(
context
)
{
return
Container
(
padding:
const
EdgeInsets
.
symmetric
(
horizontal:
1
0
,
vertical:
14
),
padding:
const
EdgeInsets
.
symmetric
(
horizontal:
1
4
,
vertical:
14
),
child:
Column
(
mainAxisSize:
MainAxisSize
.
min
,
crossAxisAlignment:
CrossAxisAlignment
.
start
,
children:
[
const
Text
(
"Select Your Reason"
,
style:
TextStyle
(
fontSize:
18
,
Center
(
child:
Container
(
width:
50
,
height:
2.5
,
decoration:
BoxDecoration
(
color:
AppColors
.
subtitleText
,
borderRadius:
BorderRadius
.
circular
(
14
),
),
),
),
SizedBox
(
height:
12
,),
SectionHeading
(
title:
"Select Your Reason"
,
textStyle:
TextStyle
(
fontSize:
16
,
fontFamily:
"Poppins"
,
fontWeight:
FontWeight
.
w
6
00
,
color:
Colors
.
black87
,
fontWeight:
FontWeight
.
w
5
00
,
color:
App
Colors
.
normalText
,
),
),
const
SizedBox
(
height:
2
4
),
const
SizedBox
(
height:
2
2
),
GridView
.
builder
(
shrinkWrap:
true
,
...
...
@@ -524,6 +672,7 @@ class _ProductsDetailScreenState extends State<ProductsDetailScreen> {
return
_buildFeatureCard
(
title:
title
,
description:
description
,
orderId:
orderId
,
icon:
icon
,
color:
color
,
);
...
...
@@ -540,6 +689,7 @@ class _ProductsDetailScreenState extends State<ProductsDetailScreen> {
Widget
_buildFeatureCard
({
required
String
title
,
required
String
description
,
required
String
orderId
,
required
String
icon
,
required
Color
color
,
})
{
...
...
@@ -547,7 +697,12 @@ class _ProductsDetailScreenState extends State<ProductsDetailScreen> {
onTap:
()
{
Navigator
.
push
(
context
,
MaterialPageRoute
(
builder:
(
context
)
=>
HelpTicketScreen
(
reason:
title
,))
MaterialPageRoute
(
builder:
(
context
)
=>
HelpTicketScreen
(
reason:
title
,
sessionId:
widget
.
sessionId
,
accId:
widget
.
accId
,
orderId:
orderId
,
))
);
},
child:
Container
(
...
...
@@ -583,6 +738,7 @@ class _ProductsDetailScreenState extends State<ProductsDetailScreen> {
style:
TextStyle
(
color:
AppColors
.
nearDarkText
,
fontSize:
14
,
fontStyle:
FontStyle
.
normal
,
fontWeight:
FontWeight
.
w400
,
fontFamily:
"Plus Jakarta Sans"
,
),
...
...
lib/Screens/ProfileScreen.dart
0 → 100644
View file @
b8c2cae9
import
'package:flutter/material.dart'
;
import
'package:flutter_svg/flutter_svg.dart'
;
import
'package:gen_rentals/Screens/HelpScreens/OrderHelpScreen.dart'
;
import
'package:gen_rentals/Screens/HelpScreens/TicketChatScreen.dart'
;
import
'package:gen_rentals/Utility/Reusablewidgets.dart'
;
import
'../../Notifier/HelpAndEnquiryProvider.dart'
;
import
'../../Utility/AppColors.dart'
;
import
'package:provider/provider.dart'
;
class
ProfileScreen
extends
StatefulWidget
{
final
String
sessionId
;
final
String
accId
;
ProfileScreen
({
super
.
key
,
required
this
.
sessionId
,
required
this
.
accId
,
});
@override
State
<
ProfileScreen
>
createState
()
=>
_ProfileScreenState
();
}
class
_ProfileScreenState
extends
State
<
ProfileScreen
>
{
@override
void
initState
()
{
super
.
initState
();
/// ✅ Fetch ticket list on screen load
Future
.
microtask
(()
async
{
final
provider
=
Provider
.
of
<
HelpAndEnquiryProvider
>(
context
,
listen:
false
);
await
provider
.
fetchTicketList
(
sessionId:
widget
.
sessionId
,
accId:
widget
.
accId
,
);
});
}
// ✅ (unchanged)
final
List
<
Map
<
String
,
dynamic
>>
createNewTickets
=
[
{
'title'
:
'Payment Issues'
,
'description'
:
'Get help with payment related problems'
,
'icon'
:
"assets/svg/rupee_coin_ic.svg"
,
'color'
:
Color
(
0xFFFFEFBE
),
},
{
'title'
:
'Bill Related Issues'
,
'description'
:
'Resolve bill and invoice matters'
,
'icon'
:
"assets/svg/know_pay.svg"
,
'color'
:
Color
(
0xFFCEF9FF
),
},
{
'title'
:
'Other Issues'
,
'description'
:
'Any other support you need'
,
'icon'
:
'assets/svg/help_ic.svg'
,
'color'
:
Color
(
0xFFE4E5FF
),
},
];
@override
Widget
build
(
BuildContext
context
)
{
return
SafeArea
(
top:
false
,
child:
Scaffold
(
backgroundColor:
AppColors
.
backgroundRegular
,
appBar:
AppBar
(
automaticallyImplyLeading:
false
,
backgroundColor:
Colors
.
white
,
title:
Row
(
children:
[
InkResponse
(
onTap:
()
=>
Navigator
.
pop
(
context
,
true
),
child:
SvgPicture
.
asset
(
"assets/svg/continue_left_ic.svg"
,
height:
30
,
),
),
const
SizedBox
(
width:
10
),
const
Text
(
"Profile"
,
style:
TextStyle
(
fontSize:
16
,
fontFamily:
"Plus Jakarta Sans"
,
fontWeight:
FontWeight
.
w600
,
color:
Colors
.
black87
,
),
),
],
),
),
// ✅ Provider Consumer used here
body:
Consumer
<
HelpAndEnquiryProvider
>(
builder:
(
context
,
provider
,
_
)
{
if
(
provider
.
isLoading
)
{
return
const
Center
(
child:
CircularProgressIndicator
());
}
if
(
provider
.
errorMessage
!=
null
)
{
return
Center
(
child:
Text
(
provider
.
errorMessage
!,
style:
const
TextStyle
(
color:
Colors
.
red
)),
);
}
final
ticketData
=
provider
.
ticketListResponse
?.
tickets
;
final
processingTickets
=
ticketData
?.
inProgress
??
[];
final
closedTickets
=
ticketData
?.
closed
??
[];
return
SingleChildScrollView
(
padding:
const
EdgeInsets
.
all
(
16
),
child:
Column
(
crossAxisAlignment:
CrossAxisAlignment
.
start
,
children:
[
// Create New Ticket Section
const
SectionHeading
(
title:
'User Profile'
,
padding:
EdgeInsets
.
symmetric
(
horizontal:
2
,
vertical:
4
),
),
],
),
);
},
),
),
);
}
}
lib/Screens/TransactionsScreen.dart
View file @
b8c2cae9
...
...
@@ -56,7 +56,7 @@ class _TransactionsScreenState extends State<TransactionsScreen> {
style:
TextStyle
(
fontSize:
16
,
fontFamily:
"Plus Jakarta Sans"
,
fontWeight:
FontWeight
.
w
6
00
,
fontWeight:
FontWeight
.
w
4
00
,
color:
Colors
.
black87
,
),
),
...
...
@@ -89,9 +89,9 @@ class _TransactionsScreenState extends State<TransactionsScreen> {
Text
(
month
,
style:
const
TextStyle
(
fontSize:
1
5
,
fontSize:
1
4
,
fontFamily:
"Poppins"
,
fontWeight:
FontWeight
.
w
6
00
,
fontWeight:
FontWeight
.
w
5
00
,
color:
Colors
.
black
,
),
),
...
...
@@ -177,10 +177,11 @@ class _TransactionsScreenState extends State<TransactionsScreen> {
children:
[
Text
(
"₹
$credit
"
,
style:
const
TextStyle
(
style:
TextStyle
(
fontFamily:
"Poppins"
,
fontWeight:
FontWeight
.
w500
,
fontSize:
13
,
fontWeight:
FontWeight
.
w400
,
fontSize:
14
,
fontStyle:
FontStyle
.
normal
,
color:
Colors
.
black
,
),
),
...
...
@@ -188,7 +189,9 @@ class _TransactionsScreenState extends State<TransactionsScreen> {
"Bill Paid"
,
style:
TextStyle
(
fontFamily:
"Poppins"
,
fontSize:
11
,
fontSize:
12
,
fontStyle:
FontStyle
.
normal
,
fontWeight:
FontWeight
.
w400
,
color:
Colors
.
black54
,
),
),
...
...
@@ -226,8 +229,8 @@ class _TransactionsScreenState extends State<TransactionsScreen> {
"₹
$debit
"
,
style:
const
TextStyle
(
fontFamily:
"Poppins"
,
fontWeight:
FontWeight
.
w
5
00
,
fontSize:
1
3
,
fontWeight:
FontWeight
.
w
4
00
,
fontSize:
1
4
,
color:
Colors
.
black
,
),
),
...
...
@@ -235,7 +238,9 @@ class _TransactionsScreenState extends State<TransactionsScreen> {
"Bill Pending"
,
style:
TextStyle
(
fontFamily:
"Poppins"
,
fontSize:
11
,
fontSize:
12
,
fontStyle:
FontStyle
.
normal
,
fontWeight:
FontWeight
.
w400
,
color:
Colors
.
black54
,
),
)
...
...
@@ -289,7 +294,7 @@ class _TransactionsScreenState extends State<TransactionsScreen> {
style:
const
TextStyle
(
fontFamily:
"Poppins"
,
color:
Colors
.
black
,
fontSize:
3
2
,
fontSize:
3
4
,
fontWeight:
FontWeight
.
w500
,
),
),
...
...
@@ -363,18 +368,20 @@ class _TransactionsScreenState extends State<TransactionsScreen> {
Text
(
title
,
overflow:
TextOverflow
.
ellipsis
,
style:
const
TextStyle
(
style:
TextStyle
(
fontFamily:
"Poppins"
,
fontSize:
14
,
fontWeight:
FontWeight
.
normal
,
color:
Colors
.
black
,
),
),
const
SizedBox
(
height:
4
),
Text
(
date
,
style:
const
TextStyle
(
style:
TextStyle
(
fontFamily:
"Poppins"
,
fontSize:
12
,
fontWeight:
FontWeight
.
w400
,
color:
Colors
.
grey
,
),
),
...
...
@@ -384,10 +391,11 @@ class _TransactionsScreenState extends State<TransactionsScreen> {
const
SizedBox
(
width:
12
),
Text
(
amount
,
style:
const
TextStyle
(
style:
TextStyle
(
fontFamily:
"Poppins"
,
fontSize:
14
,
color:
Colors
.
black
,
fontWeight:
FontWeight
.
w400
,
color:
Colors
.
black87
,
),
),
],
...
...
lib/Services/api_calling.dart
View file @
b8c2cae9
...
...
@@ -413,6 +413,7 @@ class ApiCalling {
}
}
/// Create new ticket
static
Future
<
CommonResponse
?>
addTicketApi
(
String
sessionId
,
String
accId
,
...
...
@@ -421,6 +422,7 @@ class ApiCalling {
String
orderId
,
List
<
File
>?
images
,
)
async
{
try
{
Map
<
String
,
String
>
body
=
{
"session_id"
:
sessionId
,
...
...
@@ -435,14 +437,15 @@ class ApiCalling {
'Content-Type'
:
'multipart/form-data'
,
// Add any other headers you need (auth tokens, etc.)
};
debugPrint
(
"Data to addTicketApi
${body}
"
);
final
res
=
await
postMessageWithImages
(
body
,
add
Message
Url
,
//
Your
API endpoint
add
Ticket
Url
,
// API endpoint
headers
,
images
??
[],
// Pass empty list if no images
);
debugPrint
(
"Response from addTicketApi
${res}
"
);
if
(
res
!=
null
)
{
return
CommonResponse
.
fromJson
(
jsonDecode
(
res
));
}
else
{
...
...
lib/Utility/Reusablewidgets.dart
View file @
b8c2cae9
...
...
@@ -8,8 +8,8 @@ class SectionHeading extends StatelessWidget {
const
SectionHeading
({
Key
?
key
,
required
this
.
title
,
this
.
textStyle
=
const
TextStyle
(
fontSize:
1
6
,
fontWeight:
FontWeight
.
w500
,
fontFamily:
"Poppins"
),
this
.
padding
=
const
EdgeInsets
.
symmetric
(
horizontal:
12.0
,
vertical:
8.0
),
this
.
textStyle
=
const
TextStyle
(
fontSize:
1
4
,
fontWeight:
FontWeight
.
w500
,
fontFamily:
"Poppins"
),
this
.
padding
=
const
EdgeInsets
.
symmetric
(
horizontal:
8
,
vertical:
2
),
})
:
super
(
key:
key
);
@override
...
...
lib/main.dart
View file @
b8c2cae9
...
...
@@ -40,12 +40,27 @@ class MyApp extends StatelessWidget {
return
MaterialApp
(
debugShowCheckedModeBanner:
false
,
title:
'Gen Rentals'
,
theme:
themeProvider
.
isDark
?
ThemeData
.
dark
()
:
ThemeData
.
light
().
copyWith
(
scaffoldBackgroundColor:
const
Color
(
0xFFF5F8FC
),
theme:
ThemeData
(
brightness:
themeProvider
.
isDark
?
Brightness
.
dark
:
Brightness
.
light
,
fontFamily:
'Poppins'
,
textTheme:
const
TextTheme
(
bodyMedium:
TextStyle
(
fontSize:
14
,
fontWeight:
FontWeight
.
w400
,
height:
1.5
,
letterSpacing:
-
0.12
,
),
titleMedium:
TextStyle
(
fontSize:
16
,
fontWeight:
FontWeight
.
w500
,
),
labelLarge:
TextStyle
(
fontSize:
12
,
fontWeight:
FontWeight
.
w700
,
),
),
),
home:
const
SplashScreen
(),
//
home:
const
SplashScreen
(),
);
},
),
...
...
pubspec.yaml
View file @
b8c2cae9
...
...
@@ -93,12 +93,14 @@ flutter:
# "family" key with the font family name, and a "fonts" key with a
# list giving the asset and other descriptors for the font. For
# example:
# fonts:
# - family: Schyler
# fonts:
# - asset: fonts/Schyler-Regular.ttf
# - asset: fonts/Schyler-Italic.ttf
# style: italic
fonts
:
-
family
:
Poppins
fonts
:
-
asset
:
assets/fonts/Poppins/Poppins-Regular.ttf
-
asset
:
assets/fonts/Poppins/Poppins-Medium.ttf
weight
:
500
-
asset
:
assets/fonts/Poppins/Poppins-Bold.ttf
weight
:
700
# - family: Trajan Pro
# fonts:
# - asset: fonts/TrajanPro.ttf
...
...
Prev
1
2
Next
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment