Commit c4d536dc authored by GayaniPKarunaratne's avatar GayaniPKarunaratne

Get current date in searcheven dart class

parent 504be5aa
// import 'dart:convert'; // import 'dart:convert';
// import 'dart:html'; // import 'dart:html';
import 'package:intl/date_symbol_data_local.dart';
import 'dart:convert'; import 'dart:convert';
import 'dart:ffi'; import 'dart:ffi';
...@@ -32,7 +32,9 @@ class _SearchEventState extends State<SearchEvent> { ...@@ -32,7 +32,9 @@ class _SearchEventState extends State<SearchEvent> {
var tcVisibility = false; var tcVisibility = false;
var now = new DateTime.now(); DateTime now = new DateTime.now();
Duration dur = new Duration(days: 1);
//var yesterday = now.subtract(const Duration(days: 1)); //var yesterday = now.subtract(const Duration(days: 1));
// var formatterDate = new DateFormat('dd'); // var formatterDate = new DateFormat('dd');
// var formatterMonth = new DateFormat('MM'); // var formatterMonth = new DateFormat('MM');
...@@ -150,16 +152,9 @@ Widget _buildDistrict(){ ...@@ -150,16 +152,9 @@ Widget _buildDistrict(){
return '*District is Required'; return '*District is Required';
} }
}, },
// items: dist.map((distr){ onSaved: (String value){
// return DropdownMenuItem( district = value;
// value: distr, },
// child: Text('$dist'),
// );
// }),
//------------------------------------------------------
// onSaved: (String value){
// _fName = value;
// },
onChanged: (String district){ onChanged: (String district){
getDistrict(district); getDistrict(district);
}, },
...@@ -186,7 +181,7 @@ Widget _buildNoOfInfected(){ ...@@ -186,7 +181,7 @@ Widget _buildNoOfInfected(){
// ignore: missing_return // ignore: missing_return
validator: (String value){ validator: (String value){
if (value.isEmpty) { if (value.isEmpty) {
return '*Date is Required'; return '*No Of Infected people is Required';
} }
}, },
// onSaved: (String value){ // onSaved: (String value){
...@@ -299,6 +294,9 @@ Future<void> check() async{ ...@@ -299,6 +294,9 @@ Future<void> check() async{
} }
print(reText); print(reText);
tcVisibility = true; tcVisibility = true;
print('$now');
print(now.subtract(dur));
} }
...@@ -331,6 +329,7 @@ Future<void> check() async{ ...@@ -331,6 +329,7 @@ Future<void> check() async{
SizedBox(height: 50), SizedBox(height: 50),
//Image(image: AssetImage('lib/assets/images/200.gif')), //Image(image: AssetImage('lib/assets/images/200.gif')),
//----------------------------------------------------------------------------------------------------
// Image.asset('lib/assets/images/101.gif',fit: BoxFit.contain,width: 150,height: 150,), // Image.asset('lib/assets/images/101.gif',fit: BoxFit.contain,width: 150,height: 150,),
// Center( // Center(
// child: // child:
...@@ -350,7 +349,7 @@ Future<void> check() async{ ...@@ -350,7 +349,7 @@ Future<void> check() async{
fit: BoxFit.contain,width: 150,height: 150, fit: BoxFit.contain,width: 150,height: 150,
), ),
), ),
Text('This is a $finalRisk area',style: TextStyle(fontSize: 25,fontWeight: FontWeight.bold, color: Colors.red[900]),), Text('This is a $finalRisk event',style: TextStyle(fontSize: 25,fontWeight: FontWeight.bold, color: Colors.red[900]),),
], ],
) )
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment