|5| Wrap

Wrap:
 Wrap


import 'package:flutter/material.dart';

void main() {
  runApp(MyApp());
}

class MyApp extends StatelessWidget {
  @override  Widget build(BuildContext context) {
    return MaterialApp(
      debugShowCheckedModeBanner: false,

      home: MyHomepage(),
    );
  }
}

class MyHomepage extends StatefulWidget {
  @override  _MyHomepageState createState() => _MyHomepageState();
}

class _MyHomepageState extends State<MyHomepage> {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text(
            "Wrap"        ),
      ),
      body: Wrap(
        spacing: 14.0,
        // Gap between lines.        runSpacing: 8.0,
        direction: Axis.horizontal,
        children: [
          'Flutter',
          'Dart',
          'Android',
          'Widget',
          'Youtube',
          'Facebook',
          'Google',
          'Wrap',
        ]
            .map((String name) => Chip(
          avatar: CircleAvatar(child: Text(name.substring(0, 1))),
          label: Text(name),
        ))
            .toList(),
      ),
    );
  }
}

Comments

Popular posts from this blog

|9| Transform Slider

|6| Stack

|8| Routes