resolve melos analyze warnings
This commit is contained in:
@@ -14,7 +14,11 @@ import 'web_socket_channel_stub.dart'
|
|||||||
if (dart.library.html) 'web_socket_channel_html.dart'
|
if (dart.library.html) 'web_socket_channel_html.dart'
|
||||||
if (dart.library.io) 'web_socket_channel_io.dart';
|
if (dart.library.io) 'web_socket_channel_io.dart';
|
||||||
|
|
||||||
|
/// Typedef which exposes an [Event] as the only parameter.
|
||||||
typedef EventHandler = void Function(Event);
|
typedef EventHandler = void Function(Event);
|
||||||
|
|
||||||
|
/// Typedef used for connecting to a websocket. Method returns a [WebSocketChannel]
|
||||||
|
/// and accepts a connection [url] and an optional [Iterable] of `protocols`.
|
||||||
typedef ConnectWebSocket = WebSocketChannel Function(String url,
|
typedef ConnectWebSocket = WebSocketChannel Function(String url,
|
||||||
{Iterable<String> protocols});
|
{Iterable<String> protocols});
|
||||||
|
|
||||||
@@ -236,7 +240,9 @@ class WebSocket {
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
await connect();
|
await connect();
|
||||||
} catch (e) {}
|
} catch (e) {
|
||||||
|
logger.log(Level.SEVERE, e.toString());
|
||||||
|
}
|
||||||
await Future.delayed(
|
await Future.delayed(
|
||||||
Duration(seconds: min(_retryAttempt * 5, 25)),
|
Duration(seconds: min(_retryAttempt * 5, 25)),
|
||||||
() {
|
() {
|
||||||
|
|||||||
@@ -13,6 +13,7 @@ import 'package:stream_chat/src/models/channel_model.dart';
|
|||||||
import 'package:stream_chat/src/models/own_user.dart';
|
import 'package:stream_chat/src/models/own_user.dart';
|
||||||
import 'package:stream_chat/version.dart';
|
import 'package:stream_chat/version.dart';
|
||||||
import 'package:uuid/uuid.dart';
|
import 'package:uuid/uuid.dart';
|
||||||
|
import 'package:pedantic/pedantic.dart' show unawaited;
|
||||||
|
|
||||||
import 'api/channel.dart';
|
import 'api/channel.dart';
|
||||||
import 'api/connection_status.dart';
|
import 'api/connection_status.dart';
|
||||||
@@ -25,8 +26,15 @@ import 'models/event.dart';
|
|||||||
import 'models/message.dart';
|
import 'models/message.dart';
|
||||||
import 'models/user.dart';
|
import 'models/user.dart';
|
||||||
|
|
||||||
|
/// Handler function used for logging records. Function requires a single [LogRecord]
|
||||||
|
/// as the only parameter.
|
||||||
typedef LogHandlerFunction = void Function(LogRecord record);
|
typedef LogHandlerFunction = void Function(LogRecord record);
|
||||||
|
|
||||||
|
/// Used for decoding [Map] data to a generic type `T`.
|
||||||
typedef DecoderFunction<T> = T Function(Map<String, dynamic>);
|
typedef DecoderFunction<T> = T Function(Map<String, dynamic>);
|
||||||
|
|
||||||
|
/// A function which can be used to request a Stream Chat API token from your
|
||||||
|
/// own backend server. Function requires a single [userId].
|
||||||
typedef TokenProvider = Future<String> Function(String userId);
|
typedef TokenProvider = Future<String> Function(String userId);
|
||||||
|
|
||||||
/// The key used to save the userId to sharedPreferences
|
/// The key used to save the userId to sharedPreferences
|
||||||
@@ -462,7 +470,7 @@ class Client {
|
|||||||
|
|
||||||
if (value == ConnectionStatus.connected &&
|
if (value == ConnectionStatus.connected &&
|
||||||
state.channels?.isNotEmpty == true) {
|
state.channels?.isNotEmpty == true) {
|
||||||
queryChannels(filter: {
|
unawaited (queryChannels(filter: {
|
||||||
'cid': {
|
'cid': {
|
||||||
'\$in': state.channels.keys.toList(),
|
'\$in': state.channels.keys.toList(),
|
||||||
},
|
},
|
||||||
@@ -474,7 +482,7 @@ class Client {
|
|||||||
online: true,
|
online: true,
|
||||||
));
|
));
|
||||||
},
|
},
|
||||||
);
|
));
|
||||||
} else {
|
} else {
|
||||||
_synced = false;
|
_synced = false;
|
||||||
}
|
}
|
||||||
@@ -712,7 +720,7 @@ class Client {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
_parseError(DioError error) {
|
dynamic _parseError(DioError error) {
|
||||||
if (error.type == DioErrorType.RESPONSE) {
|
if (error.type == DioErrorType.RESPONSE) {
|
||||||
final apiError =
|
final apiError =
|
||||||
ApiError(error.response?.data, error.response?.statusCode);
|
ApiError(error.response?.data, error.response?.statusCode);
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
//ignore_for_file: public_member_api_docs
|
||||||
import 'dart:io';
|
import 'dart:io';
|
||||||
import 'dart:isolate';
|
import 'dart:isolate';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
@@ -9,7 +10,7 @@ import 'package:path_provider/path_provider.dart';
|
|||||||
import 'package:stream_chat/src/db/offline_storage.dart';
|
import 'package:stream_chat/src/db/offline_storage.dart';
|
||||||
|
|
||||||
class SharedDB {
|
class SharedDB {
|
||||||
static constructDatabase(dbName) async {
|
static Future<VmDatabase> constructDatabase(dbName) async {
|
||||||
final dir = await getApplicationDocumentsDirectory();
|
final dir = await getApplicationDocumentsDirectory();
|
||||||
final path = join(dir.path, dbName);
|
final path = join(dir.path, dbName);
|
||||||
final file = File(path);
|
final file = File(path);
|
||||||
|
|||||||
@@ -1,3 +1,5 @@
|
|||||||
|
//ignore_for_file: public_member_api_docs
|
||||||
|
//ignore_for_file: always_declare_return_types
|
||||||
class SharedDB {
|
class SharedDB {
|
||||||
static constructDatabase(dbName) async {
|
static constructDatabase(dbName) async {
|
||||||
print('Unsupported Platform');
|
print('Unsupported Platform');
|
||||||
|
|||||||
@@ -1,3 +1,5 @@
|
|||||||
|
//ignore_for_file: public_member_api_docs
|
||||||
|
//ignore_for_file: always_declare_return_types
|
||||||
import 'package:moor/moor_web.dart';
|
import 'package:moor/moor_web.dart';
|
||||||
import 'package:stream_chat/src/db/offline_storage.dart';
|
import 'package:stream_chat/src/db/offline_storage.dart';
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
import 'package:emojis/emojis.dart';
|
|
||||||
import 'package:flutter/cupertino.dart';
|
import 'package:flutter/cupertino.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:jiffy/jiffy.dart';
|
import 'package:jiffy/jiffy.dart';
|
||||||
|
|||||||
@@ -907,8 +907,6 @@ class _GroupInfoScreenState extends State<GroupInfoScreen> {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
void _showRemoveUserModal(User user) {}
|
|
||||||
|
|
||||||
Widget _buildConnectedTitleState(User user) {
|
Widget _buildConnectedTitleState(User user) {
|
||||||
var alternativeWidget;
|
var alternativeWidget;
|
||||||
|
|
||||||
|
|||||||
@@ -115,7 +115,7 @@ class _HomePageState extends State<HomePage> {
|
|||||||
return <BottomNavigationBarItem>[
|
return <BottomNavigationBarItem>[
|
||||||
BottomNavigationBarItem(
|
BottomNavigationBarItem(
|
||||||
icon: Stack(
|
icon: Stack(
|
||||||
overflow: Overflow.visible,
|
clipBehavior: Clip.none,
|
||||||
children: [
|
children: [
|
||||||
StreamSvgIcon.message(
|
StreamSvgIcon.message(
|
||||||
color: _isSelected(0)
|
color: _isSelected(0)
|
||||||
@@ -133,7 +133,7 @@ class _HomePageState extends State<HomePage> {
|
|||||||
),
|
),
|
||||||
BottomNavigationBarItem(
|
BottomNavigationBarItem(
|
||||||
icon: Stack(
|
icon: Stack(
|
||||||
overflow: Overflow.visible,
|
clipBehavior: Clip.none,
|
||||||
children: [
|
children: [
|
||||||
StreamSvgIcon.mentions(
|
StreamSvgIcon.mentions(
|
||||||
color: _isSelected(1)
|
color: _isSelected(1)
|
||||||
|
|||||||
@@ -79,6 +79,9 @@ class AppRoutes {
|
|||||||
builder: (_) {
|
builder: (_) {
|
||||||
return GroupInfoScreen();
|
return GroupInfoScreen();
|
||||||
});
|
});
|
||||||
|
// Default case, should not reach here.
|
||||||
|
default:
|
||||||
|
return null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -8,8 +8,7 @@ environment:
|
|||||||
dependencies:
|
dependencies:
|
||||||
flutter:
|
flutter:
|
||||||
sdk: flutter
|
sdk: flutter
|
||||||
stream_chat_flutter:
|
stream_chat_flutter: 0.2.13+1
|
||||||
path: ../
|
|
||||||
flutter_apns: ^1.4.1
|
flutter_apns: ^1.4.1
|
||||||
flutter_local_notifications: ^2.0.2
|
flutter_local_notifications: ^2.0.2
|
||||||
flutter_svg: ^0.19.1
|
flutter_svg: ^0.19.1
|
||||||
|
|||||||
@@ -160,8 +160,6 @@ class _ChannelFileDisplayScreenState extends State<ChannelFileDisplayScreen> {
|
|||||||
),
|
),
|
||||||
child: ListView.builder(
|
child: ListView.builder(
|
||||||
itemBuilder: (context, position) {
|
itemBuilder: (context, position) {
|
||||||
var channel = StreamChannel.of(context).channel;
|
|
||||||
|
|
||||||
return Padding(
|
return Padding(
|
||||||
padding: const EdgeInsets.all(1.0),
|
padding: const EdgeInsets.all(1.0),
|
||||||
child: Padding(
|
child: Padding(
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
import 'dart:async';
|
import 'dart:async';
|
||||||
import 'dart:convert';
|
import 'dart:convert';
|
||||||
import 'dart:ui' as ui;
|
|
||||||
|
|
||||||
import 'package:flutter/foundation.dart';
|
import 'package:flutter/foundation.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
|||||||
@@ -1,7 +1,5 @@
|
|||||||
import 'dart:async';
|
import 'dart:async';
|
||||||
import 'dart:io';
|
import 'dart:io';
|
||||||
import 'dart:math';
|
|
||||||
import 'dart:typed_data';
|
|
||||||
|
|
||||||
import 'package:cached_network_image/cached_network_image.dart';
|
import 'package:cached_network_image/cached_network_image.dart';
|
||||||
import 'package:chewie/chewie.dart';
|
import 'package:chewie/chewie.dart';
|
||||||
@@ -9,8 +7,6 @@ import 'package:dio/dio.dart';
|
|||||||
import 'package:esys_flutter_share/esys_flutter_share.dart';
|
import 'package:esys_flutter_share/esys_flutter_share.dart';
|
||||||
import 'package:flutter/foundation.dart';
|
import 'package:flutter/foundation.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:image_gallery_saver/image_gallery_saver.dart';
|
|
||||||
import 'package:path_provider/path_provider.dart';
|
|
||||||
import 'package:stream_chat/stream_chat.dart';
|
import 'package:stream_chat/stream_chat.dart';
|
||||||
import 'package:stream_chat_flutter/src/stream_chat_theme.dart';
|
import 'package:stream_chat_flutter/src/stream_chat_theme.dart';
|
||||||
import 'package:stream_chat_flutter/stream_chat_flutter.dart';
|
import 'package:stream_chat_flutter/stream_chat_flutter.dart';
|
||||||
@@ -58,15 +54,16 @@ class ImageFooter extends StatefulWidget implements PreferredSizeWidget {
|
|||||||
}
|
}
|
||||||
|
|
||||||
class _ImageFooterState extends State<ImageFooter> {
|
class _ImageFooterState extends State<ImageFooter> {
|
||||||
|
//ignore:unused_field
|
||||||
bool _userSearchMode = false;
|
bool _userSearchMode = false;
|
||||||
TextEditingController _searchController;
|
TextEditingController _searchController;
|
||||||
final TextEditingController _messageController = TextEditingController();
|
final TextEditingController _messageController = TextEditingController();
|
||||||
final FocusNode _messageFocusNode = FocusNode();
|
final FocusNode _messageFocusNode = FocusNode();
|
||||||
|
|
||||||
|
//ignore:unused_field
|
||||||
String _channelNameQuery;
|
String _channelNameQuery;
|
||||||
|
|
||||||
final List<Channel> _selectedChannels = [];
|
final List<Channel> _selectedChannels = [];
|
||||||
bool _loading = false;
|
|
||||||
|
|
||||||
Timer _debounce;
|
Timer _debounce;
|
||||||
|
|
||||||
@@ -311,95 +308,6 @@ class _ImageFooterState extends State<ImageFooter> {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
Widget _buildShareTextInputSection(modalSetState) {
|
|
||||||
return Align(
|
|
||||||
alignment: Alignment.bottomCenter,
|
|
||||||
child: BottomAppBar(
|
|
||||||
child: Container(
|
|
||||||
height: 40.0,
|
|
||||||
margin: const EdgeInsets.symmetric(
|
|
||||||
vertical: 8,
|
|
||||||
horizontal: 8,
|
|
||||||
),
|
|
||||||
child: _loading
|
|
||||||
? Center(
|
|
||||||
child: Padding(
|
|
||||||
padding: const EdgeInsets.all(8.0),
|
|
||||||
child: CircularProgressIndicator(),
|
|
||||||
),
|
|
||||||
)
|
|
||||||
: Row(
|
|
||||||
children: [
|
|
||||||
Expanded(
|
|
||||||
child: TextField(
|
|
||||||
controller: _messageController,
|
|
||||||
focusNode: _messageFocusNode,
|
|
||||||
onChanged: (val) {
|
|
||||||
modalSetState(() {});
|
|
||||||
},
|
|
||||||
onTap: () {
|
|
||||||
modalSetState(() {});
|
|
||||||
setState(() {});
|
|
||||||
},
|
|
||||||
decoration: InputDecoration(
|
|
||||||
prefixText: ' ',
|
|
||||||
hintText: 'Add a comment',
|
|
||||||
enabledBorder: OutlineInputBorder(
|
|
||||||
borderRadius: BorderRadius.circular(24.0),
|
|
||||||
borderSide: BorderSide(
|
|
||||||
color: StreamChatTheme.of(context)
|
|
||||||
.colorTheme
|
|
||||||
.black
|
|
||||||
.withOpacity(0.16),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
focusedBorder: OutlineInputBorder(
|
|
||||||
borderRadius: BorderRadius.circular(24.0),
|
|
||||||
borderSide: BorderSide(
|
|
||||||
color: StreamChatTheme.of(context)
|
|
||||||
.colorTheme
|
|
||||||
.black
|
|
||||||
.withOpacity(0.16),
|
|
||||||
)),
|
|
||||||
contentPadding: const EdgeInsets.all(0),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
SizedBox(width: 8),
|
|
||||||
IconTheme(
|
|
||||||
data: StreamChatTheme.of(context)
|
|
||||||
.channelTheme
|
|
||||||
.messageInputButtonIconTheme,
|
|
||||||
child: IconButton(
|
|
||||||
onPressed: () async {
|
|
||||||
modalSetState(() => _loading = true);
|
|
||||||
await sendMessage();
|
|
||||||
modalSetState(() => _loading = false);
|
|
||||||
},
|
|
||||||
splashRadius: 24,
|
|
||||||
visualDensity: VisualDensity.compact,
|
|
||||||
constraints: BoxConstraints.tightFor(
|
|
||||||
height: 24,
|
|
||||||
width: 24,
|
|
||||||
),
|
|
||||||
padding: EdgeInsets.zero,
|
|
||||||
icon: Transform.rotate(
|
|
||||||
angle: -pi / 2,
|
|
||||||
child: StreamSvgIcon.Icon_send_message(
|
|
||||||
color: StreamChatTheme.of(context)
|
|
||||||
.colorTheme
|
|
||||||
.accentBlue,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
/// Sends the current message
|
/// Sends the current message
|
||||||
Future sendMessage() async {
|
Future sendMessage() async {
|
||||||
var text = _messageController.text.trim();
|
var text = _messageController.text.trim();
|
||||||
@@ -420,25 +328,6 @@ class _ImageFooterState extends State<ImageFooter> {
|
|||||||
_selectedChannels.clear();
|
_selectedChannels.clear();
|
||||||
Navigator.pop(context);
|
Navigator.pop(context);
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<void> _saveImage(String url) async {
|
|
||||||
var response = await Dio()
|
|
||||||
.get(url, options: Options(responseType: ResponseType.bytes));
|
|
||||||
final result = await ImageGallerySaver.saveImage(
|
|
||||||
Uint8List.fromList(response.data),
|
|
||||||
quality: 60,
|
|
||||||
name: "${DateTime.now().millisecondsSinceEpoch}");
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
|
|
||||||
Future<void> _saveVideo(String url) async {
|
|
||||||
var appDocDir = await getTemporaryDirectory();
|
|
||||||
var savePath =
|
|
||||||
appDocDir.path + "/${DateTime.now().millisecondsSinceEpoch}.mp4";
|
|
||||||
await Dio().download(url, savePath);
|
|
||||||
final result = await ImageGallerySaver.saveFile(savePath);
|
|
||||||
print(result);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Used for clipping textfield prefix icon
|
/// Used for clipping textfield prefix icon
|
||||||
|
|||||||
@@ -798,6 +798,8 @@ class MessageInputState extends State<MessageInput> {
|
|||||||
? StreamChatTheme.of(context).colorTheme.black.withOpacity(0.2)
|
? StreamChatTheme.of(context).colorTheme.black.withOpacity(0.2)
|
||||||
: StreamChatTheme.of(context).colorTheme.black.withOpacity(0.5);
|
: StreamChatTheme.of(context).colorTheme.black.withOpacity(0.5);
|
||||||
break;
|
break;
|
||||||
|
default:
|
||||||
|
return Colors.black;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1014,6 +1016,8 @@ class MessageInputState extends State<MessageInput> {
|
|||||||
);
|
);
|
||||||
});
|
});
|
||||||
break;
|
break;
|
||||||
|
default:
|
||||||
|
return SizedBox();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1038,6 +1042,7 @@ class MessageInputState extends State<MessageInput> {
|
|||||||
final mediaInfo = await CompressVideoService.compressVideo(file.path);
|
final mediaInfo = await CompressVideoService.compressVideo(file.path);
|
||||||
|
|
||||||
if (mediaInfo.filesize / (1024 * 1024) > _kMaxAttachmentSize) {
|
if (mediaInfo.filesize / (1024 * 1024) > _kMaxAttachmentSize) {
|
||||||
|
// ignore: deprecated_member_use
|
||||||
Scaffold.of(context).showSnackBar(
|
Scaffold.of(context).showSnackBar(
|
||||||
SnackBar(
|
SnackBar(
|
||||||
content: Text(
|
content: Text(
|
||||||
@@ -1058,6 +1063,7 @@ class MessageInputState extends State<MessageInput> {
|
|||||||
path: mediaInfo.path,
|
path: mediaInfo.path,
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
|
// ignore: deprecated_member_use
|
||||||
Scaffold.of(context).showSnackBar(
|
Scaffold.of(context).showSnackBar(
|
||||||
SnackBar(
|
SnackBar(
|
||||||
content: Text(
|
content: Text(
|
||||||
@@ -1110,6 +1116,7 @@ class MessageInputState extends State<MessageInput> {
|
|||||||
});
|
});
|
||||||
print(e);
|
print(e);
|
||||||
print(s);
|
print(s);
|
||||||
|
// ignore: deprecated_member_use
|
||||||
Scaffold.of(context).showSnackBar(
|
Scaffold.of(context).showSnackBar(
|
||||||
SnackBar(
|
SnackBar(
|
||||||
content: Text('Error adding the attachment: $e'),
|
content: Text('Error adding the attachment: $e'),
|
||||||
@@ -2013,6 +2020,7 @@ class MessageInputState extends State<MessageInput> {
|
|||||||
attachment.file = file;
|
attachment.file = file;
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
|
// ignore: deprecated_member_use
|
||||||
Scaffold.of(context).showSnackBar(
|
Scaffold.of(context).showSnackBar(
|
||||||
SnackBar(
|
SnackBar(
|
||||||
content: Text(
|
content: Text(
|
||||||
|
|||||||
@@ -220,7 +220,7 @@ class MessageReactionsModal extends StatelessWidget {
|
|||||||
crossAxisAlignment: CrossAxisAlignment.center,
|
crossAxisAlignment: CrossAxisAlignment.center,
|
||||||
children: [
|
children: [
|
||||||
Stack(
|
Stack(
|
||||||
overflow: Overflow.visible,
|
clipBehavior: Clip.none,
|
||||||
children: [
|
children: [
|
||||||
UserAvatar(
|
UserAvatar(
|
||||||
onTap: onUserAvatarTap,
|
onTap: onUserAvatarTap,
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:stream_chat_flutter/src/stream_chat_theme.dart';
|
import 'package:stream_chat_flutter/src/stream_chat_theme.dart';
|
||||||
import 'package:stream_chat_flutter/src/stream_svg_icon.dart';
|
|
||||||
|
|
||||||
class OptionListTile extends StatelessWidget {
|
class OptionListTile extends StatelessWidget {
|
||||||
final String title;
|
final String title;
|
||||||
|
|||||||
@@ -524,6 +524,7 @@ abstract class ListItem {
|
|||||||
final user = (this as ListUserItem).user;
|
final user = (this as ListUserItem).user;
|
||||||
return 'USER-${user.id}';
|
return 'USER-${user.id}';
|
||||||
}
|
}
|
||||||
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
Widget when({
|
Widget when({
|
||||||
@@ -536,6 +537,7 @@ abstract class ListItem {
|
|||||||
if (this is ListUserItem) {
|
if (this is ListUserItem) {
|
||||||
return userItem((this as ListUserItem).user);
|
return userItem((this as ListUserItem).user);
|
||||||
}
|
}
|
||||||
|
return SizedBox();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ Future<void> launchURL(BuildContext context, String url) async {
|
|||||||
if (await canLaunch(url)) {
|
if (await canLaunch(url)) {
|
||||||
await launch(url);
|
await launch(url);
|
||||||
} else {
|
} else {
|
||||||
Scaffold.of(context).showSnackBar(
|
ScaffoldMessenger.of(context).showSnackBar(
|
||||||
SnackBar(
|
SnackBar(
|
||||||
content: Text('Cannot launch the url'),
|
content: Text('Cannot launch the url'),
|
||||||
),
|
),
|
||||||
|
|||||||
Reference in New Issue
Block a user