Commit 6d3a8008 authored by Indika NK's avatar Indika NK

Added sending message to medical officer basic items

parent af0bb466
import 'package:covidefender/pages/self_carer/model/MessageSender.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:google_fonts/google_fonts.dart';
class SC_medicalResult extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text('Results'),
),
body: SingleChildScrollView(
child: Container(
color: Colors.white,
child: Column(
children: [
Center(
child: Container(
width: MediaQuery.of(context).size.width,
height: MediaQuery.of(context).size.height / 2.5,
child: Image.asset('lib/assets/images/lab.gif')),
),
SizedBox(
height: 10,
),
Padding(
padding: const EdgeInsets.all(16.0),
child: Text("Request Medical Officer Support",
style: GoogleFonts.lato(
color: Colors.green,
fontSize: 24,
fontWeight: FontWeight.bold,
letterSpacing: 2)),
),
SizedBox(
height: 10,
),
Padding(
padding: const EdgeInsets.fromLTRB(20,50,50,10),
child: Text(
"I agree To send My Details and location to Medical Officer ",
style: GoogleFonts.adamina(color: Colors.blue,fontSize: 16,fontStyle: FontStyle.italic,wordSpacing: 2),
),
),
SizedBox(
height: 60,
),
SizedBox(
height: 70,
width: 350,
child: ElevatedButton(
style: ElevatedButton.styleFrom(
primary: Colors.red[300],
elevation: 15,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(12)
)
),
onPressed: () {
MessageSender m = new MessageSender();
m.SENDSMS();
},
child: Text('SEND SMS',style: GoogleFonts.lato(
fontWeight: FontWeight.bold,
fontSize: 16
),)),
)
],
),
),
),
);
}
}
import 'package:covidefender/pages/self_carer/SC_medicalSupport.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:google_fonts/google_fonts.dart';
......@@ -56,7 +57,9 @@ class SC_resultScreen extends StatelessWidget {
borderRadius: BorderRadius.circular(12)
)
),
onPressed: () {},
onPressed: () {
Navigator.of(context).push(MaterialPageRoute(builder: (context)=>SC_medicalResult()));
},
child: Text('Medical Support',style: GoogleFonts.lato(
fontWeight: FontWeight.bold,
fontSize: 16
......
import 'dart:collection';
import 'package:flutter_sms/flutter_sms.dart';
class MessageSender {
List<String> recipients= ["+94776957629"];
Map<String,String> myDetails = {
"Name" : "Indika Nuwan",
"Address" : "02 nd post ,Mawanella",
"HomePhone" : "03522444555",
"message" : "This Patient Need Imediate assistance"
};
// MessageSender(this.recipients, this.message);
void SENDSMS () async{
print(myDetails.toString());
String result = await sendSMS(message: myDetails.toString(), recipients: recipients).catchError((onError)=>print(onError));
print("result");
}
void SetData(){
}
}
......@@ -36,6 +36,8 @@ dependencies:
# Use with the CupertinoIcons class for iOS style icons.
cupertino_icons: ^1.0.2
google_fonts: ^1.1.2
flutter_sms: ^2.1.1
#add dependencies for heart rate module
charts_flutter: ^0.9.0
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment