null safety
This commit is contained in:
@@ -5,10 +5,10 @@ import 'package:flutter/material.dart';
|
||||
import 'callbacks.dart';
|
||||
|
||||
class FcsExpansionTile extends StatefulWidget {
|
||||
final ValueChanged<bool> onExpansionChanged;
|
||||
final CallBack onEditPress;
|
||||
final List<Widget> children;
|
||||
final Widget title;
|
||||
final ValueChanged<bool>? onExpansionChanged;
|
||||
final CallBack? onEditPress;
|
||||
final List<Widget>? children;
|
||||
final Widget? title;
|
||||
final bool isEdit;
|
||||
const FcsExpansionTile(
|
||||
{this.onExpansionChanged,
|
||||
@@ -21,7 +21,7 @@ class FcsExpansionTile extends StatefulWidget {
|
||||
}
|
||||
|
||||
class _FcsExpansionTileState extends State<FcsExpansionTile> {
|
||||
bool expanded;
|
||||
bool? expanded;
|
||||
@override
|
||||
void initState() {
|
||||
this.expanded = false;
|
||||
@@ -39,22 +39,22 @@ class _FcsExpansionTileState extends State<FcsExpansionTile> {
|
||||
expanded = value;
|
||||
});
|
||||
if (widget.onExpansionChanged != null)
|
||||
widget.onExpansionChanged(value);
|
||||
widget.onExpansionChanged!(value);
|
||||
},
|
||||
title: widget.title,
|
||||
children: widget.children,
|
||||
title: widget.title != null ? widget.title! : Container(),
|
||||
children: widget.children != null ? widget.children! : [Container()],
|
||||
trailing: widget.isEdit
|
||||
? IconButton(
|
||||
padding: EdgeInsets.all(0),
|
||||
iconSize: 20,
|
||||
onPressed: () =>
|
||||
widget.onEditPress != null ? widget.onEditPress() : {},
|
||||
widget.onEditPress != null ? widget.onEditPress!() : {},
|
||||
icon: Icon(
|
||||
Icons.edit,
|
||||
color: primaryColor,
|
||||
))
|
||||
: AnimatedSwitcher(
|
||||
child: expanded
|
||||
child: expanded!
|
||||
? Icon(
|
||||
Icons.remove,
|
||||
color: primaryColor,
|
||||
|
||||
Reference in New Issue
Block a user