diff --git a/lib/console_ui.dart b/lib/console_ui.dart index 4111ed3..eb4d722 100644 --- a/lib/console_ui.dart +++ b/lib/console_ui.dart @@ -323,15 +323,9 @@ void printProfile(Store node, String profilePubkey) { } void printMenu(List menuOptions) { -/* - for(int i = 0; i < menuOptions.length;i++) { - print(" ${i+1}. ${menuOptions[i]}"); - } -*/ int longestMenuOption = 0; for(int i = 0; i < menuOptions.length;i++) { - //print(" ${i+1}. ${menuOptions[i]}"); if( longestMenuOption < menuOptions[i].length) { longestMenuOption = menuOptions[i].length; } @@ -346,6 +340,10 @@ void printMenu(List menuOptions) { if( longestMenuOption + 5> gMenuWidth ) gMenuWidth = longestMenuOption + 8; + if( terminalColumns~/gMenuWidth > 4) { + terminalColumns = gMenuWidth * 4; + } + //print("gMenuWidth = $gMenuWidth"); int rowLen = 0; for(int i = 0; i < menuOptions.length;i++) { diff --git a/pubspec.yaml b/pubspec.yaml index 446d42e..38d1a2c 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -5,12 +5,7 @@ homepage: https://github.com/vishalxl/nostr_console # Release 0.1.3-beta -# horizontal menu -# fixed tests -# clear screen for public channels + -# improved howto messages -# removed red error for default invokation related to invalid old encrypted group keys -# more clear screen +# limited menu columns to 4 environment: sdk: '>=2.17.3 <3.0.0'