Created with <3 with dartpad.dev.
Last active
October 16, 2022 14:01
-
-
Save pratikbutani/1e9de65ff62acacfe2611706c5eb7246 to your computer and use it in GitHub Desktop.
Change color of border & IconData in TextInput
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'package:flutter/material.dart'; | |
void main() { | |
runApp(MyApp()); | |
} | |
class MyApp extends StatelessWidget { | |
@override | |
Widget build(BuildContext context) { | |
return MaterialApp( | |
theme: ThemeData().copyWith( | |
scaffoldBackgroundColor: Colors.white, | |
colorScheme: ThemeData().colorScheme.copyWith(primary: Colors.green), | |
), | |
debugShowCheckedModeBanner: false, | |
home: Scaffold( | |
body: Center( | |
child: Padding( | |
padding: const EdgeInsets.all(24.0), | |
child: MyWidget(), | |
), | |
), | |
), | |
); | |
} | |
} | |
class MyWidget extends StatelessWidget { | |
@override | |
Widget build(BuildContext context) { | |
return const TextField( | |
decoration: InputDecoration( | |
prefixIcon: Icon(Icons.lock_outline), | |
hintText: 'Username', | |
), | |
); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment