feat(shifts): add client name support in OpenShift and RecommendedShiftCard
This commit is contained in:
@@ -12,6 +12,7 @@ class OpenShift extends Equatable {
|
|||||||
required this.shiftId,
|
required this.shiftId,
|
||||||
required this.roleId,
|
required this.roleId,
|
||||||
required this.roleName,
|
required this.roleName,
|
||||||
|
this.clientName = '',
|
||||||
required this.location,
|
required this.location,
|
||||||
required this.date,
|
required this.date,
|
||||||
required this.startTime,
|
required this.startTime,
|
||||||
@@ -29,6 +30,7 @@ class OpenShift extends Equatable {
|
|||||||
shiftId: json['shiftId'] as String,
|
shiftId: json['shiftId'] as String,
|
||||||
roleId: json['roleId'] as String,
|
roleId: json['roleId'] as String,
|
||||||
roleName: json['roleName'] as String,
|
roleName: json['roleName'] as String,
|
||||||
|
clientName: json['clientName'] as String? ?? '',
|
||||||
location: json['location'] as String? ?? '',
|
location: json['location'] as String? ?? '',
|
||||||
date: DateTime.parse(json['date'] as String),
|
date: DateTime.parse(json['date'] as String),
|
||||||
startTime: DateTime.parse(json['startTime'] as String),
|
startTime: DateTime.parse(json['startTime'] as String),
|
||||||
@@ -50,6 +52,9 @@ class OpenShift extends Equatable {
|
|||||||
/// Display name of the role.
|
/// Display name of the role.
|
||||||
final String roleName;
|
final String roleName;
|
||||||
|
|
||||||
|
/// Name of the client/business offering this shift.
|
||||||
|
final String clientName;
|
||||||
|
|
||||||
/// Human-readable location label.
|
/// Human-readable location label.
|
||||||
final String location;
|
final String location;
|
||||||
|
|
||||||
@@ -83,6 +88,7 @@ class OpenShift extends Equatable {
|
|||||||
'shiftId': shiftId,
|
'shiftId': shiftId,
|
||||||
'roleId': roleId,
|
'roleId': roleId,
|
||||||
'roleName': roleName,
|
'roleName': roleName,
|
||||||
|
'clientName': clientName,
|
||||||
'location': location,
|
'location': location,
|
||||||
'date': date.toIso8601String(),
|
'date': date.toIso8601String(),
|
||||||
'startTime': startTime.toIso8601String(),
|
'startTime': startTime.toIso8601String(),
|
||||||
@@ -100,6 +106,7 @@ class OpenShift extends Equatable {
|
|||||||
shiftId,
|
shiftId,
|
||||||
roleId,
|
roleId,
|
||||||
roleName,
|
roleName,
|
||||||
|
clientName,
|
||||||
location,
|
location,
|
||||||
date,
|
date,
|
||||||
startTime,
|
startTime,
|
||||||
|
|||||||
@@ -78,7 +78,9 @@ class RecommendedShiftCard extends StatelessWidget {
|
|||||||
children: <Widget>[
|
children: <Widget>[
|
||||||
Flexible(
|
Flexible(
|
||||||
child: Text(
|
child: Text(
|
||||||
shift.roleName,
|
shift.roleName.isNotEmpty
|
||||||
|
? shift.roleName
|
||||||
|
: shift.clientName,
|
||||||
style: UiTypography.body1m.textPrimary,
|
style: UiTypography.body1m.textPrimary,
|
||||||
overflow: TextOverflow.ellipsis,
|
overflow: TextOverflow.ellipsis,
|
||||||
),
|
),
|
||||||
@@ -94,7 +96,9 @@ class RecommendedShiftCard extends StatelessWidget {
|
|||||||
spacing: UiConstants.space1,
|
spacing: UiConstants.space1,
|
||||||
children: <Widget>[
|
children: <Widget>[
|
||||||
Text(
|
Text(
|
||||||
shift.orderType.toJson(),
|
shift.clientName.isNotEmpty
|
||||||
|
? shift.clientName
|
||||||
|
: shift.orderType.toJson(),
|
||||||
style: UiTypography.body3r.textSecondary,
|
style: UiTypography.body3r.textSecondary,
|
||||||
),
|
),
|
||||||
Text(
|
Text(
|
||||||
|
|||||||
Reference in New Issue
Block a user