Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import 'package:flutter/material.dart';
- void main() => runApp(MyApp());
- class MyApp extends StatelessWidget {
- @override
- Widget build(BuildContext context) {
- return MaterialApp(
- title: 'Flutter Demo',
- theme: ThemeData.light(),
- home: Home(),
- );
- }
- }
- class Home extends StatelessWidget {
- @override
- Widget build(BuildContext context) {
- return Scaffold(
- appBar: AppBar(
- title: Text("Whatever"),
- centerTitle: true,
- ),
- body: ListView.builder(
- itemBuilder: (context, index) => Padding(
- padding: EdgeInsets.only(bottom: 10),
- child: AspectRatio(
- aspectRatio: 2,
- child: Container(
- color: Colors.red,
- child: Center(child: Text("item : $index")),
- ),
- ),
- ),
- ),
- );
- }
- }
Add Comment
Please, Sign In to add comment