Skip to content

Commit

Permalink
feat: release v0.6.0
Browse files Browse the repository at this point in the history
  • Loading branch information
robert-virkus committed Feb 6, 2023
1 parent cecede0 commit c6b4310
Show file tree
Hide file tree
Showing 7 changed files with 50 additions and 22 deletions.
7 changes: 7 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"cSpell.words": [
"autocorrect",
"autofocus",
"Cupertino"
]
}
5 changes: 4 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
## 0.6.0
- Thanks again to [Brendan](https://github.com/definitelyme) enough_platform_widgets is now compatible with Flutter 3.7.

## 0.5.0
- Thanks to [Brendan](https://github.com/definitelyme) enough_platform_widgets is now compatible with Flutter 3.3 .
- Thanks to [Brendan](https://github.com/definitelyme) enough_platform_widgets is now compatible with Flutter 3.3.

## 0.4.0
- Thanks to [fotiDim](https://github.com/fotiDim) `PlatformInkWell.pressColor` is now available to add tap effects visible on iOS.
Expand Down
5 changes: 2 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ More cross platform widgets for Flutter developers.

Based on these great packages:
* [flutter_platform_widgets](https://pub.dev/packages/flutter_platform_widgets)
* [cupertino_list_tile](https://pub.dev/packages/cupertino_list_tile)
* [cupertino_stepper](cupertino_stepper)

Licensed commercially friendly under the [MIT License](LICENSE).
Expand All @@ -15,14 +14,14 @@ Platform widgets use their material or cupertino equivalent based on the chosen

* `DecoratedPlatformTextField` provides a cross platform replacement for the material `TextField`
* `DialogHelper` helps to show platform specific dialogs
* `PlatformBottomBar` shows a `BottomAppBar` on materal and a `CupertinoBar` on cupertino
* `PlatformBottomBar` shows a `BottomAppBar` on material and a `CupertinoBar` on cupertino
* `PlatformCheckboxListTile` is a platform aware simple checkbox list tile
* `PlatformChip` a simple cross-platform `Chip` replacement
* `PlatformDialogActionButton` is a platform aware dialog action
* `PlatformDialogActionText` provides a platform aware dialog action text
* `DropdownButton` is a replacement for the material `DropdownButton`
* `PlatformFilledButtonIcon` uses an `ElevatedButton.filled` on material and a `CupertinoButton.filled` on cupertino
* `DensePlatformIconButton` replaces the material `IconButon`
* `DensePlatformIconButton` replaces the material `IconButton`
* `PlatformInkWell` is a rectangular area of a that responds to touch and is based either on `InkWell` or on `CupertinoInkWell`
* `PlatformListTile` provides either a `ListTile` or a `CupertinoListTile`
* `PlatformPageScaffold` provides a `PlatformScaffold` with the additional option to define a bottom bar.
Expand Down
16 changes: 10 additions & 6 deletions lib/src/platform/decorated_platform_textfield.dart
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ class DecoratedPlatformTextField extends StatelessWidget {
/// See also:
///
/// * [TextInputAction.next] and [TextInputAction.previous], which
/// automatically shift the focus to the next/previous focusable item when
/// automatically shift the focus to the next/previous focus-able item when
/// the user is done editing.
final ValueChanged<String>? onSubmitted;

Expand Down Expand Up @@ -250,8 +250,6 @@ class DecoratedPlatformTextField extends StatelessWidget {
/// The appearance of the keyboard.
///
/// This setting is only honored on iOS devices.
///
/// If unset, defaults to the brightness of [ThemeData.primaryColorBrightness].
final Brightness? keyboardAppearance;

/// {@macro flutter.widgets.editableText.scrollPadding}
Expand Down Expand Up @@ -506,8 +504,12 @@ class DecoratedPlatformTextField extends StatelessWidget {
obscureText: obscureText,
onChanged: onChanged,
keyboardAppearance: keyboardAppearance,
placeholder: cupertinoShowLabel ? decoration?.hintText : decoration?.labelText ?? decoration?.hintText,
prefix: decoration?.prefix ?? decoration?.prefixIcon ?? (cupertinoShowLabel ? null : icon),
placeholder: cupertinoShowLabel
? decoration?.hintText
: decoration?.labelText ?? decoration?.hintText,
prefix: decoration?.prefix ??
decoration?.prefixIcon ??
(cupertinoShowLabel ? null : icon),
suffix: decoration?.suffix ?? decoration?.suffixIcon,
suffixMode: cupertinoSuffixMode,
clearButtonMode: OverlayVisibilityMode.editing,
Expand Down Expand Up @@ -548,7 +550,9 @@ class DecoratedPlatformTextField extends StatelessWidget {
restorationId: restorationId,
);
final labelText = decoration?.labelText;
if (cupertinoShowLabel && cupertinoAlignLabelOnTop && labelText != null) {
if (cupertinoShowLabel &&
cupertinoAlignLabelOnTop &&
labelText != null) {
if (icon != null) {
content = Row(
mainAxisAlignment: MainAxisAlignment.start,
Expand Down
32 changes: 23 additions & 9 deletions lib/src/platform/dialog_helper.dart
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,9 @@ class DialogHelper {
content: Text(query),
actions: [
CupertinoDialogAction(
child: cancelActionText != null ? Text(cancelActionText) : Icon(CupertinoIcons.clear),
child: cancelActionText != null
? Text(cancelActionText)
: Icon(CupertinoIcons.clear),
onPressed: () => Navigator.of(context).pop(false),
),
CupertinoDialogAction(
Expand All @@ -49,9 +51,10 @@ class DialogHelper {
actionButtonStyle = TextButton.styleFrom(
backgroundColor: Colors.red,
disabledForegroundColor: Colors.white,
onSurface: Colors.white,
foregroundColor: Colors.white,
);
actionTextStyle = theme.textTheme.button!.copyWith(color: Colors.white);
actionTextStyle =
theme.textTheme.labelLarge?.copyWith(color: Colors.white);
}

return showDialog<bool>(
Expand All @@ -60,7 +63,9 @@ class DialogHelper {
content: Text(query),
actions: [
TextButton(
child: cancelActionText != null ? PlatformText(cancelActionText) : Icon(Icons.cancel),
child: cancelActionText != null
? PlatformText(cancelActionText)
: Icon(Icons.cancel),
onPressed: () => Navigator.of(context).pop(false),
),
TextButton(
Expand All @@ -87,7 +92,10 @@ class DialogHelper {
String? cancelActionText,
}) {
return showWidgetDialog(context, Text(text),
title: title, actions: actions, okActionText: okActionText, cancelActionText: cancelActionText);
title: title,
actions: actions,
okActionText: okActionText,
cancelActionText: cancelActionText);
}

/// Shows a dialog with the given [content].
Expand All @@ -106,15 +114,21 @@ class DialogHelper {
String? cancelActionText,
}) {
actions ??= [
if (defaultActions == DialogActions.cancel || defaultActions == DialogActions.okAndCancel) ...{
if (defaultActions == DialogActions.cancel ||
defaultActions == DialogActions.okAndCancel) ...{
PlatformTextButton(
child: cancelActionText != null ? PlatformText(cancelActionText) : Icon(CommonPlatformIcons.cancel),
child: cancelActionText != null
? PlatformText(cancelActionText)
: Icon(CommonPlatformIcons.cancel),
onPressed: () => Navigator.of(context).pop(false),
),
},
if (defaultActions == DialogActions.ok || defaultActions == DialogActions.okAndCancel) ...{
if (defaultActions == DialogActions.ok ||
defaultActions == DialogActions.okAndCancel) ...{
PlatformTextButton(
child: okActionText != null ? PlatformText(okActionText) : Icon(CommonPlatformIcons.ok),
child: okActionText != null
? PlatformText(okActionText)
: Icon(CommonPlatformIcons.ok),
onPressed: () => Navigator.of(context).pop(true),
),
},
Expand Down
5 changes: 3 additions & 2 deletions lib/src/platform/platform_dialog_action_text.dart
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,10 @@ class PlatformDialogActionText extends StatelessWidget {
actionButtonStyle = TextButton.styleFrom(
backgroundColor: Colors.red,
disabledForegroundColor: Colors.white,
onSurface: Colors.white,
foregroundColor: Colors.white,
);
actionTextStyle = theme.textTheme.button!.copyWith(color: Colors.white);
actionTextStyle =
theme.textTheme.labelLarge?.copyWith(color: Colors.white);
}
return TextButton(
child: Text(text.toUpperCase(), style: actionTextStyle),
Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: enough_platform_widgets
description: Useful platform aware widgets to bring a Material app to Cupertino.
version: 0.5.0
version: 0.6.0
homepage: https://github.com/Enough-Software/enough_platform_widgets

environment:
Expand Down

0 comments on commit c6b4310

Please sign in to comment.