@@ -4,6 +4,7 @@ import 'package:firebase_auth/firebase_auth.dart';
4
4
import 'package:flutter/material.dart' ;
5
5
import 'package:flutter_bloc/flutter_bloc.dart' ;
6
6
import 'package:google_sign_in/google_sign_in.dart' ;
7
+ import 'package:hive/hive.dart' ;
7
8
import 'package:lottie/lottie.dart' ;
8
9
import 'package:mental_health/features/auth/domain/entities/auth/googleapisignin.dart' ;
9
10
import 'package:mental_health/features/meditation/presentation/bloc/dailyQuote/daily_quote_bloc.dart' ;
@@ -40,6 +41,7 @@ class _MeditationPageState extends State<MeditationPage> {
40
41
41
42
@override
42
43
void initState () {
44
+
43
45
_tooltipBehavior =
44
46
TooltipBehavior (enable: true , format: 'point.x : point.y%' );
45
47
__tooltipBehavior = _tooltipBehavior;
@@ -305,7 +307,8 @@ class _MeditationPageState extends State<MeditationPage> {
305
307
Widget build (BuildContext context) {
306
308
user1 = FirebaseAuth .instance.currentUser;
307
309
user2 = GoogleSignInApi .details ();
308
-
310
+ final mybox = Hive .box ('firstime' );
311
+ String valobatained = mybox.get ('firsttime' );
309
312
return Scaffold (
310
313
backgroundColor: Colors .white,
311
314
appBar: AppBar (
@@ -754,7 +757,7 @@ class _MeditationPageState extends State<MeditationPage> {
754
757
textAlign: TextAlign .center,
755
758
),
756
759
//graph
757
- BlocBuilder <MoodDataBloc ,MoodDataState >(builder: (context,state){
760
+ valobatained == 'true' ? const SizedBox (height : 50 ,child : Text ( "No data" ,style : TextStyle (color : Colors .black),),) : BlocBuilder <MoodDataBloc ,MoodDataState >(builder: (context,state){
758
761
if (state is MoodDataLoaded ){
759
762
__chartData = < ChartSampleData > [
760
763
ChartSampleData (x: 'Mon' , y: num .parse (state.moodDatainfo.happy), secondSeriesYValue: num .parse (state.moodDatainfo.neutral), thirdSeriesYValue: num .parse (state.moodDatainfo.calm)),
@@ -803,7 +806,7 @@ class _MeditationPageState extends State<MeditationPage> {
803
806
try {
804
807
return _buildColumnChart ();
805
808
}catch (error){
806
- return Text ("ERROR LOADING" );
809
+ return const Text ("ERROR LOADING" );
807
810
}
808
811
}
809
812
if (state is MoodDataLoading ){
0 commit comments