import 'package:flutter/material.dart'; void main() { runApp(MyApp()); } class MyApp extends StatefulWidget { @override _MyAppState createState() => _MyAppState(); } class _MyAppState extends State { String value = 'Test'; void clickMe() { setState(() { value = 'Tutor Joes'; }); } @override Widget build(BuildContext context) { return MaterialApp( home: Column( children: [ Text("$value"), FloatingActionButton( child: Icon(Icons.add), onPressed: clickMe, ) ], ), ); } }