Created
February 11, 2020 04:03
-
-
Save ncuillery/c9df57e3b6e4f329af1c73812d0a1729 to your computer and use it in GitHub Desktop.
Flutter mosaic issue
This file contains hidden or 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'; | |
final Color darkBlue = Color.fromARGB(255, 18, 32, 47); | |
void main() { | |
runApp(MyApp()); | |
} | |
class MyApp extends StatelessWidget { | |
@override | |
Widget build(BuildContext context) { | |
return MaterialApp( | |
theme: ThemeData.dark().copyWith(scaffoldBackgroundColor: darkBlue), | |
debugShowCheckedModeBanner: false, | |
home: Scaffold( | |
body: Center( | |
child: ListView( | |
children: [ | |
MosaicBlock(), | |
], | |
), | |
), | |
), | |
); | |
} | |
} | |
class MosaicBlock extends StatelessWidget { | |
@override | |
Widget build(BuildContext context) { | |
return AspectRatio( | |
aspectRatio: 16 / 9, | |
child: Row( | |
children: [ | |
AspectRatio( | |
aspectRatio: 1, | |
child: Image.network( | |
'https://placekitten.com/800/500', | |
fit: BoxFit.cover, | |
), | |
), | |
Expanded( | |
child: Column( | |
children: [ | |
Expanded( | |
child: Container(color: Colors.green), | |
), | |
Expanded( | |
//child: Container(color: Colors.red), | |
child: Image.network( | |
'https://placekitten.com/600/800', | |
fit: BoxFit.cover, | |
), | |
), | |
], | |
), | |
) | |
], | |
), | |
); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment