fixed const

This commit is contained in:
Juan Felipe Duarte
2023-04-24 11:17:04 -05:00
parent aaa249d6f5
commit 028fce32a9
4 changed files with 29 additions and 21 deletions
+13 -11
View File
@@ -3,14 +3,16 @@ import 'package:prosappco/src/authentication/authentication_repository.dart';
final uid = AuthenticationRepository.instance.getCurrentUserUid();
// class EventoService {
// Future<Event> createEvent() {
// FirebaseFirestore.instance.collection('users').doc(uid).update({
// 'ejemplo': 'ejm',
// });
// try {} catch (e) {
// print('Evento $e');
// }
// }
// }
class EventoService {
Future<void> createEvent(String title, String description, String day) async {
try {
await FirebaseFirestore.instance.collection('services').add({
'title': title,
'description': description,
'day': day,
});
} catch (e) {
print('Evento $e');
}
}
}
+7 -1
View File
@@ -1,5 +1,6 @@
import 'package:flutter/material.dart';
import 'package:prosappco/src/components/pop_appbar.dart';
import 'package:prosappco/src/models/event_model.dart';
import 'package:table_calendar/table_calendar.dart';
class CalendarScreen extends StatefulWidget {
@@ -10,6 +11,7 @@ class CalendarScreen extends StatefulWidget {
}
class _CalendarScreenState extends State<CalendarScreen> {
EventoService eventoService = EventoService();
CalendarFormat _calendarFormat = CalendarFormat.month;
DateTime today = DateTime.now();
@@ -65,11 +67,15 @@ class _CalendarScreenState extends State<CalendarScreen> {
},
),
),
Text(today.toString())
],
),
),
floatingActionButton: FloatingActionButton(
onPressed: () {},
onPressed: () async {
await eventoService.createEvent(
'Hola', 'Saludarnois', today.toString());
},
child: const Icon(Icons.add),
),
),
+5 -5
View File
@@ -37,10 +37,10 @@ class _NewNumberScreenState extends State<NewNumberScreen> {
resizeToAvoidBottomInset: false,
appBar: AppBar(
backgroundColor: Colors.white,
iconTheme: IconThemeData(
iconTheme: const IconThemeData(
color: Colors.black,
),
title: Text(
title: const Text(
'Añadir numero',
style: TextStyle(
color: Colors.black,
@@ -61,14 +61,14 @@ class _NewNumberScreenState extends State<NewNumberScreen> {
Form(
key: _formKey,
child: Padding(
padding: EdgeInsets.only(bottom: 5),
padding: const EdgeInsets.only(bottom: 5),
child: IntlPhoneField(
controller: controller.newPhoneNo,
initialCountryCode: 'CO',
onChanged: (newPhoneNo) {
completePhoneNumber = newPhoneNo.completeNumber;
},
decoration: InputDecoration(
decoration: const InputDecoration(
enabledBorder: OutlineInputBorder(
borderSide: BorderSide(color: Color(0xFFECECEC)),
borderRadius: BorderRadius.all(
@@ -92,7 +92,7 @@ class _NewNumberScreenState extends State<NewNumberScreen> {
style: TextStyle(fontSize: 13.0, color: Color(0xFF65676B))),
),
Padding(
padding: EdgeInsets.only(bottom: 30),
padding: const EdgeInsets.only(bottom: 30),
child: Center(
child: PrimaryButtom(
onPressed: () {
+4 -4
View File
@@ -18,16 +18,16 @@ class RequestSentScreen extends StatelessWidget {
body: Center(
child: Column(
children: [
Padding(
padding: const EdgeInsets.only(top: 90, bottom: 40),
const Padding(
padding: EdgeInsets.only(top: 90, bottom: 40),
child: Icon(
Icons.check_circle_outline,
size: 50,
color: Color(0xFF35A8ED),
),
),
Padding(
padding: const EdgeInsets.only(bottom: 350),
const Padding(
padding: EdgeInsets.only(bottom: 350),
child: Text('Información enviada con éxito.',
style:
TextStyle(color: Color(0xFF2BA4EC), fontSize: 20)),