Created
November 4, 2022 15:05
-
-
Save leighajarett/5715d4f269f629d274ef1b0e9546853b to your computer and use it in GitHub Desktop.
Flutter Row Example
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/cupertino.dart'; | |
import 'package:flutter/material.dart'; | |
void main() { | |
runApp(const MyApp()); | |
} | |
class MyApp extends StatelessWidget { | |
const MyApp({super.key}); | |
@override | |
Widget build(BuildContext context) { | |
return CupertinoApp( | |
home: const HomePage(), | |
); | |
} | |
} | |
class HomePage extends StatelessWidget { | |
const HomePage({Key? key}) : super(key: key); | |
@override | |
Widget build(BuildContext context) { | |
return Scaffold( | |
body: Center( | |
child: | |
// #docregion row | |
Row( | |
mainAxisAlignment: MainAxisAlignment.center, | |
children: const [ | |
Icon(CupertinoIcons.globe), | |
Text('Hello, world!'), | |
], | |
), | |
// #enddocregion row | |
), | |
); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment