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 images/one.jfif
Binary file not shown.
9 changes: 3 additions & 6 deletions lib/main.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import 'package:flutter/material.dart';

import 'package:book_store_app/modules/home/homeScreen.dart';
import 'package:flutter/material.dart';
void main() {
runApp(const MyApp());
}
Expand All @@ -10,11 +11,7 @@ class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return const MaterialApp(
home: Scaffold(
body: Center(
child: Text("Book Store App"),
),
),
home: HomeScreen(),
);
}
}
26 changes: 26 additions & 0 deletions lib/model/model.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
import 'package:get/get.dart';
class Book {
final String name;
final String Author_name;
final String price;
final String link;
final String Descrip;
Book(this.name, this.Author_name, this.price, this.link, this.Descrip);
static RxList<Book> one = <Book>[].obs;
add() {
one.add(this);
}
}

class BookUser {
final String name;
final String Author_name;
final String price;
final String link;
final String Descrip;
BookUser(this.name, this.Author_name, this.price, this.link, this.Descrip);
static List<BookUser> two = [];
add() {
two.add(this);
}
}
124 changes: 124 additions & 0 deletions lib/modules/aboute/abouteScreen.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,124 @@
import 'package:book_store_app/modules/add/addbook.dart';
import 'package:book_store_app/modules/cart/cart.dart';
import 'package:book_store_app/shared/components/components.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter/src/foundation/key.dart';
import 'package:flutter/src/widgets/framework.dart';
import 'package:book_store_app/modules/home/homeScreen.dart';
import 'package:book_store_app/model/model.dart';

class AboutBook extends StatelessWidget {
const AboutBook({Key? key, required int this.x}) : super(key: key);
final int x;
@override
Widget build(BuildContext context) {
return Scaffold(
backgroundColor: Color.fromARGB(255, 236, 229, 229),
appBar: AppBar(
backgroundColor: Color.fromARGB(255, 236, 229, 229),
titleSpacing: 20,
elevation: 0,
title: Row(
children: [
GestureDetector(
onTap: () {
Navigator.pushReplacement(context,
MaterialPageRoute(builder: (context) {
return HomeScreen();
}));
},
child: Icon(
Icons.arrow_back_ios,
color: Colors.black,
),
)
],
),
actions: [
Icon(
Icons.more_vert,
color: Colors.black,
)
],
),
body: Container(
padding: EdgeInsets.all(20),
width: double.infinity,
child: Column(crossAxisAlignment: CrossAxisAlignment.center, children: [
Image.network(
"${Book.one[x].link}",
width: 300,
height: 300,
),
SizedBox(
height: 20,
),
Text(
Book.one[x].name,
style: TextStyle(
color: Colors.black, fontSize: 25, fontWeight: FontWeight.bold),
),
SizedBox(
height: 10,
),
Text(Book.one[x].Author_name,
style: TextStyle(
color: Color.fromRGBO(104, 104, 104, 1),
fontSize: 15,
)),
SizedBox(
height: 10,
),
Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
buildthestar(),
SizedBox(
width: 10,
),
],
),
Container(
height: 100,
padding: EdgeInsets.all(10),
child: Row(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Expanded(
child: SingleChildScrollView(
child: Text(
Book.one[x].Descrip,
maxLines: 100,
),
))
]),
),
Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
buildnormal(ic: Icons.list),
SizedBox(
width: 10,
),
buildnormal(ic: Icons.chat, text: "Reviews"),
],
),
SizedBox(height: 30,),
buildbotton(
text: "Buy Now for \$ ${Book.one[x].price}",
onPressed: () {
BookUser(Book.one[x].name, Book.one[x].Author_name,
Book.one[x].price, Book.one[x].link, Book.one[x].Descrip).add();
Navigator.pushReplacement(context,
MaterialPageRoute(builder: (context) {
screen = 2 ;
return MyCart();
}));
})
]),
),
);
}
}
184 changes: 184 additions & 0 deletions lib/modules/add/addbook.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,184 @@
import 'dart:io';

import 'package:book_store_app/modules/home/homeScreen.dart';
import 'package:flutter/material.dart';
import 'package:flutter/src/foundation/key.dart';
import 'package:flutter/src/widgets/framework.dart';
import 'package:book_store_app/shared/components/components.dart';
import "package:book_store_app/model/model.dart";

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

@override
State<AddBook> createState() => _AddBookState();
}

class _AddBookState extends State<AddBook> {
@override
var nameBook = TextEditingController();
var nameAuthor = TextEditingController();
var price = TextEditingController();
var image = TextEditingController();
var description = TextEditingController();
Widget build(BuildContext context) {
return Scaffold(
backgroundColor: Color.fromARGB(255, 236, 229, 229),
appBar: AppBar(
backgroundColor: Color.fromARGB(255, 236, 229, 229),
titleSpacing: 20,
elevation: 0,
title: Row(
children: [
GestureDetector(
onTap: () {
Navigator.pushReplacement(context,
MaterialPageRoute(builder: (context) {
return HomeScreen();
}));
},
child: Icon(
Icons.arrow_back_ios,
color: Colors.black,
),
)
],
),
actions: [
Icon(
Icons.more_vert,
color: Colors.black,
)
],
),
body: Container(
padding: EdgeInsets.all(20),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
"Add Book",
style: TextStyle(
color: Colors.black,
fontSize: 30,
fontWeight: FontWeight.bold),
),
SizedBox(
height: 30,
),
//Form for the information
Expanded(
child: SingleChildScrollView(
child: Container(
margin: EdgeInsets.all(20),
padding: EdgeInsets.all(10),
child: Column(
children: [
// name book
Container(
padding: EdgeInsets.only(
left: 20, top: 5, right: 5, bottom: 5),
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(10)),
child: TextFormField(
controller: nameBook,
decoration: InputDecoration(
hintText: "Book Name ",
border: InputBorder.none,
),
),
),
SizedBox(
height: 20,
),
// Author name
Container(
padding: EdgeInsets.only(
left: 20, top: 5, right: 5, bottom: 5),
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(10)),
child: TextFormField(
controller: nameAuthor,
decoration: InputDecoration(
hintText: "Author Name ",
border: InputBorder.none,
),
),
),
SizedBox(
height: 20,
),
//price
Container(
padding: EdgeInsets.only(
left: 20, top: 5, right: 5, bottom: 5),
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(10)),
child: TextFormField(
controller: price,
decoration: InputDecoration(
hintText: "Price ",
border: InputBorder.none,
),
),
),
SizedBox(
height: 20,
),
//Image link
Container(
padding: EdgeInsets.only(
left: 20, top: 5, right: 5, bottom: 5),
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(10)),
child: TextFormField(
controller: image,
decoration: InputDecoration(
hintText: "Image Link ",
border: InputBorder.none,
),
),
),
SizedBox(
height: 20,
),
//Description
Container(
padding: EdgeInsets.only(
left: 20, top: 5, right: 5, bottom: 5),
height: 200,
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(10)),
child: TextFormField(
controller: description,
decoration: InputDecoration(
hintText: "Description ",
border: InputBorder.none,
),
),
),
buildbotton(onPressed: () {
Book(nameBook.text, nameAuthor.text, price.text,
image.text, description.text)
.add();
Navigator.pushReplacement(context,
MaterialPageRoute(builder: (context) {
screen = 1 ;
return HomeScreen();
}));
}),
],
),
),
))
],
),
),
);
}
}
Loading