Skip to content

Commit

Permalink
Add listPeerChannels to command list
Browse files Browse the repository at this point in the history
  • Loading branch information
erdemyerebasmaz committed Sep 21, 2023
1 parent b92e9a9 commit 1848c06
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 11 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import 'dart:convert';
import 'dart:io';

import 'package:c_breez/routes/dev/widget/render_body.dart';
import 'package:c_breez/routes/dev/widget/command_list.dart';
import 'package:c_breez/services/injector.dart';
import 'package:c_breez/theme/theme_provider.dart' as theme;
import 'package:fimber/fimber.dart';
Expand All @@ -11,16 +11,16 @@ import 'package:share_plus/share_plus.dart';

final _log = FimberLog("CommandsList");

class CommandsList extends StatefulWidget {
class CommandLineInterface extends StatefulWidget {
final GlobalKey<ScaffoldState> scaffoldKey;

const CommandsList({Key? key, required this.scaffoldKey}) : super(key: key);
const CommandLineInterface({Key? key, required this.scaffoldKey}) : super(key: key);

@override
State<CommandsList> createState() => _CommandsListState();
State<CommandLineInterface> createState() => _CommandLineInterfaceState();
}

class _CommandsListState extends State<CommandsList> {
class _CommandLineInterfaceState extends State<CommandLineInterface> {
final _breezLib = ServiceInjector().breezSDK;

final _cliInputController = TextEditingController();
Expand Down Expand Up @@ -132,7 +132,7 @@ class _CommandsListState extends State<CommandsList> {
],
),
Expanded(
child: RenderBody(
child: CommandList(
loading: isLoading,
defaults: _showDefaultCommands,
fallback: _richCliText,
Expand Down Expand Up @@ -172,6 +172,7 @@ class _CommandsListState extends State<CommandsList> {
late String reply;
switch (commandArgs[0]) {
case 'listPeers':
case 'listPeerChannels':
case 'listFunds':
case 'listPayments':
case 'listInvoices':
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import 'dart:io';
import 'package:archive/archive_io.dart';
import 'package:c_breez/bloc/account/account_bloc.dart';
import 'package:c_breez/logger.dart';
import 'package:c_breez/routes/dev/commands_list.dart';
import 'package:c_breez/routes/dev/command_line_interface.dart';
import 'package:c_breez/routes/ui_test/ui_test_page.dart';
import 'package:c_breez/widgets/back_button.dart' as back_button;
import 'package:c_breez/widgets/route.dart';
Expand Down Expand Up @@ -85,7 +85,7 @@ class DevelopersView extends StatelessWidget {
],
title: const Text("Developers"),
),
body: CommandsList(scaffoldKey: scaffoldKey),
body: CommandLineInterface(scaffoldKey: scaffoldKey),
);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@ import 'package:c_breez/routes/dev/widget/command.dart';
import 'package:c_breez/widgets/loader.dart';
import 'package:flutter/material.dart';

class RenderBody extends StatelessWidget {
class CommandList extends StatelessWidget {
final bool loading;
final bool defaults;
final List<TextSpan> fallback;
final TextStyle fallbackTextStyle;
final TextEditingController inputController;
final FocusNode focusNode;

const RenderBody({
const CommandList({
this.loading = false,
this.defaults = false,
this.fallback = const [],
Expand Down Expand Up @@ -46,6 +46,10 @@ class RenderBody extends StatelessWidget {
"listPeers",
(c) => _onCommand(context, c),
),
Command(
"listPeerChannels",
(c) => _onCommand(context, c),
),
Command(
"listFunds",
(c) => _onCommand(context, c),
Expand Down
2 changes: 1 addition & 1 deletion lib/user_app.dart
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import 'package:c_breez/bloc/user_profile/user_profile_bloc.dart';
import 'package:c_breez/bloc/user_profile/user_profile_state.dart';
import 'package:c_breez/routes/buy_bitcoin/moonpay/moonpay_page.dart';
import 'package:c_breez/routes/create_invoice/create_invoice_page.dart';
import 'package:c_breez/routes/dev/commands.dart';
import 'package:c_breez/routes/dev/developers_view.dart';
import 'package:c_breez/routes/fiat_currencies/fiat_currency_settings.dart';
import 'package:c_breez/routes/home/home_page.dart';
import 'package:c_breez/routes/initial_walkthrough/initial_walkthrough.dart';
Expand Down

0 comments on commit 1848c06

Please sign in to comment.