Skip to content

Bring projects, wikis, and teams together with AI. AppFlowy is the AI collaborative workspace where you achieve more without losing control of your data. The leading open source Notion alternative.

Fix: Null check error in FlowyHoverContainer (#2148)

Yijing Huang9fff00f731ae
diff --git a/frontend/appflowy_flutter/lib/plugins/database_view/widgets/row/accessory/cell_accessory.dart b/frontend/appflowy_flutter/lib/plugins/database_view/widgets/row/accessory/cell_accessory.dart
index 031f957ef3..4433c9f43b 100644
--- a/frontend/appflowy_flutter/lib/plugins/database_view/widgets/row/accessory/cell_accessory.dart
+++ b/frontend/appflowy_flutter/lib/plugins/database_view/widgets/row/accessory/cell_accessory.dart
@@ -3,7 +3,6 @@ import 'package:flowy_infra/image.dart';
import 'package:flowy_infra_ui/style_widget/hover.dart';
import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
-import 'package:flowy_infra/size.dart';
import 'package:styled_widget/styled_widget.dart';
import 'package:appflowy/generated/locale_keys.g.dart';
import 'package:easy_localization/easy_localization.dart';
@@ -123,7 +122,6 @@ class _AccessoryHoverState extends State<AccessoryHover> {
@override
Widget build(BuildContext context) {
List<Widget> children = [
- const _Background(),
Padding(padding: widget.contentPadding, child: widget.child),
];
@@ -171,28 +169,6 @@ class AccessoryHoverState extends ChangeNotifier {
bool get onHover => _onHover;
}
-class _Background extends StatelessWidget {
- const _Background({Key? key}) : super(key: key);
-
- @override
- Widget build(BuildContext context) {
- return Consumer<AccessoryHoverState>(
- builder: (context, state, child) {
- if (state.onHover) {
- return FlowyHoverContainer(
- style: HoverStyle(
- borderRadius: Corners.s6Border,
- hoverColor: AFThemeExtension.of(context).lightGreyHover,
- ),
- );
- } else {
- return const SizedBox();
- }
- },
- );
- }
-}
-
class CellAccessoryContainer extends StatelessWidget {
final List<GridCellAccessoryBuilder> accessories;
const CellAccessoryContainer({required this.accessories, Key? key})
diff --git a/frontend/appflowy_flutter/packages/flowy_infra_ui/lib/style_widget/hover.dart b/frontend/appflowy_flutter/packages/flowy_infra_ui/lib/style_widget/hover.dart
index bf9d255e2f..687c62a4d9 100644
--- a/frontend/appflowy_flutter/packages/flowy_infra_ui/lib/style_widget/hover.dart
+++ b/frontend/appflowy_flutter/packages/flowy_infra_ui/lib/style_widget/hover.dart
@@ -115,11 +115,11 @@ class HoverStyle {
class FlowyHoverContainer extends StatelessWidget {
final HoverStyle style;
- final Widget? child;
+ final Widget child;
const FlowyHoverContainer({
Key? key,
- this.child,
+ required this.child,
required this.style,
}) : super(key: key);
@@ -151,7 +151,7 @@ class FlowyHoverContainer extends StatelessWidget {
.iconTheme
.copyWith(color: Theme.of(context).colorScheme.onSurface),
),
- child: child!,
+ child: child,
),
);
}