diff --git a/lib/page/book_item.dart b/lib/page/book_item.dart index 4994027..300a092 100644 --- a/lib/page/book_item.dart +++ b/lib/page/book_item.dart @@ -2,7 +2,7 @@ import 'package:flutter/material.dart'; class BookItem extends StatelessWidget { - // final String bookName; + final String bookName='book name'; // final int bookNum; // const BookItem({Key key, this.bookName, this.bookNum}) : super(key: key); @@ -15,7 +15,12 @@ class BookItem extends StatelessWidget { return Padding( padding: const EdgeInsets.all(8.0), child: - image + Column( + children: [ + Flexible(child: image), + Text('$bookName') + ], + ) ); } diff --git a/lib/page/shelfdetailpage.dart b/lib/page/shelfdetailpage.dart index 0832d04..409edaf 100644 --- a/lib/page/shelfdetailpage.dart +++ b/lib/page/shelfdetailpage.dart @@ -53,11 +53,16 @@ class _ShelfDetailPageState extends State { ) ], ), - body: - Center( - child: Container( - padding: EdgeInsets.only(top:10), - color: Colors.deepPurple[300], + body: Stack( + children: [ + Container( + decoration: new BoxDecoration( + color: Colors.deepPurple[300], + ), + ), + Container( + padding: EdgeInsets.only(top: 10), + child: GridView.builder( shrinkWrap: true, itemCount: _bookCounter, @@ -66,8 +71,9 @@ class _ShelfDetailPageState extends State { itemBuilder: _buildItem, ), ), - ) - , + ], + ), + floatingActionButton: FloatingActionButton( onPressed: _incrementCounter, tooltip: 'Increment',