mirror of
https://github.com/Such-Software/hash-wallet.git
synced 2026-11-19 10:04:17 +01:00
Flutter upgrade
This commit is contained in:
@@ -1,23 +1,20 @@
|
||||
import 'dart:ui';
|
||||
import 'package:cake_wallet/palette.dart';
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:cake_wallet/src/widgets/alert_background.dart';
|
||||
import 'package:cake_wallet/src/widgets/alert_close_button.dart';
|
||||
import 'package:cake_wallet/generated/i18n.dart';
|
||||
|
||||
class CheckBoxPicker extends StatefulWidget {
|
||||
CheckBoxPicker({
|
||||
@required this.items,
|
||||
@required this.onChanged,
|
||||
this.title,
|
||||
required this.items,
|
||||
required this.onChanged,
|
||||
required this.title,
|
||||
this.displayItem,
|
||||
this.isSeparated = true,
|
||||
});
|
||||
|
||||
final List<CheckBoxItem> items;
|
||||
final String title;
|
||||
final Widget Function(CheckBoxItem) displayItem;
|
||||
final Widget Function(CheckBoxItem)? displayItem;
|
||||
final bool isSeparated;
|
||||
final Function(int, bool) onChanged;
|
||||
|
||||
@@ -61,7 +58,7 @@ class CheckBoxPickerState extends State<CheckBoxPicker> {
|
||||
child: ClipRRect(
|
||||
borderRadius: BorderRadius.all(Radius.circular(30)),
|
||||
child: Container(
|
||||
color: Theme.of(context).accentTextTheme.title.color,
|
||||
color: Theme.of(context).accentTextTheme!.headline6!.color!,
|
||||
child: ConstrainedBox(
|
||||
constraints: BoxConstraints(
|
||||
maxHeight: MediaQuery.of(context).size.height * 0.65,
|
||||
@@ -98,14 +95,14 @@ class CheckBoxPickerState extends State<CheckBoxPicker> {
|
||||
|
||||
Widget itemsList() {
|
||||
return Container(
|
||||
color: Theme.of(context).accentTextTheme.headline6.backgroundColor,
|
||||
color: Theme.of(context).accentTextTheme!.headline6!.backgroundColor!,
|
||||
child: ListView.separated(
|
||||
padding: EdgeInsets.zero,
|
||||
controller: controller,
|
||||
shrinkWrap: true,
|
||||
separatorBuilder: (context, index) => widget.isSeparated
|
||||
? Divider(
|
||||
color: Theme.of(context).accentTextTheme.title.backgroundColor,
|
||||
color: Theme.of(context).accentTextTheme!.headline6!.backgroundColor!,
|
||||
height: 1,
|
||||
)
|
||||
: const SizedBox(),
|
||||
@@ -124,13 +121,13 @@ class CheckBoxPickerState extends State<CheckBoxPicker> {
|
||||
},
|
||||
child: Container(
|
||||
height: 55,
|
||||
color: Theme.of(context).accentTextTheme.headline6.color,
|
||||
color: Theme.of(context).accentTextTheme!.headline6!.color!,
|
||||
padding: EdgeInsets.only(left: 24, right: 24),
|
||||
child: CheckboxListTile(
|
||||
value: item.value,
|
||||
activeColor: item.value
|
||||
? Palette.blueCraiola
|
||||
: Theme.of(context).accentTextTheme.subhead.decorationColor,
|
||||
: Theme.of(context).accentTextTheme!.subtitle1!.decorationColor!,
|
||||
checkColor: Colors.white,
|
||||
title: widget.displayItem?.call(item) ??
|
||||
Text(
|
||||
@@ -141,11 +138,15 @@ class CheckBoxPickerState extends State<CheckBoxPicker> {
|
||||
fontWeight: FontWeight.w600,
|
||||
color: item.isDisabled
|
||||
? Colors.grey.withOpacity(0.5)
|
||||
: Theme.of(context).primaryTextTheme.title.color,
|
||||
: Theme.of(context).primaryTextTheme!.headline6!.color!,
|
||||
decoration: TextDecoration.none,
|
||||
),
|
||||
),
|
||||
onChanged: (bool value) {
|
||||
onChanged: (bool? value) {
|
||||
if (value == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
item.value = value;
|
||||
widget.onChanged(index, value);
|
||||
setState(() {});
|
||||
|
||||
Reference in New Issue
Block a user