2022-08-11 12:28:06 +00:00
|
|
|
import 'package:flutter/material.dart';
|
2022-10-19 14:24:20 +00:00
|
|
|
import 'package:photos/theme/ente_theme.dart';
|
2022-10-19 15:27:40 +00:00
|
|
|
import 'package:photos/theme/text_style.dart';
|
2022-08-11 12:28:06 +00:00
|
|
|
|
|
|
|
class SectionTitle extends StatelessWidget {
|
2022-10-19 15:27:40 +00:00
|
|
|
final String? title;
|
|
|
|
final RichText? titleWithBrand;
|
2022-08-11 12:28:06 +00:00
|
|
|
|
2022-10-19 15:27:40 +00:00
|
|
|
const SectionTitle({
|
|
|
|
this.title,
|
|
|
|
this.titleWithBrand,
|
|
|
|
Key? key,
|
2022-08-11 12:28:06 +00:00
|
|
|
}) : super(key: key);
|
|
|
|
|
|
|
|
@override
|
|
|
|
Widget build(BuildContext context) {
|
2022-10-19 14:24:20 +00:00
|
|
|
final enteTextTheme = getEnteTextTheme(context);
|
2022-10-19 15:27:40 +00:00
|
|
|
Widget child;
|
|
|
|
if (titleWithBrand != null) {
|
|
|
|
child = titleWithBrand!;
|
|
|
|
} else if (title != null) {
|
|
|
|
child = Text(
|
|
|
|
title!,
|
|
|
|
style: enteTextTheme.largeBold,
|
|
|
|
);
|
|
|
|
} else {
|
|
|
|
child = const SizedBox.shrink();
|
|
|
|
}
|
2022-08-11 12:28:06 +00:00
|
|
|
return Container(
|
|
|
|
margin: const EdgeInsets.fromLTRB(16, 12, 0, 0),
|
|
|
|
child: Column(
|
|
|
|
children: [
|
|
|
|
Align(
|
2022-10-19 15:27:40 +00:00
|
|
|
alignment: Alignment.centerLeft,
|
|
|
|
child: child,
|
2022-08-11 12:28:06 +00:00
|
|
|
),
|
|
|
|
],
|
|
|
|
),
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
2022-10-19 15:27:40 +00:00
|
|
|
|
|
|
|
RichText onEnteSection = RichText(
|
|
|
|
text: const TextSpan(
|
|
|
|
children: [
|
|
|
|
TextSpan(
|
|
|
|
text: "On ",
|
|
|
|
style: TextStyle(
|
|
|
|
fontWeight: FontWeight.w600,
|
|
|
|
fontFamily: 'Inter',
|
|
|
|
fontSize: 21,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
TextSpan(text: "ente", style: brandStyleSmall),
|
|
|
|
],
|
|
|
|
),
|
|
|
|
);
|