Google sign in and hourglass improved
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_datetime_picker/flutter_datetime_picker.dart';
|
||||
import 'package:intl/intl.dart';
|
||||
import 'package:tasktracker/NewCategory.dart';
|
||||
import 'User.dart' as User;
|
||||
|
||||
DateFormat dateFormat = DateFormat("yyyy-MM-dd HH:mm:ss");
|
||||
@@ -15,6 +16,7 @@ class NewTask extends StatefulWidget {
|
||||
|
||||
List<String> getCategoryNames(){
|
||||
List<String> _cats = [];
|
||||
_cats.add('+Add New Category');
|
||||
User.categories.forEach((element) {
|
||||
String name = element.name;
|
||||
_cats.add(name);
|
||||
@@ -84,8 +86,15 @@ class _NewTaskState extends State<NewTask> {
|
||||
);
|
||||
}).toList(),
|
||||
onChanged: (String? _value) {
|
||||
if(_value != null) {
|
||||
if (_value.contains("+Add New Category")) {
|
||||
Navigator.of(context).push(MaterialPageRoute(builder: (context)=>NewCategory()));
|
||||
}else{
|
||||
selectedCat = _value!;
|
||||
}
|
||||
}
|
||||
setState(() {
|
||||
selectedCat = _value!;
|
||||
|
||||
});
|
||||
})),
|
||||
Container(
|
||||
|
||||
Reference in New Issue
Block a user