[SYNC] Working on the checkbox toggle
This commit is contained in:
@@ -5,7 +5,6 @@
|
|||||||
//s2 CORE
|
//s2 CORE
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter/scheduler.dart';
|
import 'package:flutter/scheduler.dart';
|
||||||
import 'dart:ui' as ui;
|
|
||||||
|
|
||||||
//s2 3RD-PARTY
|
//s2 3RD-PARTY
|
||||||
//
|
//
|
||||||
@@ -28,7 +27,7 @@ class AstromicCheckboxToggle extends StatefulWidget {
|
|||||||
//s1 -- Configuration
|
//s1 -- Configuration
|
||||||
final bool? isEnabled;
|
final bool? isEnabled;
|
||||||
final bool? isLabelTapable;
|
final bool? isLabelTapable;
|
||||||
final ui.TextDirection textDirection;
|
final TextDirection textDirection;
|
||||||
//s1 -- Style
|
//s1 -- Style
|
||||||
final double? itemSize;
|
final double? itemSize;
|
||||||
final double? labelSpacing;
|
final double? labelSpacing;
|
||||||
@@ -47,7 +46,7 @@ class AstromicCheckboxToggle extends StatefulWidget {
|
|||||||
//s1 -- Configuration
|
//s1 -- Configuration
|
||||||
this.isEnabled = true,
|
this.isEnabled = true,
|
||||||
this.isLabelTapable = true,
|
this.isLabelTapable = true,
|
||||||
this.textDirection = ui.TextDirection.ltr,
|
this.textDirection = TextDirection.ltr,
|
||||||
//s1 -- Style
|
//s1 -- Style
|
||||||
this.itemSize = 24,
|
this.itemSize = 24,
|
||||||
this.labelSpacing = 6,
|
this.labelSpacing = 6,
|
||||||
@@ -142,12 +141,12 @@ class _AstromicCheckboxToggleState extends State<AstromicCheckboxToggle> {
|
|||||||
SizedBox(
|
SizedBox(
|
||||||
width: widget.itemSize,
|
width: widget.itemSize,
|
||||||
height: widget.itemSize,
|
height: widget.itemSize,
|
||||||
child: widget.itemBuilder(isChecked, widget.isEnabled!, () => _onTap),
|
child: widget.itemBuilder(isChecked, widget.isEnabled!, () => _onTap()),
|
||||||
),
|
),
|
||||||
//S1 -- Label Spacing
|
//S1 -- Label Spacing
|
||||||
if (widget.labelBuilder != null) SizedBox(width: widget.labelSpacing),
|
if (widget.labelBuilder != null) SizedBox(width: widget.labelSpacing),
|
||||||
//S1 -- Label
|
//S1 -- Label
|
||||||
if (widget.labelBuilder != null) widget.labelBuilder!(isChecked, widget.isEnabled!, () => _onTap),
|
if (widget.labelBuilder != null) widget.labelBuilder!(isChecked, widget.isEnabled!, () => _onTap()),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -25,11 +25,11 @@ class AstromicToggles {
|
|||||||
stateVariable: stateVariable,
|
stateVariable: stateVariable,
|
||||||
initialState: initialState,
|
initialState: initialState,
|
||||||
onStateChanged: onStateChanged,
|
onStateChanged: onStateChanged,
|
||||||
isEnabled: isEnabled,
|
isEnabled: isEnabled ?? true,
|
||||||
isLabelTapable: isLabelTapable,
|
isLabelTapable: isLabelTapable ?? true,
|
||||||
textDirection: textDirection ?? TextDirection.ltr,
|
textDirection: textDirection ?? TextDirection.ltr,
|
||||||
itemSize: itemSize,
|
itemSize: itemSize ?? 24.0,
|
||||||
labelSpacing: labelSpacing,
|
labelSpacing: labelSpacing ?? 8.0,
|
||||||
itemBuilder: itemBuilder,
|
itemBuilder: itemBuilder,
|
||||||
labelBuilder: labelBuilder,
|
labelBuilder: labelBuilder,
|
||||||
);
|
);
|
||||||
|
|||||||
Reference in New Issue
Block a user