Last active
October 2, 2020 19:23
-
-
Save usimsek/12eac1e08ba969c27d34a621b39bb655 to your computer and use it in GitHub Desktop.
Hatalar
This file contains 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
a non-null string must be provided to a text widget | |
// bu hatayı verirse verdiği sayfada text widet null olamaz aşağıdaki gibi null kontrol ekle | |
Text(usertxt != null ? usertxt : 'Default Value'), | |
******************************************** | |
'package:flutter/src/widgets/navigator.dart': Failed assertion: line 1748 pos 12: '!_debugLocked': is not true. | |
// bu hatayı splash ekranında token kontrolü yaptığımda sayfa yönlendirmesinde veriyor. | |
//Sayfa yönlendirme işlemini aşağıdaki gibi yapmak lazım | |
// routes: {"login": (context) => LoginView(),}, // main.dart dosyasındaki route ismi ile çağrılınca düzeliyor. 2 side olur. | |
1-) WidgetsBinding.instance.addPostFrameCallback((_) { | |
Navigator.of(context).pushReplacementNamed("login"); | |
}); | |
2-) Navigator.of(context) | |
.pushNamedAndRemoveUntil('login', (Route<dynamic> route) => false); | |
********************************************************* | |
_TypeError (type 'int' is not a subtype of type 'double' of 'index') | |
// api den gelen double veride model tarafında null kontrolü yapılınca düzeliyor. | |
//modelde eskisini yenisi ile değiştirince hata düzeliyor. | |
gunlukOdeme =json['gunlukOdeme']; // eski | |
gunlukOdeme = json['gunlukOdeme'] == null ? 0.0 : json['gunlukOdeme'].toDouble(); //yeni | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment