Home > database >  Draw image above 3 Rows
Draw image above 3 Rows

Time:04-17

I have 3 Rows and i want draw a picture as a line, please look at picture. I tryed stack but dosent work for me enter image description here

CodePudding user response:

Try this code

import 'package:flutter/material.dart';

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

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      theme: ThemeData(primarySwatch: Colors.blue),
      home: Stack(
        children: [
          Center(
            child: Row(
              mainAxisAlignment: MainAxisAlignment.center,
              children: [
                Container(width: 60, height: 60, color: Colors.red),
                Container(width: 60, height: 60, color: Colors.green),
                Container(width: 60, height: 60, color: Colors.blue),
              ],
            ),
          ),
          Center(
            child: Container(
              color: Colors.purple,
              height: 10,
              width: 200,
            ),
          ),
        ],
      ),
    );
  }
}

Result:

enter image description here

Live example: DartPad

  • Related