Skip to content

Commit

Permalink
refactor(shared): update widget FeedbackPage
Browse files Browse the repository at this point in the history
  • Loading branch information
leandro-mancini committed Oct 22, 2022
1 parent 25cf191 commit 7e9658d
Showing 1 changed file with 28 additions and 2 deletions.
30 changes: 28 additions & 2 deletions libs/flutter/shared/lib/src/widgets/feedback_page_widget.dart
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,20 @@ import 'package:flutter_svg/flutter_svg.dart';
class FeedbackPageWidget extends StatelessWidget {
final String illustration;
final String message;
final String? description;
final String? textButton;
final bool enabledAction;
final VoidCallback? onPressed;

const FeedbackPageWidget({Key? key, required this.message, required this.illustration}) : super(key: key);
const FeedbackPageWidget({
Key? key,
required this.message,
required this.illustration,
this.description,
this.onPressed,
this.enabledAction = false,
this.textButton
}) : super(key: key);

@override
Widget build(BuildContext context) {
Expand All @@ -28,7 +40,21 @@ class FeedbackPageWidget extends StatelessWidget {
fontSize: 18,
fontWeight: FontWeight.w700,
),
)
),
description != null ? Padding(
padding: const EdgeInsets.symmetric(horizontal: 24, vertical: 6),
child: Text(
description!,
textAlign: TextAlign.center,
style: const TextStyle(
fontSize: 14,
),
),
) : Container(),
enabledAction ? TextButton(
onPressed: () => onPressed!(),
child: Text(textButton!, style: const TextStyle(color: Colors.red),)
) : Container(),
],
),
),
Expand Down

0 comments on commit 7e9658d

Please sign in to comment.