mirror of
https://github.com/flutter/samples.git
synced 2025-11-14 11:28:36 +00:00
adds new components to the gallery
This commit is contained in:
31
cupertino_gallery/lib/widgets/checkbox_page.dart
Normal file
31
cupertino_gallery/lib/widgets/checkbox_page.dart
Normal file
@@ -0,0 +1,31 @@
|
||||
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!;
|
||||
});
|
||||
},
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user