31 lines
920 B
Dart
31 lines
920 B
Dart
import 'package:flutter/material.dart';
|
|
|
|
class SettingPage extends StatelessWidget {
|
|
const SettingPage({super.key});
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return Scaffold(
|
|
// 注意:这里不需要 bottomNavigationBar 了,因为外层已经有了
|
|
backgroundColor: Colors.transparent, // 关键:背景透明,透出玻璃效果
|
|
body: CustomScrollView(
|
|
slivers: [
|
|
SliverAppBar.large(
|
|
title: const Text('首页'),
|
|
floating: true,
|
|
backgroundColor: Colors.blueAccent.withOpacity(0.8),
|
|
),
|
|
SliverList(
|
|
delegate: SliverChildBuilderDelegate(
|
|
(context, index) => ListTile(
|
|
title: Text('列表项 $index'),
|
|
leading: const Icon(Icons.article),
|
|
),
|
|
childCount: 20,
|
|
),
|
|
),
|
|
],
|
|
),
|
|
);
|
|
}
|
|
} |