Skip to content

Commit

Permalink
Merge pull request #283 from LezdCS/develop
Browse files Browse the repository at this point in the history
Remove 5 packages + style Dismissible widgets
  • Loading branch information
LezdCS authored Oct 10, 2024
2 parents 79e05ec + afb5dcb commit d4e2a43
Show file tree
Hide file tree
Showing 10 changed files with 225 additions and 246 deletions.
10 changes: 0 additions & 10 deletions ios/Podfile.lock
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
PODS:
- audioplayers_darwin (0.0.1):
- Flutter
- awesome_notifications (0.9.3):
- Flutter
- IosAwnCore (~> 0.9.3)
- connectivity_plus (0.0.1):
- Flutter
- ReachabilitySwift
Expand Down Expand Up @@ -177,7 +174,6 @@ PODS:
- in_app_purchase_storekit (0.0.1):
- Flutter
- FlutterMacOS
- IosAwnCore (0.9.3)
- MLImage (1.0.0-beta5)
- MLKitBarcodeScanning (5.0.0):
- MLKitCommon (~> 11.0)
Expand Down Expand Up @@ -232,7 +228,6 @@ PODS:

DEPENDENCIES:
- audioplayers_darwin (from `.symlinks/plugins/audioplayers_darwin/ios`)
- awesome_notifications (from `.symlinks/plugins/awesome_notifications/ios`)
- connectivity_plus (from `.symlinks/plugins/connectivity_plus/ios`)
- device_info_plus (from `.symlinks/plugins/device_info_plus/ios`)
- firebase_analytics (from `.symlinks/plugins/firebase_analytics/ios`)
Expand Down Expand Up @@ -278,7 +273,6 @@ SPEC REPOS:
- GoogleUtilities
- GoogleUtilitiesComponents
- GTMSessionFetcher
- IosAwnCore
- MLImage
- MLKitBarcodeScanning
- MLKitCommon
Expand All @@ -291,8 +285,6 @@ SPEC REPOS:
EXTERNAL SOURCES:
audioplayers_darwin:
:path: ".symlinks/plugins/audioplayers_darwin/ios"
awesome_notifications:
:path: ".symlinks/plugins/awesome_notifications/ios"
connectivity_plus:
:path: ".symlinks/plugins/connectivity_plus/ios"
device_info_plus:
Expand Down Expand Up @@ -342,7 +334,6 @@ EXTERNAL SOURCES:

SPEC CHECKSUMS:
audioplayers_darwin: 877d9a4d06331c5c374595e46e16453ac7eafa40
awesome_notifications: 66d28ab7174ca2823b04d275cb043e0a4a3eb9cf
connectivity_plus: bf0076dd84a130856aa636df1c71ccaff908fa1d
device_info_plus: 97af1d7e84681a90d0693e63169a5d50e0839a0d
Firebase: cec914dab6fd7b1bd8ab56ea07ce4e03dd251c2d
Expand Down Expand Up @@ -375,7 +366,6 @@ SPEC CHECKSUMS:
GoogleUtilitiesComponents: 679b2c881db3b615a2777504623df6122dd20afe
GTMSessionFetcher: 5aea5ba6bd522a239e236100971f10cb71b96ab6
in_app_purchase_storekit: 8c3b0b3eb1b0f04efbff401c3de6266d4258d433
IosAwnCore: b8601fbb37f7b3560f31b84ebf55a72f65812e05
MLImage: 1824212150da33ef225fbd3dc49f184cf611046c
MLKitBarcodeScanning: 10ca0845a6d15f2f6e911f682a1998b68b973e8b
MLKitCommon: afec63980417d29ffbb4790529a1b0a2291699e1
Expand Down
6 changes: 1 addition & 5 deletions lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ import 'package:irllink/src/presentation/views/login_view.dart';
import 'package:kick_chat/kick_chat.dart';
import 'package:package_info_plus/package_info_plus.dart';
import 'package:talker_flutter/talker_flutter.dart';
import 'package:upgrader/upgrader.dart';
import 'package:wakelock_plus/wakelock_plus.dart';

void main() async {
Expand Down Expand Up @@ -103,10 +102,7 @@ class Main extends StatelessWidget {
@override
Widget build(BuildContext context) {
return GetMaterialApp(
home: UpgradeAlert(
upgrader: Upgrader(),
child: const LoginView(),
),
home: const LoginView(),
theme: Themes().lightTheme,
darkTheme: Themes().darkTheme,
themeMode: ThemeMode.dark,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ class SettingsViewController extends GetxController {

final addBrowserUrlKey = GlobalKey<FormState>();
final addBrowserTitleKey = GlobalKey<FormState>();
RxList browserTabsSelected = [].obs;

late RxList<String> usernamesHiddenUsers;

Expand Down
150 changes: 78 additions & 72 deletions lib/src/presentation/views/home_view.dart
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ import 'package:irllink/src/presentation/widgets/web_page_view.dart';
import 'package:move_to_background/move_to_background.dart';
import 'package:split_view/split_view.dart';
import 'package:twitch_chat/twitch_chat.dart';
import 'package:upgrader/upgrader.dart';

class HomeView extends GetView<HomeViewController> {
const HomeView({super.key});
Expand All @@ -38,85 +39,90 @@ class HomeView extends GetView<HomeViewController> {
final double height = MediaQuery.of(context).size.height;
final double width = MediaQuery.of(context).size.width;

return PopScope(
onPopInvokedWithResult: (bool invoked, dynamic d) async {
if (invoked) {
MoveToBackground.moveTaskToBack();
}
},
child: AnnotatedRegion(
value: SystemUiOverlayStyle(
systemNavigationBarColor: Theme.of(context).colorScheme.surface,
),
child: Scaffold(
resizeToAvoidBottomInset: true,
body: Obx(
() => Listener(
onPointerUp: (_) => {
FocusScope.of(context).unfocus(),
},
child: Container(
constraints: const BoxConstraints.expand(),
decoration: BoxDecoration(
color: context.theme.colorScheme.surface,
),
child: SafeArea(
child: Stack(
children: [
Stack(
children: List<Widget>.generate(
controller.iOSAudioSources.length,
(int index) => controller.iOSAudioSources[index],
),
),
Listener(
onPointerUp: (_) => {
controller.displayDashboard.value = false,
},
child: SplitView(
controller: controller.splitViewController,
gripColor: context.theme.colorScheme.secondary,
gripColorActive: context.theme.colorScheme.secondary,
gripSize: 8,
viewMode: context.isPortrait
? SplitViewMode.Vertical
: SplitViewMode.Horizontal,
indicator: SplitIndicator(
viewMode: context.isPortrait
? SplitViewMode.Vertical
: SplitViewMode.Horizontal,
color: const Color(0xFF464444),
return UpgradeAlert(
upgrader: Upgrader(),
child: PopScope(
onPopInvokedWithResult: (bool invoked, dynamic d) async {
if (invoked) {
MoveToBackground.moveTaskToBack();
}
},
child: AnnotatedRegion(
value: SystemUiOverlayStyle(
systemNavigationBarColor: Theme.of(context).colorScheme.surface,
),
child: Scaffold(
resizeToAvoidBottomInset: true,
body: Obx(
() => Listener(
onPointerUp: (_) => {
FocusScope.of(context).unfocus(),
},
child: Container(
constraints: const BoxConstraints.expand(),
decoration: BoxDecoration(
color: context.theme.colorScheme.surface,
),
child: SafeArea(
child: Stack(
children: [
Stack(
children: List<Widget>.generate(
controller.iOSAudioSources.length,
(int index) => controller.iOSAudioSources[index],
),
activeIndicator: SplitIndicator(
color: const Color(0xFF464444),
),
Listener(
onPointerUp: (_) => {
controller.displayDashboard.value = false,
},
child: SplitView(
controller: controller.splitViewController,
gripColor: context.theme.colorScheme.secondary,
gripColorActive:
context.theme.colorScheme.secondary,
gripSize: 8,
viewMode: context.isPortrait
? SplitViewMode.Vertical
: SplitViewMode.Horizontal,
isActive: true,
indicator: SplitIndicator(
viewMode: context.isPortrait
? SplitViewMode.Vertical
: SplitViewMode.Horizontal,
color: const Color(0xFF464444),
),
activeIndicator: SplitIndicator(
color: const Color(0xFF464444),
viewMode: context.isPortrait
? SplitViewMode.Vertical
: SplitViewMode.Horizontal,
isActive: true,
),
onWeightChanged: controller.onSplitResized,
children: [
controller.tabElements.isNotEmpty
? _top(context, height, width)
: const Text(
"No tabs",
textAlign: TextAlign.center,
),
_bottom(context, height, width),
],
),
onWeightChanged: controller.onSplitResized,
children: [
controller.tabElements.isNotEmpty
? _top(context, height, width)
: const Text(
"No tabs",
textAlign: TextAlign.center,
),
_bottom(context, height, width),
],
),
),
Visibility(
visible: controller.displayDashboard.value,
child: const Dashboard(),
),
Visibility(
visible: Get.find<StoreService>().purchasePending.value,
child: CircularProgressIndicator(
color: context.theme.colorScheme.tertiary,
Visibility(
visible: controller.displayDashboard.value,
child: const Dashboard(),
),
),
],
Visibility(
visible:
Get.find<StoreService>().purchasePending.value,
child: CircularProgressIndicator(
color: context.theme.colorScheme.tertiary,
),
),
],
),
),
),
),
Expand Down
11 changes: 7 additions & 4 deletions lib/src/presentation/widgets/emote_picker_view.dart
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import 'package:cached_network_image/cached_network_image.dart';
import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:irllink/src/presentation/controllers/chat_view_controller.dart';
import 'package:irllink/src/presentation/controllers/home_view_controller.dart';
import 'package:transparent_image/transparent_image.dart';
import 'package:twitch_chat/twitch_chat.dart';

class EmotePickerView extends GetView<HomeViewController> {
Expand Down Expand Up @@ -147,9 +147,12 @@ class EmotePickerView extends GetView<HomeViewController> {
controller.chatInputController.text =
"$text${isLastCharSpace ? "" : " "}${emote.name} ";
},
child: FadeInImage.memoryNetwork(
image: emote.url1x,
placeholder: kTransparentImage,
child: CachedNetworkImage(
imageUrl: emote.url1x,
placeholder: (BuildContext context, String url) =>
const CircularProgressIndicator(),
errorWidget: (BuildContext context, String url, dynamic error) =>
const Icon(Icons.error),
),
);
}
Expand Down
28 changes: 24 additions & 4 deletions lib/src/presentation/widgets/settings/chats_joined.dart
Original file line number Diff line number Diff line change
Expand Up @@ -142,8 +142,18 @@ class ChatsJoined extends GetView<SettingsViewController> {
key: ValueKey(group),
direction: DismissDirection.endToStart,
background: Container(
color: Colors.red,
child: const Icon(Icons.delete),
alignment: Alignment.centerRight,
child: Wrap(
crossAxisAlignment: WrapCrossAlignment.center,
spacing: 10,
children: [
Text('delete'.tr),
const Icon(
Icons.delete,
color: Colors.red,
),
],
),
),
onDismissed: (direction) {
// If the user swipes to the left
Expand Down Expand Up @@ -206,8 +216,18 @@ class ChatsJoined extends GetView<SettingsViewController> {
return Dismissible(
direction: DismissDirection.endToStart,
background: Container(
color: Colors.red,
child: const Icon(Icons.delete),
alignment: Alignment.centerRight,
child: Wrap(
crossAxisAlignment: WrapCrossAlignment.center,
spacing: 10,
children: [
Text('delete'.tr),
const Icon(
Icons.delete,
color: Colors.red,
),
],
),
),
confirmDismiss: (direction) => Future.value(true),
onDismissed: (direction) {
Expand Down
40 changes: 21 additions & 19 deletions lib/src/presentation/widgets/settings/dashboard_settings_view.dart
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import 'package:collection/collection.dart';
import 'package:flutter/material.dart';
import 'package:flutter_colorpicker/flutter_colorpicker.dart';
import 'package:flutter_slidable/flutter_slidable.dart';
import 'package:get/get.dart';
import 'package:irllink/src/core/services/settings_service.dart';
import 'package:irllink/src/core/utils/dashboard_events.dart';
Expand Down Expand Up @@ -70,24 +69,27 @@ class DashboardSettingsView extends GetView<DashboardController> {
settings.dashboardSettings!.userEvents[index];
ExistingDashboardEvent? eventDetails =
dashboardEvents[event.event];
return Slidable(
return Dismissible(
key: Key('${event.title}-$index'),
endActionPane: ActionPane(
motion: const ScrollMotion(),
extentRatio: 0.25,
children: [
SlidableAction(
backgroundColor:
Theme.of(context).colorScheme.surface,
onPressed: (context) {
controller.removeDashboardEvent(event);
},
icon: Icons.delete,
label: "delete".tr,
foregroundColor: Colors.red,
),
],
direction: DismissDirection.endToStart,
background: Container(
alignment: Alignment.centerRight,
child: Wrap(
crossAxisAlignment: WrapCrossAlignment.center,
spacing: 10,
children: [
Text('delete'.tr),
const Icon(
Icons.delete,
color: Colors.red,
),
],
),
),
confirmDismiss: (direction) => Future.value(true),
onDismissed: (context) {
controller.removeDashboardEvent(event);
},
child: Container(
margin: const EdgeInsets.all(4),
padding: const EdgeInsets.all(10),
Expand Down Expand Up @@ -141,7 +143,7 @@ Widget _addGroupButton(
onTap: () {
Get.defaultDialog(
content: _addDialog(context, dashboardController),
title: "new_event".tr,
title: "new_event".tr,
cancel: null,
confirm: Container(),
backgroundColor: Theme.of(context).colorScheme.surface,
Expand Down Expand Up @@ -235,7 +237,7 @@ Widget _addDialog(context, DashboardController dashboardController) {
}).toList(),
validator: (value) {
if (value == SupportedEvents.none) {
return "please_select_event".tr;
return "please_select_event".tr;
}
return null;
},
Expand Down
Loading

0 comments on commit d4e2a43

Please sign in to comment.