Skip to main content

Posts

Showing posts from May, 2023

how add labeltext to the container in flutter

 how add labeltext to the container in flutter for an explanation watch the video code 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: &

flutter text widget example

 flutter text widget example code :  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 TextWidget(), ); } } class TextWidget extends StatelessWidget { const TextWidget({super.key}); @override Widget build(BuildContext context) { return Scaffold( appBar: AppBar( title: Text('Text Widget'), ), body: Container( child: Text( 'Hi, How Are you?', style: TextStyle( fontSize: 40, color: Colors.red, fontWeight: FontWeight.bold, fontStyle: FontStyle.italic, letterSpacing: 3, wordSpacing: