From 5854f9a593c2b5348477b5f1c154ba3968b30501 Mon Sep 17 00:00:00 2001 From: ARYA SINGH Date: Wed, 9 Oct 2024 02:47:28 +0530 Subject: [PATCH] redis-bug-fixes:2 --- .github/workflows/main.yml | 8 ++++---- README.md | 6 +++--- lib/features/auth/presentation/auth/pages/signin.dart | 2 ++ lib/features/auth/presentation/auth/pages/signup.dart | 2 ++ .../meditation/presentation/pages/meditation_page.dart | 9 ++++++--- lib/main.dart | 6 ++++++ 6 files changed, 23 insertions(+), 10 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index af05843..dd85829 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -60,13 +60,13 @@ jobs: uses: ncipollo/release-action@v1 with: artifacts: "build/app/outputs/apk/release/*" - tag: v2.0.9.3 + tag: v2.0.9.4 token: ${{ secrets.TOKEN }} - name: "beta-v2.0.9.3" + name: "beta-v2.0.9.4" body: | - ## What's New in v2.0.9.3 + ## What's New in v2.0.9.4 - - Improved Error Handlers - Catching Redis Issues step-by-step. + - Base Bug Fixes for Beta. - **Redis Cloud Implementation and Fetching in Beta Phase** - **Structure of Redis added to Clean Architecture - **Added Redis-base to support syncfusion** diff --git a/README.md b/README.md index 9605d14..5e5d451 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ Build Status - Version + Version

@@ -17,9 +17,9 @@ **APP STATUS** : ALL CORE FUNCTIONALITIES WORKING (Deployed NodeJs & Postgresql on Render) -## What's New in v2.0.9.3 (Beta Trial Phase for Redis) (Use Stable Version for Best Experience) +## What's New in v2.0.9.4 (Beta Trial Phase for Redis) (Use Stable Version for Best Experience) - - Improved Error Handlers - Catching Redis Issues step-by-step. + - Base Bug Fixes for Beta. - **Redis Cloud Implementation and Fetching in Beta Phase** - **Structure of Redis added to Clean Architecture - **Added Redis-base to support syncfusion** diff --git a/lib/features/auth/presentation/auth/pages/signin.dart b/lib/features/auth/presentation/auth/pages/signin.dart index cde482a..fc61602 100644 --- a/lib/features/auth/presentation/auth/pages/signin.dart +++ b/lib/features/auth/presentation/auth/pages/signin.dart @@ -21,11 +21,13 @@ class SignIn extends StatelessWidget { Future signIn() async { final user = await GoogleSignInApi.login(); final myboxx = Hive.box('lastlogin'); + final first = Hive.box('firstime'); if (user == null) { ScaffoldMessenger.of(context) .showSnackBar(const SnackBar(content: Text("Cancelled by User"))); } else { myboxx.put('google', 'true'); + first.put('firsttime', 'true'); Navigator.pushAndRemoveUntil( context, MaterialPageRoute(builder: (BuildContext context) => HomePage()), diff --git a/lib/features/auth/presentation/auth/pages/signup.dart b/lib/features/auth/presentation/auth/pages/signup.dart index a63731a..45f038d 100644 --- a/lib/features/auth/presentation/auth/pages/signup.dart +++ b/lib/features/auth/presentation/auth/pages/signup.dart @@ -87,7 +87,9 @@ class Signup extends StatelessWidget { ScaffoldMessenger.of(context).showSnackBar(snackbar); }, (r) { final mm = Hive.box('lastlogin'); + final first = Hive.box('firstime'); mm.put("google", "false"); + first.put('firsttime','true'); Navigator.pushAndRemoveUntil( context, MaterialPageRoute( diff --git a/lib/features/meditation/presentation/pages/meditation_page.dart b/lib/features/meditation/presentation/pages/meditation_page.dart index e14e302..241d3c7 100644 --- a/lib/features/meditation/presentation/pages/meditation_page.dart +++ b/lib/features/meditation/presentation/pages/meditation_page.dart @@ -4,6 +4,7 @@ import 'package:firebase_auth/firebase_auth.dart'; import 'package:flutter/material.dart'; import 'package:flutter_bloc/flutter_bloc.dart'; import 'package:google_sign_in/google_sign_in.dart'; +import 'package:hive/hive.dart'; import 'package:lottie/lottie.dart'; import 'package:mental_health/features/auth/domain/entities/auth/googleapisignin.dart'; import 'package:mental_health/features/meditation/presentation/bloc/dailyQuote/daily_quote_bloc.dart'; @@ -40,6 +41,7 @@ class _MeditationPageState extends State { @override void initState() { + _tooltipBehavior = TooltipBehavior(enable: true, format: 'point.x : point.y%'); __tooltipBehavior = _tooltipBehavior; @@ -305,7 +307,8 @@ class _MeditationPageState extends State { Widget build(BuildContext context) { user1 = FirebaseAuth.instance.currentUser; user2 = GoogleSignInApi.details(); - + final mybox = Hive.box('firstime'); + String valobatained = mybox.get('firsttime'); return Scaffold( backgroundColor: Colors.white, appBar: AppBar( @@ -754,7 +757,7 @@ class _MeditationPageState extends State { textAlign: TextAlign.center, ), //graph - BlocBuilder(builder: (context,state){ + valobatained=='true'?const SizedBox(height:50,child: Text("No data",style: TextStyle(color: Colors.black),),):BlocBuilder(builder: (context,state){ if (state is MoodDataLoaded){ __chartData = [ 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 { try { return _buildColumnChart(); }catch(error){ - return Text("ERROR LOADING"); + return const Text("ERROR LOADING"); } } if (state is MoodDataLoading){ diff --git a/lib/main.dart b/lib/main.dart index 89ca5f6..240817e 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -24,6 +24,7 @@ import 'injections.dart' as di; void main() async { await Hive.initFlutter(); await Hive.openBox('lastlogin'); + await Hive.openBox('firstime'); WidgetsFlutterBinding.ensureInitialized(); await Firebase.initializeApp(options: DefaultFirebaseOptions.currentPlatform); await di.init(); @@ -56,9 +57,12 @@ class _MyAppState extends State { @override Widget build(BuildContext context) { final mybox = Hive.box('lastlogin'); + final first= Hive.box('firstime'); final idval; + first.put('firsttime','false'); bool google = mybox.get('google').toString() == 'true'; if (google==true) { + idval = "aryasingh8405@gmail.com-google"; //temp }else{ idval = FirebaseAuth.instance.currentUser?.email.toString(); @@ -98,11 +102,13 @@ class _inPageState extends State { Future signIn() async { final user = await GoogleSignInApi.login(); final myboxx = Hive.box('lastlogin'); + final first = Hive.box('firstime'); if (user == null) { ScaffoldMessenger.of(context) .showSnackBar(const SnackBar(content: Text("Faliure"))); } else { myboxx.put('google', 'true'); + first.put("firsttime",'false'); Navigator.pushAndRemoveUntil( context, MaterialPageRoute(builder: (BuildContext context) => HomePage()),