반응형
import 'package:flutter/material.dart';
class SliderSelectionWidget extends StatelessWidget {
final String title;
final double value;
final double minvalue;
final double maxvalue;
final int divisions;
final ValueChanged<double> onChanged;
const SliderSelectionWidget(
{super.key,
required this.title,
required this.value,
required this.minvalue,
required this.divisions,
required this.maxvalue,
required this.onChanged});
@override
Widget build(BuildContext context) {
return Container(
padding: EdgeInsets.all(16),
decoration: BoxDecoration(
color: Theme.of(context).colorScheme.secondary,
borderRadius: BorderRadius.circular(16),
boxShadow: [BoxShadow(
color: Colors.black.withBlue(6),
)]
),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
title,
style: Theme.of(context)
.textTheme
.headlineSmall
?.copyWith(fontWeight: FontWeight.w600, fontSize: 18),
),
SizedBox(height: 12,
),
Slider(
value: value,
onChanged: onChanged,
max: maxvalue,
divisions: divisions,
min: minvalue,
label: value.toStringAsFixed(0),
activeColor: Theme.of(context).colorScheme.primary,
inactiveColor: Theme.of(context).colorScheme.onSurface,
),
SizedBox(height: 12,
),
Text('Value: ${value.toInt()}',style: Theme.of(context).textTheme.bodyMedium?.copyWith(
fontWeight: FontWeight.bold,
),)
],
),
);
}
}반응형
'새내기 게임 개발자[Unity]' 카테고리의 다른 글
| Flutter Word Game core/router/app_router.dart (0) | 2025.10.19 |
|---|---|
| Flutter WordGame core/get_it.dart (0) | 2025.10.19 |
| Flutter Word Game features/game/presentation/widget/letter_box_widget.dart (0) | 2025.10.19 |
| Flutter Word Game features/game/presentation/widget/attempt_row_widget.dart (0) | 2025.10.19 |
| Flutter Word Game features/game/presentation/bloc/game_state.dart (0) | 2025.10.19 |