-
-
Notifications
You must be signed in to change notification settings - Fork 203
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
e00ba00
commit 32c6c38
Showing
11 changed files
with
428 additions
and
140 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
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,63 @@ | ||
import 'package:flutter/material.dart'; | ||
import 'package:flutter_riverpod/flutter_riverpod.dart'; | ||
import 'package:flutter_svg/svg.dart'; | ||
import 'package:lichess_mobile/src/network/http.dart'; | ||
import 'package:lichess_mobile/src/styles/styles.dart'; | ||
import 'package:lichess_mobile/src/utils/lichess_assets.dart'; | ||
|
||
class BroadcastPlayerWidget extends ConsumerWidget { | ||
const BroadcastPlayerWidget({ | ||
required this.federation, | ||
required this.title, | ||
required this.name, | ||
this.rating, | ||
this.textStyle, | ||
}); | ||
|
||
final String? federation; | ||
final String? title; | ||
final int? rating; | ||
final String name; | ||
final TextStyle? textStyle; | ||
|
||
@override | ||
Widget build(BuildContext context, WidgetRef ref) { | ||
return Row( | ||
children: [ | ||
if (federation != null) ...[ | ||
SvgPicture.network( | ||
lichessFideFedSrc(federation!), | ||
height: 12, | ||
httpClient: ref.read(defaultClientProvider), | ||
), | ||
const SizedBox(width: 5), | ||
], | ||
if (title != null) ...[ | ||
Text( | ||
title!, | ||
style: const TextStyle().copyWith( | ||
color: context.lichessColors.brag, | ||
fontWeight: FontWeight.bold, | ||
), | ||
), | ||
const SizedBox(width: 5), | ||
], | ||
Flexible( | ||
child: Text( | ||
name, | ||
style: textStyle, | ||
overflow: TextOverflow.ellipsis, | ||
), | ||
), | ||
if (rating != null) ...[ | ||
const SizedBox(width: 5), | ||
Text( | ||
rating.toString(), | ||
style: const TextStyle(), | ||
overflow: TextOverflow.ellipsis, | ||
), | ||
], | ||
], | ||
); | ||
} | ||
} |
Oops, something went wrong.