LiveCare Call Type implemented
parent
f36fc4d88d
commit
98389e3f68
@ -0,0 +1,145 @@
|
|||||||
|
import 'package:auto_size_text/auto_size_text.dart';
|
||||||
|
import 'package:diplomaticquarterapp/config/size_config.dart';
|
||||||
|
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
|
||||||
|
import 'package:diplomaticquarterapp/theme/colors.dart';
|
||||||
|
import 'package:diplomaticquarterapp/uitl/app_toast.dart';
|
||||||
|
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
|
||||||
|
import 'package:diplomaticquarterapp/uitl/utils.dart';
|
||||||
|
import 'package:diplomaticquarterapp/uitl/utils_new.dart';
|
||||||
|
import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart';
|
||||||
|
import 'package:diplomaticquarterapp/widgets/data_display/medical/medical_profile_item.dart';
|
||||||
|
import 'package:diplomaticquarterapp/widgets/mobile-no/mobile_no.dart';
|
||||||
|
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
|
||||||
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:provider/provider.dart';
|
||||||
|
|
||||||
|
class LiveCareCallTypeSelectPage extends StatefulWidget {
|
||||||
|
Function onSelectedMethod;
|
||||||
|
|
||||||
|
LiveCareCallTypeSelectPage({required this.onSelectedMethod});
|
||||||
|
|
||||||
|
@override
|
||||||
|
State<LiveCareCallTypeSelectPage> createState() => _LiveCareCallTypeSelectPageState();
|
||||||
|
}
|
||||||
|
|
||||||
|
class _LiveCareCallTypeSelectPageState extends State<LiveCareCallTypeSelectPage> {
|
||||||
|
int selectedCallType = 1;
|
||||||
|
String mobileNo = "";
|
||||||
|
String countryCode = '966';
|
||||||
|
late ProjectViewModel projectViewModel;
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
projectViewModel = Provider.of<ProjectViewModel>(context);
|
||||||
|
mobileNo = Utils.getPhoneNumberWithoutZero(projectViewModel.authenticatedUserObject.user.mobileNumber!);
|
||||||
|
return AppScaffold(
|
||||||
|
appBarTitle: TranslationBase.of(context).selectCallType,
|
||||||
|
isShowAppBar: true,
|
||||||
|
showNewAppBar: true,
|
||||||
|
showNewAppBarTitle: true,
|
||||||
|
backgroundColor: CustomColors.appBackgroudGrey2Color,
|
||||||
|
body: Padding(
|
||||||
|
padding: EdgeInsets.all(21),
|
||||||
|
child: Column(
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
|
children: [
|
||||||
|
GridView(
|
||||||
|
gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(crossAxisCount: 3, childAspectRatio: 2 / 2, crossAxisSpacing: 12, mainAxisSpacing: 12),
|
||||||
|
physics: NeverScrollableScrollPhysics(),
|
||||||
|
shrinkWrap: true,
|
||||||
|
children: [
|
||||||
|
InkWell(
|
||||||
|
onTap: () {
|
||||||
|
setState(() {
|
||||||
|
selectedCallType = 1;
|
||||||
|
});
|
||||||
|
},
|
||||||
|
child: MedicalProfileItem(
|
||||||
|
title: TranslationBase.of(context).videoCall,
|
||||||
|
imagePath: 'video_call.svg',
|
||||||
|
subTitle: "",
|
||||||
|
isPngImage: false,
|
||||||
|
isShowBorder: selectedCallType == 1,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
InkWell(
|
||||||
|
onTap: () {
|
||||||
|
setState(() {
|
||||||
|
selectedCallType = 2;
|
||||||
|
});
|
||||||
|
},
|
||||||
|
child: MedicalProfileItem(
|
||||||
|
title: TranslationBase.of(context).audioCall,
|
||||||
|
imagePath: 'audio_call.svg',
|
||||||
|
subTitle: "",
|
||||||
|
isPngImage: false,
|
||||||
|
isShowBorder: selectedCallType == 2,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
InkWell(
|
||||||
|
onTap: () {
|
||||||
|
setState(() {
|
||||||
|
selectedCallType = 3;
|
||||||
|
});
|
||||||
|
},
|
||||||
|
child: MedicalProfileItem(
|
||||||
|
title: TranslationBase.of(context).phoneCall,
|
||||||
|
imagePath: 'phone_call.svg',
|
||||||
|
subTitle: "",
|
||||||
|
isPngImage: false,
|
||||||
|
isShowBorder: selectedCallType == 3,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
if (selectedCallType == 3)
|
||||||
|
Column(
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
|
children: [
|
||||||
|
mHeight(32.0),
|
||||||
|
AutoSizeText(
|
||||||
|
TranslationBase.of(context).mobileNumber,
|
||||||
|
maxLines: 1,
|
||||||
|
minFontSize: 12,
|
||||||
|
style: TextStyle(
|
||||||
|
fontSize: SizeConfig.textMultiplier! * 2.0,
|
||||||
|
fontWeight: FontWeight.w600,
|
||||||
|
letterSpacing: -0.39,
|
||||||
|
height: 0.8,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
mHeight(16.0),
|
||||||
|
PhoneNumberSelectorWidget(
|
||||||
|
onNumberChange: (value) => {
|
||||||
|
mobileNo = value,
|
||||||
|
},
|
||||||
|
onCountryChange: (value) => {
|
||||||
|
countryCode = value,
|
||||||
|
},
|
||||||
|
mobileNo: this.mobileNo,
|
||||||
|
isLiveCareTypeSelect: true,
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
bottomSheet: Container(
|
||||||
|
color: CustomColors.white,
|
||||||
|
padding: EdgeInsets.fromLTRB(12.0, 1.0, 12.0, 25.0),
|
||||||
|
child: DefaultButton(
|
||||||
|
TranslationBase.of(context).next,
|
||||||
|
() {
|
||||||
|
if (mobileNo.isNotEmpty) {
|
||||||
|
widget.onSelectedMethod(selectedCallType, mobileNo);
|
||||||
|
Navigator.pop(context, [selectedCallType, mobileNo]);
|
||||||
|
} else {
|
||||||
|
AppToast.showErrorToast(message: TranslationBase.of(context).enterMobileNumber);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
color: CustomColors.accentColor,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
Loading…
Reference in New Issue