voice command updated

merge-update-with-lab-changes
Sultan Khan 5 years ago
parent 83ac5b7031
commit 496163a61a

File diff suppressed because one or more lines are too long

@ -1,43 +0,0 @@
/// Flutter icons DQIcons
/// Copyright (C) 2020 by original authors @ fluttericon.com, fontello.com
/// This font was generated by FlutterIcon.com, which is derived from Fontello.
///
/// To use this font, place it in your fonts/ directory and include the
/// following in your pubspec.yaml
///
/// flutter:
/// fonts:
/// - family: DQIcons
/// fonts:
/// - asset: fonts/DQIcons.ttf
///
///
///
import 'package:flutter/widgets.dart';
class DQIcons {
DQIcons._();
static const _kFontFam = 'DQIcons';
static const _kFontPkg = null;
static const IconData blood_pressure = IconData(0xe800, fontFamily: _kFontFam, fontPackage: _kFontPkg);
static const IconData blood = IconData(0xe801, fontFamily: _kFontFam, fontPackage: _kFontPkg);
static const IconData bmi = IconData(0xe802, fontFamily: _kFontFam, fontPackage: _kFontPkg);
static const IconData heart = IconData(0xe803, fontFamily: _kFontFam, fontPackage: _kFontPkg);
static const IconData height = IconData(0xe804, fontFamily: _kFontFam, fontPackage: _kFontPkg);
static const IconData outline = IconData(0xe805, fontFamily: _kFontFam, fontPackage: _kFontPkg);
static const IconData thermometer = IconData(0xe806, fontFamily: _kFontFam, fontPackage: _kFontPkg);
static const IconData weight_scale = IconData(0xe807, fontFamily: _kFontFam, fontPackage: _kFontPkg);
static const IconData parking_icon = IconData(0xe808, fontFamily: _kFontFam, fontPackage: _kFontPkg);
static const IconData blood_type_icon = IconData(0xe809, fontFamily: _kFontFam, fontPackage: _kFontPkg);
static const IconData height_icon = IconData(0xe80a, fontFamily: _kFontFam, fontPackage: _kFontPkg);
static const IconData online_payment_icon = IconData(0xe80b, fontFamily: _kFontFam, fontPackage: _kFontPkg);
static const IconData search_medicine_icon = IconData(0xe80c, fontFamily: _kFontFam, fontPackage: _kFontPkg);
static const IconData vital_sign_icon = IconData(0xe80d, fontFamily: _kFontFam, fontPackage: _kFontPkg);
static const IconData weight_icon = IconData(0xe80e, fontFamily: _kFontFam, fontPackage: _kFontPkg);
static const IconData my_medical_file = IconData(0xe80f, fontFamily: _kFontFam, fontPackage: _kFontPkg);
static const IconData family = IconData(0xe810, fontFamily: _kFontFam, fontPackage: _kFontPkg);
static const IconData calendar__2_ = IconData(0xe811, fontFamily: _kFontFam, fontPackage: _kFontPkg);
static const IconData roboticon = IconData(0xe812, fontFamily: _kFontFam, fontPackage: _kFontPkg);
}

@ -1079,5 +1079,9 @@ const Map localizedValues = {
"Through this service, you will be able to link your family medical files to your medical file so that you can manage their records by login to your medical file.", "Through this service, you will be able to link your family medical files to your medical file so that you can manage their records by login to your medical file.",
"ar": "ar":
"هذه الخدمة تم تصميمها لتتمكن من ربط الملفات الطبية للعائلة بملفك الطبي حتى تتمكن من إدارة سجلاتهم عن طريق تسجيل الدخول إلى ملفك الطبي." "هذه الخدمة تم تصميمها لتتمكن من ربط الملفات الطبية للعائلة بملفك الطبي حتى تتمكن من إدارة سجلاتهم عن طريق تسجيل الدخول إلى ملفك الطبي."
},
"help": {
"en": "Help",
"ar": "مساعدة"
} }
}; };

