This file contains hidden or 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
void main() { | |
var values = [4, 5, 2, 3, 1, 0]; | |
// final values = [5, 3, 1, 2, 1]; | |
var s = values[0]; | |
values = values.sublist(1); | |
values.sort((a,b) => b.compareTo(a)); | |
final diffs = []; | |
var diffSum = 0; | |
for (var i = 0; i < values.length - 1; i++) { | |
final a = values[i]; |
This file contains hidden or 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:intl/intl.dart'; | |
import 'package:intl/date_symbol_data_local.dart'; | |
void main() async { | |
final parsedDate = DateTime.parse('2022-08-04 17:00:00'); | |
await initializeDateFormatting('pt_BR'); | |
final formattedDate = DateFormat('E d MMM y', 'pt_BR').format(parsedDate); | |
final capitalizedDate = formattedDate.split(' ').map((e) => '${e[0].toUpperCase()}${e.substring(1)}').join(' '); | |
print(capitalizedDate); | |
} |