Files
syncrow-web/lib/pages/device_managment/shared/increament_decreament.dart
2024-08-25 04:03:46 +03:00

88 lines
2.4 KiB
Dart

import 'package:flutter/material.dart';
import 'package:syncrow_web/utils/color_manager.dart';
class IncrementDecrementWidget extends StatelessWidget {
final String value;
final String description;
final VoidCallback onIncrement;
final VoidCallback onDecrement;
const IncrementDecrementWidget({
super.key,
required this.value,
required this.description,
required this.onIncrement,
required this.onDecrement,
});
@override
Widget build(BuildContext context) {
return Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Material(
type: MaterialType.transparency,
child: ClipRRect(
borderRadius: BorderRadius.circular(100),
child: InkWell(
splashColor: Colors.transparent,
highlightColor: Colors.transparent,
onTap: onDecrement,
child: const Padding(
padding: EdgeInsets.all(8.0),
child: Icon(
Icons.remove,
color: ColorsManager.greyColor,
size: 32,
),
),
),
),
),
RichText(
text: TextSpan(
text: '',
children: [
TextSpan(
text: value,
style: TextStyle(
fontSize: 38,
color: ColorsManager.dialogBlueTitle,
fontWeight: FontWeight.bold,
),
),
TextSpan(
text: description,
style: const TextStyle(
fontSize: 12,
color: ColorsManager.blackColor,
fontWeight: FontWeight.bold,
),
),
],
),
),
Material(
type: MaterialType.transparency,
child: ClipRRect(
borderRadius: BorderRadius.circular(100),
child: InkWell(
splashColor: Colors.transparent,
highlightColor: Colors.transparent,
onTap: onIncrement,
child: const Padding(
padding: EdgeInsets.all(8.0),
child: Icon(
Icons.add,
color: ColorsManager.greyColor,
size: 32,
),
),
),
),
),
],
);
}
}