mirror of
https://github.com/SyncrowIOT/syncrow-app.git
synced 2025-07-16 01:56:19 +00:00
push countdown widget
This commit is contained in:
@ -1,19 +1,36 @@
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
|
||||
class AlertDialogCountdown extends StatefulWidget {
|
||||
const AlertDialogCountdown({super.key});
|
||||
const AlertDialogCountdown({super.key, required this.durationValue});
|
||||
|
||||
final String durationValue;
|
||||
|
||||
@override
|
||||
State<AlertDialogCountdown> createState() => _AlertDialogCountdownState();
|
||||
}
|
||||
|
||||
class _AlertDialogCountdownState extends State<AlertDialogCountdown> {
|
||||
int durationInSeconds = 0;
|
||||
// Convert seconds to Duration.
|
||||
Duration get duration =>
|
||||
Duration(seconds: int.tryParse(widget.durationValue) ?? 0);
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Row(
|
||||
children: [
|
||||
|
||||
],
|
||||
return Container(
|
||||
height: 120,
|
||||
color: Colors.white,
|
||||
child: CupertinoTimerPicker(
|
||||
itemExtent: 120,
|
||||
mode: CupertinoTimerPickerMode.hm,
|
||||
initialTimerDuration: duration,
|
||||
onTimerDurationChanged: (newDuration) {
|
||||
setState(() {
|
||||
durationInSeconds = newDuration.inSeconds;
|
||||
});
|
||||
},
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
@ -28,7 +28,7 @@ class _AlertDialogFunctionsOperationsBodyState
|
||||
children: [
|
||||
...widget.functions[widget.index].operationalValues.map(
|
||||
(operation) => SceneListTile(
|
||||
iconsSize: 22,
|
||||
iconsSize: 25,
|
||||
minLeadingWidth: 15,
|
||||
padding: const EdgeInsets.symmetric(horizontal: 16),
|
||||
assetPath: operation.icon,
|
||||
|
@ -47,10 +47,10 @@ class SceneListTile extends StatelessWidget {
|
||||
width: iconsSize,
|
||||
child: SvgPicture.asset(
|
||||
assetPath ?? Assets.assetsImagesLogo,
|
||||
width: 20,
|
||||
height: assetHeight ?? 32,
|
||||
width: iconsSize,
|
||||
height: assetHeight ?? 35,
|
||||
alignment: Alignment.center,
|
||||
fit: BoxFit.fill,
|
||||
fit: BoxFit.contain,
|
||||
),
|
||||
)
|
||||
: null),
|
||||
|
Reference in New Issue
Block a user