TF-801 Show notification message when vacation enabled
This commit is contained in:
+37
@@ -0,0 +1,37 @@
|
||||
|
||||
import 'package:core/core.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class VacationInputDecorationBuilder extends InputDecorationBuilder {
|
||||
|
||||
@override
|
||||
InputDecoration build() {
|
||||
return InputDecoration(
|
||||
enabledBorder: enabledBorder ?? const OutlineInputBorder(
|
||||
borderRadius: BorderRadius.all(Radius.circular(10)),
|
||||
borderSide: BorderSide(width: 1, color: AppColor.colorInputBorderCreateMailbox)),
|
||||
focusedBorder: enabledBorder ?? const OutlineInputBorder(
|
||||
borderRadius: BorderRadius.all(Radius.circular(10)),
|
||||
borderSide: BorderSide(width: 1, color: AppColor.colorTextButton)),
|
||||
errorBorder: errorBorder ?? const OutlineInputBorder(
|
||||
borderRadius: BorderRadius.all(Radius.circular(10)),
|
||||
borderSide: BorderSide(width: 1, color: AppColor.colorInputBorderErrorVerifyName)),
|
||||
focusedErrorBorder: errorBorder ?? const OutlineInputBorder(
|
||||
borderRadius: BorderRadius.all(Radius.circular(10)),
|
||||
borderSide: BorderSide(width: 1, color: AppColor.colorInputBorderErrorVerifyName)),
|
||||
prefixText: prefixText,
|
||||
labelText: labelText,
|
||||
floatingLabelBehavior: FloatingLabelBehavior.never,
|
||||
labelStyle: labelStyle ?? const TextStyle(color: Colors.black, fontSize: 16),
|
||||
hintText: hintText,
|
||||
isDense: true,
|
||||
hintStyle: hintStyle ?? const TextStyle(color: AppColor.colorHintInputCreateMailbox, fontSize: 16),
|
||||
contentPadding: contentPadding ?? const EdgeInsets.symmetric(horizontal: 12, vertical: 12),
|
||||
errorText: errorText,
|
||||
errorStyle: errorTextStyle ?? const TextStyle(color: AppColor.colorInputBorderErrorVerifyName, fontSize: 13),
|
||||
filled: true,
|
||||
fillColor: errorText?.isNotEmpty == true
|
||||
? AppColor.colorInputBackgroundErrorVerifyName
|
||||
: Colors.white);
|
||||
}
|
||||
}
|
||||
+59
@@ -0,0 +1,59 @@
|
||||
|
||||
import 'package:core/core.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:jmap_dart_client/jmap/mail/vacation/vacation_response.dart';
|
||||
import 'package:tmail_ui_user/main/localizations/app_localizations.dart';
|
||||
|
||||
typedef DisableVacationResponderAction = Function();
|
||||
|
||||
class VacationNotificationMessageWidget extends StatelessWidget {
|
||||
|
||||
final VacationResponse vacationResponse;
|
||||
final DisableVacationResponderAction? action;
|
||||
final EdgeInsets? margin;
|
||||
final EdgeInsets? padding;
|
||||
final double? radius;
|
||||
|
||||
const VacationNotificationMessageWidget({
|
||||
super.key,
|
||||
required this.vacationResponse,
|
||||
this.action,
|
||||
this.radius,
|
||||
this.margin,
|
||||
this.padding,
|
||||
});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Container(
|
||||
width: double.infinity,
|
||||
margin: margin ?? const EdgeInsets.symmetric(horizontal: 16),
|
||||
padding: padding ?? const EdgeInsets.only(top: 5, bottom: 5, left: 16),
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.circular(radius ?? 5),
|
||||
color: AppColor.colorVacationNotificationMessageBackground,
|
||||
),
|
||||
child: Row(children: [
|
||||
Expanded(
|
||||
child: Text(
|
||||
AppLocalizations.of(context).yourVacationResponderIsEnabled,
|
||||
style: const TextStyle(
|
||||
color: Colors.black,
|
||||
fontSize: 16,
|
||||
fontWeight: FontWeight.bold,
|
||||
))),
|
||||
buildTextButton(
|
||||
AppLocalizations.of(context).disable.allInCaps,
|
||||
textStyle: const TextStyle(
|
||||
fontWeight: FontWeight.w500,
|
||||
fontSize: 16,
|
||||
color: AppColor.colorTextButton),
|
||||
backgroundColor: Colors.transparent,
|
||||
width: 128,
|
||||
height: 44,
|
||||
radius: 10,
|
||||
onTap: () => action?.call())
|
||||
]),
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user