Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Attempt to improve the custom build ui
- Loading branch information
Showing
5 changed files
with
133 additions
and
63 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
import 'package:flutter/material.dart'; | ||
import 'package:shiori/domain/enums/enums.dart'; | ||
import 'package:shiori/generated/l10n.dart'; | ||
import 'package:shiori/presentation/shared/extensions/i18n_extensions.dart'; | ||
import 'package:shiori/presentation/shared/styles.dart'; | ||
|
||
class SubStatToFocus extends StatelessWidget { | ||
final List<StatType> subStatsToFocus; | ||
final Color color; | ||
|
||
const SubStatToFocus({ | ||
Key? key, | ||
required this.subStatsToFocus, | ||
required this.color, | ||
}) : super(key: key); | ||
|
||
@override | ||
Widget build(BuildContext context) { | ||
final s = S.of(context); | ||
final theme = Theme.of(context); | ||
final text = subStatsToFocus.map((e) => s.translateStatTypeWithoutValue(e)).join(' > '); | ||
return Container( | ||
margin: Styles.edgeInsetHorizontal5, | ||
child: Text( | ||
'${s.subStats}: $text', | ||
style: theme.textTheme.subtitle2!.copyWith( | ||
fontWeight: FontWeight.bold, | ||
color: color, | ||
fontSize: 12, | ||
), | ||
), | ||
); | ||
} | ||
} |