Calculator
Calculator
TEXNOLOGIYALAR VAZIRLIGI
FARG’ONA FILIALI
Rahmonov Akbarjonning
fanidan tayyorlagan
MUSTAQIL ISHI
O’qituvchi: MUSAYEV X. SH.
main.dart
;
import 'package:flutter/material.dart';
@override
Widget build(BuildContext context) {
return Scaffold(
backgroundColor: Colors.black,
body: Column(
mainAxisAlignment: MainAxisAlignment.end,
children: [
Container(
alignment: Alignment.bottomRight,
padding: EdgeInsets.symmetric(horizontal: 24, vertical: 16),
child: Text(
_output,
style: TextStyle(fontSize: 60, color: Colors.white, fontWeight:
FontWeight.w200),
),
),
Divider(color: Colors.grey),
_buildRow([
"C",
"⌫",
"%",
"/",
], [
Colors.grey,
Colors.grey,
Colors.grey,
Colors.orange,
], [
Colors.black,
Colors.black,
Colors.black,
Colors.white,
]),
_buildRow([
"7",
"8",
"9",
"x",
], [
Colors.grey[850]!,
Colors.grey[850]!,
Colors.grey[850]!,
Colors.orange,
], [
Colors.white,
Colors.white,
Colors.white,
Colors.white,
]),
_buildRow([
"4",
"5",
"6",
"-",
], [
Colors.grey[850]!,
Colors.grey[850]!,
Colors.grey[850]!,
Colors.orange,
], [
Colors.white,
Colors.white,
Colors.white,
Colors.white,
]),
_buildRow([
"1",
"2",
"3",
"+",
], [
Colors.grey[850]!,
Colors.grey[850]!,
Colors.grey[850]!,
Colors.orange,
], [
Colors.white,
Colors.white,
Colors.white,
Colors.white,
]),
_buildRow([
"0",
".",
"=",
], [
Colors.grey[850]!,
Colors.grey[850]!,
Colors.orange,
], [
Colors.white,
Colors.white,
Colors.white,
], [
2, // Width factor for 0 button
1,
1,
]),
],
),
);
}
}
Natija: