import 'dart:math';
import 'package:flutter/material.dart';
class Textwidgets extends StatelessWidget {
const Textwidgets({super.key});
@override
Widget build(BuildContext context) {
return Scaffold(
body: SafeArea(
child: SingleChildScrollView(
padding: const EdgeInsets.all(16.0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
// ==================== ১. TEXT WIDGET SECTION ====================
const Text(
"--- Text Widget Properties ---",
style: TextStyle(color: Colors.white, fontSize: 18, fontWeight: FontWeight.bold),
),
const SizedBox(height: 15),
Text(
"""check text style
check text style""",
style: TextStyle(
color: Colors.blue, // টেক্সটের কালার নীল
fontSize: 30, // টেক্সটের সাইজ ৩০
fontStyle: FontStyle.italic, // টেক্সট বাঁকা (Italic) হবে
fontWeight: FontWeight.bold, // টেক্সট মোটা (Bold) হবে
letterSpacing: 2, // অক্ষরের মাঝের স্পেস
height: 3, // লাইনের উচ্চতা (Line Height)
wordSpacing: 5, // শব্দের মাঝের স্পেস
decoration: TextDecoration.overline, // টেক্সটের ওপর দাগ হবে
decorationColor: Colors.pink, // উপরের দাগের কালার গোলাপি
decorationStyle: TextDecorationStyle.wavy, // দাগটি ঢেউ খেলানো হবে
backgroundColor: Colors.amber, // টেক্সটের ব্যাকগ্রাউন্ড কালার
shadows: [
Shadow(
blurRadius: 5, // শ্যাডোর ঝাপসা ভাব
offset: const Offset(5, 5), // শ্যাডোর পজিশন (ডানে ও নিচে)
color: Colors.black.withOpacity(0.9), // শ্যাডোর কালার
)
],
),
textAlign: TextAlign.center, // টেক্সট সেন্টারে থাকবে
overflow: TextOverflow.ellipsis, // সীমানা পার হলে ... দেখাবে
maxLines: 2, // সর্বোচ্চ ২ লাইন দেখাবে
softWrap: false, // জোর করে এক লাইনে রাখবে (নিচে নামবে না)
textScaler: const TextScaler.linear(1.1), // টেক্সট ১.১ গুণ বড় দেখাবে
),
const SizedBox(height: 40), // সেকশনের মাঝে গ্যাপ
// ==================== ২. RICH TEXT SECTION ====================
const Text(
"--- RichText Widget ---",
style: TextStyle(color: Colors.black, fontSize: 18, fontWeight: FontWeight.bold),
),
const SizedBox(height: 15),
RichText(
text: const TextSpan(
text: "Hello",
style: TextStyle(color: Colors.black, fontSize: 24), // মূল স্টাইল
children: [
TextSpan(
text: " Flutter",
style: TextStyle(color: Colors.blue, fontWeight: FontWeight.w700), // আলাদা স্টাইল
),
TextSpan(
text: " Developer",
style: TextStyle(color: Colors.green), // আলাদা স্টাইল
),
],
),
),
const SizedBox(height: 40),
// ==================== ৩. ICON WIDGET SECTION ====================
const Text(
"--- Icon Widget Properties ---",
style: TextStyle(color: Colors.black, fontSize: 18, fontWeight: FontWeight.bold),
),
const SizedBox(height: 15),
// প্রথম আইকন: আপনার দেওয়া সব প্রপার্টিসহ
const Icon(
Icons.favorite,
size: 50,
color: Colors.red,
semanticLabel: "Favorite", // স্ক্রিন রিডারের জন্য নাম
textDirection: TextDirection.ltr, // বাম থেকে ডান দিক
fill: 1.0, // সম্পূর্ণ ভরাট (Filled)
weight: 400, // সাধারণ পুরুত্ব
grade: 0, // নরমাল গ্রেড
opticalSize: 48, // অপটিক্যাল সাইজ ৪৮
),
const Text("Icon 1: Filled Red Heart", style: TextStyle(color: Colors.grey)),
const SizedBox(height: 20),
// দ্বিতীয় আইকন: চিকন বর্ডার ও খালি আইকন
const Icon(
Icons.favorite_border,
color: Colors.red,
size: 50,
fill: 0.0, // খালি আইকন (Outline)
weight: 100, // একদম চিকন বর্ডার
),
const Text("Icon 2: Thin Border Heart", style: TextStyle(color: Colors.grey)),
const SizedBox(height: 40),
// ==================== ৪. ICON THEME SECTION ====================
const Text(
"--- IconTheme Widget ---",
style: TextStyle(color: Colors.black, fontSize: 18, fontWeight: FontWeight.bold),
),
const SizedBox(height: 15),
const IconTheme(
data: IconThemeData(
color: Colors.blue, // থিমের কালার নীল
size: 40, // থিমের সাইজ ৪০
opacity: 0.2, // থিমের অপাসিটি বা ঝাপসা ভাব (২০%)
),
child: Icon(Icons.home), // এই আইকনটি উপরের থিমটি পাবে
),
const Text("Icon 3: Home Icon with 0.2 Opacity", style: TextStyle(color: Colors.grey)),
],
),
),
),
);
}
}
Comments
Post a Comment