You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
cloudsolutions-atoms/lib/views/widgets/issues/report_issue_item.dart

54 lines
1.6 KiB
Dart

import 'package:flutter/material.dart';
import 'package:test_sa/views/app_style/colors.dart';
import 'package:test_sa/views/app_style/sizing.dart';
class ReportIssueItem extends StatelessWidget {
final bool isSelected;
final String issueInfo;
final Function(String, bool) onChange;
const ReportIssueItem({Key key, this.isSelected, this.issueInfo, this.onChange}) : super(key: key);
@override
Widget build(BuildContext context) {
return MaterialButton(
splashColor: AColors.secondaryColor.withOpacity(.5),
padding: EdgeInsets.symmetric(vertical: 4),
onPressed: () {
onChange(issueInfo, !isSelected);
},
child: Column(
children: [
Row(
children: [
Expanded(
child: Padding(
padding: const EdgeInsets.symmetric(horizontal: 8),
child: Text(
issueInfo ?? "",
style: Theme.of(context).textTheme.subtitle2,
textScaleFactor: AppStyle.getScaleFactor(context),
),
),
),
Padding(
padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 8),
child: Checkbox(
value: isSelected,
onChanged: (value) {
onChange(issueInfo, value);
},
),
),
],
),
Padding(
padding: const EdgeInsets.symmetric(horizontal: 16),
child: Divider(),
),
],
),
);
}
}