Skip to content

Commit

Permalink
fix(ui/peers) : make the peer list scrollable
Browse files Browse the repository at this point in the history
  • Loading branch information
iwanbk committed Nov 20, 2024
1 parent 2f48f51 commit 8c52b0b
Showing 1 changed file with 22 additions and 13 deletions.
35 changes: 22 additions & 13 deletions lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ class _MyAppState extends State<MyApp> {
List<String> peers = [];
late TextEditingController textEditController;
final _flutterDesktopSleepPlugin = FlutterDesktopSleep();
final ScrollController _scrollController = ScrollController();

@override
void initState() {
Expand Down Expand Up @@ -260,19 +261,27 @@ class _MyAppState extends State<MyApp> {
fontSize: 16,
color: Color(0xFF7D7E7E),
fontWeight: FontWeight.w500))),
TextField(
// peers address
controller: textEditController,
onTapOutside: (event) => {
FocusManager.instance.primaryFocus?.unfocus(),
},
minLines: 1,
maxLines: null,
keyboardType: TextInputType.multiline,
style: const TextStyle(fontSize: 14),
decoration: const InputDecoration(
border: OutlineInputBorder(),
//labelText: 'Peers',
ConstrainedBox(
constraints: BoxConstraints(
maxHeight: 150,
),
child: SingleChildScrollView(
controller: _scrollController,
child: TextField(
// peers address
controller: textEditController,
onTapOutside: (event) => {
FocusManager.instance.primaryFocus?.unfocus(),
},
minLines: 1,
maxLines: null,
keyboardType: TextInputType.multiline,
style: const TextStyle(fontSize: 14),
decoration: const InputDecoration(
border: OutlineInputBorder(),
//labelText: 'Peers',
),
),
),
),
Text(_peerValidity,
Expand Down

0 comments on commit 8c52b0b

Please sign in to comment.