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
class SimpleWidget extends StatefulWidget { | |
@override | |
SimpleWidgetState createState() => new SimpleWidgetState(); | |
} | |
class SimpleWidgetState extends State<SimpleWidget> { | |
int stepCounter = 0; | |
List<Step> steps = [ | |
new Step( |
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
import 'package:flutter/material.dart'; | |
class CommonThings { | |
static Size width; | |
static Size height; | |
} | |
void main() => runApp(new MyApp()); | |
class MyApp extends StatelessWidget { |
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
import 'package:flutter/material.dart'; | |
class TextWidget extends StatelessWidget { | |
const TextWidget({ | |
this.labelText, | |
this.iconPrefix, | |
this.maxLines, | |
this.isPassword = false, | |
}); |
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
import 'package:flutter/material.dart'; | |
final Color darkBlue = Color.fromARGB(255, 18, 32, 47); | |
void main() { | |
runApp(MyApp()); | |
} | |
class MyApp extends StatelessWidget { | |
@override |
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
void main(){ | |
var x = "4"; | |
int number = int.parse(x);//STRING to INT | |
var y = "4.6"; | |
double doubleNum = double.parse(y);//STRING to DOUBLE | |
var z = 55; | |
String myStr = z.toString();//INT to STRING | |
} |
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 |
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
import 'package:flutter/material.dart'; | |
class SwitchOnchangedListener extends StatefulWidget { | |
@override | |
SwitchOnchangedListenerState createState() { | |
return new SwitchOnchangedListenerState(); | |
} | |
} | |
class SwitchOnchangedListenerState extends State<SwitchOnchangedListener> { |
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
print(Countries.Cote_d_Ivoire.toString().split('.').last.replaceAll("_", " ")); // Cote d Ivoire |
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
//import 'dart:math' as math; | |
Color((math.Random().nextDouble() * 0xFFFFFF).toInt()).withOpacity(1.0) | |
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
import 'package:flutter/material.dart'; | |
void main() => runApp(MyApp()); | |
class MyApp extends StatelessWidget { | |
@override | |
Widget build(BuildContext context) { | |
return MaterialApp( | |
title: 'Flutter Demo', | |
debugShowCheckedModeBanner: false, |
OlderNewer