import 'package:anyway/layouts/scaffold.dart';
import 'package:anyway/modules/new_trip_options_button.dart';
import 'package:flutter/material.dart';

import "package:anyway/structs/trip.dart";
import 'package:anyway/modules/new_trip_location_search.dart';
import 'package:anyway/modules/new_trip_map.dart';


class NewTripPage extends StatefulWidget {
  const NewTripPage({super.key});

  @override
  _NewTripPageState createState() => _NewTripPageState();
}

class _NewTripPageState extends State<NewTripPage> with ScaffoldLayout {
  final TextEditingController latController = TextEditingController();
  final TextEditingController lonController = TextEditingController();
  Trip trip = Trip();


  @override
  Widget build(BuildContext context) {
    // floating search bar and map as a background
    return mainScaffold(
      context,
      child: Scaffold(
        body: Stack(
          children: [
            NewTripMap(trip),
            Padding(
              padding: const EdgeInsets.all(15),
              child: NewTripLocationSearch(trip),
            ),
          ],
        ),
        floatingActionButton: NewTripOptionsButton(trip: trip),
      ),
      title: const Text("New Trip"),
      helpTexts: [
        "Setting the start location",
        "To set the starting point, type a city name in the search bar. You can also navigate the map like you're used to and long press anywhere to set a starting point."
      ],
    );
  }
}
