Skip to content

Instantly share code, notes, and snippets.

@nick45chen
Created June 21, 2023 01:08
Show Gist options
  • Save nick45chen/fd0a0d8775288282a911da68a99ec612 to your computer and use it in GitHub Desktop.
Save nick45chen/fd0a0d8775288282a911da68a99ec612 to your computer and use it in GitHub Desktop.
Flutter 置中,且內容保持有 46 px,並且可以上下滑動(內容消失的邊界為螢幕)
ScrollView(
child: Padding(
padding: const EdgeInsets.all(46.0), // 添加 46px 的邊距
child: Container(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
Text('這是第一行文字'),
Text('這是第二行文字'),
// 你可以在此處添加更多的 Widget
],
),
),
),
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment