Som Seat is Flutter Application. In this application, we can select our desired train seats. It has a very clean UI for the selection of seats. And a search bar to search the particular seat.
The Application consists of 3- screen. The first is a Splash Screen, the second one is the seat selection page and the last one is the final seat display.
For State management in this application, I have used the provider package. In this project, I have created one provider which is providing the functions of adding the seat to a list, removing the seat from the list, and checking whether the seat is present in the list or not. I have created two consumers who are using our provider functions.
I have used simple Logic to generate seat numbers according to their berth type (reference taken from:- Where is My Train App).
Let's take a random seatNumber.
seatNumber%8 = refrenceSeatNumber
if refrenceSeatNumber == 1 || 4
then seat is Lower Berth.
if refrenceSeatNumber == 2 || 5
then seat is Middle Berth
if refrenceSeatNumber == 3 || 6
then seat is Upper Berth
if refrenceSeatNumber == 7
then seat is Side Lower
if refrenceSeatNumber == 8
then seat is Side Upper
Clone the project
git clone https://github.com/someshwar16/SomSeat.git
Install dependencies
flutter pub get
Start an Andorid Emulator
Then run the main.dart
flutter run