avatar

Posted by Oerror .com

24 Oct, 2024,

Updated at 22 Dec, 2024

Flutter textInputField with hintText

import 'package:flutter/material.dart'; 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: StackOverFlowQuestions(), ), ), ); } } class StackOverFlowQuestions extends StatefulWidget { @override _StackOverFlowQuestionsState createState() => _StackOverFlowQuestionsState(); } class _StackOverFlowQuestionsState extends State { final TextEditingController _textEditingController = TextEditingController(); @override Widget build(BuildContext context) { return Scaffold( appBar: AppBar(title: Text("Appbar title")), body: ListView(padding: const EdgeInsets.all(0.0), children: [ Stack(children: [ Image( image: NetworkImage('https://i.imgur.com/XrJRYCF.png'), fit: BoxFit.cover, width: MediaQuery.of(context).size.width), Positioned.fill( child: Container(color: Colors.black.withOpacity(0.25)), ), Positioned( top: 8, right: 8, child: IconButton( color: Colors.white, icon: Icon(Icons.clear), onPressed: () {}, )) ]), Padding( padding: const EdgeInsets.all(16.0), child: TextFormField( controller: _textEditingController, decoration: InputDecoration(hintText: 'Hello World'))) ])); } }

avatar

Oerror .com

24 Oct, 2024

import 'package:flutter/material.dart'; 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: StackOverFlowQuestions(), ), ), ); } } class StackOverFlowQuestions extends StatefulWidget { @override _StackOverFlowQuestionsState createState() => _StackOverFlowQuestionsState(); } class _StackOverFlowQuestionsState extends State<StackOverFlowQuestions> { final TextEditingController _textEditingController = TextEditingController(); @override Widget build(BuildContext context) { return Scaffold( appBar: AppBar(title: Text("Appbar title")), body: ListView(padding: const EdgeInsets.all(0.0), children: [ Stack(children: [ Image( image: NetworkImage('https://i.imgur.com/XrJRYCF.png'), fit: BoxFit.cover, width: MediaQuery.of(context).size.width), Positioned.fill( child: Container(color: Colors.black.withOpacity(0.25)), ), Positioned( top: 8, right: 8, child: IconButton( color: Colors.white, icon: Icon(Icons.clear), onPressed: () {}, )) ]), Padding( padding: const EdgeInsets.all(16.0), child: TextFormField( controller: _textEditingController, decoration: InputDecoration(hintText: 'Hello World'))) ])); } }

avatar

Oerror .com

24 Oct, 2024

import 'package:flutter/material.dart'; 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: StackOverFlowQuestions(), ), ), ); } } class StackOverFlowQuestions extends StatefulWidget { @override _StackOverFlowQuestionsState createState() => _StackOverFlowQuestionsState(); } class _StackOverFlowQuestionsState extends State<StackOverFlowQuestions> { final TextEditingController _textEditingController = TextEditingController(); @override Widget build(BuildContext context) { return Scaffold( appBar: AppBar(title: Text("Appbar title")), body: ListView(padding: const EdgeInsets.all(0.0), children: [ Stack(children: [ Image( image: NetworkImage('https://i.imgur.com/XrJRYCF.png'), fit: BoxFit.cover, width: MediaQuery.of(context).size.width), Positioned.fill( child: Container(color: Colors.black.withOpacity(0.25)), ), Positioned( top: 8, right: 8, child: IconButton( color: Colors.white, icon: Icon(Icons.clear), onPressed: () {}, )) ]), Padding( padding: const EdgeInsets.all(16.0), child: TextFormField( controller: _textEditingController, decoration: InputDecoration(hintText: 'Hello World'))) ])); } }

We use cookies to enhance your browsing experience, serve personalized ads or content, and analyze our traffic. By clicking "Accept", you consent to our use of cookies. learn more Accept