Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Release] 0.0.88 #232

Merged
merged 16 commits into from
Nov 21, 2023
Merged
Changes from 13 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -9,6 +9,9 @@ on:
pull_request:
branches: [main, develop]

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

jobs:
tests:
name: Run Automated Tests
@@ -17,6 +20,7 @@ jobs:
- uses: actions/checkout@v3
- uses: subosito/flutter-action@v2
with:
flutter-version: '3.13.9'
channel: 'stable'
- name: Install dependencies
run: flutter pub get
4 changes: 3 additions & 1 deletion lib/blip_ds.dart
Original file line number Diff line number Diff line change
@@ -18,7 +18,7 @@ export 'src/models/ds_message_bubble_avatar_config.model.dart'
show DSMessageBubbleAvatarConfig;
export 'src/models/ds_message_bubble_style.model.dart'
show DSMessageBubbleStyle;
export 'src/models/ds_message_item.model.dart' show DSMessageItemModel;
export 'src/models/ds_message_item.model.dart' show DSMessageItem;
export 'src/models/ds_toast_props.model.dart' show DSToastProps;
export 'src/services/ds_auth.service.dart' show DSAuthService;
export 'src/services/ds_bottom_sheet.service.dart' show DSBottomSheetService;
@@ -89,6 +89,8 @@ export 'src/widgets/buttons/ds_tertiary_button.widget.dart'
export 'src/widgets/chat/audio/ds_audio_message_bubble.widget.dart'
show DSAudioMessageBubble;
export 'src/widgets/chat/audio/ds_audio_player.widget.dart' show DSAudioPlayer;
export 'src/widgets/chat/ds_application_json_message_bubble.widget.dart'
show DSApplicationJsonMessageBubble;
export 'src/widgets/chat/ds_carrousel.widget.dart' show DSCarrousel;
export 'src/widgets/chat/ds_contact_message_bubble.widget.dart'
show DSContactMessageBubble;
6 changes: 6 additions & 0 deletions lib/src/enums/ds_interactive_message_header_type.enum.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
enum DSInteractiveMessageHeaderType {
text,
document,
image,
video,
}
10 changes: 5 additions & 5 deletions lib/src/models/ds_message_item.model.dart
Original file line number Diff line number Diff line change
@@ -2,7 +2,7 @@ import '../enums/ds_align.enum.dart';
import '../enums/ds_delivery_report_status.enum.dart';

/// A Design System message model used with [DSGroupCard] to display grouped bubble
class DSMessageItemModel {
class DSMessageItem {
/// Identifier of message
String? id;

@@ -30,8 +30,8 @@ class DSMessageItemModel {
/// Used to define if a message detail (typicament a messages date and time) should be displayed or not
bool? hideMessageDetail;

/// Creates a new Design System's [DSMessageItemModel] model
DSMessageItemModel({
/// Creates a new Design System's [DSMessageItem] model
DSMessageItem({
this.id,
required this.date,
required this.displayDate,
@@ -43,8 +43,8 @@ class DSMessageItemModel {
this.hideMessageDetail,
});

factory DSMessageItemModel.fromJson(Map<String, dynamic> json) {
final messageItem = DSMessageItemModel(
factory DSMessageItem.fromJson(Map<String, dynamic> json) {
final messageItem = DSMessageItem(
id: json['id'],
date: json['date'],
displayDate: json['displayDate'],
8 changes: 4 additions & 4 deletions lib/src/models/ds_select_option.model.dart
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
/// A Design System select options model used with [DSSelectMenu], [DSQuickReply] to display a options menu
class DSSelectOptionModel {
class DSSelectOption {
String text;
int? order;
String? type;
dynamic value;

DSSelectOptionModel({
DSSelectOption({
required this.text,
this.order,
this.type,
this.value,
});

factory DSSelectOptionModel.fromJson(Map<String, dynamic> json) {
final option = DSSelectOptionModel(
factory DSSelectOption.fromJson(Map<String, dynamic> json) {
final option = DSSelectOption(
text: json['text'],
);

Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
import 'ds_interactive_message_action.model.dart';
import 'ds_interactive_message_body.model.dart';
import 'ds_interactive_message_footer.model.dart';
import 'ds_interactive_message_header.model.dart';

class DSInteractiveMessage {
final DSInteractiveMessageHeader? header;
final DSInteractiveMessageBody? body;
final DSInteractiveMessageAction? action;
final DSInteractiveMessageFooter? footer;

DSInteractiveMessage({
this.header,
this.body,
this.action,
this.footer,
});

DSInteractiveMessage.fromJson(Map<String, dynamic> json)
: header = json['header'] != null
? DSInteractiveMessageHeader.fromJson(json['header'])
: null,
body = json['body'] != null
? DSInteractiveMessageBody.fromJson(json['body'])
: null,
action = json['action'] != null
? DSInteractiveMessageAction.fromJson(json['action'])
: null,
footer = json['footer'] != null
? DSInteractiveMessageFooter.fromJson(json['footer'])
: null;

Map<String, dynamic> toJson() => {
'header': header?.toJson(),
'body': body?.toJson(),
'action': action?.toJson(),
'footer': footer?.toJson(),
};
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
import 'ds_interactive_message_button.model.dart';
import 'ds_interactive_message_section.model.dart';

class DSInteractiveMessageAction {
final String? button;
final List<DSInteractiveMessageButton>? buttons;
final List<DSInteractiveMessageSection>? sections;

DSInteractiveMessageAction({
this.button,
this.buttons,
this.sections,
});

DSInteractiveMessageAction.fromJson(Map<String, dynamic> json)
: button = json['button'],
buttons = json['buttons'] != null
? List.from(json['buttons'])
.map(
(e) => DSInteractiveMessageButton.fromJson(e),
)
.toList()
: null,
sections = json['sections'] != null
? List.from(json['sections'])
.map(
(e) => DSInteractiveMessageSection.fromJson(e),
)
.toList()
: null;

Map<String, dynamic> toJson() => {
'button': button,
'buttons': buttons
?.map(
(e) => e.toJson(),
)
.toList(),
'sections': sections
?.map(
(e) => e.toJson(),
)
.toList(),
};
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
class DSInteractiveMessageBody {
final String? text;

DSInteractiveMessageBody({
this.text,
});

DSInteractiveMessageBody.fromJson(Map<String, dynamic> json)
: text = json['text'];

Map<String, dynamic> toJson() => {
'text': text,
};
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
class DSInteractiveMessageButton {
final String? title;

DSInteractiveMessageButton({
this.title,
});

DSInteractiveMessageButton.fromJson(Map<String, dynamic> json)
: title = json['reply']?['title'];

Map<String, dynamic> toJson() => {
'title': title,
};
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import 'ds_interactive_message_media.model.dart';

class DSInteractiveMessageDocument extends DSInteractiveMessageMedia {
final String? filename;

DSInteractiveMessageDocument({
super.link,
this.filename,
});

DSInteractiveMessageDocument.fromJson(Map<String, dynamic> json)
: filename = json['filename'],
super.fromJson(json);

@override
Map<String, dynamic> toJson() => {
'link': super.link,
'filename': filename,
};
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
class DSInteractiveMessageFooter {
final String? text;

DSInteractiveMessageFooter({
this.text,
});

DSInteractiveMessageFooter.fromJson(Map<String, dynamic> json)
: text = json['text'];

Map<String, dynamic> toJson() => {
'text': text,
};
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
import 'package:get/get.dart';

import '../../enums/ds_interactive_message_header_type.enum.dart';
import 'ds_interactive_message_document.model.dart';
import 'ds_interactive_message_image.model.dart';
import 'ds_interactive_message_video.model.dart';

class DSInteractiveMessageHeader {
final DSInteractiveMessageHeaderType? type;
final String? text;
final DSInteractiveMessageDocument? document;
final DSInteractiveMessageImage? image;
final DSInteractiveMessageVideo? video;

DSInteractiveMessageHeader({
this.type,
this.text,
this.document,
this.image,
this.video,
});

DSInteractiveMessageHeader.fromJson(Map<String, dynamic> json)
: type = DSInteractiveMessageHeaderType.values.firstWhereOrNull(
(e) => e.name == json['type'],
),
text = json['text'],
document = json['document'] != null
? DSInteractiveMessageDocument.fromJson(json['document'])
: null,
image = json['image'] != null
? DSInteractiveMessageImage.fromJson(json['image'])
: null,
video = json['video'] != null
? DSInteractiveMessageVideo.fromJson(json['video'])
: null;

Map<String, dynamic> toJson() => {
'type': type?.name,
'text': text,
'document': document?.toJson(),
'image': image?.toJson(),
'video': video?.toJson(),
};
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import 'ds_interactive_message_media.model.dart';

class DSInteractiveMessageImage extends DSInteractiveMessageMedia {
DSInteractiveMessageImage.fromJson(Map<String, dynamic> json)
: super.fromJson(json);
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
abstract class DSInteractiveMessageMedia {
final String? link;

DSInteractiveMessageMedia({
this.link,
});

DSInteractiveMessageMedia.fromJson(Map<String, dynamic> json)
: link = json['link'];

Map<String, dynamic> toJson() => {
'link': link,
};
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
class DSInteractiveMessageRow {
final String? title;

DSInteractiveMessageRow({
this.title,
});

DSInteractiveMessageRow.fromJson(Map<String, dynamic> json)
: title = json['title'];

Map<String, dynamic> toJson() => {
'title': title,
};
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
import 'ds_interactive_message_row.model.dart';

class DSInteractiveMessageSection {
final String? title;
final List<DSInteractiveMessageRow>? rows;

DSInteractiveMessageSection({
this.title,
this.rows,
});

DSInteractiveMessageSection.fromJson(Map<String, dynamic> json)
: title = json['title'],
rows = json['rows'] != null
? List.from(json['rows'])
.map(
(e) => DSInteractiveMessageRow.fromJson(e),
)
.toList()
: null;

Map<String, dynamic> toJson() => {
'title': title,
'rows': rows
?.map(
(e) => e.toJson(),
)
.toList(),
};
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import 'ds_interactive_message_media.model.dart';

class DSInteractiveMessageVideo extends DSInteractiveMessageMedia {
DSInteractiveMessageVideo.fromJson(Map<String, dynamic> json)
: super.fromJson(json);
}
Loading