Sunday, December 10, 2023

Text (State less Widget)

 IMAGE


COAD



import 'package:flutter/material.dart';

class Textless extends StatelessWidget {
// initilize Variable
final String text;
final double size;

// if color is not given then showing null color
final Color? color;
final FontWeight fontWeight;

// if textAlign is true then TextAlign.start & false then TextAlign.center
bool isAlignStart;

// Constructor
Textless({
    super.key,
    required this.text,
    required this.size,
    this.color,
    required this.fontWeight,
    required this.isAlignStart
    });


@override
Widget build(BuildContext context) {
return Text(
text,
style: TextStyle(
fontSize: size,
fontWeight: fontWeight,
color: color ?? Colors.white,
),
textAlign: isAlignStart == true ? TextAlign.start : TextAlign.center,
);
}
}

No comments:

Post a Comment

Featured post

Compress Image With Show File Size & Resolution in Flutter

 Compress Image With Show File Size & Resolution  1.Multiple File Image Compress with file Size import 'dart:io' ; import 'p...

LightBlog