stylizable item title component

This commit is contained in:
MohammadTaha Basiri 2022-01-05 18:15:00 +03:30
parent f906c1cfa2
commit 0acafc58ab
1 changed files with 3 additions and 1 deletions

View File

@ -4,6 +4,7 @@ import 'package:flutter/material.dart';
class ItemTitle extends StatelessWidget { class ItemTitle extends StatelessWidget {
final String title; final String title;
final TextStyle? style;
final IconData? icon; final IconData? icon;
final Color? color; final Color? color;
@ -12,6 +13,7 @@ class ItemTitle extends StatelessWidget {
required this.title, required this.title,
this.icon, this.icon,
this.color, this.color,
this.style,
}) : super(key: key); }) : super(key: key);
@override @override
@ -26,7 +28,7 @@ class ItemTitle extends StatelessWidget {
if (icon != null) const SizedBox(width: 4), if (icon != null) const SizedBox(width: 4),
DidvanText( DidvanText(
title, title,
style: Theme.of(context).textTheme.subtitle1, style: style ?? Theme.of(context).textTheme.subtitle1,
color: color ?? Theme.of(context).colorScheme.title, color: color ?? Theme.of(context).colorScheme.title,
) )
], ],