-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'develop' into release/0.1.6
- Loading branch information
Showing
28 changed files
with
634 additions
and
65 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
enum DSCallDirection { | ||
outbound, | ||
inbound, | ||
unknown, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
enum DSCallProvider { | ||
mobcall, | ||
whatsApp, | ||
unknown, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
enum DSCallStatus { | ||
completed, | ||
answer, | ||
noAnswer, | ||
unknown, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
enum DSCallType { | ||
voice, | ||
video, | ||
unknown, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
extension EnumByNameOrNull<T extends Enum> on Iterable<T> { | ||
T? byNameOrNull(String? name) { | ||
for (var value in this) { | ||
if (value.name.toString().toLowerCase() == | ||
name?.toString().toLowerCase()) { | ||
return value; | ||
} | ||
} | ||
|
||
return null; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import '../services/ds_localization.service.dart'; | ||
|
||
extension DSLocalizationExtension on String { | ||
translate() { | ||
final locale = DSLocalizationService.locale ?? 'pt_BR'; | ||
final translations = | ||
DSLocalizationService.translations?[locale.toString()] ?? {}; | ||
return translations[this] ?? this; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
import '../enums/ds_call_direction.enum.dart'; | ||
import '../enums/ds_call_provider.enum.dart'; | ||
import '../enums/ds_call_status.enum.dart'; | ||
import '../enums/ds_call_type.enum.dart'; | ||
import '../extensions/ds_enum.extension.dart'; | ||
|
||
class DSCallsMediaMessage { | ||
final String? sessionId; | ||
final DSCallType? type; | ||
final DSCallProvider? provider; | ||
final DSCallDirection? direction; | ||
final DSCallStatus? status; | ||
final String? ticketId; | ||
final String? identification; | ||
final int? callDuration; | ||
|
||
DSCallsMediaMessage({ | ||
required this.sessionId, | ||
required this.type, | ||
required this.provider, | ||
required this.direction, | ||
required this.status, | ||
required this.ticketId, | ||
required this.identification, | ||
this.callDuration, | ||
}); | ||
|
||
DSCallsMediaMessage.fromJson(Map<String, dynamic> json) | ||
: sessionId = json['sessionId'], | ||
type = DSCallType.values.byNameOrNull(json['type']), | ||
provider = DSCallProvider.values.byNameOrNull(json['provider']), | ||
direction = DSCallDirection.values.byNameOrNull(json['direction']), | ||
status = DSCallStatus.values.byNameOrNull(json['status']), | ||
ticketId = json['ticketId'], | ||
identification = json['identification'], | ||
callDuration = json['callDuration'] ?? 0; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import 'package:flutter/material.dart'; | ||
|
||
abstract class DSLocalizationService { | ||
static Locale? _locale; | ||
static final Map<String, dynamic> _translations = {}; | ||
|
||
static setLocale(final Locale locale) => _locale = locale; | ||
static setTranslations(final Map<String, dynamic> translations) => | ||
_translations.addAll(translations); | ||
|
||
static Locale? get locale => _locale; | ||
static Map<String, dynamic>? get translations => _translations; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import 'package:flutter/material.dart'; | ||
|
||
import '../../../blip_ds.dart'; | ||
|
||
/// A Design System's [ButtonStyleButton] primarily used by call to action. | ||
class DSGhostButton extends DSSecondaryButton { | ||
/// Creates a Design System's [ButtonStyleButton] with ghost style. | ||
DSGhostButton({ | ||
required super.onPressed, | ||
super.key, | ||
super.leadingIcon, | ||
super.label, | ||
super.trailingIcon, | ||
super.isEnabled, | ||
super.isLoading, | ||
super.autoSize, | ||
super.contentAlignment, | ||
super.foregroundColor, | ||
super.borderColor, | ||
}) : super( | ||
backgroundColor: Colors.transparent, | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.