Container(
          width: double.infinity,
          height: 1,
          color: Colors.black,
        ),

全体のソース

import 'package:flutter/material.dart';

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

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        appBar: AppBar(
          title: const Text('Draw 3 Lines Across Screen Width'),
        ),
        body: Column(
          children: [
            SizedBox(height: 10,),
            Container(
              width: double.infinity,
              height: 5,
              color: Colors.blue,
            ),
            SizedBox(height: 10,),
            Container(
              width: double.infinity,
              height: 5,
              color: Colors.red,
            ),
            SizedBox(height: 10,),
            Container(
              width: double.infinity,
              height: 5,
              color: Colors.green,
            ),
          ],
        ),
      ),
    );
  }
}

Leave a Reply

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>

(required)

(required)

© 2024 Falco Tech Blog Suffusion theme by Sayontan Sinha