Skip to content

Commit

Permalink
Merge pull request #37 from takenet/release/0.0.16
Browse files Browse the repository at this point in the history
Release/0.0.16
  • Loading branch information
leonardogbr authored Oct 20, 2022
2 parents 8619bff + 12087a3 commit 3f32bb4
Show file tree
Hide file tree
Showing 36 changed files with 1,190 additions and 273 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
## 0.0.16

* Added support for design system Toast
* Added support for modal bottom sheet
* Added support for document select bubble
* Improved group card logic

## 0.0.15

* Added suport for ticket type bubble
Expand Down
Binary file removed assets/images/icon_alert_error.png
Binary file not shown.
Binary file removed assets/images/icon_alert_system.png
Binary file not shown.
Binary file removed assets/images/icon_alert_warning.png
Binary file not shown.
3 changes: 3 additions & 0 deletions assets/images/icon_bell.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions assets/images/icon_error.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions assets/images/icon_like.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions assets/images/icon_message.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions assets/images/icon_warning.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/images/notificacao.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions lib/blip_ds.dart
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ export 'src/enums/ds_border_radius.enum.dart' show DSBorderRadius;
export 'src/enums/ds_align.enum.dart' show DSAlign;
export 'src/enums/ds_delivery_report_status.enum.dart'
show DSDeliveryReportStatus;
export 'src/enums/ds_toast_action_type.enum.dart' show DSToastActionType;
export 'src/enums/ds_ticket_message_type.enum.dart' show DSTicketMessageType;

/// Extensions
Expand Down Expand Up @@ -99,6 +100,8 @@ export 'src/themes/texts/styles/ds_caption_text_style.theme.dart'

/// Services
export 'src/services/ds_dialog.service.dart' show DSDialogService;
export 'src/services/ds_toast.service.dart' show DSToastService;
export 'src/services/ds_bottom_sheet.service.dart' show DSBottomSheetService;

/// Models
export 'src/models/ds_message_item.model.dart' show DSMessageItemModel;
Expand Down
4 changes: 4 additions & 0 deletions lib/src/controllers/chat/ds_url_preview.controller.dart
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ class DSUrlPreviewController extends GetxController {
final isLoading = RxBool(false);
final urlPreview = Rx<LinkPreview?>(null);

DSUrlPreviewController(Uri url) {
getUrlPreview(url);
}

Future<void> getUrlPreview(final Uri url) async {
if (url.toString().isNotEmpty) {
try {
Expand Down
5 changes: 5 additions & 0 deletions lib/src/enums/ds_toast_action_type.enum.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
/// A Design System enumeration that can be used to define the type of toast action.
enum DSToastActionType {
icon,
button,
}
8 changes: 8 additions & 0 deletions lib/src/enums/ds_toast_type.enum.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
/// A Design System enumeration that can be used to define the type of the toast.
enum DSToastType {
success,
warning,
error,
system,
notification,
}
130 changes: 130 additions & 0 deletions lib/src/services/ds_bottom_sheet.service.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,130 @@
import 'package:blip_ds/blip_ds.dart';
import 'package:flutter/material.dart';
import 'package:get/state_manager.dart';

class DSBottomSheetService {
final BuildContext context;
final Widget child;

DSBottomSheetService({
required this.context,
required this.child,
});

Widget _buildBottomSheet({ScrollController? controller}) {
final window = WidgetsBinding.instance.window;
final padding = MediaQueryData.fromWindow(window).padding.bottom + 36;

final RxBool showContainer = controller != null ? true.obs : false.obs;

return Container(
margin: EdgeInsets.only(
top: MediaQueryData.fromWindow(window).padding.top + 10,
),
decoration: const BoxDecoration(
color: DSColors.neutralLightSnow,
borderRadius: BorderRadius.only(
topLeft: Radius.circular(15.0),
topRight: Radius.circular(15.0),
),
),
child: Padding(
padding: const EdgeInsets.symmetric(
horizontal: 16.0,
),
child: Stack(
children: [
IgnorePointer(
child: SizedBox(
height: 30.0,
child: Row(
mainAxisSize: MainAxisSize.max,
mainAxisAlignment: MainAxisAlignment.center,
children: [
Container(
height: 4.0,
width: 32.0,
decoration: const BoxDecoration(
color: DSColors.neutralMediumWave,
borderRadius: BorderRadius.all(
Radius.circular(15.0),
),
),
),
],
),
),
),
Obx(
() => Padding(
padding: EdgeInsets.only(top: showContainer.value ? 0 : 35.0),
child: controller != null
? NotificationListener(
child: ListView(
controller: controller,
children: [
Visibility(
visible: showContainer.value,
child: Container(
padding: const EdgeInsets.only(top: 20.0),
color: Colors.transparent,
height: 35.0,
),
),
_buildChild(padding)
],
),
onNotification: (t) {
if (controller.position.pixels > 0) {
showContainer.value = false;
}

return true;
},
)
: _buildChild(padding),
),
),
],
),
),
);
}

Widget _buildChild(double padding) {
return Padding(
padding: EdgeInsets.only(
bottom: padding,
),
child: child,
);
}

void showDraggable({
final double minSize = 0.25,
final double initSize = 0.5,
}) {
showModalBottomSheet<void>(
backgroundColor: Colors.transparent,
isScrollControlled: true,
context: context,
builder: (_) {
return DraggableScrollableSheet(
expand: false,
maxChildSize: 1,
minChildSize: minSize,
initialChildSize: initSize,
builder: (_, controller) => _buildBottomSheet(controller: controller),
);
},
);
}

void show() {
showModalBottomSheet<void>(
backgroundColor: Colors.transparent,
context: context,
builder: (_) => _buildBottomSheet(),
);
}
}
Loading

0 comments on commit 3f32bb4

Please sign in to comment.