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 assets/Rectangle14.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 assets/Vector.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 assets/Vector1.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 assets/Vector2.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 assets/Vector3.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 assets/Vector4.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 assets/download.jpg
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 assets/image16.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 assets/image17.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 assets/images1.jpg
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 assets/images2.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
147 changes: 147 additions & 0 deletions lib/add_book.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,147 @@

import 'package:flutter/material.dart';
// ignore: depend_on_referenced_packages
import 'package:get/get.dart';

import 'modle.dart';

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

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

class _AddBookState extends State<AddBook> {
@override
Widget build(BuildContext context) {
return Scaffold(
body: Padding(
padding: const EdgeInsets.only(right: 20, left: 20, top: 20),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
TextButton(
onPressed: () {
Navigator.pop(context);
},
child:
Icon(Icons.arrow_back_ios, size: 15, color: Colors.black),
),
Icon(Icons.more_vert, color: Colors.black),
],
),
const SizedBox(
height: 15,
),
const Text(
'Add Book ',
style: TextStyle(fontSize: 25, fontWeight: FontWeight.bold),
),
const SizedBox(
height: 45,
),
TextField(
controller: Field.myController1,
textInputAction: TextInputAction.next,
decoration: InputDecoration(
filled: true,
fillColor: Colors.white,
hintText: 'Book Name',
enabledBorder: OutlineInputBorder(
borderRadius: BorderRadius.circular(15),
borderSide: BorderSide.none,
)),
),
const SizedBox(
height: 15,
),
TextField(
controller: Field.myController2,
textInputAction: TextInputAction.next,
decoration: InputDecoration(
filled: true,
fillColor: Colors.white,
hintText: 'Author Name',
enabledBorder: OutlineInputBorder(
borderRadius: BorderRadius.circular(15),
borderSide: BorderSide.none,
)),
),
const SizedBox(
height: 15,
),
TextField(
controller: Field.myController3,
textInputAction: TextInputAction.next,
decoration: InputDecoration(
filled: true,
fillColor: Colors.white,
hintText: 'Price',
enabledBorder: OutlineInputBorder(
borderRadius: BorderRadius.circular(15),
borderSide: BorderSide.none,
)),
),
const SizedBox(
height: 15,
),
TextField(
controller: Field.myController4,
textInputAction: TextInputAction.next,
decoration: InputDecoration(
filled: true,
fillColor: Colors.white,
hintText: 'Image link',
enabledBorder: OutlineInputBorder(
borderRadius: BorderRadius.circular(15),
borderSide: BorderSide.none,
)),
),
const SizedBox(
height: 15,
),
TextField(
controller: Field.myController5,
textInputAction: TextInputAction.send,
style: const TextStyle(
fontSize: 25.0, height: 0, color: Colors.black),
decoration: InputDecoration(
contentPadding: EdgeInsets.all(50),
filled: true,
fillColor: Colors.white,
hintText: 'Description',
enabledBorder: OutlineInputBorder(
borderRadius: BorderRadius.circular(15),
borderSide: BorderSide.none,
)),
),
const SizedBox(
height: 15,
),
TextButton(
onPressed: () {
Field.new_books();
},
child: Container(
width: 300,
height: 50,
alignment: Alignment.center,
decoration: BoxDecoration(
color: Colors.black,
borderRadius: BorderRadius.circular(15)),
child: const Text(
' Add',
style: TextStyle(color: Colors.white),
textAlign: TextAlign.center,
)),
),
],
),
),
);
}
}
55 changes: 55 additions & 0 deletions lib/card.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@


import 'package:book_store_app/modle.dart';
import 'package:flutter/material.dart';

import 'mybook.dart';

class MyCart extends StatelessWidget {
const MyCart({Key? key}) : super(key: key);
@override
Widget build(BuildContext context) {
return Scaffold(


body: Column(
children: [
Row(mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Padding(
padding: const EdgeInsets.only(left: 10),
child: TextButton(
onPressed: () {
Navigator.pop(context);
},
child: const Icon(Icons.arrow_back_ios_new,size: 15, color: Colors.black)),
),
const Padding(
padding: EdgeInsets.all(10),
child: Icon(Icons.more_vert,size: 15, color: Colors.black),)
],
),

Center(
child: Padding(
padding: const EdgeInsets.all(35),
child: Stack(children: [
Column(crossAxisAlignment: CrossAxisAlignment.start, children: [
const Text('Cart',
style: TextStyle(fontSize: 24, fontWeight: FontWeight.w600)),

SizedBox(height: 40),
Column(
children: data_book.datas
.where((e) => !e.isDone.value)
.map((e) => mybook(item: e, context: context))
.toList(),
),
]),
]),
)),
],
),
);
}
}
33 changes: 28 additions & 5 deletions lib/main.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@

import 'package:flutter/material.dart';

import 'add_book.dart';
import 'main.dart';
import 'page_1.dart';

void main() {
runApp(const MyApp());
}
Expand All @@ -9,12 +14,30 @@ class MyApp extends StatelessWidget {

@override
Widget build(BuildContext context) {
return const MaterialApp(
home: Scaffold(
body: Center(
child: Text("Book Store App"),
),
return MaterialApp(
title: 'Flutter Demo',
debugShowCheckedModeBanner: false,
theme: ThemeData(
primarySwatch: Colors.blue,
//backgroundColor: Color(0xffE5E5E5),
),
home: const MyHomePage(),
);
}
}

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




Widget build(BuildContext context) {
return const Scaffold(
body:Page_1() ,
);
}
}

80 changes: 80 additions & 0 deletions lib/modle.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
import 'dart:ffi';

import 'package:flutter/material.dart';
import 'package:get/get.dart';

class data_book {
final String image;
final String title;
final String decration;
final String price;
final IconData icon;
final RxBool isDone = false.obs;
data_book(
this.image,
this.title,
this.decration,
this.price,
this.icon,
);

static RxList<data_book> datas = <data_book>[
data_book(
'https://dl.airtable.com/.attachments/b82bca4b5496e87ae2037da38a507265/1afe35bf/cover.jpg?ts=1661017804&userId=usrCBA8uInu6jO3n2&cs=ea7f6e9447680e9e',
'Yves Saint Laurent',
'hfjdj ',
'\$99.99',
Icons.star),
data_book('https://images.randomhouse.com/cover/9780440000624',
'Yves Saint Laurent', 'SMenkesuzy ', '\$99.99', Icons.star),
data_book('https://images.randomhouse.com/cover/9780756416058',
'Yves Saint Laurent', 'SMenkesuzy ', '\$99.99', Icons.star),
data_book('https://images.randomhouse.com/cover/9781984805638',
'Yves Saint Laurent', 'SMenkesuzy ', '\$99.99', Icons.star)
].obs;
markAsDone(){
isDone.value = true;
}

}


class add_book {
final String title;
final String Author_Name;
final String Price;
final String image;
final String dec;
add_book(
{required this.title,
// ignore: non_constant_identifier_names
required this.Author_Name,
required this.Price,
required this.image,
required this.dec});

static RxList<add_book> notes = <add_book>[].obs;
static RxString queue = ''.obs;
}

class Field {
static TextEditingController myController1 = TextEditingController();
static TextEditingController myController2 = TextEditingController();
static TextEditingController myController3 = TextEditingController();
static TextEditingController myController4 = TextEditingController();
static TextEditingController myController5 = TextEditingController();

static void new_books(){
add_book.notes.add(add_book(
title: Field.myController1.text,
Author_Name: Field.myController2.text,
Price: Field.myController3.text,
image: Field.myController4.text,
dec: Field.myController5.text));
Field.myController1.clear();
Field.myController2.clear();
Field.myController3.clear();
Field.myController5.clear();
Field.myController4.clear();
}
}
Loading