From 3bfcd050ef72a59bb2db0b0440281616c2c0ffb2 Mon Sep 17 00:00:00 2001 From: liao2000 Date: Tue, 21 Dec 2021 19:09:07 +0800 Subject: [PATCH] Add scrollController --- lib/pages/poster.dart | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/pages/poster.dart b/lib/pages/poster.dart index 0d25ba6..50c6e04 100644 --- a/lib/pages/poster.dart +++ b/lib/pages/poster.dart @@ -9,14 +9,17 @@ class PosterPage extends StatefulWidget { class _PosterPageState extends State { double width = 500; + final ScrollController scrollController = ScrollController(); @override Widget build(BuildContext context) { return Scaffold( appBar: AppBar(title: const Text('海報張貼系統')), drawer: const MyDrawer(), body: Scrollbar( + controller: scrollController, isAlwaysShown: true, child: SingleChildScrollView( + controller: scrollController, child: Center( child: Padding( padding: const EdgeInsets.all(10), @@ -30,7 +33,7 @@ class _PosterPageState extends State { children: [ Text( '申請系統(測試中)', - style: Theme.of(context).textTheme.headline4, + style: Theme.of(context).textTheme.headline6, ), const SizedBox(height: 15), const TextField(