diff --git a/frontend/app_flowy/lib/core/frameless_window.dart b/frontend/app_flowy/lib/core/frameless_window.dart index a7d6417cd3..3641aeef4d 100644 --- a/frontend/app_flowy/lib/core/frameless_window.dart +++ b/frontend/app_flowy/lib/core/frameless_window.dart @@ -31,10 +31,10 @@ class MoveWindowDetector extends StatefulWidget { final Widget? child; @override - _MoveWindowDetectorState createState() => _MoveWindowDetectorState(); + MoveWindowDetectorState createState() => MoveWindowDetectorState(); } -class _MoveWindowDetectorState extends State<MoveWindowDetector> { +class MoveWindowDetectorState extends State<MoveWindowDetector> { double winX = 0; double winY = 0; @@ -59,7 +59,8 @@ class _MoveWindowDetectorState extends State<MoveWindowDetector> { final double dy = windowPos[1]; final deltaX = details.globalPosition.dx - winX; final deltaY = details.globalPosition.dy - winY; - await CocoaWindowChannel.instance.setWindowPosition(Offset(dx + deltaX, dy - deltaY)); + await CocoaWindowChannel.instance + .setWindowPosition(Offset(dx + deltaX, dy - deltaY)); }, child: widget.child, ); diff --git a/frontend/app_flowy/lib/plugins/board/application/board_bloc.dart b/frontend/app_flowy/lib/plugins/board/application/board_bloc.dart index 53038c8d42..a71480c710 100644 --- a/frontend/app_flowy/lib/plugins/board/application/board_bloc.dart +++ b/frontend/app_flowy/lib/plugins/board/application/board_bloc.dart @@ -23,7 +23,7 @@ class BoardBloc extends Bloc<BoardEvent, BoardState> { final BoardDataController _gridDataController; late final AFBoardDataController boardController; final MoveRowFFIService _rowService; - LinkedHashMap<String, GroupController> groupControllers = LinkedHashMap.new(); + LinkedHashMap<String, GroupController> groupControllers = LinkedHashMap(); GridFieldCache get fieldCache => _gridDataController.fieldCache; String get gridId => _gridDataController.gridId; diff --git a/frontend/app_flowy/lib/plugins/board/application/board_data_controller.dart b/frontend/app_flowy/lib/plugins/board/application/board_data_controller.dart index 79f53093f1..2f9bdc24e0 100644 --- a/frontend/app_flowy/lib/plugins/board/application/board_data_controller.dart +++ b/frontend/app_flowy/lib/plugins/board/application/board_data_controller.dart @@ -52,7 +52,8 @@ class BoardDataController { BoardDataController({required ViewPB view}) : gridId = view.id, _listener = BoardListener(view.id), - _blocks = LinkedHashMap.new(), + // ignore: prefer_collection_literals + _blocks = LinkedHashMap(), _gridFFIService = GridFFIService(gridId: view.id), fieldCache = GridFieldCache(gridId: view.id); diff --git a/frontend/app_flowy/lib/plugins/board/application/card/board_date_cell_bloc.dart b/frontend/app_flowy/lib/plugins/board/application/card/board_date_cell_bloc.dart index 76267ededb..b1110f45cc 100644 --- a/frontend/app_flowy/lib/plugins/board/application/card/board_date_cell_bloc.dart +++ b/frontend/app_flowy/lib/plugins/board/application/card/board_date_cell_bloc.dart @@ -79,7 +79,7 @@ class BoardDateCellState with _$BoardDateCellState { String _dateStrFromCellData(DateCellDataPB? cellData) { String dateStr = ""; if (cellData != null) { - dateStr = cellData.date + " " + cellData.time; + dateStr = "${cellData.date} ${cellData.time}"; } return dateStr; } diff --git a/frontend/app_flowy/lib/plugins/board/presentation/card/board_select_option_cell.dart b/frontend/app_flowy/lib/plugins/board/presentation/card/board_select_option_cell.dart index 173f569f07..fb1cc15de6 100644 --- a/frontend/app_flowy/lib/plugins/board/presentation/card/board_select_option_cell.dart +++ b/frontend/app_flowy/lib/plugins/board/presentation/card/board_select_option_cell.dart @@ -65,7 +65,7 @@ class _BoardSelectOptionCellState extends State<BoardSelectOptionCell> { alignment: AlignmentDirectional.center, fit: StackFit.expand, children: [ - Wrap(children: children, spacing: 4, runSpacing: 2), + Wrap(spacing: 4, runSpacing: 2, children: children), _SelectOptionDialog( controller: widget.cellControllerBuilder.build(), ), diff --git a/frontend/app_flowy/lib/plugins/board/presentation/card/card_container.dart b/frontend/app_flowy/lib/plugins/board/presentation/card/card_container.dart index e3660d68f3..d28e6712c9 100644 --- a/frontend/app_flowy/lib/plugins/board/presentation/card/card_container.dart +++ b/frontend/app_flowy/lib/plugins/board/presentation/card/card_container.dart @@ -26,8 +26,8 @@ class BoardCardContainer extends StatelessWidget { final accessories = accessoryBuilder!(context); if (accessories.isNotEmpty) { container = _CardEnterRegion( - child: container, accessories: accessories, + child: container, ); } } @@ -78,9 +78,9 @@ class CardAccessoryContainer extends StatelessWidget { ), ); return GestureDetector( - child: hover, behavior: HitTestBehavior.opaque, onTap: () => accessory.onTap(context), + child: hover, ); }).toList(); diff --git a/frontend/app_flowy/lib/plugins/doc/presentation/banner.dart b/frontend/app_flowy/lib/plugins/doc/presentation/banner.dart index bd4b651da8..66c1f6dfba 100644 --- a/frontend/app_flowy/lib/plugins/doc/presentation/banner.dart +++ b/frontend/app_flowy/lib/plugins/doc/presentation/banner.dart @@ -40,11 +40,11 @@ class DocumentBanner extends StatelessWidget { downColor: theme.main1, outlineColor: Colors.white, borderRadius: Corners.s8Border, + onPressed: onRestore, child: FlowyText.medium( LocaleKeys.deletePagePrompt_restore.tr(), color: Colors.white, - fontSize: 14), - onPressed: onRestore), + fontSize: 14)), const HSpace(20), BaseStyledButton( minWidth: 220, @@ -55,11 +55,11 @@ class DocumentBanner extends StatelessWidget { downColor: theme.main1, outlineColor: Colors.white, borderRadius: Corners.s8Border, + onPressed: onDelete, child: FlowyText.medium( LocaleKeys.deletePagePrompt_deletePermanent.tr(), color: Colors.white, - fontSize: 14), - onPressed: onDelete), + fontSize: 14)), ], ), ), diff --git a/frontend/app_flowy/lib/plugins/doc/presentation/style_widgets.dart b/frontend/app_flowy/lib/plugins/doc/presentation/style_widgets.dart index 4f09b64053..8bbd5bc0d0 100644 --- a/frontend/app_flowy/lib/plugins/doc/presentation/style_widgets.dart +++ b/frontend/app_flowy/lib/plugins/doc/presentation/style_widgets.dart @@ -16,7 +16,10 @@ class EditorCheckboxBuilder extends QuillCheckboxBuilder { EditorCheckboxBuilder(this.theme); @override - Widget build({required BuildContext context, required bool isChecked, required ValueChanged<bool> onChanged}) { + Widget build( + {required BuildContext context, + required bool isChecked, + required ValueChanged<bool> onChanged}) { return FlowyEditorCheckbox( theme: theme, isChecked: isChecked, @@ -37,10 +40,10 @@ class FlowyEditorCheckbox extends StatefulWidget { }) : super(key: key); @override - _FlowyEditorCheckboxState createState() => _FlowyEditorCheckboxState(); + FlowyEditorCheckboxState createState() => FlowyEditorCheckboxState(); } -class _FlowyEditorCheckboxState extends State<FlowyEditorCheckbox> { +class FlowyEditorCheckboxState extends State<FlowyEditorCheckbox> { late bool isChecked; @override @@ -51,7 +54,9 @@ class _FlowyEditorCheckboxState extends State<FlowyEditorCheckbox> { @override Widget build(BuildContext context) { - final icon = isChecked ? svgWidget('editor/editor_check') : svgWidget('editor/editor_uncheck'); + final icon = isChecked + ? svgWidget('editor/editor_check') + : svgWidget('editor/editor_uncheck'); return Align( alignment: Alignment.centerLeft, child: FlowyIconButton( diff --git a/frontend/app_flowy/lib/plugins/doc/presentation/toolbar/check_button.dart b/frontend/app_flowy/lib/plugins/doc/presentation/toolbar/check_button.dart index 55f17ac558..280209c64a 100644 --- a/frontend/app_flowy/lib/plugins/doc/presentation/toolbar/check_button.dart +++ b/frontend/app_flowy/lib/plugins/doc/presentation/toolbar/check_button.dart @@ -28,10 +28,10 @@ class FlowyCheckListButton extends StatefulWidget { final String tooltipText; @override - _FlowyCheckListButtonState createState() => _FlowyCheckListButtonState(); + FlowyCheckListButtonState createState() => FlowyCheckListButtonState(); } -class _FlowyCheckListButtonState extends State<FlowyCheckListButton> { +class FlowyCheckListButtonState extends State<FlowyCheckListButton> { bool? _isToggled; Style get _selectionStyle => widget.controller.getSelectionStyle(); diff --git a/frontend/app_flowy/lib/plugins/doc/presentation/toolbar/color_picker.dart b/frontend/app_flowy/lib/plugins/doc/presentation/toolbar/color_picker.dart index 57299bd6cc..1f262483a8 100644 --- a/frontend/app_flowy/lib/plugins/doc/presentation/toolbar/color_picker.dart +++ b/frontend/app_flowy/lib/plugins/doc/presentation/toolbar/color_picker.dart @@ -24,10 +24,10 @@ class FlowyColorButton extends StatefulWidget { final QuillIconTheme? iconTheme; @override - _FlowyColorButtonState createState() => _FlowyColorButtonState(); + FlowyColorButtonState createState() => FlowyColorButtonState(); } -class _FlowyColorButtonState extends State<FlowyColorButton> { +class FlowyColorButtonState extends State<FlowyColorButton> { late bool _isToggledColor; late bool _isToggledBackground; late bool _isWhite; @@ -37,10 +37,14 @@ class _FlowyColorButtonState extends State<FlowyColorButton> { void _didChangeEditingValue() { setState(() { - _isToggledColor = _getIsToggledColor(widget.controller.getSelectionStyle().attributes); - _isToggledBackground = _getIsToggledBackground(widget.controller.getSelectionStyle().attributes); - _isWhite = _isToggledColor && _selectionStyle.attributes['color']!.value == '#ffffff'; - _isWhitebackground = _isToggledBackground && _selectionStyle.attributes['background']!.value == '#ffffff'; + _isToggledColor = + _getIsToggledColor(widget.controller.getSelectionStyle().attributes); + _isToggledBackground = _getIsToggledBackground( + widget.controller.getSelectionStyle().attributes); + _isWhite = _isToggledColor && + _selectionStyle.attributes['color']!.value == '#ffffff'; + _isWhitebackground = _isToggledBackground && + _selectionStyle.attributes['background']!.value == '#ffffff'; }); } @@ -49,8 +53,10 @@ class _FlowyColorButtonState extends State<FlowyColorButton> { super.initState(); _isToggledColor = _getIsToggledColor(_selectionStyle.attributes); _isToggledBackground = _getIsToggledBackground(_selectionStyle.attributes); - _isWhite = _isToggledColor && _selectionStyle.attributes['color']!.value == '#ffffff'; - _isWhitebackground = _isToggledBackground && _selectionStyle.attributes['background']!.value == '#ffffff'; + _isWhite = _isToggledColor && + _selectionStyle.attributes['color']!.value == '#ffffff'; + _isWhitebackground = _isToggledBackground && + _selectionStyle.attributes['background']!.value == '#ffffff'; widget.controller.addListener(_didChangeEditingValue); } @@ -69,9 +75,12 @@ class _FlowyColorButtonState extends State<FlowyColorButton> { oldWidget.controller.removeListener(_didChangeEditingValue); widget.controller.addListener(_didChangeEditingValue); _isToggledColor = _getIsToggledColor(_selectionStyle.attributes); - _isToggledBackground = _getIsToggledBackground(_selectionStyle.attributes); - _isWhite = _isToggledColor && _selectionStyle.attributes['color']!.value == '#ffffff'; - _isWhitebackground = _isToggledBackground && _selectionStyle.attributes['background']!.value == '#ffffff'; + _isToggledBackground = + _getIsToggledBackground(_selectionStyle.attributes); + _isWhite = _isToggledColor && + _selectionStyle.attributes['color']!.value == '#ffffff'; + _isWhitebackground = _isToggledBackground && + _selectionStyle.attributes['background']!.value == '#ffffff'; } } @@ -88,9 +97,10 @@ class _FlowyColorButtonState extends State<FlowyColorButton> { final fillColor = _isToggledColor && !widget.background && _isWhite ? stringToColor('#ffffff') : (widget.iconTheme?.iconUnselectedFillColor ?? theme.canvasColor); - final fillColorBackground = _isToggledBackground && widget.background && _isWhitebackground - ? stringToColor('#ffffff') - : (widget.iconTheme?.iconUnselectedFillColor ?? theme.canvasColor); + final fillColorBackground = + _isToggledBackground && widget.background && _isWhitebackground + ? stringToColor('#ffffff') + : (widget.iconTheme?.iconUnselectedFillColor ?? theme.canvasColor); return Tooltip( message: LocaleKeys.toolbar_highlight.tr(), @@ -99,7 +109,8 @@ class _FlowyColorButtonState extends State<FlowyColorButton> { highlightElevation: 0, hoverElevation: 0, size: widget.iconSize * kIconButtonFactor, - icon: Icon(widget.icon, size: widget.iconSize, color: theme.iconTheme.color), + icon: Icon(widget.icon, + size: widget.iconSize, color: theme.iconTheme.color), fillColor: widget.background ? fillColorBackground : fillColor, onPressed: _showColorPicker, ), @@ -112,13 +123,16 @@ class _FlowyColorButtonState extends State<FlowyColorButton> { hex = hex.substring(2); } hex = '#$hex'; - widget.controller.formatSelection(widget.background ? BackgroundAttribute(hex) : ColorAttribute(hex)); + widget.controller.formatSelection( + widget.background ? BackgroundAttribute(hex) : ColorAttribute(hex)); Navigator.of(context).pop(); } void _showColorPicker() { final style = widget.controller.getSelectionStyle(); - final values = style.values.where((v) => v.key == Attribute.background.key).map((v) => v.value); + final values = style.values + .where((v) => v.key == Attribute.background.key) + .map((v) => v.value); int initialColor = 0; if (values.isNotEmpty) { assert(values.length == 1); @@ -160,7 +174,9 @@ class FlowyColorPicker extends StatefulWidget { ]; final Function(Color?) onColorChanged; final int initialColor; - FlowyColorPicker({Key? key, required this.onColorChanged, this.initialColor = 0}) : super(key: key); + FlowyColorPicker( + {Key? key, required this.onColorChanged, this.initialColor = 0}) + : super(key: key); @override State<FlowyColorPicker> createState() => _FlowyColorPickerState(); @@ -178,8 +194,10 @@ class _FlowyColorPickerState extends State<FlowyColorPicker> { const double crossAxisSpacing = 10; final numberOfRows = (widget.colors.length / crossAxisCount).ceil(); - const perRowHeight = ((width - ((crossAxisCount - 1) * mainAxisSpacing)) / crossAxisCount); - final totalHeight = numberOfRows * perRowHeight + numberOfRows * crossAxisSpacing; + const perRowHeight = + ((width - ((crossAxisCount - 1) * mainAxisSpacing)) / crossAxisCount); + final totalHeight = + numberOfRows * perRowHeight + numberOfRows * crossAxisSpacing; return Container( constraints: BoxConstraints.tightFor(width: width, height: totalHeight), @@ -198,7 +216,8 @@ class _FlowyColorPickerState extends State<FlowyColorPicker> { delegate: SliverChildBuilderDelegate( (BuildContext context, int index) { if (widget.colors.length > index) { - final isSelected = widget.colors[index] == widget.initialColor; + final isSelected = + widget.colors[index] == widget.initialColor; return ColorItem( color: Color(widget.colors[index]), onPressed: widget.onColorChanged, @@ -242,7 +261,8 @@ class ColorItem extends StatelessWidget { ); } else { return RawMaterialButton( - shape: const CircleBorder(side: BorderSide(color: Colors.white, width: 8)) + + shape: const CircleBorder( + side: BorderSide(color: Colors.white, width: 8)) + CircleBorder(side: BorderSide(color: color, width: 4)), onPressed: () { if (isSelected) { diff --git a/frontend/app_flowy/lib/plugins/doc/presentation/toolbar/header_button.dart b/frontend/app_flowy/lib/plugins/doc/presentation/toolbar/header_button.dart index 427c5cf559..2db98b5af0 100644 --- a/frontend/app_flowy/lib/plugins/doc/presentation/toolbar/header_button.dart +++ b/frontend/app_flowy/lib/plugins/doc/presentation/toolbar/header_button.dart @@ -16,10 +16,10 @@ class FlowyHeaderStyleButton extends StatefulWidget { final double iconSize; @override - _FlowyHeaderStyleButtonState createState() => _FlowyHeaderStyleButtonState(); + FlowyHeaderStyleButtonState createState() => FlowyHeaderStyleButtonState(); } -class _FlowyHeaderStyleButtonState extends State<FlowyHeaderStyleButton> { +class FlowyHeaderStyleButtonState extends State<FlowyHeaderStyleButton> { Attribute? _value; Style get _selectionStyle => widget.controller.getSelectionStyle(); @@ -28,22 +28,27 @@ class _FlowyHeaderStyleButtonState extends State<FlowyHeaderStyleButton> { void initState() { super.initState(); setState(() { - _value = _selectionStyle.attributes[Attribute.header.key] ?? Attribute.header; + _value = + _selectionStyle.attributes[Attribute.header.key] ?? Attribute.header; }); widget.controller.addListener(_didChangeEditingValue); } @override Widget build(BuildContext context) { - final _valueToText = <Attribute, String>{ + final valueToText = <Attribute, String>{ Attribute.h1: 'H1', Attribute.h2: 'H2', Attribute.h3: 'H3', }; - final _valueAttribute = <Attribute>[Attribute.h1, Attribute.h2, Attribute.h3]; - final _valueString = <String>['H1', 'H2', 'H3']; - final _attributeImageName = <String>['editor/H1', 'editor/H2', 'editor/H3']; + final valueAttribute = <Attribute>[ + Attribute.h1, + Attribute.h2, + Attribute.h3 + ]; + final valueString = <String>['H1', 'H2', 'H3']; + final attributeImageName = <String>['editor/H1', 'editor/H2', 'editor/H3']; return Row( mainAxisSize: MainAxisSize.min, @@ -52,18 +57,18 @@ class _FlowyHeaderStyleButtonState extends State<FlowyHeaderStyleButton> { // _valueToText[_value] == _valueString[index] ? svg('editor/H1', color: Colors.white) : svg('editor/H1'); final headerTitle = "${LocaleKeys.toolbar_header.tr()} ${index + 1}"; - final _isToggled = _valueToText[_value] == _valueString[index]; + final isToggled = valueToText[_value] == valueString[index]; return ToolbarIconButton( onPressed: () { - if (_isToggled) { + if (isToggled) { widget.controller.formatSelection(Attribute.header); } else { - widget.controller.formatSelection(_valueAttribute[index]); + widget.controller.formatSelection(valueAttribute[index]); } }, width: widget.iconSize * kIconButtonFactor, - iconName: _attributeImageName[index], - isToggled: _isToggled, + iconName: attributeImageName[index], + isToggled: isToggled, tooltipText: headerTitle, ); }), @@ -72,7 +77,8 @@ class _FlowyHeaderStyleButtonState extends State<FlowyHeaderStyleButton> { void _didChangeEditingValue() { setState(() { - _value = _selectionStyle.attributes[Attribute.header.key] ?? Attribute.header; + _value = + _selectionStyle.attributes[Attribute.header.key] ?? Attribute.header; }); } @@ -82,7 +88,8 @@ class _FlowyHeaderStyleButtonState extends State<FlowyHeaderStyleButton> { if (oldWidget.controller != widget.controller) { oldWidget.controller.removeListener(_didChangeEditingValue); widget.controller.addListener(_didChangeEditingValue); - _value = _selectionStyle.attributes[Attribute.header.key] ?? Attribute.header; + _value = + _selectionStyle.attributes[Attribute.header.key] ?? Attribute.header; } } diff --git a/frontend/app_flowy/lib/plugins/doc/presentation/toolbar/link_button.dart b/frontend/app_flowy/lib/plugins/doc/presentation/toolbar/link_button.dart index 60b654302f..428c45e400 100644 --- a/frontend/app_flowy/lib/plugins/doc/presentation/toolbar/link_button.dart +++ b/frontend/app_flowy/lib/plugins/doc/presentation/toolbar/link_button.dart @@ -19,10 +19,10 @@ class FlowyLinkStyleButton extends StatefulWidget { final double iconSize; @override - _FlowyLinkStyleButtonState createState() => _FlowyLinkStyleButtonState(); + FlowyLinkStyleButtonState createState() => FlowyLinkStyleButtonState(); } -class _FlowyLinkStyleButtonState extends State<FlowyLinkStyleButton> { +class FlowyLinkStyleButtonState extends State<FlowyLinkStyleButton> { void _didChangeSelection() { setState(() {}); } @@ -75,7 +75,9 @@ class _FlowyLinkStyleButtonState extends State<FlowyLinkStyleButton> { void _openLinkDialog(BuildContext context) { final style = widget.controller.getSelectionStyle(); - final values = style.values.where((v) => v.key == Attribute.link.key).map((v) => v.value); + final values = style.values + .where((v) => v.key == Attribute.link.key) + .map((v) => v.value); String value = ""; if (values.isNotEmpty) { assert(values.length == 1); diff --git a/frontend/app_flowy/lib/plugins/doc/presentation/toolbar/toggle_button.dart b/frontend/app_flowy/lib/plugins/doc/presentation/toolbar/toggle_button.dart index 89fd72981d..2ecb98c3ea 100644 --- a/frontend/app_flowy/lib/plugins/doc/presentation/toolbar/toggle_button.dart +++ b/frontend/app_flowy/lib/plugins/doc/presentation/toolbar/toggle_button.dart @@ -21,10 +21,10 @@ class FlowyToggleStyleButton extends StatefulWidget { }) : super(key: key); @override - _ToggleStyleButtonState createState() => _ToggleStyleButtonState(); + ToggleStyleButtonState createState() => ToggleStyleButtonState(); } -class _ToggleStyleButtonState extends State<FlowyToggleStyleButton> { +class ToggleStyleButtonState extends State<FlowyToggleStyleButton> { bool? _isToggled; Style get _selectionStyle => widget.controller.getSelectionStyle(); @override @@ -77,6 +77,8 @@ class _ToggleStyleButtonState extends State<FlowyToggleStyleButton> { } void _toggleAttribute() { - widget.controller.formatSelection(_isToggled! ? Attribute.clone(widget.attribute, null) : widget.attribute); + widget.controller.formatSelection(_isToggled! + ? Attribute.clone(widget.attribute, null) + : widget.attribute); } } diff --git a/frontend/app_flowy/lib/plugins/doc/presentation/toolbar/tool_bar.dart b/frontend/app_flowy/lib/plugins/doc/presentation/toolbar/tool_bar.dart index 8dae41f986..d649340066 100644 --- a/frontend/app_flowy/lib/plugins/doc/presentation/toolbar/tool_bar.dart +++ b/frontend/app_flowy/lib/plugins/doc/presentation/toolbar/tool_bar.dart @@ -32,7 +32,8 @@ class EditorToolbar extends StatelessWidget implements PreferredSizeWidget { return Container( color: Theme.of(context).canvasColor, constraints: BoxConstraints.tightFor(height: preferredSize.height), - child: ToolbarButtonList(buttons: children).padding(horizontal: 4, vertical: 4), + child: ToolbarButtonList(buttons: children) + .padding(horizontal: 4, vertical: 4), ); } @@ -168,10 +169,11 @@ class ToolbarButtonList extends StatefulWidget { final List<Widget> buttons; @override - _ToolbarButtonListState createState() => _ToolbarButtonListState(); + ToolbarButtonListState createState() => ToolbarButtonListState(); } -class _ToolbarButtonListState extends State<ToolbarButtonList> with WidgetsBindingObserver { +class ToolbarButtonListState extends State<ToolbarButtonList> + with WidgetsBindingObserver { final ScrollController _controller = ScrollController(); bool _showLeftArrow = false; bool _showRightArrow = false; @@ -196,7 +198,8 @@ class _ToolbarButtonListState extends State<ToolbarButtonList> with WidgetsBindi return LayoutBuilder( builder: (BuildContext context, BoxConstraints constraints) { List<Widget> children = []; - double width = (widget.buttons.length + 2) * defaultIconSize * kIconButtonFactor; + double width = + (widget.buttons.length + 2) * defaultIconSize * kIconButtonFactor; final isFit = constraints.maxWidth > width; if (!isFit) { children.add(_buildLeftArrow()); @@ -233,8 +236,10 @@ class _ToolbarButtonListState extends State<ToolbarButtonList> with WidgetsBindi void _handleScroll() { if (!mounted) return; setState(() { - _showLeftArrow = _controller.position.minScrollExtent != _controller.position.pixels; - _showRightArrow = _controller.position.maxScrollExtent != _controller.position.pixels; + _showLeftArrow = + _controller.position.minScrollExtent != _controller.position.pixels; + _showRightArrow = + _controller.position.maxScrollExtent != _controller.position.pixels; }); } diff --git a/frontend/app_flowy/lib/plugins/grid/application/cell/cell_service/cell_service.dart b/frontend/app_flowy/lib/plugins/grid/application/cell/cell_service/cell_service.dart index bb750b4b89..48e82cc906 100644 --- a/frontend/app_flowy/lib/plugins/grid/application/cell/cell_service/cell_service.dart +++ b/frontend/app_flowy/lib/plugins/grid/application/cell/cell_service/cell_service.dart @@ -71,6 +71,6 @@ class GridCellIdentifier with _$GridCellIdentifier { FieldType get fieldType => field.fieldType; ValueKey key() { - return ValueKey(rowId + fieldId + "${field.fieldType}"); + return ValueKey("$rowId$fieldId${field.fieldType}"); } } diff --git a/frontend/app_flowy/lib/plugins/grid/application/cell/date_cal_bloc.dart b/frontend/app_flowy/lib/plugins/grid/application/cell/date_cal_bloc.dart index c0584a084b..a7124b7a3d 100644 --- a/frontend/app_flowy/lib/plugins/grid/application/cell/date_cal_bloc.dart +++ b/frontend/app_flowy/lib/plugins/grid/application/cell/date_cal_bloc.dart @@ -119,13 +119,13 @@ class DateCalBloc extends Bloc<DateCalEvent, DateCalState> { } String timeFormatPrompt(FlowyError error) { - String msg = LocaleKeys.grid_field_invalidTimeFormat.tr() + ". "; + String msg = "${LocaleKeys.grid_field_invalidTimeFormat.tr()}. "; switch (state.dateTypeOptionPB.timeFormat) { case TimeFormat.TwelveHour: - msg = msg + "e.g. 01: 00 AM"; + msg = "${msg}e.g. 01: 00 AM"; break; case TimeFormat.TwentyFourHour: - msg = msg + "e.g. 13: 00"; + msg = "${msg}e.g. 13: 00"; break; default: break; diff --git a/frontend/app_flowy/lib/plugins/grid/application/cell/date_cell_bloc.dart b/frontend/app_flowy/lib/plugins/grid/application/cell/date_cell_bloc.dart index 4150093275..4d453eca25 100644 --- a/frontend/app_flowy/lib/plugins/grid/application/cell/date_cell_bloc.dart +++ b/frontend/app_flowy/lib/plugins/grid/application/cell/date_cell_bloc.dart @@ -79,7 +79,7 @@ class DateCellState with _$DateCellState { String _dateStrFromCellData(DateCellDataPB? cellData) { String dateStr = ""; if (cellData != null) { - dateStr = cellData.date + " " + cellData.time; + dateStr = "${cellData.date} ${cellData.time}"; } return dateStr; } diff --git a/frontend/app_flowy/lib/plugins/grid/application/cell/select_option_editor_bloc.dart b/frontend/app_flowy/lib/plugins/grid/application/cell/select_option_editor_bloc.dart index 8d52252e2a..349d95d13f 100644 --- a/frontend/app_flowy/lib/plugins/grid/application/cell/select_option_editor_bloc.dart +++ b/frontend/app_flowy/lib/plugins/grid/application/cell/select_option_editor_bloc.dart @@ -1,12 +1,14 @@ import 'dart:async'; + +import 'package:app_flowy/plugins/grid/application/cell/cell_service/cell_service.dart'; +import 'package:collection/collection.dart'; import 'package:dartz/dartz.dart'; import 'package:flowy_sdk/log.dart'; import 'package:flowy_sdk/protobuf/flowy-grid/select_option.pb.dart'; import 'package:flutter_bloc/flutter_bloc.dart'; import 'package:freezed_annotation/freezed_annotation.dart'; -import 'package:app_flowy/plugins/grid/application/cell/cell_service/cell_service.dart'; + import 'select_option_service.dart'; -import 'package:collection/collection.dart'; part 'select_option_editor_bloc.freezed.dart'; diff --git a/frontend/app_flowy/lib/plugins/grid/application/grid_data_controller.dart b/frontend/app_flowy/lib/plugins/grid/application/grid_data_controller.dart index f11db25167..55733b9b7b 100644 --- a/frontend/app_flowy/lib/plugins/grid/application/grid_data_controller.dart +++ b/frontend/app_flowy/lib/plugins/grid/application/grid_data_controller.dart @@ -46,7 +46,8 @@ class GridDataController { GridDataController({required ViewPB view}) : gridId = view.id, - _blocks = LinkedHashMap.new(), + // ignore: prefer_collection_literals + _blocks = LinkedHashMap(), _gridFFIService = GridFFIService(gridId: view.id), fieldCache = GridFieldCache(gridId: view.id); diff --git a/frontend/app_flowy/lib/plugins/grid/application/row/row_cache.dart b/frontend/app_flowy/lib/plugins/grid/application/row/row_cache.dart index d6cd387e74..618d73cbc1 100644 --- a/frontend/app_flowy/lib/plugins/grid/application/row/row_cache.dart +++ b/frontend/app_flowy/lib/plugins/grid/application/row/row_cache.dart @@ -210,7 +210,8 @@ class GridRowCache { } GridCellMap _makeGridCells(String rowId, RowPB? row) { - var cellDataMap = GridCellMap.new(); + // ignore: prefer_collection_literals + var cellDataMap = GridCellMap(); for (final field in _fieldNotifier.fields) { if (field.visibility) { cellDataMap[field.id] = GridCellIdentifier( diff --git a/frontend/app_flowy/lib/plugins/grid/presentation/widgets/cell/cell_accessory.dart b/frontend/app_flowy/lib/plugins/grid/presentation/widgets/cell/cell_accessory.dart index 9b3f281130..8a88316473 100644 --- a/frontend/app_flowy/lib/plugins/grid/presentation/widgets/cell/cell_accessory.dart +++ b/frontend/app_flowy/lib/plugins/grid/presentation/widgets/cell/cell_accessory.dart @@ -190,12 +190,12 @@ class CellAccessoryContainer extends StatelessWidget { ), ); return GestureDetector( - child: hover, behavior: HitTestBehavior.opaque, onTap: () => accessory.onTap(), + child: hover, ); }).toList(); - return Wrap(children: children, spacing: 6); + return Wrap(spacing: 6, children: children); } } diff --git a/frontend/app_flowy/lib/plugins/grid/presentation/widgets/cell/cell_container.dart b/frontend/app_flowy/lib/plugins/grid/presentation/widgets/cell/cell_container.dart index ed09ec3f36..eea58775dd 100644 --- a/frontend/app_flowy/lib/plugins/grid/presentation/widgets/cell/cell_container.dart +++ b/frontend/app_flowy/lib/plugins/grid/presentation/widgets/cell/cell_container.dart @@ -44,8 +44,8 @@ class CellContainer extends StatelessWidget { if (accessories.isNotEmpty) { container = _GridCellEnterRegion( - child: container, accessories: accessories, + child: container, ); } } diff --git a/frontend/app_flowy/lib/plugins/grid/presentation/widgets/cell/date_cell/date_editor.dart b/frontend/app_flowy/lib/plugins/grid/presentation/widgets/cell/date_cell/date_editor.dart index f6ddf42fba..d1289b93f2 100644 --- a/frontend/app_flowy/lib/plugins/grid/presentation/widgets/cell/date_cell/date_editor.dart +++ b/frontend/app_flowy/lib/plugins/grid/presentation/widgets/cell/date_cell/date_editor.dart @@ -48,8 +48,8 @@ class DateCellEditor with FlowyOverlayDelegate { FlowyOverlay.of(context).insertWithAnchor( widget: OverlayContainer( - child: calendar, constraints: BoxConstraints.loose(const Size(320, 500)), + child: calendar, ), identifier: DateCellEditor.identifier(), anchorContext: context, @@ -304,9 +304,7 @@ class _DateTypeOptionButton extends StatelessWidget { @override Widget build(BuildContext context) { final theme = context.watch<AppTheme>(); - final title = LocaleKeys.grid_field_dateFormat.tr() + - " &" + - LocaleKeys.grid_field_timeFormat.tr(); + final title = "${LocaleKeys.grid_field_dateFormat.tr()} &${LocaleKeys.grid_field_timeFormat.tr()}"; return BlocSelector<DateCalBloc, DateCalState, DateTypeOptionPB>( selector: (state) => state.dateTypeOptionPB, builder: (context, dateTypeOptionPB) { @@ -349,8 +347,8 @@ class _CalDateTimeSetting extends StatefulWidget { hide(context); FlowyOverlay.of(context).insertWithAnchor( widget: OverlayContainer( - child: this, constraints: BoxConstraints.loose(const Size(140, 100)), + child: this, ), identifier: _CalDateTimeSetting.identifier(), anchorContext: context, @@ -415,8 +413,8 @@ class _CalDateTimeSettingState extends State<_CalDateTimeSetting> { overlayIdentifier = child.toString(); FlowyOverlay.of(context).insertWithAnchor( widget: OverlayContainer( - child: child, constraints: BoxConstraints.loose(const Size(460, 440)), + child: child, ), identifier: overlayIdentifier!, anchorContext: context, diff --git a/frontend/app_flowy/lib/plugins/grid/presentation/widgets/cell/select_option_cell/select_option_cell.dart b/frontend/app_flowy/lib/plugins/grid/presentation/widgets/cell/select_option_cell/select_option_cell.dart index a8d3993a2f..c771586e70 100644 --- a/frontend/app_flowy/lib/plugins/grid/presentation/widgets/cell/select_option_cell/select_option_cell.dart +++ b/frontend/app_flowy/lib/plugins/grid/presentation/widgets/cell/select_option_cell/select_option_cell.dart @@ -163,14 +163,14 @@ class SelectOptionWrap extends StatelessWidget { child = Align( alignment: Alignment.centerLeft, child: Wrap( + spacing: 4, + runSpacing: 2, children: selectOptions .map((option) => SelectOptionTag.fromOption( context: context, option: option, )) .toList(), - spacing: 4, - runSpacing: 2, ), ); } diff --git a/frontend/app_flowy/lib/plugins/grid/presentation/widgets/cell/select_option_cell/select_option_editor.dart b/frontend/app_flowy/lib/plugins/grid/presentation/widgets/cell/select_option_cell/select_option_editor.dart index c07eef5617..ef0dab83c9 100644 --- a/frontend/app_flowy/lib/plugins/grid/presentation/widgets/cell/select_option_cell/select_option_editor.dart +++ b/frontend/app_flowy/lib/plugins/grid/presentation/widgets/cell/select_option_cell/select_option_editor.dart @@ -72,8 +72,8 @@ class SelectOptionCellEditor extends StatelessWidget with FlowyOverlayDelegate { // FlowyOverlay.of(context).insertWithAnchor( widget: OverlayContainer( - child: SizedBox(width: _editorPannelWidth, child: editor), constraints: BoxConstraints.loose(const Size(_editorPannelWidth, 300)), + child: SizedBox(width: _editorPannelWidth, child: editor), ), identifier: SelectOptionCellEditor.identifier(), anchorContext: context, @@ -289,8 +289,8 @@ class _SelectOptionCell extends StatelessWidget { FlowyOverlay.of(context).remove(overlayIdentifier); FlowyOverlay.of(context).insertWithAnchor( widget: OverlayContainer( - child: pannel, constraints: BoxConstraints.loose(const Size(200, 300)), + child: pannel, ), identifier: overlayIdentifier, anchorContext: context, diff --git a/frontend/app_flowy/lib/plugins/grid/presentation/widgets/cell/select_option_cell/text_field.dart b/frontend/app_flowy/lib/plugins/grid/presentation/widgets/cell/select_option_cell/text_field.dart index 5482a403cc..022d411f2b 100644 --- a/frontend/app_flowy/lib/plugins/grid/presentation/widgets/cell/select_option_cell/text_field.dart +++ b/frontend/app_flowy/lib/plugins/grid/presentation/widgets/cell/select_option_cell/text_field.dart @@ -108,7 +108,7 @@ class SelectOptionTextField extends StatelessWidget { child: SingleChildScrollView( controller: sc, scrollDirection: Axis.horizontal, - child: Wrap(children: children, spacing: 4), + child: Wrap(spacing: 4, children: children), ), ); } diff --git a/frontend/app_flowy/lib/plugins/grid/presentation/widgets/cell/url_cell/cell_editor.dart b/frontend/app_flowy/lib/plugins/grid/presentation/widgets/cell/url_cell/cell_editor.dart index e68ac720a3..b9e0f1ef48 100644 --- a/frontend/app_flowy/lib/plugins/grid/presentation/widgets/cell/url_cell/cell_editor.dart +++ b/frontend/app_flowy/lib/plugins/grid/presentation/widgets/cell/url_cell/cell_editor.dart @@ -30,11 +30,11 @@ class URLCellEditor extends StatefulWidget with FlowyOverlayDelegate { // FlowyOverlay.of(context).insertWithAnchor( widget: OverlayContainer( + constraints: BoxConstraints.loose(const Size(300, 160)), child: SizedBox( width: 200, child: Padding(padding: const EdgeInsets.all(6), child: editor), ), - constraints: BoxConstraints.loose(const Size(300, 160)), ), identifier: URLCellEditor.identifier(), anchorContext: context, diff --git a/frontend/app_flowy/lib/plugins/grid/presentation/widgets/header/field_cell_action_sheet.dart b/frontend/app_flowy/lib/plugins/grid/presentation/widgets/header/field_cell_action_sheet.dart index cd884cd557..9ea8b56b77 100644 --- a/frontend/app_flowy/lib/plugins/grid/presentation/widgets/header/field_cell_action_sheet.dart +++ b/frontend/app_flowy/lib/plugins/grid/presentation/widgets/header/field_cell_action_sheet.dart @@ -24,8 +24,8 @@ class GridFieldCellActionSheet extends StatelessWidget void show(BuildContext overlayContext) { FlowyOverlay.of(overlayContext).insertWithAnchor( widget: OverlayContainer( - child: this, constraints: BoxConstraints.loose(const Size(240, 200)), + child: this, ), identifier: GridFieldCellActionSheet.identifier(), anchorContext: overlayContext, diff --git a/frontend/app_flowy/lib/plugins/grid/presentation/widgets/header/field_editor.dart b/frontend/app_flowy/lib/plugins/grid/presentation/widgets/header/field_editor.dart index efa70bb81a..3f497d3304 100644 --- a/frontend/app_flowy/lib/plugins/grid/presentation/widgets/header/field_editor.dart +++ b/frontend/app_flowy/lib/plugins/grid/presentation/widgets/header/field_editor.dart @@ -56,8 +56,8 @@ class FieldEditor extends StatelessWidget with FlowyOverlayDelegate { FlowyOverlay.of(context).remove(identifier()); FlowyOverlay.of(context).insertWithAnchor( widget: OverlayContainer( - child: this, constraints: BoxConstraints.loose(const Size(280, 400)), + child: this, ), identifier: identifier(), anchorContext: context, diff --git a/frontend/app_flowy/lib/plugins/grid/presentation/widgets/header/field_type_option_editor.dart b/frontend/app_flowy/lib/plugins/grid/presentation/widgets/header/field_type_option_editor.dart index 20440235cb..d9e5eb4f38 100644 --- a/frontend/app_flowy/lib/plugins/grid/presentation/widgets/header/field_type_option_editor.dart +++ b/frontend/app_flowy/lib/plugins/grid/presentation/widgets/header/field_type_option_editor.dart @@ -110,8 +110,8 @@ class _FieldTypeOptionEditorState extends State<FieldTypeOptionEditor> { currentOverlayIdentifier = identifier; FlowyOverlay.of(context).insertWithAnchor( widget: OverlayContainer( - child: child, constraints: BoxConstraints.loose(const Size(460, 440)), + child: child, ), identifier: identifier, anchorContext: context, diff --git a/frontend/app_flowy/lib/plugins/grid/presentation/widgets/header/type_option/number.dart b/frontend/app_flowy/lib/plugins/grid/presentation/widgets/header/type_option/number.dart index d15be4a6a0..590a025a41 100644 --- a/frontend/app_flowy/lib/plugins/grid/presentation/widgets/header/type_option/number.dart +++ b/frontend/app_flowy/lib/plugins/grid/presentation/widgets/header/type_option/number.dart @@ -90,10 +90,10 @@ class NumberTypeOptionWidget extends TypeOptionWidget { } } -typedef _SelectNumberFormatCallback = Function(NumberFormat format); +typedef SelectNumberFormatCallback = Function(NumberFormat format); class NumberFormatList extends StatelessWidget { - final _SelectNumberFormatCallback onSelected; + final SelectNumberFormatCallback onSelected; final NumberFormat selectedFormat; const NumberFormatList( {required this.selectedFormat, required this.onSelected, Key? key}) diff --git a/frontend/app_flowy/lib/plugins/grid/presentation/widgets/row/grid_row.dart b/frontend/app_flowy/lib/plugins/grid/presentation/widgets/row/grid_row.dart index d560f03fc0..55ec7b9832 100755 --- a/frontend/app_flowy/lib/plugins/grid/presentation/widgets/row/grid_row.dart +++ b/frontend/app_flowy/lib/plugins/grid/presentation/widgets/row/grid_row.dart @@ -190,7 +190,6 @@ class RowContent extends StatelessWidget { return CellContainer( width: cellId.field.width.toDouble(), - child: child, rowStateNotifier: Provider.of<RegionStateNotifier>(context, listen: false), accessoryBuilder: (buildContext) { @@ -208,6 +207,7 @@ class RowContent extends StatelessWidget { } return accessories; }, + child: child, ); }, ).toList(); diff --git a/frontend/app_flowy/lib/plugins/grid/presentation/widgets/row/row_action_sheet.dart b/frontend/app_flowy/lib/plugins/grid/presentation/widgets/row/row_action_sheet.dart index b4390d098f..8c828ec627 100644 --- a/frontend/app_flowy/lib/plugins/grid/presentation/widgets/row/row_action_sheet.dart +++ b/frontend/app_flowy/lib/plugins/grid/presentation/widgets/row/row_action_sheet.dart @@ -59,8 +59,8 @@ class GridRowActionSheet extends StatelessWidget { }) { FlowyOverlay.of(overlayContext).insertWithAnchor( widget: OverlayContainer( - child: this, constraints: BoxConstraints.loose(const Size(140, 200)), + child: this, ), identifier: GridRowActionSheet.identifier(), anchorContext: overlayContext, diff --git a/frontend/app_flowy/lib/plugins/grid/presentation/widgets/row/row_detail.dart b/frontend/app_flowy/lib/plugins/grid/presentation/widgets/row/row_detail.dart index d1ea79b6d1..7d07e9fa3f 100644 --- a/frontend/app_flowy/lib/plugins/grid/presentation/widgets/row/row_detail.dart +++ b/frontend/app_flowy/lib/plugins/grid/presentation/widgets/row/row_detail.dart @@ -38,8 +38,8 @@ class RowDetailPage extends StatefulWidget with FlowyOverlayDelegate { final size = windowSize * 0.5; FlowyOverlay.of(context).insertWithRect( widget: OverlayContainer( - child: this, constraints: BoxConstraints.tight(size), + child: this, ), identifier: RowDetailPage.identifier(), anchorPosition: Offset(-size.width / 2.0, -size.height / 2.0), @@ -156,9 +156,9 @@ class _RowDetailCell extends StatelessWidget { behavior: HitTestBehavior.translucent, onTap: () => cell.beginFocus.notify(), child: AccessoryHover( - child: cell, contentPadding: const EdgeInsets.symmetric(horizontal: 10, vertical: 12), + child: cell, ), ); diff --git a/frontend/app_flowy/lib/plugins/grid/presentation/widgets/toolbar/grid_property.dart b/frontend/app_flowy/lib/plugins/grid/presentation/widgets/toolbar/grid_property.dart index 02230e5139..08ba3dcd08 100644 --- a/frontend/app_flowy/lib/plugins/grid/presentation/widgets/toolbar/grid_property.dart +++ b/frontend/app_flowy/lib/plugins/grid/presentation/widgets/toolbar/grid_property.dart @@ -30,8 +30,8 @@ class GridPropertyList extends StatelessWidget with FlowyOverlayDelegate { void show(BuildContext context) { FlowyOverlay.of(context).insertWithAnchor( widget: OverlayContainer( - child: this, constraints: BoxConstraints.loose(const Size(260, 400)), + child: this, ), identifier: identifier(), anchorContext: context, diff --git a/frontend/app_flowy/lib/plugins/grid/presentation/widgets/toolbar/grid_setting.dart b/frontend/app_flowy/lib/plugins/grid/presentation/widgets/toolbar/grid_setting.dart index f555b6266a..289d84141f 100644 --- a/frontend/app_flowy/lib/plugins/grid/presentation/widgets/toolbar/grid_setting.dart +++ b/frontend/app_flowy/lib/plugins/grid/presentation/widgets/toolbar/grid_setting.dart @@ -53,8 +53,8 @@ class GridSettingList extends StatelessWidget { FlowyOverlay.of(context).insertWithAnchor( widget: OverlayContainer( - child: list, constraints: BoxConstraints.loose(const Size(140, 400)), + child: list, ), identifier: list.identifier(), anchorContext: context, diff --git a/frontend/app_flowy/lib/plugins/trash/trash.dart b/frontend/app_flowy/lib/plugins/trash/trash.dart index 0d17091581..c1622d5b20 100644 --- a/frontend/app_flowy/lib/plugins/trash/trash.dart +++ b/frontend/app_flowy/lib/plugins/trash/trash.dart @@ -91,12 +91,12 @@ class _TrashPageState extends State<TrashPage> { builder: (context, state) { return SizedBox.expand( child: Column( + mainAxisAlignment: MainAxisAlignment.start, children: [ _renderTopBar(context, theme, state), const VSpace(32), _renderTrashList(context, state), ], - mainAxisAlignment: MainAxisAlignment.start, ).padding(horizontal: horizontalPadding, vertical: 48), ); }, diff --git a/frontend/app_flowy/lib/startup/tasks/app_widget.dart b/frontend/app_flowy/lib/startup/tasks/app_widget.dart index 6dae04a1c0..dd9e1f0850 100644 --- a/frontend/app_flowy/lib/startup/tasks/app_widget.dart +++ b/frontend/app_flowy/lib/startup/tasks/app_widget.dart @@ -20,39 +20,35 @@ class InitAppWidgetTask extends LaunchTask { final setting = await UserSettingsService().getAppearanceSettings(); final settingModel = AppearanceSettingModel(setting); final app = ApplicationWidget( - child: widget, settingModel: settingModel, + child: widget, ); - BlocOverrides.runZoned( - () { - runApp( - EasyLocalization( - supportedLocales: const [ - // In alphabetical order - Locale('ca', 'ES'), - Locale('de', 'DE'), - Locale('en'), - Locale('es', 'VE'), - Locale('fr', 'FR'), - Locale('fr', 'CA'), - Locale('hu', 'HU'), - Locale('id', 'ID'), - Locale('it', 'IT'), - Locale('ja', 'JP'), - Locale('pl', 'PL'), - Locale('pt', 'BR'), - Locale('ru', 'RU'), - Locale('tr', 'TR'), - Locale('zh', 'CN'), - ], - path: 'assets/translations', - fallbackLocale: const Locale('en'), - saveLocale: false, - child: app, - ), - ); - }, - blocObserver: ApplicationBlocObserver(), + Bloc.observer = ApplicationBlocObserver(); + runApp( + EasyLocalization( + supportedLocales: const [ + // In alphabetical order + Locale('ca', 'ES'), + Locale('de', 'DE'), + Locale('en'), + Locale('es', 'VE'), + Locale('fr', 'FR'), + Locale('fr', 'CA'), + Locale('hu', 'HU'), + Locale('id', 'ID'), + Locale('it', 'IT'), + Locale('ja', 'JP'), + Locale('pl', 'PL'), + Locale('pt', 'BR'), + Locale('ru', 'RU'), + Locale('tr', 'TR'), + Locale('zh', 'CN'), + ], + path: 'assets/translations', + fallbackLocale: const Locale('en'), + saveLocale: false, + child: app, + ), ); return Future(() => {}); diff --git a/frontend/app_flowy/lib/user/presentation/router.dart b/frontend/app_flowy/lib/user/presentation/router.dart index 2928154ebe..82ff46ada9 100644 --- a/frontend/app_flowy/lib/user/presentation/router.dart +++ b/frontend/app_flowy/lib/user/presentation/router.dart @@ -28,16 +28,19 @@ class AuthRouter { ); } - void pushHomeScreen(BuildContext context, UserProfilePB profile, CurrentWorkspaceSettingPB workspaceSetting) { + void pushHomeScreen(BuildContext context, UserProfilePB profile, + CurrentWorkspaceSettingPB workspaceSetting) { Navigator.push( context, - PageRoutes.fade(() => HomeScreen(profile, workspaceSetting), RouteDurations.slow.inMilliseconds * .001), + PageRoutes.fade(() => HomeScreen(profile, workspaceSetting), + RouteDurations.slow.inMilliseconds * .001), ); } } class SplashRoute { - Future<void> pushWelcomeScreen(BuildContext context, UserProfilePB userProfile) async { + Future<void> pushWelcomeScreen( + BuildContext context, UserProfilePB userProfile) async { final screen = WelcomeScreen(userProfile: userProfile); final workspaceId = await Navigator.of(context).push( PageRoutes.fade( @@ -46,20 +49,24 @@ class SplashRoute { ), ); + // ignore: use_build_context_synchronously pushHomeScreen(context, userProfile, workspaceId); } - void pushHomeScreen(BuildContext context, UserProfilePB userProfile, CurrentWorkspaceSettingPB workspaceSetting) { + void pushHomeScreen(BuildContext context, UserProfilePB userProfile, + CurrentWorkspaceSettingPB workspaceSetting) { Navigator.push( context, - PageRoutes.fade(() => HomeScreen(userProfile, workspaceSetting), RouteDurations.slow.inMilliseconds * .001), + PageRoutes.fade(() => HomeScreen(userProfile, workspaceSetting), + RouteDurations.slow.inMilliseconds * .001), ); } void pushSignInScreen(BuildContext context) { Navigator.push( context, - PageRoutes.fade(() => SignInScreen(router: getIt<AuthRouter>()), RouteDurations.slow.inMilliseconds * .001), + PageRoutes.fade(() => SignInScreen(router: getIt<AuthRouter>()), + RouteDurations.slow.inMilliseconds * .001), ); } diff --git a/frontend/app_flowy/lib/user/presentation/sign_in_screen.dart b/frontend/app_flowy/lib/user/presentation/sign_in_screen.dart index ee3600e782..6f17404474 100644 --- a/frontend/app_flowy/lib/user/presentation/sign_in_screen.dart +++ b/frontend/app_flowy/lib/user/presentation/sign_in_screen.dart @@ -94,6 +94,7 @@ class SignUpPrompt extends StatelessWidget { Widget build(BuildContext context) { final theme = context.watch<AppTheme>(); return Row( + mainAxisAlignment: MainAxisAlignment.center, children: [ Text(LocaleKeys.signIn_dontHaveAnAccount.tr(), style: TextStyle(color: theme.shader3, fontSize: 12)), TextButton( @@ -107,7 +108,6 @@ class SignUpPrompt extends StatelessWidget { ), ), ], - mainAxisAlignment: MainAxisAlignment.center, ); } } diff --git a/frontend/app_flowy/lib/user/presentation/sign_up_screen.dart b/frontend/app_flowy/lib/user/presentation/sign_up_screen.dart index d0cb7f8b90..75834f3836 100644 --- a/frontend/app_flowy/lib/user/presentation/sign_up_screen.dart +++ b/frontend/app_flowy/lib/user/presentation/sign_up_screen.dart @@ -86,6 +86,7 @@ class SignUpPrompt extends StatelessWidget { Widget build(BuildContext context) { final theme = context.watch<AppTheme>(); return Row( + mainAxisAlignment: MainAxisAlignment.center, children: [ Text( LocaleKeys.signUp_alreadyHaveAnAccount.tr(), @@ -97,7 +98,6 @@ class SignUpPrompt extends StatelessWidget { child: Text(LocaleKeys.signIn_buttonText.tr(), style: TextStyle(color: theme.main1)), ), ], - mainAxisAlignment: MainAxisAlignment.center, ); } } diff --git a/frontend/app_flowy/lib/workspace/application/markdown/src/inline_parser.dart b/frontend/app_flowy/lib/workspace/application/markdown/src/inline_parser.dart index 8b47a97433..ce0f11302e 100644 --- a/frontend/app_flowy/lib/workspace/application/markdown/src/inline_parser.dart +++ b/frontend/app_flowy/lib/workspace/application/markdown/src/inline_parser.dart @@ -399,8 +399,8 @@ class AutolinkExtensionSyntax extends InlineSyntax { } } -class _DelimiterRun { - _DelimiterRun._( +class DelimiterRun { + DelimiterRun._( {this.char, this.length, this.isLeftFlanking, @@ -420,8 +420,7 @@ class _DelimiterRun { final bool? isFollowedByPunctuation; // ignore: prefer_constructors_over_static_methods - static _DelimiterRun? tryParse( - InlineParser parser, int runStart, int runEnd) { + static DelimiterRun? tryParse(InlineParser parser, int runStart, int runEnd) { bool leftFlanking, rightFlanking, precededByPunctuation, @@ -466,7 +465,7 @@ class _DelimiterRun { return null; } - return _DelimiterRun._( + return DelimiterRun._( char: parser.charAt(runStart), length: runEnd - runStart + 1, isLeftFlanking: leftFlanking, @@ -516,7 +515,7 @@ class TagSyntax extends InlineSyntax { return true; } - final delimiterRun = _DelimiterRun.tryParse(parser, matchStart, matchEnd); + final delimiterRun = DelimiterRun.tryParse(parser, matchStart, matchEnd); if (delimiterRun != null && delimiterRun.canOpen) { parser.openTag(TagState(parser.pos, matchEnd + 1, this, delimiterRun)); return true; @@ -531,7 +530,7 @@ class TagSyntax extends InlineSyntax { final matchStart = parser.pos; final matchEnd = parser.pos + runLength - 1; final openingRunLength = state.endPos - state.startPos; - final delimiterRun = _DelimiterRun.tryParse(parser, matchStart, matchEnd); + final delimiterRun = DelimiterRun.tryParse(parser, matchStart, matchEnd); if (openingRunLength == 1 && runLength == 1) { parser.addNode(Element('em', state.children)); @@ -579,7 +578,7 @@ class StrikethroughSyntax extends TagSyntax { final runLength = match.group(0)!.length; final matchStart = parser.pos; final matchEnd = parser.pos + runLength - 1; - final delimiterRun = _DelimiterRun.tryParse(parser, matchStart, matchEnd)!; + final delimiterRun = DelimiterRun.tryParse(parser, matchStart, matchEnd)!; if (!delimiterRun.isRightFlanking!) { return false; } @@ -1170,7 +1169,7 @@ class TagState { /// The children of this node. Will be `null` for text nodes. final List<Node> children; - final _DelimiterRun? openingDelimiterRun; + final DelimiterRun? openingDelimiterRun; /// Attempts to close this tag by matching the current text against its end /// pattern. @@ -1193,7 +1192,7 @@ class TagState { final closingMatchStart = parser.pos; final closingMatchEnd = parser.pos + runLength - 1; final closingDelimiterRun = - _DelimiterRun.tryParse(parser, closingMatchStart, closingMatchEnd); + DelimiterRun.tryParse(parser, closingMatchStart, closingMatchEnd); if (closingDelimiterRun != null && closingDelimiterRun.canClose) { // Emphasis rules #9 and #10: final oneRunOpensAndCloses = diff --git a/frontend/app_flowy/lib/workspace/presentation/home/home_stack.dart b/frontend/app_flowy/lib/workspace/presentation/home/home_stack.dart index 5099dcddfc..eed9eb6f4a 100644 --- a/frontend/app_flowy/lib/workspace/presentation/home/home_stack.dart +++ b/frontend/app_flowy/lib/workspace/presentation/home/home_stack.dart @@ -58,10 +58,10 @@ class FadingIndexedStack extends StatefulWidget { }) : super(key: key); @override - _FadingIndexedStackState createState() => _FadingIndexedStackState(); + FadingIndexedStackState createState() => FadingIndexedStackState(); } -class _FadingIndexedStackState extends State<FadingIndexedStack> { +class FadingIndexedStackState extends State<FadingIndexedStack> { double _targetOpacity = 1; @override diff --git a/frontend/app_flowy/lib/workspace/presentation/home/hotkeys.dart b/frontend/app_flowy/lib/workspace/presentation/home/hotkeys.dart index 32c2bae7fe..0ac9cbc704 100644 --- a/frontend/app_flowy/lib/workspace/presentation/home/hotkeys.dart +++ b/frontend/app_flowy/lib/workspace/presentation/home/hotkeys.dart @@ -13,14 +13,14 @@ class HomeHotKeys extends StatelessWidget { @override Widget build(BuildContext context) { - HotKey _hotKey = HotKey( + HotKey hotKey = HotKey( KeyCode.backslash, modifiers: [Platform.isMacOS ? KeyModifier.meta : KeyModifier.control], // Set hotkey scope (default is HotKeyScope.system) scope: HotKeyScope.inapp, // Set as inapp-wide hotkey. ); hotKeyManager.register( - _hotKey, + hotKey, keyDownHandler: (hotKey) { context.read<HomeBloc>().add(const HomeEvent.collapseMenu()); getIt<HomeStackManager>().collapsedNotifier.value = diff --git a/frontend/app_flowy/lib/workspace/presentation/home/menu/menu.dart b/frontend/app_flowy/lib/workspace/presentation/home/menu/menu.dart index f9704a695f..1796640d00 100644 --- a/frontend/app_flowy/lib/workspace/presentation/home/menu/menu.dart +++ b/frontend/app_flowy/lib/workspace/presentation/home/menu/menu.dart @@ -222,7 +222,7 @@ class MenuTopBar extends StatelessWidget { Tooltip( richMessage: TextSpan(children: [ TextSpan( - text: LocaleKeys.sideBar_closeSidebar.tr() + "\n"), + text: "${LocaleKeys.sideBar_closeSidebar.tr()}\n"), TextSpan( text: Platform.isMacOS ? "⌘+\\" : "Ctrl+\\", style: const TextStyle(color: Colors.white60), diff --git a/frontend/app_flowy/lib/workspace/presentation/home/menu/menu_user.dart b/frontend/app_flowy/lib/workspace/presentation/home/menu/menu_user.dart index 3d9d76fe29..399bbd1f89 100644 --- a/frontend/app_flowy/lib/workspace/presentation/home/menu/menu_user.dart +++ b/frontend/app_flowy/lib/workspace/presentation/home/menu/menu_user.dart @@ -24,6 +24,7 @@ class MenuUser extends StatelessWidget { getIt<MenuUserBloc>(param1: user)..add(const MenuUserEvent.initial()), child: BlocBuilder<MenuUserBloc, MenuUserState>( builder: (context, state) => Row( + crossAxisAlignment: CrossAxisAlignment.center, children: [ _renderAvatar(context), const HSpace(10), @@ -34,7 +35,6 @@ class MenuUser extends StatelessWidget { //we get the below block back //_renderDropButton(context), ], - crossAxisAlignment: CrossAxisAlignment.center, ), ), ); diff --git a/frontend/app_flowy/lib/workspace/presentation/home/navigation.dart b/frontend/app_flowy/lib/workspace/presentation/home/navigation.dart index 019a567932..bfdb708013 100644 --- a/frontend/app_flowy/lib/workspace/presentation/home/navigation.dart +++ b/frontend/app_flowy/lib/workspace/presentation/home/navigation.dart @@ -101,7 +101,7 @@ class FlowyNavigation extends StatelessWidget { turns: const AlwaysStoppedAnimation(180 / 360), child: Tooltip( richMessage: TextSpan(children: [ - TextSpan(text: LocaleKeys.sideBar_openSidebar.tr() + "\n"), + TextSpan(text: "${LocaleKeys.sideBar_openSidebar.tr()}\n"), TextSpan( text: Platform.isMacOS ? "⌘+\\" : "Ctrl+\\", style: const TextStyle(color: Colors.white60), diff --git a/frontend/app_flowy/lib/workspace/presentation/home/toast.dart b/frontend/app_flowy/lib/workspace/presentation/home/toast.dart index 28241c0ec4..d3473adaa9 100644 --- a/frontend/app_flowy/lib/workspace/presentation/home/toast.dart +++ b/frontend/app_flowy/lib/workspace/presentation/home/toast.dart @@ -10,14 +10,14 @@ class FlowyMessageToast extends StatelessWidget { @override Widget build(BuildContext context) { return Container( - child: Padding( - padding: const EdgeInsets.symmetric(horizontal: 12, vertical: 6), - child: FlowyText.medium(message, color: Colors.white), - ), decoration: const BoxDecoration( borderRadius: BorderRadius.all(Radius.circular(4)), color: Colors.black, ), + child: Padding( + padding: const EdgeInsets.symmetric(horizontal: 12, vertical: 6), + child: FlowyText.medium(message, color: Colors.white), + ), ); } } diff --git a/frontend/app_flowy/lib/workspace/presentation/settings/widgets/settings_language_view.dart b/frontend/app_flowy/lib/workspace/presentation/settings/widgets/settings_language_view.dart index e95e6e83ab..bb1b419da0 100644 --- a/frontend/app_flowy/lib/workspace/presentation/settings/widgets/settings_language_view.dart +++ b/frontend/app_flowy/lib/workspace/presentation/settings/widgets/settings_language_view.dart @@ -84,8 +84,8 @@ class _LanguageSelectorDropdownState extends State<LanguageSelectorDropdown> { }); }, icon: const Visibility( - child: (Icon(Icons.arrow_downward)), visible: false, + child: (Icon(Icons.arrow_downward)), ), borderRadius: BorderRadius.circular(8), items: EasyLocalization.of(context)!.supportedLocales.map((locale) { diff --git a/frontend/app_flowy/lib/workspace/presentation/widgets/edit_panel/panel_animation.dart b/frontend/app_flowy/lib/workspace/presentation/widgets/edit_panel/panel_animation.dart index 082cb5dabf..614ff356cb 100644 --- a/frontend/app_flowy/lib/workspace/presentation/widgets/edit_panel/panel_animation.dart +++ b/frontend/app_flowy/lib/workspace/presentation/widgets/edit_panel/panel_animation.dart @@ -19,10 +19,10 @@ class AnimatedPanel extends StatefulWidget { : super(key: key); @override - _AnimatedPanelState createState() => _AnimatedPanelState(); + AnimatedPanelState createState() => AnimatedPanelState(); } -class _AnimatedPanelState extends State<AnimatedPanel> { +class AnimatedPanelState extends State<AnimatedPanel> { bool _isHidden = true; @override @@ -79,9 +79,9 @@ extension AnimatedPanelExtensions on Widget { return AnimatedPanel( closedX: closePos.dx, closedY: closePos.dy, - child: this, isClosed: isClosed ?? false, duration: duration ?? .35, - curve: curve); + curve: curve, + child: this); } } diff --git a/frontend/app_flowy/lib/workspace/presentation/widgets/emoji_picker/src/default_emoji_picker_view.dart b/frontend/app_flowy/lib/workspace/presentation/widgets/emoji_picker/src/default_emoji_picker_view.dart index afdfa5e6eb..271a3b6dd2 100644 --- a/frontend/app_flowy/lib/workspace/presentation/widgets/emoji_picker/src/default_emoji_picker_view.dart +++ b/frontend/app_flowy/lib/workspace/presentation/widgets/emoji_picker/src/default_emoji_picker_view.dart @@ -10,28 +10,34 @@ import 'emoji_picker_builder.dart'; import 'emoji_view_state.dart'; class DefaultEmojiPickerView extends EmojiPickerBuilder { - const DefaultEmojiPickerView(Config config, EmojiViewState state, {Key? key}) : super(config, state, key: key); + const DefaultEmojiPickerView(Config config, EmojiViewState state, {Key? key}) + : super(config, state, key: key); @override - _DefaultEmojiPickerViewState createState() => _DefaultEmojiPickerViewState(); + DefaultEmojiPickerViewState createState() => DefaultEmojiPickerViewState(); } -class _DefaultEmojiPickerViewState extends State<DefaultEmojiPickerView> with TickerProviderStateMixin { +class DefaultEmojiPickerViewState extends State<DefaultEmojiPickerView> + with TickerProviderStateMixin { PageController? _pageController; TabController? _tabController; final TextEditingController _emojiController = TextEditingController(); final FocusNode _emojiFocusNode = FocusNode(); - final CategoryEmoji _categoryEmoji = CategoryEmoji(Category.SEARCH, List.empty(growable: true)); + final CategoryEmoji _categoryEmoji = + CategoryEmoji(Category.SEARCH, List.empty(growable: true)); CategoryEmoji searchEmojiList = CategoryEmoji(Category.SEARCH, <Emoji>[]); @override void initState() { - var initCategory = - widget.state.categoryEmoji.indexWhere((element) => element.category == widget.config.initCategory); + var initCategory = widget.state.categoryEmoji.indexWhere( + (element) => element.category == widget.config.initCategory); if (initCategory == -1) { initCategory = 0; } - _tabController = TabController(initialIndex: initCategory, length: widget.state.categoryEmoji.length, vsync: this); + _tabController = TabController( + initialIndex: initCategory, + length: widget.state.categoryEmoji.length, + vsync: this); _pageController = PageController(initialPage: initCategory); _emojiFocusNode.requestFocus(); @@ -83,7 +89,8 @@ class _DefaultEmojiPickerViewState extends State<DefaultEmojiPickerView> with Ti } bool isEmojiSearching() { - bool result = searchEmojiList.emoji.isNotEmpty || _emojiController.text.isNotEmpty; + bool result = + searchEmojiList.emoji.isNotEmpty || _emojiController.text.isNotEmpty; return result; } @@ -133,7 +140,9 @@ class _DefaultEmojiPickerViewState extends State<DefaultEmojiPickerView> with Ti child: TabBar( labelColor: widget.config.iconColorSelected, unselectedLabelColor: widget.config.iconColor, - controller: isEmojiSearching() ? TabController(length: 1, vsync: this) : _tabController, + controller: isEmojiSearching() + ? TabController(length: 1, vsync: this) + : _tabController, labelPadding: EdgeInsets.zero, indicatorColor: widget.config.indicatorColor, padding: const EdgeInsets.symmetric(vertical: 5.0), @@ -154,7 +163,8 @@ class _DefaultEmojiPickerViewState extends State<DefaultEmojiPickerView> with Ti : widget.state.categoryEmoji .asMap() .entries - .map<Widget>((item) => _buildCategory(item.value.category, emojiSize)) + .map<Widget>((item) => _buildCategory( + item.value.category, emojiSize)) .toList(), ), ), @@ -163,7 +173,9 @@ class _DefaultEmojiPickerViewState extends State<DefaultEmojiPickerView> with Ti ), Flexible( child: PageView.builder( - itemCount: searchEmojiList.emoji.isNotEmpty ? 1 : widget.state.categoryEmoji.length, + itemCount: searchEmojiList.emoji.isNotEmpty + ? 1 + : widget.state.categoryEmoji.length, controller: _pageController, physics: const NeverScrollableScrollPhysics(), // onPageChanged: (index) { @@ -173,7 +185,9 @@ class _DefaultEmojiPickerViewState extends State<DefaultEmojiPickerView> with Ti // ); // }, itemBuilder: (context, index) { - CategoryEmoji catEmoji = isEmojiSearching() ? searchEmojiList : widget.state.categoryEmoji[index]; + CategoryEmoji catEmoji = isEmojiSearching() + ? searchEmojiList + : widget.state.categoryEmoji[index]; return _buildPage(emojiSize, catEmoji); }, ), @@ -195,24 +209,28 @@ class _DefaultEmojiPickerViewState extends State<DefaultEmojiPickerView> with Ti ); } - Widget _buildButtonWidget({required VoidCallback onPressed, required Widget child}) { + Widget _buildButtonWidget( + {required VoidCallback onPressed, required Widget child}) { if (widget.config.buttonMode == ButtonMode.MATERIAL) { return TextButton( onPressed: onPressed, - child: child, style: ButtonStyle(padding: MaterialStateProperty.all(EdgeInsets.zero)), + child: child, ); } - return CupertinoButton(padding: EdgeInsets.zero, onPressed: onPressed, child: child); + return CupertinoButton( + padding: EdgeInsets.zero, onPressed: onPressed, child: child); } Widget _buildPage(double emojiSize, CategoryEmoji categoryEmoji) { // Display notice if recent has no entries yet final scrollController = ScrollController(); - if (categoryEmoji.category == Category.RECENT && categoryEmoji.emoji.isEmpty) { + if (categoryEmoji.category == Category.RECENT && + categoryEmoji.emoji.isEmpty) { return _buildNoRecent(); - } else if (categoryEmoji.category == Category.SEARCH && categoryEmoji.emoji.isEmpty) { + } else if (categoryEmoji.category == Category.SEARCH && + categoryEmoji.emoji.isEmpty) { return const Center(child: Text("No Emoji Found")); } // Build page normally @@ -236,8 +254,13 @@ class _DefaultEmojiPickerViewState extends State<DefaultEmojiPickerView> with Ti mainAxisSpacing: widget.config.verticalSpacing, crossAxisSpacing: widget.config.horizontalSpacing, children: _categoryEmoji.emoji.isNotEmpty - ? _categoryEmoji.emoji.map<Widget>((e) => _buildEmoji(emojiSize, categoryEmoji, e)).toList() - : categoryEmoji.emoji.map<Widget>((item) => _buildEmoji(emojiSize, categoryEmoji, item)).toList(), + ? _categoryEmoji.emoji + .map<Widget>((e) => _buildEmoji(emojiSize, categoryEmoji, e)) + .toList() + : categoryEmoji.emoji + .map<Widget>( + (item) => _buildEmoji(emojiSize, categoryEmoji, item)) + .toList(), ), ), ); diff --git a/frontend/app_flowy/lib/workspace/presentation/widgets/emoji_picker/src/emoji_button.dart b/frontend/app_flowy/lib/workspace/presentation/widgets/emoji_picker/src/emoji_button.dart index 37ce933618..28cf268a46 100644 --- a/frontend/app_flowy/lib/workspace/presentation/widgets/emoji_picker/src/emoji_button.dart +++ b/frontend/app_flowy/lib/workspace/presentation/widgets/emoji_picker/src/emoji_button.dart @@ -20,10 +20,10 @@ class FlowyEmojiStyleButton extends StatefulWidget { }) : super(key: key); @override - _EmojiStyleButtonState createState() => _EmojiStyleButtonState(); + EmojiStyleButtonState createState() => EmojiStyleButtonState(); } -class _EmojiStyleButtonState extends State<FlowyEmojiStyleButton> { +class EmojiStyleButtonState extends State<FlowyEmojiStyleButton> { bool _isToggled = false; // Style get _selectionStyle => widget.controller.getSelectionStyle(); final GlobalKey emojiButtonKey = GlobalKey(); diff --git a/frontend/app_flowy/lib/workspace/presentation/widgets/emoji_picker/src/emoji_picker.dart b/frontend/app_flowy/lib/workspace/presentation/widgets/emoji_picker/src/emoji_picker.dart index 650cd185f1..8852b12799 100644 --- a/frontend/app_flowy/lib/workspace/presentation/widgets/emoji_picker/src/emoji_picker.dart +++ b/frontend/app_flowy/lib/workspace/presentation/widgets/emoji_picker/src/emoji_picker.dart @@ -101,10 +101,10 @@ class EmojiPicker extends StatefulWidget { final Config config; @override - _EmojiPickerState createState() => _EmojiPickerState(); + EmojiPickerState createState() => EmojiPickerState(); } -class _EmojiPickerState extends State<EmojiPicker> { +class EmojiPickerState extends State<EmojiPicker> { static const platform = MethodChannel('emoji_picker_flutter'); List<CategoryEmoji> categoryEmoji = List.empty(growable: true); @@ -147,7 +147,8 @@ class _EmojiPickerState extends State<EmojiPicker> { return const Center(child: CircularProgressIndicator()); } if (widget.config.showRecentsTab) { - categoryEmoji[0].emoji = recentEmoji.map((e) => e.emoji).toList().cast<Emoji>(); + categoryEmoji[0].emoji = + recentEmoji.map((e) => e.emoji).toList().cast<Emoji>(); } var state = EmojiViewState( @@ -184,23 +185,35 @@ class _EmojiPickerState extends State<EmojiPicker> { categoryEmoji.clear(); if (widget.config.showRecentsTab) { recentEmoji = await _getRecentEmojis(); - final List<Emoji> recentEmojiMap = recentEmoji.map((e) => e.emoji).toList().cast<Emoji>(); + final List<Emoji> recentEmojiMap = + recentEmoji.map((e) => e.emoji).toList().cast<Emoji>(); categoryEmoji.add(CategoryEmoji(Category.RECENT, recentEmojiMap)); } categoryEmoji.addAll([ - CategoryEmoji(Category.SMILEYS, await _getAvailableEmojis(emoji_list.smileys, title: 'smileys')), - CategoryEmoji(Category.ANIMALS, await _getAvailableEmojis(emoji_list.animals, title: 'animals')), - CategoryEmoji(Category.FOODS, await _getAvailableEmojis(emoji_list.foods, title: 'foods')), - CategoryEmoji(Category.ACTIVITIES, await _getAvailableEmojis(emoji_list.activities, title: 'activities')), - CategoryEmoji(Category.TRAVEL, await _getAvailableEmojis(emoji_list.travel, title: 'travel')), - CategoryEmoji(Category.OBJECTS, await _getAvailableEmojis(emoji_list.objects, title: 'objects')), - CategoryEmoji(Category.SYMBOLS, await _getAvailableEmojis(emoji_list.symbols, title: 'symbols')), - CategoryEmoji(Category.FLAGS, await _getAvailableEmojis(emoji_list.flags, title: 'flags')) + CategoryEmoji(Category.SMILEYS, + await _getAvailableEmojis(emoji_list.smileys, title: 'smileys')), + CategoryEmoji(Category.ANIMALS, + await _getAvailableEmojis(emoji_list.animals, title: 'animals')), + CategoryEmoji(Category.FOODS, + await _getAvailableEmojis(emoji_list.foods, title: 'foods')), + CategoryEmoji( + Category.ACTIVITIES, + await _getAvailableEmojis(emoji_list.activities, + title: 'activities')), + CategoryEmoji(Category.TRAVEL, + await _getAvailableEmojis(emoji_list.travel, title: 'travel')), + CategoryEmoji(Category.OBJECTS, + await _getAvailableEmojis(emoji_list.objects, title: 'objects')), + CategoryEmoji(Category.SYMBOLS, + await _getAvailableEmojis(emoji_list.symbols, title: 'symbols')), + CategoryEmoji(Category.FLAGS, + await _getAvailableEmojis(emoji_list.flags, title: 'flags')) ]); } // Get available emoji for given category title - Future<List<Emoji>> _getAvailableEmojis(Map<String, String> map, {required String title}) async { + Future<List<Emoji>> _getAvailableEmojis(Map<String, String> map, + {required String title}) async { Map<String, String>? newMap; // Get Emojis cached locally if available @@ -216,19 +229,22 @@ class _EmojiPickerState extends State<EmojiPicker> { } // Map to Emoji Object - return newMap!.entries.map<Emoji>((entry) => Emoji(entry.key, entry.value)).toList(); + return newMap!.entries + .map<Emoji>((entry) => Emoji(entry.key, entry.value)) + .toList(); } // Check if emoji is available on current platform - Future<Map<String, String>?> _getPlatformAvailableEmoji(Map<String, String> emoji) async { + Future<Map<String, String>?> _getPlatformAvailableEmoji( + Map<String, String> emoji) async { if (Platform.isAndroid) { Map<String, String>? filtered = {}; var delimiter = '|'; try { var entries = emoji.values.join(delimiter); var keys = emoji.keys.join(delimiter); - var result = (await platform - .invokeMethod<String>('checkAvailability', {'emojiKeys': keys, 'emojiEntries': entries})) as String; + var result = (await platform.invokeMethod<String>('checkAvailability', + {'emojiKeys': keys, 'emojiEntries': entries})) as String; var resultKeys = result.split(delimiter); for (var i = 0; i < resultKeys.length; i++) { filtered[resultKeys[i]] = emoji[resultKeys[i]]!; @@ -249,12 +265,14 @@ class _EmojiPickerState extends State<EmojiPicker> { if (emojiJson == null) { return null; } - var emojis = Map<String, String>.from(jsonDecode(emojiJson) as Map<String, dynamic>); + var emojis = + Map<String, String>.from(jsonDecode(emojiJson) as Map<String, dynamic>); return emojis; } // Stores filtered emoji locally for faster access next time - Future<void> _cacheFilteredEmojis(String title, Map<String, String> emojis) async { + Future<void> _cacheFilteredEmojis( + String title, Map<String, String> emojis) async { final prefs = await SharedPreferences.getInstance(); var emojiJson = jsonEncode(emojis); prefs.setString(title, emojiJson); @@ -274,7 +292,8 @@ class _EmojiPickerState extends State<EmojiPicker> { // Add an emoji to recently used list or increase its counter Future<void> _addEmojiToRecentlyUsed(Emoji emoji) async { final prefs = await SharedPreferences.getInstance(); - var recentEmojiIndex = recentEmoji.indexWhere((element) => element.emoji.emoji == emoji.emoji); + var recentEmojiIndex = + recentEmoji.indexWhere((element) => element.emoji.emoji == emoji.emoji); if (recentEmojiIndex != -1) { // Already exist in recent list // Just update counter @@ -285,7 +304,8 @@ class _EmojiPickerState extends State<EmojiPicker> { // Sort by counter desc recentEmoji.sort((a, b) => b.counter - a.counter); // Limit entries to recentsLimit - recentEmoji = recentEmoji.sublist(0, min(widget.config.recentsLimit, recentEmoji.length)); + recentEmoji = recentEmoji.sublist( + 0, min(widget.config.recentsLimit, recentEmoji.length)); // save locally prefs.setString('recent', jsonEncode(recentEmoji)); } diff --git a/frontend/app_flowy/lib/workspace/presentation/widgets/float_bubble/question_bubble.dart b/frontend/app_flowy/lib/workspace/presentation/widgets/float_bubble/question_bubble.dart index 6cc150489c..dbcafe2e44 100644 --- a/frontend/app_flowy/lib/workspace/presentation/widgets/float_bubble/question_bubble.dart +++ b/frontend/app_flowy/lib/workspace/presentation/widgets/float_bubble/question_bubble.dart @@ -87,7 +87,7 @@ class _DebugToast { return deviceInfo.then((info) { var debugText = ""; info.toMap().forEach((key, value) { - debugText = debugText + "$key: $value\n"; + debugText = "$debugText$key: $value\n"; }); return debugText; }); diff --git a/frontend/app_flowy/lib/workspace/presentation/widgets/pop_up_window.dart b/frontend/app_flowy/lib/workspace/presentation/widgets/pop_up_window.dart index 1803257672..9ad25dc70c 100644 --- a/frontend/app_flowy/lib/workspace/presentation/widgets/pop_up_window.dart +++ b/frontend/app_flowy/lib/workspace/presentation/widgets/pop_up_window.dart @@ -10,8 +10,8 @@ class FlowyPoppuWindow extends StatelessWidget { @override Widget build(BuildContext context) { return Material( - child: child, type: MaterialType.transparency, + child: child, ); } @@ -21,6 +21,7 @@ class FlowyPoppuWindow extends StatelessWidget { required Size size, }) async { final window = await getWindowInfo(); + // ignore: use_build_context_synchronously FlowyOverlay.of(context).insertWithRect( widget: FlowyPoppuWindow(child: child), identifier: 'FlowyPoppuWindow', @@ -49,7 +50,10 @@ class PopupTextField extends StatelessWidget { ); } - static void show({required BuildContext context, required Size size, required void Function(String) textDidChange}) { + static void show( + {required BuildContext context, + required Size size, + required void Function(String) textDidChange}) { FlowyPoppuWindow.show( context, size: size, diff --git a/frontend/app_flowy/packages/appflowy_board/example/pubspec.yaml b/frontend/app_flowy/packages/appflowy_board/example/pubspec.yaml index 1a90f3b84a..c9bd9ef0f9 100644 --- a/frontend/app_flowy/packages/appflowy_board/example/pubspec.yaml +++ b/frontend/app_flowy/packages/appflowy_board/example/pubspec.yaml @@ -46,7 +46,7 @@ dev_dependencies: # activated in the `analysis_options.yaml` file located at the root of your # package. See that file for information about deactivating specific lint # rules and activating additional ones. - flutter_lints: ^2.0.0 + flutter_lints: ^2.0.1 # For information on the generic Dart part of this file, see the # following page: https://dart.dev/tools/pub/pubspec diff --git a/frontend/app_flowy/packages/appflowy_board/pubspec.yaml b/frontend/app_flowy/packages/appflowy_board/pubspec.yaml index a9adf5007a..14dc501dcc 100644 --- a/frontend/app_flowy/packages/appflowy_board/pubspec.yaml +++ b/frontend/app_flowy/packages/appflowy_board/pubspec.yaml @@ -17,7 +17,7 @@ dependencies: dev_dependencies: flutter_test: sdk: flutter - flutter_lints: ^2.0.0 + flutter_lints: ^2.0.1 # For information on the generic Dart part of this file, see the # following page: https://dart.dev/tools/pub/pubspec diff --git a/frontend/app_flowy/packages/appflowy_editor/example/pubspec.yaml b/frontend/app_flowy/packages/appflowy_editor/example/pubspec.yaml index 5ba51433d6..482cad0875 100644 --- a/frontend/app_flowy/packages/appflowy_editor/example/pubspec.yaml +++ b/frontend/app_flowy/packages/appflowy_editor/example/pubspec.yaml @@ -51,7 +51,7 @@ dev_dependencies: # activated in the `analysis_options.yaml` file located at the root of your # package. See that file for information about deactivating specific lint # rules and activating additional ones. - flutter_lints: ^2.0.0 + flutter_lints: ^2.0.1 # For information on the generic Dart part of this file, see the # following page: https://dart.dev/tools/pub/pubspec diff --git a/frontend/app_flowy/packages/appflowy_editor/pubspec.yaml b/frontend/app_flowy/packages/appflowy_editor/pubspec.yaml index 6816037b9b..295a45ad8c 100644 --- a/frontend/app_flowy/packages/appflowy_editor/pubspec.yaml +++ b/frontend/app_flowy/packages/appflowy_editor/pubspec.yaml @@ -21,7 +21,7 @@ dependencies: dev_dependencies: flutter_test: sdk: flutter - flutter_lints: ^2.0.0 + flutter_lints: ^2.0.1 network_image_mock: ^2.1.1 # For information on the generic Dart part of this file, see the diff --git a/frontend/app_flowy/packages/flowy_infra/lib/notifier.dart b/frontend/app_flowy/packages/flowy_infra/lib/notifier.dart index ac225775d7..bbb55bf885 100644 --- a/frontend/app_flowy/packages/flowy_infra/lib/notifier.dart +++ b/frontend/app_flowy/packages/flowy_infra/lib/notifier.dart @@ -37,13 +37,13 @@ class PublishNotifier<T> extends ChangeNotifier { () { if (_value == null) { return; - } + } else {} if (listenWhen != null && listenWhen() == false) { return; } - callback(_value!); + callback(_value as T); }, ); } diff --git a/frontend/app_flowy/packages/flowy_infra/pubspec.lock b/frontend/app_flowy/packages/flowy_infra/pubspec.lock index fc492e7344..23fd739d68 100644 --- a/frontend/app_flowy/packages/flowy_infra/pubspec.lock +++ b/frontend/app_flowy/packages/flowy_infra/pubspec.lock @@ -68,14 +68,14 @@ packages: name: flutter_lints url: "https://pub.dartlang.org" source: hosted - version: "1.0.4" + version: "2.0.1" flutter_svg: dependency: "direct main" description: name: flutter_svg url: "https://pub.dartlang.org" source: hosted - version: "0.22.0" + version: "1.1.4" flutter_test: dependency: "direct dev" description: flutter @@ -87,7 +87,7 @@ packages: name: lints url: "https://pub.dartlang.org" source: hosted - version: "1.0.1" + version: "2.0.0" matcher: dependency: transitive description: @@ -122,21 +122,21 @@ packages: name: path_drawing url: "https://pub.dartlang.org" source: hosted - version: "0.5.1" + version: "1.0.1" path_parsing: dependency: transitive description: name: path_parsing url: "https://pub.dartlang.org" source: hosted - version: "0.2.1" + version: "1.0.1" petitparser: dependency: transitive description: name: petitparser url: "https://pub.dartlang.org" source: hosted - version: "4.2.0" + version: "5.0.0" sky_engine: dependency: transitive description: flutter @@ -225,7 +225,7 @@ packages: name: xml url: "https://pub.dartlang.org" source: hosted - version: "5.2.0" + version: "6.1.0" sdks: - dart: ">=2.17.0-0 <3.0.0" - flutter: ">=1.24.0-7.0" + dart: ">=2.17.0 <3.0.0" + flutter: ">=2.11.0-0.1.pre" diff --git a/frontend/app_flowy/packages/flowy_infra/pubspec.yaml b/frontend/app_flowy/packages/flowy_infra/pubspec.yaml index ebd7656af9..63f1b66b4e 100644 --- a/frontend/app_flowy/packages/flowy_infra/pubspec.yaml +++ b/frontend/app_flowy/packages/flowy_infra/pubspec.yaml @@ -18,7 +18,7 @@ dependencies: dev_dependencies: flutter_test: sdk: flutter - flutter_lints: ^1.0.0 + flutter_lints: ^2.0.1 # For information on the generic Dart part of this file, see the # following page: https://dart.dev/tools/pub/pubspec diff --git a/frontend/app_flowy/packages/flowy_infra_ui/example/lib/keyboard/keyboard_screen.dart b/frontend/app_flowy/packages/flowy_infra_ui/example/lib/keyboard/keyboard_screen.dart index 28aa027b49..fde544365b 100644 --- a/frontend/app_flowy/packages/flowy_infra_ui/example/lib/keyboard/keyboard_screen.dart +++ b/frontend/app_flowy/packages/flowy_infra_ui/example/lib/keyboard/keyboard_screen.dart @@ -22,12 +22,13 @@ class KeyboardScreen extends StatefulWidget { const KeyboardScreen({Key? key}) : super(key: key); @override - _KeyboardScreenState createState() => _KeyboardScreenState(); + State<KeyboardScreen> createState() => _KeyboardScreenState(); } class _KeyboardScreenState extends State<KeyboardScreen> { bool _isKeyboardVisible = false; - final TextEditingController _controller = TextEditingController(text: 'Hello Flowy'); + final TextEditingController _controller = + TextEditingController(text: 'Hello Flowy'); @override Widget build(BuildContext context) { diff --git a/frontend/app_flowy/packages/flowy_infra_ui/example/pubspec.lock b/frontend/app_flowy/packages/flowy_infra_ui/example/pubspec.lock index eaaa5db680..8ddcc99719 100644 --- a/frontend/app_flowy/packages/flowy_infra_ui/example/pubspec.lock +++ b/frontend/app_flowy/packages/flowy_infra_ui/example/pubspec.lock @@ -124,14 +124,14 @@ packages: name: flutter_lints url: "https://pub.dartlang.org" source: hosted - version: "1.0.4" + version: "2.0.1" flutter_svg: dependency: transitive description: name: flutter_svg url: "https://pub.dartlang.org" source: hosted - version: "0.22.0" + version: "1.1.4" flutter_test: dependency: "direct dev" description: flutter @@ -162,7 +162,7 @@ packages: name: lints url: "https://pub.dartlang.org" source: hosted - version: "1.0.1" + version: "2.0.0" loading_indicator: dependency: transitive description: @@ -211,21 +211,21 @@ packages: name: path_drawing url: "https://pub.dartlang.org" source: hosted - version: "0.5.1+1" + version: "1.0.1" path_parsing: dependency: transitive description: name: path_parsing url: "https://pub.dartlang.org" source: hosted - version: "0.2.1" + version: "1.0.1" petitparser: dependency: transitive description: name: petitparser url: "https://pub.dartlang.org" source: hosted - version: "4.4.0" + version: "5.0.0" plugin_platform_interface: dependency: transitive description: @@ -335,7 +335,7 @@ packages: name: xml url: "https://pub.dartlang.org" source: hosted - version: "5.3.1" + version: "6.1.0" sdks: - dart: ">=2.17.0-0 <3.0.0" - flutter: ">=2.0.0" + dart: ">=2.17.0 <3.0.0" + flutter: ">=2.11.0-0.1.pre" diff --git a/frontend/app_flowy/packages/flowy_infra_ui/example/pubspec.yaml b/frontend/app_flowy/packages/flowy_infra_ui/example/pubspec.yaml index a747d1dc18..b9c8ec058e 100644 --- a/frontend/app_flowy/packages/flowy_infra_ui/example/pubspec.yaml +++ b/frontend/app_flowy/packages/flowy_infra_ui/example/pubspec.yaml @@ -14,12 +14,13 @@ dependencies: path: ../ cupertino_icons: ^1.0.2 + provider: dev_dependencies: flutter_test: sdk: flutter - flutter_lints: ^1.0.0 + flutter_lints: ^2.0.1 flutter: uses-material-design: true diff --git a/frontend/app_flowy/packages/flowy_infra_ui/flowy_infra_ui_platform_interface/pubspec.yaml b/frontend/app_flowy/packages/flowy_infra_ui/flowy_infra_ui_platform_interface/pubspec.yaml index 0b5f8eb74b..2f375be367 100644 --- a/frontend/app_flowy/packages/flowy_infra_ui/flowy_infra_ui_platform_interface/pubspec.yaml +++ b/frontend/app_flowy/packages/flowy_infra_ui/flowy_infra_ui_platform_interface/pubspec.yaml @@ -16,6 +16,6 @@ dependencies: dev_dependencies: flutter_test: sdk: flutter - flutter_lints: ^1.0.0 + flutter_lints: ^2.0.1 flutter: \ No newline at end of file diff --git a/frontend/app_flowy/packages/flowy_infra_ui/flowy_infra_ui_web/pubspec.yaml b/frontend/app_flowy/packages/flowy_infra_ui/flowy_infra_ui_web/pubspec.yaml index 03600f2e5a..224d7bf47f 100644 --- a/frontend/app_flowy/packages/flowy_infra_ui/flowy_infra_ui_web/pubspec.yaml +++ b/frontend/app_flowy/packages/flowy_infra_ui/flowy_infra_ui_web/pubspec.yaml @@ -18,7 +18,7 @@ dependencies: dev_dependencies: flutter_test: sdk: flutter - flutter_lints: ^1.0.0 + flutter_lints: ^2.0.1 flutter: plugin: diff --git a/frontend/app_flowy/packages/flowy_infra_ui/lib/src/flowy_overlay/flowy_overlay.dart b/frontend/app_flowy/packages/flowy_infra_ui/lib/src/flowy_overlay/flowy_overlay.dart index 25507b8f6d..54f8d3168f 100644 --- a/frontend/app_flowy/packages/flowy_infra_ui/lib/src/flowy_overlay/flowy_overlay.dart +++ b/frontend/app_flowy/packages/flowy_infra_ui/lib/src/flowy_overlay/flowy_overlay.dart @@ -398,8 +398,8 @@ class FlowyOverlayState extends State<FlowyOverlay> { if (style.blur) { child = BackdropFilter( - child: child, filter: ImageFilter.blur(sigmaX: 4, sigmaY: 4), + child: child, ); } } diff --git a/frontend/app_flowy/packages/flowy_infra_ui/lib/src/keyboard/keyboard_visibility_detector.dart b/frontend/app_flowy/packages/flowy_infra_ui/lib/src/keyboard/keyboard_visibility_detector.dart index b4d084acc0..643ddd94b1 100644 --- a/frontend/app_flowy/packages/flowy_infra_ui/lib/src/keyboard/keyboard_visibility_detector.dart +++ b/frontend/app_flowy/packages/flowy_infra_ui/lib/src/keyboard/keyboard_visibility_detector.dart @@ -14,10 +14,12 @@ class KeyboardVisibilityDetector extends StatefulWidget { final void Function(bool)? onKeyboardVisibilityChange; @override - _KeyboardVisibilityDetectorState createState() => _KeyboardVisibilityDetectorState(); + State<KeyboardVisibilityDetector> createState() => + _KeyboardVisibilityDetectorState(); } -class _KeyboardVisibilityDetectorState extends State<KeyboardVisibilityDetector> { +class _KeyboardVisibilityDetectorState + extends State<KeyboardVisibilityDetector> { FlowyInfraUIPlatform get _platform => FlowyInfraUIPlatform.instance; bool isObserving = false; @@ -27,7 +29,8 @@ class _KeyboardVisibilityDetectorState extends State<KeyboardVisibilityDetector> @override void initState() { super.initState(); - _keyboardSubscription = _platform.onKeyboardVisibilityChange.listen((newValue) { + _keyboardSubscription = + _platform.onKeyboardVisibilityChange.listen((newValue) { setState(() { isKeyboardVisible = newValue; if (widget.onKeyboardVisibilityChange != null) { @@ -62,7 +65,8 @@ class _KeyboardVisibilityDetectorInheritedWidget extends InheritedWidget { final bool isKeyboardVisible; @override - bool updateShouldNotify(_KeyboardVisibilityDetectorInheritedWidget oldWidget) { + bool updateShouldNotify( + _KeyboardVisibilityDetectorInheritedWidget oldWidget) { return isKeyboardVisible != oldWidget.isKeyboardVisible; } } diff --git a/frontend/app_flowy/packages/flowy_infra_ui/lib/style_widget/container.dart b/frontend/app_flowy/packages/flowy_infra_ui/lib/style_widget/container.dart index 4e26d9bd2d..fc91998c1f 100644 --- a/frontend/app_flowy/packages/flowy_infra_ui/lib/style_widget/container.dart +++ b/frontend/app_flowy/packages/flowy_infra_ui/lib/style_widget/container.dart @@ -31,7 +31,6 @@ class FlowyContainer extends StatelessWidget { return AnimatedContainer( width: width, height: height, - child: child, margin: margin, alignment: align, duration: duration ?? Durations.medium, @@ -39,6 +38,7 @@ class FlowyContainer extends StatelessWidget { color: color, borderRadius: borderRadius, boxShadow: shadows, - border: border)); + border: border), + child: child); } } diff --git a/frontend/app_flowy/packages/flowy_infra_ui/lib/style_widget/hover.dart b/frontend/app_flowy/packages/flowy_infra_ui/lib/style_widget/hover.dart index b9440bf1f1..5a3b305e1e 100644 --- a/frontend/app_flowy/packages/flowy_infra_ui/lib/style_widget/hover.dart +++ b/frontend/app_flowy/packages/flowy_infra_ui/lib/style_widget/hover.dart @@ -51,7 +51,7 @@ class _FlowyHoverState extends State<FlowyHover> { child: child, ); } else { - return Container(child: child, color: widget.style.backgroundColor); + return Container(color: widget.style.backgroundColor, child: child); } } } diff --git a/frontend/app_flowy/packages/flowy_infra_ui/lib/style_widget/icon_button.dart b/frontend/app_flowy/packages/flowy_infra_ui/lib/style_widget/icon_button.dart index f3ecd23005..0f56541516 100644 --- a/frontend/app_flowy/packages/flowy_infra_ui/lib/style_widget/icon_button.dart +++ b/frontend/app_flowy/packages/flowy_infra_ui/lib/style_widget/icon_button.dart @@ -57,7 +57,7 @@ class FlowyIconButton extends StatelessWidget { onPressed: onPressed, child: Padding( padding: iconPadding, - child: SizedBox.fromSize(child: child, size: childSize), + child: SizedBox.fromSize(size: childSize, child: child), ), ), ), diff --git a/frontend/app_flowy/packages/flowy_infra_ui/lib/style_widget/scrolling/styled_scrollview.dart b/frontend/app_flowy/packages/flowy_infra_ui/lib/style_widget/scrolling/styled_scrollview.dart index bf086f756e..b57b4059cf 100644 --- a/frontend/app_flowy/packages/flowy_infra_ui/lib/style_widget/scrolling/styled_scrollview.dart +++ b/frontend/app_flowy/packages/flowy_infra_ui/lib/style_widget/scrolling/styled_scrollview.dart @@ -27,10 +27,12 @@ class StyledSingleChildScrollView extends StatefulWidget { }) : super(key: key); @override - _StyledSingleChildScrollViewState createState() => _StyledSingleChildScrollViewState(); + State<StyledSingleChildScrollView> createState() => + StyledSingleChildScrollViewState(); } -class _StyledSingleChildScrollViewState extends State<StyledSingleChildScrollView> { +class StyledSingleChildScrollViewState + extends State<StyledSingleChildScrollView> { late ScrollController scrollController; @override @@ -92,10 +94,10 @@ class StyledCustomScrollView extends StatefulWidget { }) : super(key: key); @override - _StyledCustomScrollViewState createState() => _StyledCustomScrollViewState(); + StyledCustomScrollViewState createState() => StyledCustomScrollViewState(); } -class _StyledCustomScrollViewState extends State<StyledCustomScrollView> { +class StyledCustomScrollViewState extends State<StyledCustomScrollView> { late ScrollController controller; @override diff --git a/frontend/app_flowy/packages/flowy_infra_ui/lib/widget/buttons/base_styled_button.dart b/frontend/app_flowy/packages/flowy_infra_ui/lib/widget/buttons/base_styled_button.dart index 0c257f3d3a..d251f993fd 100644 --- a/frontend/app_flowy/packages/flowy_infra_ui/lib/widget/buttons/base_styled_button.dart +++ b/frontend/app_flowy/packages/flowy_infra_ui/lib/widget/buttons/base_styled_button.dart @@ -45,10 +45,10 @@ class BaseStyledButton extends StatefulWidget { }) : super(key: key); @override - _BaseStyledBtnState createState() => _BaseStyledBtnState(); + State<BaseStyledButton> createState() => BaseStyledBtnState(); } -class _BaseStyledBtnState extends State<BaseStyledButton> { +class BaseStyledBtnState extends State<BaseStyledButton> { late FocusNode _focusNode; bool _isFocused = false; @@ -79,9 +79,16 @@ class _BaseStyledBtnState extends State<BaseStyledButton> { borderRadius: widget.borderRadius ?? Corners.s10Border, boxShadow: _isFocused ? [ - BoxShadow(color: theme.shader6, offset: Offset.zero, blurRadius: 8.0, spreadRadius: 0.0), BoxShadow( - color: widget.bgColor ?? theme.surface, offset: Offset.zero, blurRadius: 8.0, spreadRadius: -4.0), + color: theme.shader6, + offset: Offset.zero, + blurRadius: 8.0, + spreadRadius: 0.0), + BoxShadow( + color: widget.bgColor ?? theme.surface, + offset: Offset.zero, + blurRadius: 8.0, + spreadRadius: -4.0), ] : [], ), @@ -112,20 +119,21 @@ class _BaseStyledBtnState extends State<BaseStyledButton> { hoverColor: widget.hoverColor ?? theme.hover, highlightColor: widget.downColor ?? theme.main1, focusColor: widget.focusColor ?? Colors.grey.withOpacity(0.35), - child: Opacity( - child: Padding( - padding: widget.contentPadding ?? EdgeInsets.all(Insets.m), - child: widget.child, - ), - opacity: widget.onPressed != null ? 1 : .7, - ), - constraints: BoxConstraints(minHeight: widget.minHeight ?? 0, minWidth: widget.minWidth ?? 0), + constraints: BoxConstraints( + minHeight: widget.minHeight ?? 0, minWidth: widget.minWidth ?? 0), onPressed: widget.onPressed, shape: widget.shape ?? RoundedRectangleBorder( side: BorderSide(color: widget.outlineColor, width: 1.5), borderRadius: widget.borderRadius ?? Corners.s10Border, ), + child: Opacity( + opacity: widget.onPressed != null ? 1 : .7, + child: Padding( + padding: widget.contentPadding ?? EdgeInsets.all(Insets.m), + child: widget.child, + ), + ), ), ); } diff --git a/frontend/app_flowy/packages/flowy_infra_ui/lib/widget/buttons/primary_button.dart b/frontend/app_flowy/packages/flowy_infra_ui/lib/widget/buttons/primary_button.dart index 3cd1cdf81e..2c0725288c 100644 --- a/frontend/app_flowy/packages/flowy_infra_ui/lib/widget/buttons/primary_button.dart +++ b/frontend/app_flowy/packages/flowy_infra_ui/lib/widget/buttons/primary_button.dart @@ -38,8 +38,8 @@ class PrimaryButton extends StatelessWidget { hoverColor: theme.main1, downColor: theme.main1, borderRadius: bigMode ? Corners.s12Border : Corners.s8Border, - child: child, onPressed: onPressed, + child: child, ); } } diff --git a/frontend/app_flowy/packages/flowy_infra_ui/lib/widget/buttons/secondary_button.dart b/frontend/app_flowy/packages/flowy_infra_ui/lib/widget/buttons/secondary_button.dart index dedef61295..9e6f7d331d 100644 --- a/frontend/app_flowy/packages/flowy_infra_ui/lib/widget/buttons/secondary_button.dart +++ b/frontend/app_flowy/packages/flowy_infra_ui/lib/widget/buttons/secondary_button.dart @@ -41,8 +41,8 @@ class SecondaryButton extends StatelessWidget { downColor: theme.main1, outlineColor: theme.main1, borderRadius: bigMode ? Corners.s12Border : Corners.s8Border, - child: child, onPressed: onPressed, + child: child, ); } } diff --git a/frontend/app_flowy/packages/flowy_infra_ui/lib/widget/dialog/styled_dialogs.dart b/frontend/app_flowy/packages/flowy_infra_ui/lib/widget/dialog/styled_dialogs.dart index 5db6afacef..ecd8cfb4ae 100644 --- a/frontend/app_flowy/packages/flowy_infra_ui/lib/widget/dialog/styled_dialogs.dart +++ b/frontend/app_flowy/packages/flowy_infra_ui/lib/widget/dialog/styled_dialogs.dart @@ -151,9 +151,9 @@ class StyledDialogRoute<T> extends PopupRoute<T> { Widget buildPage(BuildContext context, Animation<double> animation, Animation<double> secondaryAnimation) { return Semantics( - child: _pageBuilder(context, animation, secondaryAnimation), scopesRoute: true, explicitChildNodes: true, + child: _pageBuilder(context, animation, secondaryAnimation), ); } diff --git a/frontend/app_flowy/packages/flowy_infra_ui/lib/widget/mouse_hover_builder.dart b/frontend/app_flowy/packages/flowy_infra_ui/lib/widget/mouse_hover_builder.dart index 207775a275..81529ba16c 100644 --- a/frontend/app_flowy/packages/flowy_infra_ui/lib/widget/mouse_hover_builder.dart +++ b/frontend/app_flowy/packages/flowy_infra_ui/lib/widget/mouse_hover_builder.dart @@ -5,12 +5,14 @@ typedef HoverBuilder = Widget Function(BuildContext context, bool onHover); class MouseHoverBuilder extends StatefulWidget { final bool isClickable; - const MouseHoverBuilder({Key? key, required this.builder, this.isClickable = false}) : super(key: key); + const MouseHoverBuilder( + {Key? key, required this.builder, this.isClickable = false}) + : super(key: key); final HoverBuilder builder; @override - _MouseHoverBuilderState createState() => _MouseHoverBuilderState(); + State<MouseHoverBuilder> createState() => _MouseHoverBuilderState(); } class _MouseHoverBuilderState extends State<MouseHoverBuilder> { @@ -19,7 +21,9 @@ class _MouseHoverBuilderState extends State<MouseHoverBuilder> { @override Widget build(BuildContext context) { return MouseRegion( - cursor: widget.isClickable ? SystemMouseCursors.click : SystemMouseCursors.basic, + cursor: widget.isClickable + ? SystemMouseCursors.click + : SystemMouseCursors.basic, onEnter: (p) => setOnHover(true), onExit: (p) => setOnHover(false), child: widget.builder(context, _onHover), diff --git a/frontend/app_flowy/packages/flowy_infra_ui/lib/widget/rounded_button.dart b/frontend/app_flowy/packages/flowy_infra_ui/lib/widget/rounded_button.dart index 4d5a79fe79..33075f703c 100644 --- a/frontend/app_flowy/packages/flowy_infra_ui/lib/widget/rounded_button.dart +++ b/frontend/app_flowy/packages/flowy_infra_ui/lib/widget/rounded_button.dart @@ -42,11 +42,11 @@ class RoundedTextButton extends StatelessWidget { ), child: SizedBox.expand( child: TextButton( + onPressed: onPressed, child: Text( title ?? '', style: TextStyle(color: textColor, fontSize: fontSize), ), - onPressed: onPressed, ), ), ), diff --git a/frontend/app_flowy/packages/flowy_infra_ui/lib/widget/route/animation.dart b/frontend/app_flowy/packages/flowy_infra_ui/lib/widget/route/animation.dart index b4f53008d3..e0f328afc9 100644 --- a/frontend/app_flowy/packages/flowy_infra_ui/lib/widget/route/animation.dart +++ b/frontend/app_flowy/packages/flowy_infra_ui/lib/widget/route/animation.dart @@ -52,10 +52,10 @@ class PageRoutes { pageBuilder: (context, animation, secondaryAnimation) => pageBuilder(), transitionsBuilder: (context, animation, secondaryAnimation, child) { return SharedAxisTransition( - child: child, animation: animation, secondaryAnimation: secondaryAnimation, transitionType: type, + child: child, ); }, ); diff --git a/frontend/app_flowy/packages/flowy_infra_ui/lib/widget/seperated_column.dart b/frontend/app_flowy/packages/flowy_infra_ui/lib/widget/seperated_column.dart index f25a74426e..7362f989e5 100644 --- a/frontend/app_flowy/packages/flowy_infra_ui/lib/widget/seperated_column.dart +++ b/frontend/app_flowy/packages/flowy_infra_ui/lib/widget/seperated_column.dart @@ -31,13 +31,13 @@ class SeparatedColumn extends StatelessWidget { if (i > 0 && separatorBuilder != null) c.insert(i, separatorBuilder!()); } return Column( - children: c, mainAxisAlignment: mainAxisAlignment, crossAxisAlignment: crossAxisAlignment, mainAxisSize: mainAxisSize, textBaseline: textBaseline, textDirection: textDirection, verticalDirection: verticalDirection, + children: c, ); } } diff --git a/frontend/app_flowy/packages/flowy_infra_ui/pubspec.lock b/frontend/app_flowy/packages/flowy_infra_ui/pubspec.lock index c24e86d22d..143279950d 100644 --- a/frontend/app_flowy/packages/flowy_infra_ui/pubspec.lock +++ b/frontend/app_flowy/packages/flowy_infra_ui/pubspec.lock @@ -110,14 +110,14 @@ packages: name: flutter_lints url: "https://pub.dartlang.org" source: hosted - version: "1.0.4" + version: "2.0.1" flutter_svg: dependency: transitive description: name: flutter_svg url: "https://pub.dartlang.org" source: hosted - version: "0.22.0" + version: "1.1.4" flutter_test: dependency: "direct dev" description: flutter @@ -148,7 +148,7 @@ packages: name: lints url: "https://pub.dartlang.org" source: hosted - version: "1.0.1" + version: "2.0.0" loading_indicator: dependency: "direct main" description: @@ -197,21 +197,21 @@ packages: name: path_drawing url: "https://pub.dartlang.org" source: hosted - version: "0.5.1+1" + version: "1.0.1" path_parsing: dependency: transitive description: name: path_parsing url: "https://pub.dartlang.org" source: hosted - version: "0.2.1" + version: "1.0.1" petitparser: dependency: transitive description: name: petitparser url: "https://pub.dartlang.org" source: hosted - version: "4.4.0" + version: "5.0.0" plugin_platform_interface: dependency: transitive description: @@ -321,7 +321,7 @@ packages: name: xml url: "https://pub.dartlang.org" source: hosted - version: "5.3.1" + version: "6.1.0" sdks: - dart: ">=2.17.0-0 <3.0.0" - flutter: ">=2.0.0" + dart: ">=2.17.0 <3.0.0" + flutter: ">=2.11.0-0.1.pre" diff --git a/frontend/app_flowy/packages/flowy_infra_ui/pubspec.yaml b/frontend/app_flowy/packages/flowy_infra_ui/pubspec.yaml index e9473070a0..c95ba1119e 100644 --- a/frontend/app_flowy/packages/flowy_infra_ui/pubspec.yaml +++ b/frontend/app_flowy/packages/flowy_infra_ui/pubspec.yaml @@ -2,7 +2,7 @@ name: flowy_infra_ui description: A new flutter plugin project. version: 0.0.1 homepage: -publish_to: 'none' +publish_to: "none" environment: sdk: ">=2.12.0 <3.0.0" @@ -13,13 +13,14 @@ dependencies: sdk: flutter # Thirdparty packages - textstyle_extensions: '2.0.0-nullsafety' - dartz: '0.10.0-nullsafety.2' + textstyle_extensions: "2.0.0-nullsafety" + dartz: provider: ^6.0.1 - styled_widget: '^0.3.1' - equatable: '^2.0.3' + styled_widget: "^0.3.1" + equatable: "^2.0.3" animations: ^2.0.0 loading_indicator: ^3.0.1 + async: # Federated Platform Interface flowy_infra_ui_platform_interface: @@ -34,7 +35,7 @@ dependencies: dev_dependencies: flutter_test: sdk: flutter - flutter_lints: ^1.0.0 + flutter_lints: ^2.0.1 flutter: plugin: @@ -52,4 +53,4 @@ flutter: linux: pluginClass: FlowyInfraUIPlugin web: - default_package: flowy_infra_ui_web \ No newline at end of file + default_package: flowy_infra_ui_web diff --git a/frontend/app_flowy/packages/flowy_sdk/example/pubspec.yaml b/frontend/app_flowy/packages/flowy_sdk/example/pubspec.yaml index dbee825038..954a50e831 100644 --- a/frontend/app_flowy/packages/flowy_sdk/example/pubspec.yaml +++ b/frontend/app_flowy/packages/flowy_sdk/example/pubspec.yaml @@ -29,7 +29,7 @@ dev_dependencies: sdk: flutter integration_test: sdk: flutter - flutter_lints: ^1.0.0 + flutter_lints: ^2.0.1 # For information on the generic Dart part of this file, see the # following page: https://dart.dev/tools/pub/pubspec diff --git a/frontend/app_flowy/packages/flowy_sdk/pubspec.yaml b/frontend/app_flowy/packages/flowy_sdk/pubspec.yaml index 95ca835649..186381d848 100644 --- a/frontend/app_flowy/packages/flowy_sdk/pubspec.yaml +++ b/frontend/app_flowy/packages/flowy_sdk/pubspec.yaml @@ -14,7 +14,7 @@ dependencies: ffi: ^1.0.0 isolates: ^3.0.3+8 protobuf: "2.0.0" - dartz: "0.10.0-nullsafety.2" + dartz: ^0.10.1 freezed_annotation: logger: ^1.0.0 @@ -23,7 +23,7 @@ dev_dependencies: sdk: flutter build_runner: freezed: - flutter_lints: ^1.0.0 + flutter_lints: ^2.0.1 # For information on the generic Dart part of this file, see the # following page: https://dart.dev/tools/pub/pubspec diff --git a/frontend/app_flowy/pubspec.lock b/frontend/app_flowy/pubspec.lock index 8466696ec9..e2fef15056 100644 --- a/frontend/app_flowy/pubspec.lock +++ b/frontend/app_flowy/pubspec.lock @@ -7,14 +7,14 @@ packages: name: _fe_analyzer_shared url: "https://pub.dartlang.org" source: hosted - version: "44.0.0" + version: "46.0.0" analyzer: dependency: "direct overridden" description: name: analyzer url: "https://pub.dartlang.org" source: hosted - version: "4.4.0" + version: "4.6.0" animations: dependency: transitive description: @@ -51,12 +51,12 @@ packages: source: hosted version: "2.8.2" bloc: - dependency: transitive + dependency: "direct main" description: name: bloc url: "https://pub.dartlang.org" source: hosted - version: "8.0.3" + version: "8.1.0" bloc_test: dependency: "direct dev" description: @@ -84,7 +84,7 @@ packages: name: build_config url: "https://pub.dartlang.org" source: hosted - version: "1.0.0" + version: "1.1.0" build_daemon: dependency: transitive description: @@ -105,7 +105,7 @@ packages: name: build_runner url: "https://pub.dartlang.org" source: hosted - version: "2.1.11" + version: "2.2.0" build_runner_core: dependency: transitive description: @@ -135,7 +135,7 @@ packages: source: hosted version: "1.2.0" charcode: - dependency: transitive + dependency: "direct main" description: name: charcode url: "https://pub.dartlang.org" @@ -170,7 +170,7 @@ packages: source: hosted version: "4.1.0" collection: - dependency: transitive + dependency: "direct main" description: name: collection url: "https://pub.dartlang.org" @@ -182,7 +182,7 @@ packages: name: connectivity_plus url: "https://pub.dartlang.org" source: hosted - version: "2.2.0" + version: "2.3.6+1" connectivity_plus_linux: dependency: transitive description: @@ -196,7 +196,7 @@ packages: name: connectivity_plus_macos url: "https://pub.dartlang.org" source: hosted - version: "1.2.2" + version: "1.2.4" connectivity_plus_platform_interface: dependency: transitive description: @@ -210,14 +210,14 @@ packages: name: connectivity_plus_web url: "https://pub.dartlang.org" source: hosted - version: "1.2.0" + version: "1.2.3" connectivity_plus_windows: dependency: transitive description: name: connectivity_plus_windows url: "https://pub.dartlang.org" source: hosted - version: "1.2.0" + version: "1.2.2" convert: dependency: transitive description: @@ -268,12 +268,12 @@ packages: source: hosted version: "2.2.3" dartz: - dependency: transitive + dependency: "direct main" description: name: dartz url: "https://pub.dartlang.org" source: hosted - version: "0.10.0-nullsafety.2" + version: "0.10.1" dbus: dependency: transitive description: @@ -380,7 +380,7 @@ packages: source: hosted version: "6.1.2" fixnum: - dependency: transitive + dependency: "direct main" description: name: fixnum url: "https://pub.dartlang.org" @@ -474,7 +474,7 @@ packages: name: flutter_lints url: "https://pub.dartlang.org" source: hosted - version: "1.0.4" + version: "2.0.1" flutter_localizations: dependency: "direct main" description: flutter @@ -526,14 +526,14 @@ packages: name: freezed url: "https://pub.dartlang.org" source: hosted - version: "2.0.3+1" + version: "2.1.0+1" freezed_annotation: dependency: "direct main" description: name: freezed_annotation url: "https://pub.dartlang.org" source: hosted - version: "2.0.3" + version: "2.1.0" frontend_server_client: dependency: transitive description: @@ -701,7 +701,7 @@ packages: name: lints url: "https://pub.dartlang.org" source: hosted - version: "1.0.1" + version: "2.0.0" loading_indicator: dependency: transitive description: @@ -948,7 +948,7 @@ packages: source: hosted version: "4.2.4" protobuf: - dependency: transitive + dependency: "direct main" description: name: protobuf url: "https://pub.dartlang.org" @@ -1046,7 +1046,7 @@ packages: source: hosted version: "1.0.0" shared_preferences: - dependency: transitive + dependency: "direct main" description: name: shared_preferences url: "https://pub.dartlang.org" @@ -1268,7 +1268,7 @@ packages: source: hosted version: "2.0.0+1" textstyle_extensions: - dependency: transitive + dependency: "direct main" description: name: textstyle_extensions url: "https://pub.dartlang.org" @@ -1289,7 +1289,7 @@ packages: source: hosted version: "1.0.0" tuple: - dependency: transitive + dependency: "direct main" description: name: tuple url: "https://pub.dartlang.org" diff --git a/frontend/app_flowy/pubspec.yaml b/frontend/app_flowy/pubspec.yaml index 77412464ff..41fa98d7ea 100644 --- a/frontend/app_flowy/pubspec.yaml +++ b/frontend/app_flowy/pubspec.yaml @@ -50,9 +50,10 @@ dependencies: intl: ^0.17.0 time: "^2.0.0" equatable: "^2.0.3" - freezed_annotation: + freezed_annotation: ^2.1.0 get_it: "^7.1.3" flutter_bloc: "^8.0.1" + dartz: ^0.10.1 provider: ^6.0.1 path_provider: ^2.0.1 window_size: @@ -68,7 +69,7 @@ dependencies: url_launcher: ^6.0.2 # file_picker: ^4.2.1 clipboard: ^0.1.3 - connectivity_plus: 2.2.0 + connectivity_plus: ^2.3.6+1 easy_localization: ^3.0.0 textfield_tags: ^2.0.0 # The following adds the Cupertino Icons font to your application. @@ -80,13 +81,22 @@ dependencies: reorderables: ^0.5.0 linked_scroll_controller: ^0.2.0 hotkey_manager: ^0.1.7 + fixnum: ^1.0.1 + tuple: ^2.0.0 + protobuf: "2.0.0" + charcode: ^1.3.1 + collection: ^1.16.0 + bloc: ^8.1.0 + textstyle_extensions: "2.0.0-nullsafety" + shared_preferences: ^2.0.15 dev_dependencies: - flutter_lints: ^1.0.0 + flutter_lints: ^2.0.1 + flutter_test: sdk: flutter - build_runner: - freezed: + build_runner: ^2.2.0 + freezed: ^2.1.0+1 bloc_test: ^9.0.2 dependency_overrides: