Skip to content

Commit

Permalink
Community section implemented with chat and video
Browse files Browse the repository at this point in the history
  • Loading branch information
shubham64mehta committed Oct 4, 2020
1 parent 363839d commit cc3baac
Show file tree
Hide file tree
Showing 33 changed files with 1,397 additions and 238 deletions.
Binary file added assets/girl1.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/girl10.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/girl11.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/girl12.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/girl13.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/girl2.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/girl3.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/girl4.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/girl5.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/girl6.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/girl7.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/girl8.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/girl9.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 2 additions & 0 deletions lib/Appoitment/Appointmentlist.dart
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,8 @@ class _ListState extends State<List> {
check:
snapshot1.data.value['check'],
uid: snapshot1.data.value['uid'],
drimage:
snapshot1.data.value['drimage'],
)));
},
child: Row(
Expand Down
19 changes: 11 additions & 8 deletions lib/Appoitment/Makeapt.dart
Original file line number Diff line number Diff line change
Expand Up @@ -129,16 +129,19 @@ class _MakeaptState extends State<Makeapt> {
return Scaffold(
backgroundColor: Color(0xFFFFC0CB),
appBar: AppBar(
automaticallyImplyLeading: false,
iconTheme: IconThemeData(color: Colors.black),
automaticallyImplyLeading: true,
backgroundColor: Colors.white,
elevation: 0,
title: Text(
"APPOINTMENT FORM",
style: TextStyle(
color: Colors.black,
letterSpacing: 3,
fontSize: 20,
fontWeight: FontWeight.w400),
title: Center(
child: Text(
"APPOINTMENT FORM",
style: TextStyle(
color: Colors.black,
letterSpacing: 3,
fontSize: 20,
fontWeight: FontWeight.w400),
),
),
),
body: SingleChildScrollView(
Expand Down
10 changes: 7 additions & 3 deletions lib/Appoitment/Show.dart
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ class Show extends StatefulWidget {
final String report;
final String check;
final String uid;
final String drimage;
const Show(
{Key key,
this.index,
Expand All @@ -22,7 +23,8 @@ class Show extends StatefulWidget {
this.image,
this.report,
this.check,
this.uid})
this.uid,
this.drimage})
: super(key: key);
@override
_ShowState createState() => _ShowState();
Expand All @@ -33,12 +35,13 @@ class _ShowState extends State<Show> {
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
automaticallyImplyLeading: false,
iconTheme: IconThemeData(color: Colors.black),
automaticallyImplyLeading: true,
backgroundColor: Colors.white,
elevation: 0,
title: Center(
child: Text(
"APPOINNTMENT STATUS",
"APPOINTMENT STATUS",
style: TextStyle(
color: Colors.black,
letterSpacing: 5,
Expand Down Expand Up @@ -148,6 +151,7 @@ class _ShowState extends State<Show> {
MaterialPageRoute(
builder: (context) => MyApp(
uid: widget.uid,
image: widget.drimage,
)));
}
},
Expand Down
3 changes: 2 additions & 1 deletion lib/Appoitment/appointmentrequest.dart
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@ class _RequestState extends State<Request> {
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
automaticallyImplyLeading: false,
iconTheme: IconThemeData(color: Colors.black),
automaticallyImplyLeading: true,
backgroundColor: Colors.white,
elevation: 0,
title: Center(
Expand Down
150 changes: 150 additions & 0 deletions lib/Appoitment/bot.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,150 @@
import 'package:bubble/bubble.dart';
import 'package:flutter/material.dart';
import 'package:flutter_dialogflow/dialogflow_v2.dart';
import 'package:hackathon2/global.dart';

class MyApp extends StatefulWidget {
final String drimag;

const MyApp({Key key, this.drimag}) : super(key: key);

@override
_MyAppState createState() => _MyAppState();
}

class _MyAppState extends State<MyApp> {
void response(query) async {
AuthGoogle authGoogle =
await AuthGoogle(fileJson: "assets/pink-288804-5fbc02059449.json")
.build();
Dialogflow dialogflow =
Dialogflow(authGoogle: authGoogle, language: Language.english);
AIResponse aiResponse = await dialogflow.detectIntent(query);
setState(() {
messsages.insert(0, {
"data": 0,
"message": aiResponse.getListMessage()[0]["text"]["text"][0].toString()
});
});
}

final messageInsert = TextEditingController();
List<Map> messsages = List();

@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
leading: IconButton(
icon: Icon(Icons.arrow_back, color: Colors.black),
onPressed: () {
Navigator.pop(context);
}),
backgroundColor: Colors.white,
elevation: 0,
title: Center(
child: Text(
"CHAT",
style: TextStyle(
color: Colors.black,
letterSpacing: 5,
fontSize: 20,
fontWeight: FontWeight.w400),
),
),
),
body: Container(
child: Column(
children: <Widget>[
Flexible(
child: ListView.builder(
reverse: true,
itemCount: messsages.length,
itemBuilder: (context, index) => chat(
messsages[index]["message"].toString(),
messsages[index]["data"]))),
Divider(
height: 5.0,
color: Colors.deepOrange,
),
Container(
padding: EdgeInsets.only(left: 15.0, right: 15.0),
margin: const EdgeInsets.symmetric(horizontal: 8.0),
child: Row(
children: <Widget>[
Flexible(
child: TextField(
controller: messageInsert,
decoration: InputDecoration.collapsed(
hintText: "Send your message",
hintStyle: TextStyle(
fontWeight: FontWeight.bold, fontSize: 18.0)),
)),
Container(
margin: EdgeInsets.symmetric(horizontal: 4.0),
child: IconButton(
icon: Icon(
Icons.send,
size: 30.0,
color: Colors.black,
),
onPressed: () {
if (messageInsert.text.isEmpty) {
print("empty message");
} else {
setState(() {
messsages.insert(0,
{"data": 1, "message": messageInsert.text});
});
response(messageInsert.text);
messageInsert.clear();
}
}),
)
],
),
),
SizedBox(
height: 15.0,
)
],
),
),
);
}

//for better one i have use the bubble package check out the pubspec.yaml

Widget chat(String message, int data) {
return Padding(
padding: EdgeInsets.all(10.0),
child: Bubble(
radius: Radius.circular(15.0),
color: data == 0 ? Colors.pink[100] : Colors.pink[100],
elevation: 0.0,
alignment: data == 0 ? Alignment.topLeft : Alignment.topRight,
nip: data == 0 ? BubbleNip.leftBottom : BubbleNip.rightTop,
child: Padding(
padding: EdgeInsets.all(2.0),
child: Row(
mainAxisSize: MainAxisSize.min,
children: <Widget>[
CircleAvatar(
backgroundImage:
NetworkImage(data == 0 ? widget.drimag : globalimage),
),
SizedBox(
width: 10.0,
),
Flexible(
child: Text(
message,
style: TextStyle(
color: Colors.white, fontWeight: FontWeight.bold),
))
],
),
)),
);
}
}
Loading

0 comments on commit cc3baac

Please sign in to comment.