mirror of
https://github.com/AppFlowy-IO/AppFlowy.git
synced 2024-08-30 18:12:39 +00:00
Fix: Null check error in FlowyHoverContainer (#2148)
* fix: fix null check error in FlowyHoverContainer and delete unnecessary widget * chore: set child to required in FlowyHoverContainer * chore: delete unused import file
This commit is contained in:
parent
fc004c319b
commit
9fff00f731
@ -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})
|
||||
|
@ -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,
|
||||
),
|
||||
);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user