Skip to content

Instantly share code, notes, and snippets.

@fladago
Last active August 29, 2021 16:29
Show Gist options
  • Save fladago/20455933b8c2127def595e7fdc7f89a1 to your computer and use it in GitHub Desktop.
Save fladago/20455933b8c2127def595e7fdc7f89a1 to your computer and use it in GitHub Desktop.
BorderSide doesn't work
import 'package:flutter/material.dart';
void main() {
runApp(const MyApp());
}
class MyApp extends StatelessWidget {
const MyApp({Key? key}) : super(key: key);
// This widget is the root of your application.
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Flutter Demo',
theme: ThemeData(
primarySwatch: Colors.blue,
),
home: const CustomContainer(),
);
}
}
class CustomContainer extends StatelessWidget {
const CustomContainer({Key? key}) : super(key: key);
@override
Widget build(BuildContext context) {
return Scaffold(
body: Center(
child: Container(
height: 300,
width: 350,
decoration: BoxDecoration(
color: Colors.blue,
border: Border.all(
width: 19, // <--- border Work here
),
// border: Border(
// top: BorderSide(
// color: Colors.black, width: 10.0, style: BorderStyle.solid),
// right: BorderSide(
// color: Colors.black, width: 10.0, style: BorderStyle.solid),
// bottom: BorderSide(
// color: Colors.black, width: 10.0, style: BorderStyle.solid),
// left: BorderSide(
// color: Colors.blue, width: 10.0, style: BorderStyle.solid),
// ),
borderRadius: const BorderRadius.only(
topRight: Radius.circular(30),
bottomRight: Radius.circular(30),
),
),
),
),
);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment