You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
samples/cupertino_gallery/lib/widgets/checkbox_page.dart

32 lines
692 B

import 'package:flutter/cupertino.dart';
class CheckboxPage extends StatefulWidget {
const CheckboxPage({super.key});
@override
State<CheckboxPage> createState() => _CheckboxPageState();
}
class _CheckboxPageState extends State<CheckboxPage> {
bool _value = false;
@override
Widget build(BuildContext context) {
return CupertinoPageScaffold(
navigationBar: const CupertinoNavigationBar(
middle: Text('Checkbox'),
),
child: Center(
child: CupertinoCheckbox(
value: _value,
onChanged: (bool? value) {
setState(() {
_value = value!;
});
},
),
),
);
}
}