Skip to content

Instantly share code, notes, and snippets.

@doppelledev
Created July 26, 2019 00:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save doppelledev/2a78883bffde0a160ccf14f9ee2051e5 to your computer and use it in GitHub Desktop.
Save doppelledev/2a78883bffde0a160ccf14f9ee2051e5 to your computer and use it in GitHub Desktop.
for so
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
void main() => runApp(MyApp());
class MyApp extends StatelessWidget {
// This widget is the root of your application.
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Flutter Demo',
home: MyHomePage(),
);
}
}
class MyHomePage extends StatefulWidget {
@override
_MyHomePageState createState() => _MyHomePageState();
}
class _MyHomePageState extends State<MyHomePage> {
String _text = 'Press Me To update Text !';
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text('Change text'),
),
body: Center(
child: RaisedButton(
onPressed: () {
setState(() {
_text = 'The text is updated';
});
},
child: Text(_text),
),
));
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment