70 lines
1.7 KiB
Dart
70 lines
1.7 KiB
Dart
import 'package:flutter/material.dart';
|
|
|
|
// ignore: must_be_immutable
|
|
class TVShowDetailsSettingsBoxCliffhanger extends StatefulWidget {
|
|
TVShowDetailsSettingsBoxCliffhanger({
|
|
super.key,
|
|
required this.cliffhanger,
|
|
required this.cliffhangerChanged,
|
|
});
|
|
|
|
int cliffhanger;
|
|
|
|
final Function(int cliffhanger) cliffhangerChanged;
|
|
|
|
@override
|
|
State<TVShowDetailsSettingsBoxCliffhanger> createState() =>
|
|
_TVShowDetailsSettingsBoxCliffhangerState();
|
|
}
|
|
|
|
class _TVShowDetailsSettingsBoxCliffhangerState
|
|
extends State<TVShowDetailsSettingsBoxCliffhanger> {
|
|
@override
|
|
void initState() {
|
|
_curCliffhanger = widget.cliffhanger;
|
|
super.initState();
|
|
}
|
|
|
|
var _curCliffhanger = 0;
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return Padding(
|
|
padding: const EdgeInsets.only(
|
|
left: 5.0,
|
|
right: 5.0,
|
|
top: 5.0,
|
|
bottom: 5.0,
|
|
),
|
|
child: Column(
|
|
children: [
|
|
const Text(
|
|
'Cliffhanger',
|
|
style: TextStyle(
|
|
fontWeight: FontWeight.bold,
|
|
),
|
|
),
|
|
const SizedBox(
|
|
height: 10,
|
|
),
|
|
Checkbox(
|
|
side: WidgetStateBorderSide.resolveWith(
|
|
(states) => const BorderSide(width: 1.0, color: Colors.grey),
|
|
),
|
|
value: (_curCliffhanger == 1),
|
|
onChanged: (bool? value) {
|
|
setState(() {
|
|
_curCliffhanger = value == true ? 1 : 0;
|
|
widget.cliffhangerChanged(_curCliffhanger);
|
|
});
|
|
},
|
|
),
|
|
const SizedBox(
|
|
height: 10,
|
|
),
|
|
],
|
|
),
|
|
);
|
|
}
|
|
}
|