Skip to content

Commit

Permalink
Merge pull request #7 from SalihCanBinboga/develop
Browse files Browse the repository at this point in the history
Updated Doc & Added new prop
  • Loading branch information
SalihCanBinboga authored Apr 9, 2023
2 parents d10d21e + 4f4097d commit e7933fb
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 3 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
## 3.0.1

- feat: Added `enableLog` prop to `InfoPopupWidget`
- doc: Added package profile logo.

## 3.0.0

- fix: This fixes the issue of the InfoPopupWidget not updating when the popup content or a property of the InfoPopupWidget changes.
Expand Down
Binary file added assets/readme/package_profile.webp
Binary file not shown.
14 changes: 12 additions & 2 deletions lib/src/info_popup_widget.dart
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import 'package:flutter/foundation.dart';
import 'package:flutter/gestures.dart';
import 'package:flutter/material.dart';
import 'package:flutter/rendering.dart';
Expand Down Expand Up @@ -26,6 +27,7 @@ class InfoPopupWidget extends StatefulWidget {
this.contentMaxWidth,
this.enableHighlight = false,
this.highLightTheme,
this.enableLog = false,
super.key,
}) : assert(customContent == null || contentTitle == null,
'You can not use both customContent and contentTitle at the same time.');
Expand Down Expand Up @@ -78,6 +80,12 @@ class InfoPopupWidget extends StatefulWidget {
/// highlight is enabled or not.
final bool enableHighlight;

/// The [enableLog] is the boolean value that indicates whether the
/// log is enabled or not.
///
/// If the [enableLog] is true, the log will be shown in the console.
final bool enableLog;

/// The [highLightTheme] is the theme of the highlight. Can customize the
/// highlight border radius and the padding.
final HighLightTheme? highLightTheme;
Expand Down Expand Up @@ -192,8 +200,10 @@ class _InfoPopupWidgetState extends State<InfoPopupWidget> {
@override
void didUpdateWidget(InfoPopupWidget oldWidget) {
if (oldWidget.customContent != widget.customContent) {
print('Info Popup: You have changed the custom content. '
'Please restart the app to see the changes.');
if (widget.enableLog && kDebugMode) {
print('Info Popup: You have changed the custom content. '
'Please restart the app to see the changes.');
}
} else {
if (oldWidget.contentTitle != widget.contentTitle ||
oldWidget.areaBackgroundColor != widget.areaBackgroundColor ||
Expand Down
9 changes: 8 additions & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,14 @@
name: info_popup
description: The simple way to show the user some information on your selected widget.
version: 3.0.0
maintainer: Salih Can Binboga
homepage: https://github.com/salihcanbinboga/info_popup
repository: https://github.com/salihcanbinboga/info_popup
issue_tracker: https://github.com/salihcanbinboga/info_popup/issues
screenshots:
- description: "Info Popup Logo"
path: assets/readme/package_profile.webp

version: 3.0.1

environment:
sdk: '>=2.18.4 <3.0.0'
Expand Down

0 comments on commit e7933fb

Please sign in to comment.