Advertisement
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 {
- Container MyArticles(String imagefile, String header, String subheafer){
- return Container(
- width: 100.0,
- child: Card(
- child: Wrap(
- children: <Widget>[
- //Image.asset('assets/aries_120.jpg'),
- ListTile(
- title: Text(header),
- subtitle: Text(subheafer)
- )
- ],
- ),
- ),
- );
- }
- @override
- Widget build(BuildContext context) {
- return MaterialApp(
- //debugShowCheckedModeBanner: false,
- title: 'Flutter Demo',
- theme: ThemeData(
- primaryColor: Color(0xff622F72)
- ),
- home: Scaffold(
- appBar: AppBar(
- title: Text('Scroll View - Horizontal',
- style: TextStyle(
- color: Colors.white
- ),)
- ),
- body: Container(
- margin: EdgeInsets.symmetric(vertical: 20.0),
- height: 200,
- child: ListView(
- scrollDirection: Axis.horizontal,
- children: <Widget>[
- MyArticles('some_img_file', 'header1', 'subheader1'),
- MyArticles('some_img_file', 'header2', 'subheader2'),
- MyArticles('some_img_file', 'header3', 'subheader3'),
- MyArticles('some_img_file', 'header4', 'subheader4'),
- MyArticles('some_img_file', 'header5', 'subheader5'),
- MyArticles('some_img_file', 'header6', 'subheader6')
- ],
- ),
- )
- )
- );
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement