import 'package:anyway/modules/new_trip_button.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({Key? key}) : super(key: key);

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

class _NewTripPageState extends State<NewTripPage> {
  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 Scaffold(
      appBar: AppBar(
        title: const Text('New Trip'),
      ),
      body: Stack(
        children: [
          NewTripMap(trip),
          Padding(
            padding: EdgeInsets.all(15),
            child: NewTripLocationSearch(trip),
          ),
        ],
      ),
      floatingActionButton: NewTripOptionsButton(trip: trip),
    );
  }
}
