Skip to content

Instantly share code, notes, and snippets.

@datafoya
Created June 18, 2019 16:25
Show Gist options
  • Save datafoya/96bb046154fbe16a36168040ac7fb78d to your computer and use it in GitHub Desktop.
Save datafoya/96bb046154fbe16a36168040ac7fb78d to your computer and use it in GitHub Desktop.
widget sizing 2
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