content localized on locale change
This commit is contained in:
@@ -3,32 +3,29 @@ import 'package:resume/widgets/content_list_tile.dart';
|
||||
import 'package:resume/widgets/language_widget.dart';
|
||||
import 'package:resume/constants.dart' show ContentType;
|
||||
|
||||
import '../services/content_provider.dart';
|
||||
|
||||
class ContentBlock extends StatelessWidget {
|
||||
const ContentBlock({
|
||||
super.key,
|
||||
required this.blockTitle,
|
||||
required this.contentType,
|
||||
required this.content,
|
||||
});
|
||||
|
||||
final String blockTitle;
|
||||
final ContentType contentType;
|
||||
final dynamic content;
|
||||
|
||||
Widget get _getContentWidget {
|
||||
if (contentType == ContentType.language) {
|
||||
return const LanguageWidget();
|
||||
} else if (contentType == ContentType.text ||
|
||||
contentType == ContentType.generalSkills) {
|
||||
final content = ContentProvider.getContent<String>(contentType);
|
||||
return SizedBox(
|
||||
width: double.infinity,
|
||||
child: Text(content),
|
||||
);
|
||||
}
|
||||
// List-based content-blocks
|
||||
List<dynamic> content =
|
||||
ContentProvider.getContent<List<dynamic>>(contentType);
|
||||
List<Widget> widgets = [];
|
||||
for (var item in content) {
|
||||
widgets.add(_buildListTile(item));
|
||||
|
||||
Reference in New Issue
Block a user