57 lines
1.4 KiB
Dart
57 lines
1.4 KiB
Dart
import 'package:flutter/material.dart';
|
|
import 'package:get/get.dart';
|
|
import 'package:pilipala/pages/media/index.dart';
|
|
|
|
class MediaPage extends StatefulWidget {
|
|
const MediaPage({super.key});
|
|
|
|
@override
|
|
State<MediaPage> createState() => _MediaPageState();
|
|
}
|
|
|
|
class _MediaPageState extends State<MediaPage>
|
|
with AutomaticKeepAliveClientMixin {
|
|
late MediaController mediaController;
|
|
|
|
@override
|
|
bool get wantKeepAlive => true;
|
|
|
|
@override
|
|
void initState() {
|
|
super.initState();
|
|
mediaController = Get.put(MediaController());
|
|
}
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
super.build(context);
|
|
Color primary = Theme.of(context).colorScheme.primary;
|
|
return Scaffold(
|
|
body: Column(
|
|
children: [
|
|
for (var i in mediaController.list) ...[
|
|
ListTile(
|
|
onTap: () => i['onTap'](),
|
|
dense: true,
|
|
leading: Padding(
|
|
padding: const EdgeInsets.only(left: 15),
|
|
child: Icon(
|
|
i['icon'],
|
|
color: primary,
|
|
),
|
|
),
|
|
contentPadding:
|
|
const EdgeInsets.only(left: 15, top: 2, bottom: 2),
|
|
minLeadingWidth: 0,
|
|
title: Text(
|
|
i['title'],
|
|
style: const TextStyle(fontSize: 15),
|
|
),
|
|
),
|
|
],
|
|
],
|
|
),
|
|
);
|
|
}
|
|
}
|