chore: run dart fix --apply

This commit is contained in:
appflowy
2022-08-31 09:19:31 +08:00
parent 94a440f773
commit a2d8fe9e80
43 changed files with 77 additions and 75 deletions

View File

@ -23,7 +23,7 @@ class BoardBloc extends Bloc<BoardEvent, BoardState> {
final BoardDataController _gridDataController; final BoardDataController _gridDataController;
late final AFBoardDataController boardController; late final AFBoardDataController boardController;
final MoveRowFFIService _rowService; final MoveRowFFIService _rowService;
LinkedHashMap<String, GroupController> groupControllers = LinkedHashMap.new(); LinkedHashMap<String, GroupController> groupControllers = LinkedHashMap();
GridFieldCache get fieldCache => _gridDataController.fieldCache; GridFieldCache get fieldCache => _gridDataController.fieldCache;
String get gridId => _gridDataController.gridId; String get gridId => _gridDataController.gridId;

View File

@ -52,7 +52,8 @@ class BoardDataController {
BoardDataController({required ViewPB view}) BoardDataController({required ViewPB view})
: gridId = view.id, : gridId = view.id,
_listener = BoardListener(view.id), _listener = BoardListener(view.id),
_blocks = LinkedHashMap.new(), // ignore: prefer_collection_literals
_blocks = LinkedHashMap(),
_gridFFIService = GridFFIService(gridId: view.id), _gridFFIService = GridFFIService(gridId: view.id),
fieldCache = GridFieldCache(gridId: view.id); fieldCache = GridFieldCache(gridId: view.id);

View File

@ -79,7 +79,7 @@ class BoardDateCellState with _$BoardDateCellState {
String _dateStrFromCellData(DateCellDataPB? cellData) { String _dateStrFromCellData(DateCellDataPB? cellData) {
String dateStr = ""; String dateStr = "";
if (cellData != null) { if (cellData != null) {
dateStr = cellData.date + " " + cellData.time; dateStr = "${cellData.date} ${cellData.time}";
} }
return dateStr; return dateStr;
} }

View File

@ -65,7 +65,7 @@ class _BoardSelectOptionCellState extends State<BoardSelectOptionCell> {
alignment: AlignmentDirectional.center, alignment: AlignmentDirectional.center,
fit: StackFit.expand, fit: StackFit.expand,
children: [ children: [
Wrap(children: children, spacing: 4, runSpacing: 2), Wrap(spacing: 4, runSpacing: 2, children: children),
_SelectOptionDialog( _SelectOptionDialog(
controller: widget.cellControllerBuilder.build(), controller: widget.cellControllerBuilder.build(),
), ),

View File

@ -26,8 +26,8 @@ class BoardCardContainer extends StatelessWidget {
final accessories = accessoryBuilder!(context); final accessories = accessoryBuilder!(context);
if (accessories.isNotEmpty) { if (accessories.isNotEmpty) {
container = _CardEnterRegion( container = _CardEnterRegion(
child: container,
accessories: accessories, accessories: accessories,
child: container,
); );
} }
} }
@ -78,9 +78,9 @@ class CardAccessoryContainer extends StatelessWidget {
), ),
); );
return GestureDetector( return GestureDetector(
child: hover,
behavior: HitTestBehavior.opaque, behavior: HitTestBehavior.opaque,
onTap: () => accessory.onTap(context), onTap: () => accessory.onTap(context),
child: hover,
); );
}).toList(); }).toList();

View File

@ -40,11 +40,11 @@ class DocumentBanner extends StatelessWidget {
downColor: theme.main1, downColor: theme.main1,
outlineColor: Colors.white, outlineColor: Colors.white,
borderRadius: Corners.s8Border, borderRadius: Corners.s8Border,
onPressed: onRestore,
child: FlowyText.medium( child: FlowyText.medium(
LocaleKeys.deletePagePrompt_restore.tr(), LocaleKeys.deletePagePrompt_restore.tr(),
color: Colors.white, color: Colors.white,
fontSize: 14), fontSize: 14)),
onPressed: onRestore),
const HSpace(20), const HSpace(20),
BaseStyledButton( BaseStyledButton(
minWidth: 220, minWidth: 220,
@ -55,11 +55,11 @@ class DocumentBanner extends StatelessWidget {
downColor: theme.main1, downColor: theme.main1,
outlineColor: Colors.white, outlineColor: Colors.white,
borderRadius: Corners.s8Border, borderRadius: Corners.s8Border,
onPressed: onDelete,
child: FlowyText.medium( child: FlowyText.medium(
LocaleKeys.deletePagePrompt_deletePermanent.tr(), LocaleKeys.deletePagePrompt_deletePermanent.tr(),
color: Colors.white, color: Colors.white,
fontSize: 14), fontSize: 14)),
onPressed: onDelete),
], ],
), ),
), ),

View File

@ -35,15 +35,15 @@ class _FlowyHeaderStyleButtonState extends State<FlowyHeaderStyleButton> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
final _valueToText = <Attribute, String>{ final valueToText = <Attribute, String>{
Attribute.h1: 'H1', Attribute.h1: 'H1',
Attribute.h2: 'H2', Attribute.h2: 'H2',
Attribute.h3: 'H3', Attribute.h3: 'H3',
}; };
final _valueAttribute = <Attribute>[Attribute.h1, Attribute.h2, Attribute.h3]; final valueAttribute = <Attribute>[Attribute.h1, Attribute.h2, Attribute.h3];
final _valueString = <String>['H1', 'H2', 'H3']; final valueString = <String>['H1', 'H2', 'H3'];
final _attributeImageName = <String>['editor/H1', 'editor/H2', 'editor/H3']; final attributeImageName = <String>['editor/H1', 'editor/H2', 'editor/H3'];
return Row( return Row(
mainAxisSize: MainAxisSize.min, mainAxisSize: MainAxisSize.min,
@ -52,18 +52,18 @@ class _FlowyHeaderStyleButtonState extends State<FlowyHeaderStyleButton> {
// _valueToText[_value] == _valueString[index] ? svg('editor/H1', color: Colors.white) : svg('editor/H1'); // _valueToText[_value] == _valueString[index] ? svg('editor/H1', color: Colors.white) : svg('editor/H1');
final headerTitle = "${LocaleKeys.toolbar_header.tr()} ${index + 1}"; final headerTitle = "${LocaleKeys.toolbar_header.tr()} ${index + 1}";
final _isToggled = _valueToText[_value] == _valueString[index]; final isToggled = valueToText[_value] == valueString[index];
return ToolbarIconButton( return ToolbarIconButton(
onPressed: () { onPressed: () {
if (_isToggled) { if (isToggled) {
widget.controller.formatSelection(Attribute.header); widget.controller.formatSelection(Attribute.header);
} else { } else {
widget.controller.formatSelection(_valueAttribute[index]); widget.controller.formatSelection(valueAttribute[index]);
} }
}, },
width: widget.iconSize * kIconButtonFactor, width: widget.iconSize * kIconButtonFactor,
iconName: _attributeImageName[index], iconName: attributeImageName[index],
isToggled: _isToggled, isToggled: isToggled,
tooltipText: headerTitle, tooltipText: headerTitle,
); );
}), }),

View File

@ -71,6 +71,6 @@ class GridCellIdentifier with _$GridCellIdentifier {
FieldType get fieldType => field.fieldType; FieldType get fieldType => field.fieldType;
ValueKey key() { ValueKey key() {
return ValueKey(rowId + fieldId + "${field.fieldType}"); return ValueKey("$rowId$fieldId${field.fieldType}");
} }
} }

View File

@ -119,13 +119,13 @@ class DateCalBloc extends Bloc<DateCalEvent, DateCalState> {
} }
String timeFormatPrompt(FlowyError error) { String timeFormatPrompt(FlowyError error) {
String msg = LocaleKeys.grid_field_invalidTimeFormat.tr() + ". "; String msg = "${LocaleKeys.grid_field_invalidTimeFormat.tr()}. ";
switch (state.dateTypeOptionPB.timeFormat) { switch (state.dateTypeOptionPB.timeFormat) {
case TimeFormat.TwelveHour: case TimeFormat.TwelveHour:
msg = msg + "e.g. 01: 00 AM"; msg = "${msg}e.g. 01: 00 AM";
break; break;
case TimeFormat.TwentyFourHour: case TimeFormat.TwentyFourHour:
msg = msg + "e.g. 13: 00"; msg = "${msg}e.g. 13: 00";
break; break;
default: default:
break; break;

View File

@ -79,7 +79,7 @@ class DateCellState with _$DateCellState {
String _dateStrFromCellData(DateCellDataPB? cellData) { String _dateStrFromCellData(DateCellDataPB? cellData) {
String dateStr = ""; String dateStr = "";
if (cellData != null) { if (cellData != null) {
dateStr = cellData.date + " " + cellData.time; dateStr = "${cellData.date} ${cellData.time}";
} }
return dateStr; return dateStr;
} }

View File

@ -46,7 +46,8 @@ class GridDataController {
GridDataController({required ViewPB view}) GridDataController({required ViewPB view})
: gridId = view.id, : gridId = view.id,
_blocks = LinkedHashMap.new(), // ignore: prefer_collection_literals
_blocks = LinkedHashMap(),
_gridFFIService = GridFFIService(gridId: view.id), _gridFFIService = GridFFIService(gridId: view.id),
fieldCache = GridFieldCache(gridId: view.id); fieldCache = GridFieldCache(gridId: view.id);

View File

@ -210,7 +210,8 @@ class GridRowCache {
} }
GridCellMap _makeGridCells(String rowId, RowPB? row) { GridCellMap _makeGridCells(String rowId, RowPB? row) {
var cellDataMap = GridCellMap.new(); // ignore: prefer_collection_literals
var cellDataMap = GridCellMap();
for (final field in _fieldNotifier.fields) { for (final field in _fieldNotifier.fields) {
if (field.visibility) { if (field.visibility) {
cellDataMap[field.id] = GridCellIdentifier( cellDataMap[field.id] = GridCellIdentifier(

View File

@ -190,12 +190,12 @@ class CellAccessoryContainer extends StatelessWidget {
), ),
); );
return GestureDetector( return GestureDetector(
child: hover,
behavior: HitTestBehavior.opaque, behavior: HitTestBehavior.opaque,
onTap: () => accessory.onTap(), onTap: () => accessory.onTap(),
child: hover,
); );
}).toList(); }).toList();
return Wrap(children: children, spacing: 6); return Wrap(spacing: 6, children: children);
} }
} }

View File

@ -44,8 +44,8 @@ class CellContainer extends StatelessWidget {
if (accessories.isNotEmpty) { if (accessories.isNotEmpty) {
container = _GridCellEnterRegion( container = _GridCellEnterRegion(
child: container,
accessories: accessories, accessories: accessories,
child: container,
); );
} }
} }

View File

@ -48,8 +48,8 @@ class DateCellEditor with FlowyOverlayDelegate {
FlowyOverlay.of(context).insertWithAnchor( FlowyOverlay.of(context).insertWithAnchor(
widget: OverlayContainer( widget: OverlayContainer(
child: calendar,
constraints: BoxConstraints.loose(const Size(320, 500)), constraints: BoxConstraints.loose(const Size(320, 500)),
child: calendar,
), ),
identifier: DateCellEditor.identifier(), identifier: DateCellEditor.identifier(),
anchorContext: context, anchorContext: context,
@ -304,9 +304,7 @@ class _DateTypeOptionButton extends StatelessWidget {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
final theme = context.watch<AppTheme>(); final theme = context.watch<AppTheme>();
final title = LocaleKeys.grid_field_dateFormat.tr() + final title = "${LocaleKeys.grid_field_dateFormat.tr()} &${LocaleKeys.grid_field_timeFormat.tr()}";
" &" +
LocaleKeys.grid_field_timeFormat.tr();
return BlocSelector<DateCalBloc, DateCalState, DateTypeOptionPB>( return BlocSelector<DateCalBloc, DateCalState, DateTypeOptionPB>(
selector: (state) => state.dateTypeOptionPB, selector: (state) => state.dateTypeOptionPB,
builder: (context, dateTypeOptionPB) { builder: (context, dateTypeOptionPB) {
@ -349,8 +347,8 @@ class _CalDateTimeSetting extends StatefulWidget {
hide(context); hide(context);
FlowyOverlay.of(context).insertWithAnchor( FlowyOverlay.of(context).insertWithAnchor(
widget: OverlayContainer( widget: OverlayContainer(
child: this,
constraints: BoxConstraints.loose(const Size(140, 100)), constraints: BoxConstraints.loose(const Size(140, 100)),
child: this,
), ),
identifier: _CalDateTimeSetting.identifier(), identifier: _CalDateTimeSetting.identifier(),
anchorContext: context, anchorContext: context,
@ -415,8 +413,8 @@ class _CalDateTimeSettingState extends State<_CalDateTimeSetting> {
overlayIdentifier = child.toString(); overlayIdentifier = child.toString();
FlowyOverlay.of(context).insertWithAnchor( FlowyOverlay.of(context).insertWithAnchor(
widget: OverlayContainer( widget: OverlayContainer(
child: child,
constraints: BoxConstraints.loose(const Size(460, 440)), constraints: BoxConstraints.loose(const Size(460, 440)),
child: child,
), ),
identifier: overlayIdentifier!, identifier: overlayIdentifier!,
anchorContext: context, anchorContext: context,

View File

@ -163,14 +163,14 @@ class SelectOptionWrap extends StatelessWidget {
child = Align( child = Align(
alignment: Alignment.centerLeft, alignment: Alignment.centerLeft,
child: Wrap( child: Wrap(
spacing: 4,
runSpacing: 2,
children: selectOptions children: selectOptions
.map((option) => SelectOptionTag.fromOption( .map((option) => SelectOptionTag.fromOption(
context: context, context: context,
option: option, option: option,
)) ))
.toList(), .toList(),
spacing: 4,
runSpacing: 2,
), ),
); );
} }

View File

@ -72,8 +72,8 @@ class SelectOptionCellEditor extends StatelessWidget with FlowyOverlayDelegate {
// //
FlowyOverlay.of(context).insertWithAnchor( FlowyOverlay.of(context).insertWithAnchor(
widget: OverlayContainer( widget: OverlayContainer(
child: SizedBox(width: _editorPannelWidth, child: editor),
constraints: BoxConstraints.loose(const Size(_editorPannelWidth, 300)), constraints: BoxConstraints.loose(const Size(_editorPannelWidth, 300)),
child: SizedBox(width: _editorPannelWidth, child: editor),
), ),
identifier: SelectOptionCellEditor.identifier(), identifier: SelectOptionCellEditor.identifier(),
anchorContext: context, anchorContext: context,
@ -289,8 +289,8 @@ class _SelectOptionCell extends StatelessWidget {
FlowyOverlay.of(context).remove(overlayIdentifier); FlowyOverlay.of(context).remove(overlayIdentifier);
FlowyOverlay.of(context).insertWithAnchor( FlowyOverlay.of(context).insertWithAnchor(
widget: OverlayContainer( widget: OverlayContainer(
child: pannel,
constraints: BoxConstraints.loose(const Size(200, 300)), constraints: BoxConstraints.loose(const Size(200, 300)),
child: pannel,
), ),
identifier: overlayIdentifier, identifier: overlayIdentifier,
anchorContext: context, anchorContext: context,

View File

@ -108,7 +108,7 @@ class SelectOptionTextField extends StatelessWidget {
child: SingleChildScrollView( child: SingleChildScrollView(
controller: sc, controller: sc,
scrollDirection: Axis.horizontal, scrollDirection: Axis.horizontal,
child: Wrap(children: children, spacing: 4), child: Wrap(spacing: 4, children: children),
), ),
); );
} }

View File

@ -30,11 +30,11 @@ class URLCellEditor extends StatefulWidget with FlowyOverlayDelegate {
// //
FlowyOverlay.of(context).insertWithAnchor( FlowyOverlay.of(context).insertWithAnchor(
widget: OverlayContainer( widget: OverlayContainer(
constraints: BoxConstraints.loose(const Size(300, 160)),
child: SizedBox( child: SizedBox(
width: 200, width: 200,
child: Padding(padding: const EdgeInsets.all(6), child: editor), child: Padding(padding: const EdgeInsets.all(6), child: editor),
), ),
constraints: BoxConstraints.loose(const Size(300, 160)),
), ),
identifier: URLCellEditor.identifier(), identifier: URLCellEditor.identifier(),
anchorContext: context, anchorContext: context,

View File

@ -24,8 +24,8 @@ class GridFieldCellActionSheet extends StatelessWidget
void show(BuildContext overlayContext) { void show(BuildContext overlayContext) {
FlowyOverlay.of(overlayContext).insertWithAnchor( FlowyOverlay.of(overlayContext).insertWithAnchor(
widget: OverlayContainer( widget: OverlayContainer(
child: this,
constraints: BoxConstraints.loose(const Size(240, 200)), constraints: BoxConstraints.loose(const Size(240, 200)),
child: this,
), ),
identifier: GridFieldCellActionSheet.identifier(), identifier: GridFieldCellActionSheet.identifier(),
anchorContext: overlayContext, anchorContext: overlayContext,

View File

@ -56,8 +56,8 @@ class FieldEditor extends StatelessWidget with FlowyOverlayDelegate {
FlowyOverlay.of(context).remove(identifier()); FlowyOverlay.of(context).remove(identifier());
FlowyOverlay.of(context).insertWithAnchor( FlowyOverlay.of(context).insertWithAnchor(
widget: OverlayContainer( widget: OverlayContainer(
child: this,
constraints: BoxConstraints.loose(const Size(280, 400)), constraints: BoxConstraints.loose(const Size(280, 400)),
child: this,
), ),
identifier: identifier(), identifier: identifier(),
anchorContext: context, anchorContext: context,

View File

@ -110,8 +110,8 @@ class _FieldTypeOptionEditorState extends State<FieldTypeOptionEditor> {
currentOverlayIdentifier = identifier; currentOverlayIdentifier = identifier;
FlowyOverlay.of(context).insertWithAnchor( FlowyOverlay.of(context).insertWithAnchor(
widget: OverlayContainer( widget: OverlayContainer(
child: child,
constraints: BoxConstraints.loose(const Size(460, 440)), constraints: BoxConstraints.loose(const Size(460, 440)),
child: child,
), ),
identifier: identifier, identifier: identifier,
anchorContext: context, anchorContext: context,

View File

@ -190,7 +190,6 @@ class RowContent extends StatelessWidget {
return CellContainer( return CellContainer(
width: cellId.field.width.toDouble(), width: cellId.field.width.toDouble(),
child: child,
rowStateNotifier: rowStateNotifier:
Provider.of<RegionStateNotifier>(context, listen: false), Provider.of<RegionStateNotifier>(context, listen: false),
accessoryBuilder: (buildContext) { accessoryBuilder: (buildContext) {
@ -208,6 +207,7 @@ class RowContent extends StatelessWidget {
} }
return accessories; return accessories;
}, },
child: child,
); );
}, },
).toList(); ).toList();

View File

@ -59,8 +59,8 @@ class GridRowActionSheet extends StatelessWidget {
}) { }) {
FlowyOverlay.of(overlayContext).insertWithAnchor( FlowyOverlay.of(overlayContext).insertWithAnchor(
widget: OverlayContainer( widget: OverlayContainer(
child: this,
constraints: BoxConstraints.loose(const Size(140, 200)), constraints: BoxConstraints.loose(const Size(140, 200)),
child: this,
), ),
identifier: GridRowActionSheet.identifier(), identifier: GridRowActionSheet.identifier(),
anchorContext: overlayContext, anchorContext: overlayContext,

View File

@ -38,8 +38,8 @@ class RowDetailPage extends StatefulWidget with FlowyOverlayDelegate {
final size = windowSize * 0.5; final size = windowSize * 0.5;
FlowyOverlay.of(context).insertWithRect( FlowyOverlay.of(context).insertWithRect(
widget: OverlayContainer( widget: OverlayContainer(
child: this,
constraints: BoxConstraints.tight(size), constraints: BoxConstraints.tight(size),
child: this,
), ),
identifier: RowDetailPage.identifier(), identifier: RowDetailPage.identifier(),
anchorPosition: Offset(-size.width / 2.0, -size.height / 2.0), anchorPosition: Offset(-size.width / 2.0, -size.height / 2.0),
@ -156,9 +156,9 @@ class _RowDetailCell extends StatelessWidget {
behavior: HitTestBehavior.translucent, behavior: HitTestBehavior.translucent,
onTap: () => cell.beginFocus.notify(), onTap: () => cell.beginFocus.notify(),
child: AccessoryHover( child: AccessoryHover(
child: cell,
contentPadding: contentPadding:
const EdgeInsets.symmetric(horizontal: 10, vertical: 12), const EdgeInsets.symmetric(horizontal: 10, vertical: 12),
child: cell,
), ),
); );

View File

@ -30,8 +30,8 @@ class GridPropertyList extends StatelessWidget with FlowyOverlayDelegate {
void show(BuildContext context) { void show(BuildContext context) {
FlowyOverlay.of(context).insertWithAnchor( FlowyOverlay.of(context).insertWithAnchor(
widget: OverlayContainer( widget: OverlayContainer(
child: this,
constraints: BoxConstraints.loose(const Size(260, 400)), constraints: BoxConstraints.loose(const Size(260, 400)),
child: this,
), ),
identifier: identifier(), identifier: identifier(),
anchorContext: context, anchorContext: context,

View File

@ -53,8 +53,8 @@ class GridSettingList extends StatelessWidget {
FlowyOverlay.of(context).insertWithAnchor( FlowyOverlay.of(context).insertWithAnchor(
widget: OverlayContainer( widget: OverlayContainer(
child: list,
constraints: BoxConstraints.loose(const Size(140, 400)), constraints: BoxConstraints.loose(const Size(140, 400)),
child: list,
), ),
identifier: list.identifier(), identifier: list.identifier(),
anchorContext: context, anchorContext: context,

View File

@ -91,12 +91,12 @@ class _TrashPageState extends State<TrashPage> {
builder: (context, state) { builder: (context, state) {
return SizedBox.expand( return SizedBox.expand(
child: Column( child: Column(
mainAxisAlignment: MainAxisAlignment.start,
children: [ children: [
_renderTopBar(context, theme, state), _renderTopBar(context, theme, state),
const VSpace(32), const VSpace(32),
_renderTrashList(context, state), _renderTrashList(context, state),
], ],
mainAxisAlignment: MainAxisAlignment.start,
).padding(horizontal: horizontalPadding, vertical: 48), ).padding(horizontal: horizontalPadding, vertical: 48),
); );
}, },

View File

@ -20,8 +20,8 @@ class InitAppWidgetTask extends LaunchTask {
final setting = await UserSettingsService().getAppearanceSettings(); final setting = await UserSettingsService().getAppearanceSettings();
final settingModel = AppearanceSettingModel(setting); final settingModel = AppearanceSettingModel(setting);
final app = ApplicationWidget( final app = ApplicationWidget(
child: widget,
settingModel: settingModel, settingModel: settingModel,
child: widget,
); );
BlocOverrides.runZoned( BlocOverrides.runZoned(
() { () {

View File

@ -94,6 +94,7 @@ class SignUpPrompt extends StatelessWidget {
Widget build(BuildContext context) { Widget build(BuildContext context) {
final theme = context.watch<AppTheme>(); final theme = context.watch<AppTheme>();
return Row( return Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [ children: [
Text(LocaleKeys.signIn_dontHaveAnAccount.tr(), style: TextStyle(color: theme.shader3, fontSize: 12)), Text(LocaleKeys.signIn_dontHaveAnAccount.tr(), style: TextStyle(color: theme.shader3, fontSize: 12)),
TextButton( TextButton(
@ -107,7 +108,6 @@ class SignUpPrompt extends StatelessWidget {
), ),
), ),
], ],
mainAxisAlignment: MainAxisAlignment.center,
); );
} }
} }

View File

@ -86,6 +86,7 @@ class SignUpPrompt extends StatelessWidget {
Widget build(BuildContext context) { Widget build(BuildContext context) {
final theme = context.watch<AppTheme>(); final theme = context.watch<AppTheme>();
return Row( return Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [ children: [
Text( Text(
LocaleKeys.signUp_alreadyHaveAnAccount.tr(), LocaleKeys.signUp_alreadyHaveAnAccount.tr(),
@ -97,7 +98,6 @@ class SignUpPrompt extends StatelessWidget {
child: Text(LocaleKeys.signIn_buttonText.tr(), style: TextStyle(color: theme.main1)), child: Text(LocaleKeys.signIn_buttonText.tr(), style: TextStyle(color: theme.main1)),
), ),
], ],
mainAxisAlignment: MainAxisAlignment.center,
); );
} }
} }

View File

@ -13,14 +13,14 @@ class HomeHotKeys extends StatelessWidget {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
HotKey _hotKey = HotKey( HotKey hotKey = HotKey(
KeyCode.backslash, KeyCode.backslash,
modifiers: [Platform.isMacOS ? KeyModifier.meta : KeyModifier.control], modifiers: [Platform.isMacOS ? KeyModifier.meta : KeyModifier.control],
// Set hotkey scope (default is HotKeyScope.system) // Set hotkey scope (default is HotKeyScope.system)
scope: HotKeyScope.inapp, // Set as inapp-wide hotkey. scope: HotKeyScope.inapp, // Set as inapp-wide hotkey.
); );
hotKeyManager.register( hotKeyManager.register(
_hotKey, hotKey,
keyDownHandler: (hotKey) { keyDownHandler: (hotKey) {
context.read<HomeBloc>().add(const HomeEvent.collapseMenu()); context.read<HomeBloc>().add(const HomeEvent.collapseMenu());
getIt<HomeStackManager>().collapsedNotifier.value = getIt<HomeStackManager>().collapsedNotifier.value =

View File

@ -222,7 +222,7 @@ class MenuTopBar extends StatelessWidget {
Tooltip( Tooltip(
richMessage: TextSpan(children: [ richMessage: TextSpan(children: [
TextSpan( TextSpan(
text: LocaleKeys.sideBar_closeSidebar.tr() + "\n"), text: "${LocaleKeys.sideBar_closeSidebar.tr()}\n"),
TextSpan( TextSpan(
text: Platform.isMacOS ? "⌘+\\" : "Ctrl+\\", text: Platform.isMacOS ? "⌘+\\" : "Ctrl+\\",
style: const TextStyle(color: Colors.white60), style: const TextStyle(color: Colors.white60),

View File

@ -24,6 +24,7 @@ class MenuUser extends StatelessWidget {
getIt<MenuUserBloc>(param1: user)..add(const MenuUserEvent.initial()), getIt<MenuUserBloc>(param1: user)..add(const MenuUserEvent.initial()),
child: BlocBuilder<MenuUserBloc, MenuUserState>( child: BlocBuilder<MenuUserBloc, MenuUserState>(
builder: (context, state) => Row( builder: (context, state) => Row(
crossAxisAlignment: CrossAxisAlignment.center,
children: [ children: [
_renderAvatar(context), _renderAvatar(context),
const HSpace(10), const HSpace(10),
@ -34,7 +35,6 @@ class MenuUser extends StatelessWidget {
//we get the below block back //we get the below block back
//_renderDropButton(context), //_renderDropButton(context),
], ],
crossAxisAlignment: CrossAxisAlignment.center,
), ),
), ),
); );

View File

@ -101,7 +101,7 @@ class FlowyNavigation extends StatelessWidget {
turns: const AlwaysStoppedAnimation(180 / 360), turns: const AlwaysStoppedAnimation(180 / 360),
child: Tooltip( child: Tooltip(
richMessage: TextSpan(children: [ richMessage: TextSpan(children: [
TextSpan(text: LocaleKeys.sideBar_openSidebar.tr() + "\n"), TextSpan(text: "${LocaleKeys.sideBar_openSidebar.tr()}\n"),
TextSpan( TextSpan(
text: Platform.isMacOS ? "⌘+\\" : "Ctrl+\\", text: Platform.isMacOS ? "⌘+\\" : "Ctrl+\\",
style: const TextStyle(color: Colors.white60), style: const TextStyle(color: Colors.white60),

View File

@ -10,14 +10,14 @@ class FlowyMessageToast extends StatelessWidget {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Container( return Container(
child: Padding(
padding: const EdgeInsets.symmetric(horizontal: 12, vertical: 6),
child: FlowyText.medium(message, color: Colors.white),
),
decoration: const BoxDecoration( decoration: const BoxDecoration(
borderRadius: BorderRadius.all(Radius.circular(4)), borderRadius: BorderRadius.all(Radius.circular(4)),
color: Colors.black, color: Colors.black,
), ),
child: Padding(
padding: const EdgeInsets.symmetric(horizontal: 12, vertical: 6),
child: FlowyText.medium(message, color: Colors.white),
),
); );
} }
} }

View File

@ -84,8 +84,8 @@ class _LanguageSelectorDropdownState extends State<LanguageSelectorDropdown> {
}); });
}, },
icon: const Visibility( icon: const Visibility(
child: (Icon(Icons.arrow_downward)),
visible: false, visible: false,
child: (Icon(Icons.arrow_downward)),
), ),
borderRadius: BorderRadius.circular(8), borderRadius: BorderRadius.circular(8),
items: EasyLocalization.of(context)!.supportedLocales.map((locale) { items: EasyLocalization.of(context)!.supportedLocales.map((locale) {

View File

@ -79,9 +79,9 @@ extension AnimatedPanelExtensions on Widget {
return AnimatedPanel( return AnimatedPanel(
closedX: closePos.dx, closedX: closePos.dx,
closedY: closePos.dy, closedY: closePos.dy,
child: this,
isClosed: isClosed ?? false, isClosed: isClosed ?? false,
duration: duration ?? .35, duration: duration ?? .35,
curve: curve); curve: curve,
child: this);
} }
} }

View File

@ -199,8 +199,8 @@ class _DefaultEmojiPickerViewState extends State<DefaultEmojiPickerView> with Ti
if (widget.config.buttonMode == ButtonMode.MATERIAL) { if (widget.config.buttonMode == ButtonMode.MATERIAL) {
return TextButton( return TextButton(
onPressed: onPressed, onPressed: onPressed,
child: child,
style: ButtonStyle(padding: MaterialStateProperty.all(EdgeInsets.zero)), 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);

View File

@ -87,7 +87,7 @@ class _DebugToast {
return deviceInfo.then((info) { return deviceInfo.then((info) {
var debugText = ""; var debugText = "";
info.toMap().forEach((key, value) { info.toMap().forEach((key, value) {
debugText = debugText + "$key: $value\n"; debugText = "$debugText$key: $value\n";
}); });
return debugText; return debugText;
}); });

View File

@ -10,8 +10,8 @@ class FlowyPoppuWindow extends StatelessWidget {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Material( return Material(
child: child,
type: MaterialType.transparency, type: MaterialType.transparency,
child: child,
); );
} }

View File

@ -7,14 +7,14 @@ packages:
name: _fe_analyzer_shared name: _fe_analyzer_shared
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "44.0.0" version: "46.0.0"
analyzer: analyzer:
dependency: "direct overridden" dependency: "direct overridden"
description: description:
name: analyzer name: analyzer
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "4.4.0" version: "4.6.0"
animations: animations:
dependency: transitive dependency: transitive
description: description:
@ -182,7 +182,7 @@ packages:
name: connectivity_plus name: connectivity_plus
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "2.2.0" version: "2.3.6+1"
connectivity_plus_linux: connectivity_plus_linux:
dependency: transitive dependency: transitive
description: description:
@ -196,7 +196,7 @@ packages:
name: connectivity_plus_macos name: connectivity_plus_macos
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.2.2" version: "1.2.4"
connectivity_plus_platform_interface: connectivity_plus_platform_interface:
dependency: transitive dependency: transitive
description: description:
@ -210,14 +210,14 @@ packages:
name: connectivity_plus_web name: connectivity_plus_web
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.2.0" version: "1.2.3"
connectivity_plus_windows: connectivity_plus_windows:
dependency: transitive dependency: transitive
description: description:
name: connectivity_plus_windows name: connectivity_plus_windows
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.2.0" version: "1.2.2"
convert: convert:
dependency: transitive dependency: transitive
description: description:

View File

@ -81,6 +81,7 @@ dependencies:
reorderables: ^0.5.0 reorderables: ^0.5.0
linked_scroll_controller: ^0.2.0 linked_scroll_controller: ^0.2.0
hotkey_manager: ^0.1.7 hotkey_manager: ^0.1.7
fixnum: ^1.0.1
dev_dependencies: dev_dependencies:
flutter_lints: ^2.0.1 flutter_lints: ^2.0.1