How to add a border to only one part of the container in Flutter?

This Article is posted by seven.srikanth at 06-12-2018 01:23:54

In this article, I'm going to show you how to add a border to only one or few parts of the container in Flutter?

This is how the final output is going to look.

Here is the code to achieve this,

import 'package:flutter/material.dart';

void main() {

class MyApp extends StatelessWidget {
Widget build(BuildContext context) {
return Center(
child: Container(
child: Text(
"This is a Boder with One Side",
textDirection: TextDirection.ltr,
style: TextStyle(color:,
padding: EdgeInsets.symmetric(vertical: 100.0, horizontal: 100.0),
decoration: BoxDecoration(
border: Border(
top: BorderSide(width: 16.0, color: Colors.lightBlue.shade600),
bottom: BorderSide(width: 16.0, color: Colors.lightBlue.shade900),
color: Colors.white,


Tags: How to add a border to only one part of the container in Flutter?; border class; borderside class;

Login to comment.
Recent Comments

Be the first to Comment. You can ask a Query or Share your toughts or Just say thanks.

Recent Articles

How to deploy flutter web site on GitHub using peanut

Posted by nikhilchaudhary12155 on 13 Oct 2019 Article

AnimatedPositioned Widget Example in Flutter

Posted by seven.srikanth on 10 Oct 2019 Article

Flutter Open-Source and directory lists

Posted by nishantkotatech on 09 Oct 2019 Article

Flutter Travelling Couple Leading Page - Flutter Web Series 3

Posted by nikhilchaudhary12155 on 05 Oct 2019 Article

© 2018 - Fluttercentral | Email to me -