feat(upload): enhance PDF upload banners with title and description
This commit is contained in:
@@ -1166,6 +1166,8 @@
|
|||||||
"upload": {
|
"upload": {
|
||||||
"instructions": "Please select a valid PDF file to upload.",
|
"instructions": "Please select a valid PDF file to upload.",
|
||||||
"pdf_banner": "Only PDF files are accepted. Maximum file size is 10MB.",
|
"pdf_banner": "Only PDF files are accepted. Maximum file size is 10MB.",
|
||||||
|
"pdf_banner_title": "PDF files only",
|
||||||
|
"pdf_banner_description": "Upload a PDF document up to 10MB in size.",
|
||||||
"file_not_found": "File not found.",
|
"file_not_found": "File not found.",
|
||||||
"submit": "Submit Document",
|
"submit": "Submit Document",
|
||||||
"select_pdf": "Select PDF File",
|
"select_pdf": "Select PDF File",
|
||||||
|
|||||||
@@ -1161,6 +1161,8 @@
|
|||||||
"upload": {
|
"upload": {
|
||||||
"instructions": "Por favor selecciona un archivo PDF válido para subir.",
|
"instructions": "Por favor selecciona un archivo PDF válido para subir.",
|
||||||
"pdf_banner": "Solo se aceptan archivos PDF. Tamaño máximo del archivo: 10MB.",
|
"pdf_banner": "Solo se aceptan archivos PDF. Tamaño máximo del archivo: 10MB.",
|
||||||
|
"pdf_banner_title": "Solo archivos PDF",
|
||||||
|
"pdf_banner_description": "Sube un documento PDF de hasta 10MB de tamaño.",
|
||||||
"submit": "Enviar Documento",
|
"submit": "Enviar Documento",
|
||||||
"select_pdf": "Seleccionar Archivo PDF",
|
"select_pdf": "Seleccionar Archivo PDF",
|
||||||
"attestation": "Certifico que este documento es genuino y válido.",
|
"attestation": "Certifico que este documento es genuino y válido.",
|
||||||
|
|||||||
@@ -84,6 +84,7 @@ class UiNoticeBanner extends StatelessWidget {
|
|||||||
style: UiTypography.body2b.copyWith(
|
style: UiTypography.body2b.copyWith(
|
||||||
color: titleColor ?? UiColors.primary,
|
color: titleColor ?? UiColors.primary,
|
||||||
),
|
),
|
||||||
|
overflow: TextOverflow.ellipsis,
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
|
|||||||
@@ -186,7 +186,8 @@ class _CertificateUploadPageState extends State<CertificateUploadPage> {
|
|||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
children: <Widget>[
|
children: <Widget>[
|
||||||
PdfFileTypesBanner(
|
PdfFileTypesBanner(
|
||||||
message: t.staff_documents.upload.pdf_banner,
|
title: t.staff_documents.upload.pdf_banner_title,
|
||||||
|
description: t.staff_documents.upload.pdf_banner_description,
|
||||||
),
|
),
|
||||||
const SizedBox(height: UiConstants.space6),
|
const SizedBox(height: UiConstants.space6),
|
||||||
|
|
||||||
|
|||||||
@@ -3,12 +3,24 @@ import 'package:flutter/material.dart';
|
|||||||
|
|
||||||
/// Banner displaying accepted file types and size limit for PDF upload.
|
/// Banner displaying accepted file types and size limit for PDF upload.
|
||||||
class PdfFileTypesBanner extends StatelessWidget {
|
class PdfFileTypesBanner extends StatelessWidget {
|
||||||
const PdfFileTypesBanner({super.key, required this.message});
|
const PdfFileTypesBanner({
|
||||||
|
super.key,
|
||||||
|
required this.title,
|
||||||
|
this.description,
|
||||||
|
});
|
||||||
|
|
||||||
final String message;
|
/// Short title for the banner.
|
||||||
|
final String title;
|
||||||
|
|
||||||
|
/// Optional description with additional details.
|
||||||
|
final String? description;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return UiNoticeBanner(title: message, icon: UiIcons.info);
|
return UiNoticeBanner(
|
||||||
|
title: title,
|
||||||
|
description: description,
|
||||||
|
icon: UiIcons.info,
|
||||||
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -70,7 +70,8 @@ class DocumentUploadPage extends StatelessWidget {
|
|||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
children: <Widget>[
|
children: <Widget>[
|
||||||
PdfFileTypesBanner(
|
PdfFileTypesBanner(
|
||||||
message: t.staff_documents.upload.pdf_banner,
|
title: t.staff_documents.upload.pdf_banner_title,
|
||||||
|
description: t.staff_documents.upload.pdf_banner_description,
|
||||||
),
|
),
|
||||||
const SizedBox(height: UiConstants.space6),
|
const SizedBox(height: UiConstants.space6),
|
||||||
DocumentFileSelector(
|
DocumentFileSelector(
|
||||||
|
|||||||
@@ -3,12 +3,24 @@ import 'package:flutter/material.dart';
|
|||||||
|
|
||||||
/// Banner displaying accepted file types and size limit for PDF upload.
|
/// Banner displaying accepted file types and size limit for PDF upload.
|
||||||
class PdfFileTypesBanner extends StatelessWidget {
|
class PdfFileTypesBanner extends StatelessWidget {
|
||||||
const PdfFileTypesBanner({required this.message, super.key});
|
const PdfFileTypesBanner({
|
||||||
|
super.key,
|
||||||
|
required this.title,
|
||||||
|
this.description,
|
||||||
|
});
|
||||||
|
|
||||||
final String message;
|
/// Short title for the banner.
|
||||||
|
final String title;
|
||||||
|
|
||||||
|
/// Optional description with additional details.
|
||||||
|
final String? description;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return UiNoticeBanner(title: message, icon: UiIcons.info);
|
return UiNoticeBanner(
|
||||||
|
title: title,
|
||||||
|
description: description,
|
||||||
|
icon: UiIcons.info,
|
||||||
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user