2019-12-20 15:41:38 +01:00
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
import 'package:git_touch/utils/utils.dart';
|
|
|
|
|
|
|
|
enum IssueIconState {
|
|
|
|
open,
|
|
|
|
closed,
|
|
|
|
prOpen,
|
|
|
|
prClosed,
|
|
|
|
prMerged,
|
|
|
|
}
|
|
|
|
|
|
|
|
class IssueIcon extends StatelessWidget {
|
|
|
|
final IssueIconState state;
|
2021-05-16 09:16:35 +02:00
|
|
|
final double? size;
|
2019-12-20 15:41:38 +01:00
|
|
|
|
2022-09-06 18:28:12 +02:00
|
|
|
const IssueIcon(this.state, {this.size});
|
2019-12-20 15:41:38 +01:00
|
|
|
|
|
|
|
@override
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
switch (state) {
|
|
|
|
case IssueIconState.open:
|
|
|
|
return Icon(Octicons.issue_opened,
|
|
|
|
color: GithubPalette.open, size: size);
|
|
|
|
case IssueIconState.closed:
|
|
|
|
return Icon(Octicons.issue_closed,
|
|
|
|
color: GithubPalette.closed, size: size);
|
|
|
|
case IssueIconState.prOpen:
|
|
|
|
return Icon(Octicons.git_pull_request,
|
|
|
|
color: GithubPalette.open, size: size);
|
|
|
|
case IssueIconState.prClosed:
|
|
|
|
return Icon(Octicons.git_pull_request,
|
|
|
|
color: GithubPalette.closed, size: size);
|
|
|
|
case IssueIconState.prMerged:
|
|
|
|
return Icon(Octicons.git_merge,
|
|
|
|
color: GithubPalette.merged, size: size);
|
|
|
|
default:
|
2021-05-16 09:16:35 +02:00
|
|
|
return Container();
|
2019-12-20 15:41:38 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|