Skip to content
Snippets Groups Projects
Commit 797a309c authored by Aayush's avatar Aayush
Browse files

Search Item

parent 53fb48d3
No related branches found
No related tags found
1 merge request!3Main product
...@@ -22,24 +22,13 @@ if (flutterVersionName == null) { ...@@ -22,24 +22,13 @@ if (flutterVersionName == null) {
} }
apply plugin: 'com.android.application' apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'com.google.gms.google-services' apply plugin: 'com.google.gms.google-services'
apply plugin: 'kotlin-android'
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle" apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
android { android {
compileSdkVersion 30 compileSdkVersion 30
compileOptions {
// sourceCompatibility JavaVersion.VERSION_1_8
// targetCompatibility JavaVersion.VERSION_1_8
main.java.srcDirs += 'src/main/kotlin'
}
// kotlinOptions {
// jvmTarget = '1.8'
// }
sourceSets { sourceSets {
main.java.srcDirs += 'src/main/kotlin' main.java.srcDirs += 'src/main/kotlin'
} }
...@@ -58,7 +47,6 @@ android { ...@@ -58,7 +47,6 @@ android {
release { release {
// TODO: Add your own signing config for the release build. // TODO: Add your own signing config for the release build.
// Signing with the debug keys for now, so `flutter run --release` works. // Signing with the debug keys for now, so `flutter run --release` works.
// signingConfig signingConfigs.debug
signingConfig signingConfigs.debug signingConfig signingConfigs.debug
} }
} }
...@@ -70,6 +58,6 @@ flutter { ...@@ -70,6 +58,6 @@ flutter {
dependencies { dependencies {
implementation platform('com.google.firebase:firebase-bom:29.1.0') implementation platform('com.google.firebase:firebase-bom:29.1.0')
implementation 'com.google.firebase:firebase-analytics'
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
implementation 'com.google.firebase:firebase-analytics'
} }
{ {
"project_info": { "project_info": {
"project_number": "375774083593", "project_number": "458093853085",
"project_id": "food-app-602fc", "project_id": "food-app-116b0",
"storage_bucket": "food-app-602fc.appspot.com" "storage_bucket": "food-app-116b0.appspot.com"
}, },
"client": [ "client": [
{ {
"client_info": { "client_info": {
"mobilesdk_app_id": "1:375774083593:android:2b8e6c1fd9ee6e6bc316d8", "mobilesdk_app_id": "1:458093853085:android:14bf3d2f5e89e6d0f89774",
"android_client_info": { "android_client_info": {
"package_name": "com.example.food_app" "package_name": "com.example.food_app"
} }
}, },
"oauth_client": [ "oauth_client": [
{ {
"client_id": "375774083593-rhd0pgkupictbitrh46du642741pdka8.apps.googleusercontent.com", "client_id": "458093853085-g6rmbug37s8665jmdpevskn3j0qq6qjj.apps.googleusercontent.com",
"client_type": 1,
"android_info": {
"package_name": "com.example.food_app",
"certificate_hash": "101a695034d46d74d9daca2ffc626bcaf8169de1"
}
},
{
"client_id": "458093853085-eta48qgdc1bibfj91to7gtle63c9kh64.apps.googleusercontent.com",
"client_type": 3 "client_type": 3
} }
], ],
"api_key": [ "api_key": [
{ {
"current_key": "AIzaSyBZqWpgE6uspEbr0tKuPdDXzZF5kp5PnaI" "current_key": "AIzaSyC6FXF2g0UgUXBcxGTpmLO4zumc3J_D-bc"
} }
], ],
"services": { "services": {
"appinvite_service": { "appinvite_service": {
"other_platform_oauth_client": [ "other_platform_oauth_client": [
{ {
"client_id": "375774083593-rhd0pgkupictbitrh46du642741pdka8.apps.googleusercontent.com", "client_id": "458093853085-eta48qgdc1bibfj91to7gtle63c9kh64.apps.googleusercontent.com",
"client_type": 3 "client_type": 3
} }
] ]
......
buildscript { buildscript {
ext.kotlin_version = '1.6.10' ext.kotlin_version = '1.6.10'
ext.plugin_version = '4.2.0'
repositories { repositories {
google() google()
mavenCentral() mavenCentral()
} }
dependencies { dependencies {
classpath "com.android.tools.build:gradle:$plugin_version"
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath 'com.google.gms:google-services:4.3.10' classpath 'com.google.gms:google-services:4.3.10'
classpath "com.android.tools.build:gradle:4.2.0"
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
} }
} }
......
...@@ -17,9 +17,8 @@ class MyApp extends StatelessWidget { ...@@ -17,9 +17,8 @@ class MyApp extends StatelessWidget {
Widget build(BuildContext context) { Widget build(BuildContext context) {
return MaterialApp( return MaterialApp(
theme: ThemeData( theme: ThemeData(
primaryColor: primaryColor, primaryColor: primaryColor,
scaffoldBackgroundColor: scaffoldBackgroundColor scaffoldBackgroundColor: scaffoldBackgroundColor),
),
debugShowCheckedModeBanner: false, debugShowCheckedModeBanner: false,
home: HomeScreen(), home: HomeScreen(),
); );
......
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:food_app/screens/home_screens/drawer_side.dart'; import 'package:food_app/screens/home_screens/drawer_side.dart';
import 'package:food_app/config/colors.dart'; import 'package:food_app/config/colors.dart';
import 'package:food_app/screens/home_screens/product_overview/product_overview.dart'; import 'package:food_app/screens/home_screens/product_overview/product_overview.dart';
import 'package:food_app/screens/home_screens/single_product.dart'; import 'package:food_app/screens/home_screens/single_product.dart';
import 'package:food_app/screens/search/search.dart';
class HomeScreen extends StatelessWidget { class HomeScreen extends StatelessWidget {
Widget _buildHerbsProduct(context) { Widget _buildHerbsProduct(context) {
...@@ -247,7 +249,16 @@ class HomeScreen extends StatelessWidget { ...@@ -247,7 +249,16 @@ class HomeScreen extends StatelessWidget {
CircleAvatar( CircleAvatar(
radius: 12, radius: 12,
backgroundColor: primaryColor, backgroundColor: primaryColor,
child: Icon(Icons.search, size: 17, color: textColor), child: IconButton(
onPressed: () {
Navigator.of(context).push(
MaterialPageRoute(
builder: (context) => Search(),
),
);
},
icon: Icon(Icons.search, size: 17, color: textColor),
),
), ),
Padding( Padding(
padding: const EdgeInsets.symmetric(horizontal: 5), padding: const EdgeInsets.symmetric(horizontal: 5),
......
import 'package:flutter/material.dart';
import 'package:food_app/screens/search/search_item.dart';
class Search extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text("Search"),
actions: [
Padding(
padding: const EdgeInsets.all(8.0),
child: Icon(Icons.menu_rounded),
),
],
),
body: ListView(
children: [
ListTile(
title: Text("Items"),
),
Container(
height: 52,
margin: EdgeInsets.symmetric(horizontal: 20),
child: TextField(
decoration: InputDecoration(
border: OutlineInputBorder(
borderRadius: BorderRadius.circular(30),
borderSide: BorderSide.none,
),
fillColor: Color(0xffc2c2c2),
filled: true,
hintText: "Search Items in the store",
suffixIcon: Icon(Icons.search),
),
),
),
SizedBox(
height: 10,
),
SearchItem(),
SearchItem(),
SearchItem(),
SearchItem(),
SearchItem(),
],
),
);
}
}
import 'package:flutter/material.dart';
import 'package:food_app/config/colors.dart';
class SearchItem extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Padding(
padding: const EdgeInsets.symmetric(horizontal: 10),
child: Row(
children: [
Expanded(
child: Container(
height: 100,
child: Center(
child: Image.network(
"https://www.pngitem.com/pimgs/m/490-4903879_fresh-basil-leaf-png-transparent-png.png"),
),
),
),
Expanded(
child: Container(
height: 100,
child: Column(
mainAxisAlignment: MainAxisAlignment.spaceAround,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Column(
children: [
Text(
"productName",
style: TextStyle(
color: textColor, fontWeight: FontWeight.bold),
),
Text(
"50\$/50 Gram",
style: TextStyle(
color: Colors.grey,
),
),
],
),
Container(
margin: EdgeInsets.only(right: 15),
padding: EdgeInsets.symmetric(horizontal: 10),
height: 35,
decoration: BoxDecoration(
border: Border.all(color: Colors.grey),
borderRadius: BorderRadius.circular(30),
),
child: Row(
children: [
Expanded(
child: Text(
"50 Gram",
style: TextStyle(
color: Colors.grey,
fontSize: 12,
),
),
),
Center(
child: Icon(
Icons.arrow_drop_down,
size: 20,
color: primaryColor,
),
)
],
),
)
],
),
),
),
Expanded(
child: Container(
height: 100,
child: Container(
height: 100,
padding: EdgeInsets.symmetric(horizontal: 15, vertical: 32),
child: Container(
height: 25,
width: 50,
decoration: BoxDecoration(
border: Border.all(color: Colors.grey),
borderRadius: BorderRadius.circular(30),
),
child: Center(
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Icon(
Icons.add,
color: primaryColor,
size: 20,
),
Text(
"ADD",
style: TextStyle(
color: primaryColor,
),
),
],
),
),
),
),
),
),
],
),
);
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment