Skip to content

Commit

Permalink
improve stream popup
Browse files Browse the repository at this point in the history
Signed-off-by: phuoc <[email protected]>
  • Loading branch information
phuocbitmark committed Jun 19, 2024
1 parent 7c6a0c6 commit 2b122a8
Show file tree
Hide file tree
Showing 4 changed files with 41 additions and 15 deletions.
2 changes: 1 addition & 1 deletion assets
2 changes: 2 additions & 0 deletions lib/service/deeplink_service.dart
Original file line number Diff line number Diff line change
Expand Up @@ -431,13 +431,15 @@ class DeeplinkServiceImpl extends DeeplinkService {
/// scan with navigation home page does not go to this flow
_navigationService.goBack(result: device);
} else {
print('-------------');
await UIHelper.showFlexibleDialog(
_navigationService.context,
BlocProvider.value(
value: injector<CanvasDeviceBloc>(),
child: const StreamDeviceView(),
),
isDismissible: true,
autoDismissAfter: 3
);
}
}
Expand Down
8 changes: 6 additions & 2 deletions lib/util/ui_helper.dart
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ Future askForNotification() async {
class UIHelper {
static String currentDialogTitle = '';
static final metricClient = injector.get<MetricClientService>();
static const String ignoreBackLayerPopUpRouteName = 'ignoreBackLayerPopUp';
static const String ignoreBackLayerPopUpRouteName = 'popUp.ignoreBackLayer';

static Future<dynamic> showDialog(
BuildContext context,
Expand Down Expand Up @@ -817,7 +817,11 @@ class UIHelper {
static void hideInfoDialog(BuildContext context) {
currentDialogTitle = '';
try {
Navigator.popUntil(context, (route) => route.settings.name != null);
Navigator.popUntil(
context,
(route) =>
route.settings.name != null &&
!route.settings.name!.contains('popUp'));
} catch (_) {}
}

Expand Down
44 changes: 32 additions & 12 deletions lib/view/stream_device_view.dart
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import 'package:feralfile_app_tv_proto/models/canvas_device.dart';
import 'package:flutter/gestures.dart';
import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:flutter_svg/flutter_svg.dart';

class StreamDeviceView extends StatefulWidget {
final Function(CanvasDevice device)? onDeviceSelected;
Expand Down Expand Up @@ -59,20 +60,39 @@ class _StreamDeviceViewState extends State<StreamDeviceView> {
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
RichText(
text: TextSpan(
children: <TextSpan>[
TextSpan(
text: 'display'.tr(),
style: theme.textTheme.ppMori700White24,
Row(
children: [
Expanded(
child: RichText(
text: TextSpan(
children: <TextSpan>[
TextSpan(
text: 'display'.tr(),
style: theme.textTheme.ppMori700White24,
),
if (connectedDevice != null)
TextSpan(
text: ' ${connectedDevice.name}',
style: theme.textTheme.ppMori400White24,
),
],
),
),
if (connectedDevice != null)
TextSpan(
text: ' ${connectedDevice.name}',
style: theme.textTheme.ppMori400White24,
),
if (connectedDevice != null)
Padding(
padding: const EdgeInsets.only(left: 10),
child: GestureDetector(
child: SvgPicture.asset('assets/images/closeCycle.svg',
height: 24,
colorFilter: const ColorFilter.mode(
AppColor.white,
BlendMode.srcIn,
)),
onTap: () => Navigator.of(context).pop(),
),
],
),
)
],
),
const SizedBox(height: 40),
ListView.builder(
Expand Down

0 comments on commit 2b122a8

Please sign in to comment.