Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix/components #18

Merged
merged 4 commits into from
Oct 26, 2022
Merged
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
69 changes: 36 additions & 33 deletions lib/components/cards/book_card.dart
Original file line number Diff line number Diff line change
Expand Up @@ -9,49 +9,52 @@ class BookCard extends StatelessWidget {
final Book book;
final Function(Book)? onTap;
final double radius = 10;

@override
Widget build(BuildContext context) {
return Ink(
return Container(
width: Get.width * 0.5,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(radius),
),
child: Column(
mainAxisSize: MainAxisSize.min,
children: [
InkWell(
borderRadius: BorderRadius.circular(radius),
onTap: () => onTap?.call(book),
child: Ink(
width: double.infinity,
height: 160,
padding: const EdgeInsets.all(10),
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(radius),
boxShadow: [
BoxShadow(
color: Colors.black.withOpacity(0.05),
spreadRadius: 0.1,
blurRadius: 10,
offset: const Offset(0, 3),
),
],
),
child: Center(
child: LayoutBuilder(builder: (context, constraints) {
return Ink(
height: constraints.maxHeight,
width: (constraints.maxHeight * 240) / 360,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(radius),
image: DecorationImage(
image: NetworkImage(book.capaUrl!),
fit: BoxFit.cover,
),
Material(
child: InkWell(
borderRadius: BorderRadius.circular(radius),
onTap: () => onTap?.call(book),
child: Ink(
width: double.infinity,
height: 160,
padding: const EdgeInsets.all(10),
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(radius),
boxShadow: [
BoxShadow(
color: Colors.black.withOpacity(0.05),
spreadRadius: 0.1,
blurRadius: 10,
offset: const Offset(0, 3),
),
);
}),
],
),
child: Center(
child: LayoutBuilder(builder: (context, constraints) {
return Ink(
height: constraints.maxHeight,
width: (constraints.maxHeight * 240) / 360,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(radius),
image: DecorationImage(
image: NetworkImage(book.capaUrl!),
fit: BoxFit.cover,
),
),
);
}),
),
),
),
),
Expand Down
1 change: 1 addition & 0 deletions lib/components/header.dart
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ class _HeaderState extends State<Header> {
HeaderProps props = widget.props;
return AppBar(
toolbarHeight: 52,
elevation: 0,
centerTitle: props.showLogo || props.title == null,
title: props.title != null
? Text(
Expand Down
2 changes: 2 additions & 0 deletions lib/configs/themes.dart
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ const dark = Color(0xFF252837);
const grey = Color(0xFF646E77);
const lightGrey = Color(0xFFF6F7F8);

const double pageRadius = 30;

ThemeData themeData = ThemeData(
primarySwatch: Colors.red,
fontFamily: "Avenir",
Expand Down
17 changes: 13 additions & 4 deletions lib/pages/book_availability_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,13 @@ class _BookAvailabilityPageState extends State<BookAvailabilityPage> {
showBackButton: true,
title: 'Disponibilizar livro',
),
child: Ink(
child: Container(
decoration: const BoxDecoration(
color: lightGrey,
borderRadius: BorderRadius.only(
topLeft: Radius.circular(pageRadius),
topRight: Radius.circular(pageRadius),
),
),
height: double.infinity,
width: double.infinity,
Expand All @@ -46,9 +50,13 @@ class _BookAvailabilityPageState extends State<BookAvailabilityPage> {
status: _status,
onChange: (status) => _status = status,
),
const SizedBox(height: 24),
Padding(
padding: const EdgeInsets.symmetric(horizontal: 10),
padding: const EdgeInsets.only(
right: 10,
left: 10,
top: 24,
bottom: 10,
),
child: Input(
hintText: "Pesquise por título ou ISBN",
leftIcon: const Icon(Icons.search, color: Colors.grey),
Expand All @@ -64,7 +72,6 @@ class _BookAvailabilityPageState extends State<BookAvailabilityPage> {
},
),
),
const SizedBox(height: 24),
Expanded(
child: Obx(() {
if (_searchStatus.value == SearchStatus.initial) {
Expand All @@ -75,6 +82,8 @@ class _BookAvailabilityPageState extends State<BookAvailabilityPage> {
);
} else if (_searchStatus.value == SearchStatus.complete) {
return CustomScrollView(
shrinkWrap: true,
physics: const BouncingScrollPhysics(),
slivers: [
SliverPadding(
padding: const EdgeInsets.symmetric(horizontal: 10),
Expand Down