50 lines
1.3 KiB
Dart
50 lines
1.3 KiB
Dart
import 'package:flutter/material.dart';
|
|
|
|
class OptModalWidget extends StatefulWidget {
|
|
const OptModalWidget({Key? key}) : super(key: key);
|
|
|
|
@override
|
|
_OptModalWidgetState createState() => _OptModalWidgetState();
|
|
}
|
|
|
|
class _OptModalWidgetState extends State<OptModalWidget> {
|
|
String selectedOption = 'T'; // Estado inicial
|
|
|
|
void setSelectedOption(String option) {
|
|
setState(() {
|
|
selectedOption = option;
|
|
});
|
|
}
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return Container(
|
|
// Estilize seu modal como necessário
|
|
child: Column(
|
|
children: [
|
|
// Botão para "Visitante"
|
|
ElevatedButton(
|
|
onPressed: () => setSelectedOption('E'),
|
|
child: Text('Visitante'),
|
|
),
|
|
// Botão para "Morador"
|
|
ElevatedButton(
|
|
onPressed: () => setSelectedOption('O'),
|
|
child: Text('Morador'),
|
|
),
|
|
// Botão para "Ambos ou Nenhum"
|
|
ElevatedButton(
|
|
onPressed: () => setSelectedOption('T'),
|
|
child: Text('Ambos ou Nenhum'),
|
|
),
|
|
// Botão para confirmar a seleção e fechar o modal
|
|
ElevatedButton(
|
|
onPressed: () => Navigator.pop(context, selectedOption),
|
|
child: Text('Confirmar'),
|
|
),
|
|
],
|
|
),
|
|
);
|
|
}
|
|
}
|