comp
This commit is contained in:
@@ -34,7 +34,7 @@ class _GenderDropdownState extends State<GenderDropdown> {
|
||||
child: DropdownButtonHideUnderline(
|
||||
child: DropdownButton<String>(
|
||||
isExpanded: true,
|
||||
value: controller.text,
|
||||
value: controller.text == '' ? null : controller.text,
|
||||
hint: const Text(
|
||||
'Selecciona tu género',
|
||||
style: TextStyle(fontSize: 16.0),
|
||||
|
||||
@@ -0,0 +1,28 @@
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class GeneralCheckbox extends StatelessWidget {
|
||||
final String text;
|
||||
final bool initialValue;
|
||||
final Function(bool) onChanged;
|
||||
|
||||
const GeneralCheckbox({
|
||||
super.key,
|
||||
required this.text,
|
||||
required this.initialValue,
|
||||
required this.onChanged,
|
||||
});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return CheckboxListTile(
|
||||
title: Text(
|
||||
text,
|
||||
style: const TextStyle(fontSize: 15),
|
||||
),
|
||||
value: initialValue,
|
||||
onChanged: (value) {
|
||||
onChanged(value!);
|
||||
},
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -1,10 +1,40 @@
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class GeneralPrimaryButton extends StatelessWidget {
|
||||
const GeneralPrimaryButton({super.key});
|
||||
final VoidCallback onPressed;
|
||||
final String label;
|
||||
final bool isEnabled;
|
||||
|
||||
const GeneralPrimaryButton({
|
||||
super.key,
|
||||
required this.onPressed,
|
||||
required this.label,
|
||||
this.isEnabled = true,
|
||||
});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Container();
|
||||
return ElevatedButton(
|
||||
onPressed: isEnabled ? onPressed : null,
|
||||
style: ElevatedButton.styleFrom(
|
||||
backgroundColor: Theme.of(context).colorScheme.primary,
|
||||
elevation: 0,
|
||||
minimumSize: Size(
|
||||
MediaQuery.of(context).size.width * 0.5,
|
||||
50,
|
||||
),
|
||||
shape: const RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.all(Radius.circular(50)),
|
||||
),
|
||||
),
|
||||
child: Text(
|
||||
label,
|
||||
style: TextStyle(
|
||||
color: isEnabled ? Colors.white : Colors.black,
|
||||
fontWeight: FontWeight.bold,
|
||||
fontSize: 16,
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user