Last active
May 10, 2021 12:00
-
-
Save faizan1947/f00ec5a8257a2e1b8d1ab8f26c1de99b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'package:flutter/material.dart'; | |
import 'package:date_format/date_format.dart'; | |
class TEST extends StatefulWidget { | |
@override | |
_TESTState createState() => _TESTState(); | |
} | |
class _TESTState extends State<TEST> { | |
String currentDate = formatDate(DateTime.now(), [mm, '-', dd, '-', yyyy]); | |
//String saturday = formatDate(DateTime(5), [DD]) ; | |
int currentDay = formatDate(DateTime(DateTime.now().weekday), [DD]) as int; | |
@override | |
Widget build(BuildContext context) { | |
return Scaffold( | |
body: Center( | |
child: ElevatedButton( | |
onPressed: () { | |
setState(() { | |
int currentDay = 7; | |
switch (currentDay) { | |
case 1: { | |
print(" number 1"); | |
} break; | |
case 2: { | |
print(" number 2"); | |
} break; | |
case 3: { | |
print(" number 3"); | |
} break; | |
case 4: { | |
print(" number 4"); | |
} break; | |
case 5: { | |
print(" number 5"); | |
} break; | |
case 6: { | |
print(" number 6"); | |
} break; | |
case 7: { | |
print(" number 7"); | |
} break; | |
default: { | |
print("This is default case"); | |
} break; | |
} | |
}); | |
}, | |
child: Text('s'), | |
), | |
), | |
); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment