Last active
December 7, 2019 22:03
-
-
Save cnruby/3145e7cef26b5701c57b4a61430653dc to your computer and use it in GitHub Desktop.
Flutter App 31: Change the main() from "App30" to two "class 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'; | |
void main() { | |
runApp(new FriendlychatApp()); | |
} | |
class FriendlychatApp extends StatelessWidget { | |
@override | |
Widget build(BuildContext context) { | |
return new MaterialApp( | |
title: "Friendlychat", | |
home: new ChatScreen(), | |
); | |
} | |
} | |
class ChatScreen extends StatelessWidget { | |
@override | |
Widget build(BuildContext context) { | |
return new Scaffold( | |
appBar: new AppBar( | |
title: new Text("Friendlychat") | |
), | |
); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment