[SYNC] Working on the checkbox toggle

This commit is contained in:
2024-05-16 21:07:32 +03:00
parent 87384edaae
commit 2b3d702c2e
2 changed files with 8 additions and 9 deletions

View File

@@ -5,7 +5,6 @@
//s2 CORE
import 'package:flutter/material.dart';
import 'package:flutter/scheduler.dart';
import 'dart:ui' as ui;
//s2 3RD-PARTY
//
@@ -28,7 +27,7 @@ class AstromicCheckboxToggle extends StatefulWidget {
//s1 -- Configuration
final bool? isEnabled;
final bool? isLabelTapable;
final ui.TextDirection textDirection;
final TextDirection textDirection;
//s1 -- Style
final double? itemSize;
final double? labelSpacing;
@@ -47,7 +46,7 @@ class AstromicCheckboxToggle extends StatefulWidget {
//s1 -- Configuration
this.isEnabled = true,
this.isLabelTapable = true,
this.textDirection = ui.TextDirection.ltr,
this.textDirection = TextDirection.ltr,
//s1 -- Style
this.itemSize = 24,
this.labelSpacing = 6,
@@ -142,12 +141,12 @@ class _AstromicCheckboxToggleState extends State<AstromicCheckboxToggle> {
SizedBox(
width: widget.itemSize,
height: widget.itemSize,
child: widget.itemBuilder(isChecked, widget.isEnabled!, () => _onTap),
child: widget.itemBuilder(isChecked, widget.isEnabled!, () => _onTap()),
),
//S1 -- Label Spacing
if (widget.labelBuilder != null) SizedBox(width: widget.labelSpacing),
//S1 -- Label
if (widget.labelBuilder != null) widget.labelBuilder!(isChecked, widget.isEnabled!, () => _onTap),
if (widget.labelBuilder != null) widget.labelBuilder!(isChecked, widget.isEnabled!, () => _onTap()),
],
),
);