Calculate Square Root Of Given Number
Complete Code For Calculate Square Root Of Given Number In Flutter
main.dart
import 'package:flutter/material.dart'; import 'dart:math'; void main() => runApp(MyApp()); class MyApp extends StatelessWidget { double SQUARE_1 = 625; double SQUARE_2; findSquareRoot() { SQUARE_2 = sqrt(SQUARE_1); print(SQUARE_2); } @override Widget build(BuildContext context) { return MaterialApp( debugShowCheckedModeBanner: false, home: Scaffold( appBar: AppBar( backgroundColor: Colors.lightGreen, title: Text("Square Root Of Given Number"), ), 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 Square Root Of Number '), textColor: Colors.white, color: Color(0xFFFFC107), padding: EdgeInsets.fromLTRB(10, 10, 10, 10), )), ] ) ) ) ); } }