feat: Update file selector and PDF types banner to use super.key for improved widget initialization
This commit is contained in:
@@ -5,6 +5,7 @@ import 'package:core_localization/core_localization.dart';
|
|||||||
/// Widget for selecting certificate file.
|
/// Widget for selecting certificate file.
|
||||||
class FileSelector extends StatelessWidget {
|
class FileSelector extends StatelessWidget {
|
||||||
const FileSelector({
|
const FileSelector({
|
||||||
|
super.key,
|
||||||
required this.selectedFilePath,
|
required this.selectedFilePath,
|
||||||
required this.onTap,
|
required this.onTap,
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -3,33 +3,12 @@ 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});
|
const PdfFileTypesBanner({super.key, required this.message});
|
||||||
|
|
||||||
final String message;
|
final String message;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return Container(
|
return UiNoticeBanner(title: message, icon: UiIcons.info);
|
||||||
width: double.infinity,
|
|
||||||
padding: const EdgeInsets.symmetric(
|
|
||||||
horizontal: UiConstants.space4,
|
|
||||||
vertical: UiConstants.space3,
|
|
||||||
),
|
|
||||||
decoration: BoxDecoration(
|
|
||||||
color: UiColors.primaryForeground,
|
|
||||||
borderRadius: BorderRadius.circular(UiConstants.radiusBase),
|
|
||||||
border: Border.all(color: UiColors.primary.withValues(alpha: 0.3)),
|
|
||||||
),
|
|
||||||
child: Row(
|
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
|
||||||
children: <Widget>[
|
|
||||||
const Icon(UiIcons.info, size: 20, color: UiColors.primary),
|
|
||||||
const SizedBox(width: UiConstants.space3),
|
|
||||||
Expanded(
|
|
||||||
child: Text(message, style: UiTypography.body2r.textSecondary),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user