Commit 1c336c23 authored by Nilupul Jayasekara's avatar Nilupul Jayasekara

finalize the main functionalities

parent d3d97f22
This source diff could not be displayed because it is too large. You can view the blob instead.
...@@ -5,6 +5,7 @@ ...@@ -5,6 +5,7 @@
<uses-permission android:name="android.permission.WAKE_LOCK"/> <uses-permission android:name="android.permission.WAKE_LOCK"/>
<!-- For apps with targetSDK=31 (Android 12) --> <!-- For apps with targetSDK=31 (Android 12) -->
<uses-permission android:name="android.permission.SCHEDULE_EXACT_ALARM"/> <uses-permission android:name="android.permission.SCHEDULE_EXACT_ALARM"/>
<queries> <intent> <action android:name="android.intent.action.SENDTO" /> <data android:scheme="mailto" /> </intent> </queries>
<application <application
android:label="DiaBeta" android:label="DiaBeta"
android:name="${applicationName}" android:name="${applicationName}"
......
diabeta_app/assets/images/profile.png

8.69 KB | W: | H:

diabeta_app/assets/images/profile.png

78.2 KB | W: | H:

diabeta_app/assets/images/profile.png
diabeta_app/assets/images/profile.png
diabeta_app/assets/images/profile.png
diabeta_app/assets/images/profile.png
  • 2-up
  • Swipe
  • Onion skin
