createCustomCheckbox function

void createCustomCheckbox()

Implementation

void createCustomCheckbox() {
  final coreDir = DirsRepository.coreDir();
  createFile('${coreDir.path}/widgets', 'custom_checkbox.dart', '''
import 'package:flutter/material.dart';

class CustomCheckbox extends StatelessWidget {
  final bool value;
  final ValueChanged<bool?> onChanged;
  final String? label;

  const CustomCheckbox({
    required this.value,
    required this.onChanged,
    this.label,
    Key? key,
  }) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return Row(
      children: [
        Checkbox(
          value: value,
          onChanged: onChanged,
        ),
        if (label != null) Text(label!),
      ],
    );
  }
}
''');
}