diff --git a/images/image.jpg b/images/image.jpg new file mode 100644 index 0000000..1b6d5f8 Binary files /dev/null and b/images/image.jpg differ diff --git a/images/img.png b/images/img.png new file mode 100644 index 0000000..8f79b84 Binary files /dev/null and b/images/img.png differ diff --git a/images/img_1.png b/images/img_1.png new file mode 100644 index 0000000..6d9683f Binary files /dev/null and b/images/img_1.png differ diff --git a/lib/PageOne/card_one.dart b/lib/PageOne/card_one.dart new file mode 100644 index 0000000..66769d9 --- /dev/null +++ b/lib/PageOne/card_one.dart @@ -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) + ], + ); + } +} \ No newline at end of file diff --git a/lib/PageOne/my_end_card.dart b/lib/PageOne/my_end_card.dart new file mode 100644 index 0000000..0db3980 --- /dev/null +++ b/lib/PageOne/my_end_card.dart @@ -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,),), + ], + ); + } + ), + ); + } +} \ No newline at end of file diff --git a/lib/PageOne/my_list_view.dart b/lib/PageOne/my_list_view.dart new file mode 100644 index 0000000..2864961 --- /dev/null +++ b/lib/PageOne/my_list_view.dart @@ -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(), + + ), + + ], + ); + } + ); + } +} \ No newline at end of file diff --git a/lib/PageOne/my_stack.dart b/lib/PageOne/my_stack.dart new file mode 100644 index 0000000..563be8a --- /dev/null +++ b/lib/PageOne/my_stack.dart @@ -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(), + ], + ) + + ); + } +} \ No newline at end of file diff --git a/lib/PageOne/page_one_main.dart b/lib/PageOne/page_one_main.dart new file mode 100644 index 0000000..910cde2 --- /dev/null +++ b/lib/PageOne/page_one_main.dart @@ -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(), + ], + ), + ), + + ), + ); + } +} + + + + + + + + + + + diff --git a/lib/PageOne/text_field.dart b/lib/PageOne/text_field.dart new file mode 100644 index 0000000..db33d93 --- /dev/null +++ b/lib/PageOne/text_field.dart @@ -0,0 +1,49 @@ +import 'package:book_store_app/model.dart'; +import 'package:flutter/material.dart'; +class SearchTextField extends StatelessWidget { + const SearchTextField({ + Key? key, + }) : super(key: key); + + @override + Widget build(BuildContext context) { + TextEditingController editingController = TextEditingController(); + return Padding( + padding: const EdgeInsets.symmetric(vertical: 38,horizontal: 10), + child:TextField( + onSubmitted: (x){ + Book.Q.value =x; + }, + controller: editingController, + style: TextStyle(fontSize: 20,color: Color.fromRGBO(132, 136, 158, 1)), + minLines: 1, + maxLines: 2, + textInputAction: TextInputAction.search, + decoration: InputDecoration( + filled: true, + fillColor: Color.fromRGBO(255, 255, 255, 1), + border: InputBorder.none, + hintText: 'Search...', + suffixIcon: TextButton( + onPressed: (){ + + }, + child: Icon(Icons.search, color: Colors.grey), + ), + enabledBorder: OutlineInputBorder( + borderRadius: BorderRadius.circular(20), + borderSide: BorderSide.none + ), + focusedBorder: OutlineInputBorder( + borderRadius: BorderRadius.circular(20), + borderSide: const BorderSide( + color: Colors.greenAccent, + width: 1, + ) + ), + ), + ) + + ); + } +} \ No newline at end of file diff --git a/lib/PageOne/title_of_book.dart b/lib/PageOne/title_of_book.dart new file mode 100644 index 0000000..6ec8fbc --- /dev/null +++ b/lib/PageOne/title_of_book.dart @@ -0,0 +1,29 @@ + +import 'package:book_store_app/model.dart'; +import 'package:flutter/material.dart'; + +class Title0fBook extends StatefulWidget { + const Title0fBook({ + Key? key, required this.name, + }) : super(key: key); +final String name; + + @override + State createState() => _Title0fBookState(); +} + +class _Title0fBookState extends State { + @override + + Widget build(BuildContext context) { + + return + Text('${widget.name}', + style:const TextStyle( + fontSize: 24, + fontWeight: FontWeight.bold, + color: Colors.black + ), + ); + } +} \ No newline at end of file diff --git a/lib/PageThree/TextFieldMain/my_auther_name.dart b/lib/PageThree/TextFieldMain/my_auther_name.dart new file mode 100644 index 0000000..4e07037 --- /dev/null +++ b/lib/PageThree/TextFieldMain/my_auther_name.dart @@ -0,0 +1,39 @@ + +import 'package:flutter/material.dart'; +final TextEditingController conAuther = TextEditingController(); + +class AutherName extends StatelessWidget { + const AutherName({ + Key? key, + }) : super(key: key); + + @override + Widget build(BuildContext context) { + return Padding( + padding: const EdgeInsets.only(top: 20), + child: TextField( + controller: conAuther, + style: TextStyle(fontSize: 15,color: Color.fromRGBO(132, 136, 158, 1)), + minLines: 1, + maxLines: 2, + textInputAction: TextInputAction.next, + decoration: InputDecoration( + filled: true, + fillColor: Color.fromRGBO(255, 255, 255, 1), + border: InputBorder.none, + hintText: 'Auther Name', + enabledBorder: OutlineInputBorder( + borderRadius: BorderRadius.circular(8), + borderSide: BorderSide.none + ), + focusedBorder: OutlineInputBorder( + borderSide: const BorderSide( + color: Colors.greenAccent, + width: 1, + ) + ), + ), + ), + ); + } +} \ No newline at end of file diff --git a/lib/PageThree/TextFieldMain/my_book_name.dart b/lib/PageThree/TextFieldMain/my_book_name.dart new file mode 100644 index 0000000..830afc8 --- /dev/null +++ b/lib/PageThree/TextFieldMain/my_book_name.dart @@ -0,0 +1,39 @@ + + +import 'package:flutter/material.dart'; +final TextEditingController conBook = TextEditingController(); + +class BookName extends StatelessWidget { + const BookName({ + Key? key, + }) : super(key: key); + @override + Widget build(BuildContext context) { + return Padding( + padding: const EdgeInsets.only(top: 20), + child: TextField( + controller: conBook, + style: TextStyle(fontSize: 15,color: Color.fromRGBO(132, 136, 158, 1)), + minLines: 1, + maxLines: 2, + textInputAction: TextInputAction.next, + decoration: InputDecoration( + filled: true, + fillColor: Color.fromRGBO(255, 255, 255, 1), + border: InputBorder.none, + hintText: 'Book Name', + enabledBorder: OutlineInputBorder( + borderRadius: BorderRadius.circular(8), + borderSide: BorderSide.none + ), + focusedBorder:const OutlineInputBorder( + borderSide: BorderSide( + color: Colors.greenAccent, + width: 1, + ) + ), + ), + ), + ); + } +} \ No newline at end of file diff --git a/lib/PageThree/TextFieldMain/my_description.dart b/lib/PageThree/TextFieldMain/my_description.dart new file mode 100644 index 0000000..b070e5d --- /dev/null +++ b/lib/PageThree/TextFieldMain/my_description.dart @@ -0,0 +1,40 @@ + + +import 'package:flutter/material.dart'; +final TextEditingController conDescription = TextEditingController(); + +class Description extends StatelessWidget { + const Description({ + Key? key, + }) : super(key: key); + + @override + Widget build(BuildContext context) { + return Padding( + padding: const EdgeInsets.only(top: 20), + child: TextField( + controller: conDescription, + style: TextStyle(fontSize: 15,color: Color.fromRGBO(132, 136, 158, 1)), + minLines: 7, + maxLines: 7, + textInputAction: TextInputAction.next, + decoration: InputDecoration( + filled: true, + fillColor: Color.fromRGBO(255, 255, 255, 1), + border: InputBorder.none, + hintText: 'Description', + enabledBorder: OutlineInputBorder( + borderRadius: BorderRadius.circular(8), + borderSide: BorderSide.none + ), + focusedBorder: OutlineInputBorder( + borderSide: const BorderSide( + color: Colors.greenAccent, + width: 1, + ) + ), + ), + ), + ); + } +} \ No newline at end of file diff --git a/lib/PageThree/TextFieldMain/my_image_link.dart b/lib/PageThree/TextFieldMain/my_image_link.dart new file mode 100644 index 0000000..7997214 --- /dev/null +++ b/lib/PageThree/TextFieldMain/my_image_link.dart @@ -0,0 +1,40 @@ + + +import 'package:flutter/material.dart'; +final TextEditingController conImage = TextEditingController(); + +class ImageLink extends StatelessWidget { + const ImageLink({ + Key? key, + }) : super(key: key); + + @override + Widget build(BuildContext context) { + return Padding( + padding: const EdgeInsets.only(top: 20), + child: TextField( + controller: conImage, + style: TextStyle(fontSize: 15,color: Color.fromRGBO(132, 136, 158, 1)), + minLines: 1, + maxLines: 2, + textInputAction: TextInputAction.next, + decoration: InputDecoration( + filled: true, + fillColor: Color.fromRGBO(255, 255, 255, 1), + border: InputBorder.none, + hintText: 'Image link', + enabledBorder: OutlineInputBorder( + borderRadius: BorderRadius.circular(8), + borderSide: BorderSide.none + ), + focusedBorder: OutlineInputBorder( + borderSide: const BorderSide( + color: Colors.greenAccent, + width: 1, + ) + ), + ), + ), + ); + } +} \ No newline at end of file diff --git a/lib/PageThree/TextFieldMain/my_price.dart b/lib/PageThree/TextFieldMain/my_price.dart new file mode 100644 index 0000000..a12c8c9 --- /dev/null +++ b/lib/PageThree/TextFieldMain/my_price.dart @@ -0,0 +1,40 @@ + + +import 'package:flutter/material.dart'; +final TextEditingController conPrice = TextEditingController(); + +class Price extends StatelessWidget { + const Price({ + Key? key, + }) : super(key: key); + + @override + Widget build(BuildContext context) { + return Padding( + padding: const EdgeInsets.only(top: 20), + child: TextField( + controller: conPrice, + style: TextStyle(fontSize: 15,color: Color.fromRGBO(132, 136, 158, 1)), + minLines: 1, + maxLines: 2, + textInputAction: TextInputAction.next, + decoration: InputDecoration( + filled: true, + fillColor: Color.fromRGBO(255, 255, 255, 1), + border: InputBorder.none, + hintText: 'Price', + enabledBorder: OutlineInputBorder( + borderRadius: BorderRadius.circular(8), + borderSide: BorderSide.none + ), + focusedBorder: OutlineInputBorder( + borderSide: const BorderSide( + color: Colors.greenAccent, + width: 1, + ) + ), + ), + ), + ); + } +} \ No newline at end of file diff --git a/lib/PageThree/TextFieldMain/my_text_filed_main.dart b/lib/PageThree/TextFieldMain/my_text_filed_main.dart new file mode 100644 index 0000000..73f08e1 --- /dev/null +++ b/lib/PageThree/TextFieldMain/my_text_filed_main.dart @@ -0,0 +1,38 @@ +import 'package:book_store_app/PageThree/TextFieldMain/my_auther_name.dart'; +import 'package:book_store_app/PageThree/TextFieldMain/my_book_name.dart'; +import 'package:book_store_app/PageThree/TextFieldMain/my_description.dart'; +import 'package:book_store_app/PageThree/TextFieldMain/my_image_link.dart'; +import 'package:book_store_app/PageThree/TextFieldMain/my_price.dart'; +import 'package:flutter/material.dart'; + +class MyTextFieldMain extends StatelessWidget { + const MyTextFieldMain({ + Key? key, + }) : super(key: key); + + @override + Widget build(BuildContext context) { + return Container( + margin: EdgeInsets.symmetric(horizontal: 50,vertical: 20), + + child: Column( + children: const [ + BookName(), + AutherName(), + Price(), + ImageLink(), + Description(), + ], + ), + ); + } +} + + + + + + + + + diff --git a/lib/PageThree/add_book_title.dart b/lib/PageThree/add_book_title.dart new file mode 100644 index 0000000..c899a21 --- /dev/null +++ b/lib/PageThree/add_book_title.dart @@ -0,0 +1,20 @@ + +import 'package:flutter/material.dart'; + +class AddBookTitle extends StatelessWidget { + const AddBookTitle({ + Key? key, + }) : super(key: key); + + @override + Widget build(BuildContext context) { + return const Padding( + padding: const EdgeInsets.symmetric(horizontal: 30,vertical: 10), + child: Text('Add Book',style: TextStyle( + color: Colors.black, + fontSize: 25, + fontWeight: FontWeight.bold + ),), + ); + } +} \ No newline at end of file diff --git a/lib/PageThree/my_text_button.dart b/lib/PageThree/my_text_button.dart new file mode 100644 index 0000000..f85ed5d --- /dev/null +++ b/lib/PageThree/my_text_button.dart @@ -0,0 +1,47 @@ + +import 'package:book_store_app/PageThree/TextFieldMain/my_auther_name.dart'; +import 'package:book_store_app/PageThree/TextFieldMain/my_book_name.dart'; +import 'package:book_store_app/PageThree/TextFieldMain/my_description.dart'; +import 'package:book_store_app/PageThree/TextFieldMain/my_image_link.dart'; +import 'package:book_store_app/PageThree/TextFieldMain/my_price.dart'; +import 'package:book_store_app/main.dart'; +import 'package:book_store_app/model.dart'; +import 'package:flutter/material.dart'; + +class MyTextButtonAdd extends StatelessWidget { + const MyTextButtonAdd({ + Key? key, + }) : super(key: key); + + @override + Widget build(BuildContext context) { + return TextButton( + onPressed: (){ + if(conBook.text != '' || conAuther.text != '' || conPrice.text != '' || conImage.text != ''){ + Book.add(conBook.text, conAuther.text, conPrice.text, conImage.text, conDescription.text); + Navigator.push( + context, + MaterialPageRoute(builder: (context) => const MyApp()), + ); + }else{ + print('no push'); + } + + }, + child: Container( + margin: EdgeInsets.symmetric(horizontal: 45), + padding: EdgeInsets.symmetric(horizontal: 135,vertical: 18), + decoration: BoxDecoration( + color: Colors.black, + borderRadius: BorderRadius.circular(8), + ), + child:const Text('Add',style: TextStyle( + color: Colors.white, + fontSize: 15, + fontWeight: FontWeight.bold, + ),), + ) + + ); + } +} \ No newline at end of file diff --git a/lib/PageThree/page_three_main.dart b/lib/PageThree/page_three_main.dart new file mode 100644 index 0000000..8e6d4e9 --- /dev/null +++ b/lib/PageThree/page_three_main.dart @@ -0,0 +1,69 @@ + +import 'package:book_store_app/PageOne/page_one_main.dart'; +import 'package:book_store_app/PageThree/TextFieldMain/my_text_filed_main.dart'; +import 'package:book_store_app/PageThree/add_book_title.dart'; +import 'package:book_store_app/PageThree/my_text_button.dart'; +import 'package:book_store_app/main.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter/services.dart'; + + +class PageThree extends StatelessWidget { + const PageThree({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, + leading: IconButton( + onPressed: (){ + Navigator.pop(context); + }, + icon: const Icon(Icons.arrow_back_ios), + color: Colors.black, + ), + actions: [ + IconButton(onPressed: (){}, icon: const Icon( + Icons.more_vert, + color: Colors.black, + )) + ], + ), + /////////////////////////// + /////////////////////////// + body: SingleChildScrollView( + scrollDirection: Axis.vertical, + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: const[ + AddBookTitle(), + MyTextFieldMain(), + MyTextButtonAdd(), + ], + ), + ) + ), + ); + + + + + + + + } +} + + + + + + diff --git a/lib/PageTwo/information_book.dart b/lib/PageTwo/information_book.dart new file mode 100644 index 0000000..af79e88 --- /dev/null +++ b/lib/PageTwo/information_book.dart @@ -0,0 +1,76 @@ + + +import 'package:book_store_app/model.dart'; +import 'package:flutter/material.dart'; + +class InformationBook extends StatelessWidget { + const InformationBook({ + Key? key, required this.information, + }) : super(key: key); +final Book information; + @override + Widget build(BuildContext context) { + return Column( + children: [ + Text( + '${information.nameBook}', + style: TextStyle( + color: Colors.black, + fontSize: 25, + fontWeight: FontWeight.bold), + ), + Padding( + padding: const EdgeInsets.only(top: 10), + child: Text( + '${information.nameAuther}', + style:const TextStyle( + color: Colors.grey, + fontSize: 15, + fontWeight: FontWeight.normal), + ), + ), + Padding( + padding: const EdgeInsets.only(top: 10), + child: Row( + mainAxisAlignment: MainAxisAlignment.center, + children: const[ + Icon( + Icons.star, + color: Colors.orange, + size: 20, + ), + Icon( + Icons.star, + color: Colors.orange, + size: 20, + ), + Icon( + Icons.star, + color: Colors.orange, + size: 20, + ), + Icon( + Icons.star_half, + color: Colors.orange, + size: 20, + ), + Icon( + Icons.star_border_sharp, + color: Colors.orange, + size: 20, + ), + Text( + '4.5/', + style: TextStyle(color: Colors.black, fontSize: 15), + ), + Text( + '5.0', + style: TextStyle(color: Colors.grey, fontSize: 15), + ) + ], + ), + ), + ], + ); + } +} \ No newline at end of file diff --git a/lib/PageTwo/main_image.dart b/lib/PageTwo/main_image.dart new file mode 100644 index 0000000..bebeb55 --- /dev/null +++ b/lib/PageTwo/main_image.dart @@ -0,0 +1,28 @@ + + + +import 'package:book_store_app/model.dart'; +import 'package:flutter/material.dart'; + +class MyMainImage extends StatelessWidget { + const MyMainImage({ + Key? key, required this.image, + }) : super(key: key); +final Book image; + @override + Widget build(BuildContext context) { + return Container( + width: 211.69, + height: 310, + margin: const EdgeInsets.symmetric(horizontal: 100, vertical: 20), + decoration: BoxDecoration( + image: DecorationImage( + image: NetworkImage( + '${image.imageNetwork}', + ), + fit: BoxFit.fill), + borderRadius: BorderRadius.only( + topRight: Radius.circular(10), bottomRight: Radius.circular(10))), + ); + } +} \ No newline at end of file diff --git a/lib/PageTwo/my_stack.dart b/lib/PageTwo/my_stack.dart new file mode 100644 index 0000000..279913d --- /dev/null +++ b/lib/PageTwo/my_stack.dart @@ -0,0 +1,102 @@ + + +import 'package:book_store_app/model.dart'; +import 'package:flutter/material.dart'; + +class MyStack extends StatelessWidget { + const MyStack({ + Key? key, required this.description, + }) : super(key: key); +final Book description; + @override + Widget build(BuildContext context) { + return Padding( + padding: const EdgeInsets.only(top: 10), + child: Stack( + children: [ + Container( + width: 330, + height: 120, + margin: EdgeInsets.symmetric(horizontal: 40), + child: SingleChildScrollView( + scrollDirection: Axis.vertical, + child: Text( + '${description.dscription}', + style: TextStyle( + color: Colors.grey, + fontSize: 15, + ), + ), + ), + ), + Padding( + padding: const EdgeInsets.only(top: 100, bottom: 36), + child: Row( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + TextButton( + onPressed: () {}, + child: Container( + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.circular(8)), + padding:const EdgeInsets.symmetric( + horizontal: 31, vertical: 8), + child: Row( + children: const[ + Icon( + Icons.featured_play_list, + size: 20, + color: Colors.black, + ), + SizedBox( + width: 10, + ), + Text( + 'Preview', + style: TextStyle( + color: Colors.black, + fontSize: 14, + fontWeight: FontWeight.bold), + ) + ], + ), + ), + ), + TextButton( + onPressed: () {}, + child: Container( + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.circular(8)), + padding: const EdgeInsets.symmetric( + horizontal: 31, vertical: 8), + child: Row( + children:const [ + Icon( + Icons.chat_outlined, + size: 20, + color: Colors.black, + ), + SizedBox( + width: 10, + ), + Text( + 'Reviews', + style: TextStyle( + color: Colors.black, + fontSize: 14, + fontWeight: FontWeight.bold), + ) + ], + ), + ), + ), + ], + ), + ), + ], + ), + ); + } +} \ No newline at end of file diff --git a/lib/PageTwo/my_text_button.dart b/lib/PageTwo/my_text_button.dart new file mode 100644 index 0000000..e4fdbbe --- /dev/null +++ b/lib/PageTwo/my_text_button.dart @@ -0,0 +1,41 @@ + + +import 'package:book_store_app/PageOne/page_one_main.dart'; +import 'package:book_store_app/PageTwo/page_two_main.dart'; +import 'package:book_store_app/main.dart'; +import 'package:book_store_app/model.dart'; +import 'package:flutter/material.dart'; + +class MyTextButton extends StatelessWidget { + const MyTextButton({ + Key? key, required this.price, + }) : super(key: key); +final Book price; + @override + Widget build(BuildContext context) { + return TextButton( + onPressed: () { + price.makeAsDone(); + Navigator.push( + context, + MaterialPageRoute(builder: (context) => const PageOne()), + ); + }, + child: Container( + margin: const EdgeInsets.symmetric(horizontal: 40), + padding: const EdgeInsets.symmetric(horizontal: 80, vertical: 20), + decoration: BoxDecoration( + color: Colors.black, + borderRadius: BorderRadius.circular(8), + ), + child: Text( + 'Buy Now For \$${price.price}', + style: const TextStyle( + color: Colors.white, + fontSize: 15, + fontWeight: FontWeight.bold, + ), + ), + )); + } +} \ No newline at end of file diff --git a/lib/PageTwo/page_two_main.dart b/lib/PageTwo/page_two_main.dart new file mode 100644 index 0000000..485e3c4 --- /dev/null +++ b/lib/PageTwo/page_two_main.dart @@ -0,0 +1,62 @@ +import 'dart:math'; + +import 'package:book_store_app/PageTwo/information_book.dart'; +import 'package:book_store_app/PageTwo/main_image.dart'; +import 'package:book_store_app/PageTwo/my_stack.dart'; +import 'package:book_store_app/PageTwo/my_text_button.dart'; +import 'package:book_store_app/model.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter/services.dart'; + +class PageTwo extends StatelessWidget { + PageTwo({Key? key, required this.mybook, }) : super(key: key); +final Book mybook; + @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, + leading: IconButton( + onPressed: () { + Navigator.pop(context); + }, + icon: const Icon(Icons.arrow_back_ios), + color: Colors.black, + ), + actions: [ + IconButton( + onPressed: () {}, + icon: const Icon( + Icons.more_vert, + color: Colors.black, + )) + ], + ), + + /////////////////////////////// + /////////////////////////////// + body: Column( + children: [ + MyMainImage(image: mybook), + InformationBook(information: mybook,), + MyStack(description: mybook,), + MyTextButton(price: mybook,) + ], + )), + ); + } +} + + + + + + + + diff --git a/lib/main.dart b/lib/main.dart index bcc58f7..bf417e0 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -1,5 +1,8 @@ + +import 'package:book_store_app/PageOne/page_one_main.dart'; import 'package:flutter/material.dart'; + void main() { runApp(const MyApp()); } @@ -9,12 +12,8 @@ class MyApp extends StatelessWidget { @override Widget build(BuildContext context) { - return const MaterialApp( - home: Scaffold( - body: Center( - child: Text("Book Store App"), - ), - ), - ); + return const PageOne(); } } + + diff --git a/lib/model.dart b/lib/model.dart new file mode 100644 index 0000000..5fc0072 --- /dev/null +++ b/lib/model.dart @@ -0,0 +1,46 @@ +import 'package:get/get.dart'; + +class Book{ + final RxString nameBook; + final RxString nameAuther; + final RxString price; + final RxString imageNetwork; + final RxString dscription; + final RxBool isDone; + + Book( + String dataBook, + String dataAuther, + String dataPrice, + String dataImageNetwork , + String dataDescription, + [bool? isDone ] + ): + nameBook =dataBook.obs, + nameAuther = dataAuther.obs, + price = dataPrice.obs, + imageNetwork = dataImageNetwork.obs, + dscription = dataDescription.obs, + + isDone = (isDone??false).obs; + + makeAsDone(){ + isDone.value = true; + } + + static RxList books =[].obs; + static RxString Q =''.obs; + static add(String nBook,String nAuther,String nPrice,String nImageLink,String nDescription){ + + Book myBook =Book( + nBook, + nAuther, + nPrice, + nImageLink, + nDescription); + + books.add(myBook); + + } + +} \ No newline at end of file diff --git a/pubspec.lock b/pubspec.lock index 7bc8bdd..a45ff75 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -74,6 +74,13 @@ packages: description: flutter source: sdk version: "0.0.0" + get: + dependency: "direct dev" + description: + name: get + url: "https://pub.dartlang.org" + source: hosted + version: "4.6.5" lints: dependency: transitive description: diff --git a/pubspec.yaml b/pubspec.yaml index cd0f457..fe5f854 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -38,6 +38,7 @@ dependencies: dev_dependencies: flutter_test: sdk: flutter + get: any # The "flutter_lints" package below contains a set of recommended lints to # encourage good coding practices. The lint set provided by the package is @@ -58,9 +59,8 @@ flutter: uses-material-design: true # To add assets to your application, add an assets section, like this: - # assets: - # - images/a_dot_burr.jpeg - # - images/a_dot_ham.jpeg + assets: + - images/ # An image asset can refer to one or more resolution-specific "variants", see # https://flutter.dev/assets-and-images/#resolution-aware