Skip to content

Instantly share code, notes, and snippets.

@brighthr-stanton
Created November 17, 2020 17:25
Show Gist options
  • Save brighthr-stanton/ceb91d98a7f7130460e467b66dc92487 to your computer and use it in GitHub Desktop.
Save brighthr-stanton/ceb91d98a7f7130460e467b66dc92487 to your computer and use it in GitHub Desktop.
Border customisation
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.light().copyWith(scaffoldBackgroundColor: Colors.white),
debugShowCheckedModeBanner: false,
home: Scaffold(
body: Center(
child: Padding(
padding: EdgeInsets.all(20),
child: Form(
child: Column(
children: [
Field(),
Field(),
],
))),
),
),
);
}
}
final focusedBorder = UnderlineInputBorder(
borderSide: BorderSide(width: 2, color: Colors.grey[600]),
);
final normalBorder = UnderlineInputBorder(
borderSide: BorderSide(width:0.3, color: Colors.grey[200]),
);
class Field extends StatelessWidget {
@override
Widget build(BuildContext context) {
return TextFormField(
initialValue: "Blah",
decoration: InputDecoration(
focusedBorder: focusedBorder,
border: normalBorder,
),
);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment