mirror of
https://github.com/SyncrowIOT/web.git
synced 2025-07-09 14:47:23 +00:00
88 lines
2.4 KiB
Dart
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,
|
|
),
|
|
),
|
|
),
|
|
),
|
|
),
|
|
],
|
|
);
|
|
}
|
|
}
|