Porque a frase: Hi from MyStatefulWidge não é impressa no Device e sim no Console ?
import 'package:flutter/material.dart';
void main(){
runApp(
MyStatefulWidget()
);
}
class MyStatefulWidget extends StatefulWidget{
@override
_MyStatefulWidgetState createState()=> _MyStatefulWidgetState();}
class _MyStatefulWidgetState extends State<MyStatefulWidget>{
var myColor = Colors.red;
changeColor(){
setState(() {
myColor = Colors.blue;
});
}
@override
Widget build(BuildContext context){
return MaterialApp(
home: Container(
color: myColor,
child: Center(
child: RaisedButton(
child: Text("Click", textDirection: TextDirection.ltr,),
onPressed:(){
print("Hi from MyStatefulWidget");
changeColor();
}
),
),
),
);
}
}