import 'package:diabeta_app/components/constants.dart'; import 'package:diabeta_app/components/constants.dart';
import 'package:diabeta_app/screens/auth_screen.dart';
import 'package:diabeta_app/screens/login_screen.dart'; import 'package:diabeta_app/screens/login_screen.dart';
import 'package:diabeta_app/screens/main_screen.dart';
import 'package:firebase_auth/firebase_auth.dart'; import 'package:firebase_auth/firebase_auth.dart';
import 'package:firebase_core/firebase_core.dart'; import 'package:firebase_core/firebase_core.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
...@@ -13,7 +13,7 @@ void main() async { ...@@ -13,7 +13,7 @@ void main() async {
class MyApp extends StatelessWidget { class MyApp extends StatelessWidget {
const MyApp({Key? key}) : super(key: key); const MyApp({Key? key}) : super(key: key);
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
var _currentUser = FirebaseAuth.instance.currentUser; var _currentUser = FirebaseAuth.instance.currentUser;
...@@ -24,8 +24,7 @@ class MyApp extends StatelessWidget { ...@@ -24,8 +24,7 @@ class MyApp extends StatelessWidget {
theme: ThemeData( theme: ThemeData(
primarySwatch: kPrimaryColor, primarySwatch: kPrimaryColor,
), ),
home: LoginScreen(), home: _currentUser != null ? const AuthScreen() : const LoginScreen(),
// home: _currentUser != null ? MainScreen() : const LoginScreen(),
); );
} }
} }
class AccountInfo {
String? id;
String? uid;
String? fullname;
String? email;
String? mobile;
String? diabetesType;
String? gender;
DateTime? dob;
DateTime? yod;
AccountInfo({
this.id,
this.uid,
this.fullname,
this.email,
this.mobile,
this.diabetesType,
this.dob,
this.gender,
this.yod});
}
...@@ -23,7 +23,7 @@ class HealthQuestions { ...@@ -23,7 +23,7 @@ class HealthQuestions {
question: "What is your hieght?", question: "What is your hieght?",
type: QuesType.withSlider, type: QuesType.withSlider,
minValue: 1, minValue: 1,
maxValue: 120, maxValue: 200,
defaultValue: 20, defaultValue: 20,
unit: "cm", unit: "cm",
subText: "Your Height"), subText: "Your Height"),
...@@ -32,8 +32,8 @@ class HealthQuestions { ...@@ -32,8 +32,8 @@ class HealthQuestions {
question: "What is your weight?", question: "What is your weight?",
type: QuesType.withSlider, type: QuesType.withSlider,
minValue: 1, minValue: 1,
maxValue: 100, maxValue: 200,
defaultValue: 20, defaultValue: 60,
unit: "Kg", unit: "Kg",
subText: "Your Weight"), subText: "Your Weight"),
DiabetesQues( DiabetesQues(
...@@ -143,7 +143,7 @@ class HealthQuestions { ...@@ -143,7 +143,7 @@ class HealthQuestions {
type: QuesType.withSlider, type: QuesType.withSlider,
minValue: 80, minValue: 80,
maxValue: 300, maxValue: 300,
defaultValue: 20, defaultValue: 100,
unit: "mg/dL", unit: "mg/dL",
subText: "Your Cholesterol"), subText: "Your Cholesterol"),
DiabetesQues( DiabetesQues(
......
import 'package:diabeta_app/components/constants.dart';
import 'package:diabeta_app/screens/main_screen.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:local_auth/local_auth.dart';
import 'package:shared_preferences/shared_preferences.dart';
class AuthScreen extends StatefulWidget {
const AuthScreen({Key? key}) : super(key: key);
@override
State<AuthScreen> createState() => _AuthScreenState();
}
enum _SupportState {
unknown,
supported,
unsupported,
}
class _AuthScreenState extends State<AuthScreen> {
final LocalAuthentication auth = LocalAuthentication();
_SupportState _supportState = _SupportState.unknown;
bool? _canCheckBiometrics;
List<BiometricType>? _availableBiometrics;
String _authorized = 'Not Authorized';
bool _isAuthenticating = false;
bool isLoad = true;
final Future<SharedPreferences> _prefs = SharedPreferences.getInstance();
Future<void> _authenticateWithBiometrics() async {
SharedPreferences prefs = await _prefs;
bool authenticated = false;
if (prefs.getBool("isAppLock") == null) {
prefs.setBool("isAppLock", false);
}
if (prefs.getBool("isAppLock")!) {
isLoad = false;
try {
setState(() {
_isAuthenticating = true;
_authorized = 'Authenticating';
});
authenticated = await auth.authenticate(
localizedReason: 'Scan your fingerprint to authenticate',
options: const AuthenticationOptions(
stickyAuth: true,
biometricOnly: true,
),
);
setState(() {
_isAuthenticating = false;
_authorized = 'Authenticating';
});
} on PlatformException catch (e) {
setState(() {
_isAuthenticating = false;
_authorized = 'Error - ${e.message}';
});
return;
}
if (!mounted) {
return;
}
if (authenticated) {
Navigator.push(
context,
MaterialPageRoute(builder: (context) => const MainScreen()),
);
}
} else {
Navigator.push(
context,
MaterialPageRoute(builder: (context) => const MainScreen()),
);
}
}
@override
void initState() {
auth.isDeviceSupported().then(
(bool isSupported) => setState(() => _supportState = isSupported
? _SupportState.supported
: _SupportState.unsupported),
);
_authenticateWithBiometrics();
super.initState();
}
@override
Widget build(BuildContext context) {
return Scaffold(
backgroundColor: Colors.white,
body: isLoad
? Column(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Column(
children: [
Padding(
padding: const EdgeInsets.only(top: 40.0),
child: Image.asset(
"assets/images/frontlogo.png",
width: 300,
height: 300,
),
),
const Center(
child: Text(
"DiaBeta",
style: TextStyle(fontSize: 36, color: Colors.teal),
),
),
],
),
InkWell(
onTap: () {
Navigator.push(
context,
MaterialPageRoute(
builder: (context) => const MainScreen()),
);
},
child: Padding(
padding: const EdgeInsets.only(bottom: 40),
child: Text(
"Continue",
style: TextStyle(
color: kPrimaryColor,
fontWeight: FontWeight.bold,
fontSize: 16),
),
),
),
],
)
: Column(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Column(
children: [
Padding(
padding: const EdgeInsets.only(top: 40.0),
child: Image.asset(
"assets/images/frontlogo.png",
width: 300,
height: 300,
),
),
const Center(
child: Text(
"DiaBeta Locked",
style: TextStyle(fontSize: 24, color: Colors.teal),
),
),
],
),
InkWell(
onTap: () {
_authenticateWithBiometrics();
},
child: Padding(
padding: const EdgeInsets.only(bottom: 40),
child: Text(
"Unlock",
style: TextStyle(
color: kPrimaryColor,
fontWeight: FontWeight.bold,
fontSize: 16),
),
),
),
],
),
);
}
}
...@@ -9,8 +9,10 @@ import 'package:diabeta_app/screens/reports/report_screen.dart'; ...@@ -9,8 +9,10 @@ import 'package:diabeta_app/screens/reports/report_screen.dart';
import 'package:diabeta_app/services/diabates_predict_service.dart'; import 'package:diabeta_app/services/diabates_predict_service.dart';
import 'package:diabeta_app/services/glucose_log_service.dart'; import 'package:diabeta_app/services/glucose_log_service.dart';
import 'package:firebase_auth/firebase_auth.dart'; import 'package:firebase_auth/firebase_auth.dart';
import 'package:firebase_database/firebase_database.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:intl/intl.dart'; import 'package:intl/intl.dart';
import 'package:shared_preferences/shared_preferences.dart';
import 'package:syncfusion_flutter_charts/charts.dart'; import 'package:syncfusion_flutter_charts/charts.dart';
import '../model/glucose_data.dart'; import '../model/glucose_data.dart';
...@@ -27,9 +29,39 @@ class _DashboardScreenState extends State<DashboardScreen> { ...@@ -27,9 +29,39 @@ class _DashboardScreenState extends State<DashboardScreen> {
List<SplineAreaWeightData> _chartData = <SplineAreaWeightData>[]; List<SplineAreaWeightData> _chartData = <SplineAreaWeightData>[];
List<SplineAreaWeightData> _chartData1 = <SplineAreaWeightData>[]; List<SplineAreaWeightData> _chartData1 = <SplineAreaWeightData>[];
final _currentUser = FirebaseAuth.instance.currentUser; final _currentUser = FirebaseAuth.instance.currentUser;
final Future<SharedPreferences> _prefs = SharedPreferences.getInstance();
bool ismodelCalled = false;
int color = 0xFF34eb43;
void _changeGlucoseColor(int glucose) {
if (glucose > 315) {
setState(() {
color = 0xFFff0000;
});
} else if (glucose > 180) {
setState(() {
color = 0xFFfa5c5c;
});
} else if (glucose > 120) {
setState(() {
color = 0xFFff9d00;
});
} else if (glucose > 70) {
setState(() {
color = 0xFF34eb43;
});
} else if (glucose > 0) {
setState(() {
color = 0xFFff0000;
});
}
}
void getChartData() async { void getChartData() async {
List<SplineAreaWeightData> _data = <SplineAreaWeightData>[]; List<SplineAreaWeightData> _data = <SplineAreaWeightData>[];
final SharedPreferences prefs = await _prefs;
var glucoseData = []; var glucoseData = [];
List data = await GlucoseLogService.getRecordsByTimeFrame( List data = await GlucoseLogService.getRecordsByTimeFrame(
_currentUser!.uid, "This year", _currentUser!.uid, "This year",
...@@ -61,7 +93,10 @@ class _DashboardScreenState extends State<DashboardScreen> { ...@@ -61,7 +93,10 @@ class _DashboardScreenState extends State<DashboardScreen> {
} }
}); });
if (lastDate != null) { if (prefs.getBool("isForecast") == null) {
prefs.setBool("isForecast", true);
}
if (lastDate != null && prefs.getBool("isForecast")!) {
String futureData = await DiabatesPredictService.getFuturGlucoseLevel( String futureData = await DiabatesPredictService.getFuturGlucoseLevel(
DateTime(lastDate!.year, lastDate!.month, lastDate!.day + 1), DateTime(lastDate!.year, lastDate!.month, lastDate!.day + 1),
glucoseData); glucoseData);
...@@ -113,6 +148,19 @@ class _DashboardScreenState extends State<DashboardScreen> { ...@@ -113,6 +148,19 @@ class _DashboardScreenState extends State<DashboardScreen> {
void initState() { void initState() {
//initialaizeLineChart(); //initialaizeLineChart();
getChartData(); getChartData();
DatabaseReference starCountRef = FirebaseDatabase.instance.ref('2/Glucose');
starCountRef.onValue.listen((DatabaseEvent event) {
final data = event.snapshot.value;
print(data);
if (mounted) {
setState(() {
if (data != 0 && !ismodelCalled) {
ismodelCalled = true;
showModelDialog(int.parse(data.toString()));
}
});
}
});
super.initState(); super.initState();
} }
...@@ -127,7 +175,7 @@ class _DashboardScreenState extends State<DashboardScreen> { ...@@ -127,7 +175,7 @@ class _DashboardScreenState extends State<DashboardScreen> {
Navigator.push( Navigator.push(
context, context,
MaterialPageRoute(builder: (context) => const GlucoseLogScreen()), MaterialPageRoute(builder: (context) => const GlucoseLogScreen()),
).then((_) => setState(() {})); );
}, },
child: const Icon(Icons.add)), child: const Icon(Icons.add)),
body: ListView( body: ListView(
...@@ -400,4 +448,173 @@ class _DashboardScreenState extends State<DashboardScreen> { ...@@ -400,4 +448,173 @@ class _DashboardScreenState extends State<DashboardScreen> {
), ),
); );
} }
void showModelDialog(int glucose) async {
final SharedPreferences prefs = await _prefs;
if (prefs.getBool("isDiaBetaConnect") == null) {
prefs.setBool("isDiaBetaConnect", false);
} else {
if (prefs.getBool("isDiaBetaConnect")!) {
_changeGlucoseColor(glucose);
showModalBottomSheet(
context: context,
backgroundColor: Colors.transparent,
builder: (context) {
return Container(
height: 500,
decoration: BoxDecoration(
color: Colors.white,
borderRadius: const BorderRadius.only(
topLeft: Radius.circular(40.0),
topRight: Radius.circular(40.0),
)),
child: Column(
children: [
SizedBox(
height: 16,
),
Padding(
padding: const EdgeInsets.symmetric(horizontal: 16.0),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
InkWell(
child: const Text(
'Close',
style: TextStyle(
fontSize: 16,
color: Colors.teal,
fontWeight: FontWeight.bold),
),
onTap: () {
FirebaseDatabase.instance
.ref('2/Glucose')
.set(0)
.then((_) {
ismodelCalled = false;
Navigator.pop(context);
}).catchError((error) {});
},
),
const Text(
'Glucometer',
style: TextStyle(
fontSize: 18, fontWeight: FontWeight.bold),
),
InkWell(
child: const Text(
'Done',
style: TextStyle(
fontSize: 16,
color: Colors.teal,
fontWeight: FontWeight.bold),
),
onTap: () {
setState(() {});
FirebaseDatabase.instance
.ref('2/Glucose')
.set(0)
.then((_) {
ismodelCalled = false;
Navigator.push(
context,
MaterialPageRoute(
builder: (context) => GlucoseLogScreen(
glucose: glucose.toString(),
)),
);
}).catchError((error) {});
},
),
],
),
),
Divider(
color: kPrimaryColor,
),
Stack(
children: [
Center(
child: Image.asset(
"assets/images/glucometer.png",
width: 250,
height: 350,
),
),
Padding(
padding: const EdgeInsets.only(
top: 145,
),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Center(
child: Column(
children: [
Text(
"Glucose level",
),
SizedBox(
height: 16,
),
Text(
glucose.toString() + " mg/dL",
style: TextStyle(
fontSize: 26, color: Color(color)),
)
],
),
),
// SizedBox(
// height: 16,
// ),
// Padding(
// padding: const EdgeInsets.only(left: 100.0),
// child: Column(
// children: [
// Row(
// children: [
// Text(
// 'Heart rate : ',
// style: TextStyle(fontSize: 12),
// ),
// Text(
// "187.53 bpm",
// style: TextStyle(fontSize: 12),
// )
// ],
// ),
// Row(
// children: [
// Text(
// 'Oxygen level : ',
// style: TextStyle(fontSize: 12),
// ),
// Text(
// "97%",
// style: TextStyle(fontSize: 12),
// )
// ],
// ),
// ],
// ),
// )
],
),
)
],
),
],
),
);
}).whenComplete(_onBottomSheetClosed);
}
}
}
void _onBottomSheetClosed() {
FirebaseDatabase.instance.ref('2/Glucose').set(0).then((_) {
ismodelCalled = false;
}).catchError((error) {});
}
} }
import 'package:diabeta_app/components/constants.dart'; import 'package:diabeta_app/components/constants.dart';
import 'package:diabeta_app/model/log_entry.dart'; import 'package:diabeta_app/model/log_entry.dart';
import 'package:diabeta_app/screens/diabetes/components/b_card.dart'; import 'package:diabeta_app/screens/diabetes/components/b_card.dart';
import 'package:diabeta_app/screens/main_screen.dart';
import 'package:diabeta_app/services/glucose_log_service.dart'; import 'package:diabeta_app/services/glucose_log_service.dart';
import 'package:firebase_auth/firebase_auth.dart'; import 'package:firebase_auth/firebase_auth.dart';
import 'package:firebase_database/firebase_database.dart'; import 'package:firebase_database/firebase_database.dart';
...@@ -11,8 +12,9 @@ import '../../../components/yes_no_model.dart'; ...@@ -11,8 +12,9 @@ import '../../../components/yes_no_model.dart';
class GlucoseLogScreen extends StatefulWidget { class GlucoseLogScreen extends StatefulWidget {
final String title; final String title;
final String? glucose;
final LogEntry? logEntry; final LogEntry? logEntry;
const GlucoseLogScreen({Key? key, this.title = "", this.logEntry}) const GlucoseLogScreen({Key? key, this.title = "", this.logEntry, this.glucose})
: super(key: key); : super(key: key);
@override @override
...@@ -55,20 +57,13 @@ class _GlucoseLogScreenState extends State<GlucoseLogScreen> { ...@@ -55,20 +57,13 @@ class _GlucoseLogScreenState extends State<GlucoseLogScreen> {
@override @override
void initState() { void initState() {
DatabaseReference starCountRef = FirebaseDatabase.instance.ref('2/Glucose'); if(widget.glucose != null){
starCountRef.onValue.listen((DatabaseEvent event) { _glucoseController.text = widget.glucose!;
final data = event.snapshot.value; _changeGlucoseColor(int.parse(widget.glucose!));
print(data); }
if (mounted) {
setState(() {
if (data != 0) {
_glucoseController.text = data.toString();
}
});
}
});
if (widget.title != "") { if (widget.title != "") {
if (widget.logEntry!.glucoseLevel != null) { if (widget.logEntry!.glucoseLevel != null) {
_changeGlucoseColor(widget.logEntry!.glucoseLevel!.toInt());
_glucoseController.text = widget.logEntry!.glucoseLevel.toString(); _glucoseController.text = widget.logEntry!.glucoseLevel.toString();
} }
if (widget.logEntry!.carbs != null) { if (widget.logEntry!.carbs != null) {
...@@ -244,15 +239,14 @@ class _GlucoseLogScreenState extends State<GlucoseLogScreen> { ...@@ -244,15 +239,14 @@ class _GlucoseLogScreenState extends State<GlucoseLogScreen> {
? <Widget>[ ? <Widget>[
IconButton( IconButton(
onPressed: () async { onPressed: () async {
FirebaseDatabase.instance.ref('2/Glucose').set(0).then((_) {
// Data saved successfully!
}).catchError((error) {
// The write failed...
});
if (_formKey.currentState!.validate()) { if (_formKey.currentState!.validate()) {
bool result = await _addRecord(); bool result = await _addRecord();
if (result) { if (result) {
Navigator.pop(context); Navigator.push(
context,
MaterialPageRoute(
builder: (context) => MainScreen()),
);
} }
} }
}, },
......
...@@ -404,6 +404,10 @@ class _FoodRecommendationScreenState extends State<FoodRecommendationScreen> { ...@@ -404,6 +404,10 @@ class _FoodRecommendationScreenState extends State<FoodRecommendationScreen> {
clean_input += "notdesert "; clean_input += "notdesert ";
} }
if(vegNonVeg == "Non Veg"){
vegNonVeg = "non";
}
clean_input += foodType+' '; clean_input += foodType+' ';
clean_input += vegNonVeg+ ' '; clean_input += vegNonVeg+ ' ';
......
...@@ -5,6 +5,7 @@ import 'package:diabeta_app/screens/health/eye_risk_screen.dart'; ...@@ -5,6 +5,7 @@ import 'package:diabeta_app/screens/health/eye_risk_screen.dart';
import 'package:diabeta_app/screens/health/heart_risk_screen.dart'; import 'package:diabeta_app/screens/health/heart_risk_screen.dart';
import 'package:diabeta_app/screens/health/kidney_risk_screen.dart'; import 'package:diabeta_app/screens/health/kidney_risk_screen.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:url_launcher/url_launcher.dart';
import 'diabetes/screens/quiz_screen1.dart'; import 'diabetes/screens/quiz_screen1.dart';
...@@ -16,6 +17,12 @@ class HealthCheckScreen extends StatefulWidget { ...@@ -16,6 +17,12 @@ class HealthCheckScreen extends StatefulWidget {
} }
class _HealthCheckScreenState extends State<HealthCheckScreen> { class _HealthCheckScreenState extends State<HealthCheckScreen> {
Future<void> _launchUrl(_url) async {
if (!await launchUrl(Uri.parse(_url))) {
throw 'Could not launch $_url';
}
}
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Scaffold( return Scaffold(
...@@ -43,27 +50,27 @@ class _HealthCheckScreenState extends State<HealthCheckScreen> { ...@@ -43,27 +50,27 @@ class _HealthCheckScreenState extends State<HealthCheckScreen> {
topLeft: Radius.circular(40.0), topLeft: Radius.circular(40.0),
topRight: Radius.circular(40.0), topRight: Radius.circular(40.0),
)), )),
child: InkWell( child: Padding(
onTap: () { padding: const EdgeInsets.symmetric(
Navigator.push( horizontal: 32, vertical: 32),
context, child: Column(
MaterialPageRoute( crossAxisAlignment: CrossAxisAlignment.start,
builder: (context) => const QuizScreen1()), children: [
); const Text(
}, 'Could You Have Prediabetes?',
child: Padding( style: TextStyle(
padding: const EdgeInsets.symmetric( fontSize: 18, fontWeight: FontWeight.bold),
horizontal: 32, vertical: 32), ),
child: Column( InkWell(
crossAxisAlignment: CrossAxisAlignment.start, onTap: () {
children: [ Navigator.push(
const Text( context,
'Could You Have Prediabetes?', MaterialPageRoute(
style: TextStyle( builder: (context) =>
fontSize: 18, const QuizScreen1()),
fontWeight: FontWeight.bold), );
), },
Padding( child: Padding(
padding: const EdgeInsets.only( padding: const EdgeInsets.only(
top: 8.0, bottom: 16.0), top: 8.0, bottom: 16.0),
child: Container( child: Container(
...@@ -83,44 +90,44 @@ class _HealthCheckScreenState extends State<HealthCheckScreen> { ...@@ -83,44 +90,44 @@ class _HealthCheckScreenState extends State<HealthCheckScreen> {
)), )),
), ),
), ),
const Text( ),
'Could You Have Type 2 Diabetes?', const Text(
style: TextStyle( 'Could You Have Type 2 Diabetes?',
fontSize: 18, style: TextStyle(
fontWeight: FontWeight.bold), fontSize: 18, fontWeight: FontWeight.bold),
), ),
InkWell( InkWell(
onTap: () { onTap: () {
Navigator.push( _launchUrl("https://diabeta.000webhostapp.com/educations.html");
context, // Navigator.push(
MaterialPageRoute( // context,
builder: (context) => // MaterialPageRoute(
const QuizScreen()), // builder: (context) =>
); // const QuizScreen()),
}, // );
child: Padding( },
padding: const EdgeInsets.only( child: Padding(
top: 8.0, bottom: 16.0), padding: const EdgeInsets.only(
child: Container( top: 8.0, bottom: 16.0),
height: 40, child: Container(
width: 200, height: 40,
decoration: const BoxDecoration( width: 200,
color: kPrimaryColor, decoration: const BoxDecoration(
borderRadius: BorderRadius.all( color: kPrimaryColor,
Radius.circular(10.0), borderRadius: BorderRadius.all(
)), Radius.circular(10.0),
child: const Center( )),
child: Text( child: const Center(
'TAKE THE TEST', child: Text(
style: TextStyle( 'TAKE THE TEST',
fontWeight: FontWeight.bold, style: TextStyle(
color: Colors.white), fontWeight: FontWeight.bold,
)), color: Colors.white),
), )),
), ),
), ),
], ),
), ],
), ),
)); ));
}); });
...@@ -143,7 +150,8 @@ class _HealthCheckScreenState extends State<HealthCheckScreen> { ...@@ -143,7 +150,8 @@ class _HealthCheckScreenState extends State<HealthCheckScreen> {
onTap: () { onTap: () {
Navigator.push( Navigator.push(
context, context,
MaterialPageRoute(builder: (context) => const HeartRiskScreen()), MaterialPageRoute(
builder: (context) => const HeartRiskScreen()),
); );
}, },
), ),
...@@ -167,7 +175,8 @@ class _HealthCheckScreenState extends State<HealthCheckScreen> { ...@@ -167,7 +175,8 @@ class _HealthCheckScreenState extends State<HealthCheckScreen> {
onTap: () { onTap: () {
Navigator.push( Navigator.push(
context, context,
MaterialPageRoute(builder: (context) => const KidneyRiskScreen()), MaterialPageRoute(
builder: (context) => const KidneyRiskScreen()),
); );
}, },
), ),
......
import 'package:diabeta_app/components/constants.dart';
import 'package:diabeta_app/screens/main_screen.dart'; import 'package:diabeta_app/screens/main_screen.dart';
import 'package:diabeta_app/screens/register_screen.dart'; import 'package:diabeta_app/screens/register_screen.dart';
import 'package:firebase_auth/firebase_auth.dart'; import 'package:firebase_auth/firebase_auth.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:local_auth/local_auth.dart';
class LoginScreen extends StatefulWidget { class LoginScreen extends StatefulWidget {
const LoginScreen({Key? key}) : super(key: key); const LoginScreen({Key? key}) : super(key: key);
...@@ -13,19 +10,7 @@ class LoginScreen extends StatefulWidget { ...@@ -13,19 +10,7 @@ class LoginScreen extends StatefulWidget {
State<LoginScreen> createState() => _LoginScreenState(); State<LoginScreen> createState() => _LoginScreenState();
} }
enum _SupportState {
unknown,
supported,
unsupported,
}
class _LoginScreenState extends State<LoginScreen> { class _LoginScreenState extends State<LoginScreen> {
final LocalAuthentication auth = LocalAuthentication();
_SupportState _supportState = _SupportState.unknown;
bool? _canCheckBiometrics;
List<BiometricType>? _availableBiometrics;
String _authorized = 'Not Authorized';
bool _isAuthenticating = false;
final GlobalKey<FormState> _formKey = GlobalKey<FormState>(); final GlobalKey<FormState> _formKey = GlobalKey<FormState>();
final TextEditingController _userNameController = TextEditingController(); final TextEditingController _userNameController = TextEditingController();
final TextEditingController _passwordController = TextEditingController(); final TextEditingController _passwordController = TextEditingController();
...@@ -35,52 +20,6 @@ class _LoginScreenState extends State<LoginScreen> { ...@@ -35,52 +20,6 @@ class _LoginScreenState extends State<LoginScreen> {
@override @override
void initState() { void initState() {
super.initState(); super.initState();
auth.isDeviceSupported().then(
(bool isSupported) => setState(() => _supportState = isSupported
? _SupportState.supported
: _SupportState.unsupported),
);
_authenticateWithBiometrics();
}
Future<void> _authenticateWithBiometrics() async {
bool authenticated = false;
try {
setState(() {
_isAuthenticating = true;
_authorized = 'Authenticating';
});
authenticated = await auth.authenticate(
localizedReason:
'Scan your fingerprint to authenticate',
options: const AuthenticationOptions(
stickyAuth: true,
biometricOnly: true,
),
);
setState(() {
_isAuthenticating = false;
_authorized = 'Authenticating';
});
} on PlatformException catch (e) {
print(e);
setState(() {
_isAuthenticating = false;
_authorized = 'Error - ${e.message}';
});
return;
}
if (!mounted) {
return;
}
final String message = authenticated ? 'Authorized' : 'Not Authorized';
if(authenticated){
Navigator.push(
context,
MaterialPageRoute(builder: (context) => const MainScreen()),
);
}
} }
@override @override
...@@ -96,7 +35,7 @@ class _LoginScreenState extends State<LoginScreen> { ...@@ -96,7 +35,7 @@ class _LoginScreenState extends State<LoginScreen> {
child: Image.asset( child: Image.asset(
"assets/images/frontlogo.png", "assets/images/frontlogo.png",
width: 300, width: 300,
height: 350, height: 300,
), ),
), ),
const Center( const Center(
...@@ -176,20 +115,6 @@ class _LoginScreenState extends State<LoginScreen> { ...@@ -176,20 +115,6 @@ class _LoginScreenState extends State<LoginScreen> {
if (_formKey.currentState!.validate()) { if (_formKey.currentState!.validate()) {
_login(); _login();
} }
// if (_userNameController.text == "amal" &&
// _passwordController.text == "1234") {
// Navigator.push(
// context,
// MaterialPageRoute(
// builder: (context) => const MainScreen()),
// );
// } else {
// const snackBar = SnackBar(
// content: Text("Invalid username or password."),
// backgroundColor: Colors.red);
// ScaffoldMessenger.of(context)
// .showSnackBar(snackBar);
// }
}, },
child: const Text( child: const Text(
'Login', 'Login',
...@@ -203,9 +128,7 @@ class _LoginScreenState extends State<LoginScreen> { ...@@ -203,9 +128,7 @@ class _LoginScreenState extends State<LoginScreen> {
), ),
), ),
), ),
SizedBox(
height: 16,
),
const Padding( const Padding(
padding: EdgeInsets.symmetric(vertical: 16.0), padding: EdgeInsets.symmetric(vertical: 16.0),
child: Center( child: Center(
...@@ -291,6 +214,9 @@ class _LoginScreenState extends State<LoginScreen> { ...@@ -291,6 +214,9 @@ class _LoginScreenState extends State<LoginScreen> {
// ); // );
// }, // },
// ), // ),
const SizedBox(
height: 24,
),
], ],
), ),
), ),
......
import 'package:diabeta_app/model/account_info.dart';
import 'package:diabeta_app/screens/diabetes/screens/logbook_screen.dart'; import 'package:diabeta_app/screens/diabetes/screens/logbook_screen.dart';
import 'package:diabeta_app/screens/diabetes/screens/print_log_screen.dart'; import 'package:diabeta_app/screens/diabetes/screens/print_log_screen.dart';
import 'package:diabeta_app/screens/exercise/exercise_main_screen.dart'; import 'package:diabeta_app/screens/exercise/exercise_main_screen.dart';
...@@ -7,6 +8,7 @@ import 'package:diabeta_app/screens/dashboard_screen.dart'; ...@@ -7,6 +8,7 @@ import 'package:diabeta_app/screens/dashboard_screen.dart';
import 'package:diabeta_app/screens/reminders/reminder_screen.dart'; import 'package:diabeta_app/screens/reminders/reminder_screen.dart';
import 'package:diabeta_app/screens/reports/report_screen.dart'; import 'package:diabeta_app/screens/reports/report_screen.dart';
import 'package:diabeta_app/screens/settings/settings_screen.dart'; import 'package:diabeta_app/screens/settings/settings_screen.dart';
import 'package:diabeta_app/services/account_service.dart';
import 'package:firebase_auth/firebase_auth.dart'; import 'package:firebase_auth/firebase_auth.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import '../components/constants.dart'; import '../components/constants.dart';
...@@ -24,6 +26,21 @@ class _MainScreenState extends State<MainScreen> { ...@@ -24,6 +26,21 @@ class _MainScreenState extends State<MainScreen> {
String period = "All records"; String period = "All records";
String _title = "DiaBeta"; String _title = "DiaBeta";
final _currentUser = FirebaseAuth.instance.currentUser; final _currentUser = FirebaseAuth.instance.currentUser;
String fullname = "";
@override
void initState() {
getAccountInfo();
super.initState();
}
void getAccountInfo() async {
AccountInfo accountInfo =
await AccountService.getAccountInfoByID(_currentUser!.uid);
setState(() {
fullname = accountInfo.fullname ?? "";
});
}
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
...@@ -88,7 +105,7 @@ class _MainScreenState extends State<MainScreen> { ...@@ -88,7 +105,7 @@ class _MainScreenState extends State<MainScreen> {
), ),
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center,
children: [ children: [
const Padding( const Padding(
padding: EdgeInsets.all(4.0), padding: EdgeInsets.all(4.0),
child: CircleAvatar( child: CircleAvatar(
...@@ -100,7 +117,7 @@ class _MainScreenState extends State<MainScreen> { ...@@ -100,7 +117,7 @@ class _MainScreenState extends State<MainScreen> {
Padding( Padding(
padding: const EdgeInsets.all(4.0), padding: const EdgeInsets.all(4.0),
child: Text( child: Text(
_currentUser!.displayName.toString(), fullname,
style: const TextStyle(color: Colors.white), style: const TextStyle(color: Colors.white),
), ),
), ),
...@@ -282,30 +299,23 @@ class _MainScreenState extends State<MainScreen> { ...@@ -282,30 +299,23 @@ class _MainScreenState extends State<MainScreen> {
Navigator.pop(context); Navigator.pop(context);
}, },
), ),
ListTile( // ListTile(
title: Row( // title: Row(
children: const [ // children: const [
Icon( // Icon(
Icons.exit_to_app, // Icons.exit_to_app,
color: kPrimaryColor, // color: kPrimaryColor,
), // ),
SizedBox( // SizedBox(
width: 8, // width: 8,
), // ),
Text('Logout') // Text('Logout')
], // ],
), // ),
onTap: () async { // onTap: () async {
try {
await FirebaseAuth.instance.signOut(); // },
Navigator.of(context).pushReplacement( // ),
MaterialPageRoute(
builder: (context) => const LoginScreen(),
),
);
} on FirebaseAuthException catch (e) {}
},
),
], ],
), ),
), ),
...@@ -335,42 +345,44 @@ class _MainScreenState extends State<MainScreen> { ...@@ -335,42 +345,44 @@ class _MainScreenState extends State<MainScreen> {
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Padding( Container(
padding: const EdgeInsets.symmetric(horizontal: 16.0), child: Padding(
child: Row( padding: const EdgeInsets.symmetric(horizontal: 16.0),
mainAxisAlignment: MainAxisAlignment.spaceBetween, child: Row(
children: [ mainAxisAlignment: MainAxisAlignment.spaceBetween,
InkWell( children: [
child: const Text( InkWell(
'Close', child: const Text(
style: TextStyle( 'Close',
fontSize: 16, style: TextStyle(
color: Colors.teal, fontSize: 16,
fontWeight: FontWeight.bold), color: Colors.teal,
fontWeight: FontWeight.bold),
),
onTap: () {
Navigator.pop(context);
},
), ),
onTap: () { const Text(
Navigator.pop(context); 'Filter',
},
),
const Text(
'Filter',
style: TextStyle(
fontSize: 18, fontWeight: FontWeight.bold),
),
InkWell(
child: const Text(
'Done',
style: TextStyle( style: TextStyle(
fontSize: 16, fontSize: 18, fontWeight: FontWeight.bold),
color: Colors.teal,
fontWeight: FontWeight.bold),
), ),
onTap: () { InkWell(
callBack(period); child: const Text(
Navigator.pop(context); 'Done',
}, style: TextStyle(
), fontSize: 16,
], color: Colors.teal,
fontWeight: FontWeight.bold),
),
onTap: () {
callBack(period);
Navigator.pop(context);
},
),
],
),
), ),
), ),
const Divider(), const Divider(),
......
...@@ -46,7 +46,7 @@ class _RegisterScreenState extends State<RegisterScreen> { ...@@ -46,7 +46,7 @@ class _RegisterScreenState extends State<RegisterScreen> {
child: Image.asset( child: Image.asset(
"assets/images/frontlogo.png", "assets/images/frontlogo.png",
width: 300, width: 300,
height: 350, height: 300,
), ),
), ),
const Padding( const Padding(
......
...@@ -73,8 +73,7 @@ class _ReminderDetailsState extends State<ReminderDetails> { ...@@ -73,8 +73,7 @@ class _ReminderDetailsState extends State<ReminderDetails> {
return Scaffold( return Scaffold(
appBar: AppBar( appBar: AppBar(
elevation: 0, elevation: 0,
title: const Text("Reminder Details"), title: const Text("Add Reminder"),
centerTitle: true,
leading: IconButton( leading: IconButton(
icon: const Icon(Icons.close), icon: const Icon(Icons.close),
onPressed: () { onPressed: () {
...@@ -119,15 +118,12 @@ class _ReminderDetailsState extends State<ReminderDetails> { ...@@ -119,15 +118,12 @@ class _ReminderDetailsState extends State<ReminderDetails> {
), ),
body: SingleChildScrollView( body: SingleChildScrollView(
child: Padding( child: Padding(
padding: const EdgeInsets.all(17.0), padding: const EdgeInsets.all(16.0),
child: Center( child: Center(
child: Column( child: Column(
// mainAxisAlignment: MainAxisAlignment.center, // mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
SizedBox(
height: 40,
),
Padding( Padding(
padding: EdgeInsets.only(left: 12.0, bottom: 0), padding: EdgeInsets.only(left: 12.0, bottom: 0),
child: Text( child: Text(
......
...@@ -33,8 +33,8 @@ class _ReportScreenState extends State<ReportScreen> { ...@@ -33,8 +33,8 @@ class _ReportScreenState extends State<ReportScreen> {
List<SplineAreaWeightData> _chartGlucoseData = <SplineAreaWeightData>[]; List<SplineAreaWeightData> _chartGlucoseData = <SplineAreaWeightData>[];
List<SplineAreaWeightData> _chartCarbData = <SplineAreaWeightData>[]; List<SplineAreaWeightData> _chartCarbData = <SplineAreaWeightData>[];
final _currentUser = FirebaseAuth.instance.currentUser; final _currentUser = FirebaseAuth.instance.currentUser;
int _gselectedIndex = 0; int _gselectedIndex = 2;
int _cselectedIndex = 0; int _cselectedIndex = 2;
void getChartGlucoseDataByTimeFrame() async { void getChartGlucoseDataByTimeFrame() async {
List<SplineAreaWeightData> _data = <SplineAreaWeightData>[]; List<SplineAreaWeightData> _data = <SplineAreaWeightData>[];
......
import 'package:diabeta_app/components/constants.dart'; import 'package:diabeta_app/components/constants.dart';
import 'package:diabeta_app/model/account_info.dart';
import 'package:diabeta_app/services/account_service.dart';
import 'package:firebase_auth/firebase_auth.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:intl/intl.dart';
import '../login_screen.dart';
class AccountScreen extends StatefulWidget { class AccountScreen extends StatefulWidget {
const AccountScreen({Key? key}) : super(key: key); const AccountScreen({Key? key}) : super(key: key);
...@@ -9,6 +15,79 @@ class AccountScreen extends StatefulWidget { ...@@ -9,6 +15,79 @@ class AccountScreen extends StatefulWidget {
} }
class _AccountScreenState extends State<AccountScreen> { class _AccountScreenState extends State<AccountScreen> {
String genderValue = "";
String diabetesValues = "";
DateTime? dobDate = null;
DateTime? yodDate = null;
TextEditingController _nameController = TextEditingController();
TextEditingController _emailController = TextEditingController();
TextEditingController _mobileController = TextEditingController();
final _currentUser = FirebaseAuth.instance.currentUser;
bool isAccountExist = false;
AccountInfo accountInfo = new AccountInfo();
var genders = [
'',
'Male',
'Female',
];
var diabetes = ['', 'Type 1', 'Type 2', 'Other'];
@override
void initState() {
getAccountInfo();
super.initState();
}
void getAccountInfo() async {
accountInfo = await AccountService.getAccountInfoByID(_currentUser!.uid);
if (accountInfo.email != null) {
isAccountExist = true;
}
_emailController.text = _currentUser!.email!;
_mobileController.text =
accountInfo.mobile != null ? accountInfo.mobile! : "";
_nameController.text =
accountInfo.fullname != null ? accountInfo.fullname! : "";
setState(() {
genderValue = accountInfo.gender != null ? accountInfo.gender! : "";
diabetesValues =
accountInfo.diabetesType != null ? accountInfo.diabetesType! : "";
yodDate = accountInfo.yod;
dobDate = accountInfo.dob;
});
}
Future pickDOBDate(BuildContext context) async {
FocusScope.of(context).requestFocus(FocusNode());
final initialDate = DateTime(1990);
final newDate = await showDatePicker(
context: context,
initialDate: initialDate,
firstDate: DateTime(DateTime.now().year - 50),
lastDate: DateTime(DateTime.now().year - 5));
if (newDate == null) return;
setState(() {
dobDate = newDate;
});
}
Future pickYODDate(BuildContext context) async {
FocusScope.of(context).requestFocus(FocusNode());
final initialDate = DateTime.now();
final newDate = await showDatePicker(
context: context,
initialDate: initialDate,
firstDate: DateTime(DateTime.now().year - 50),
lastDate: DateTime.now());
if (newDate == null) return;
setState(() {
yodDate = newDate;
});
}
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Scaffold( return Scaffold(
...@@ -17,11 +96,360 @@ class _AccountScreenState extends State<AccountScreen> { ...@@ -17,11 +96,360 @@ class _AccountScreenState extends State<AccountScreen> {
elevation: 0, elevation: 0,
backgroundColor: kPrimaryColor, backgroundColor: kPrimaryColor,
), ),
body: ListView( body: SingleChildScrollView(
children: [ child: Container(
child: Padding(
padding: const EdgeInsets.symmetric(horizontal: 20, vertical: 16),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
'Account Info',
style: TextStyle(fontSize: 12, color: kPrimaryColor),
),
Divider(),
Padding(
padding: const EdgeInsets.symmetric(vertical: 4),
child: Column(
children: [
Container(
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Text(
"Full Name",
style: TextStyle(fontSize: 14),
),
Container(
width: 180,
decoration: const BoxDecoration(
border: Border(
bottom: BorderSide(color: Colors.grey))),
child: Padding(
padding: const EdgeInsets.only(bottom: 4.0),
child: TextFormField(
keyboardType: TextInputType.text,
controller: _nameController,
decoration: const InputDecoration(
border: InputBorder.none,
isDense: true,
isCollapsed: true),
),
),
),
],
),
),
],
),
),
Divider(),
Padding(
padding: const EdgeInsets.symmetric(vertical: 4),
child: Column(
children: [
Container(
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Text(
"Email",
style: TextStyle(fontSize: 14),
),
Container(
width: 180,
decoration: const BoxDecoration(
border: Border(
bottom: BorderSide(color: Colors.grey))),
child: Padding(
padding: const EdgeInsets.only(bottom: 4.0),
child: TextFormField(
enabled: false,
style: const TextStyle(color: Colors.grey),
keyboardType: TextInputType.emailAddress,
controller: _emailController,
decoration: const InputDecoration(
border: InputBorder.none,
isDense: true,
isCollapsed: true),
),
),
),
],
),
),
],
),
),
Divider(),
Padding(
padding: const EdgeInsets.symmetric(vertical: 4),
child: Column(
children: [
Container(
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Text(
"Mobile No",
style: TextStyle(fontSize: 14),
),
Container(
width: 180,
decoration: const BoxDecoration(
border: Border(
bottom: BorderSide(color: Colors.grey))),
child: Padding(
padding: const EdgeInsets.only(bottom: 4.0),
child: TextFormField(
keyboardType: TextInputType.number,
controller: _mobileController,
decoration: const InputDecoration(
border: InputBorder.none,
isDense: true,
isCollapsed: true),
),
),
),
],
),
),
],
),
),
Divider(),
SizedBox(
height: 24,
),
Text(
'Basic therapy info',
style: TextStyle(fontSize: 12, color: kPrimaryColor),
),
Divider(),
Padding(
padding: const EdgeInsets.symmetric(vertical: 4),
child: Column(
children: [
Container(
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Text(
"Diabetes Type",
style: TextStyle(fontSize: 14),
),
DropdownButton(
// Initial Value
value: diabetesValues,
isDense: true,
// Down Arrow Icon
icon: const Icon(Icons.keyboard_arrow_down),
// Array list of items
items: diabetes.map((String items) {
return DropdownMenuItem(
value: items,
child: Text(items),
);
}).toList(),
// After selecting the desired option,it will
// change button value to selected value
onChanged: (String? newValue) {
setState(() {
diabetesValues = newValue!;
});
},
),
],
),
),
],
),
),
Divider(),
Padding(
padding: const EdgeInsets.symmetric(vertical: 4),
child: Column(
children: [
Container(
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Text(
"Gender",
style: TextStyle(fontSize: 14),
),
DropdownButton(
// Initial Value
value: genderValue,
isDense: true,
// Down Arrow Icon
icon: const Icon(Icons.keyboard_arrow_down),
// Array list of items
items: genders.map((String items) {
return DropdownMenuItem(
value: items,
child: Text(items),
);
}).toList(),
// After selecting the desired option,it will
// change button value to selected value
onChanged: (String? newValue) {
setState(() {
genderValue = newValue!;
});
},
),
],
),
),
],
),
),
Divider(),
Padding(
padding: const EdgeInsets.symmetric(vertical: 4),
child: Column(
children: [
Container(
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Text(
"Date of birth",
style: TextStyle(fontSize: 14),
),
InkWell(
child: dobDate == null
? Text("Not Set")
: Text(DateFormat('MMMM dd, yyyy')
.format(dobDate!)),
onTap: () {
pickDOBDate(context);
},
)
],
),
),
],
),
),
Divider(),
Padding(
padding: const EdgeInsets.symmetric(vertical: 4),
child: Column(
children: [
Container(
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Text(
"Year of diagnosis",
style: TextStyle(fontSize: 14),
),
InkWell(
child: yodDate == null
? Text("Not Set")
: Text(DateFormat('MMMM dd, yyyy')
.format(yodDate!)),
onTap: () {
pickYODDate(context);
},
)
],
),
),
],
),
),
Divider(),
Text(
"Sex, age and diabetes duration affect your metabolism.",
style: TextStyle(fontSize: 12, color: Colors.grey),
),
SizedBox(
height: 32,
),
ConstrainedBox(
constraints: const BoxConstraints.tightFor(
height: 35, width: double.infinity),
child: ElevatedButton(
onPressed: () async {
AccountInfo accountInfo1 = AccountInfo(
uid: _currentUser!.uid,
fullname: _nameController.text,
email: _emailController.text,
mobile: _mobileController.text,
diabetesType: diabetesValues,
dob: dobDate,
gender: genderValue,
yod: yodDate);
], if (isAccountExist) {
bool result = await AccountService.editRecord(
accountInfo1, accountInfo.id);
if (result) {
const snackBar = SnackBar(
content:
Text("Account info updated successfully."),
backgroundColor: kPrimaryColor);
ScaffoldMessenger.of(context).showSnackBar(snackBar);
}
} else {
String? id =
await AccountService.addRecord(accountInfo1);
if (id != null) {
const snackBar = SnackBar(
content: Text("Account info saved successfully."),
backgroundColor: kPrimaryColor);
ScaffoldMessenger.of(context).showSnackBar(snackBar);
}
}
},
child: const Text(
'Save changes',
style: TextStyle(fontSize: 16),
),
style: ElevatedButton.styleFrom(
shape: const StadiumBorder(),
elevation: 0,
primary: kPrimaryColor,
),
),
),
SizedBox(
height: 16,
),
ConstrainedBox(
constraints: const BoxConstraints.tightFor(
height: 35, width: double.infinity),
child: ElevatedButton(
onPressed: () async {
try {
await FirebaseAuth.instance.signOut();
Navigator.of(context).pushReplacement(
MaterialPageRoute(
builder: (context) => const LoginScreen(),
),
);
} on FirebaseAuthException catch (e) {}
},
child: const Text(
'Logout',
style: TextStyle(fontSize: 16),
),
style: ElevatedButton.styleFrom(
shape: const StadiumBorder(),
elevation: 0,
primary: kSecondaryColor,
),
),
),
],
),
),
),
), ),
); );
} }
} }
\ No newline at end of file
import 'package:diabeta_app/components/constants.dart'; import 'package:diabeta_app/components/constants.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:shared_preferences/shared_preferences.dart';
class OtherSettingsScreen extends StatefulWidget { class OtherSettingsScreen extends StatefulWidget {
const OtherSettingsScreen({Key? key}) : super(key: key); const OtherSettingsScreen({Key? key}) : super(key: key);
...@@ -9,6 +10,34 @@ class OtherSettingsScreen extends StatefulWidget { ...@@ -9,6 +10,34 @@ class OtherSettingsScreen extends StatefulWidget {
} }
class _OtherSettingsScreenState extends State<OtherSettingsScreen> { class _OtherSettingsScreenState extends State<OtherSettingsScreen> {
final Future<SharedPreferences> _prefs = SharedPreferences.getInstance();
bool isAppLock = false;
bool isForecast = false;
bool isDiaBetaConnect = false;
@override
void initState() {
initializevalues();
super.initState();
}
Future<void> initializevalues() async {
final SharedPreferences prefs = await _prefs;
if (prefs.getBool("isForecast") == null) {
prefs.setBool("isForecast", false);
} else if (prefs.getBool("isAppLock") == null) {
prefs.setBool("isAppLock", false);
} else if (prefs.getBool("isDiaBetaConnect") == null) {
prefs.setBool("isDiaBetaConnect", false);
}
setState(() {
isForecast = prefs.getBool("isForecast")!;
isAppLock = prefs.getBool("isAppLock")!;
isDiaBetaConnect = prefs.getBool("isDiaBetaConnect")!;
});
}
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Scaffold( return Scaffold(
...@@ -17,67 +46,328 @@ class _OtherSettingsScreenState extends State<OtherSettingsScreen> { ...@@ -17,67 +46,328 @@ class _OtherSettingsScreenState extends State<OtherSettingsScreen> {
elevation: 0, elevation: 0,
backgroundColor: kPrimaryColor, backgroundColor: kPrimaryColor,
), ),
body: ListView( body: Padding(
children: [ padding: const EdgeInsets.symmetric(horizontal: 20),
Row( child: Column(
mainAxisAlignment: MainAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Padding( // Row(
padding: // mainAxisAlignment: MainAxisAlignment.center,
const EdgeInsets.only(left: 32, top:16, right: 16), // children: [
child: Image.asset( // Padding(
"assets/images/settings.png", // padding: const EdgeInsets.only(top: 16, right: 16),
width: 70, // child: Image.asset(
height: 70, // "assets/images/settings.png",
// width: 70,
// height: 70,
// ),
// ),
// Column(
// crossAxisAlignment: CrossAxisAlignment.start,
// children: const [
// Text(
// "No need to change these, ",
// style: TextStyle(color: Colors.grey),
// ),
// SizedBox(
// height: 4,
// ),
// Text(
// "but of course you can.",
// style: TextStyle(color: Colors.grey),
// )
// ],
// )
// ],
// ),
SizedBox(
height: 16,
),
Text(
'Privacy',
style: TextStyle(fontSize: 12, color: kPrimaryColor),
),
Divider(),
Column(
children: [
Container(
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Row(
children: [
Text(
"App Lock",
style: TextStyle(fontSize: 14),
),
],
),
Switch(
materialTapTargetSize: MaterialTapTargetSize.shrinkWrap,
value: isAppLock,
onChanged: (value) async {
final SharedPreferences prefs = await _prefs;
setState(() {
prefs
.setBool('isAppLock', value)
.then((bool success) {
isAppLock = value;
});
});
},
activeTrackColor: Colors.teal[300],
activeColor: kPrimaryColor,
),
],
),
), ),
), ],
Column( ),
crossAxisAlignment: CrossAxisAlignment.start, Divider(),
children: const[ Text(
Text("No need to change these, ", style: TextStyle(color: Colors.grey),), "Require screen lock when you open the app.",
SizedBox( style: TextStyle(fontSize: 12, color: Colors.grey),
height: 4, ),
SizedBox(
height: 32,
),
Text(
'Your personal and medical data',
style: TextStyle(fontSize: 12, color: kPrimaryColor),
),
Divider(),
Column(
children: [
Container(
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Row(
children: [
Text(
"Export data",
style: TextStyle(fontSize: 14),
),
],
),
],
), ),
Text("but of course you can.",style: TextStyle(color: Colors.grey),) ),
], ],
) ),
], Divider(),
), Text(
Divider(), "Export all your data in the app.",
Column( style: TextStyle(fontSize: 12, color: Colors.grey),
children: [ ),
Padding( Divider(),
padding: const EdgeInsets.symmetric(horizontal: 20), Column(
child: Container( children: [
child: Row( Container(
mainAxisAlignment: MainAxisAlignment.spaceBetween, child: Row(
children: [ mainAxisAlignment: MainAxisAlignment.spaceBetween,
Row( children: [
Row(
children: [
Text(
"Forecast glucose level",
style: TextStyle(fontSize: 14),
),
],
),
Switch(
materialTapTargetSize: MaterialTapTargetSize.shrinkWrap,
value: isForecast,
onChanged: (value) async {
final SharedPreferences prefs = await _prefs;
setState(() {
prefs
.setBool('isForecast', value)
.then((bool success) {
isForecast = value;
});
});
},
activeTrackColor: Colors.teal[300],
activeColor: kPrimaryColor,
),
],
),
),
],
),
Divider(),
Text(
"Forecast your glucose level for next two days.",
style: TextStyle(fontSize: 12, color: Colors.grey),
),
Divider(),
Column(
children: [
Container(
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Row(
children: [
Text(
"Connect DiaBeta device",
style: TextStyle(fontSize: 14),
),
],
),
Switch(
materialTapTargetSize: MaterialTapTargetSize.shrinkWrap,
value: isDiaBetaConnect,
onChanged: (value) async {
final SharedPreferences prefs = await _prefs;
setState(() {
prefs
.setBool('isDiaBetaConnect', value)
.then((bool success) {
isDiaBetaConnect = value;
});
});
},
activeTrackColor: Colors.teal[300],
activeColor: kPrimaryColor,
),
],
),
),
],
),
Divider(),
Text(
"Automatically connect to DiaBeta device",
style: TextStyle(fontSize: 12, color: Colors.grey),
),
SizedBox(
height: 32,
),
Text(
'Account',
style: TextStyle(fontSize: 12, color: kPrimaryColor),
),
Divider(),
InkWell(
onTap: () {
showDeleteAccount();
},
child: Column(
children: [
Container(
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [ children: [
Icon( Row(
Icons.settings, children: [
size: 25, Text(
color: kPrimaryColor, "Delete my account",
), style: TextStyle(
Text( fontSize: 14, color: Colors.redAccent),
" Other settings", ),
style: TextStyle(fontSize: 14), ],
), ),
], ],
), ),
Icon( ),
Icons.arrow_forward_ios, ],
size: 16,
color: kPrimaryColor,
)
],
),
), ),
), ),
Divider(),
Text(
"If you delete your account, your data will gone forever.",
style: TextStyle(fontSize: 12, color: Colors.grey),
)
], ],
), ),
Divider(), ),
], );
}
void showDeleteAccount() {
showModalBottomSheet(
context: context,
backgroundColor: Colors.transparent,
builder: (context) {
return DeleteAccount();
},
);
}
}
class DeleteAccount extends StatelessWidget {
const DeleteAccount({Key? key}) : super(key: key);
@override
Widget build(BuildContext context) {
return SingleChildScrollView(
child: Container(
height: 400,
decoration: BoxDecoration(
color: Colors.white,
borderRadius: const BorderRadius.only(
topLeft: Radius.circular(40.0),
topRight: Radius.circular(40.0),
)),
child: Padding(
padding: const EdgeInsets.symmetric(horizontal: 32, vertical: 32),
child: Column(
crossAxisAlignment: CrossAxisAlignment.center,
children: [
const Text(
'Are you sure?',
style: TextStyle(
fontSize: 16,
fontWeight: FontWeight.bold,
),
),
Divider(),
const Text(
'Delete account?',
style: TextStyle(
fontSize: 16,
fontWeight: FontWeight.bold,
color: Colors.redAccent),
),
Image.asset(
"assets/images/heart.jpg",
width: 100,
height: 150,
),
SizedBox(
width: double.infinity,
child: Text(
"We're so sad to see you go. Please be aware that by deleting your account, your data will be gone forever.",
),
),
SizedBox(
height: 30,
),
ConstrainedBox(
constraints: const BoxConstraints.tightFor(
height: 45, width: double.infinity),
child: ElevatedButton(
onPressed: () {},
child: const Text(
'Delete',
style: TextStyle(fontSize: 16),
),
style: ElevatedButton.styleFrom(
shape: const StadiumBorder(),
elevation: 0,
primary: Colors.redAccent,
),
),
),
SizedBox(
height: 16,
),
],
),
),
), ),
); );
} }
......
import 'package:diabeta_app/components/constants.dart'; import 'package:diabeta_app/components/constants.dart';
import 'package:diabeta_app/screens/settings/account_screen.dart'; import 'package:diabeta_app/screens/settings/account_screen.dart';
import 'package:diabeta_app/screens/settings/other_settings_screen.dart'; import 'package:diabeta_app/screens/settings/other_settings_screen.dart';
import 'package:diabeta_app/screens/settings/subscribe_screen.dart';
import 'package:smooth_star_rating_nsafe/smooth_star_rating.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_email_sender/flutter_email_sender.dart';
import 'package:share/share.dart';
class SettingsScreen extends StatefulWidget { class SettingsScreen extends StatefulWidget {
const SettingsScreen({Key? key}) : super(key: key); const SettingsScreen({Key? key}) : super(key: key);
...@@ -65,24 +69,6 @@ class _SettingsScreenState extends State<SettingsScreen> { ...@@ -65,24 +69,6 @@ class _SettingsScreenState extends State<SettingsScreen> {
), ),
), ),
Divider(), Divider(),
Padding(
padding: const EdgeInsets.symmetric(horizontal: 20),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Text(
"My subcription",
),
Text("Basic")
],
),
),
Divider(),
],
),
Divider(),
Column(
children: [
Padding( Padding(
padding: const EdgeInsets.symmetric(horizontal: 20), padding: const EdgeInsets.symmetric(horizontal: 20),
child: InkWell( child: InkWell(
...@@ -90,36 +76,21 @@ class _SettingsScreenState extends State<SettingsScreen> { ...@@ -90,36 +76,21 @@ class _SettingsScreenState extends State<SettingsScreen> {
Navigator.push( Navigator.push(
context, context,
MaterialPageRoute( MaterialPageRoute(
builder: (context) => const AccountScreen()), builder: (context) => const SubscribeScreen()),
); );
}, },
child: Container( child: Row(
child: Row( mainAxisAlignment: MainAxisAlignment.spaceBetween,
mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [
children: [ Text(
Row( "My subcription",
children: [ ),
Icon( Text("PRO")
Icons.contact_support, ],
size: 25,
color: kPrimaryColor,
),
Text(
" Support & Feedback",
style: TextStyle(fontSize: 14),
),
],
),
Icon(
Icons.arrow_forward_ios,
size: 16,
color: kPrimaryColor,
)
],
),
), ),
), ),
), ),
Divider(),
], ],
), ),
Divider(), Divider(),
...@@ -129,11 +100,7 @@ class _SettingsScreenState extends State<SettingsScreen> { ...@@ -129,11 +100,7 @@ class _SettingsScreenState extends State<SettingsScreen> {
padding: const EdgeInsets.symmetric(horizontal: 20), padding: const EdgeInsets.symmetric(horizontal: 20),
child: InkWell( child: InkWell(
onTap: () { onTap: () {
Navigator.push( showSupportFeedbackPage();
context,
MaterialPageRoute(
builder: (context) => const AccountScreen()),
);
}, },
child: Container( child: Container(
child: Row( child: Row(
...@@ -142,12 +109,12 @@ class _SettingsScreenState extends State<SettingsScreen> { ...@@ -142,12 +109,12 @@ class _SettingsScreenState extends State<SettingsScreen> {
Row( Row(
children: [ children: [
Icon( Icon(
Icons.emoji_events, Icons.contact_support,
size: 25, size: 25,
color: kPrimaryColor, color: kPrimaryColor,
), ),
Text( Text(
" Challenges", " Support & Feedback",
style: TextStyle(fontSize: 14), style: TextStyle(fontSize: 14),
), ),
], ],
...@@ -165,18 +132,54 @@ class _SettingsScreenState extends State<SettingsScreen> { ...@@ -165,18 +132,54 @@ class _SettingsScreenState extends State<SettingsScreen> {
], ],
), ),
Divider(), Divider(),
Column( // Column(
// children: [
// Padding(
// padding: const EdgeInsets.symmetric(horizontal: 20),
// child: InkWell(
// onTap: () {
// Navigator.push(
// context,
// MaterialPageRoute(
// builder: (context) => const AccountScreen()),
// );
// },
// child: Container(
// child: Row(
// mainAxisAlignment: MainAxisAlignment.spaceBetween,
// children: [
// Row(
// children: [
// Icon(
// Icons.emoji_events,
// size: 25,
// color: kPrimaryColor,
// ),
// Text(
// " Challenges",
// style: TextStyle(fontSize: 14),
// ),
// ],
// ),
// Icon(
// Icons.arrow_forward_ios,
// size: 16,
// color: kPrimaryColor,
// )
// ],
// ),
// ),
// ),
// ),
// ],
// ),
// Divider(),
Column(
children: [ children: [
Padding( Padding(
padding: const EdgeInsets.symmetric(horizontal: 20), padding: const EdgeInsets.symmetric(horizontal: 20),
child: InkWell( child: InkWell(
onTap: () { onTap: () {},
Navigator.push(
context,
MaterialPageRoute(
builder: (context) => const AccountScreen()),
);
},
child: Container( child: Container(
child: Row( child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
...@@ -207,17 +210,13 @@ class _SettingsScreenState extends State<SettingsScreen> { ...@@ -207,17 +210,13 @@ class _SettingsScreenState extends State<SettingsScreen> {
], ],
), ),
Divider(), Divider(),
Column( Column(
children: [ children: [
Padding( Padding(
padding: const EdgeInsets.symmetric(horizontal: 20), padding: const EdgeInsets.symmetric(horizontal: 20),
child: InkWell( child: InkWell(
onTap: () { onTap: () {
Navigator.push( showRecommendDiaBetaView();
context,
MaterialPageRoute(
builder: (context) => const AccountScreen()),
);
}, },
child: Container( child: Container(
child: Row( child: Row(
...@@ -249,7 +248,7 @@ class _SettingsScreenState extends State<SettingsScreen> { ...@@ -249,7 +248,7 @@ class _SettingsScreenState extends State<SettingsScreen> {
], ],
), ),
Divider(), Divider(),
Column( Column(
children: [ children: [
Padding( Padding(
padding: const EdgeInsets.symmetric(horizontal: 20), padding: const EdgeInsets.symmetric(horizontal: 20),
...@@ -294,4 +293,216 @@ class _SettingsScreenState extends State<SettingsScreen> { ...@@ -294,4 +293,216 @@ class _SettingsScreenState extends State<SettingsScreen> {
], ],
); );
} }
void showSupportFeedbackPage() {
showDialog(
context: context,
builder: (context) {
return SupportDialog();
});
}
void showRecommendDiaBetaView() {
showModalBottomSheet(
context: context,
backgroundColor: Colors.transparent,
builder: (context) {
return RecommedDiaBeta();
});
}
}
class RecommedDiaBeta extends StatefulWidget {
const RecommedDiaBeta({Key? key}) : super(key: key);
@override
State<RecommedDiaBeta> createState() => _RecommedDiaBetaState();
}
class _RecommedDiaBetaState extends State<RecommedDiaBeta> {
@override
Widget build(BuildContext context) {
return Container(
height: 400,
decoration: BoxDecoration(
color: Colors.white,
borderRadius: const BorderRadius.only(
topLeft: Radius.circular(40.0),
topRight: Radius.circular(40.0),
)),
child: Padding(
padding: const EdgeInsets.symmetric(horizontal: 32, vertical: 32),
child: Column(
children: [
const Text(
'Like DiaBeta? Share the love!',
style: TextStyle(
fontSize: 16,
fontWeight: FontWeight.bold,
color: kPrimaryColor),
),
SizedBox(
height: 16,
),
Image.asset(
"assets/images/share.png",
width: 150,
height: 200,
),
SizedBox(
height: 16,
),
ConstrainedBox(
constraints: const BoxConstraints.tightFor(
height: 45, width: double.infinity),
child: ElevatedButton(
onPressed: () {
Share.share(
'Visit our website https://diabeta.000webhostapp.com/educations.html');
Navigator.pop(context);
},
child: const Text(
'Share with friends',
style: TextStyle(fontSize: 16),
),
style: ElevatedButton.styleFrom(
shape: const StadiumBorder(),
elevation: 0,
primary: kPrimaryColor,
),
),
),
SizedBox(
height: 16,
),
const Text(
'Thank you!',
style: TextStyle(fontSize: 14, color: kPrimaryColor),
),
],
),
),
);
}
}
class SupportDialog extends StatefulWidget {
const SupportDialog({Key? key}) : super(key: key);
@override
State<SupportDialog> createState() => _SupportDialogState();
}
class _SupportDialogState extends State<SupportDialog> {
double rating = 5;
TextEditingController _bodyController = TextEditingController();
Future<void> send() async {
final Email email = Email(
body: _bodyController.text + "\n User rating : " + rating.toString(),
subject: "DiaBeta Support and Feedback",
recipients: ["diabetasystem@gmail.com"],
);
String platformResponse;
try {
await FlutterEmailSender.send(email);
platformResponse = 'success';
} catch (error) {
print(error);
platformResponse = error.toString();
}
if (!mounted) return;
}
@override
Widget build(BuildContext context) {
return AlertDialog(
content: Container(
height: 370,
decoration: BoxDecoration(
color: Colors.white,
borderRadius: const BorderRadius.only(
topLeft: Radius.circular(40.0),
topRight: Radius.circular(40.0),
)),
child: Padding(
padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 16),
child: Column(
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
const Text(
'What is your rate?',
style: TextStyle(fontSize: 16, fontWeight: FontWeight.bold),
),
SizedBox(
height: 8,
),
SmoothStarRating(
allowHalfRating: false,
onRatingChanged: (v) {
setState(() {
rating = v;
});
},
starCount: 5,
rating: rating,
size: 40.0,
filledIconData: Icons.star,
halfFilledIconData: Icons.star_half,
defaultIconData: Icons.star_border,
color: kPrimaryColor,
borderColor: kPrimaryColor,
spacing: 0.0),
SizedBox(
height: 32,
),
const Text(
'Please share your opinion?',
style: TextStyle(fontSize: 16, fontWeight: FontWeight.bold),
),
SizedBox(
height: 16,
),
TextField(
controller: _bodyController,
maxLines: 6,
minLines: 5,
decoration: const InputDecoration(
filled: true,
fillColor: Colors.white,
border: OutlineInputBorder(
borderRadius: BorderRadius.all(Radius.circular(20)),
borderSide: BorderSide(color: Colors.teal))),
),
SizedBox(
height: 16,
),
ConstrainedBox(
constraints: const BoxConstraints.tightFor(
height: 45, width: double.infinity),
child: ElevatedButton(
onPressed: () {
send();
},
child: const Text(
'Send',
style: TextStyle(fontSize: 16),
),
style: ElevatedButton.styleFrom(
shape: const StadiumBorder(),
elevation: 0,
primary: kPrimaryColor,
),
),
),
],
),
),
),
);
}
} }
import 'package:flutter/material.dart';
class SubscribeScreen extends StatelessWidget {
const SubscribeScreen({Key? key}) : super(key: key);
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
backgroundColor: Colors.white,
elevation: 0.5,
centerTitle: true,
actions: [
IconButton(
onPressed: () {
Navigator.pop(context);
},
icon: const Icon(
Icons.close,
color: Colors.black87,
size: 20,
))
],
title: const Text(
"Subscribe",
style: TextStyle(color: Colors.black87, fontSize: 16),
),
),
body: SingleChildScrollView(
child: Padding(
padding: const EdgeInsets.all(16.0),
child: Column(
children: [
SizedBox(
width: double.infinity,
child: const Text(
"Choose your favourite plan and do something good for you and your diabetes.",
textAlign: TextAlign.center,
),
),
Card()
],
),
),
),
);
}
}
import 'package:cloud_firestore/cloud_firestore.dart';
import 'package:diabeta_app/model/account_info.dart';
class AccountService {
static final CollectionReference _records =
FirebaseFirestore.instance.collection('account_info');
static Future<String> addRecord(AccountInfo accountInfo) {
return _records.add({
'uid': accountInfo.uid,
'fullname': accountInfo.fullname,
'email': accountInfo.email,
'mobile': accountInfo.mobile,
'diabetesType': accountInfo.diabetesType,
'gender': accountInfo.gender,
'dob': accountInfo.dob,
'yod': accountInfo.yod
}).then((value) {
return value.id;
}).catchError((error) {
return "";
});
}
static Future<bool> editRecord(AccountInfo accountInfo, String? id) {
return _records
.doc(id)
.update({
'fullname': accountInfo.fullname,
'email': accountInfo.email,
'mobile': accountInfo.mobile,
'diabetesType': accountInfo.diabetesType,
'gender': accountInfo.gender,
'dob': accountInfo.dob,
'yod': accountInfo.yod
})
.then((value) => true)
.catchError((error) => false);
}
static Future<AccountInfo> getAccountInfoByID(String id) async {
AccountInfo accountInfo = new AccountInfo();
await _records
.where("uid", isEqualTo: id)
.get()
.then((QuerySnapshot querySnapshot) {
querySnapshot.docs.forEach((doc) {
accountInfo = AccountInfo(
id: doc.id,
uid: doc["uid"],
dob: doc["dob"] !=null ? DateTime.parse(doc["dob"].toDate().toString()): null,
yod: doc["yod"] != null ? DateTime.parse(doc["yod"].toDate().toString()): null,
diabetesType: doc["diabetesType"],
email: doc["email"],
fullname: doc["fullname"],
gender: doc["gender"],
mobile: doc["mobile"],
);
});
}).catchError((error) {
print(error);
});
return accountInfo;
}
}
...@@ -265,6 +265,13 @@ packages: ...@@ -265,6 +265,13 @@ packages:
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.5.1" version: "1.5.1"
flutter_email_sender:
dependency: "direct main"
description:
name: flutter_email_sender
url: "https://pub.dartlang.org"
source: hosted
version: "5.1.0"
flutter_lints: flutter_lints:
dependency: "direct dev" dependency: "direct dev"
description: description:
...@@ -471,6 +478,13 @@ packages: ...@@ -471,6 +478,13 @@ packages:
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.8.0" version: "1.8.0"
mime:
dependency: transitive
description:
name: mime
url: "https://pub.dartlang.org"
source: hosted
version: "1.0.2"
outline_search_bar: outline_search_bar:
dependency: "direct main" dependency: "direct main"
description: description:
...@@ -604,6 +618,13 @@ packages: ...@@ -604,6 +618,13 @@ packages:
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "0.27.5" version: "0.27.5"
share:
dependency: "direct main"
description:
name: share
url: "https://pub.dartlang.org"
source: hosted
version: "2.0.4"
shared_preferences: shared_preferences:
dependency: "direct main" dependency: "direct main"
description: description:
...@@ -672,6 +693,13 @@ packages: ...@@ -672,6 +693,13 @@ packages:
description: flutter description: flutter
source: sdk source: sdk
version: "0.0.99" version: "0.0.99"
smooth_star_rating_nsafe:
dependency: "direct main"
description:
name: smooth_star_rating_nsafe
url: "https://pub.dartlang.org"
source: hosted
version: "1.0.0+1"
source_span: source_span:
dependency: transitive dependency: transitive
description: description:
...@@ -742,6 +770,62 @@ packages: ...@@ -742,6 +770,62 @@ packages:
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.3.0" version: "1.3.0"
url_launcher:
dependency: "direct main"
description:
name: url_launcher
url: "https://pub.dartlang.org"
source: hosted
version: "6.1.6"
url_launcher_android:
dependency: transitive
description:
name: url_launcher_android
url: "https://pub.dartlang.org"
source: hosted
version: "6.0.21"
url_launcher_ios:
dependency: transitive
description:
name: url_launcher_ios
url: "https://pub.dartlang.org"
source: hosted
version: "6.0.17"
url_launcher_linux:
dependency: transitive
description:
name: url_launcher_linux
url: "https://pub.dartlang.org"
source: hosted
version: "3.0.1"
url_launcher_macos:
dependency: transitive
description:
name: url_launcher_macos
url: "https://pub.dartlang.org"
source: hosted
version: "3.0.1"
url_launcher_platform_interface:
dependency: transitive
description:
name: url_launcher_platform_interface
url: "https://pub.dartlang.org"
source: hosted
version: "2.1.1"
url_launcher_web:
dependency: transitive
description:
name: url_launcher_web
url: "https://pub.dartlang.org"
source: hosted
version: "2.0.13"
url_launcher_windows:
dependency: transitive
description:
name: url_launcher_windows
url: "https://pub.dartlang.org"
source: hosted
version: "3.0.1"
vector_math: vector_math:
dependency: transitive dependency: transitive
description: description:
......
...@@ -61,6 +61,10 @@ dependencies: ...@@ -61,6 +61,10 @@ dependencies:
google_fonts: ^3.0.1 google_fonts: ^3.0.1
firebase_database: ^9.1.7 firebase_database: ^9.1.7
local_auth: ^2.1.2 local_auth: ^2.1.2
smooth_star_rating_nsafe: 1.0.0+1
flutter_email_sender: ^5.1.0
share: ^2.0.4
url_launcher: ^6.1.6
dev_dependencies: dev_dependencies:
flutter_test: flutter_test:
......
...@@ -7,7 +7,6 @@ ...@@ -7,7 +7,6 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_test/flutter_test.dart'; import 'package:flutter_test/flutter_test.dart';
import 'package:diabeta_app/main.dart'; import 'package:diabeta_app/main.dart';
void main() { void main() {
......
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