i am trying to create a single page app where I want to add and multiply some values, values are given below;
(currentTime.Day + currentTime.Month + 39) * currentTime.Year
and i want the value shown below and also get copied
this is the formula
>Solution :
As far as i understood you want this fuzzy expression to be implemented, you can refer the below code:
void main() {
int day = DateTime.now().day;
int month = DateTime.now().month;
int year = DateTime.now().year;
int result = (day + month + 39) * year;
print(result);
}
For adding this data to your device clipboard you need a button, on it’s click it will add the value to the clipboard:
import this import 'package:flutter/services.dart';
And then Simply implement this into your onPressed of the button:
onPressed: () async {
await Clipboard.setData(ClipboardData(text: result));
// copied successfully
},