mirror of
https://github.com/SyncrowIOT/syncrow-app.git
synced 2026-10-26 03:27:54 +00:00
water heater and timer and schedule ui and api ,
Circulate ui and Inching ui
This commit is contained in:
@@ -1,11 +1,9 @@
|
||||
|
||||
|
||||
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:syncrow_app/features/shared_widgets/default_container.dart';
|
||||
|
||||
import '../../../../../utils/resource_manager/color_manager.dart';
|
||||
import 'package:syncrow_app/features/shared_widgets/text_widgets/body_large.dart';
|
||||
import 'package:syncrow_app/utils/resource_manager/color_manager.dart';
|
||||
|
||||
|
||||
class InchingWidget extends StatefulWidget {
|
||||
@@ -48,22 +46,98 @@ class _InchingWidgetState extends State<InchingWidget> {
|
||||
),
|
||||
],
|
||||
),
|
||||
SizedBox(height: 10,),
|
||||
Text('Once enabled this feature, each time the device is turned on, it will automatically turn of after a period time as pre-set.'),
|
||||
const SizedBox(height: 10,),
|
||||
const Text('Once enabled this feature, each time the device is turned on, it will automatically turn of after a period time as pre-set.'),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
SizedBox(
|
||||
height: 110,
|
||||
child: CupertinoDatePicker(
|
||||
mode: CupertinoDatePickerMode.time,
|
||||
initialDateTime: DateTime.now(),
|
||||
onDateTimeChanged: (selectedTime) {
|
||||
}, ),
|
||||
const Padding(
|
||||
padding: EdgeInsets.only(right: 30,left: 30),
|
||||
child: Divider(),
|
||||
),
|
||||
Container(
|
||||
child: MinuteSecondPicker()),
|
||||
const Padding(
|
||||
padding: EdgeInsets.only(right: 30,left: 30),
|
||||
child: Divider(),
|
||||
),
|
||||
|
||||
],
|
||||
);
|
||||
}
|
||||
}
|
||||
class MinuteSecondPicker extends StatefulWidget {
|
||||
const MinuteSecondPicker({super.key});
|
||||
|
||||
@override
|
||||
_MinuteSecondPickerState createState() => _MinuteSecondPickerState();
|
||||
}
|
||||
|
||||
class _MinuteSecondPickerState extends State<MinuteSecondPicker> {
|
||||
int selectedMinute = 0;
|
||||
int selectedSecond = 0;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Center(
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
// Minutes picker
|
||||
Container(
|
||||
height: 80,
|
||||
width: 100,
|
||||
child: CupertinoPicker(
|
||||
itemExtent: 40.0,
|
||||
scrollController: FixedExtentScrollController(initialItem: selectedMinute),
|
||||
onSelectedItemChanged: (int index) {
|
||||
setState(() {
|
||||
selectedMinute = index;
|
||||
});
|
||||
},
|
||||
children: List<Widget>.generate(61, (int index) {
|
||||
return Center(
|
||||
child: BodyLarge(
|
||||
text: index.toString().padLeft(2, '0'),
|
||||
style: const TextStyle(
|
||||
fontWeight: FontWeight.w400,
|
||||
fontSize: 30,color: Colors.blue),
|
||||
),
|
||||
);
|
||||
}),
|
||||
),
|
||||
),
|
||||
const Text('M'),
|
||||
SizedBox(width: 20),
|
||||
// Seconds picker
|
||||
Container(
|
||||
height: 80,
|
||||
width: 100,
|
||||
child: CupertinoPicker(
|
||||
itemExtent: 40.0,
|
||||
scrollController: FixedExtentScrollController(initialItem: selectedSecond),
|
||||
onSelectedItemChanged: (int index) {
|
||||
setState(() {
|
||||
selectedSecond = index;
|
||||
});
|
||||
},
|
||||
children: List<Widget>.generate(60, (int index) {
|
||||
return Center(
|
||||
child: BodyLarge(
|
||||
text: index.toString().padLeft(2, '0'),
|
||||
style: const TextStyle(
|
||||
fontWeight: FontWeight.w400,
|
||||
fontSize: 30,color: Colors.blue),
|
||||
),
|
||||
);
|
||||
}),
|
||||
),
|
||||
),
|
||||
const Text('S'),
|
||||
|
||||
],
|
||||
),
|
||||
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -126,30 +126,19 @@ class CirculateWidget extends StatelessWidget {
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 20),
|
||||
const DefaultContainer(child:
|
||||
DefaultContainer(child:
|
||||
Column(
|
||||
children: [
|
||||
Padding(
|
||||
padding: EdgeInsets.all(8.0),
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Text('Start Duration'),
|
||||
Row(
|
||||
InkWell(
|
||||
onTap: () {
|
||||
|
||||
},
|
||||
child: const Padding(
|
||||
padding: EdgeInsets.all(8.0),
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Text('0h 0m'),
|
||||
Icon(Icons.arrow_forward_ios_sharp,color:ColorsManager.graysColor,)
|
||||
],
|
||||
),
|
||||
],),
|
||||
),
|
||||
Divider(color: ColorsManager.graysColor,),
|
||||
Padding(
|
||||
padding: EdgeInsets.all(8.0),
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Text('End Duration'),
|
||||
Text('Start Duration'),
|
||||
Row(
|
||||
children: [
|
||||
Text('0h 0m'),
|
||||
@@ -157,6 +146,27 @@ class CirculateWidget extends StatelessWidget {
|
||||
],
|
||||
),
|
||||
],),
|
||||
),
|
||||
),
|
||||
const Divider(color: ColorsManager.graysColor,),
|
||||
InkWell(
|
||||
onTap: () {
|
||||
|
||||
},
|
||||
child: const Padding(
|
||||
padding: EdgeInsets.all(8.0),
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Text('End Duration'),
|
||||
Row(
|
||||
children: [
|
||||
Text('0h 0m'),
|
||||
Icon(Icons.arrow_forward_ios_sharp,color:ColorsManager.graysColor,)
|
||||
],
|
||||
),
|
||||
],),
|
||||
),
|
||||
),
|
||||
],
|
||||
)
|
||||
@@ -165,4 +175,5 @@ class CirculateWidget extends StatelessWidget {
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user