TF-56 Add object upload request & response and widget builder
This commit is contained in:
@@ -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