TF-740 Create OrderListType object
This commit is contained in:
@@ -0,0 +1,51 @@
|
|||||||
|
|
||||||
|
import 'package:core/core.dart';
|
||||||
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:flutter_svg/flutter_svg.dart';
|
||||||
|
import 'package:tmail_ui_user/main/localizations/app_localizations.dart';
|
||||||
|
|
||||||
|
enum OrderListType {
|
||||||
|
bulletedList,
|
||||||
|
numberedList;
|
||||||
|
|
||||||
|
String get commandAction {
|
||||||
|
switch(this) {
|
||||||
|
case OrderListType.bulletedList:
|
||||||
|
return 'insertUnorderedList';
|
||||||
|
case OrderListType.numberedList:
|
||||||
|
return 'insertOrderedList';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
String getIcon(ImagePaths imagePaths) {
|
||||||
|
switch (this) {
|
||||||
|
case OrderListType.bulletedList:
|
||||||
|
return imagePaths.icOrderBullet;
|
||||||
|
case OrderListType.numberedList:
|
||||||
|
return imagePaths.icOrderNumber;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
String getTooltipButton(BuildContext context) {
|
||||||
|
switch (this) {
|
||||||
|
case OrderListType.bulletedList:
|
||||||
|
return AppLocalizations.of(context).bulletedList;
|
||||||
|
case OrderListType.numberedList:
|
||||||
|
return AppLocalizations.of(context).numberedList;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Widget buildButtonWidget(
|
||||||
|
BuildContext context,
|
||||||
|
ImagePaths imagePaths,
|
||||||
|
Function(OrderListType type) onActionCallback
|
||||||
|
) {
|
||||||
|
return buildIconWeb(
|
||||||
|
icon: SvgPicture.asset(getIcon(imagePaths)),
|
||||||
|
iconPadding: const EdgeInsets.symmetric(vertical: 8, horizontal: 5),
|
||||||
|
minSize: 30,
|
||||||
|
iconSize: 30,
|
||||||
|
tooltip: getTooltipButton(context),
|
||||||
|
onTap: () => onActionCallback.call(this));
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
{
|
{
|
||||||
"@@last_modified": "2022-07-26T16:21:05.066657",
|
"@@last_modified": "2022-07-27T12:01:37.344258",
|
||||||
"initializing_data": "Initializing data...",
|
"initializing_data": "Initializing data...",
|
||||||
"@initializing_data": {
|
"@initializing_data": {
|
||||||
"type": "text",
|
"type": "text",
|
||||||
@@ -1729,5 +1729,23 @@
|
|||||||
"type": "text",
|
"type": "text",
|
||||||
"placeholders_order": [],
|
"placeholders_order": [],
|
||||||
"placeholders": {}
|
"placeholders": {}
|
||||||
|
},
|
||||||
|
"orderList": "Order list",
|
||||||
|
"@orderList": {
|
||||||
|
"type": "text",
|
||||||
|
"placeholders_order": [],
|
||||||
|
"placeholders": {}
|
||||||
|
},
|
||||||
|
"numberedList": "Numbered list",
|
||||||
|
"@numberedList": {
|
||||||
|
"type": "text",
|
||||||
|
"placeholders_order": [],
|
||||||
|
"placeholders": {}
|
||||||
|
},
|
||||||
|
"bulletedList": "Bulleted list",
|
||||||
|
"@bulletedList": {
|
||||||
|
"type": "text",
|
||||||
|
"placeholders_order": [],
|
||||||
|
"placeholders": {}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1773,4 +1773,22 @@ class AppLocalizations {
|
|||||||
'Indent',
|
'Indent',
|
||||||
name: 'indent');
|
name: 'indent');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
String get orderList {
|
||||||
|
return Intl.message(
|
||||||
|
'Order list',
|
||||||
|
name: 'orderList');
|
||||||
|
}
|
||||||
|
|
||||||
|
String get numberedList {
|
||||||
|
return Intl.message(
|
||||||
|
'Numbered list',
|
||||||
|
name: 'numberedList');
|
||||||
|
}
|
||||||
|
|
||||||
|
String get bulletedList {
|
||||||
|
return Intl.message(
|
||||||
|
'Bulleted list',
|
||||||
|
name: 'bulletedList');
|
||||||
|
}
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user