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:flutter/material.dart'; | |
| import 'package:flutter_application_2/splash.dart'; | |
| import 'dart:io'; | |
| import 'package:image_picker/image_picker.dart'; | |
| void main() { | |
| runApp(const MyApp()); | |
| } | |
| class MyApp extends StatelessWidget { | |
| const MyApp({super.key}); |
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:flutter/material.dart'; | |
| void main() => runApp(const MyApp()); | |
| class MyApp extends StatelessWidget { | |
| const MyApp({super.key}); | |
| static const String _title = 'Simple calculator app by Lefa Lipali'; | |
| // This widget is the root of your application. | |
| @override | |
| Widget build(BuildContext context) { |
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
| /*Circle Area: Declare a constant variable for pi (3.14159). Ask the user for the | |
| radius of a circle. Calculate the area of the circle using the formula area = pi * | |
| radius * radius. Use string interpolation to print the result in the format "The area | |
| of the circle is [area]"*/ | |
| import 'dart:io'; | |
| void main() { | |
| const double pi = 3.14159; | |
| double? radius; |
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
| /*Greetings: Ask the user for their first and last names. Store these in | |
| variables. Then, use string interpolation to create a greeting message like | |
| "Hello, [FirstName] [LastName]!". Print the message. */ | |
| import 'dart:io'; | |
| void main() { | |
| //First we promt and read then store the inputs | |
| stdout.write("Please enter your first name: "); | |
| String firstName = stdin.readLineSync() ?? ""; |