mirror of
https://github.com/SyncrowIOT/web.git
synced 2025-07-09 22:57:21 +00:00
84 lines
2.6 KiB
Dart
84 lines
2.6 KiB
Dart
import 'package:flutter/material.dart';
|
|
import 'package:flutter_svg/flutter_svg.dart';
|
|
import 'package:syncrow_web/utils/color_manager.dart';
|
|
import 'package:syncrow_web/utils/constants/assets.dart';
|
|
import 'package:syncrow_web/utils/style.dart';
|
|
|
|
class DateTimeWebWidget extends StatelessWidget {
|
|
const DateTimeWebWidget({
|
|
super.key,
|
|
required this.size,
|
|
required this.isRequired,
|
|
required this.title,
|
|
required this.startTime,
|
|
required this.endTime,
|
|
required this.isTime,
|
|
required this.firstString,
|
|
required this.secondString,
|
|
});
|
|
|
|
final Size size;
|
|
final String title;
|
|
final bool isRequired;
|
|
final bool isTime;
|
|
final String firstString;
|
|
final String secondString;
|
|
final Function()? startTime;
|
|
final Function()? endTime;
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return Column(
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
mainAxisAlignment: MainAxisAlignment.start,
|
|
children: [
|
|
Row(
|
|
children: [
|
|
if(isRequired)
|
|
Text(
|
|
'* ',
|
|
style: Theme.of(context)
|
|
.textTheme
|
|
.bodyMedium!
|
|
.copyWith(color: Colors.red),
|
|
),
|
|
Text(title??'' ,
|
|
style: Theme.of(context).textTheme.bodySmall!.copyWith(
|
|
color: Colors.black,fontSize: 13),),
|
|
],
|
|
),
|
|
const SizedBox(height: 8,),
|
|
Container(
|
|
width: size.width * 0.25,
|
|
padding: EdgeInsets.all(10),
|
|
decoration: containerDecoration,
|
|
child: Column(
|
|
children: [
|
|
Row(
|
|
mainAxisAlignment:
|
|
MainAxisAlignment.spaceBetween,
|
|
children: [
|
|
InkWell(
|
|
onTap: startTime,
|
|
child: Text(firstString, style: Theme.of(context).textTheme.bodySmall!.copyWith(
|
|
color: ColorsManager.grayColor,fontSize: 12,fontWeight: FontWeight.w400),)
|
|
),
|
|
const Icon(Icons.arrow_right_alt),
|
|
InkWell(
|
|
onTap:endTime,
|
|
child: Text(secondString, style: Theme.of(context).textTheme.bodySmall!.copyWith(
|
|
color: ColorsManager.grayColor,fontSize: 12,fontWeight: FontWeight.w400),)),
|
|
SvgPicture.asset(
|
|
isTime?
|
|
Assets.timeIcon:
|
|
Assets.calendarIcon,
|
|
),
|
|
],
|
|
),
|
|
],
|
|
)),
|
|
],
|
|
);
|
|
}
|
|
}
|