TF-32 Add domain layer of export attachment for ios platform

This commit is contained in:
dab246
2021-09-16 09:46:14 +07:00
committed by Dat H. Pham
parent 20f98ce541
commit 0158142e45
15 changed files with 268 additions and 5 deletions
@@ -55,4 +55,5 @@ extension AppColor on Color {
static const toastBackgroundColor = Color(0xFFACAFFF);
static const toastSuccessBackgroundColor = Color(0xFF04AA11);
static const toastErrorBackgroundColor = Color(0xFFFF5858);
static const backgroundCountAttachment = Color(0x681C1C1C);
}
@@ -37,6 +37,8 @@ class ImagePaths {
String get icComposerFileShare => _getImagePath('ic_composer_file_share.svg');
String get icExpandAddress => _getImagePath('ic_expand_address.svg');
String get icSelected => _getImagePath('ic_selected.svg');
String get icExpandAttachment => _getImagePath('ic_expand_attachment.svg');
String get icDownload => _getImagePath('ic_download.svg');
String _getImagePath(String imageName) {
return AssetsPaths.images + imageName;
@@ -0,0 +1,71 @@
import 'package:core/core.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter/widgets.dart';
typedef OnCancelDownloadActionClick = void Function();
class DownloadingFileDialogBuilder {
Key? _key;
String _title = '';
String _content = '';
String _actionText = '';
OnCancelDownloadActionClick? _onCancelDownloadActionClick;
DownloadingFileDialogBuilder();
void key(Key key) {
_key = key;
}
void title(String title) {
_title = title;
}
void content(String content) {
_content = content;
}
void actionText(String actionText) {
_actionText = actionText;
}
void addCancelDownloadActionClick(OnCancelDownloadActionClick onCancelDownloadActionClick) {
_onCancelDownloadActionClick = onCancelDownloadActionClick;
}
Widget build() {
return CupertinoAlertDialog(
key: _key ?? Key('DownloadingFileBuilder'),
title: Text(_title, style: TextStyle(fontSize: 17.0, color: Colors.black)),
content: Padding(
padding: EdgeInsets.only(top: 16.0, left: 16.0, right: 16.0),
child: Center(
child: Column(
children: [
SizedBox(
width: 20.0,
height: 20.0,
child: CupertinoActivityIndicator()),
SizedBox(height: 16),
Text(
_content,
style: TextStyle(fontSize: 13.0, color: Colors.black),
softWrap: false,
maxLines: 1)
],
),
)),
actions: [
TextButton(
onPressed: () {
if (_onCancelDownloadActionClick != null) {
_onCancelDownloadActionClick!();
}},
child: Text(_actionText, style: TextStyle(fontSize: 17.0, color: AppColor.appColor)),
)
],
);
}
}