diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 780437a..cab2196 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -26,5 +26,5 @@ jobs: uses: ncipollo/release-action@v1 with: artifacts: "build/app/outputs/apk/release/*" - tag: v1.0.9 + tag: v2.0.0 token: ${{ secrets.TOKEN }} diff --git a/README.md b/README.md index 03a2f4b..93b39ea 100644 --- a/README.md +++ b/README.md @@ -2,6 +2,8 @@ **APP STATUS** : ALL CORE FUNCTIONALITIES WORKING (Deployed NodeJs & Postgresql on Render) +**LATEST** : v2.0.0 ReImagines Major UI + **UPDATE** : **SUPERCHARGED FACE EMOTION DETECTOR** + ADDED AI CHATBOT SUPPORT (OLD) + SONG PLAYER UI CHANGED (OLD) [DEMO LINK](https://vimeo.com/1013864504) diff --git a/lib/features/auth/presentation/auth/pages/signin.dart b/lib/features/auth/presentation/auth/pages/signin.dart index 5933d72..4446b90 100644 --- a/lib/features/auth/presentation/auth/pages/signin.dart +++ b/lib/features/auth/presentation/auth/pages/signin.dart @@ -1,7 +1,6 @@ import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:flutter/painting.dart'; -import 'package:flutter_svg/flutter_svg.dart'; import 'package:mental_health/features/auth/data/models/auth/signin_user_req.dart'; import 'package:mental_health/features/auth/domain/usecases/auth/signin.dart'; import 'package:mental_health/features/auth/presentation/auth/pages/signup.dart'; @@ -19,13 +18,16 @@ class SignIn extends StatelessWidget { return Scaffold( bottomNavigationBar: _signupText(context), appBar: AppBar( - title: Image.asset( - "screenshots/logo.png", - height: 300, - width: 300, + backgroundColor: Colors.transparent, + title: Padding( + padding: const EdgeInsets.only(right: 41.0, top: 5), + child: Image.asset( + "screenshots/logo.png", + ), ), centerTitle: true, ), + backgroundColor: Colors.white, body: SingleChildScrollView( scrollDirection: Axis.vertical, child: Padding( @@ -39,7 +41,7 @@ class SignIn extends StatelessWidget { const SizedBox( height: 10, ), - Text( + const Text( "Get In Your Mood", style: TextStyle( fontFamily: 't3', @@ -48,7 +50,7 @@ class SignIn extends StatelessWidget { fontWeight: FontWeight.bold), ), const SizedBox( - height: 110, + height: 80, ), _registerText(), const SizedBox( @@ -60,7 +62,7 @@ class SignIn extends StatelessWidget { ), _password(context), const SizedBox( - height: 80, + height: 90, ), ElevatedButton( style: ElevatedButton.styleFrom(backgroundColor: Colors.black), @@ -89,7 +91,7 @@ class SignIn extends StatelessWidget { style: TextStyle( fontFamily: 't3', color: Colors.white, - fontSize: 22, + fontSize: 17, ), ), ), @@ -104,7 +106,7 @@ class SignIn extends StatelessWidget { return const Text( 'Sign In', style: TextStyle( - letterSpacing: 3, + letterSpacing: 1, fontFamily: 't1', color: Colors.green, fontSize: 25, @@ -119,10 +121,10 @@ class SignIn extends StatelessWidget { decoration: const InputDecoration( hintText: "Enter Email", ), - style: TextStyle( + style: const TextStyle( fontFamily: 't3', color: Colors.black, - fontSize: 20, + fontSize: 16, fontWeight: FontWeight.bold), ); } @@ -133,17 +135,17 @@ class SignIn extends StatelessWidget { decoration: const InputDecoration( hintText: "Password", ), - style: TextStyle( + style: const TextStyle( fontFamily: 't3', color: Colors.black, - fontSize: 20, + fontSize: 16, fontWeight: FontWeight.bold), ); } Widget _signupText(BuildContext context) { return Padding( - padding: EdgeInsets.symmetric(vertical: 30), + padding: const EdgeInsets.symmetric(vertical: 30), child: Row( mainAxisAlignment: MainAxisAlignment.center, children: [ @@ -152,7 +154,7 @@ class SignIn extends StatelessWidget { style: TextStyle( fontFamily: 't2', color: Colors.red, - fontSize: 25, + fontSize: 20, fontWeight: FontWeight.bold), ), TextButton( @@ -168,7 +170,7 @@ class SignIn extends StatelessWidget { letterSpacing: 0, fontFamily: 't2', color: Colors.purple, - fontSize: 25, + fontSize: 20, fontWeight: FontWeight.bold), )), ], diff --git a/lib/features/auth/presentation/auth/pages/signup.dart b/lib/features/auth/presentation/auth/pages/signup.dart index b2c6e3d..87c4df6 100644 --- a/lib/features/auth/presentation/auth/pages/signup.dart +++ b/lib/features/auth/presentation/auth/pages/signup.dart @@ -1,5 +1,3 @@ -import 'dart:ffi'; - import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:flutter/painting.dart'; @@ -21,13 +19,16 @@ class Signup extends StatelessWidget { return Scaffold( bottomNavigationBar: _signinText(context), appBar: AppBar( - title: Image.asset( - "screenshots/logo.png", - height: 300, - width: 300, + backgroundColor: Colors.transparent, + title: Padding( + padding: const EdgeInsets.only(right: 45.0, top: 5), + child: Image.asset( + "screenshots/logo.png", + ), ), centerTitle: true, ), + backgroundColor: Colors.white, body: SingleChildScrollView( scrollDirection: Axis.vertical, child: Padding( @@ -41,32 +42,32 @@ class Signup extends StatelessWidget { const SizedBox( height: 10, ), - Text( + const Text( "Tune into your Mind", style: TextStyle( fontFamily: 't3', color: Colors.black, - fontSize: 32, + fontSize: 30, fontWeight: FontWeight.bold), ), const SizedBox( - height: 110, + height: 80, ), _registerText(), const SizedBox( - height: 100, + height: 80, ), _fullnamefield(context), const SizedBox( - height: 60, + height: 30, ), _emailfield(context), const SizedBox( - height: 60, + height: 30, ), _password(context), const SizedBox( - height: 60, + height: 80, ), ElevatedButton( style: ElevatedButton.styleFrom(backgroundColor: Colors.black), @@ -96,7 +97,7 @@ class Signup extends StatelessWidget { style: TextStyle( fontFamily: 't3', color: Colors.white, - fontSize: 22, + fontSize: 17, ), ), ), @@ -111,7 +112,7 @@ class Signup extends StatelessWidget { return const Text( 'Register', style: TextStyle( - letterSpacing: 3, + letterSpacing: 1, fontFamily: 't1', color: Colors.green, fontSize: 25, @@ -126,10 +127,10 @@ class Signup extends StatelessWidget { decoration: const InputDecoration( hintText: "Full Name", ).applyDefaults(Theme.of(context).inputDecorationTheme), - style: TextStyle( + style: const TextStyle( fontFamily: 't3', color: Colors.black, - fontSize: 20, + fontSize: 16, fontWeight: FontWeight.bold), ); } @@ -140,10 +141,10 @@ class Signup extends StatelessWidget { decoration: const InputDecoration( hintText: "Enter Email", ), - style: TextStyle( + style: const TextStyle( fontFamily: 't3', color: Colors.black, - fontSize: 20, + fontSize: 16, fontWeight: FontWeight.bold), ); } @@ -154,17 +155,17 @@ class Signup extends StatelessWidget { decoration: const InputDecoration( hintText: "Password", ), - style: TextStyle( + style: const TextStyle( fontFamily: 't3', color: Colors.black, - fontSize: 20, + fontSize: 16, fontWeight: FontWeight.bold), ); } Widget _signinText(BuildContext context) { return Padding( - padding: EdgeInsets.symmetric(vertical: 30), + padding: const EdgeInsets.symmetric(vertical: 30), child: Row( mainAxisAlignment: MainAxisAlignment.center, children: [ @@ -173,7 +174,7 @@ class Signup extends StatelessWidget { style: TextStyle( fontFamily: 't2', color: Colors.green, - fontSize: 25, + fontSize: 20, fontWeight: FontWeight.bold), ), TextButton( @@ -189,7 +190,7 @@ class Signup extends StatelessWidget { letterSpacing: 0, fontFamily: 't2', color: Colors.purple, - fontSize: 25, + fontSize: 20, fontWeight: FontWeight.bold), )), ], diff --git a/lib/features/auth/presentation/auth/pages/signup_or_signin.dart b/lib/features/auth/presentation/auth/pages/signup_or_signin.dart index ada196a..0df0fe6 100644 --- a/lib/features/auth/presentation/auth/pages/signup_or_signin.dart +++ b/lib/features/auth/presentation/auth/pages/signup_or_signin.dart @@ -21,8 +21,13 @@ class SignupOrSignin extends StatelessWidget { child: SvgPicture.asset("assets/bottom_pattern.svg"), ), Align( - alignment: Alignment.topCenter, - child: Image.asset("screenshots/logo.png")), + alignment: Alignment.topCenter, + child: Image.asset( + "screenshots/logo.png", + width: 400, + height: 300, + ), + ), Align( alignment: Alignment.center, child: Padding( @@ -44,7 +49,7 @@ class SignupOrSignin extends StatelessWidget { style: TextStyle( fontFamily: 't3', color: Colors.white, - fontSize: 35, + fontSize: 28, letterSpacing: 0, leadingDistribution: TextLeadingDistribution.proportional), @@ -57,13 +62,13 @@ class SignupOrSignin extends StatelessWidget { style: TextStyle( fontFamily: 't3', color: Colors.white, - fontSize: 25, + fontSize: 20, letterSpacing: 0, leadingDistribution: TextLeadingDistribution.proportional), ), const SizedBox( - height: 200, + height: 100, ), const Text( "Mindful does everything you ever wished for from making you relaxed to give you future motivation", diff --git a/lib/features/meditation/presentation/pages/playlistscreen.dart b/lib/features/meditation/presentation/pages/playlistscreen.dart index fc5ff64..1e176a6 100644 --- a/lib/features/meditation/presentation/pages/playlistscreen.dart +++ b/lib/features/meditation/presentation/pages/playlistscreen.dart @@ -5,7 +5,6 @@ import 'package:mental_health/features/music/data/sources/song_datasource.dart'; import 'package:mental_health/features/music/domain/entitites/song.dart'; import 'package:mental_health/features/music/presentation/bloc/song_bloc.dart'; import 'package:mental_health/features/music/presentation/pages/music_player_screen.dart'; -import 'package:http/http.dart' as http; import '../../../music/presentation/bloc/song_state.dart'; @@ -33,45 +32,48 @@ class _PlaylistscreenState extends State { ), body: BlocBuilder(builder: (context, state) { if (state is SongLoading) { - return Center( + return const Center( child: CircularProgressIndicator.adaptive(), ); } else if (state is SongLoaded) { - return Container( - color: DefaultColors.white, - child: ListView.builder( - itemCount: state.songs.length, - itemBuilder: (context, index) { - return ListTile( - leading: CircleAvatar( - backgroundImage: - NetworkImage(state.songs[index].imageid), - ), - trailing: const Icon( - Icons.arrow_forward, - size: 15, - ), - title: Text( - state.songs[index].title, - style: Theme.of(context).textTheme.labelMedium, - ), - subtitle: Text( - state.songs[index].author, - style: Theme.of(context).textTheme.labelSmall, - ), - onTap: () { - // - // var x = SongRemoteDataSourceImpl(client: http.Client()); - // x.getAllSongs(); - Navigator.push( - context, - MaterialPageRoute( - builder: (context) => MusicPlayerScreen( - song: state.songs[index], - ))); - }, - ); - }), + return Padding( + padding: const EdgeInsets.only(top: 10.0), + child: Container( + color: DefaultColors.white, + child: ListView.builder( + itemCount: state.songs.length, + itemBuilder: (context, index) { + return ListTile( + leading: CircleAvatar( + backgroundImage: + NetworkImage(state.songs[index].imageid), + ), + trailing: const Icon( + Icons.arrow_forward, + size: 15, + ), + title: Text( + state.songs[index].title, + style: Theme.of(context).textTheme.labelMedium!.copyWith(fontSize: 20), + ), + subtitle: Text( + state.songs[index].author, + style: Theme.of(context).textTheme.labelSmall, + ), + onTap: () { + // + // var x = SongRemoteDataSourceImpl(client: http.Client()); + // x.getAllSongs(); + Navigator.push( + context, + MaterialPageRoute( + builder: (context) => MusicPlayerScreen( + song: state.songs[index], + ))); + }, + ); + }), + ), ); } else if (state is SongLoadFailure) { return Center( diff --git a/lib/features/music/presentation/pages/music_player_screen.dart b/lib/features/music/presentation/pages/music_player_screen.dart index aafcce3..465f4ba 100644 --- a/lib/features/music/presentation/pages/music_player_screen.dart +++ b/lib/features/music/presentation/pages/music_player_screen.dart @@ -77,39 +77,32 @@ class _MusicPlayerScreenState extends State { title: Text( "Your Chill Song", style: Theme.of(context).textTheme.bodyMedium!.copyWith( - color: Colors.black, fontSize: 25, fontWeight: FontWeight.bold), + color: Colors.grey, fontSize: 25, fontWeight: FontWeight.bold), ), centerTitle: true, leading: GestureDetector( onTap: () => Navigator.pop(context), child: Image.asset( 'assets/down_arrow.png', + color: Colors.white, ), ), actions: [ - Image.asset("assets/transcript_icon.png"), + Image.asset( + "assets/transcript_icon.png", + color: Colors.white, + ), const SizedBox( width: 16, ), ], ), - backgroundColor: Colors.white.withOpacity(0.95), + // backgroundColor: Colors.white.withOpacity(0.95), + backgroundColor: Colors.black.withOpacity(0.95), body: Container( padding: const EdgeInsets.only(top: 40, left: 35, right: 35), child: Column( children: [ - // - // ClipRRect( - // borderRadius: BorderRadius.circular(20), - // child: Image.network( - // widget.song.imageid, - // height: 300, - // width: double.infinity, - // fit: BoxFit.cover, - // ), - // ), - - // const Spacer(), StreamBuilder( stream: _audioPlayer.positionStream, builder: (context, snapshot) { @@ -127,7 +120,7 @@ class _MusicPlayerScreenState extends State { .textTheme .displayMedium! .copyWith( - fontSize: 18, + fontSize: 16, color: Colors.grey.withOpacity(0.6)), ), Text( @@ -137,115 +130,103 @@ class _MusicPlayerScreenState extends State { .textTheme .displayMedium! .copyWith( - fontSize: 18, + fontSize: 16, color: Colors.grey.withOpacity(0.6))), ], ), const SizedBox( height: 30, ), - CircularPercentIndicator( - arcType: ArcType.FULL, - backgroundColor: Colors.red, - progressColor: Colors.red, - - // curve: Curves.easeInToLinear, - radius: MediaQuery.of(context).size.width / 2.7, - center: Container( - decoration: BoxDecoration( + Align( + alignment: Alignment.center, + child: CircularPercentIndicator( + arcType: ArcType.FULL, + backgroundColor: Colors.red, + progressColor: Colors.red, + radius: MediaQuery.of(context).size.width / 2.7, + center: Container( + decoration: BoxDecoration( + borderRadius: BorderRadius.circular( + MediaQuery.of(context).size.width * 0.7 - + 30), + boxShadow: [ + BoxShadow( + // spreadRadius: 20, + blurRadius: 140, + offset: const Offset(-3, 20), + color: Colors.deepOrangeAccent + .withOpacity(0.5), + ) + ]), + width: MediaQuery.of(context).size.width * 0.7 - 40, + height: + MediaQuery.of(context).size.width * 0.7 - 40, + child: ClipRRect( borderRadius: BorderRadius.circular( - MediaQuery.of(context).size.width * 0.7 - 30), - boxShadow: [ - BoxShadow( - // spreadRadius: 20, - blurRadius: 120, - offset: const Offset(-3, 20), - color: - Colors.deepOrangeAccent.withOpacity(0.5), - ) - ]), - width: MediaQuery.of(context).size.width * 0.7 - 40, - height: MediaQuery.of(context).size.width * 0.7 - 40, - child: ClipRRect( - borderRadius: BorderRadius.circular( - MediaQuery.of(context).size.width), - child: Image.network( - widget.song.imageid, - scale: 1, - // height: 200, - // width: double.infinity, - fit: BoxFit.cover, + MediaQuery.of(context).size.width), + child: Image.network( + widget.song.imageid, + scale: 0.1, + // height: 200, + // width: double.infinity, + fit: BoxFit.cover, + ), ), ), + percent: position.inSeconds / total.inSeconds, + startAngle: 0, + circularStrokeCap: CircularStrokeCap.round, ), - percent: position.inSeconds / total.inSeconds, - circularStrokeCap: CircularStrokeCap.round, ), ], ); - - // return ProgressBar( - // timeLabelLocation: TimeLabelLocation.below, - // timeLabelTextStyle: Theme.of(context).textTheme.labelSmall, - // progress: position, - // total: total, - // baseBarColor: DefaultColors.lightpink, - // thumbColor: DefaultColors.pink, - // onSeek: (duration) { - // _audioPlayer.seek(duration); - // }, - // ); }), - const SizedBox( - height: 40, + height: 30, ), Text( widget.song.title, style: Theme.of(context).textTheme.displayMedium!.copyWith( - fontWeight: FontWeight.bold, fontSize: 34, letterSpacing: 1), + color: Colors.white70, + fontWeight: FontWeight.bold, + fontSize: 30, + letterSpacing: 1), textAlign: TextAlign.center, ), const SizedBox( - height: 15, + height: 17, ), Text( "By : ${widget.song.author}", style: Theme.of(context) .textTheme .labelSmall! - .copyWith(fontSize: 21, color: Colors.grey), + .copyWith(fontSize: 17, color: Colors.grey), textAlign: TextAlign.center, ), const SizedBox( - height: 80, + height: 50, ), - Row( - mainAxisAlignment: MainAxisAlignment.spaceEvenly, + mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ Container( child: IconButton( onPressed: () {}, icon: Icon( - size: 28, + size: 22, CupertinoIcons.shuffle, color: Colors.grey.withOpacity(0.5))), ), - const SizedBox( - width: 18, - ), + Container( child: IconButton( onPressed: seekBackward, icon: Icon( - size: 37, + size: 35, Icons.skip_previous_sharp, color: Colors.grey.withOpacity(0.5))), ), - const SizedBox( - width: 2, - ), StreamBuilder( stream: _audioPlayer.playerStateStream, builder: (context, snapshot) { @@ -257,8 +238,8 @@ class _MusicPlayerScreenState extends State { processingState == ProcessingState.buffering) { return Container( // margin: const EdgeInsets.all(8), - width: 50, - height: 50, + width: 22, + height: 22, child: const CircularProgressIndicator( color: DefaultColors.pink, ), @@ -270,11 +251,11 @@ class _MusicPlayerScreenState extends State { boxShadow: [ BoxShadow( color: Colors.redAccent.withOpacity(0.17), - blurRadius: 5, + blurRadius: 6, spreadRadius: 10) ]), child: IconButton( - iconSize: 130, + iconSize: 80, onPressed: togglePlayPause, icon: Icon(CupertinoIcons.play_circle_fill, color: Colors.redAccent.withOpacity(1))), @@ -282,7 +263,7 @@ class _MusicPlayerScreenState extends State { } else if (processingState != ProcessingState.completed) { return Container( child: IconButton( - iconSize: 110, + iconSize: 80, onPressed: togglePlayPause, icon: Icon( CupertinoIcons.pause_circle_fill, @@ -292,7 +273,7 @@ class _MusicPlayerScreenState extends State { } else { return Container( child: IconButton( - iconSize: 110, + iconSize: 80, onPressed: seekRestart, icon: Icon( CupertinoIcons.restart, @@ -301,26 +282,21 @@ class _MusicPlayerScreenState extends State { ); } }), - const SizedBox( - width: 2, - ), Container( child: IconButton( onPressed: seekForward, icon: Icon( - size: 26, + size: 25, CupertinoIcons.playpause_fill, color: Colors.grey.withOpacity(0.5), )), ), - const SizedBox( - width: 12, - ), + Container( child: IconButton( onPressed: toggleLoop, icon: Icon( - size: 30, + size: 24, isLooping ? CupertinoIcons.repeat_1 : CupertinoIcons.repeat, diff --git a/lib/presentation/Face_Emotion_Recognition/fer2013.dart b/lib/presentation/Face_Emotion_Recognition/fer2013.dart index b77c4c4..4348c9b 100644 --- a/lib/presentation/Face_Emotion_Recognition/fer2013.dart +++ b/lib/presentation/Face_Emotion_Recognition/fer2013.dart @@ -8,72 +8,62 @@ import 'package:image_picker/image_picker.dart'; class _FaceEmotionDetector extends State { var faceSdk = FaceSDK.instance; - var _emotion = "not initialised"; - var _status = "not initialised"; - var _details = "not initialised"; + var _emotion = "Not Initialised"; + var _status = "not Initialised"; + var _details = "Not Initialised"; var _uiImage1 = Image.asset('assets/portrait.png'); - set emotion(String val) => setState(() { - _emotion=val; - }); + _emotion = val; + }); set status(String val) => setState(() { - _status=val; - - }); + _status = val; + }); set details(String val) => setState(() { - _details=val; - }); - + _details = val; + }); set uiImage1(Image val) => setState(() => _uiImage1 = val); - Uint8List? mfImage1; - void init() async { super.initState(); if (!await initialize()) return; - status = "Service Loaded"; + status = "Face Emotion Detector"; } EmotionDetect() async { - setState(() { - - }); - var config = DetectFacesConfig( + setState(() {}); + var config = DetectFacesConfig( attributes: [ DetectFacesAttribute.EMOTION, ], ); if (mfImage1 == null) return; - var request = DetectFacesRequest(mfImage1!, config); + var request = DetectFacesRequest(mfImage1!, config); var response = await faceSdk.detectFaces(request); response.detection?.attributes?.forEach((attributeResult) { var value = attributeResult.value; - var attribute = attributeResult.attribute; var confidence = attributeResult.confidence; - print(value); - emotion=value!; - details=confidence.toString(); - + emotion = value!; + details = confidence.toString(); }); } clearResults() { - status = "Service Restarted"; + status = "FER Restarted"; emotion = "nil"; - details="nil"; + details = "nil"; uiImage1 = Image.asset('assets/portrait.png'); mfImage1 = null; } Future initialize() async { - status = "Initializing..."; + status = "Configuring..."; InitConfig? config = null; var (success, error) = await faceSdk.initialize(config: config); if (!success) { @@ -84,10 +74,9 @@ class _FaceEmotionDetector extends State { } setImage(Uint8List bytes, ImageType type, int number) async { - // var mfImage = MatchFacesImage(bytes, type); if (number == 1) { - mfImage1 = bytes; + mfImage1 = bytes; uiImage1 = Image.memory(bytes); } } @@ -108,13 +97,12 @@ class _FaceEmotionDetector extends State { var response = await faceSdk.startFaceCapture(); var image = response.image; if (image != null) setImage(image.image, image.imageType, number); - }); } Widget image(Image image, Function() onTap) => GestureDetector( onTap: onTap, - child: Image(height: 150, width: 150, image: image.image), + child: Image(height: 300, width: 300, image: image.image), ); Widget button(String text, Function() onPressed) { @@ -127,7 +115,9 @@ class _FaceEmotionDetector extends State { ); } - Widget text(String text) => Text(text, style: TextStyle(fontSize: 18,color: Colors.black)); + Widget text(String text) => Text(text, + style: TextStyle( + fontSize: 22, color: Colors.black, fontWeight: FontWeight.bold)); Widget textButton(String text, Function() onPressed, {ButtonStyle? style}) => TextButton( @@ -139,7 +129,7 @@ class _FaceEmotionDetector extends State { setImageDialog(BuildContext context, int number) => showDialog( context: context, builder: (BuildContext context) => AlertDialog( - title: Text("Select option"), + title: Text("Select Option"), actions: [useGallery(number), useCamera(number)], ), ); @@ -147,7 +137,15 @@ class _FaceEmotionDetector extends State { @override Widget build(BuildContext bc) { return Scaffold( - appBar: AppBar(title: Center(child: Text(_status))), + appBar: AppBar( + title: Padding( + padding: const EdgeInsets.only(top: 20.0), + child: Center( + child: Text( + _status, + style: TextStyle(color: Colors.green, fontSize: 30), + )), + )), body: Container( margin: EdgeInsets.fromLTRB(0, 0, 0, MediaQuery.of(bc).size.height / 8), width: double.infinity, @@ -156,19 +154,41 @@ class _FaceEmotionDetector extends State { child: Column( mainAxisAlignment: MainAxisAlignment.center, children: [ + SizedBox( + height: 50, + ), image(_uiImage1, () => setImageDialog(bc, 1)), - Container(margin: EdgeInsets.fromLTRB(0, 0, 0, 15)), - ElevatedButton(onPressed: EmotionDetect, child: Text("Detect")), - button("Clear", () => clearResults()), - Container(margin: EdgeInsets.fromLTRB(0, 15, 0, 0)), - Row( + SizedBox( + height: 40, + ), + Column( + crossAxisAlignment: CrossAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center, children: [ - text("Emotion: $_emotion"), + text("Emotion : $_emotion"), Container(margin: EdgeInsets.fromLTRB(20, 0, 0, 0)), - text("Details: $_details"), + text("Accuracy : ${_details}"), ], - ) + ), + SizedBox( + height: 25, + ), + ElevatedButton( + style: + ElevatedButton.styleFrom(backgroundColor: Colors.black), + onPressed: EmotionDetect, + child: Text( + "Analyze Emotion", + style: TextStyle(fontSize: 20, color: Colors.white), + )), + SizedBox( + height: 5, + ), + ElevatedButton( + style: ElevatedButton.styleFrom(backgroundColor: Colors.red), + onPressed: clearResults, + child: Text("Reset", + style: TextStyle(fontSize: 20, color: Colors.black))) ], ), ), @@ -189,4 +209,4 @@ class FaceEmotionDetector extends StatefulWidget { @override _FaceEmotionDetector createState() => _FaceEmotionDetector(); -} \ No newline at end of file +} diff --git a/lib/presentation/chat_screen/chat_with_ai.dart b/lib/presentation/chat_screen/chat_with_ai.dart index bce8b2b..8276afd 100644 --- a/lib/presentation/chat_screen/chat_with_ai.dart +++ b/lib/presentation/chat_screen/chat_with_ai.dart @@ -44,7 +44,7 @@ class _ChatScreenState extends State { image: DecorationImage( colorFilter: new ColorFilter.mode( Colors.black.withOpacity(0.8), BlendMode.dstATop), - image: NetworkImage( + image: const NetworkImage( 'https://media.istockphoto.com/id/1850608258/vector/seamless-talking-speech-bubble-conversation-chatting-teamwork-gpt-background.jpg?s=612x612&w=0&k=20&c=nEB5xbclDA-FGFSVN_ttBEHiNS1IJ5NtqRAlZTWlVJI='), fit: BoxFit.cover)), child: Column( @@ -67,29 +67,34 @@ class _ChatScreenState extends State { Expanded( flex: 15, child: TextFormField( - style: TextStyle(color: Colors.white), + style: const TextStyle(color: Colors.white), controller: _userInput, decoration: InputDecoration( border: OutlineInputBorder( + borderSide: const BorderSide( + color: Colors.black, width: 10), borderRadius: BorderRadius.circular(15), ), - label: Text('Enter Your Message')), + label: const Text( + 'Ask Me Anything', + style: TextStyle(color: Colors.white), + )), ), ), - Spacer(), + const Spacer(), IconButton( - padding: EdgeInsets.all(12), + padding: const EdgeInsets.all(12), iconSize: 30, style: ButtonStyle( backgroundColor: - MaterialStateProperty.all(Colors.black), + WidgetStateProperty.all(Colors.black), foregroundColor: - MaterialStateProperty.all(Colors.white), - shape: MaterialStateProperty.all(CircleBorder())), + WidgetStateProperty.all(Colors.white), + shape: WidgetStateProperty.all(const CircleBorder())), onPressed: () { sendMessage(); }, - icon: Icon(Icons.send)) + icon: const Icon(Icons.send)) ], ), ) @@ -123,16 +128,16 @@ class Messages extends StatelessWidget { Widget build(BuildContext context) { return Container( width: double.infinity, - padding: EdgeInsets.all(15), - margin: EdgeInsets.symmetric(vertical: 15) + padding: const EdgeInsets.all(15), + margin: const EdgeInsets.symmetric(vertical: 15) .copyWith(left: isUser ? 100 : 10, right: isUser ? 10 : 100), decoration: BoxDecoration( - color: isUser ? Colors.blueAccent : Colors.grey.shade400, + color: isUser ? Colors.black : Colors.white, borderRadius: BorderRadius.only( - topLeft: Radius.circular(10), - bottomLeft: isUser ? Radius.circular(10) : Radius.zero, - topRight: Radius.circular(10), - bottomRight: isUser ? Radius.zero : Radius.circular(10))), + topLeft: const Radius.circular(10), + bottomLeft: isUser ? const Radius.circular(10) : Radius.zero, + topRight: const Radius.circular(10), + bottomRight: isUser ? Radius.zero : const Radius.circular(10))), child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ diff --git a/lib/presentation/onboarding/onboarding.dart b/lib/presentation/onboarding/onboarding.dart index 71231e6..f58b63e 100644 --- a/lib/presentation/onboarding/onboarding.dart +++ b/lib/presentation/onboarding/onboarding.dart @@ -10,6 +10,7 @@ class Onboarding extends StatelessWidget { @override Widget build(BuildContext context) { return Scaffold( + backgroundColor: Colors.white, body: OnBoardingSlider( totalPage: 3, headerBackgroundColor: Colors.white, @@ -42,8 +43,8 @@ class Onboarding extends StatelessWidget { style: TextStyle( fontFamily: 't3', color: Colors.black, - fontSize: 20, - letterSpacing: 2, + fontSize: 17, + letterSpacing: 0, leadingDistribution: TextLeadingDistribution.proportional), ), skipIcon: const Icon( @@ -56,7 +57,7 @@ class Onboarding extends StatelessWidget { fontFamily: 't3', color: Colors.black, fontSize: 17, - letterSpacing: 2, + letterSpacing: 0, leadingDistribution: TextLeadingDistribution.proportional), ), trailingFunction: () { @@ -68,39 +69,48 @@ class Onboarding extends StatelessWidget { }, background: [ Container( - height: MediaQuery.of(context).size.height * 0.95, + height: MediaQuery.of(context).size.height * 0.85, width: MediaQuery.of(context).size.width, decoration: const BoxDecoration( + color: Colors.white, image: DecorationImage( image: AssetImage('assets/med1.jpg'), fit: BoxFit.fitWidth)), ), - Container( - height: MediaQuery.of(context).size.height * 0.95, - width: MediaQuery.of(context).size.width, - decoration: const BoxDecoration( - image: DecorationImage( - image: AssetImage('assets/ai.png'), - fit: BoxFit.fitWidth)), + Padding( + padding: EdgeInsets.only( + left: MediaQuery.of(context).size.width / 9.5), + child: Container( + height: MediaQuery.of(context).size.height * 0.80, + width: MediaQuery.of(context).size.width * 0.8, + decoration: const BoxDecoration( + color: Colors.white, + image: DecorationImage( + image: AssetImage('assets/ai.png'), + fit: BoxFit.contain)), + ), ), const Stack( children: [ Image( image: AssetImage('assets/nodepress.png'), - width: 450, - height: 450, + width: 400, + height: 400, ), - Image( - image: AssetImage('assets/firebase.png'), - width: 225, - height: 850, + Padding( + padding: EdgeInsets.only(left: 20.0), + child: Image( + image: AssetImage('assets/firebase.png'), + width: 160, + height: 720, + ), ), Positioned( - top: 355, + top: 300, child: Image( image: AssetImage('assets/postgres.png'), - width: 620, - height: 150, + width: 570, + height: 130, )), ], ), @@ -111,7 +121,7 @@ class Onboarding extends StatelessWidget { Positioned( left: 0, right: 0, - top: MediaQuery.of(context).size.height / 7, + top: MediaQuery.of(context).size.height / 10, child: Container( padding: const EdgeInsets.symmetric(horizontal: 40), child: Column( @@ -122,7 +132,7 @@ class Onboarding extends StatelessWidget { fontFamily: 't2', color: Colors.black, fontSize: 60, - letterSpacing: 5, + letterSpacing: 2, leadingDistribution: TextLeadingDistribution.proportional), ), @@ -149,17 +159,17 @@ class Onboarding extends StatelessWidget { Positioned( left: 0, right: 0, - top: MediaQuery.of(context).size.height / 9, + top: MediaQuery.of(context).size.height / 14, child: Container( padding: const EdgeInsets.symmetric(horizontal: 40), child: Column( children: [ - Text( + const Text( 'Most Powerful Integration', style: TextStyle( fontFamily: 't2', color: Colors.black, - fontSize: 50, + fontSize: 40, letterSpacing: 0, leadingDistribution: TextLeadingDistribution.proportional), @@ -167,7 +177,7 @@ class Onboarding extends StatelessWidget { ), // SizedBox(height: MediaQuery.of(context).size.height / 20), SizedBox( - height: MediaQuery.of(context).size.height / 2.7, + height: MediaQuery.of(context).size.height / 3, ), Text( "Suggestions like Never Before and Analysis like a Pro", @@ -191,7 +201,7 @@ class Onboarding extends StatelessWidget { Positioned( left: 0, right: 0, - top: MediaQuery.of(context).size.height / 17, + top: MediaQuery.of(context).size.height / 35, child: Container( padding: const EdgeInsets.symmetric(horizontal: 40), child: Column( @@ -201,14 +211,14 @@ class Onboarding extends StatelessWidget { style: TextStyle( fontFamily: 't1', color: Colors.black, - fontSize: 50, - letterSpacing: 2, + fontSize: 40, + letterSpacing: 0, leadingDistribution: TextLeadingDistribution.proportional), textAlign: TextAlign.center, ), SizedBox(height: MediaQuery.of(context).size.height / 2), - Text( + const Text( "Fully Secure Transmission of Vital Information", style: TextStyle( fontWeight: FontWeight.bold, @@ -223,7 +233,7 @@ class Onboarding extends StatelessWidget { const SizedBox( height: 50, ), - Text( + const Text( "Thanks to the encrypted Technologies used", style: TextStyle( fontWeight: FontWeight.bold, @@ -241,41 +251,6 @@ class Onboarding extends StatelessWidget { ), ]), ]), - - // body: Stack( - // children: [ - // Positioned.fill( - // child: Image.asset( - // 'assets/onboarding.png', - // fit: BoxFit.contain, - // )), - // Align( - // alignment: Alignment.bottomCenter, - // child: Padding( - // padding: const EdgeInsets.all(16.0), - // child: SizedBox( - // height: 70, - // child: ElevatedButton( - // onPressed: () { - // Navigator.of(context).pushAndRemoveUntil( - // MaterialPageRoute( - // builder: (BuildContext context) => HomePage()), - // (context) => false); - // }, - // style: ElevatedButton.styleFrom( - // minimumSize: const Size(double.infinity, 50), - // backgroundColor: Theme.of(context).focusColor, - // shape: RoundedRectangleBorder( - // borderRadius: BorderRadius.circular(12))), - // child: Text( - // "Let us help you", - // style: Theme.of(context).textTheme.bodyLarge, - // )), - // ), - // ), - // ), - // ], - // ), ); } }