You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
33 lines
782 B
33 lines
782 B
// SPDX-FileCopyrightText: Copyright 2023 Open Mobile Platform LLC <community@omp.ru> |
|
// SPDX-License-Identifier: BSD-3-Clause |
|
import 'package:flutter/material.dart'; |
|
|
|
class TextBase extends StatelessWidget { |
|
const TextBase( |
|
this.data, { |
|
super.key, |
|
this.color, |
|
this.textAlign, |
|
this.fontWeight, |
|
}); |
|
|
|
final String data; |
|
final Color? color; |
|
final TextAlign? textAlign; |
|
final FontWeight? fontWeight; |
|
|
|
TextStyle? getStyle(BuildContext context) { |
|
return Theme.of(context).textTheme.bodyMedium; |
|
} |
|
|
|
@override |
|
Widget build(BuildContext context) { |
|
return Text( |
|
data, |
|
style: getStyle(context)?.copyWith(color: color ?? Colors.black).copyWith( |
|
fontWeight: fontWeight, |
|
), |
|
textAlign: textAlign, |
|
); |
|
} |
|
}
|
|
|