Skip to content

Instantly share code, notes, and snippets.

@ncuillery
Created February 11, 2020 04:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ncuillery/c9df57e3b6e4f329af1c73812d0a1729 to your computer and use it in GitHub Desktop.
Save ncuillery/c9df57e3b6e4f329af1c73812d0a1729 to your computer and use it in GitHub Desktop.
Flutter mosaic issue
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