voice command

merge-requests/140/head
Sultan Khan 4 years ago
parent 7742313923
commit 188b72bb90

@ -76,9 +76,11 @@ class _LandingPageState extends State<LandingPage> with WidgetsBindingObserver {
LocationUtils locationUtils; LocationUtils locationUtils;
_changeCurrentTab(int tab) { _changeCurrentTab(int tab) {
setState(() { setState(() {
currentTab = tab; currentTab = tab;
if (tab != 0)
pageController.jumpToPage(tab); pageController.jumpToPage(tab);
else
this.triggerRobot();
}); });
} }
@ -431,7 +433,7 @@ class _LandingPageState extends State<LandingPage> with WidgetsBindingObserver {
children: [ children: [
HomePage( HomePage(
goToMyProfile: () { goToMyProfile: () {
// _changeCurrentTab(1); // _changeCurrentTab(1);
}, },
), ),
MedicalProfilePage(), MedicalProfilePage(),
@ -445,13 +447,14 @@ class _LandingPageState extends State<LandingPage> with WidgetsBindingObserver {
index: currentTab, index: currentTab,
), ),
floatingActionButtonLocation: FloatingActionButtonLocation.centerDocked, floatingActionButtonLocation: FloatingActionButtonLocation.centerDocked,
floatingActionButton: (projectViewModel.havePrivilege(34) && currentTab == 0) floatingActionButton:
? FloatingButton( (projectViewModel.havePrivilege(34) && currentTab == 0)
elevation: true, ? FloatingButton(
onTap: () { elevation: true,
_changeCurrentTab(2); onTap: () {
}) _changeCurrentTab(2);
: null); })
: null);
} }
triggerRobot() { triggerRobot() {

@ -48,15 +48,19 @@ class MedicalProfilePage extends StatefulWidget {
class _MedicalProfilePageState extends State<MedicalProfilePage> { class _MedicalProfilePageState extends State<MedicalProfilePage> {
var authProvider = new AuthProvider(); var authProvider = new AuthProvider();
List<Medical> medical=List(); List<Medical> medical = List();
ProjectViewModel projectViewModel; ProjectViewModel projectViewModel;
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
projectViewModel = Provider.of(context); projectViewModel = Provider.of(context);
var appoCountProvider = Provider.of<ToDoCountProviderModel>(context); var appoCountProvider = Provider.of<ToDoCountProviderModel>(context);
List<Widget> myMedicalList = Utils.myMedicalList(projectViewModel: projectViewModel,context: context,count: appoCountProvider.count,isLogin: projectViewModel.isLogin); List<Widget> myMedicalList = Utils.myMedicalList(
return BaseView<MedicalViewModel>( projectViewModel: projectViewModel,
context: context,
count: appoCountProvider.count,
isLogin: projectViewModel.isLogin);
return BaseView<MedicalViewModel>(
onModelReady: (model) => model.getAppointmentHistory(), onModelReady: (model) => model.getAppointmentHistory(),
builder: (_, model, widget) => AppScaffold( builder: (_, model, widget) => AppScaffold(
isShowDecPage: false, isShowDecPage: false,
@ -96,20 +100,25 @@ class _MedicalProfilePageState extends State<MedicalProfilePage> {
], ],
), ),
), ),
SizedBox(height: 50,), SizedBox(
height: 50,
),
Padding( Padding(
padding: EdgeInsets.symmetric(vertical: 5.0), padding: EdgeInsets.symmetric(vertical: 5.0),
child: GridView.builder( child: GridView.builder(
shrinkWrap: true, shrinkWrap: true,
primary: false, primary: false,
physics: NeverScrollableScrollPhysics(), physics: NeverScrollableScrollPhysics(),
gridDelegate: SliverGridDelegateWithFixedCrossAxisCount( gridDelegate:
SliverGridDelegateWithFixedCrossAxisCount(
crossAxisCount: 3, crossAxisCount: 3,
childAspectRatio: MediaQuery.of(context).size.width / (MediaQuery.of(context).size.height / 2.40), childAspectRatio: MediaQuery.of(context)
.size
.width /
(MediaQuery.of(context).size.height / 2.40),
), ),
itemCount: myMedicalList.length, itemCount: myMedicalList.length,
itemBuilder: (BuildContext context, int index) { itemBuilder: (BuildContext context, int index) {
return myMedicalList[index]; return myMedicalList[index];
}, },
), ),
@ -117,8 +126,7 @@ class _MedicalProfilePageState extends State<MedicalProfilePage> {
], ],
), ),
SizedBox( SizedBox(
height: height: MediaQuery.of(context).size.height * 0.12,
MediaQuery.of(context).size.height * 0.12,
), ),
if (model.user != null && model.isLogin) if (model.user != null && model.isLogin)
Positioned( Positioned(
@ -182,19 +190,16 @@ class _MedicalProfilePageState extends State<MedicalProfilePage> {
); );
} }
fullMedicalData(){ fullMedicalData() {
if(projectViewModel.havePrivilege(5)) if (projectViewModel.havePrivilege(5)) {}
{}
} }
} }
class Medical{ class Medical {
final String title;
final String title; final String imagePath;
final String imagePath; final String subTitle;
final String subTitle; final Widget page;
final Widget page;
Medical({this.title, this.imagePath, this.subTitle, this.page});
Medical({this.title, this.imagePath, this.subTitle, this.page});
} }

@ -93,7 +93,7 @@ class _BottomNavBarState extends State<BottomNavBar> {
currentIndex: 4, currentIndex: 4,
name: TranslationBase.of(context).todoList, name: TranslationBase.of(context).todoList,
), ),
if (widget.index == 0 && projectViewModel.havePrivilege(77)) if (projectViewModel.havePrivilege(77))
BottomNavigationItem( BottomNavigationItem(
icon: DQIcons.roboticon, icon: DQIcons.roboticon,
activeIcon: DQIcons.roboticon, activeIcon: DQIcons.roboticon,

Loading…
Cancel
Save