on igc button long press, show user language dialog

pull/1384/head
ggurdin 1 year ago
parent 817f45709f
commit f6572d3127

@ -5,6 +5,7 @@ import 'package:fluffychat/config/app_config.dart';
import 'package:fluffychat/pangea/choreographer/controllers/choreographer.dart';
import 'package:fluffychat/pangea/constants/colors.dart';
import 'package:fluffychat/pangea/controllers/subscription_controller.dart';
import 'package:fluffychat/pangea/widgets/user_settings/p_language_dialog.dart';
import 'package:flutter/material.dart';
import 'package:flutter_gen/gen_l10n/l10n.dart';
@ -77,61 +78,65 @@ class StartIGCButtonState extends State<StartIGCButton>
return SizedBox(
height: 50,
width: 50,
child: FloatingActionButton(
tooltip: assistanceState.tooltip(
L10n.of(context)!,
),
backgroundColor: Theme.of(context).scaffoldBackgroundColor,
disabledElevation: 0,
shape: const CircleBorder(),
onPressed: () {
if (assistanceState != AssistanceState.complete) {
widget.controller.choreographer
.getLanguageHelp(
false,
true,
)
.then((_) {
if (widget.controller.choreographer.igc.igcTextData != null &&
widget.controller.choreographer.igc.igcTextData!.matches
.isNotEmpty) {
widget.controller.choreographer.igc.showFirstMatch(context);
}
});
}
},
child: Stack(
alignment: Alignment.center,
children: [
_controller != null
? RotationTransition(
turns: Tween(begin: 0.0, end: math.pi * 2)
.animate(_controller!),
child: icon,
)
: icon,
Container(
width: 26,
height: 26,
decoration: BoxDecoration(
shape: BoxShape.circle,
color: Theme.of(context).scaffoldBackgroundColor,
child: InkWell(
customBorder: const CircleBorder(),
onLongPress: () => pLanguageDialog(context, () {}),
child: FloatingActionButton(
tooltip: assistanceState.tooltip(
L10n.of(context)!,
),
backgroundColor: Theme.of(context).scaffoldBackgroundColor,
disabledElevation: 0,
shape: const CircleBorder(),
onPressed: () {
if (assistanceState != AssistanceState.complete) {
widget.controller.choreographer
.getLanguageHelp(
false,
true,
)
.then((_) {
if (widget.controller.choreographer.igc.igcTextData != null &&
widget.controller.choreographer.igc.igcTextData!.matches
.isNotEmpty) {
widget.controller.choreographer.igc.showFirstMatch(context);
}
});
}
},
child: Stack(
alignment: Alignment.center,
children: [
_controller != null
? RotationTransition(
turns: Tween(begin: 0.0, end: math.pi * 2)
.animate(_controller!),
child: icon,
)
: icon,
Container(
width: 26,
height: 26,
decoration: BoxDecoration(
shape: BoxShape.circle,
color: Theme.of(context).scaffoldBackgroundColor,
),
),
),
Container(
width: 20,
height: 20,
decoration: BoxDecoration(
shape: BoxShape.circle,
color: assistanceState.stateColor(context),
Container(
width: 20,
height: 20,
decoration: BoxDecoration(
shape: BoxShape.circle,
color: assistanceState.stateColor(context),
),
),
Icon(
size: 16,
Icons.check,
color: Theme.of(context).scaffoldBackgroundColor,
),
),
Icon(
size: 16,
Icons.check,
color: Theme.of(context).scaffoldBackgroundColor,
),
],
],
),
),
),
);

Loading…
Cancel
Save