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

Feat/add bottom perfil #14

Merged
merged 3 commits into from
Oct 13, 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
51 changes: 51 additions & 0 deletions lib/components/bottom_profile.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
import 'package:app_flutter/components/button_option_profile.dart';
import 'package:flutter/material.dart';

class BottomProfile extends StatelessWidget {
const BottomProfile({super.key});

@override
Widget build(BuildContext context) {
return Padding(
padding: const EdgeInsets.symmetric(horizontal: 10),
child: Ink(
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(10),
boxShadow: [
BoxShadow(
color: Colors.black.withOpacity(0.1),
spreadRadius: 1,
blurRadius: 10,
offset: const Offset(0, 3), // changes position of shadow
),
],
),
child: Column(
mainAxisSize: MainAxisSize.min,
children: [
ButtonOptionProfile(
label: "Lista de Interesse",
icon: Icons.book_rounded,
topLeftRadius: 10,
topRightRadius: 10,
onPressed: () {},
),
ButtonOptionProfile(
label: "Livros Disponibilizados",
icon: Icons.book_rounded,
onPressed: () {},
),
ButtonOptionProfile(
label: "Livros Avaliados",
icon: Icons.stars_rounded,
bottomLeftRadius: 10,
bottomRightRadius: 10,
onPressed: () {},
),
],
),
),
);
}
}
54 changes: 54 additions & 0 deletions lib/components/button_option_profile.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
import 'package:flutter/material.dart';

class ButtonOptionProfile extends StatelessWidget {
const ButtonOptionProfile(
{super.key,
required this.label,
required this.icon,
this.onPressed,
this.topLeftRadius = 0,
this.topRightRadius = 0,
this.bottomLeftRadius = 0,
this.bottomRightRadius = 0});

final String label;
final IconData icon;
final Function()? onPressed;

final double topLeftRadius;
final double topRightRadius;
final double bottomLeftRadius;
final double bottomRightRadius;

@override
Widget build(BuildContext context) {
return ClipRect(
child: InkWell(
borderRadius: BorderRadius.only(
topLeft: Radius.circular(topLeftRadius),
topRight: Radius.circular(topRightRadius),
bottomLeft: Radius.circular(bottomLeftRadius),
bottomRight: Radius.circular(bottomRightRadius),
),
onTap: () {},
child: Ink(
height: 60,
padding: const EdgeInsets.symmetric(horizontal: 5),
child: Row(
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Icon(icon, size: 30),
Expanded(
child: Padding(
padding: const EdgeInsets.symmetric(horizontal: 10),
child: Text(label),
),
),
const Icon(Icons.arrow_forward_ios_rounded),
],
),
),
),
);
}
}
10 changes: 10 additions & 0 deletions storybook/main.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import 'package:app_flutter/components/bottom_menu.dart';
import 'package:app_flutter/components/bottom_profile.dart';
import 'package:app_flutter/components/button_action.dart';
import 'package:app_flutter/components/button_option.dart';
import 'package:app_flutter/components/button_option_badge.dart';
Expand Down Expand Up @@ -147,6 +148,15 @@ class _StorybookAppState extends State<StorybookApp> {
),
),
),
Story(
name: 'Components/BottomProfile',
builder: (context) => Scaffold(
backgroundColor: lightGrey,
body: Center(
child: BottomProfile(),
),
),
),
],
);
}