-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add info banner for indicators count limit
- Loading branch information
1 parent
a6fbd9b
commit 5c6bafb
Showing
4 changed files
with
91 additions
and
10 deletions.
There are no files selected for viewing
61 changes: 61 additions & 0 deletions
61
packages/deriv_mobile_chart_wrapper/lib/src/core_widgets/info_banner.dart
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
import 'package:flutter/material.dart'; | ||
import 'package:deriv_theme/deriv_theme.dart'; | ||
|
||
/// Information banner used to display information to the user. | ||
class InfoBanner extends StatelessWidget { | ||
/// Initializes [InfoBanner]. | ||
const InfoBanner({ | ||
required this.message, | ||
this.onClose, | ||
Key? key, | ||
}) : super(key: key); | ||
|
||
/// Message to be displayed. | ||
final String message; | ||
|
||
/// This callback will be called when the user click on the close banner icon. | ||
final VoidCallback? onClose; | ||
|
||
@override | ||
Widget build(BuildContext context) => Container( | ||
padding: const EdgeInsets.symmetric( | ||
horizontal: ThemeProvider.margin16, | ||
vertical: ThemeProvider.margin08, | ||
), | ||
decoration: BoxDecoration( | ||
color: context.theme.colors.information.withOpacity(0.24), | ||
borderRadius: BorderRadius.circular(ThemeProvider.borderRadius04), | ||
), | ||
child: Row( | ||
crossAxisAlignment: CrossAxisAlignment.center, | ||
children: <Widget>[ | ||
Icon( | ||
Icons.info_outline, | ||
color: context.theme.colors.information, | ||
size: ThemeProvider.iconSize24, | ||
), | ||
const SizedBox(width: ThemeProvider.margin08), | ||
Expanded( | ||
child: Text( | ||
message, | ||
style: TextStyles.overline, | ||
), | ||
), | ||
if (onClose != null) | ||
Padding( | ||
padding: const EdgeInsetsDirectional.only( | ||
start: ThemeProvider.margin08, | ||
), | ||
child: GestureDetector( | ||
onTap: onClose, | ||
child: Icon( | ||
Icons.close, | ||
color: context.theme.colors.prominent, | ||
size: ThemeProvider.iconSize16, | ||
), | ||
), | ||
), | ||
], | ||
), | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 2 additions & 1 deletion
3
packages/deriv_mobile_chart_wrapper/lib/src/models/indicator_tab_label.dart
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters