diff --git a/lib/Appoitment/Show.dart b/lib/Appoitment/Show.dart index 50303bf..b1105f7 100644 --- a/lib/Appoitment/Show.dart +++ b/lib/Appoitment/Show.dart @@ -1,5 +1,5 @@ import 'package:flutter/material.dart'; -import 'package:hackathon2/Chat/1.dart'; +import 'package:hackathon2/Chat/2.dart'; import 'Chatscreen.dart'; class Show extends StatefulWidget { @@ -149,9 +149,9 @@ class _ShowState extends State { Navigator.push( context, MaterialPageRoute( - builder: (context) => MyApp( + builder: (context) => AllChatsPage( uid: widget.uid, - image: widget.drimage, + image2: widget.drimage, ))); } }, diff --git a/lib/Appoitment/appointment.dart b/lib/Appoitment/appointment.dart index 835ee57..c861c0d 100644 --- a/lib/Appoitment/appointment.dart +++ b/lib/Appoitment/appointment.dart @@ -67,6 +67,10 @@ class _AppointmentState extends State { degree: snapshot1.data.value['degree'], exp: snapshot1.data.value['exp'], + language: snapshot1 + .data.value['language'], + drcertificate: snapshot1 + .data.value['certificate'], ))); }, child: Row( diff --git a/lib/Appoitment/appointmentrequest.dart b/lib/Appoitment/appointmentrequest.dart index 9d53e99..b911f3e 100644 --- a/lib/Appoitment/appointmentrequest.dart +++ b/lib/Appoitment/appointmentrequest.dart @@ -14,6 +14,8 @@ class Request extends StatefulWidget { final String fee; final String degree; final String exp; + final String language; + final String drcertificate; const Request( {Key key, this.index, @@ -21,7 +23,9 @@ class Request extends StatefulWidget { this.fee, this.degree, this.exp, - this.doctorname}) + this.doctorname, + this.language, + this.drcertificate}) : super(key: key); @override _RequestState createState() => _RequestState(); @@ -51,6 +55,7 @@ class _RequestState extends State { tag: widget.index, child: SingleChildScrollView( child: Column( + crossAxisAlignment: CrossAxisAlignment.start, children: [ Container( width: MediaQuery.of(context).size.width, @@ -83,7 +88,7 @@ class _RequestState extends State { "Degree: " + widget.degree, style: TextStyle( color: Colors.white, - fontSize: 23, + fontSize: 16, fontWeight: FontWeight.bold, ), ), @@ -94,7 +99,7 @@ class _RequestState extends State { "Experience: " + widget.exp, style: TextStyle( color: Colors.white, - fontSize: 23, + fontSize: 16, fontWeight: FontWeight.bold, ), ), @@ -105,7 +110,18 @@ class _RequestState extends State { "Fees: " + widget.fee, style: TextStyle( color: Colors.white, - fontSize: 23, + fontSize: 16, + fontWeight: FontWeight.bold, + ), + ), + ), + Padding( + padding: const EdgeInsets.all(8.0), + child: Text( + "Known Languages: " + widget.language, + style: TextStyle( + color: Colors.white, + fontSize: 16, fontWeight: FontWeight.bold, ), ), @@ -114,7 +130,7 @@ class _RequestState extends State { ), color: Color(0xFFFF69B4), width: MediaQuery.of(context).size.width / 1.2, - height: MediaQuery.of(context).size.height / 6, + height: MediaQuery.of(context).size.height / 5, ), ), ) @@ -122,7 +138,30 @@ class _RequestState extends State { ), ), SizedBox( - height: 70, + height: 20, + ), + Padding( + padding: const EdgeInsets.all(8.0), + child: Text( + "Certificate", + style: TextStyle( + color: Colors.black, + fontSize: 25, + fontWeight: FontWeight.bold), + ), + ), + Center( + child: Container( + decoration: BoxDecoration( + image: DecorationImage( + image: NetworkImage(widget.drcertificate), + fit: BoxFit.fill)), + width: MediaQuery.of(context).size.width / 1.3, + height: MediaQuery.of(context).size.height / 1.9, + ), + ), + SizedBox( + height: 20, ), Center( child: GestureDetector( diff --git a/lib/Chat/1.dart b/lib/Chat/1.dart deleted file mode 100644 index d9fa9ea..0000000 --- a/lib/Chat/1.dart +++ /dev/null @@ -1,29 +0,0 @@ -import 'package:flutter/material.dart'; -import 'package:scoped_model/scoped_model.dart'; - -import '2.dart'; -import 'chatmodel.dart'; - -class MyApp extends StatefulWidget { - final String uid; - final String image; - const MyApp({Key key, this.uid, this.image}) : super(key: key); - @override - _MyAppState createState() => _MyAppState(); -} - -class _MyAppState extends State { - @override - Widget build(BuildContext context) { - return ScopedModel( - model: ChatModel(), - child: MaterialApp( - debugShowCheckedModeBanner: false, - home: AllChatsPage( - uid: widget.uid, - image2: widget.image, - ), - ), - ); - } -} diff --git a/lib/Chat/2.dart b/lib/Chat/2.dart index 13a2ec1..45dfb6b 100644 --- a/lib/Chat/2.dart +++ b/lib/Chat/2.dart @@ -10,9 +10,6 @@ import 'package:hexcolor/hexcolor.dart'; import 'package:permission_handler/permission_handler.dart'; import 'package:scoped_model/scoped_model.dart'; import 'package:http/http.dart' as http; -import '3.dart'; -import 'chatmodel.dart'; -import 'user.dart'; class AllChatsPage extends StatefulWidget { final String uid; @@ -48,13 +45,7 @@ class _AllChatsPageState extends State { ); } - @override - void initState() { - super.initState(); - ScopedModel.of(context, rebuildOnChange: false).init(); - } - - void friendClicked(User friend) { + void friendClicked() { Navigator.of(context).push( MaterialPageRoute( builder: (BuildContext context) { @@ -67,65 +58,44 @@ class _AllChatsPageState extends State { } Widget buildAllChatList() { - return ScopedModelDescendant( - builder: (context, child, model) { - return ListView.builder( - itemCount: model.friendList.length, - itemBuilder: (BuildContext context, int index) { - User friend = model.friendList[index]; - return Center( - child: Padding( - padding: const EdgeInsets.all(40.0), - child: Column( - children: [ - Padding( - padding: const EdgeInsets.all(70.0), - child: Center( - child: Row( - children: [ - GestureDetector( - onTap: () { - onJoin(); - }, - child: CircleAvatar( - radius: 40, - backgroundColor: Colors.pink[100], - child: Center( - child: Icon( - CupertinoIcons.video_camera_solid, - color: Colors.black, - ), - ), - ), - ), - SizedBox( - width: 30, - ), - GestureDetector( - onTap: () { - friendClicked(friend); - }, - child: CircleAvatar( - radius: 40, - backgroundColor: Colors.pink[100], - child: Center( - child: Icon( - Icons.chat_bubble_outline, - color: Colors.black, - ), - ), - ), - ) - ], - ), - ), - ) - ], - ), - ), - ); - }); - }, + return Row( + crossAxisAlignment: CrossAxisAlignment.center, + mainAxisAlignment: MainAxisAlignment.center, + children: [ + GestureDetector( + onTap: () { + onJoin(); + }, + child: CircleAvatar( + radius: 40, + backgroundColor: Colors.pink[100], + child: Center( + child: Icon( + CupertinoIcons.video_camera_solid, + color: Colors.black, + ), + ), + ), + ), + SizedBox( + width: 30, + ), + GestureDetector( + onTap: () { + friendClicked(); + }, + child: CircleAvatar( + radius: 40, + backgroundColor: Colors.pink[100], + child: Center( + child: Icon( + Icons.chat_bubble_outline, + color: Colors.black, + ), + ), + ), + ) + ], ); } @@ -133,17 +103,8 @@ class _AllChatsPageState extends State { Widget build(BuildContext context) { return Scaffold( appBar: AppBar( - leading: IconButton( - icon: Icon( - Icons.arrow_back, - color: Colors.black, - ), - onPressed: () { - Navigator.push(context, - MaterialPageRoute(builder: (context) => Appointment3())); - }), - // iconTheme: IconThemeData(color: Colors.black), - //automaticallyImplyLeading: true, + iconTheme: IconThemeData(color: Colors.black), + automaticallyImplyLeading: true, backgroundColor: Colors.white, elevation: 0, title: Center( diff --git a/lib/Chat/3.dart b/lib/Chat/3.dart deleted file mode 100644 index 436028c..0000000 --- a/lib/Chat/3.dart +++ /dev/null @@ -1,140 +0,0 @@ -import 'package:flutter/material.dart'; -import 'package:hexcolor/hexcolor.dart'; -import 'package:scoped_model/scoped_model.dart'; - -import 'chatmodel.dart'; -import 'message.dart'; -import 'user.dart'; - -class ChatPage extends StatefulWidget { - final User friend; - ChatPage(this.friend); - @override - _ChatPageState createState() => _ChatPageState(); -} - -class _ChatPageState extends State { - final TextEditingController textEditingController = TextEditingController(); - - Widget buildSingleMessage(Message message) { - return SizedBox( - width: MediaQuery.of(context).size.width / 5, - child: Card( - elevation: 9, - color: Colors.transparent, - shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(20)), - child: SizedBox( - width: MediaQuery.of(context).size.width / 60, - child: Container( - width: MediaQuery.of(context).size.width / 15, - color: Colors.transparent, - alignment: message.senderID == widget.friend.chatID - ? Alignment.centerLeft - : Alignment.centerRight, - padding: EdgeInsets.all(10.0), - margin: EdgeInsets.all(10.0), - child: Text( - message.text, - style: TextStyle( - color: Colors.black, - fontSize: 20, - fontWeight: FontWeight.bold), - ), - ), - ), - ), - ); - } - - Widget buildChatList() { - return ScopedModelDescendant( - builder: (context, child, model) { - List messages = - model.getMessagesForChatID(widget.friend.chatID); - - return Container( - height: MediaQuery.of(context).size.height * 0.75, - child: ListView.builder( - itemCount: messages.length, - itemBuilder: (BuildContext context, int index) { - return buildSingleMessage(messages[index]); - }, - ), - ); - }, - ); - } - - Widget buildChatArea() { - return ScopedModelDescendant( - builder: (context, child, model) { - return Container( - height: MediaQuery.of(context).size.height / 7, - child: Row( - children: [ - Container( - width: MediaQuery.of(context).size.width * 0.8, - child: TextField( - style: TextStyle(color: Colors.black), - controller: textEditingController, - decoration: InputDecoration( - hintText: "Type a message", - hintStyle: TextStyle(color: Colors.black)), - ), - ), - SizedBox(width: 10.0), - FloatingActionButton( - backgroundColor: Colors.transparent, - onPressed: () { - model.sendMessage( - textEditingController.text, widget.friend.chatID); - textEditingController.text = ''; - }, - elevation: 0, - child: Icon( - Icons.send, - color: Colors.black, - ), - ), - ], - ), - ); - }, - ); - } - - @override - void initState() { - super.initState(); - ScopedModel.of(context, rebuildOnChange: false).init(); - } - - @override - Widget build(BuildContext context) { - return Scaffold( - backgroundColor: Color(0xFFFFC0CB), - appBar: AppBar( - iconTheme: IconThemeData(color: Colors.black), - automaticallyImplyLeading: true, - backgroundColor: Colors.white, - elevation: 0, - title: Center( - child: Text( - "CHAT", - style: TextStyle( - color: Colors.black, - letterSpacing: 3, - fontSize: 20, - fontWeight: FontWeight.w400), - ), - ), - ), - body: ListView( - children: [ - buildChatList(), - buildChatArea(), - ], - ), - ); - } -} diff --git a/lib/Chat/chatmodel.dart b/lib/Chat/chatmodel.dart deleted file mode 100644 index c4bcd65..0000000 --- a/lib/Chat/chatmodel.dart +++ /dev/null @@ -1,59 +0,0 @@ -import 'package:hackathon2/global.dart'; -import 'package:scoped_model/scoped_model.dart'; -import 'package:flutter_socket_io/flutter_socket_io.dart'; -import 'package:flutter_socket_io/socket_io_manager.dart'; -import 'dart:convert'; - -import 'message.dart'; -import 'user.dart'; - -class ChatModel extends Model { - List users = [ - User('Shubham Mehta', '5f602d5d868b451a58b3bff8'), // stuent id - User('Debashish Sau', '111110'), //mentor id - ]; - - User currentUser; - List friendList = List(); - List messages = List(); - SocketIO socketIO; - - void init() { - currentUser = users[0]; //ye mein hoon - friendList = users - .where((user) => user.chatID != currentUser.chatID) - .toList(); //friend list mein tu hai - socketIO = SocketIOManager().createSocketIO( - 'https://chat-flutter-pp.herokuapp.com/', '/', - query: 'chatID=${currentUser.chatID}'); //socket bana meri id key saath - socketIO.init(); - - socketIO.subscribe('receive_message', (jsonData) { - Map data = json.decode(jsonData); - messages.add(Message( - data['content'], data['senderChatID'], data['receiverChatID'])); - notifyListeners(); - }); - - socketIO.connect(); - } - - void sendMessage(String text, String receiverChatID) { - messages.add(Message(text, currentUser.chatID, receiverChatID)); - socketIO.sendMessage( - 'send_message', - json.encode({ - 'receiverChatID': receiverChatID, - 'senderChatID': currentUser.chatID, - 'content': text, - }), - ); - notifyListeners(); - } - - List getMessagesForChatID(String chatID) { - return messages - .where((msg) => msg.senderID == chatID || msg.receiverID == chatID) - .toList(); - } -} diff --git a/lib/Chat/message.dart b/lib/Chat/message.dart deleted file mode 100644 index a830459..0000000 --- a/lib/Chat/message.dart +++ /dev/null @@ -1,7 +0,0 @@ -class Message { - final String text; - final String senderID; - final String receiverID; - - Message(this.text, this.senderID, this.receiverID); -} diff --git a/lib/Chat/user.dart b/lib/Chat/user.dart deleted file mode 100644 index a643233..0000000 --- a/lib/Chat/user.dart +++ /dev/null @@ -1,6 +0,0 @@ -class User { - String name; - String chatID; - - User(this.name, this.chatID); -} diff --git a/lib/Doctor/Firstscreen/appointment.dart b/lib/Doctor/Firstscreen/appointment.dart index 9830c3c..db187ab 100644 --- a/lib/Doctor/Firstscreen/appointment.dart +++ b/lib/Doctor/Firstscreen/appointment.dart @@ -61,7 +61,8 @@ class _AppointmentState extends State { Widget build(BuildContext context) { return Scaffold( appBar: AppBar( - automaticallyImplyLeading: false, + iconTheme: IconThemeData(color: Colors.black), + automaticallyImplyLeading: true, backgroundColor: Colors.white, elevation: 0, title: Center( diff --git a/lib/Doctor/Login1 and signup1/SignIn1.dart b/lib/Doctor/Login1 and signup1/SignIn1.dart index b15d4bc..b84ec7e 100644 --- a/lib/Doctor/Login1 and signup1/SignIn1.dart +++ b/lib/Doctor/Login1 and signup1/SignIn1.dart @@ -88,6 +88,12 @@ class _SignInState extends State { ), ) : Scaffold( + appBar: AppBar( + elevation: 0, + automaticallyImplyLeading: true, + iconTheme: IconThemeData(color: Colors.black), + backgroundColor: Color(0xFFFFC0CB), + ), backgroundColor: Colors.white, body: Container( child: Column( diff --git a/lib/Doctor/Login1 and signup1/SignUp1.dart b/lib/Doctor/Login1 and signup1/SignUp1.dart index c35fc8f..ea1f0cc 100644 --- a/lib/Doctor/Login1 and signup1/SignUp1.dart +++ b/lib/Doctor/Login1 and signup1/SignUp1.dart @@ -7,10 +7,12 @@ import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; import 'package:image_picker/image_picker.dart'; import 'package:material_design_icons_flutter/material_design_icons_flutter.dart'; +import 'package:percent_indicator/circular_percent_indicator.dart'; import 'package:uuid/uuid.dart'; AuthResult authResult; String user; +int g = 1; class SignUp2 extends StatefulWidget { final Function toggle; @@ -136,7 +138,7 @@ class _SignUpState extends State { imageQuality: 80, ); image2 = File(file.path); - uploadVideo(image2); + uploadVideo1(image2); } catch (error) { print(error); } @@ -152,10 +154,8 @@ class _SignUpState extends State { print(val); downloadurl1 = val; // add(downloadurl); //Val here is Already String - Future.delayed(Duration(seconds: 2), () { - setState(() { - // check = true; - }); + setState(() { + g = 0; }); }); }); @@ -182,6 +182,7 @@ class _SignUpState extends State { "fee": "true", "degree": "true", "language": "true", + "certificate": "true", "uid": "true" }).then((_) { print('Transaction committed.'); @@ -201,6 +202,7 @@ class _SignUpState extends State { "fee": fee, "degree": degree, "language": language1, + "certificate": downloadurl1, "uid": user }); } @@ -518,7 +520,22 @@ class _SignUpState extends State { ), GestureDetector( onTap: () { - uploadToStorage1(); + uploadToStorage1().then((value) { + showDialog( + context: context, + builder: (context) { + Future.delayed(Duration(seconds: 5), + () { + Navigator.of(context).pop(true); + }); + return AlertDialog( + content: g == 0 + ? CircularProgressIndicator() + : Icon(Icons.check, + color: Colors.green), + ); + }); + }); }, child: Container( height: 50, @@ -563,6 +580,14 @@ class _SignUpState extends State { _fee.text, _deg.text, _language.text); + _name.clear(); + _email.clear(); + _pwd.clear(); + _pwd1.clear(); + _exp.clear(); + _fee.clear(); + _deg.clear(); + _language.clear(); }, child: Container( height: 40, diff --git a/lib/Doctor/Secondscreen/second.dart b/lib/Doctor/Secondscreen/second.dart index 687d411..ed9a937 100644 --- a/lib/Doctor/Secondscreen/second.dart +++ b/lib/Doctor/Secondscreen/second.dart @@ -1,6 +1,6 @@ import 'package:firebase_database/firebase_database.dart'; import 'package:flutter/material.dart'; -import 'package:hackathon2/Chat/1.dart'; +import 'package:hackathon2/Doctor/Secondscreen/show1.dart'; //import 'package:hackathon2/Doctor/Chat/1.dart'; import 'package:hackathon2/global.dart'; @@ -87,7 +87,8 @@ class _SecondState extends State { Widget build(BuildContext context) { return Scaffold( appBar: AppBar( - automaticallyImplyLeading: false, + iconTheme: IconThemeData(color: Colors.black), + automaticallyImplyLeading: true, backgroundColor: Colors.white, elevation: 0, title: Center( @@ -198,12 +199,12 @@ class _SecondState extends State { onTap: () { add(widget.image, widget.name, widget.age, widget.contact, widget.address, widget.report, widget.uid, "false"); - /* Navigator.push( + Navigator.push( context, MaterialPageRoute( - builder: (context) => MyApp1( + builder: (context) => Show1( uid: widget.uid, - )));*/ + ))); }, child: Container( height: 40, diff --git a/lib/Doctor/Secondscreen/show1.dart b/lib/Doctor/Secondscreen/show1.dart new file mode 100644 index 0000000..5e919fa --- /dev/null +++ b/lib/Doctor/Secondscreen/show1.dart @@ -0,0 +1,117 @@ +import 'package:agora_rtc_engine/rtc_engine.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; +import 'package:hackathon2/Doctor/call.dart'; +import 'package:permission_handler/permission_handler.dart'; + +class Show1 extends StatefulWidget { + final String uid; + final String image2; + const Show1({Key key, this.uid, this.image2}) : super(key: key); + @override + _AllChatsPageState createState() => _AllChatsPageState(); +} + +class _AllChatsPageState extends State { + int f = 0; + ClientRole _role = ClientRole.Broadcaster; + + Future onJoin() async { + // update input validation + // await for camera and mic permissions before pushing video page + await _handleCameraAndMic(); + // push video page with given channel name + await Navigator.push( + context, + MaterialPageRoute( + builder: (context) => CallPage1( + channelName: widget.uid, + role: _role, + ), + ), + ); + } + + Future _handleCameraAndMic() async { + await PermissionHandler().requestPermissions( + [PermissionGroup.camera, PermissionGroup.microphone], + ); + } + + /* void friendClicked() { + Navigator.of(context).push( + MaterialPageRoute( + builder: (BuildContext context) { + return MyApp( + drimag: widget.image2, + ); + }, + ), + ); + }*/ + + Widget buildAllChatList() { + return Row( + crossAxisAlignment: CrossAxisAlignment.center, + mainAxisAlignment: MainAxisAlignment.center, + children: [ + GestureDetector( + onTap: () { + onJoin(); + }, + child: CircleAvatar( + radius: 40, + backgroundColor: Colors.pink[100], + child: Center( + child: Icon( + CupertinoIcons.video_camera_solid, + color: Colors.black, + ), + ), + ), + ), + SizedBox( + width: 30, + ), + GestureDetector( + onTap: () { + //friendClicked(); + }, + child: CircleAvatar( + radius: 40, + backgroundColor: Colors.pink[100], + child: Center( + child: Icon( + Icons.chat_bubble_outline, + color: Colors.black, + ), + ), + ), + ) + ], + ); + } + + @override + Widget build(BuildContext context) { + return Scaffold( + appBar: AppBar( + iconTheme: IconThemeData(color: Colors.black), + automaticallyImplyLeading: true, + backgroundColor: Colors.white, + elevation: 0, + title: Center( + child: Text( + "CONNECTION", + style: TextStyle( + color: Colors.black, + letterSpacing: 3, + fontSize: 20, + fontWeight: FontWeight.w400), + ), + ), + ), + body: Center(child: buildAllChatList()), + ); + } +} diff --git a/lib/Login and signup/SignIn.dart b/lib/Login and signup/SignIn.dart index 42ef90b..5c4aee3 100644 --- a/lib/Login and signup/SignIn.dart +++ b/lib/Login and signup/SignIn.dart @@ -4,6 +4,7 @@ import 'package:hackathon2/Choices/Choices.dart'; import 'package:hackathon2/GoogleAuth/google.dart'; import 'package:hackathon2/global.dart'; import 'package:hackathon2/messages.dart'; +import 'package:hackathon2/onboarding/onboarding.dart'; import 'package:shared_preferences/shared_preferences.dart'; class SignIn extends StatefulWidget { @@ -87,6 +88,12 @@ class _SignInState extends State { ), ) : Scaffold( + appBar: AppBar( + automaticallyImplyLeading: true, + backgroundColor: Color(0xFFFFC0CB), + elevation: 0, + iconTheme: IconThemeData(color: Colors.black), + ), backgroundColor: Colors.white, body: Container( child: Column( diff --git a/lib/Login and signup/SignUp.dart b/lib/Login and signup/SignUp.dart index 02863f6..e253f9c 100644 --- a/lib/Login and signup/SignUp.dart +++ b/lib/Login and signup/SignUp.dart @@ -342,6 +342,10 @@ class _SignUpState extends State { onTap: () { _trysubmit(context, _name.text, _email.text, _pwd.text, _pwd1.text); + _name.clear(); + _email.clear(); + _pwd.clear(); + _pwd1.clear(); }, child: Container( height: 40, diff --git a/lib/global.dart b/lib/global.dart index dfa213f..a7dcae4 100644 --- a/lib/global.dart +++ b/lib/global.dart @@ -1,7 +1,4 @@ -import 'Chat/user.dart'; - String uid1; String globalimage; String globalname; String appointmentid; -User user1;