import 'package:firebase_messaging/firebase_messaging.dart';
import 'package:flutter/material.dart';
import 'package:garage/notification/widget/notification_row.dart';

class NotificationPage extends StatelessWidget {
  const NotificationPage({super.key});

  static const fakeMessages = [
    RemoteMessage(),
    RemoteMessage(),
    RemoteMessage(),
    RemoteMessage(),
    RemoteMessage(),
    RemoteMessage(),
    RemoteMessage()
  ];

  @override
  Widget build(BuildContext context) {
    final message = (ModalRoute.of(context)!.settings.arguments ??
        RemoteMessage()) as RemoteMessage;
    return Scaffold(
      appBar: AppBar(
        centerTitle: true,
        title: Text("Oznámení",
            style: TextStyle(
              color: Colors.white,
            )),
        backgroundColor: Theme.of(context).colorScheme.primary,
      ),
      body: ListView.separated(
        itemBuilder: (BuildContext context, int index) =>
            NotificationRow(message: fakeMessages[index]),
        separatorBuilder: (_, __) => const Divider(),
        itemCount: fakeMessages.length,
      ),
    );
  }
}
