原生epub阅读

This commit is contained in:
DelLevin-Home
2026-06-27 14:06:44 +08:00
parent 5acbc3a602
commit d54e33e4cf
177 changed files with 6500 additions and 93933 deletions

View File

@@ -0,0 +1,74 @@
import 'package:flutter/material.dart';
/// A compact card-style stepper for an integer value.
class IntegerStepper extends StatelessWidget {
const IntegerStepper({
super.key,
required this.label,
required this.value,
required this.min,
required this.max,
required this.step,
required this.onChanged,
});
final String label;
final int value;
final int min;
final int max;
final int step;
final ValueChanged<int> onChanged;
@override
Widget build(BuildContext context) {
final colorScheme = Theme.of(context).colorScheme;
return Container(
padding: const EdgeInsets.fromLTRB(12, 8, 8, 8),
decoration: BoxDecoration(
color: colorScheme.surfaceContainerHighest,
borderRadius: BorderRadius.circular(12),
border: Border.all(color: colorScheme.outlineVariant, width: 1.5),
),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisSize: MainAxisSize.min,
children: [
Text(
label,
style: TextStyle(fontSize: 12, color: colorScheme.onSurfaceVariant),
),
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
IconButton(
icon: const Icon(Icons.remove_outlined, size: 16),
onPressed: value > min ? () => onChanged(value - step) : null,
padding: EdgeInsets.zero,
constraints: const BoxConstraints(minWidth: 28, minHeight: 28),
visualDensity: VisualDensity.compact,
color: colorScheme.primary,
disabledColor: colorScheme.outline,
),
Text(
'$value',
style: TextStyle(
fontSize: 14,
color: colorScheme.onSurfaceVariant,
),
),
IconButton(
icon: const Icon(Icons.add_outlined, size: 16),
onPressed: value < max ? () => onChanged(value + step) : null,
padding: EdgeInsets.zero,
constraints: const BoxConstraints(minWidth: 28, minHeight: 28),
visualDensity: VisualDensity.compact,
color: colorScheme.primary,
disabledColor: colorScheme.outline,
),
],
),
],
),
);
}
}