Skip to content

Commit

Permalink
Bump Version + flutter_lints (#333)
Browse files Browse the repository at this point in the history
  • Loading branch information
bdlukaa authored May 13, 2022
2 parents e9d92a8 + a9a61fd commit 29f678a
Show file tree
Hide file tree
Showing 32 changed files with 124 additions and 116 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
Date format: DD/MM/YYYY

## [3.12.0] - Flutter 3.0 - [13/05/2022]

- Add support for Flutter 3.0 (Fixes [#186](https://github.com/bdlukaa/fluent_ui/issues/186), [#327](https://github.com/bdlukaa/fluent_ui/issues/327))

## [3.11.1] - [30/04/2022]

- Reworked `DropDownButton` ([#297](https://github.com/bdlukaa/fluent_ui/pull/297)):
Expand Down
6 changes: 5 additions & 1 deletion analysis_options.yaml
Original file line number Diff line number Diff line change
@@ -1 +1,5 @@
include: package:flutter_lints/flutter.yaml
include: package:flutter_lints/flutter.yaml

linter:
rules:
library_private_types_in_public_api: false
4 changes: 2 additions & 2 deletions example/pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ packages:
path: ".."
relative: true
source: path
version: "3.11.1"
version: "3.12.0"
flutter:
dependency: "direct main"
description: flutter
Expand Down Expand Up @@ -406,4 +406,4 @@ packages:
version: "3.1.0"
sdks:
dart: ">=2.17.0-0 <3.0.0"
flutter: ">=2.8.0"
flutter: ">=3.0.0"
2 changes: 1 addition & 1 deletion lib/src/app.dart
Original file line number Diff line number Diff line change
Expand Up @@ -542,8 +542,8 @@ class FluentScrollBehavior extends ScrollBehavior {
case TargetPlatform.macOS:
case TargetPlatform.windows:
return Scrollbar(
child: child,
controller: details.controller,
child: child,
);
case TargetPlatform.android:
case TargetPlatform.fuchsia:
Expand Down
8 changes: 4 additions & 4 deletions lib/src/controls/form/auto_suggest_box.dart
Original file line number Diff line number Diff line change
Expand Up @@ -481,10 +481,6 @@ class __AutoSuggestBoxOverlayTileState extends State<_AutoSuggestBoxOverlayTile>
),
alignment: AlignmentDirectional.centerStart,
child: EntrancePageTransition(
child: Text(
widget.text,
style: theme.typography.body,
),
animation: Tween<double>(
begin: 0.75,
end: 1.0,
Expand All @@ -493,6 +489,10 @@ class __AutoSuggestBoxOverlayTileState extends State<_AutoSuggestBoxOverlayTile>
curve: Curves.easeOut,
)),
vertical: true,
child: Text(
widget.text,
style: theme.typography.body,
),
),
),
if (states.isFocused)
Expand Down
32 changes: 16 additions & 16 deletions lib/src/controls/form/pickers/date_picker.dart
Original file line number Diff line number Diff line change
Expand Up @@ -515,6 +515,22 @@ class __DatePickerContentPopUpState extends State<_DatePickerContentPopUp> {
},
child: ListWheelScrollView(
controller: widget.yearController,
itemExtent: kOneLineTileHeight,
diameterRatio: kPickerDiameterRatio,
physics: const FixedExtentScrollPhysics(),
onSelectedItemChanged: (index) {
widget.handleDateChanged(DateTime(
widget.startYear + index + 1,
widget.date.month,
widget.date.day,
widget.date.hour,
widget.date.minute,
widget.date.second,
widget.date.millisecond,
widget.date.microsecond,
));
setState(() {});
},
children: List.generate(years, (index) {
// index++;
final realYear = widget.startYear + index + 1;
Expand All @@ -532,22 +548,6 @@ class __DatePickerContentPopUpState extends State<_DatePickerContentPopUp> {
),
);
}),
itemExtent: kOneLineTileHeight,
diameterRatio: kPickerDiameterRatio,
physics: const FixedExtentScrollPhysics(),
onSelectedItemChanged: (index) {
widget.handleDateChanged(DateTime(
widget.startYear + index + 1,
widget.date.month,
widget.date.day,
widget.date.hour,
widget.date.minute,
widget.date.second,
widget.date.millisecond,
widget.date.microsecond,
));
setState(() {});
},
),
);
}(),
Expand Down
8 changes: 4 additions & 4 deletions lib/src/controls/form/pickers/pickers.dart
Original file line number Diff line number Diff line change
Expand Up @@ -95,9 +95,9 @@ class YesNoPickerControl extends StatelessWidget {
margin: const EdgeInsets.all(4.0),
height: kOneLineTileHeight / 1.2,
child: Button(
child: const Icon(FluentIcons.check_mark),
onPressed: onChanged,
style: style(),
child: const Icon(FluentIcons.check_mark),
),
),
),
Expand All @@ -106,9 +106,9 @@ class YesNoPickerControl extends StatelessWidget {
margin: const EdgeInsets.all(4.0),
height: kOneLineTileHeight / 1.2,
child: Button(
child: const Icon(FluentIcons.chrome_close),
onPressed: onCancel,
style: style(),
child: const Icon(FluentIcons.chrome_close),
),
),
),
Expand Down Expand Up @@ -153,10 +153,10 @@ class PickerNavigatorIndicator extends StatelessWidget {
right: 0,
height: kOneLineTileHeight,
child: Button(
onPressed: onBackward,
child: const Center(
child: Icon(FluentIcons.chevron_up, size: 12),
),
onPressed: onBackward,
),
),
if (show)
Expand All @@ -166,10 +166,10 @@ class PickerNavigatorIndicator extends StatelessWidget {
right: 0,
height: kOneLineTileHeight,
child: Button(
onPressed: onForward,
child: const Center(
child: Icon(FluentIcons.chevron_down, size: 12),
),
onPressed: onForward,
),
),
]),
Expand Down
14 changes: 7 additions & 7 deletions lib/src/controls/form/pickers/time_picker.dart
Original file line number Diff line number Diff line change
Expand Up @@ -340,15 +340,15 @@ class __TimePickerContentPopupState extends State<_TimePickerContentPopup> {
diameterRatio: kPickerDiameterRatio,
physics: const FixedExtentScrollPhysics(),
onSelectedItemChanged: (index) {
int _hour = index + 1;
int hour = index + 1;
if (!widget.use24Format && !isAm) {
_hour += 12;
hour += 12;
}
widget.handleDateChanged(DateTime(
widget.date.year,
widget.date.month,
widget.date.day,
_hour,
hour,
widget.date.minute,
widget.date.second,
widget.date.millisecond,
Expand Down Expand Up @@ -452,22 +452,22 @@ class __TimePickerContentPopupState extends State<_TimePickerContentPopup> {
],
onSelectedItemChanged: (index) {
setState(() {});
int _hour = widget.date.hour;
int hour = widget.date.hour;
final isAm = index == 0;
if (!widget.use24Format) {
// If it was previously am and now it's pm
if (!isAm) {
_hour += 12;
hour += 12;
// If it was previously pm and now it's am
} else if (isAm) {
_hour -= 12;
hour -= 12;
}
}
widget.handleDateChanged(DateTime(
widget.date.year,
widget.date.month,
widget.date.day,
_hour,
hour,
widget.date.minute,
widget.date.second,
widget.date.millisecond,
Expand Down
2 changes: 1 addition & 1 deletion lib/src/controls/form/text_box.dart
Original file line number Diff line number Diff line change
Expand Up @@ -1047,9 +1047,9 @@ class _TextBoxState extends State<TextBox>
child: () {
if (widget.header != null) {
return InfoLabel(
child: listener,
label: widget.header!,
labelStyle: widget.headerStyle,
child: listener,
);
}
return listener;
Expand Down
2 changes: 1 addition & 1 deletion lib/src/controls/inputs/buttons/base.dart
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ class _BaseButtonState extends State<BaseButton> {
),
),
);
return FocusBorder(child: result, focused: states.isFocused);
return FocusBorder(focused: states.isFocused, child: result);
},
);

Expand Down
10 changes: 5 additions & 5 deletions lib/src/controls/inputs/dropdown_button.dart
Original file line number Diff line number Diff line change
Expand Up @@ -170,17 +170,17 @@ class _DropDownButtonState extends State<DropDownButton> {
widget.disabled ? null : flyoutController.open,
) ??
Button(
onPressed: widget.disabled ? null : flyoutController.open,
autofocus: widget.autofocus,
focusNode: widget.focusNode,
// ignore: deprecated_member_use_from_same_package
style: widget.buttonStyle,
child: Row(
mainAxisSize: MainAxisSize.min,
mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.center,
children: buttonChildren,
),
onPressed: widget.disabled ? null : flyoutController.open,
autofocus: widget.autofocus,
focusNode: widget.focusNode,
// ignore: deprecated_member_use_from_same_package
style: widget.buttonStyle,
);
}),
content: (context) {
Expand Down
2 changes: 1 addition & 1 deletion lib/src/controls/inputs/toggle_button.dart
Original file line number Diff line number Diff line change
Expand Up @@ -68,9 +68,9 @@ class ToggleButton extends StatelessWidget {
return Button(
autofocus: autofocus,
focusNode: focusNode,
child: Semantics(child: child, selected: checked),
onPressed: onChanged == null ? null : () => onChanged!(!checked),
style: checked ? theme.checkedButtonStyle : theme.uncheckedButtonStyle,
child: Semantics(selected: checked, child: child),
);
}
}
Expand Down
4 changes: 2 additions & 2 deletions lib/src/controls/inputs/toggle_switch.dart
Original file line number Diff line number Diff line change
Expand Up @@ -167,11 +167,11 @@ class _ToggleSwitchState extends State<ToggleSwitch> {
]);
}
return Semantics(
checked: widget.checked,
child: FocusBorder(
child: child,
focused: states.isFocused,
child: child,
),
checked: widget.checked,
);
},
);
Expand Down
12 changes: 6 additions & 6 deletions lib/src/controls/navigation/navigation_view/body.dart
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ class _NavigationBodyState extends State<NavigationBody> {
@override
Widget build(BuildContext context) {
assert(debugCheckHasFluentTheme(context));
final _body = InheritedNavigationView.maybeOf(context);
final body = InheritedNavigationView.maybeOf(context);
final theme = FluentTheme.of(context);
final NavigationPaneThemeData paneTheme = NavigationPaneTheme.of(context);
return Container(
Expand All @@ -135,21 +135,21 @@ class _NavigationBodyState extends State<NavigationBody> {
return widget.transitionBuilder!(child, animation);
}
bool useDrillTransition = true;
if (_body != null && _body.displayMode != null) {
if (_body.displayMode! == PaneDisplayMode.top) {
if (body != null && body.displayMode != null) {
if (body.displayMode! == PaneDisplayMode.top) {
useDrillTransition = false;
}
}
if (useDrillTransition) {
return DrillInPageTransition(
child: child,
animation: animation,
child: child,
);
} else {
return EntrancePageTransition(
child: child,
animation: animation,
vertical: true,
child: child,
);
}
},
Expand Down Expand Up @@ -221,12 +221,12 @@ class InheritedNavigationView extends InheritedWidget {
final current = InheritedNavigationView.maybeOf(context);
return InheritedNavigationView(
key: key,
child: child,
displayMode: displayMode ?? current?.displayMode,
minimalPaneOpen: minimalPaneOpen ?? current?.minimalPaneOpen ?? false,
currentItemIndex: currentItemIndex ?? current?.currentItemIndex ?? -1,
pane: pane ?? current?.pane,
oldIndex: oldIndex ?? current?.oldIndex ?? 0,
child: child,
);
});
}
Expand Down
6 changes: 3 additions & 3 deletions lib/src/controls/navigation/navigation_view/indicators.dart
Original file line number Diff line number Diff line change
Expand Up @@ -54,11 +54,11 @@ class NavigationIndicatorState<T extends NavigationIndicator> extends State<T> {

void fetch() {
WidgetsBinding.instance.addPostFrameCallback((timeStamp) {
final _offsets = pane.effectiveItems._getPaneItemsOffsets(
final localOffsets = pane.effectiveItems._getPaneItemsOffsets(
pane.paneKey,
);
if (mounted && (offsets != _offsets)) {
offsets = _offsets;
if (mounted && (offsets != localOffsets)) {
offsets = localOffsets;
}
});
}
Expand Down
30 changes: 15 additions & 15 deletions lib/src/controls/navigation/navigation_view/pane.dart
Original file line number Diff line number Diff line change
Expand Up @@ -524,30 +524,23 @@ class _TopNavigationPaneState extends State<_TopNavigationPane> {
),
Expanded(
child: DynamicOverflow(
children: _localItemHold.map((index) {
final item = widget.pane.items[index];
return SizedBox(
height: height,
child: _buildItem(context, item),
);
}).toList(),
overflowWidgetAlignment: MainAxisAlignment.start,
overflowWidget: Flyout(
controller: overflowController,
child: PaneItem(icon: const Icon(FluentIcons.more)).build(
context,
false,
overflowController.open,
showTextOnTop: false,
displayMode: PaneDisplayMode.top,
),
placement: FlyoutPlacement.end,
content: (context) => MenuFlyout(
items: _localItemHold.sublist(hiddenPaneItems.first).map((i) {
final item = widget.pane.items[i];
return buildMenuPaneItem(context, item);
}).toList(),
),
child: PaneItem(icon: const Icon(FluentIcons.more)).build(
context,
false,
overflowController.open,
showTextOnTop: false,
displayMode: PaneDisplayMode.top,
),
),
overflowChangedCallback: (hiddenItems) {
setState(() {
Expand All @@ -565,6 +558,13 @@ class _TopNavigationPaneState extends State<_TopNavigationPane> {
hiddenPaneItems = hiddenItems;
});
},
children: _localItemHold.map((index) {
final item = widget.pane.items[index];
return SizedBox(
height: height,
child: _buildItem(context, item),
);
}).toList(),
),
),
if (widget.pane.autoSuggestBox != null)
Expand Down Expand Up @@ -897,8 +897,8 @@ class _OpenNavigationPaneState extends State<_OpenNavigationPane>
menuButton,
Expanded(
child: Align(
child: widget.pane.header!,
alignment: Alignment.centerLeft,
child: widget.pane.header!,
),
),
]);
Expand Down
Loading

0 comments on commit 29f678a

Please sign in to comment.