78 lines
2.0 KiB
Dart
78 lines
2.0 KiB
Dart
|
import 'package:flutter/material.dart';
|
|||
|
import 'package:qhd_prevention/pages/my_appbar.dart';
|
|||
|
import 'package:qhd_prevention/tools/tools.dart';
|
|||
|
import '/customWidget/search_bar_widget.dart';
|
|||
|
|
|||
|
class LowPage extends StatefulWidget {
|
|||
|
const LowPage({super.key});
|
|||
|
|
|||
|
@override
|
|||
|
State<LowPage> createState() => _LowPagePageState();
|
|||
|
}
|
|||
|
|
|||
|
class _LowPagePageState extends State<LowPage> {
|
|||
|
// 模拟数据
|
|||
|
final List<Map<String, dynamic>> _dataInfos = List.generate(10, (i) {
|
|||
|
return {
|
|||
|
'title': '测试数据标题标题 ${i + 1}',
|
|||
|
};
|
|||
|
});
|
|||
|
final TextEditingController _searchController = TextEditingController();
|
|||
|
|
|||
|
@override
|
|||
|
Widget build(BuildContext context) {
|
|||
|
return Scaffold(
|
|||
|
appBar: MyAppbar(
|
|||
|
title: "法律法规",
|
|||
|
),
|
|||
|
body: SafeArea(child: _vcDetailWidget()),
|
|||
|
);
|
|||
|
}
|
|||
|
|
|||
|
Widget _vcDetailWidget() {
|
|||
|
return Column(
|
|||
|
children: [
|
|||
|
Padding(
|
|||
|
padding: EdgeInsets.all(10),
|
|||
|
child: SearchBarWidget(
|
|||
|
controller: _searchController,
|
|||
|
onSearch: (keyboard) {
|
|||
|
// 输入请求接口
|
|||
|
|
|||
|
},
|
|||
|
),
|
|||
|
),
|
|||
|
|
|||
|
// 修复:使用Expanded包裹ListView确保正确高度
|
|||
|
Expanded(
|
|||
|
child: ListView.separated(
|
|||
|
separatorBuilder: (_, __) => const Divider(height: 0.5, color: Colors.black12,),
|
|||
|
itemCount: _dataInfos.length,
|
|||
|
itemBuilder: (context, index) {
|
|||
|
final item = _dataInfos[index];
|
|||
|
return _fxitemCell(item);
|
|||
|
},
|
|||
|
),
|
|||
|
),
|
|||
|
],
|
|||
|
);
|
|||
|
}
|
|||
|
|
|||
|
Widget _fxitemCell(final item) {
|
|||
|
String title = item['title'];
|
|||
|
|
|||
|
return Container(
|
|||
|
height: 50,
|
|||
|
color: Colors.white,
|
|||
|
padding: EdgeInsets.symmetric(horizontal: 16), // 添加水平内边距
|
|||
|
child: Row(
|
|||
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|||
|
children: [
|
|||
|
Text(title),
|
|||
|
Icon(Icons.arrow_forward_ios, color: Colors.black26,)
|
|||
|
],
|
|||
|
),
|
|||
|
);
|
|||
|
}
|
|||
|
}
|