diff --git a/android/app/src/main/AndroidManifest.xml b/android/app/src/main/AndroidManifest.xml index fa0b24c..954d593 100644 --- a/android/app/src/main/AndroidManifest.xml +++ b/android/app/src/main/AndroidManifest.xml @@ -1,7 +1,7 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/android/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml b/android/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml new file mode 100644 index 0000000..c4a603d --- /dev/null +++ b/android/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/android/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml b/android/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml new file mode 100644 index 0000000..c4a603d --- /dev/null +++ b/android/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/android/app/src/main/res/mipmap-hdpi/ic_launcher.png b/android/app/src/main/res/mipmap-hdpi/ic_launcher.png index db77bb4..4e5bcda 100644 Binary files a/android/app/src/main/res/mipmap-hdpi/ic_launcher.png and b/android/app/src/main/res/mipmap-hdpi/ic_launcher.png differ diff --git a/android/app/src/main/res/mipmap-hdpi/ic_launcher_foreground.png b/android/app/src/main/res/mipmap-hdpi/ic_launcher_foreground.png new file mode 100644 index 0000000..03dafaa Binary files /dev/null and b/android/app/src/main/res/mipmap-hdpi/ic_launcher_foreground.png differ diff --git a/android/app/src/main/res/mipmap-hdpi/ic_launcher_round.png b/android/app/src/main/res/mipmap-hdpi/ic_launcher_round.png new file mode 100644 index 0000000..1646924 Binary files /dev/null and b/android/app/src/main/res/mipmap-hdpi/ic_launcher_round.png differ diff --git a/android/app/src/main/res/mipmap-mdpi/ic_launcher.png b/android/app/src/main/res/mipmap-mdpi/ic_launcher.png index 17987b7..945c258 100644 Binary files a/android/app/src/main/res/mipmap-mdpi/ic_launcher.png and b/android/app/src/main/res/mipmap-mdpi/ic_launcher.png differ diff --git a/android/app/src/main/res/mipmap-mdpi/ic_launcher_foreground.png b/android/app/src/main/res/mipmap-mdpi/ic_launcher_foreground.png new file mode 100644 index 0000000..1ade4b9 Binary files /dev/null and b/android/app/src/main/res/mipmap-mdpi/ic_launcher_foreground.png differ diff --git a/android/app/src/main/res/mipmap-mdpi/ic_launcher_round.png b/android/app/src/main/res/mipmap-mdpi/ic_launcher_round.png new file mode 100644 index 0000000..4a8fb3f Binary files /dev/null and b/android/app/src/main/res/mipmap-mdpi/ic_launcher_round.png differ diff --git a/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png b/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png index 09d4391..5e2f06a 100644 Binary files a/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png and b/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png differ diff --git a/android/app/src/main/res/mipmap-xhdpi/ic_launcher_foreground.png b/android/app/src/main/res/mipmap-xhdpi/ic_launcher_foreground.png new file mode 100644 index 0000000..cf943a4 Binary files /dev/null and b/android/app/src/main/res/mipmap-xhdpi/ic_launcher_foreground.png differ diff --git a/android/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png b/android/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png new file mode 100644 index 0000000..e1e9455 Binary files /dev/null and b/android/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png differ diff --git a/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png b/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png index d5f1c8d..42f4260 100644 Binary files a/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png and b/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png differ diff --git a/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_foreground.png b/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_foreground.png new file mode 100644 index 0000000..468d4fb Binary files /dev/null and b/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_foreground.png differ diff --git a/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png b/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png new file mode 100644 index 0000000..7111d94 Binary files /dev/null and b/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png differ diff --git a/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png b/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png index 4d6372e..68538e1 100644 Binary files a/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png and b/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png differ diff --git a/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_foreground.png b/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_foreground.png new file mode 100644 index 0000000..175b01e Binary files /dev/null and b/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_foreground.png differ diff --git a/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png b/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png new file mode 100644 index 0000000..e3d37fe Binary files /dev/null and b/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png differ diff --git a/assets/images/appicon.png b/assets/images/appicon.png new file mode 100644 index 0000000..e224b29 Binary files /dev/null and b/assets/images/appicon.png differ diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json deleted file mode 100644 index d36b1fa..0000000 --- a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json +++ /dev/null @@ -1,122 +0,0 @@ -{ - "images" : [ - { - "size" : "20x20", - "idiom" : "iphone", - "filename" : "Icon-App-20x20@2x.png", - "scale" : "2x" - }, - { - "size" : "20x20", - "idiom" : "iphone", - "filename" : "Icon-App-20x20@3x.png", - "scale" : "3x" - }, - { - "size" : "29x29", - "idiom" : "iphone", - "filename" : "Icon-App-29x29@1x.png", - "scale" : "1x" - }, - { - "size" : "29x29", - "idiom" : "iphone", - "filename" : "Icon-App-29x29@2x.png", - "scale" : "2x" - }, - { - "size" : "29x29", - "idiom" : "iphone", - "filename" : "Icon-App-29x29@3x.png", - "scale" : "3x" - }, - { - "size" : "40x40", - "idiom" : "iphone", - "filename" : "Icon-App-40x40@2x.png", - "scale" : "2x" - }, - { - "size" : "40x40", - "idiom" : "iphone", - "filename" : "Icon-App-40x40@3x.png", - "scale" : "3x" - }, - { - "size" : "60x60", - "idiom" : "iphone", - "filename" : "Icon-App-60x60@2x.png", - "scale" : "2x" - }, - { - "size" : "60x60", - "idiom" : "iphone", - "filename" : "Icon-App-60x60@3x.png", - "scale" : "3x" - }, - { - "size" : "20x20", - "idiom" : "ipad", - "filename" : "Icon-App-20x20@1x.png", - "scale" : "1x" - }, - { - "size" : "20x20", - "idiom" : "ipad", - "filename" : "Icon-App-20x20@2x.png", - "scale" : "2x" - }, - { - "size" : "29x29", - "idiom" : "ipad", - "filename" : "Icon-App-29x29@1x.png", - "scale" : "1x" - }, - { - "size" : "29x29", - "idiom" : "ipad", - "filename" : "Icon-App-29x29@2x.png", - "scale" : "2x" - }, - { - "size" : "40x40", - "idiom" : "ipad", - "filename" : "Icon-App-40x40@1x.png", - "scale" : "1x" - }, - { - "size" : "40x40", - "idiom" : "ipad", - "filename" : "Icon-App-40x40@2x.png", - "scale" : "2x" - }, - { - "size" : "76x76", - "idiom" : "ipad", - "filename" : "Icon-App-76x76@1x.png", - "scale" : "1x" - }, - { - "size" : "76x76", - "idiom" : "ipad", - "filename" : "Icon-App-76x76@2x.png", - "scale" : "2x" - }, - { - "size" : "83.5x83.5", - "idiom" : "ipad", - "filename" : "Icon-App-83.5x83.5@2x.png", - "scale" : "2x" - }, - { - "size" : "1024x1024", - "idiom" : "ios-marketing", - "filename" : "Icon-App-1024x1024@1x.png", - "scale" : "1x" - } - ], - "info" : { - "version" : 1, - "author" : "xcode" - } -} diff --git a/lib/components/customtextfield.dart b/lib/components/customtextfield.dart index cbce17c..20407c4 100644 --- a/lib/components/customtextfield.dart +++ b/lib/components/customtextfield.dart @@ -1,37 +1,6 @@ import 'package:flutter/material.dart'; -TextField customTextField(String text,IconData icon,bool isPasswordType,TextEditingController controller){ - - return TextField( - controller: controller, - obscureText: isPasswordType, - enableSuggestions: !isPasswordType, - autocorrect: !isPasswordType, - cursorColor: Colors.black, - style: TextStyle(color: Colors.black), - decoration: InputDecoration( - prefixIcon: Icon (icon,color: Colors.black,), - labelText: text, - labelStyle: TextStyle(color: Colors.grey.withOpacity(0.9)), - filled: true, - floatingLabelBehavior: FloatingLabelBehavior.never, - fillColor: Colors.white, - border: OutlineInputBorder( - borderRadius: BorderRadius.circular(10.0), - borderSide: const BorderSide( - width: 5, - color: Colors.black, - style: BorderStyle.solid, - ), - ), - ), - keyboardType: isPasswordType ? TextInputType.visiblePassword : TextInputType.emailAddress, - ); - -} - - -Container signinbuttons( BuildContext context , bool isLogin , Function onTap){ +Container signinbuttons(BuildContext context, bool isLogin, Function onTap) { return Container( width: MediaQuery.of(context).size.width, height: 50, @@ -40,12 +9,12 @@ Container signinbuttons( BuildContext context , bool isLogin , Function onTap){ borderRadius: BorderRadius.circular(90), ), child: ElevatedButton( - onPressed: (){ + onPressed: () { onTap(); }, style: ButtonStyle( backgroundColor: MaterialStateProperty.resolveWith( - (Set states) { + (Set states) { if (states.contains(MaterialState.pressed)) { return Colors.black26; } @@ -53,17 +22,12 @@ Container signinbuttons( BuildContext context , bool isLogin , Function onTap){ }, ), shape: MaterialStateProperty.all( - RoundedRectangleBorder(borderRadius: BorderRadius.circular(10)) - ) - ), + RoundedRectangleBorder(borderRadius: BorderRadius.circular(10)))), child: Text( isLogin ? "Log In" : "Sign Up", style: const TextStyle( - color: Colors.white, - fontWeight: FontWeight.bold, - fontSize: 16 - ), + color: Colors.white, fontWeight: FontWeight.bold, fontSize: 16), ), ), ); -} \ No newline at end of file +} diff --git a/lib/constants.dart b/lib/constants.dart index 919a59b..08462eb 100644 --- a/lib/constants.dart +++ b/lib/constants.dart @@ -9,25 +9,56 @@ Future> postData(String textField) async { String body = jsonEncode(data); // Use `data` in request body if using Node.js server as backend // Use `body` in request body if using FastAPI server as backend - final response = await http.post(url, body: body).timeout(const Duration(seconds: 5)); + final response = + await http.post(url, body: body).timeout(const Duration(seconds: 2)); Map temp = await json.decode(response.body); print(temp); return temp; } catch (e) { print("ERROR - $e"); - Map temp = { - "msg": "Bad Request or Server might be down :(" - }; - return temp; + return {"msg": "Bad Request or Server might be down :("}; } } +TextField customTextField(String text, IconData icon, bool isPasswordType, + TextEditingController controller) { + return TextField( + controller: controller, + obscureText: isPasswordType, + enableSuggestions: !isPasswordType, + autocorrect: !isPasswordType, + cursorColor: Colors.black, + style: TextStyle(color: Colors.black), + decoration: InputDecoration( + prefixIcon: Icon( + icon, + color: Colors.black, + ), + labelText: text, + labelStyle: TextStyle(color: Colors.grey.withOpacity(0.9)), + filled: true, + floatingLabelBehavior: FloatingLabelBehavior.never, + fillColor: Colors.white, + border: OutlineInputBorder( + borderRadius: BorderRadius.circular(10.0), + borderSide: const BorderSide( + width: 5, + color: Colors.black, + style: BorderStyle.solid, + ), + ), + ), + keyboardType: isPasswordType + ? TextInputType.visiblePassword + : TextInputType.emailAddress, + ); +} + const kBoxDecoration = BoxDecoration( gradient: LinearGradient( begin: Alignment.topCenter, end: Alignment.bottomCenter, colors: [ - // Color(0xFF2C2B2B), // Color(0xFF1D1C1C), @@ -56,3 +87,9 @@ const kBoxDecoration = BoxDecoration( ), ); +const kHomepageText = TextStyle( + fontSize: 30, + fontWeight: FontWeight.bold, + color: Colors.white, + fontFamily: 'OpenSans', +); diff --git a/lib/pages/HomePage.dart b/lib/pages/HomePage.dart index 04e8065..75a9a47 100644 --- a/lib/pages/HomePage.dart +++ b/lib/pages/HomePage.dart @@ -1,9 +1,7 @@ import '../components/ResultsPage.dart'; import 'package:flutter/material.dart'; -import '../components/customtextfield.dart'; import '../constants.dart'; - class HomePage extends StatefulWidget { const HomePage({Key? key}) : super(key: key); @@ -12,10 +10,10 @@ class HomePage extends StatefulWidget { } class _HomePageState extends State { - final TextEditingController myController = TextEditingController(); bool isactive1 = true; bool isactive2 = false; + String username = "Emily"; @override Widget build(BuildContext context) { @@ -27,30 +25,27 @@ class _HomePageState extends State { height: MediaQuery.of(context).size.height, width: MediaQuery.of(context).size.width, child: SingleChildScrollView( - child: Padding( - padding: EdgeInsets.fromLTRB(20,MediaQuery.of(context).size.height * 0.06,20,0), + padding: EdgeInsets.fromLTRB( + 20, MediaQuery.of(context).size.height * 0.06, 20, 0), child: Column( crossAxisAlignment: CrossAxisAlignment.start, - children:[ + children: [ Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, crossAxisAlignment: CrossAxisAlignment.start, children: [ Column( crossAxisAlignment: CrossAxisAlignment.start, - children: const [SizedBox( - height: 3, - ), - Text("Hello User", - style: TextStyle( - fontSize: 30, - fontWeight: FontWeight.bold, - color: Colors.white, - fontFamily: 'OpenSans', + children: [ + const SizedBox( + height: 3, + ), + Text( + "Hello $username", + style: kHomepageText, + textAlign: TextAlign.left, ), - textAlign: TextAlign.left, - ), SizedBox( height: 5, ), @@ -66,18 +61,19 @@ class _HomePageState extends State { Container( child: Image.asset('assets/images/bababa.png'), ), - ] - ), + ],), const SizedBox( height: 30, ), - const Text("Moods", - style:TextStyle( + const Text( + "Moods", + style: TextStyle( fontSize: 26, fontWeight: FontWeight.bold, color: Colors.white, fontFamily: 'Outfit', - ),), + ), + ), const SizedBox( height: 8, ), @@ -134,7 +130,14 @@ class _HomePageState extends State { const SizedBox( height: 55, ), - customTextField("Type here",Icons.search,false, myController,), + customTextField( + (isactive1) + ? "How are you feeling?" + : "What's your favourite song?", + Icons.search, + false, + myController, + ), const SizedBox( height: 20, ), @@ -157,8 +160,10 @@ class _HomePageState extends State { }); }, style: ButtonStyle( - backgroundColor: MaterialStateProperty.all(Colors.deepOrangeAccent), - shape: MaterialStateProperty.all( + backgroundColor: MaterialStateProperty.all( + Colors.deepOrangeAccent), + shape: + MaterialStateProperty.all( RoundedRectangleBorder( borderRadius: BorderRadius.circular(18.0), side: const BorderSide(color: Colors.black), @@ -168,9 +173,13 @@ class _HomePageState extends State { child: Row( mainAxisAlignment: MainAxisAlignment.center, children: const [ - Icon(Icons.search,color: Colors.white,), + Icon( + Icons.search, + color: Colors.white, + ), SizedBox(width: 8.0), - Text('Search', + Text( + 'Search', style: TextStyle( fontWeight: FontWeight.bold, color: Colors.white, @@ -185,18 +194,18 @@ class _HomePageState extends State { const SizedBox( height: 55, ), - const Text("Recommend By", + const Text( + "Recommend By", style: TextStyle( fontWeight: FontWeight.bold, fontSize: 24, fontFamily: 'Outfit', color: Colors.white, - ),), - + ), + ), const SizedBox( height: 22.5, ), - Padding( padding: const EdgeInsets.fromLTRB(10, 20, 10, 0), child: Row( @@ -213,8 +222,12 @@ class _HomePageState extends State { }); }, style: ButtonStyle( - backgroundColor: MaterialStateProperty.all(isactive1 ? Colors.deepOrangeAccent : Colors.white), - shape: MaterialStateProperty.all( + backgroundColor: MaterialStateProperty.all( + isactive1 + ? Colors.deepOrangeAccent + : Colors.white), + shape: MaterialStateProperty.all< + RoundedRectangleBorder>( RoundedRectangleBorder( borderRadius: BorderRadius.circular(18.0), side: const BorderSide(color: Colors.black), @@ -224,13 +237,19 @@ class _HomePageState extends State { child: Row( mainAxisAlignment: MainAxisAlignment.center, children: [ - Icon(Icons.emoji_emotions_rounded,color: isactive1 ? Colors.white : Colors.black,), + Icon( + Icons.emoji_emotions_rounded, + color: isactive1 ? Colors.white : Colors.black, + ), const SizedBox(width: 10.0), - Text('Emotions', + Text( + 'Emotions', style: TextStyle( fontWeight: FontWeight.bold, - color: isactive1 ? Colors.white : Colors.black, - ),), + color: + isactive1 ? Colors.white : Colors.black, + ), + ), ], ), ), @@ -245,8 +264,12 @@ class _HomePageState extends State { }); }, style: ButtonStyle( - backgroundColor: MaterialStateProperty.all(isactive2 ? Colors.deepOrangeAccent: Colors.white), - shape: MaterialStateProperty.all( + backgroundColor: MaterialStateProperty.all( + isactive2 + ? Colors.deepOrangeAccent + : Colors.white), + shape: MaterialStateProperty.all< + RoundedRectangleBorder>( RoundedRectangleBorder( borderRadius: BorderRadius.circular(18.0), side: const BorderSide(color: Colors.black), @@ -256,12 +279,17 @@ class _HomePageState extends State { child: Row( mainAxisAlignment: MainAxisAlignment.center, children: [ - Icon(Icons.music_note_sharp,color: isactive2 ? Colors.white : Colors.black,), + Icon( + Icons.music_note_sharp, + color: isactive2 ? Colors.white : Colors.black, + ), const SizedBox(width: 10.0), - Text('Music', + Text( + 'Music', style: TextStyle( fontWeight: FontWeight.bold, - color: isactive2 ? Colors.white : Colors.black, + color: + isactive2 ? Colors.white : Colors.black, ), ), ], diff --git a/lib/pages/SearchPage.dart b/lib/pages/SearchPage.dart index fb8309a..e275e03 100644 --- a/lib/pages/SearchPage.dart +++ b/lib/pages/SearchPage.dart @@ -81,7 +81,7 @@ class _SearchPageState extends State { controller: myController, style: TextStyle(color: Colors.black), decoration: const InputDecoration( - hintText: "What do yo want to listen to?", + hintText: "What do you want to listen to?", hintStyle: TextStyle(color: Colors.black), fillColor: Colors.white, filled: true,