Skip to content

Instantly share code, notes, and snippets.

@rashmisridar
Last active November 25, 2020 10:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rashmisridar/e3116de6afb375d54db7b843d03cd35c to your computer and use it in GitHub Desktop.
Save rashmisridar/e3116de6afb375d54db7b843d03cd35c to your computer and use it in GitHub Desktop.
Chip add width & height issue
import 'package:flutter/material.dart';
final Color darkBlue = Color.fromARGB(255, 18, 32, 47);
void main() {
runApp(MyApp());
}
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
theme: ThemeData.dark().copyWith(scaffoldBackgroundColor: darkBlue),
debugShowCheckedModeBanner: false,
home: Scaffold(
body: Center(
child: MyWidget(),
),
),
);
}
}
class MyWidget extends StatefulWidget {
@override
_MyWidgetState createState() => _MyWidgetState();
}
class _MyWidgetState extends State<MyWidget> {
@override
Widget build(BuildContext context) {
return Column(
mainAxisAlignment: MainAxisAlignment.start,
children: [
Transform(
transform: new Matrix4.identity()..scale(2.0),
child: new Chip(
label: Text('VIP', style: TextStyle(color: Colors.blue)),
padding: const EdgeInsets.only(left: 20, right: 20),
shape: StadiumBorder(
side: BorderSide(color: Colors.redAccent, width: 2.0)),
)),
SizedBox(height:100),
Container(
padding: EdgeInsets.all(10),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Text(
"BMW 520D",
style: TextStyle(color: Colors.blue),
textAlign: TextAlign.center,
),
Chip(
padding: const EdgeInsets.only(left: 30, right: 30),
shape: StadiumBorder(
side: BorderSide(color: Colors.grey, width: 0.5)),
label: Align(
alignment: Alignment.center,
child: Text(
"VIP",
style: TextStyle(color: Colors.blue),
textAlign: TextAlign.center,
),
),
),
],
),
),
],
);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment