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.
71 lines
2.9 KiB
Dart
71 lines
2.9 KiB
Dart
import 'package:easy_localization/easy_localization.dart';
|
|
import 'package:flutter/material.dart';
|
|
import 'package:hmg_patient_app_new/core/app_assets.dart';
|
|
import 'package:hmg_patient_app_new/core/dependencies.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/features/insurance/insurance_view_model.dart';
|
|
import 'package:hmg_patient_app_new/generated/locale_keys.g.dart';
|
|
import 'package:hmg_patient_app_new/presentation/insurance/insurance_home_page.dart';
|
|
import 'package:hmg_patient_app_new/presentation/profile_settings/profile_settings.dart';
|
|
import 'package:hmg_patient_app_new/theme/colors.dart';
|
|
import 'package:hmg_patient_app_new/widgets/buttons/custom_button.dart';
|
|
import 'package:hmg_patient_app_new/widgets/routes/custom_page_route.dart';
|
|
import 'package:hmg_patient_app_new/widgets/routes/spring_page_route_builder.dart';
|
|
import 'package:smooth_corner/smooth_corner.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 Column(
|
|
children: [
|
|
InkWell(
|
|
onTap: onTap,
|
|
borderRadius: BorderRadius.circular(30),
|
|
child: Row(
|
|
mainAxisSize: MainAxisSize.min,
|
|
spacing: 8.h,
|
|
children: [
|
|
Icon(Icons.menu, color: AppColors.textColor).onPress(() {
|
|
Navigator.of(context).push(springPageRoute(ProfileSettings()));
|
|
}),
|
|
Image.asset(imageUrl, width: 40, height: 40),
|
|
Column(
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
spacing: 4.h,
|
|
mainAxisSize: MainAxisSize.min,
|
|
children: [
|
|
LocaleKeys.welcome.tr(context: context).toText14(color: AppColors.greyTextColor, height: 1, weight: FontWeight.w500),
|
|
Row(
|
|
spacing: 4.h,
|
|
crossAxisAlignment: CrossAxisAlignment.center,
|
|
mainAxisSize: MainAxisSize.min,
|
|
children: [
|
|
Flexible(child: name.toText16(weight: FontWeight.w500, textOverflow: TextOverflow.ellipsis, maxlines: 1, height: 1, isEnglishOnly: true)),
|
|
// Icon(Icons.keyboard_arrow_down, size: 20, color: AppColors.greyTextColor),
|
|
Utils.buildSvgWithAssets(icon: AppAssets.arrowRight, height: 22.h, width: 22.w)
|
|
],
|
|
),
|
|
],
|
|
).expanded,
|
|
],
|
|
),
|
|
),
|
|
],
|
|
);
|
|
}
|
|
}
|