You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
HMG_Patient_App_New/lib/presentation/home/widgets/welcome_widget.dart

52 lines
1.7 KiB
Dart

import 'package:flutter/material.dart';
import 'package:hmg_patient_app_new/core/app_assets.dart';
import 'package:hmg_patient_app_new/core/utils/size_utils.dart';
import 'package:hmg_patient_app_new/core/utils/utils.dart';
import 'package:hmg_patient_app_new/extensions/string_extensions.dart';
import 'package:hmg_patient_app_new/extensions/widget_extensions.dart';
import 'package:hmg_patient_app_new/theme/colors.dart';
class WelcomeWidget extends StatelessWidget {
final String name;
final String imageUrl;
final VoidCallback? onTap;
const WelcomeWidget({
super.key,
required this.name,
required this.imageUrl,
this.onTap,
});
@override
Widget build(BuildContext context) {
return InkWell(
onTap: onTap,
borderRadius: BorderRadius.circular(30),
child: Row(
mainAxisSize: MainAxisSize.min,
spacing: 8.h,
children: [
Image.asset(imageUrl, width: 40, height: 40),
Column(
crossAxisAlignment: CrossAxisAlignment.start,
spacing: 4.h,
mainAxisSize: MainAxisSize.min,
children: [
"Welcome".needTranslation.toText14(color: AppColors.greyTextColor, height: 1, weight: FontWeight.w500),
Row(
spacing: 4.h,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
name.toText16(weight: FontWeight.w500, textOverflow: TextOverflow.ellipsis, maxlines: 1, height: 1).expanded,
const Icon(Icons.keyboard_arrow_down, size: 20, color: Colors.black),
],
),
],
).expanded,
],
),
);
}
}