Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Can Someone please explain in detail how i do this formula in Flutter?

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

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

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
},
Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading