forked from eatvio/eatvio_app
merge upstream
This commit is contained in:
@@ -1058,10 +1058,9 @@ class _ChatHeaderVideoCallButton extends StatelessWidget {
|
|||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
final theme = Theme.of(context);
|
|
||||||
final tooltipMessage = S.maybeOf(context)?.video_call;
|
final tooltipMessage = S.maybeOf(context)?.video_call;
|
||||||
final button = Material(
|
final button = Material(
|
||||||
color: theme.colorScheme.onPrimary,
|
color: appTheme.blueA400,
|
||||||
borderRadius: BorderRadius.circular(20),
|
borderRadius: BorderRadius.circular(20),
|
||||||
elevation: 0,
|
elevation: 0,
|
||||||
child: InkWell(
|
child: InkWell(
|
||||||
@@ -1072,8 +1071,8 @@ class _ChatHeaderVideoCallButton extends StatelessWidget {
|
|||||||
height: 40,
|
height: 40,
|
||||||
child: Center(
|
child: Center(
|
||||||
child: Icon(
|
child: Icon(
|
||||||
Icons.videocam_rounded,
|
Icons.call_rounded,
|
||||||
color: appTheme.blueA400,
|
color: appTheme.whiteA700,
|
||||||
size: 18,
|
size: 18,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|||||||
@@ -247,12 +247,16 @@ void main() {
|
|||||||
expect(find.byType(ChatScreen), findsOneWidget);
|
expect(find.byType(ChatScreen), findsOneWidget);
|
||||||
expect(find.byType(RefreshIndicator), findsOneWidget);
|
expect(find.byType(RefreshIndicator), findsOneWidget);
|
||||||
expect(find.text('User Two'), findsOneWidget);
|
expect(find.text('User Two'), findsOneWidget);
|
||||||
|
|
||||||
|
// Кнопка звонка скрыта, когда план не выбран (chosenPlan == null).
|
||||||
|
expect(find.byIcon(Icons.call_rounded), findsNothing);
|
||||||
|
expect(find.byIcon(Icons.videocam_rounded), findsNothing);
|
||||||
expect(find.text('hello'), findsOneWidget);
|
expect(find.text('hello'), findsOneWidget);
|
||||||
expect(find.text('hi'), findsOneWidget);
|
expect(find.text('hi'), findsOneWidget);
|
||||||
expect(find.text('sending...'), findsOneWidget);
|
expect(find.text('sending...'), findsOneWidget);
|
||||||
expect(find.text('tap to retry'), findsOneWidget);
|
expect(find.text('tap to retry'), findsOneWidget);
|
||||||
expect(find.text('file.pdf'), findsOneWidget);
|
expect(find.text('file.pdf'), findsOneWidget);
|
||||||
expect(find.byIcon(Icons.videocam_rounded), findsNothing);
|
expect(find.byIcon(Icons.call_rounded), findsNothing);
|
||||||
VisibilityDetectorController.instance.notifyNow();
|
VisibilityDetectorController.instance.notifyNow();
|
||||||
await tester.pump();
|
await tester.pump();
|
||||||
});
|
});
|
||||||
@@ -351,7 +355,18 @@ void main() {
|
|||||||
messages: [incomingCallMessage()],
|
messages: [incomingCallMessage()],
|
||||||
);
|
);
|
||||||
|
|
||||||
expect(find.byIcon(Icons.videocam_rounded), findsOneWidget);
|
// Белый значок звонка на синем фоне (см. PR 1137).
|
||||||
|
final callIconFinder = find.byIcon(Icons.call_rounded);
|
||||||
|
expect(callIconFinder, findsOneWidget);
|
||||||
|
final callIcon = tester.widget<Icon>(callIconFinder);
|
||||||
|
expect(callIcon.color, appTheme.whiteA700);
|
||||||
|
final buttonMaterial = tester.widget<Material>(
|
||||||
|
find
|
||||||
|
.ancestor(of: callIconFinder, matching: find.byType(Material))
|
||||||
|
.first,
|
||||||
|
);
|
||||||
|
expect(buttonMaterial.color, appTheme.blueA400);
|
||||||
|
expect(find.byIcon(Icons.videocam_rounded), findsNothing);
|
||||||
expect(find.byType(VideoCallChatMessageWidget), findsOneWidget);
|
expect(find.byType(VideoCallChatMessageWidget), findsOneWidget);
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -364,7 +379,7 @@ void main() {
|
|||||||
messages: [incomingCallMessage()],
|
messages: [incomingCallMessage()],
|
||||||
);
|
);
|
||||||
|
|
||||||
expect(find.byIcon(Icons.videocam_rounded), findsNothing);
|
expect(find.byIcon(Icons.call_rounded), findsNothing);
|
||||||
expect(find.byType(VideoCallChatMessageWidget), findsNothing);
|
expect(find.byType(VideoCallChatMessageWidget), findsNothing);
|
||||||
expect(find.text('Видеозвонок'), findsOneWidget);
|
expect(find.text('Видеозвонок'), findsOneWidget);
|
||||||
});
|
});
|
||||||
@@ -377,7 +392,7 @@ void main() {
|
|||||||
plan: chosenPlan(ChosenPlanStateEnum.stateCanceledByTheInitiator),
|
plan: chosenPlan(ChosenPlanStateEnum.stateCanceledByTheInitiator),
|
||||||
);
|
);
|
||||||
|
|
||||||
expect(find.byIcon(Icons.videocam_rounded), findsNothing);
|
expect(find.byIcon(Icons.call_rounded), findsNothing);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user