|
|
|
@ -33,7 +33,7 @@ class StartIGCButtonState extends State<StartIGCButton>
|
|
|
|
void initState() {
|
|
|
|
void initState() {
|
|
|
|
_controller = AnimationController(
|
|
|
|
_controller = AnimationController(
|
|
|
|
vsync: this,
|
|
|
|
vsync: this,
|
|
|
|
duration: const Duration(seconds: 1),
|
|
|
|
duration: const Duration(seconds: 2),
|
|
|
|
);
|
|
|
|
);
|
|
|
|
choreoListener = widget.controller.choreographer.stateListener.stream
|
|
|
|
choreoListener = widget.controller.choreographer.stateListener.stream
|
|
|
|
.listen(updateSpinnerState);
|
|
|
|
.listen(updateSpinnerState);
|
|
|
|
@ -54,14 +54,15 @@ class StartIGCButtonState extends State<StartIGCButton>
|
|
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
@override
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
if (widget.controller.choreographer.isAutoIGCEnabled) {
|
|
|
|
if (widget.controller.choreographer.isAutoIGCEnabled ||
|
|
|
|
|
|
|
|
widget.controller.choreographer.choreoMode == ChoreoMode.it) {
|
|
|
|
return const SizedBox.shrink();
|
|
|
|
return const SizedBox.shrink();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
final Widget icon = Icon(
|
|
|
|
final Widget icon = Icon(
|
|
|
|
Icons.autorenew_rounded,
|
|
|
|
Icons.autorenew_rounded,
|
|
|
|
size: 46,
|
|
|
|
size: 46,
|
|
|
|
color: assistanceState.stateColor,
|
|
|
|
color: assistanceState.stateColor(context),
|
|
|
|
);
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
|
|
return SizedBox(
|
|
|
|
return SizedBox(
|
|
|
|
@ -71,15 +72,23 @@ class StartIGCButtonState extends State<StartIGCButton>
|
|
|
|
tooltip: assistanceState.tooltip(
|
|
|
|
tooltip: assistanceState.tooltip(
|
|
|
|
L10n.of(context)!,
|
|
|
|
L10n.of(context)!,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
backgroundColor: Colors.white,
|
|
|
|
backgroundColor: Theme.of(context).scaffoldBackgroundColor,
|
|
|
|
disabledElevation: 0,
|
|
|
|
disabledElevation: 0,
|
|
|
|
shape: const CircleBorder(),
|
|
|
|
shape: const CircleBorder(),
|
|
|
|
onPressed: () {
|
|
|
|
onPressed: () {
|
|
|
|
if (assistanceState != AssistanceState.complete) {
|
|
|
|
if (assistanceState != AssistanceState.complete) {
|
|
|
|
widget.controller.choreographer.getLanguageHelp(
|
|
|
|
widget.controller.choreographer
|
|
|
|
|
|
|
|
.getLanguageHelp(
|
|
|
|
false,
|
|
|
|
false,
|
|
|
|
true,
|
|
|
|
true,
|
|
|
|
);
|
|
|
|
)
|
|
|
|
|
|
|
|
.then((_) {
|
|
|
|
|
|
|
|
if (widget.controller.choreographer.igc.igcTextData != null &&
|
|
|
|
|
|
|
|
widget.controller.choreographer.igc.igcTextData!.matches
|
|
|
|
|
|
|
|
.isNotEmpty) {
|
|
|
|
|
|
|
|
widget.controller.choreographer.igc.showFirstMatch(context);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
},
|
|
|
|
child: Stack(
|
|
|
|
child: Stack(
|
|
|
|
@ -95,9 +104,9 @@ class StartIGCButtonState extends State<StartIGCButton>
|
|
|
|
Container(
|
|
|
|
Container(
|
|
|
|
width: 26,
|
|
|
|
width: 26,
|
|
|
|
height: 26,
|
|
|
|
height: 26,
|
|
|
|
decoration: const BoxDecoration(
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
shape: BoxShape.circle,
|
|
|
|
shape: BoxShape.circle,
|
|
|
|
color: Colors.white,
|
|
|
|
color: Theme.of(context).scaffoldBackgroundColor,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
Container(
|
|
|
|
Container(
|
|
|
|
@ -105,13 +114,13 @@ class StartIGCButtonState extends State<StartIGCButton>
|
|
|
|
height: 20,
|
|
|
|
height: 20,
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
shape: BoxShape.circle,
|
|
|
|
shape: BoxShape.circle,
|
|
|
|
color: assistanceState.stateColor,
|
|
|
|
color: assistanceState.stateColor(context),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
const Icon(
|
|
|
|
Icon(
|
|
|
|
size: 16,
|
|
|
|
size: 16,
|
|
|
|
Icons.check,
|
|
|
|
Icons.check,
|
|
|
|
color: Colors.white,
|
|
|
|
color: Theme.of(context).scaffoldBackgroundColor,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
],
|
|
|
|
],
|
|
|
|
),
|
|
|
|
),
|
|
|
|
@ -121,12 +130,12 @@ class StartIGCButtonState extends State<StartIGCButton>
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
extension AssistanceStateExtension on AssistanceState {
|
|
|
|
extension AssistanceStateExtension on AssistanceState {
|
|
|
|
Color get stateColor {
|
|
|
|
Color stateColor(context) {
|
|
|
|
switch (this) {
|
|
|
|
switch (this) {
|
|
|
|
case AssistanceState.noMessage:
|
|
|
|
case AssistanceState.noMessage:
|
|
|
|
case AssistanceState.notFetched:
|
|
|
|
case AssistanceState.notFetched:
|
|
|
|
case AssistanceState.fetching:
|
|
|
|
case AssistanceState.fetching:
|
|
|
|
return AppConfig.primaryColor;
|
|
|
|
return Theme.of(context).colorScheme.primary;
|
|
|
|
case AssistanceState.fetched:
|
|
|
|
case AssistanceState.fetched:
|
|
|
|
return PangeaColors.igcError;
|
|
|
|
return PangeaColors.igcError;
|
|
|
|
case AssistanceState.complete:
|
|
|
|
case AssistanceState.complete:
|
|
|
|
|