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/image.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 images/img.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 images/img_1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
31 changes: 31 additions & 0 deletions lib/PageOne/card_one.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@

import 'package:flutter/material.dart';

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

@override
Widget build(BuildContext context) {
return Row(
children: [
Container(
width: 40,height: 40,
margin: EdgeInsets.only(right: 12),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(10),
),
child: Image.asset('images/img.png'),
),
Text('Hi,Ali!',style: TextStyle(
fontSize: 14,
color: Color.fromRGBO(6, 7, 13, 1),
fontWeight: FontWeight.bold
),),
Spacer(),
Icon(Icons.more_vert)
],
);
}
}
57 changes: 57 additions & 0 deletions lib/PageOne/my_end_card.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@

import 'package:book_store_app/PageOne/my_list_view.dart';
import 'package:book_store_app/PageOne/title_of_book.dart';
import 'package:book_store_app/PageThree/page_three_main.dart';
import 'package:flutter/material.dart';
import 'package:get/get.dart';

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

@override
Widget build(BuildContext context) {
return Container(
width: 220,height: 72,
margin: EdgeInsets.only(top: 410,bottom: 38,left: 65),
padding: EdgeInsets.symmetric(horizontal: 25,vertical: 10),
decoration: BoxDecoration(
boxShadow: const[
BoxShadow(
color: Colors.white,
spreadRadius: 40,
blurRadius: 50,
offset: Offset(0, 60), // changes position of shadow
),
],
borderRadius: BorderRadius.circular(20),
color: Color.fromRGBO(255, 255, 255, 1),
),
child: Obx(() {
return Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
IconButton(onPressed: (){
Title0fBook(name: 'Book List',);
MyListView.controller.animateToPage(0, duration: Duration(milliseconds: 500), curve: Curves.linear);
}, icon: Icon(Icons.home_outlined,color: MyListView.currentPage == 0 ? Colors.blue : Colors.grey),),


IconButton(onPressed: (){
Title0fBook(name: 'Card',);
MyListView.controller.animateToPage(1, duration: Duration(milliseconds: 500), curve: Curves.linear);
}, icon: Icon(Icons.shopping_cart_outlined,color: MyListView.currentPage == 1 ? Colors.blue : Colors.grey),),
IconButton(onPressed: (){
Navigator.push(
context,
MaterialPageRoute(builder: (context) => const PageThree()),
);
}, icon: Icon(Icons.add,color: Colors.grey,),),
],
);
}
),
);
}
}
178 changes: 178 additions & 0 deletions lib/PageOne/my_list_view.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,178 @@

import 'package:book_store_app/PageTwo/page_two_main.dart';
import 'package:book_store_app/model.dart';
import 'package:flutter/material.dart';
import 'package:get/get.dart';

class MyListView extends StatelessWidget {
const MyListView({
Key? key,
}) : super(key: key);
static PageController controller = PageController();
static RxInt currentPage = 0.obs;
@override
Widget build(BuildContext context) {
return Obx(() {
return PageView(
controller: controller,
onPageChanged: (x){
currentPage.value = x;
},
children: [
AnimatedSwitcher(duration: Duration(seconds: 2),
child: Book.books.isNotEmpty ? ListView(
controller: ScrollController(),
children: Book.books.where((e) => e.nameBook.contains(Book.Q)).map((e) =>
TextButton(
onPressed: (){
Navigator.push(
context,
MaterialPageRoute(builder: (context) => PageTwo(mybook: e,)),
);
},
child: Container(
margin: const EdgeInsets.only(top: 10,bottom: 30),
padding: const EdgeInsets.all(10),
child: Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Container(
width: 100,height: 150,
margin: const EdgeInsets.only(right: 28),
decoration: BoxDecoration(
borderRadius: const BorderRadius.only(
topRight: Radius.circular(10),
bottomRight: Radius.circular(10
)),
image: DecorationImage(
image: NetworkImage('${e.imageNetwork}',),
fit: BoxFit.fill,
),
),
),
Padding(
padding: const EdgeInsets.only(top: 20),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text('${e.nameBook}',style:const TextStyle(
fontSize: 16,
fontWeight: FontWeight.bold,
color: Colors.black
),),
Text('${e.nameAuther}',style: const TextStyle(
fontSize: 12,
color: Color.fromRGBO(6, 7, 13, 0.5)
),),
Text('\$${e.price}',style: const TextStyle(
fontSize: 14,
fontWeight: FontWeight.bold,
color: Color.fromRGBO(6, 7, 13, 1)
),),
Row(
children: const[
Icon(Icons.star,color: Colors.orange,size: 16,),
Icon(Icons.star,color: Colors.orange,size: 16,),
Icon(Icons.star,color: Colors.orange,size: 16,),
Icon(Icons.star,color: Colors.orange,size: 16,),
Icon(Icons.star_border_sharp,color: Colors.orange,size: 16,),

],
)
],
),
)
],
),
),
),
).toList(),
): Column(
mainAxisAlignment: MainAxisAlignment.center,
children: const[
Icon(Icons.menu_book,size: 100,color: Colors.grey,),
Text('Add the Books',style: TextStyle(
color: Colors.grey,
fontSize: 25,
),)
],
),
),


ListView(
controller: ScrollController(),
children: Book.books.where((e) => e.isDone.value).map((e) =>
TextButton(
onPressed: (){
Navigator.push(
context,
MaterialPageRoute(builder: (context) => PageTwo(mybook: e,)),
);
},
child: Container(
margin: const EdgeInsets.only(top: 10,bottom: 30),
padding: const EdgeInsets.all(10),
child: Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Container(
width: 100,height: 150,
margin: const EdgeInsets.only(right: 28),
decoration: BoxDecoration(
borderRadius: const BorderRadius.only(
topRight: Radius.circular(10),
bottomRight: Radius.circular(10
)),
image: DecorationImage(
image: NetworkImage('${e.imageNetwork}',),
fit: BoxFit.fill,
),
),
),
Padding(
padding: const EdgeInsets.only(top: 20),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text('${e.nameBook}',style:const TextStyle(
fontSize: 16,
fontWeight: FontWeight.bold,
color: Colors.black
),),
Text('${e.nameAuther}',style: const TextStyle(
fontSize: 12,
color: Color.fromRGBO(6, 7, 13, 0.5)
),),
Text('\$${e.price}',style: const TextStyle(
fontSize: 14,
fontWeight: FontWeight.bold,
color: Color.fromRGBO(6, 7, 13, 1)
),),
Row(
children: const[
Icon(Icons.star,color: Colors.orange,size: 16,),
Icon(Icons.star,color: Colors.orange,size: 16,),
Icon(Icons.star,color: Colors.orange,size: 16,),
Icon(Icons.star,color: Colors.orange,size: 16,),
Icon(Icons.star_border_sharp,color: Colors.orange,size: 16,),

],
)
],
),
)
],
),
),
),
).toList(),

),

],
);
}
);
}
}
23 changes: 23 additions & 0 deletions lib/PageOne/my_stack.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@

import 'package:book_store_app/PageOne/my_end_card.dart';
import 'package:book_store_app/PageOne/my_list_view.dart';
import 'package:flutter/material.dart';

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

@override
Widget build(BuildContext context) {
return Expanded(
child: Stack(
children: const[
MyListView(),
MyEndCard(),
],
)

);
}
}
59 changes: 59 additions & 0 deletions lib/PageOne/page_one_main.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@

import 'package:book_store_app/PageOne/card_one.dart';
import 'package:book_store_app/PageOne/my_end_card.dart';
import 'package:book_store_app/PageOne/my_list_view.dart';
import 'package:book_store_app/PageOne/my_stack.dart';
import 'package:book_store_app/PageOne/text_field.dart';
import 'package:book_store_app/PageOne/title_of_book.dart';
import 'package:book_store_app/model.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';

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

@override
Widget build(BuildContext context) {
return MaterialApp(
home: Scaffold(
backgroundColor: const Color.fromRGBO(235, 235, 235, 1),
appBar: AppBar(
systemOverlayStyle: const SystemUiOverlayStyle(
statusBarColor: Colors.transparent,
statusBarIconBrightness: Brightness.dark
),
backgroundColor: const Color.fromRGBO(235, 235, 235, 1),
elevation: 0,
),
////////////////////////////////
////////////////////////////////
body: Padding(
padding: const EdgeInsets.symmetric(horizontal: 28),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children:const [
CardOne(),
SearchTextField(),
Title0fBook(name: '',),
MyStack(),
],
),
),

),
);
}
}











Loading