Change the Text
Part of the Your First App section of Coddy's Flutter journey. Lesson 2 of 32.
The Text widget shows a line of text. You give it the words to show, inside quotes:
Text('Good morning')Words inside quotes are called a string. Flutter shows a string exactly as you write it: the same letters, the same capitals, the same spaces. Text('good morning') and Text('Good Morning') are two different texts.
When you change your code, press Run again to see the change on the phone.
Challenge
EasyMake the app say I build apps instead of Hello, Flutter!. Capitals and spaces count.
Try it yourself
import 'package:flutter/material.dart';
void main() {
runApp(const MyApp());
}
class MyApp extends StatelessWidget {
const MyApp({super.key});
@override
Widget build(BuildContext context) {
return MaterialApp(
debugShowCheckedModeBanner: false,
home: Scaffold(
body: Center(
child: Text('Hello, Flutter!'),
),
),
);
}
}
This lesson includes a short quiz. Start the lesson to answer it and track your progress.
All lessons in Your First App
1Hello, Flutter
What Is Flutter?Change the TextThe Widget TreeScaffold and AppBarStrings and QuotesCommentsPractice on your own: Online Flutter compiler