Created
June 18, 2019 16:25
-
-
Save datafoya/96bb046154fbe16a36168040ac7fb78d to your computer and use it in GitHub Desktop.
widget sizing 2
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_web/material.dart'; | |
import 'package:flutter_web_test/flutter_web_test.dart'; | |
import 'package:flutter_web_ui/ui.dart' as ui; | |
void main() async { | |
await ui.webOnlyInitializePlatform(); | |
runApp(MyApp()); | |
} | |
class MyApp extends StatelessWidget { | |
@override | |
Widget build(BuildContext context) { | |
return MaterialApp( | |
title: 'Flutter layout demo', | |
home: Scaffold( | |
appBar: AppBar( | |
title: Text('Flutter layout demo'), | |
), | |
// Change to buildFoo() for the other examples | |
body: Center(child: buildExpandedImages()), | |
), | |
); | |
} | |
Widget buildExpandedImages() => | |
// #docregion expanded-images | |
Row( | |
crossAxisAlignment: CrossAxisAlignment.center, | |
children: [ | |
Text('hi'), | |
Image.network( | |
'https://raw.githubusercontent.com/flutter/website/master/examples/layout/sizing/images/pic1.jpg', | |
), | |
], | |
); | |
// #enddocregion expanded-images | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment