49 lines
1.3 KiB
Dart
49 lines
1.3 KiB
Dart
import 'package:flutter/material.dart';
|
|
import 'package:remever/common/resources.dart';
|
|
import 'package:remever/common/widgets/typography.dart';
|
|
import 'package:remever/components/extensions/context.dart';
|
|
|
|
class CrudCollectionField extends StatelessWidget {
|
|
const CrudCollectionField({
|
|
super.key,
|
|
this.height = 90,
|
|
this.width = 100,
|
|
this.onTap,
|
|
this.hint = 'Hint',
|
|
this.content,
|
|
});
|
|
|
|
final double height;
|
|
final double width;
|
|
final void Function()? onTap;
|
|
final String hint;
|
|
final String? content;
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return GestureDetector(
|
|
onTap: onTap,
|
|
child: Container(
|
|
height: height.h,
|
|
width: width.w,
|
|
decoration: BoxDecoration(
|
|
color: AppColors.white,
|
|
borderRadius: const BorderRadius.all(Radius.circular(8)).r,
|
|
),
|
|
child: Padding(
|
|
padding: const EdgeInsets.all(12).r,
|
|
child:
|
|
content != null && content!.isNotEmpty
|
|
? AppTypography(content!, maxLines: 99, type: Regular16px())
|
|
: AppTypography(
|
|
hint,
|
|
maxLines: 99,
|
|
type: Regular14px(),
|
|
color: AppColors.disabled,
|
|
),
|
|
),
|
|
),
|
|
);
|
|
}
|
|
}
|