@ -39,4 +39,5 @@ class DQIcons {
static const IconData my_medical_file = IconData(0xe80f, fontFamily: _kFontFam, fontPackage: _kFontPkg); static const IconData my_medical_file = IconData(0xe80f, fontFamily: _kFontFam, fontPackage: _kFontPkg);
static const IconData family = IconData(0xe810, fontFamily: _kFontFam, fontPackage: _kFontPkg); static const IconData family = IconData(0xe810, fontFamily: _kFontFam, fontPackage: _kFontPkg);
static const IconData calendar__2_ = IconData(0xe811, fontFamily: _kFontFam, fontPackage: _kFontPkg); static const IconData calendar__2_ = IconData(0xe811, fontFamily: _kFontFam, fontPackage: _kFontPkg);
static const IconData roboticon = IconData(0xe812, fontFamily: _kFontFam, fontPackage: _kFontPkg);
} }

@ -65,6 +65,7 @@ class _AllHabibMedicalServiceState extends State<AllHabibMedicalService> {
isShowAppBar: true, isShowAppBar: true,
appBarTitle: TranslationBase.of(context).alhabiServices, appBarTitle: TranslationBase.of(context).alhabiServices,
isShowDecPage: false, isShowDecPage: false,
isHelp:false,
body: Column( body: Column(
children: [ children: [
Expanded( Expanded(

@ -1033,6 +1033,7 @@ class TranslationBase {
localizedValues['info-my-appointments'][locale.languageCode]; localizedValues['info-my-appointments'][locale.languageCode];
String get infoTodo => localizedValues['info-todo'][locale.languageCode]; String get infoTodo => localizedValues['info-todo'][locale.languageCode];
String get familyInfo => localizedValues['family-info'][locale.languageCode]; String get familyInfo => localizedValues['family-info'][locale.languageCode];
String get help => localizedValues['help'][locale.languageCode];
} }
class TranslationBaseDelegate extends LocalizationsDelegate<TranslationBase> { class TranslationBaseDelegate extends LocalizationsDelegate<TranslationBase> {

@ -4,7 +4,7 @@ import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:eva_icons_flutter/eva_icons_flutter.dart'; import 'package:eva_icons_flutter/eva_icons_flutter.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:diplomaticquarterapp/services/robo_search/event_provider.dart';
import '../../d_q_icons_icons.dart'; import '../../d_q_icons_icons.dart';
import 'bottom_navigation_item.dart'; import 'bottom_navigation_item.dart';
@ -19,9 +19,12 @@ class BottomNavBar extends StatefulWidget {
class _BottomNavBarState extends State<BottomNavBar> { class _BottomNavBarState extends State<BottomNavBar> {
int _index = 0; int _index = 0;
var event = RobotProvider();
_changeIndex(int index) { _changeIndex(int index) {
widget.changeIndex(index); widget.changeIndex(index);
if(_index==0){
event.setValue({'isRobotVisible':'true'});
}
} }
@override @override
@ -36,14 +39,7 @@ class _BottomNavBarState extends State<BottomNavBar> {
mainAxisSize: MainAxisSize.max, mainAxisSize: MainAxisSize.max,
mainAxisAlignment: MainAxisAlignment.spaceAround, mainAxisAlignment: MainAxisAlignment.spaceAround,
children: [ children: [
BottomNavigationItem(
icon: EvaIcons.home,
activeIcon: EvaIcons.home,
changeIndex: _changeIndex,
index: widget.index,
currentIndex: 0,
name: TranslationBase.of(context).home,
),
BottomNavigationItem( BottomNavigationItem(
icon: DQIcons.my_medical_file, icon: DQIcons.my_medical_file,
activeIcon: DQIcons.my_medical_file, activeIcon: DQIcons.my_medical_file,
@ -52,6 +48,15 @@ class _BottomNavBarState extends State<BottomNavBar> {
currentIndex: 1, currentIndex: 1,
name: TranslationBase.of(context).medicalProfile, name: TranslationBase.of(context).medicalProfile,
), ),
BottomNavigationItem(
icon: DQIcons.family,
activeIcon: DQIcons.family,
changeIndex: _changeIndex,
index: widget.index,
currentIndex: 3,
name: TranslationBase.of(context).myFamily,
),
if(widget.index == 0) if(widget.index == 0)
Expanded( Expanded(
child: SizedBox( child: SizedBox(
@ -75,14 +80,6 @@ class _BottomNavBarState extends State<BottomNavBar> {
name: TranslationBase.of(context).bookAppo, name: TranslationBase.of(context).bookAppo,
), ),
BottomNavigationItem(
icon: DQIcons.family,
activeIcon: DQIcons.family,
changeIndex: _changeIndex,
index: widget.index,
currentIndex: 3,
name: TranslationBase.of(context).myFamily,
),
BottomNavigationItem( BottomNavigationItem(
icon: EvaIcons.calendar, icon: EvaIcons.calendar,
activeIcon: EvaIcons.calendar, activeIcon: EvaIcons.calendar,
@ -90,6 +87,14 @@ class _BottomNavBarState extends State<BottomNavBar> {
index: widget.index, index: widget.index,
currentIndex: 4, currentIndex: 4,
name: TranslationBase.of(context).todoList, name: TranslationBase.of(context).todoList,
),
BottomNavigationItem(
icon: DQIcons.roboticon,
activeIcon: DQIcons.roboticon,
changeIndex: _changeIndex,
index: widget.index,
currentIndex: 0,
name: TranslationBase.of(context).help,
) )
], ],
), ),

@ -16,14 +16,14 @@ import 'package:flutter/material.dart';
import 'package:flutter_svg/flutter_svg.dart'; import 'package:flutter_svg/flutter_svg.dart';
import 'package:font_awesome_flutter/font_awesome_flutter.dart'; import 'package:font_awesome_flutter/font_awesome_flutter.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
import 'package:animated_text_kit/animated_text_kit.dart';
import '../../locator.dart'; import '../../locator.dart';
import 'floating_button_search.dart'; import 'floating_button_search.dart';
import '../progress_indicator/app_loader_widget.dart'; import '../progress_indicator/app_loader_widget.dart';
import 'arrow_back.dart'; import 'arrow_back.dart';
import 'network_base_view.dart'; import 'network_base_view.dart';
import 'not_auh_page.dart'; import 'not_auh_page.dart';
import 'package:diplomaticquarterapp/widgets/weather_slider/weather_slider.dart';
class AppScaffold extends StatelessWidget { class AppScaffold extends StatelessWidget {
final String appBarTitle; final String appBarTitle;
final Widget body; final Widget body;
@ -40,7 +40,7 @@ class AppScaffold extends StatelessWidget {
final bool isShowDecPage; final bool isShowDecPage;
final List<String> infoList; final List<String> infoList;
final Color backgroundColor; final Color backgroundColor;
final bool isHelp;
AuthenticatedUserObject authenticatedUserObject = AuthenticatedUserObject authenticatedUserObject =
locator<AuthenticatedUserObject>(); locator<AuthenticatedUserObject>();
@ -59,7 +59,9 @@ class AppScaffold extends StatelessWidget {
this.backgroundColor, this.backgroundColor,
this.isBottomBar, this.isBottomBar,
this.image, this.image,
this.infoList}); this.infoList,
this.isHelp
});
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
@ -138,7 +140,7 @@ class AppScaffold extends StatelessWidget {
// floatingActionButton: floatingActionButton ?? floatingActionButton, // floatingActionButton: floatingActionButton ?? floatingActionButton,
// bottomNavigationBar: // bottomNavigationBar:
// this.isBottomBar == true ? BottomBarSearch() : SizedBox() // this.isBottomBar == true ? BottomBarSearch() : SizedBox()
floatingActionButton: FloatingSearchButton(), //floatingActionButton: FloatingSearchButton(),
); );
} }
@ -149,7 +151,60 @@ class AppScaffold extends StatelessWidget {
buildBodyWidget() { buildBodyWidget() {
// return body; //Stack(children: <Widget>[body, buildAppLoaderWidget(isLoading)]); // return body; //Stack(children: <Widget>[body, buildAppLoaderWidget(isLoading)]);
return Stack(children: <Widget>[ return Stack(children: <Widget>[
body, /*FloatingSearchButton()*/ body,
isHelp?? Positioned(
child:Column(children: [
Container(
height:100,
width:150,
padding:EdgeInsets.all(5),
margin: EdgeInsets.only(right: 10.0, bottom: 0),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(10),
color: Colors.white,
boxShadow: [
BoxShadow(color: Colors.grey, spreadRadius: 3),
],
),
child: TyperAnimatedTextKit(
onTap: () {
},
text: [
"Discipline is the best tool",
"Design first, then code",
"Do not patch bugs out, rewrite them",
"Do not test bugs out, design them out",
],
textStyle: TextStyle(
fontSize: 14.0,
color:Colors.black54
),
speed:Duration(milliseconds: 100),
textAlign: TextAlign.start,
alignment: AlignmentDirectional.topStart // or Alignment.topLeft
)),
Positioned(child:Stack(children: [
Positioned(
top:0,
right:50,
child: Container(
height: 0,
width:0,
decoration: ShapeDecoration(
color: Colors.grey,
shape: MessageBorder(reverse: true),
))),
FloatingSearchButton()
],))
],), left:SizeConfig.screenWidth -160, bottom:50)
/*FloatingSearchButton()*/
]); ]);
} }
} }

@ -55,7 +55,7 @@ class BottomBarSearch extends StatefulWidget {
class _SearchBot extends State<BottomBarSearch> { class _SearchBot extends State<BottomBarSearch> {
SearchProvider searchProvider = new SearchProvider(); SearchProvider searchProvider = new SearchProvider();
RobotProvider eventProvider = RobotProvider(); RobotProvider Provider = RobotProvider();
bool isLoading = false; bool isLoading = false;
bool isError = false; bool isError = false;
final SpeechToText speech = SpeechToText(); final SpeechToText speech = SpeechToText();

@ -1,6 +1,7 @@
import 'dart:collection'; import 'dart:collection';
import 'dart:io'; import 'dart:io';
import 'dart:math'; import 'dart:math';
import 'package:diplomaticquarterapp/config/config.dart'; import 'package:diplomaticquarterapp/config/config.dart';
import 'package:diplomaticquarterapp/config/shared_pref_kay.dart'; import 'package:diplomaticquarterapp/config/shared_pref_kay.dart';
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
@ -93,24 +94,30 @@ class _FloatingSearchButton extends State<FloatingSearchButton>
bool _hasSpeech = false; bool _hasSpeech = false;
ProjectViewModel projectProvider; ProjectViewModel projectProvider;
AnimationController controller;
Animation<Offset> offset;
@override @override
void initState() { void initState() {
// event.controller.stream.listen((p) { controller =
// if (p['isRobot'] == 'true') { AnimationController(vsync: this, duration: Duration(seconds: 1));
// if (this.mounted) { offset = Tween<Offset>(begin: Offset.zero, end: Offset(0.0, 1.0))
// setState(() { .animate(controller);
// position = Offset(250, 400); controller.reverse();
// activeAnimation = false;
// });
// }
// }
// });
Future.delayed(const Duration(seconds: 2), () { Future.delayed(const Duration(seconds: 2), () {
requestPermissions(); requestPermissions();
getUserData(); getUserData();
}); });
controller.reverse();
event.controller.stream.listen((p) {
if (p['isRobotVisible'] == 'true') {
if (this.mounted) {
setState(() {
controller.reverse();
});
}
}
});
super.initState(); super.initState();
} }
@ -119,19 +126,19 @@ class _FloatingSearchButton extends State<FloatingSearchButton>
Widget build(BuildContext context) { Widget build(BuildContext context) {
projectProvider = Provider.of(context); projectProvider = Provider.of(context);
return Container( return Container(
child: isShow ? getStack() : Stack(children: <Widget>[Container()])); child:
SlideTransition(
position: offset,
child: getStack()));
} }
Widget getStack() { Widget getStack() {
return Container( return Container(
height: 150, height: 150,
width: 150, width: 150,
margin: EdgeInsets.only(right: 0.0), margin: EdgeInsets.only(left: 20.0),
child: Stack(children: <Widget>[ child: Stack(children: <Widget>[
// Column(
// mainAxisSize: MainAxisSize.min,
// crossAxisAlignment: CrossAxisAlignment.stretch,
// children: <Widget>[
GestureDetector( GestureDetector(
child: Container( child: Container(
child: Image.asset('assets/images/gif/robot-idle.gif'), child: Image.asset('assets/images/gif/robot-idle.gif'),
@ -140,8 +147,6 @@ class _FloatingSearchButton extends State<FloatingSearchButton>
initSpeechState().then((value) => {startVoiceSearch()}); initSpeechState().then((value) => {startVoiceSearch()});
}, },
), ),
// ],
// ),
Positioned( Positioned(
left: 15.0, left: 15.0,
top: 10, top: 10,
@ -149,7 +154,8 @@ class _FloatingSearchButton extends State<FloatingSearchButton>
onTap: () { onTap: () {
setState(() { setState(() {
if (this.mounted) { if (this.mounted) {
isShow = false; controller.forward();
//isShow = false;
} }
}); });
}, },

@ -163,8 +163,8 @@ class WeatherSlider extends StatelessWidget {
} }
class MessageBorder extends ShapeBorder { class MessageBorder extends ShapeBorder {
final bool usePadding; final bool usePadding;
final bool reverse;
MessageBorder({this.usePadding = true}); MessageBorder({this.usePadding = true, this.reverse =false});
@override @override
EdgeInsetsGeometry get dimensions => EdgeInsets.only(bottom: usePadding? 0 : 0); EdgeInsetsGeometry get dimensions => EdgeInsets.only(bottom: usePadding? 0 : 0);
@ -175,13 +175,23 @@ class MessageBorder extends ShapeBorder {
@override @override
Path getOuterPath(Rect rect, {TextDirection textDirection}) { Path getOuterPath(Rect rect, {TextDirection textDirection}) {
rect = Rect.fromPoints(rect.bottomRight, rect.bottomLeft - Offset(0, 0)); rect = Rect.fromPoints(rect.bottomRight, rect.bottomLeft - Offset(0, 0));
if(!reverse) {
return Path() return Path()
..addRRect(RRect.fromRectAndRadius(rect, Radius.circular(rect.height / 2))) ..addRRect(
RRect.fromRectAndRadius(rect, Radius.circular(rect.height / 2)))
..moveTo(rect.topCenter.dx - 10, rect.topCenter.dy) ..moveTo(rect.topCenter.dx - 10, rect.topCenter.dy)
..relativeLineTo(10, -10) ..relativeLineTo(10, -10)..relativeLineTo(10, 10)
..relativeLineTo(10,10) ..close();
}else{
return Path()
..addRRect(
RRect.fromRectAndRadius(rect, Radius.circular(rect.height / 2)))
..moveTo(rect.topCenter.dx, rect.topCenter.dy)
..relativeLineTo(10, 20)
..relativeLineTo(20, -20)
..close(); ..close();
} }
}
@override @override
void paint(Canvas canvas, Rect rect, {TextDirection textDirection}) {} void paint(Canvas canvas, Rect rect, {TextDirection textDirection}) {}

@ -143,7 +143,7 @@ dependencies:
screen: ^0.0.5 screen: ^0.0.5
#google maps places #google maps places
google_maps_place_picker: ^1.0.0 google_maps_place_picker: ^1.0.0
animated_text_kit: ^2.5.4
#Dependencies for video call implementation #Dependencies for video call implementation
native_device_orientation: ^0.3.0 native_device_orientation: ^0.3.0
enum_to_string: ^1.0.9 enum_to_string: ^1.0.9

Loading…
Cancel
Save