34 lines
915 B
Dart
34 lines
915 B
Dart
import 'package:flutter/material.dart';
|
|
import 'package:tm_app/core/theme/colors.dart';
|
|
import 'package:tm_app/views/notification/strings/notification_strings.dart';
|
|
|
|
class PageSelectionDialog extends StatelessWidget {
|
|
final int totalPages;
|
|
|
|
const PageSelectionDialog({
|
|
required this.totalPages, super.key,
|
|
});
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return AlertDialog(
|
|
backgroundColor: AppColors.backgroundColor,
|
|
title: const Text(NotificationStrings.selectPage),
|
|
content: SizedBox(
|
|
width: 200,
|
|
height: 300,
|
|
child: ListView.builder(
|
|
itemCount: totalPages,
|
|
itemBuilder: (context, index) {
|
|
final pageNumber = index + 1;
|
|
return ListTile(
|
|
title: Text('$pageNumber'),
|
|
onTap: () => Navigator.pop(context, pageNumber),
|
|
);
|
|
},
|
|
),
|
|
),
|
|
);
|
|
}
|
|
}
|