double screenWidth = MediaQuery.of(context).size.width;
double screenHeight = MediaQuery.of(context).size.height;
Container(
height: screenHeight,
width: screenWidth,
color: Colors.white,
// ...
),
double screenWidth = MediaQuery.of(context).size.width;
double screenHeight = MediaQuery.of(context).size.height;
Container(
height: screenHeight,
width: screenWidth,
color: Colors.white,
// ...
),
Her page ayri bir dart dosyasinda kodladiginizi varsayalim.
import 'page2.dart';
diger sayfadaki class yukaridaki sekilde import edilmelidir.
File|Settings|Language & Frameworks|Flutter - 'Format code on save'
Before:
void main() {
runApp(AnaEkran(),
);
}
After:
void main() {
runApp(MaterialApp(
home: AnaEkran(),
),
);
}
https://stackoverflow.com/questions/44004451/navigator-operation-requested-with-a-context-that-does-not-include-a-navigator
Random is a generator of bool, int or double values.
var intValue = Random().nextInt(10); // Value is >= 0 and < 10.
var doubleValue = Random().nextDouble(); // Value is >= 0.0 and < 1.0.
var boolValue = Random().nextBool(); // true or false, with equal chance
Reference:
https://api.flutter.dev/flutter/dart-math/dart-math-library.html
Random rnd;
int min = 5;
int max = 10;
rnd = new Random();
r = min + rnd.nextInt(max - min);
print("$r is in the range of $min and $max");
//1 ile 5 arasında bir sayı döndür
import 'dart:math';
int max = 5;
int randomNumber = Random().nextInt(max) + 1;
int nextInt(int min, int max) => min + _random.nextInt((max + 1) - min);
import 'dart:math';
Random rnd = new Random();
// Define min and max value
int min = 1, max = 10;
//Getting range
int num = min + rnd.nextInt(max - min);
print("$num is in the range of $min and $max");
double screenWidth = MediaQuery.of(context).size.width; double screenHeight = MediaQuery.of(context).size.height; Container( height: sc...