Fix simple analysis issues

parent 57834605
......@@ -40,13 +40,8 @@ final routes = {
),
Routes.chats: (Object arguments) => platformPageRoute(
settings: RouteSettings(name: Routes.chats),
builder: (context) {
if (arguments is Room) {
return ChatPage(arguments);
} else {
return ChatOverviewPage();
}
},
builder: (context) =>
arguments is Room ? ChatPage(arguments) : ChatOverviewPage(),
),
Routes.chatsSettings: (Object arguments) => platformPageRoute(
settings: RouteSettings(name: Routes.chatsSettings),
......
......@@ -16,7 +16,6 @@
// along with Pattle. If not, see <https://www.gnu.org/licenses/>.
import 'package:matrix_sdk/matrix_sdk.dart';
import 'package:pattle/src/ui/main/overview/models/chat_overview.dart';
import 'package:rxdart/rxdart.dart';
import 'package:pattle/src/di.dart' as di;
import 'package:respect_24_hour/respect_24_hour.dart';
......
......@@ -131,7 +131,7 @@ class ChatBloc {
// TODO: Check if text is just whitespace
if (room is JoinedRoom && text.isNotEmpty) {
// Refresh the list every time the sent state changes.
await for (var sentState in room.send(TextMessage(body: text))) {
await for (var _ in room.send(TextMessage(body: text))) {
_shouldRefreshSubj.add(true);
}
}
......
......@@ -14,8 +14,6 @@
//
// You should have received a copy of the GNU Affero General Public License
// along with Pattle. If not, see <https://www.gnu.org/licenses/>.
import 'dart:async';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter_platform_widgets/flutter_platform_widgets.dart';
......
......@@ -15,9 +15,7 @@
// You should have received a copy of the GNU Affero General Public License
// along with Pattle. If not, see <https://www.gnu.org/licenses/>.
import 'package:matrix_sdk/matrix_sdk.dart';
import 'package:pattle/src/ui/main/models/chat_item.dart';
import 'package:pattle/src/ui/main/sync_bloc.dart';
import 'package:pattle/src/ui/util/room.dart';
import 'package:rxdart/rxdart.dart';
class ImageBloc {
......
......@@ -15,8 +15,6 @@
//
// You should have received a copy of the GNU Affero General Public License
// along with Pattle. If not, see <https://www.gnu.org/licenses/>.
import 'dart:async';
import 'package:flutter/material.dart';
import 'package:matrix_sdk/matrix_sdk.dart';
import 'package:pattle/src/ui/main/chat/image/image_bloc.dart';
......@@ -50,6 +48,7 @@ class ImagePageState extends State<ImagePage> {
@override
void didChangeDependencies() {
super.didChangeDependencies();
_date =
'${formatAsDate(context, message.time)}, ${formatAsTime(message.time)}';
}
......@@ -96,14 +95,16 @@ class ImagePageState extends State<ImagePage> {
BuildContext context,
AsyncSnapshot<List<ImageMessageEvent>> snapshot,
) {
Widget widget;
switch (snapshot.connectionState) {
case ConnectionState.none:
case ConnectionState.waiting:
return Center(child: CircularProgressIndicator());
widget = Center(child: CircularProgressIndicator());
break;
case ConnectionState.active:
case ConnectionState.done:
final events = snapshot.data;
return PhotoViewGallery.builder(
widget = PhotoViewGallery.builder(
itemCount: events.length,
reverse: true,
builder: (context, index) {
......@@ -124,7 +125,10 @@ class ImagePageState extends State<ImagePage> {
initialPage: events.indexOf(message),
),
);
break;
}
return widget;
},
);
}
......
......@@ -18,10 +18,6 @@
import 'dart:async';
import 'package:matrix_sdk/matrix_sdk.dart';
import 'package:pattle/src/ui/main/models/chat_item.dart';
import 'package:pattle/src/ui/main/sync_bloc.dart';
import 'package:pattle/src/ui/util/room.dart';
import 'package:rxdart/rxdart.dart';
import 'package:pattle/src/di.dart' as di;
class ChatSettingsBloc {
......
......@@ -19,7 +19,6 @@ import 'package:flutter/material.dart';
import 'package:flutter/rendering.dart';
import 'package:flutter_platform_widgets/flutter_platform_widgets.dart';
import 'package:matrix_sdk/matrix_sdk.dart';
import 'package:pattle/src/ui/main/chat/chat_bloc.dart';
import 'package:pattle/src/ui/main/chat/settings/chat_settings_bloc.dart';
import 'package:pattle/src/ui/main/widgets/chat_name.dart';
import 'package:pattle/src/ui/main/widgets/user_item.dart';
......@@ -30,7 +29,6 @@ import 'package:pattle/src/di.dart' as di;
import 'package:pattle/src/ui/util/future_or_builder.dart';
import 'package:pattle/src/ui/util/matrix_image.dart';
import 'package:pattle/src/ui/util/room.dart';
import 'package:pattle/src/ui/util/user.dart';
class ChatSettingsPageState extends State<ChatSettingsPage> {
final me = di.getLocalUser();
......
......@@ -16,15 +16,7 @@
// along with Pattle. If not, see <https://www.gnu.org/licenses/>.
import 'package:flutter/material.dart';
import 'package:matrix_sdk/matrix_sdk.dart';
import 'package:pattle/src/ui/main/models/chat_item.dart';
import 'package:pattle/src/ui/resources/theme.dart';
import 'package:pattle/src/ui/util/date_format.dart';
import 'package:pattle/src/ui/util/user.dart';
import 'image_bubble.dart';
import 'state/member_bubble.dart';
import 'text_bubble.dart';
abstract class Item extends StatelessWidget {
final ChatItem item;
......
......@@ -15,19 +15,10 @@
// You should have received a copy of the GNU Affero General Public License
// along with Pattle. If not, see <https://www.gnu.org/licenses/>.
import 'dart:ui' as ui;
import 'package:flutter/material.dart';
import 'package:matrix_sdk/matrix_sdk.dart';
import 'package:pattle/src/ui/main/models/chat_item.dart';
import 'package:pattle/src/ui/main/widgets/platform_ink_well.dart';
import 'package:pattle/src/ui/util/future_or_builder.dart';
import 'package:pattle/src/ui/util/user.dart';
import 'package:url_launcher/url_launcher.dart';
import 'package:pattle/src/di.dart' as di;
import 'package:flutter_html/flutter_html.dart';
import 'bubble.dart';
import 'message_bubble.dart';
class LoadingBubble extends MessageBubble {
......
......@@ -15,8 +15,6 @@
// You should have received a copy of the GNU Affero General Public License
// along with Pattle. If not, see <https://www.gnu.org/licenses/>.
import 'dart:ui' as ui;
import 'package:flutter/material.dart';
import 'package:matrix_sdk/matrix_sdk.dart';
import 'package:pattle/src/ui/main/models/chat_item.dart';
......
......@@ -20,10 +20,7 @@ import 'package:flutter/material.dart';
import 'package:matrix_sdk/matrix_sdk.dart';
import 'package:pattle/src/ui/main/chat/util/member_span.dart';
import 'package:pattle/src/ui/main/models/chat_item.dart';
import 'package:pattle/src/ui/resources/localizations.dart';
import 'package:pattle/src/ui/util/user.dart';
import '../bubble.dart';
import 'state_bubble.dart';
class MemberBubble extends StateBubble {
......
......@@ -15,8 +15,6 @@
// You should have received a copy of the GNU Affero General Public License
// along with Pattle. If not, see <https://www.gnu.org/licenses/>.
import 'dart:ui' as ui;
import 'package:flutter/material.dart';
import 'package:matrix_sdk/matrix_sdk.dart';
import 'package:pattle/src/ui/main/models/chat_item.dart';
......
......@@ -16,7 +16,6 @@
// along with Pattle. If not, see <https://www.gnu.org/licenses/>.
import 'package:matrix_sdk/matrix_sdk.dart';
import 'package:meta/meta.dart';
abstract class ChatItem {}
......
......@@ -14,8 +14,6 @@
//
// You should have received a copy of the GNU Affero General Public License
// along with Pattle. If not, see <https://www.gnu.org/licenses/>.
import 'dart:async';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter_platform_widgets/flutter_platform_widgets.dart';
......
......@@ -14,8 +14,6 @@
//
// You should have received a copy of the GNU Affero General Public License
// along with Pattle. If not, see <https://www.gnu.org/licenses/>.
import 'dart:collection';
import 'package:matrix_sdk/matrix_sdk.dart';
import 'package:pattle/src/ui/main/sync_bloc.dart';
import 'package:pattle/src/ui/util/user.dart';
......
......@@ -17,12 +17,10 @@
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter_platform_widgets/flutter_platform_widgets.dart';
import 'package:matrix_sdk/matrix_sdk.dart';
import 'package:pattle/src/app.dart';
import 'package:pattle/src/ui/main/widgets/error.dart';
import 'package:pattle/src/ui/main/widgets/user_avatar.dart';
import 'package:pattle/src/ui/resources/localizations.dart';
import 'package:pattle/src/ui/util/matrix_image.dart';
import 'package:pattle/src/ui/util/user.dart';
import 'package:pattle/src/ui/main/overview/create/group/create_group_bloc.dart';
......
......@@ -20,12 +20,8 @@ import 'package:flutter_platform_widgets/flutter_platform_widgets.dart';
import 'package:matrix_sdk/matrix_sdk.dart';
import 'package:pattle/src/app.dart';
import 'package:pattle/src/ui/main/widgets/error.dart';
import 'package:pattle/src/ui/main/widgets/user_avatar.dart';
import 'package:pattle/src/ui/main/widgets/user_item.dart';
import 'package:pattle/src/ui/resources/localizations.dart';
import 'package:pattle/src/ui/resources/theme.dart';
import 'package:pattle/src/ui/util/matrix_image.dart';
import 'package:pattle/src/ui/util/user.dart';
import 'package:pattle/src/ui/main/overview/create/group/create_group_bloc.dart';
......
......@@ -15,8 +15,6 @@
// You should have received a copy of the GNU Affero General Public License
// along with Pattle. If not, see <https://www.gnu.org/licenses/>.
import 'dart:typed_data';
import 'package:matrix_sdk/matrix_sdk.dart';
import 'package:meta/meta.dart';
......
......@@ -18,7 +18,6 @@
import 'package:flutter/material.dart';
import 'package:matrix_sdk/matrix_sdk.dart';
import 'package:pattle/src/ui/main/chat/util/member_span.dart';
import 'package:pattle/src/ui/util/user.dart';
import 'subtitle.dart';
......
......@@ -17,7 +17,6 @@
import 'package:flutter/material.dart';
import 'package:matrix_sdk/matrix_sdk.dart';
import 'package:pattle/src/ui/main/chat/util/member_span.dart';
import 'package:pattle/src/ui/resources/localizations.dart';
import 'package:pattle/src/ui/util/user.dart';
......
......@@ -17,11 +17,8 @@
import 'package:flutter/material.dart';
import 'package:matrix_sdk/matrix_sdk.dart';
import 'package:pattle/src/ui/main/chat/util/member_span.dart';
import 'package:pattle/src/ui/main/chat/util/typing_span.dart';
import 'package:pattle/src/ui/resources/localizations.dart';
import 'package:pattle/src/ui/resources/theme.dart';
import 'package:pattle/src/ui/util/user.dart';
import 'subtitle.dart';
......
import 'package:flutter/material.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:pattle/main.dart';
void main() {}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment