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/lib/pages/ContactUs/widgets/card_common_contat.dart

147 lines
5.7 KiB
Dart

import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/pages/ContactUs/LiveChat/livechat_page.dart';
import 'package:diplomaticquarterapp/pages/ContactUs/findus/findus_page.dart';
import 'package:diplomaticquarterapp/pages/feedback/feedback_home_page.dart';
import 'package:diplomaticquarterapp/widgets/data_display/medical/medical_profile_item.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
import '../../../Constants.dart';
class CardCommonContact extends StatelessWidget {
final image;
final text;
final subText;
final type;
const CardCommonContact({@required this.image, @required this.text, @required this.subText, @required this.type});
@override
Widget build(BuildContext context) {
ProjectViewModel projectViewModel = Provider.of(context);
return GestureDetector(
onTap: () {
navigateToSearch(context, this.type);
},
child:
// Container(
// // height: double.infinity,
// // width: double.infinity,
// // margin: EdgeInsets.all(0),
// decoration: BoxDecoration(
// borderRadius: BorderRadius.all(
// Radius.circular(10.0),
// ),
// boxShadow: [
// BoxShadow(
// color: Color(0xff000000).withOpacity(.05),
// //spreadRadius: 5,
// blurRadius: 27,
// offset: Offset(0, -3),
// ),
// ],
// color: Colors.white),
// clipBehavior: Clip.antiAlias,
// child: Stack(
// children: [
// Padding(
// padding: EdgeInsets.all(10),
// child: Column(
// crossAxisAlignment: CrossAxisAlignment.start,
// children: <Widget>[
// // Align(
// // alignment: projectViewModel.isArabic ? Alignment.bottomLeft : Alignment.bottomRight,
// // child: Image.asset(
// // "assets/images/medical/$imagePath",
// // height: SizeConfig.heightMultiplier * 5,
// // width: SizeConfig.heightMultiplier * 5,
// // ),
// // ),
// Image.asset(
// image,
// // height: SizeConfig.widthMultiplier * 7,
// // width: SizeConfig.widthMultiplier * 7,
// // color: imgColor,
// ),
//
// Text(
// text,
// maxLines: 1,
// style: TextStyle(
// // fontSize: SizeConfig.textMultiplier * 1.4,
// fontWeight: FontWeight.w600,
// letterSpacing: -0.3,
// height: 13 / 10,
// ),
// ),
// Container(
// width: double.infinity,
// child: Row(
// children: [
// Expanded(
// child: Text(
// subText,
// maxLines: 1,
// style: TextStyle(
// // fontSize: SizeConfig.textMultiplier * 1.4,
// fontWeight: FontWeight.w600,
// letterSpacing: -0.3,
// height: 1,
// ),
// ),
// ),
// ],
// ),
// ),
// ],
// ),
// ),
// ],
// ),
// )
Container(
margin: EdgeInsets.fromLTRB(9.0, 9.0, 9.0, 9.0),
decoration: BoxDecoration(boxShadow: [BoxShadow(color: Colors.grey[400], blurRadius: 2.0, spreadRadius: 0.0)], borderRadius: BorderRadius.circular(10), color: Colors.white),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Container(
margin: EdgeInsets.fromLTRB(10.0, 10.0, 10.0, 0.0),
child: Texts(this.text,
// overflow: TextOverflow.clip,
color: secondaryColor,
fontWeight: FontWeight.w700,
fontSize: 20.0),
),
Container(
margin: EdgeInsets.fromLTRB(10.0, 0.0, 10.0, 0.0),
child: Texts(this.subText, color: Colors.black, fontSize: 15.0),
),
Align(
alignment: projectViewModel.isArabic ? Alignment.bottomLeft : Alignment.bottomRight,
child: Container(
margin: EdgeInsets.fromLTRB(10.0, 0.0, 10.0, 8.0),
child: Image.asset(this.image, width: 60.0, height: 60.0),
),
),
],
),
),
);
}
Future navigateToSearch(context, type) async {
if (type == 0) {
Navigator.push(context, FadePage(page: FindUsPage()));
} else if (type == 1) {
Navigator.push(context, FadePage(page: FeedbackHomePage()));
} else if (type == 2) {
//LiveChatPage
Navigator.push(context, FadePage(page: LiveChatPage()));
}
}
}