TF-56 Add object upload request & response and widget builder
This commit is contained in:
+3
-1
@@ -33,7 +33,9 @@ export 'presentation/views/text/text_form_field_builder.dart';
|
||||
export 'presentation/views/image/icon_builder.dart';
|
||||
export 'presentation/views/context_menu/context_menu_action_builder.dart';
|
||||
export 'presentation/views/context_menu/context_menu_builder.dart';
|
||||
export 'presentation/views/dialog/downloading_file_dialog_builder.dart';
|
||||
export 'presentation/views/context_menu/context_menu_header_builder.dart';
|
||||
export 'presentation/views/context_menu/simple_context_menu_action_builder.dart';
|
||||
export 'presentation/views/dialog/loading_dialog_builder.dart';
|
||||
|
||||
// Resources
|
||||
export 'presentation/resources/assets_paths.dart';
|
||||
|
||||
@@ -39,6 +39,8 @@ class ImagePaths {
|
||||
String get icSelected => _getImagePath('ic_selected.svg');
|
||||
String get icExpandAttachment => _getImagePath('ic_expand_attachment.svg');
|
||||
String get icDownload => _getImagePath('ic_download.svg');
|
||||
String get icMore => _getImagePath('ic_more.svg');
|
||||
String get icPhotoLibrary => _getImagePath('ic_photo_library.svg');
|
||||
|
||||
String _getImagePath(String imageName) {
|
||||
return AssetsPaths.images + imageName;
|
||||
|
||||
@@ -6,10 +6,16 @@ abstract class ViewState extends Success {}
|
||||
|
||||
class UIState extends ViewState {
|
||||
static final idle = UIState();
|
||||
static final loading = UIState();
|
||||
|
||||
UIState() : super();
|
||||
|
||||
@override
|
||||
List<Object?> get props => [];
|
||||
}
|
||||
|
||||
class LoadingState extends UIState {
|
||||
LoadingState();
|
||||
|
||||
@override
|
||||
List<Object?> get props => [];
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
|
||||
import 'package:core/core.dart';
|
||||
import 'package:flutter/foundation.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class ContextMenuHeaderBuilder {
|
||||
final Key _key;
|
||||
String? _label;
|
||||
TextStyle? _textStyle;
|
||||
|
||||
ContextMenuHeaderBuilder(this._key);
|
||||
|
||||
void addLabel(String label) {
|
||||
_label = label;
|
||||
}
|
||||
|
||||
void textStyle(TextStyle textStyle) {
|
||||
_textStyle = textStyle;
|
||||
}
|
||||
|
||||
ListTile build() {
|
||||
return ListTile(
|
||||
key: _key,
|
||||
title: Transform(
|
||||
transform: Matrix4.translationValues(12, 5, 0.0),
|
||||
child: Text(
|
||||
_label ?? '',
|
||||
style: _textStyle ?? TextStyle(fontSize: 20.0, color: AppColor.nameUserColor, fontWeight: FontWeight.w500),
|
||||
),
|
||||
));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
|
||||
import 'package:core/presentation/views/context_menu/context_menu_action_builder.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_svg/flutter_svg.dart';
|
||||
|
||||
class SimpleContextMenuActionBuilder extends ContextMenuActionBuilder<void> {
|
||||
SimpleContextMenuActionBuilder(
|
||||
Key key,
|
||||
SvgPicture actionIcon,
|
||||
String actionName
|
||||
) : super(key, actionIcon, actionName);
|
||||
|
||||
@override
|
||||
ListTile build() {
|
||||
return ListTile(
|
||||
key: key,
|
||||
leading: Padding(
|
||||
padding: EdgeInsets.only(left: 12),
|
||||
child: actionIcon),
|
||||
title: Text(actionName, style: actionTextStyle()),
|
||||
onTap: () {
|
||||
if (onContextMenuActionClick != null) {
|
||||
onContextMenuActionClick!(null);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
|
||||
import 'package:core/core.dart';
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/widgets.dart';
|
||||
|
||||
class LoadingDialogBuilder {
|
||||
final Key _key;
|
||||
final String _title;
|
||||
|
||||
LoadingDialogBuilder(this._key, this._title);
|
||||
|
||||
Widget build() {
|
||||
return CupertinoAlertDialog(
|
||||
key: _key,
|
||||
title: Text(_title, style: TextStyle(fontSize: 17.0, color: AppColor.appColor)),
|
||||
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),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user