An Interest In:
Web News this Week
- April 28, 2024
- April 27, 2024
- April 26, 2024
- April 25, 2024
- April 24, 2024
- April 23, 2024
- April 22, 2024
April 5, 2023 06:33 am GMT
Original Link: https://dev.to/realnamehidden1_61/how-add-labeltext-to-the-container-in-flutter-5a9f
how add labeltext to the container in flutter
import 'package:flutter/material.dart';void main() { runApp(const MyApp());}class MyApp extends StatelessWidget { const MyApp({super.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 Home(), debugShowCheckedModeBanner: false, ); }}class Home extends StatefulWidget { const Home({super.key}); @override State<Home> createState() => _HomeState();}class _HomeState extends State<Home> { @override Widget build(BuildContext context) { return Scaffold( body: Center( child: Container( height: 100, width: 400, child: InputDecorator( decoration: InputDecoration( labelText: 'Box', border: OutlineInputBorder( borderRadius: BorderRadius.circular(10), )), child: Text("Container Content"), ), ), ), ); }}
Original Link: https://dev.to/realnamehidden1_61/how-add-labeltext-to-the-container-in-flutter-5a9f
Share this article:
Tweet
View Full Article
Dev To
An online community for sharing and discovering great ideas, having debates, and making friendsMore About this Source Visit Dev To