Skip to content

Commit 7b53b2c

Browse files
authored
Merge pull request #945 from AppFlowy-IO/feat/update_flutter_packages
Feat/update flutter packages
2 parents 8b7b18b + 28f3948 commit 7b53b2c

File tree

87 files changed

+449
-324
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

87 files changed

+449
-324
lines changed

frontend/app_flowy/lib/core/frameless_window.dart

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,10 @@ class MoveWindowDetector extends StatefulWidget {
3131
final Widget? child;
3232

3333
@override
34-
_MoveWindowDetectorState createState() => _MoveWindowDetectorState();
34+
MoveWindowDetectorState createState() => MoveWindowDetectorState();
3535
}
3636

37-
class _MoveWindowDetectorState extends State<MoveWindowDetector> {
37+
class MoveWindowDetectorState extends State<MoveWindowDetector> {
3838
double winX = 0;
3939
double winY = 0;
4040

@@ -59,7 +59,8 @@ class _MoveWindowDetectorState extends State<MoveWindowDetector> {
5959
final double dy = windowPos[1];
6060
final deltaX = details.globalPosition.dx - winX;
6161
final deltaY = details.globalPosition.dy - winY;
62-
await CocoaWindowChannel.instance.setWindowPosition(Offset(dx + deltaX, dy - deltaY));
62+
await CocoaWindowChannel.instance
63+
.setWindowPosition(Offset(dx + deltaX, dy - deltaY));
6364
},
6465
child: widget.child,
6566
);

frontend/app_flowy/lib/plugins/board/application/board_bloc.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ class BoardBloc extends Bloc<BoardEvent, BoardState> {
2323
final BoardDataController _gridDataController;
2424
late final AFBoardDataController boardController;
2525
final MoveRowFFIService _rowService;
26-
LinkedHashMap<String, GroupController> groupControllers = LinkedHashMap.new();
26+
LinkedHashMap<String, GroupController> groupControllers = LinkedHashMap();
2727

2828
GridFieldCache get fieldCache => _gridDataController.fieldCache;
2929
String get gridId => _gridDataController.gridId;

frontend/app_flowy/lib/plugins/board/application/board_data_controller.dart

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,8 @@ class BoardDataController {
5252
BoardDataController({required ViewPB view})
5353
: gridId = view.id,
5454
_listener = BoardListener(view.id),
55-
_blocks = LinkedHashMap.new(),
55+
// ignore: prefer_collection_literals
56+
_blocks = LinkedHashMap(),
5657
_gridFFIService = GridFFIService(gridId: view.id),
5758
fieldCache = GridFieldCache(gridId: view.id);
5859

frontend/app_flowy/lib/plugins/board/application/card/board_date_cell_bloc.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ class BoardDateCellState with _$BoardDateCellState {
7979
String _dateStrFromCellData(DateCellDataPB? cellData) {
8080
String dateStr = "";
8181
if (cellData != null) {
82-
dateStr = cellData.date + " " + cellData.time;
82+
dateStr = "${cellData.date} ${cellData.time}";
8383
}
8484
return dateStr;
8585
}

frontend/app_flowy/lib/plugins/board/presentation/card/board_select_option_cell.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ class _BoardSelectOptionCellState extends State<BoardSelectOptionCell> {
6565
alignment: AlignmentDirectional.center,
6666
fit: StackFit.expand,
6767
children: [
68-
Wrap(children: children, spacing: 4, runSpacing: 2),
68+
Wrap(spacing: 4, runSpacing: 2, children: children),
6969
_SelectOptionDialog(
7070
controller: widget.cellControllerBuilder.build(),
7171
),

frontend/app_flowy/lib/plugins/board/presentation/card/card_container.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@ class BoardCardContainer extends StatelessWidget {
2626
final accessories = accessoryBuilder!(context);
2727
if (accessories.isNotEmpty) {
2828
container = _CardEnterRegion(
29-
child: container,
3029
accessories: accessories,
30+
child: container,
3131
);
3232
}
3333
}
@@ -78,9 +78,9 @@ class CardAccessoryContainer extends StatelessWidget {
7878
),
7979
);
8080
return GestureDetector(
81-
child: hover,
8281
behavior: HitTestBehavior.opaque,
8382
onTap: () => accessory.onTap(context),
83+
child: hover,
8484
);
8585
}).toList();
8686

frontend/app_flowy/lib/plugins/doc/presentation/banner.dart

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,11 +40,11 @@ class DocumentBanner extends StatelessWidget {
4040
downColor: theme.main1,
4141
outlineColor: Colors.white,
4242
borderRadius: Corners.s8Border,
43+
onPressed: onRestore,
4344
child: FlowyText.medium(
4445
LocaleKeys.deletePagePrompt_restore.tr(),
4546
color: Colors.white,
46-
fontSize: 14),
47-
onPressed: onRestore),
47+
fontSize: 14)),
4848
const HSpace(20),
4949
BaseStyledButton(
5050
minWidth: 220,
@@ -55,11 +55,11 @@ class DocumentBanner extends StatelessWidget {
5555
downColor: theme.main1,
5656
outlineColor: Colors.white,
5757
borderRadius: Corners.s8Border,
58+
onPressed: onDelete,
5859
child: FlowyText.medium(
5960
LocaleKeys.deletePagePrompt_deletePermanent.tr(),
6061
color: Colors.white,
61-
fontSize: 14),
62-
onPressed: onDelete),
62+
fontSize: 14)),
6363
],
6464
),
6565
),

frontend/app_flowy/lib/plugins/doc/presentation/style_widgets.dart

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,10 @@ class EditorCheckboxBuilder extends QuillCheckboxBuilder {
1616
EditorCheckboxBuilder(this.theme);
1717

1818
@override
19-
Widget build({required BuildContext context, required bool isChecked, required ValueChanged<bool> onChanged}) {
19+
Widget build(
20+
{required BuildContext context,
21+
required bool isChecked,
22+
required ValueChanged<bool> onChanged}) {
2023
return FlowyEditorCheckbox(
2124
theme: theme,
2225
isChecked: isChecked,
@@ -37,10 +40,10 @@ class FlowyEditorCheckbox extends StatefulWidget {
3740
}) : super(key: key);
3841

3942
@override
40-
_FlowyEditorCheckboxState createState() => _FlowyEditorCheckboxState();
43+
FlowyEditorCheckboxState createState() => FlowyEditorCheckboxState();
4144
}
4245

43-
class _FlowyEditorCheckboxState extends State<FlowyEditorCheckbox> {
46+
class FlowyEditorCheckboxState extends State<FlowyEditorCheckbox> {
4447
late bool isChecked;
4548

4649
@override
@@ -51,7 +54,9 @@ class _FlowyEditorCheckboxState extends State<FlowyEditorCheckbox> {
5154

5255
@override
5356
Widget build(BuildContext context) {
54-
final icon = isChecked ? svgWidget('editor/editor_check') : svgWidget('editor/editor_uncheck');
57+
final icon = isChecked
58+
? svgWidget('editor/editor_check')
59+
: svgWidget('editor/editor_uncheck');
5560
return Align(
5661
alignment: Alignment.centerLeft,
5762
child: FlowyIconButton(

frontend/app_flowy/lib/plugins/doc/presentation/toolbar/check_button.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,10 @@ class FlowyCheckListButton extends StatefulWidget {
2828
final String tooltipText;
2929

3030
@override
31-
_FlowyCheckListButtonState createState() => _FlowyCheckListButtonState();
31+
FlowyCheckListButtonState createState() => FlowyCheckListButtonState();
3232
}
3333

34-
class _FlowyCheckListButtonState extends State<FlowyCheckListButton> {
34+
class FlowyCheckListButtonState extends State<FlowyCheckListButton> {
3535
bool? _isToggled;
3636

3737
Style get _selectionStyle => widget.controller.getSelectionStyle();

frontend/app_flowy/lib/plugins/doc/presentation/toolbar/color_picker.dart

Lines changed: 42 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,10 @@ class FlowyColorButton extends StatefulWidget {
2424
final QuillIconTheme? iconTheme;
2525

2626
@override
27-
_FlowyColorButtonState createState() => _FlowyColorButtonState();
27+
FlowyColorButtonState createState() => FlowyColorButtonState();
2828
}
2929

30-
class _FlowyColorButtonState extends State<FlowyColorButton> {
30+
class FlowyColorButtonState extends State<FlowyColorButton> {
3131
late bool _isToggledColor;
3232
late bool _isToggledBackground;
3333
late bool _isWhite;
@@ -37,10 +37,14 @@ class _FlowyColorButtonState extends State<FlowyColorButton> {
3737

3838
void _didChangeEditingValue() {
3939
setState(() {
40-
_isToggledColor = _getIsToggledColor(widget.controller.getSelectionStyle().attributes);
41-
_isToggledBackground = _getIsToggledBackground(widget.controller.getSelectionStyle().attributes);
42-
_isWhite = _isToggledColor && _selectionStyle.attributes['color']!.value == '#ffffff';
43-
_isWhitebackground = _isToggledBackground && _selectionStyle.attributes['background']!.value == '#ffffff';
40+
_isToggledColor =
41+
_getIsToggledColor(widget.controller.getSelectionStyle().attributes);
42+
_isToggledBackground = _getIsToggledBackground(
43+
widget.controller.getSelectionStyle().attributes);
44+
_isWhite = _isToggledColor &&
45+
_selectionStyle.attributes['color']!.value == '#ffffff';
46+
_isWhitebackground = _isToggledBackground &&
47+
_selectionStyle.attributes['background']!.value == '#ffffff';
4448
});
4549
}
4650

@@ -49,8 +53,10 @@ class _FlowyColorButtonState extends State<FlowyColorButton> {
4953
super.initState();
5054
_isToggledColor = _getIsToggledColor(_selectionStyle.attributes);
5155
_isToggledBackground = _getIsToggledBackground(_selectionStyle.attributes);
52-
_isWhite = _isToggledColor && _selectionStyle.attributes['color']!.value == '#ffffff';
53-
_isWhitebackground = _isToggledBackground && _selectionStyle.attributes['background']!.value == '#ffffff';
56+
_isWhite = _isToggledColor &&
57+
_selectionStyle.attributes['color']!.value == '#ffffff';
58+
_isWhitebackground = _isToggledBackground &&
59+
_selectionStyle.attributes['background']!.value == '#ffffff';
5460
widget.controller.addListener(_didChangeEditingValue);
5561
}
5662

@@ -69,9 +75,12 @@ class _FlowyColorButtonState extends State<FlowyColorButton> {
6975
oldWidget.controller.removeListener(_didChangeEditingValue);
7076
widget.controller.addListener(_didChangeEditingValue);
7177
_isToggledColor = _getIsToggledColor(_selectionStyle.attributes);
72-
_isToggledBackground = _getIsToggledBackground(_selectionStyle.attributes);
73-
_isWhite = _isToggledColor && _selectionStyle.attributes['color']!.value == '#ffffff';
74-
_isWhitebackground = _isToggledBackground && _selectionStyle.attributes['background']!.value == '#ffffff';
78+
_isToggledBackground =
79+
_getIsToggledBackground(_selectionStyle.attributes);
80+
_isWhite = _isToggledColor &&
81+
_selectionStyle.attributes['color']!.value == '#ffffff';
82+
_isWhitebackground = _isToggledBackground &&
83+
_selectionStyle.attributes['background']!.value == '#ffffff';
7584
}
7685
}
7786

@@ -88,9 +97,10 @@ class _FlowyColorButtonState extends State<FlowyColorButton> {
8897
final fillColor = _isToggledColor && !widget.background && _isWhite
8998
? stringToColor('#ffffff')
9099
: (widget.iconTheme?.iconUnselectedFillColor ?? theme.canvasColor);
91-
final fillColorBackground = _isToggledBackground && widget.background && _isWhitebackground
92-
? stringToColor('#ffffff')
93-
: (widget.iconTheme?.iconUnselectedFillColor ?? theme.canvasColor);
100+
final fillColorBackground =
101+
_isToggledBackground && widget.background && _isWhitebackground
102+
? stringToColor('#ffffff')
103+
: (widget.iconTheme?.iconUnselectedFillColor ?? theme.canvasColor);
94104

95105
return Tooltip(
96106
message: LocaleKeys.toolbar_highlight.tr(),
@@ -99,7 +109,8 @@ class _FlowyColorButtonState extends State<FlowyColorButton> {
99109
highlightElevation: 0,
100110
hoverElevation: 0,
101111
size: widget.iconSize * kIconButtonFactor,
102-
icon: Icon(widget.icon, size: widget.iconSize, color: theme.iconTheme.color),
112+
icon: Icon(widget.icon,
113+
size: widget.iconSize, color: theme.iconTheme.color),
103114
fillColor: widget.background ? fillColorBackground : fillColor,
104115
onPressed: _showColorPicker,
105116
),
@@ -112,13 +123,16 @@ class _FlowyColorButtonState extends State<FlowyColorButton> {
112123
hex = hex.substring(2);
113124
}
114125
hex = '#$hex';
115-
widget.controller.formatSelection(widget.background ? BackgroundAttribute(hex) : ColorAttribute(hex));
126+
widget.controller.formatSelection(
127+
widget.background ? BackgroundAttribute(hex) : ColorAttribute(hex));
116128
Navigator.of(context).pop();
117129
}
118130

119131
void _showColorPicker() {
120132
final style = widget.controller.getSelectionStyle();
121-
final values = style.values.where((v) => v.key == Attribute.background.key).map((v) => v.value);
133+
final values = style.values
134+
.where((v) => v.key == Attribute.background.key)
135+
.map((v) => v.value);
122136
int initialColor = 0;
123137
if (values.isNotEmpty) {
124138
assert(values.length == 1);
@@ -160,7 +174,9 @@ class FlowyColorPicker extends StatefulWidget {
160174
];
161175
final Function(Color?) onColorChanged;
162176
final int initialColor;
163-
FlowyColorPicker({Key? key, required this.onColorChanged, this.initialColor = 0}) : super(key: key);
177+
FlowyColorPicker(
178+
{Key? key, required this.onColorChanged, this.initialColor = 0})
179+
: super(key: key);
164180

165181
@override
166182
State<FlowyColorPicker> createState() => _FlowyColorPickerState();
@@ -178,8 +194,10 @@ class _FlowyColorPickerState extends State<FlowyColorPicker> {
178194
const double crossAxisSpacing = 10;
179195
final numberOfRows = (widget.colors.length / crossAxisCount).ceil();
180196

181-
const perRowHeight = ((width - ((crossAxisCount - 1) * mainAxisSpacing)) / crossAxisCount);
182-
final totalHeight = numberOfRows * perRowHeight + numberOfRows * crossAxisSpacing;
197+
const perRowHeight =
198+
((width - ((crossAxisCount - 1) * mainAxisSpacing)) / crossAxisCount);
199+
final totalHeight =
200+
numberOfRows * perRowHeight + numberOfRows * crossAxisSpacing;
183201

184202
return Container(
185203
constraints: BoxConstraints.tightFor(width: width, height: totalHeight),
@@ -198,7 +216,8 @@ class _FlowyColorPickerState extends State<FlowyColorPicker> {
198216
delegate: SliverChildBuilderDelegate(
199217
(BuildContext context, int index) {
200218
if (widget.colors.length > index) {
201-
final isSelected = widget.colors[index] == widget.initialColor;
219+
final isSelected =
220+
widget.colors[index] == widget.initialColor;
202221
return ColorItem(
203222
color: Color(widget.colors[index]),
204223
onPressed: widget.onColorChanged,
@@ -242,7 +261,8 @@ class ColorItem extends StatelessWidget {
242261
);
243262
} else {
244263
return RawMaterialButton(
245-
shape: const CircleBorder(side: BorderSide(color: Colors.white, width: 8)) +
264+
shape: const CircleBorder(
265+
side: BorderSide(color: Colors.white, width: 8)) +
246266
CircleBorder(side: BorderSide(color: color, width: 4)),
247267
onPressed: () {
248268
if (isSelected) {

0 commit comments

Comments
 (0)