release 1.0.7, Close Issue #10 , 添加Logo位置设置
This commit is contained in:
@ -5,7 +5,7 @@ class AMapRadioGroup<T> extends StatefulWidget {
|
||||
final String? groupLabel;
|
||||
final T? groupValue;
|
||||
final Map<String, T>? radioValueMap;
|
||||
final ValueChanged<T>? onChanged;
|
||||
final ValueChanged<T?>? onChanged;
|
||||
AMapRadioGroup(
|
||||
{Key? key,
|
||||
this.groupLabel,
|
||||
@ -15,37 +15,35 @@ class AMapRadioGroup<T> extends StatefulWidget {
|
||||
: super(key: key);
|
||||
|
||||
@override
|
||||
_AMapRadioGroupState createState() => _AMapRadioGroupState();
|
||||
_AMapRadioGroupState<T> createState() => _AMapRadioGroupState<T>();
|
||||
}
|
||||
|
||||
class _AMapRadioGroupState extends State<AMapRadioGroup> {
|
||||
dynamic _groupValue;
|
||||
class _AMapRadioGroupState<T> extends State<AMapRadioGroup<T>> {
|
||||
T? _groupValue;
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
_groupValue = widget.groupValue ?? null;
|
||||
_groupValue = (widget.groupValue ?? null) as T?;
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
List<Widget> radioList = <Widget>[];
|
||||
_groupValue = widget.groupValue ?? null;
|
||||
_groupValue = (widget.groupValue ?? null) as T?;
|
||||
Widget _myRadio(String label, dynamic radioValue) {
|
||||
return Row(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
Text(label),
|
||||
Radio<dynamic>(
|
||||
Radio<T>(
|
||||
value: radioValue,
|
||||
groupValue: _groupValue,
|
||||
onChanged: (_value) {
|
||||
onChanged: (T? _value) {
|
||||
setState(() {
|
||||
_groupValue = _value;
|
||||
});
|
||||
if (null != widget.onChanged) {
|
||||
widget.onChanged!(_value);
|
||||
}
|
||||
widget.onChanged!(_value);
|
||||
},
|
||||
),
|
||||
],
|
||||
|
Reference in New Issue
Block a user