|
|
|
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
|
|
|
|
import 'package:diplomaticquarterapp/models/Appointments/toDoCountProviderModel.dart';
|
|
|
|
import 'package:diplomaticquarterapp/pages/ContactUs/LiveChat/livechat_page.dart';
|
|
|
|
import 'package:diplomaticquarterapp/pages/ContactUs/findus/findus_page.dart';
|
|
|
|
import 'package:diplomaticquarterapp/pages/ToDoList/ToDo.dart';
|
|
|
|
import 'package:diplomaticquarterapp/pages/feedback/feedback_home_page.dart';
|
|
|
|
import 'package:diplomaticquarterapp/pages/medical/balance/advance_payment_page.dart';
|
|
|
|
import 'package:diplomaticquarterapp/pages/medical/balance/my_balance_page.dart';
|
|
|
|
import 'package:diplomaticquarterapp/pages/medical/my_trackers/Weight/WeightHomePage.dart';
|
|
|
|
import 'package:diplomaticquarterapp/pages/medical/my_trackers/blood_pressure/BloodPressureHomePage.dart';
|
|
|
|
import 'package:diplomaticquarterapp/pages/medical/my_trackers/blood_suger/blood_sugar_home_page.dart';
|
|
|
|
import 'package:diplomaticquarterapp/uitl/app_toast.dart';
|
|
|
|
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
|
|
|
|
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
|
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
|
|
|
|
class CardCommonContact extends StatelessWidget {
|
|
|
|
final image;
|
|
|
|
final text;
|
|
|
|
final subText;
|
|
|
|
final type;
|
|
|
|
final width;
|
|
|
|
final height;
|
|
|
|
final ProjectViewModel projectViewModel;
|
|
|
|
final ToDoCountProviderModel model;
|
|
|
|
|
|
|
|
const CardCommonContact({@required this.image, @required this.text, @required this.subText, @required this.type, this.width, this.height, this.projectViewModel, this.model});
|
|
|
|
|
|
|
|
@override
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
// ProjectViewModel projectViewModel = Provider.of(context);
|
|
|
|
// ToDoCountProviderModel model = Provider.of<ToDoCountProviderModel>(context);
|
|
|
|
return GestureDetector(
|
|
|
|
onTap: () {
|
|
|
|
navigateToSearch(context, this.type);
|
|
|
|
},
|
|
|
|
child: Container(
|
|
|
|
padding: EdgeInsets.only(left: 20, right: 20, bottom: 15, top: 28),
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
borderRadius: BorderRadius.circular(15),
|
|
|
|
color: Colors.white,
|
|
|
|
border: Border.all(
|
|
|
|
color: Color(0xffefefef),
|
|
|
|
width: 1,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
child: Column(
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
|
|
children: <Widget>[
|
|
|
|
Image.asset(
|
|
|
|
this.image,
|
|
|
|
width: width != null ? width : 42.0,
|
|
|
|
height: height != null ? height : 42.0,
|
|
|
|
),
|
|
|
|
Text(
|
|
|
|
text + "${subText.isEmpty ? "" : "\n$subText"}",
|
|
|
|
style: TextStyle(fontSize: 16, fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.48, height: 20 / 16),
|
|
|
|
),
|
|
|
|
],
|
|
|
|
),
|
|
|
|
),
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
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) {
|
|
|
|
Navigator.push(context, FadePage(page: LiveChatPage()));
|
|
|
|
} else if (type == 3) {
|
|
|
|
Navigator.push(context, FadePage(page: BloodSugarHomePage()));
|
|
|
|
} else if (type == 4) {
|
|
|
|
Navigator.push(context, FadePage(page: BloodPressureHomePage()));
|
|
|
|
} else if (type == 5) {
|
|
|
|
Navigator.push(context, FadePage(page: WeightHomePage()));
|
|
|
|
} else if (type == 6) {
|
|
|
|
Navigator.push(context, FadePage(page: AdvancePaymentPage()));
|
|
|
|
} else if (type == 7) {
|
|
|
|
navigateToToDoPage(context);
|
|
|
|
} else if (type == 8) {
|
|
|
|
Navigator.push(context, FadePage(page: MyBalancePage()));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
navigateToToDoPage(BuildContext context) {
|
|
|
|
if (projectViewModel.isLogin) {
|
|
|
|
if (model.count != 0) {
|
|
|
|
Navigator.push(context, FadePage(page: ToDo(isShowAppBar: true)));
|
|
|
|
} else {
|
|
|
|
AppToast.showErrorToast(message: TranslationBase.of(context).upcomingEmpty);
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
Navigator.push(context, FadePage(page: ToDo(isShowAppBar: true)));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|