59 lines
1.8 KiB
Dart
59 lines
1.8 KiB
Dart
import 'package:flutter/material.dart';
|
|
import 'package:flutter/widgets.dart';
|
|
|
|
class HorizontalScrollView extends StatefulWidget {
|
|
@override
|
|
State<HorizontalScrollView> createState() => _HorizontalScrollViewState();
|
|
}
|
|
|
|
class _HorizontalScrollViewState extends State<HorizontalScrollView> {
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return Center(
|
|
child: Padding(
|
|
padding: const EdgeInsets.all(03.0),
|
|
child: Card(
|
|
surfaceTintColor: Colors.white,
|
|
elevation: 10.0,
|
|
child: Column(
|
|
children: [
|
|
const Padding(
|
|
padding: EdgeInsets.all(10.0),
|
|
child: SearchBar(
|
|
leading: Icon(Icons.search),
|
|
hintText: "Search here",
|
|
),
|
|
),
|
|
Expanded(
|
|
child: SingleChildScrollView(
|
|
scrollDirection: Axis.vertical,
|
|
child: SingleChildScrollView(
|
|
scrollDirection: Axis.horizontal,
|
|
child: DataTable(
|
|
columns: List.generate(
|
|
10, // Number of columns
|
|
(index) => DataColumn(label: Text('Column $index')),
|
|
),
|
|
rows: List.generate(
|
|
5, // Number of rows
|
|
(rowIndex) => DataRow(
|
|
cells: List.generate(
|
|
10, // Number of cells in each row
|
|
(cellIndex) => DataCell(
|
|
Text('Data 21223wewds $rowIndex'),
|
|
),
|
|
),
|
|
),
|
|
),
|
|
),
|
|
),
|
|
),
|
|
),
|
|
],
|
|
),
|
|
),
|
|
),
|
|
);
|
|
}
|
|
}
|