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

55 lines
1.6 KiB
Dart

import 'package:flutter/material.dart';
import '../../app_style/colors.dart';
import '../../app_style/sizing.dart';
3 years ago
class ReportIssueItem extends StatelessWidget {
final bool? isSelected;
final String? issueInfo;
final Function(String, bool)? onChange;
3 years ago
const ReportIssueItem({Key? key, this.isSelected, this.issueInfo, this.onChange}) : super(key: key);
3 years ago
@override
Widget build(BuildContext context) {
return MaterialButton(
splashColor: AColors.secondaryColor.withOpacity(.5),
padding: EdgeInsets.symmetric(vertical: 4),
onPressed: () {
onChange!(issueInfo!, !isSelected!);
3 years ago
},
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),
3 years ago
child: Checkbox(
value: isSelected,
onChanged: (value) {
onChange!(issueInfo!, value!);
3 years ago
},
),
),
],
),
Padding(
padding: const EdgeInsets.symmetric(horizontal: 16),
child: Divider(),
),
],
),
);
}
}