voice command updated

merge-requests/140/head
Sultan Khan 4 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.",
"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 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);
}

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

@ -1033,6 +1033,7 @@ class TranslationBase {
localizedValues['info-my-appointments'][locale.languageCode];
String get infoTodo => localizedValues['info-todo'][locale.languageCode];
String get familyInfo => localizedValues['family-info'][locale.languageCode];
String get help => localizedValues['help'][locale.languageCode];
}
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:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:diplomaticquarterapp/services/robo_search/event_provider.dart';
import '../../d_q_icons_icons.dart';
import 'bottom_navigation_item.dart';
@ -19,9 +19,12 @@ class BottomNavBar extends StatefulWidget {
class _BottomNavBarState extends State<BottomNavBar> {
int _index = 0;
var event = RobotProvider();
_changeIndex(int index) {
widget.changeIndex(index);
if(_index==0){
event.setValue({'isRobotVisible':'true'});
}
}
@override
@ -36,14 +39,7 @@ class _BottomNavBarState extends State<BottomNavBar> {
mainAxisSize: MainAxisSize.max,
mainAxisAlignment: MainAxisAlignment.spaceAround,
children: [
BottomNavigationItem(
icon: EvaIcons.home,
activeIcon: EvaIcons.home,
changeIndex: _changeIndex,
index: widget.index,
currentIndex: 0,
name: TranslationBase.of(context).home,
),
BottomNavigationItem(
icon: DQIcons.my_medical_file,
activeIcon: DQIcons.my_medical_file,
@ -52,28 +48,6 @@ class _BottomNavBarState extends State<BottomNavBar> {
currentIndex: 1,
name: TranslationBase.of(context).medicalProfile,
),
if(widget.index == 0)
Expanded(
child: SizedBox(
height: 50,
child: Column(
mainAxisSize: MainAxisSize.min,
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
SizedBox(height: 22),
],
),
),
),
if(widget.index != 0)
BottomNavigationItem(
icon: EvaIcons.calendar,
activeIcon: EvaIcons.calendar,
changeIndex: _changeIndex,
index: _index,
currentIndex: 2,
name: TranslationBase.of(context).bookAppo,
),
BottomNavigationItem(
icon: DQIcons.family,
@ -83,6 +57,29 @@ class _BottomNavBarState extends State<BottomNavBar> {
currentIndex: 3,
name: TranslationBase.of(context).myFamily,
),
if(widget.index == 0)
Expanded(
child: SizedBox(
height: 50,
child: Column(
mainAxisSize: MainAxisSize.min,
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
SizedBox(height: 22),
],
),
),
),
if(widget.index != 0)
BottomNavigationItem(
icon: EvaIcons.calendar,
activeIcon: EvaIcons.calendar,
changeIndex: _changeIndex,
index: _index,
currentIndex: 2,
name: TranslationBase.of(context).bookAppo,
),
BottomNavigationItem(
icon: EvaIcons.calendar,
activeIcon: EvaIcons.calendar,
@ -90,6 +87,14 @@ class _BottomNavBarState extends State<BottomNavBar> {
index: widget.index,
currentIndex: 4,
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:font_awesome_flutter/font_awesome_flutter.dart';
import 'package:provider/provider.dart';
import 'package:animated_text_kit/animated_text_kit.dart';
import '../../locator.dart';
import 'floating_button_search.dart';
import '../progress_indicator/app_loader_widget.dart';
import 'arrow_back.dart';
import 'network_base_view.dart';
import 'not_auh_page.dart';
import 'package:diplomaticquarterapp/widgets/weather_slider/weather_slider.dart';
class AppScaffold extends StatelessWidget {
final String appBarTitle;
final Widget body;
@ -40,7 +40,7 @@ class AppScaffold extends StatelessWidget {
final bool isShowDecPage;
final List<String> infoList;
final Color backgroundColor;
final bool isHelp;
AuthenticatedUserObject authenticatedUserObject =
locator<AuthenticatedUserObject>();
@ -59,7 +59,9 @@ class AppScaffold extends StatelessWidget {
this.backgroundColor,
this.isBottomBar,
this.image,
this.infoList});
this.infoList,
this.isHelp
});
@override
Widget build(BuildContext context) {
@ -138,7 +140,7 @@ class AppScaffold extends StatelessWidget {
// floatingActionButton: floatingActionButton ?? floatingActionButton,
// bottomNavigationBar:
// this.isBottomBar == true ? BottomBarSearch() : SizedBox()
floatingActionButton: FloatingSearchButton(),
//floatingActionButton: FloatingSearchButton(),
);
}
@ -149,7 +151,60 @@ class AppScaffold extends StatelessWidget {
buildBodyWidget() {
// return body; //Stack(children: <Widget>[body, buildAppLoaderWidget(isLoading)]);
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> {
SearchProvider searchProvider = new SearchProvider();
RobotProvider eventProvider = RobotProvider();
RobotProvider Provider = RobotProvider();
bool isLoading = false;
bool isError = false;
final SpeechToText speech = SpeechToText();

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

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

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

Loading…
Cancel
Save