Skip to content

Instantly share code, notes, and snippets.

@mmanflori
Created February 24, 2019 07:47
Show Gist options
  • Save mmanflori/129b6cc35bd58e643bb9e2cab6bc8eb9 to your computer and use it in GitHub Desktop.
Save mmanflori/129b6cc35bd58e643bb9e2cab6bc8eb9 to your computer and use it in GitHub Desktop.
ListView Beispiel
import 'package:flutter/material.dart';
void main() => runApp(MyApp());
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
debugShowCheckedModeBanner: false,
title: 'Flutter Beispiel',
theme: ThemeData(
primarySwatch: Colors.blue,
),
home: Scaffold(
appBar: AppBar(
title: Text(
"Scroll View Horizontal",
style: TextStyle(
color: Colors.white,
),
),
),
body: Container(
margin: EdgeInsets.symmetric(vertical: 20.0),
height: 300.0,
child: ListView(
scrollDirection: Axis.horizontal,
children: <Widget>[
Container(
width: 160.0,
child: Card(
child: Wrap(
children: <Widget>[
Image.asset("bilder/wasser1.png",),
ListTile(
title: Text("Wasser"),
subtitle: Text("Blaue Periode"),
),
],
),
),
),
Container(
width: 160.0,
child: Card(
child: Wrap(
children: <Widget>[
Image.network(
"https://images.unsplash.com/photo-1518495973542-4542c06a5843?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=crop&w=2134&q=80",
),
ListTile(
title: Text("Natur"),
subtitle: Text("Baum"),
)
],
),
),
),
Container(
width: 160.0,
child: Card(
child: Wrap(
children: <Widget>[
Image.network(
"https://images.unsplash.com/photo-1518495973542-4542c06a5843?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=crop&w=2134&q=80"),
ListTile(
title: Text("Natur"),
subtitle: Text("Baum"),
),
],
),
),
),
Container(
width: 160.0,
child: Card(
child: Wrap(
children: <Widget>[
Image.network(
"https://images.unsplash.com/photo-1518495973542-4542c06a5843?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=crop&w=2134&q=80"),
ListTile(
title: Text("Natur"),
subtitle: Text("Baum"),
),
],
),
),
),
Container(
width: 160.0,
child: Card(
child: Wrap(
children: <Widget>[
Image.asset("bilder/wasser1.png",),
ListTile(
title: Text("Wasser"),
subtitle: Text("Blaue Periode"),
),
],
),
),
),
],
),
),
)
);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment