Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added finalresult/Screenshot_1661707723.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added finalresult/Screenshot_1661708147.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added finalresult/Screenshot_1661708159.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added finalresult/Screenshot_1661708170.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
49 changes: 49 additions & 0 deletions lib/add_page/add_button.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
import 'package:book_store_app/model.dart';
import 'package:flutter/material.dart';
class AddButton extends StatelessWidget {
const AddButton({
Key? key, required this.bookName,
required this.autherName,
required this.price,
required this.image,
required this.description,
}) : super(key: key);
final TextEditingController bookName ;
final TextEditingController autherName ;
final TextEditingController price ;
final TextEditingController image ;
final TextEditingController description ;
@override
Widget build(BuildContext context) {
return Container(
width: 305,
height: 60,
margin: const EdgeInsets.only(left: 45.0,bottom: 45.0),
decoration: BoxDecoration(
color: Colors.black,
borderRadius: BorderRadius.circular(16.0),
),
child: TextButton(onPressed: () {
Books book = Books(
bookName: bookName.text,
auther: autherName.text,
price: price.text,
description: description.text,
image: image.text);
Books.book.add(book);
bookName.text='';
autherName.text='';
price.text='';
description.text='';
image.text='';
},
child: const Text('ADD',
style: TextStyle(
fontWeight: FontWeight.w500,
fontSize: 16,
color: Colors.white
),)
)
);
}
}
51 changes: 51 additions & 0 deletions lib/add_page/add_field.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
import 'package:flutter/material.dart';

class AddFields extends StatefulWidget {
const AddFields({
Key? key, required this.fieldName, required this.maxLines, required this.myCont,
}) : super(key: key);
final String fieldName;
final int maxLines;
final TextEditingController myCont;

@override
State<AddFields> createState() => _AddFieldsState();
}

class _AddFieldsState extends State<AddFields> {
@override
Widget build(BuildContext context) {
return Padding(
padding: const EdgeInsets.only(left: 45.0,bottom: 22.0,right: 45.0,),
child: TextField(
controller: widget.myCont,
onSubmitted: (x){
widget.myCont.text=x;
},
maxLines: widget.maxLines,
textAlign: TextAlign.start,
cursorColor: Colors.black,
decoration: InputDecoration(
fillColor: Colors.white,
filled: true,
hintText: widget.fieldName,
border: OutlineInputBorder(
borderSide:const BorderSide(
// width: 317,
color: Colors.white,
style: BorderStyle.none
),
borderRadius: BorderRadius.circular(20.0)
),
enabledBorder: OutlineInputBorder(
borderSide:const BorderSide(
color: Colors.white,
style: BorderStyle.none
),
borderRadius: BorderRadius.circular(20.0)
),
),
),
);
}
}
62 changes: 62 additions & 0 deletions lib/add_page/add_page.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
import 'package:flutter/material.dart';
import '../first_raw.dart';
import 'add_button.dart';
import 'add_field.dart';


class AddBooks extends StatefulWidget {
const AddBooks({Key? key}) : super(key: key);

@override
State<AddBooks> createState() => _AddBooksState();
}

class _AddBooksState extends State<AddBooks> {
static TextEditingController bookName =TextEditingController();
static TextEditingController autherName =TextEditingController();
static TextEditingController price =TextEditingController();
static TextEditingController image =TextEditingController();
static TextEditingController description =TextEditingController();
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
toolbarHeight: 0,
elevation: 0,
backgroundColor: const Color(0xffE5E5E5),
),
backgroundColor: const Color(0xffE5E5E5),
body:Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
const Padding(
padding: EdgeInsets.only(top: 15.0),
child: FirstRaw(),
),
const Padding(
padding: EdgeInsets.only(left: 25.0,top: 18.0,bottom: 59.0),
child: Text('Add Book',style: TextStyle(
color: Colors.black,
fontFamily:'Poppins',
fontSize: 24,
fontWeight: FontWeight.bold,
),),
),
Expanded(
child: ListView(
children:[
AddFields(fieldName: 'Book Name', maxLines: 1, myCont: bookName),
AddFields(fieldName: 'Auther Name', maxLines: 1, myCont: autherName),
AddFields(fieldName: 'Price', maxLines: 1, myCont: price),
AddFields(fieldName: 'Image Link', maxLines: 1, myCont: image),
AddFields(fieldName: 'Description', maxLines: 5, myCont: description),

]),),

AddButton(bookName: bookName, autherName: autherName,
price: price, image: image, description: description),
]),

);
}
}
45 changes: 45 additions & 0 deletions lib/cart_page/cart_page.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
import 'package:book_store_app/main_page/my_books.dart';
import 'package:book_store_app/my_floating_buttons.dart';
import 'package:flutter/material.dart';

import '../first_raw.dart';
import '../model.dart';

class CartsPage extends StatelessWidget {
const CartsPage({Key? key}) : super(key: key);

@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
toolbarHeight: 0,
elevation: 0,
backgroundColor: const Color(0xffE5E5E5),
),
backgroundColor: const Color(0xffE5E5E5),
body: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
const FirstRaw(),
const Padding(
padding: EdgeInsets.only(left: 25.0,top: 18.0),
child: Text('Cart',style: TextStyle(
color: Colors.black,
fontFamily:'Poppins',
fontSize: 24,
fontWeight: FontWeight.bold,
),),
),
Expanded(
child: ListView(
children:
Books.book.where((a) => a.isSelect.value).map((e) => MyBooks(book: e)).toList()
),
)
],
),
floatingActionButton: const MyFloatingActionButtons(),
floatingActionButtonLocation: FloatingActionButtonLocation.centerFloat,
);
}
}
26 changes: 26 additions & 0 deletions lib/details_page/details_page.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
import 'package:book_store_app/details_page/view_book.dart';
import 'package:book_store_app/first_raw.dart';
import 'package:book_store_app/model.dart';
import 'package:flutter/material.dart';

class BookDetails extends StatelessWidget {
const BookDetails({Key? key, required this.book}) : super(key: key);
final Books book;
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
toolbarHeight: 0,
elevation: 0,
backgroundColor: const Color(0xffE5E5E5),
),
backgroundColor: const Color(0xffE5E5E5),
body: Column(
children: [
const FirstRaw(),
BookView(book: book,)
]
)
);
}
}
19 changes: 19 additions & 0 deletions lib/details_page/rate_buttons.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@

import 'package:flutter/cupertino.dart';

class Rate extends StatelessWidget {
const Rate({
Key? key, required this.date, required this.color,
}) : super(key: key);
final String date;
final Color color;
@override
Widget build(BuildContext context) {
return Text(date,style: TextStyle(
color:color,
fontFamily:'Poppins',
fontSize: 14,
fontWeight: FontWeight.w500,
),);
}
}
33 changes: 33 additions & 0 deletions lib/details_page/review_preview_button.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
import 'package:flutter/material.dart';

class Buttons extends StatelessWidget {
const Buttons({
Key? key, required this.icon, required this.text,
}) : super(key: key);
final IconData icon;
final String text;

@override
Widget build(BuildContext context) {
return SizedBox(
width: 154,
child: MaterialButton(onPressed: (){},
height: 40,
color: Colors.white,
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceAround,
children: [
Icon(icon,color: Colors.black,),
Text(text,
style: const TextStyle(
color: Colors.black,
fontFamily:'Poppins',
fontSize: 14,
fontWeight: FontWeight.w500,
),),
],
),
),
);
}
}
103 changes: 103 additions & 0 deletions lib/details_page/view_book.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
import 'package:book_store_app/model.dart';
import 'package:flutter/material.dart';
import '../my_stars.dart';
import 'rate_buttons.dart';
import 'review_preview_button.dart';

class BookView extends StatelessWidget {
const BookView({
Key? key, required this.book,
}) : super(key: key);
final Books book;

@override
Widget build(BuildContext context) {
return Expanded(
child: ListView(
children: [
Column(
children: [
Container(
margin: const EdgeInsets.only(top: 17,bottom: 12),
width: 216,
height: 320,
child:Image(image: NetworkImage(book.image),
fit: BoxFit.cover,)
),

Text(book.bookName,
style: const TextStyle(
color: Colors.black,
fontFamily:'Poppins',
fontSize: 24,
fontWeight: FontWeight.w600,
),),
Padding(
padding: const EdgeInsets.all(12.0),
child: Text(book.auther,
style:const TextStyle(
color: Colors.black45,
fontFamily:'Poppins',
fontSize: 14,
fontWeight: FontWeight.w500,
),),
),
Padding(
padding: const EdgeInsets.only(bottom: 15.0),
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: const [
MyStars(),
Rate(date: '4.0',color: Colors.black,),
Rate(date: '/', color: Colors.grey),
Rate(date: '5.0', color: Colors.grey)
],
),
),
SizedBox(
width: 319,
child: Text(book.description,
style: const TextStyle(
color: Colors.black,
fontFamily:'Poppins',
fontSize: 14,
fontWeight: FontWeight.w400,
),),
),
Padding(
padding: const EdgeInsets.only(left: 35.0,right: 35.0,bottom: 26.0),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: const [
Buttons(text: 'Preview', icon: Icons.menu,),
Buttons(text: 'Reviews', icon: Icons.reviews,),
],
),
),
Container(
width: 319,
height: 60,
decoration: BoxDecoration(
color: Colors.black,
borderRadius: BorderRadius.circular(16.0)
),
child: TextButton(
onPressed: (){
book.makeAsSelect();
},
child: Text(r'Buy Now for $ '+book.price,
style: const TextStyle(
color: Colors.white,
fontFamily:'Poppins',
fontSize: 20,
fontWeight: FontWeight.w500,
),),
),
),
],
),
],
),
);
}
}
Loading