Flutter Dart Calculate Find Cube Or N Power Of Exponent

admin_img Posted By Bajarangi soft , Posted On 10-10-2020

In Flutter the ‘dart:math’ library contains most of mathematical functions. One of them is pow() method. The pow() function returns Returns x to the power of given exponent. Using this we can find Square, Cube and all the mathematical exponent related calculations. All we have to do is pass the Number and exponent and it will return us the calculated result.

How To Find Cube Of Given Number In Flutter Android App

 Calculate Find Cube Or N Power Of Exponent 
Complete Code For Calculate Find Cube Or N Power Of Exponent   In Flutter
Main.dart

import 'package:flutter/material.dart';
import 'dart:math';
void main() => runApp(MyApp());
class MyApp extends StatelessWidget {
  double Number1 = 9;
  double Number2;
  findSquareRoot() {
    Number2 = pow(Number1, 4);
    print(Number2);
  }
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      debugShowCheckedModeBanner: false,
        home: Scaffold(
            body: Center(
                child: Column(
                    mainAxisAlignment: MainAxisAlignment.center,
                    children: <Widget>[
                      Container(
                          margin: const EdgeInsets.fromLTRB(20, 10, 20, 10),
                          child: RaisedButton(
                            onPressed: () => findSquareRoot(),
                            child: Text('Find Cube Of Given Number'),
                            textColor: Colors.white,
                            color: Colors.deepOrangeAccent,
                            padding: EdgeInsets.fromLTRB(12, 12, 12, 12),
                          )),
                    ]))));
  }
}

Related Post