diff --git a/finalresult/Screenshot_1661707723.png b/finalresult/Screenshot_1661707723.png new file mode 100644 index 0000000..5139d86 Binary files /dev/null and b/finalresult/Screenshot_1661707723.png differ diff --git a/finalresult/Screenshot_1661708147.png b/finalresult/Screenshot_1661708147.png new file mode 100644 index 0000000..da538e5 Binary files /dev/null and b/finalresult/Screenshot_1661708147.png differ diff --git a/finalresult/Screenshot_1661708159.png b/finalresult/Screenshot_1661708159.png new file mode 100644 index 0000000..68a0cb1 Binary files /dev/null and b/finalresult/Screenshot_1661708159.png differ diff --git a/finalresult/Screenshot_1661708170.png b/finalresult/Screenshot_1661708170.png new file mode 100644 index 0000000..79df2de Binary files /dev/null and b/finalresult/Screenshot_1661708170.png differ diff --git a/lib/add_page/add_button.dart b/lib/add_page/add_button.dart new file mode 100644 index 0000000..c3f1dbd --- /dev/null +++ b/lib/add_page/add_button.dart @@ -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 + ),) + ) + ); + } +} \ No newline at end of file diff --git a/lib/add_page/add_field.dart b/lib/add_page/add_field.dart new file mode 100644 index 0000000..6e65b9f --- /dev/null +++ b/lib/add_page/add_field.dart @@ -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 createState() => _AddFieldsState(); +} + +class _AddFieldsState extends State { + @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) + ), + ), + ), + ); + } +} \ No newline at end of file diff --git a/lib/add_page/add_page.dart b/lib/add_page/add_page.dart new file mode 100644 index 0000000..34394f5 --- /dev/null +++ b/lib/add_page/add_page.dart @@ -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 createState() => _AddBooksState(); +} + +class _AddBooksState extends State { + 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), + ]), + + ); + } +} diff --git a/lib/cart_page/cart_page.dart b/lib/cart_page/cart_page.dart new file mode 100644 index 0000000..f8ace53 --- /dev/null +++ b/lib/cart_page/cart_page.dart @@ -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, + ); + } +} diff --git a/lib/details_page/details_page.dart b/lib/details_page/details_page.dart new file mode 100644 index 0000000..26237b2 --- /dev/null +++ b/lib/details_page/details_page.dart @@ -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,) + ] + ) + ); + } +} \ No newline at end of file diff --git a/lib/details_page/rate_buttons.dart b/lib/details_page/rate_buttons.dart new file mode 100644 index 0000000..c87a58d --- /dev/null +++ b/lib/details_page/rate_buttons.dart @@ -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, + ),); + } +} \ No newline at end of file diff --git a/lib/details_page/review_preview_button.dart b/lib/details_page/review_preview_button.dart new file mode 100644 index 0000000..04d46f5 --- /dev/null +++ b/lib/details_page/review_preview_button.dart @@ -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, + ),), + ], + ), + ), + ); + } +} diff --git a/lib/details_page/view_book.dart b/lib/details_page/view_book.dart new file mode 100644 index 0000000..97f9dd9 --- /dev/null +++ b/lib/details_page/view_book.dart @@ -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, + ),), + ), + ), + ], + ), + ], + ), + ); + } +} diff --git a/lib/first_raw.dart b/lib/first_raw.dart new file mode 100644 index 0000000..5b87431 --- /dev/null +++ b/lib/first_raw.dart @@ -0,0 +1,35 @@ +import 'package:flutter/material.dart'; + +class FirstRaw extends StatelessWidget { + const FirstRaw({ + Key? key, + }) : super(key: key); + + @override + Widget build(BuildContext context) { + return Row( + mainAxisSize: MainAxisSize.max, + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + TextButton( + onPressed: () { + Navigator.pop(context); + }, + child: const Icon( + Icons.arrow_back_ios, + color: Colors.black, + size: 30, + ), + ), + TextButton( + onPressed: () {}, + child: const Icon( + Icons.more_vert, + color: Colors.black, + size: 30, + ), + ) + ], + ); + } +} \ No newline at end of file diff --git a/lib/main.dart b/lib/main.dart index bcc58f7..cceac82 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -1,20 +1,37 @@ -import 'package:flutter/material.dart'; - -void main() { - runApp(const MyApp()); -} - -class MyApp extends StatelessWidget { - const MyApp({Key? key}) : super(key: key); - - @override - Widget build(BuildContext context) { - return const MaterialApp( - home: Scaffold( - body: Center( - child: Text("Book Store App"), - ), - ), - ); - } -} +import 'package:flutter/material.dart'; +import 'package:flutter/services.dart'; +import 'main_page/main_page.dart'; + + +void main() { + + runApp(const MyApp()); +} + +class MyApp extends StatelessWidget { + const MyApp({Key? key}) : super(key: key); + + @override + Widget build(BuildContext context) { + return MaterialApp( + theme: ThemeData( + canvasColor:Colors.white60, + + ), + debugShowCheckedModeBanner: false, + home: Scaffold( + appBar: AppBar( + toolbarHeight: 0, + elevation: 0, + backgroundColor: const Color(0xffE5E5E5), + systemOverlayStyle: const SystemUiOverlayStyle( + statusBarIconBrightness: Brightness.dark, + statusBarColor: Colors.transparent, + ), + ), + backgroundColor: const Color(0xffE5E5E5), + body: const MyListBook(), + ), + ); + } +} diff --git a/lib/main_page/main_page.dart b/lib/main_page/main_page.dart new file mode 100644 index 0000000..0a4133f --- /dev/null +++ b/lib/main_page/main_page.dart @@ -0,0 +1,75 @@ +import 'package:book_store_app/main_page/search_field.dart'; +import 'package:flutter/material.dart'; +import '../my_floating_buttons.dart'; +import 'my_list_book.dart'; + +class MyListBook extends StatelessWidget { + const MyListBook({Key? key}) : super(key: key); + + @override + Widget build(BuildContext context) { + + return Scaffold( + body: Padding( + padding: const EdgeInsets.only(top: 43.0), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Row( + children: const [ + Padding( + padding: EdgeInsets.only(left: 28.0,right: 12.0), + child: CircleAvatar( + radius: 25, + backgroundImage: AssetImage('images/photo_2022-08-25_15-20-40.jpg'), + ), + ), + Text('Hi,Ali',style: TextStyle( + fontFamily: 'Poppins', + fontSize: 14, + color: Colors.black, + fontWeight: FontWeight.w600, + ),), + SizedBox( + width: 228, + ), + Icon(Icons.more_vert,color: Colors.black,size: 30,) + ], + ), + const Padding( + padding: EdgeInsets.all(28.0), + child: SearchField(), + ), + const Padding( + padding: EdgeInsets.only(left: 25.0,top: 15.0), + child: Text('Book List',style: TextStyle( + color: Colors.black, + fontFamily:'Poppins', + fontSize: 24, + fontWeight: FontWeight.bold, + ),), + ), + const MyBook(), + Container( + width: double.maxFinite, + height: 20, + decoration: BoxDecoration( + boxShadow: [ + BoxShadow( + color: Colors.white.withOpacity(0.5), + spreadRadius: 30, + blurRadius: 20, + ) + ] + ), + ) + ], + ), + ), + backgroundColor: const Color(0xffE5E5E5), + floatingActionButton: const MyFloatingActionButtons(), + floatingActionButtonLocation: FloatingActionButtonLocation.centerFloat, + ); + } +} + diff --git a/lib/main_page/my_books.dart b/lib/main_page/my_books.dart new file mode 100644 index 0000000..a490e92 --- /dev/null +++ b/lib/main_page/my_books.dart @@ -0,0 +1,59 @@ +import 'package:book_store_app/details_page/details_page.dart'; +import 'package:book_store_app/model.dart'; +import 'package:book_store_app/my_stars.dart'; +import 'package:flutter/material.dart'; + +class MyBooks extends StatelessWidget { + const MyBooks({ + Key? key, + required this.book, + }) : super(key: key); + + final Books book; + @override + Widget build(BuildContext context) { + return GestureDetector( + onTap: (){ + Navigator.push( + context, + MaterialPageRoute(builder: (context) => BookDetails(book: book,)) + );}, + child: Row( + children: [ + Container( + margin: const EdgeInsets.only(left: 36.0,top: 8.0,right: 26.0), + width: 72, + height: 106, + child: Image(image: NetworkImage(book.image), + fit: BoxFit.cover,) + ), + + Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text(book.bookName, + style: const TextStyle( + color: Colors.black, + fontFamily:'Poppins', + fontSize: 16, + fontWeight: FontWeight.w600, + ),), + Text(book.auther, + style:const TextStyle( + color: Colors.black45, + fontFamily:'Poppins', + fontSize: 12, + fontWeight: FontWeight.w500, + ),), + Text( r'$'+book.price, + style:const TextStyle( + color: Color(0xff191919), + fontFamily:'Poppins', + fontSize: 14, + fontWeight: FontWeight.w500, + ),), + const MyStars(), + ],),],), + ); + } +} \ No newline at end of file diff --git a/lib/main_page/my_list_book.dart b/lib/main_page/my_list_book.dart new file mode 100644 index 0000000..e3be43c --- /dev/null +++ b/lib/main_page/my_list_book.dart @@ -0,0 +1,27 @@ +import 'package:book_store_app/model.dart'; +import 'package:flutter/material.dart'; +import 'my_books.dart'; +import 'package:get/get.dart'; +class MyBook extends StatelessWidget { + const MyBook({ + Key? key, + }) : super(key: key); + + @override + Widget build(BuildContext context) { + return Expanded( + child: ListView( + children: [Obx(() { + return Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: + Books.book.where((e) => e.bookName.contains(Books.typed.value)).map((e) => MyBooks(book: e,)).toList() + + ); + } + ),] + ), + ); + } +} + diff --git a/lib/main_page/search_field.dart b/lib/main_page/search_field.dart new file mode 100644 index 0000000..cc64631 --- /dev/null +++ b/lib/main_page/search_field.dart @@ -0,0 +1,55 @@ +import 'package:flutter/material.dart'; +import 'package:get/get.dart'; + +import '../model.dart'; + +class SearchField extends StatefulWidget { + const SearchField({ + Key? key, + }) : super(key: key); + + @override + State createState() => _SearchFieldState(); +} + +class _SearchFieldState extends State { + RxString index=''.obs; + @override + Widget build(BuildContext context) { + return TextField( + textAlign: TextAlign.start, + cursorColor: Colors.black, + onChanged: (x){ + Books.typed.value=x; + }, + decoration: InputDecoration( + fillColor: Colors.white, + filled: true, + + hintText: 'Search.....', + suffixIcon: Obx(() { + return Icon(Icons.search, + color: Books.typed.value.isEmpty ?Colors.grey : Colors.blue, + size: 30,); + } + ), + 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) + ), + + ), + ); + } +} diff --git a/lib/model.dart b/lib/model.dart new file mode 100644 index 0000000..006a2c5 --- /dev/null +++ b/lib/model.dart @@ -0,0 +1,46 @@ +import 'package:get/get.dart'; +class Books{ + final String bookName; + final String auther; + final String description; + final String image; + final String price; + final RxBool isSelect; + + Books({required this.bookName, required this.auther, + required this.price,required this.description ,required this.image,bool? isSelect}) + : isSelect = (isSelect??false).obs; + static RxList book =[ + Books(bookName: 'Forty Rules Of Love', auther: 'Elif Shafak', price: '21.99', + description: 'Ella Rubenstein is forty years old and unhappily married when she takes a job as a reader for a literary agent. ' + 'Her first assignment is to read and report on Sweet Blasphemy, a novel written by a man named Aziz Zahara.', + image: 'https://images-na.ssl-images-amazon.com/images/S/compressed.photo.goodreads.com/books/1442161289i/6642715.jpg'), + Books(bookName: 'THE WRITER\'S SECRET LIFE', auther: 'Guillaume Musso ', price: '39.99', + description: 'In 1999, after publishing three cult novels, famous author Nathan Fawles announces the end of his writing career and withdraws to Beaumont,' + ' a wild and beautiful island off the Mediterranean coast.Autumn 2018.Over the past twenty years, Fawles has not given a single interview.' + ' As his novels continue to captivate readers, Mathilde Monney, a young Swiss journalist, arrives on the island,determined to unlock his secrets.', + image: 'https://www.guillaumemusso.com/sites/default/files/images/livres/couv/9782702165485-001-T.jpeg'), + Books(bookName: 'The Midnight Library', auther: 'Matt Haig', price: '24.99', + description: 'Between life and death there is a library, and within that library, the shelves go on forever.' + ' Every book provides a chance to try another life you could have lived. To see how things would be if you had made other choices . ' + ' Would you have done anything different, if you had the chance to undo your regrets?', + image: 'https://images-na.ssl-images-amazon.com/images/S/compressed.photo.goodreads.com/books/1602190253i/52578297.jpg'), + Books(bookName: 'Atomic Habits', auther: 'James Clear', price: '15.00', + description: 'No matter your goals, Atomic Habits offers a proven framework for improving—every day. James Clear, one of the world\'s leading experts on habit formation, ' + 'reveals practical strategies that will teach you exactly how to form good habits, break bad ones, ' + 'and master the tiny behaviors that lead to remarkable results.', + image: 'https://images-na.ssl-images-amazon.com/images/S/compressed.photo.goodreads.com/books/1655988385i/40121378.jpg'), + Books(bookName: 'Animal Farm', auther: 'George Orwell', price: '10.00', + description: 'A farm is taken over by its overworked, mistreated animals. With flaming idealism and stirring slogans, ' + 'they set out to create a paradise of progress, justice, and equality. Thus the stage is set for one of the most' + ' telling satiric fables ever penned –a razor-edged fairy tale for grown-ups that records the evolution from revolution against ' + 'tyranny to a totalitarianism just as terrible', + image: 'https://images-na.ssl-images-amazon.com/images/S/compressed.photo.goodreads.com/books/1325861570i/170448.jpg'), + ].obs; + + static RxString typed=''.obs; + makeAsSelect(){ + isSelect.value=true; + } + +} \ No newline at end of file diff --git a/lib/my_floating_buttons.dart b/lib/my_floating_buttons.dart new file mode 100644 index 0000000..bbd076a --- /dev/null +++ b/lib/my_floating_buttons.dart @@ -0,0 +1,44 @@ +import 'package:flutter/material.dart'; +import 'add_page/add_page.dart'; +import 'cart_page/cart_page.dart'; + +class MyFloatingActionButtons extends StatelessWidget { + const MyFloatingActionButtons({ + Key? key, + }) : super(key: key); + + @override + Widget build(BuildContext context) { + return Container( + width: 200, + height: 72, + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(22.0), + color: Colors.white + ), + child: Row( + mainAxisSize: MainAxisSize.max, + mainAxisAlignment: MainAxisAlignment.spaceAround, + children: [ + TextButton(child: const Icon(Icons.home_outlined,size: 30,color: Colors.black,), + onPressed: (){ + Navigator.pop(context); + },), + TextButton(child: const Icon(Icons.shopping_cart_outlined,size: 30,color: Colors.black,), + onPressed: (){ + Navigator.push( + context, + MaterialPageRoute(builder: (context) => const CartsPage())); + },), + TextButton(child: const Icon(Icons.add,size: 30,color: Colors.black,), + onPressed: (){ + Navigator.push( + context, + MaterialPageRoute(builder: (context) => const AddBooks()) + ); + },), + ], + ), + ); + } +} \ No newline at end of file diff --git a/lib/my_stars.dart b/lib/my_stars.dart new file mode 100644 index 0000000..bc77e38 --- /dev/null +++ b/lib/my_stars.dart @@ -0,0 +1,19 @@ +import 'package:flutter/material.dart'; + +class MyStars extends StatelessWidget { + const MyStars({ + Key? key, + }) : super(key: key); + + @override + Widget build(BuildContext context) { + return Row( + children: const [ + Icon(Icons.star,size: 20, color: Colors.yellowAccent,), + Icon(Icons.star,size: 20, color: Colors.yellowAccent,), + Icon(Icons.star,size: 20, color: Colors.yellowAccent,), + Icon(Icons.star,size: 20, color: Colors.yellowAccent,), + Icon(Icons.star,size: 20, color: Colors.grey,) + ]); + } +} \ No newline at end of file