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.
diplomatic-quarter/lib/pages/landing/widgets/logged_slider_view.dart

223 lines
9.6 KiB
Dart

import 'package:diplomaticquarterapp/core/viewModels/dashboard_view_model.dart';
3 years ago
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
3 years ago
import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/health_calculator/carbs/carbs.dart';
3 years ago
import 'package:diplomaticquarterapp/uitl/date_uitl.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
3 years ago
import 'package:diplomaticquarterapp/uitl/utils_new.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
3 years ago
import 'package:flutter/material.dart';
3 years ago
import 'package:diplomaticquarterapp/extensions/string_extensions.dart';
3 years ago
import 'package:diplomaticquarterapp/models/slider_data.dart';
import 'package:flutter_svg/flutter_svg.dart';
3 years ago
class LoggedSliderView extends StatelessWidget {
3 years ago
ProjectViewModel projectViewModel;
3 years ago
SliderData sliderData;
DashboardViewModel model;
3 years ago
LoggedSliderView(this.projectViewModel, this.sliderData, this.model);
3 years ago
@override
Widget build(BuildContext context) {
3 years ago
//'${DateUtil.getMonthDayYearDateFormatted(sliderData.dateofBirthDataTime)} ,${model.user.gender == 1 ? TranslationBase.of(context).male : TranslationBase.of(context).female} ${model.user.age.toString() + "y"}',
3 years ago
return Card(
shape: cardRadius(20),
3 years ago
elevation: 0,
margin: EdgeInsets.all(0),
3 years ago
child: Card(
shape: cardRadius(20),
clipBehavior: Clip.antiAlias,
margin: EdgeInsets.zero,
color: sliderData.darkColor,
elevation: 0,
// padding: EdgeInsets.zero,
child: Stack(
children: [
Card(
child: Container(
width: double.infinity,
height: double.infinity,
),
color: Colors.transparent,
margin: EdgeInsets.zero,
elevation: 8,
),
Container(
width: double.infinity,
height: double.infinity,
clipBehavior: Clip.antiAlias,
margin: EdgeInsets.zero,
3 years ago
decoration: projectViewModel.isArabic
? containerBottomRightRadiusWithGradientForAr(MediaQuery.of(context).size.width / 4, darkColor: sliderData.darkColor, lightColor: sliderData.lightColor)
: containerBottomRightRadiusWithGradient(MediaQuery.of(context).size.width / 4, darkColor: sliderData.darkColor, lightColor: sliderData.lightColor),
3 years ago
child: Card(
color: Colors.transparent,
margin: EdgeInsets.zero,
elevation: 8,
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
mFlex(2),
3 years ago
Row(
children: [
Container(
3 years ago
decoration: projectViewModel.isArabic ? containerColorRadiusLeft(Color(0xFFFBF2E31), 100) : containerColorRadiusRight(Color(0xFFFBF2E31), 100),
3 years ago
padding: EdgeInsets.only(left: 20, right: 16, top: 6, bottom: 6),
child: Text(
3 years ago
TranslationBase.of(context).medicalFile,
style: TextStyle(
color: Colors.white,
fontWeight: FontWeight.bold,
fontSize: 10,
letterSpacing: -0.3,
height: 1.2,
),
3 years ago
),
),
mWidth(MediaQuery.of(context).size.width / 50),
3 years ago
//circularAviator(MediaQuery.of(context).size.width / 14, brColor: Colors.white),
3 years ago
mFlex(1),
projectViewModel.isArabic ? circularAviator(MediaQuery.of(context).size.width / 28, brColor: Colors.white, icon: Icons.done, bcColor: Colors.white) : Container(),
3 years ago
Text(
3 years ago
TranslationBase.of(context).verified,
style: TextStyle(
color: Colors.white,
fontSize: 10,
letterSpacing: -0.3,
height: 1,
),
3 years ago
),
!projectViewModel.isArabic ? circularAviator(MediaQuery.of(context).size.width / 28, brColor: Colors.white, icon: Icons.done, bcColor: Colors.white) : Container(),
3 years ago
mWidth(MediaQuery.of(context).size.width / 70),
],
),
mFlex(1),
3 years ago
Padding(
3 years ago
padding: const EdgeInsets.only(left: 20, right: 20),
3 years ago
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
3 years ago
sliderData.pateintName.toLowerCase().capitalizeFirstofEach,
3 years ago
style: TextStyle(
color: Colors.white,
fontWeight: FontWeight.bold,
fontSize: 17,
letterSpacing: -0.25,
height: 25 / 17,
3 years ago
),
),
mHeight(2),
3 years ago
Text(
sliderData.pateintId,
style: TextStyle(
color: Colors.white,
fontSize: 12,
letterSpacing: -0.36,
height: 1,
),
3 years ago
),
],
),
),
mHeight(3),
3 years ago
Padding(
padding: const EdgeInsets.only(left: 20, right: 20),
child: Text(
'${DateUtil.getMonthDayYearDateFormatted(projectViewModel.user.dateofBirthDataTime)} ,${projectViewModel.user.gender == 1 ? TranslationBase.of(context).male : TranslationBase.of(context).female} ${projectViewModel.user.age.toString() + "y"}',
style: TextStyle(
color: Colors.white,
fontSize: 12,
letterSpacing: -0.36,
height: 1,
),
3 years ago
),
),
mFlex(3),
Padding(
padding: const EdgeInsets.only(left: 20, right: 20),
child: Row(
children: <Widget>[
Expanded(
child: Row(
children: <Widget>[
SvgPicture.asset(
'assets/images/new/height.svg',
width: 12,
height: 12,
),
mWidth(6),
Texts(
"${model.heightCm} ${TranslationBase.of(context).cm}",
color: Colors.white,
fontSize: 9,
)
],
),
),
SizedBox(
width: 3,
),
Expanded(
child: Row(
children: <Widget>[
SvgPicture.asset(
'assets/images/new/weight.svg',
width: 12,
height: 12,
),
mWidth(6),
Texts('${model.weightKg} ${TranslationBase.of(context).kg}', color: Colors.white, fontSize: 9)
],
),
),
SizedBox(
width: 3,
),
Expanded(
child: Row(
children: <Widget>[
SvgPicture.asset(
'assets/images/new/blood.svg',
width: 12,
height: 12,
),
mWidth(6),
Texts('${model.booldType}', color: Colors.white, fontSize: 9)
],
),
),
],
),
),
mFlex(2),
3 years ago
],
),
),
),
3 years ago
projectViewModel.isArabic
? Positioned(
child: Icon(
Icons.arrow_forward,
color: Colors.white,
size: 20,
),
bottom: 8,
left: 8,
)
: Positioned(
child: Icon(
Icons.arrow_forward_rounded,
color: Colors.white,
size: 20,
),
bottom: 8,
right: 8,
),
3 years ago
],
),
),
);
}
}