fecha
This commit is contained in:
@@ -4,8 +4,8 @@ import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:prosappco/src/authentication/authentication_repository.dart';
|
||||
import 'package:prosappco/src/components/drawer_menu.dart';
|
||||
import 'package:prosappco/src/components/primary_btn.dart';
|
||||
import 'package:prosappco/src/screens/professional.dart';
|
||||
import 'package:intl/intl.dart';
|
||||
|
||||
class ServiceScreen extends StatefulWidget {
|
||||
const ServiceScreen({super.key});
|
||||
@@ -15,6 +15,25 @@ class ServiceScreen extends StatefulWidget {
|
||||
}
|
||||
|
||||
class _ServiceScreenState extends State<ServiceScreen> {
|
||||
final DateFormat formatter = DateFormat('dd/MM/yyyy');
|
||||
|
||||
DateTime? _selectedDate;
|
||||
|
||||
Future<void> _selectDate(BuildContext context) async {
|
||||
final DateTime? picked = await showDatePicker(
|
||||
context: context,
|
||||
initialDate: DateTime.now(),
|
||||
firstDate: DateTime(2022),
|
||||
lastDate: DateTime(2025),
|
||||
);
|
||||
|
||||
if (picked != null && picked != _selectedDate) {
|
||||
setState(() {
|
||||
_selectedDate = picked;
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
final FirebaseStorage storage = FirebaseStorage.instance;
|
||||
final uid = AuthenticationRepository.instance.getCurrentUserUid();
|
||||
var _ciudad = '';
|
||||
@@ -199,20 +218,30 @@ class _ServiceScreenState extends State<ServiceScreen> {
|
||||
Row(
|
||||
children: [
|
||||
SizedBox(
|
||||
width: 150,
|
||||
child: TextFormField(
|
||||
decoration: const InputDecoration(
|
||||
suffixIcon: Icon(Icons.arrow_drop_down),
|
||||
prefixIcon: Icon(Icons.calendar_month),
|
||||
hintText: 'Fecha'),
|
||||
)),
|
||||
width: 150,
|
||||
child: TextFormField(
|
||||
onTap: () {
|
||||
_selectDate(context);
|
||||
},
|
||||
readOnly: true,
|
||||
decoration: const InputDecoration(
|
||||
prefixIcon: Icon(Icons.calendar_month),
|
||||
hintText: 'Fecha',
|
||||
),
|
||||
controller: TextEditingController(
|
||||
text: _selectedDate == null
|
||||
? ''
|
||||
: formatter.format(_selectedDate!)),
|
||||
),
|
||||
),
|
||||
SizedBox(
|
||||
width: 150,
|
||||
child: TextFormField(
|
||||
decoration: const InputDecoration(
|
||||
suffixIcon: Icon(Icons.arrow_drop_down),
|
||||
hintText: 'Hora'),
|
||||
)),
|
||||
width: 150,
|
||||
child: TextFormField(
|
||||
decoration: const InputDecoration(
|
||||
suffixIcon: Icon(Icons.arrow_drop_down),
|
||||
hintText: 'Hora'),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
const SizedBox(height: 15),
|
||||
|
||||
Reference in New Issue
Block a user