A Music Player in which you can control audio player by shaking device in a particular manner.
To play/pause the current audio file, you can shake the device from center to back, like in video below.
play_pause.mp4
To change speed of the current audio file, you can shake the device, like in video below.
- center to left to decrease the speed
decrease.mp4
- center to right to increase the speed
increase.mp4
- app - contains config and setup related files
- models - data classes which will be used everywhere in the app
- resources - data provider classes and contains dto classes to convert response to model classes
- repositories - classes used to fetch data from any provider. called from viewmodels.
- screens
- view files - main screen UI
- viewmodel files - contains business logic of the app.
- theme - contains styling and dimensions related code
- utils - helper classes
- widgets - common widgets used throughout the app
MVVM (Model View ViewModel)
- Model: Simply holds the data.
- View: Shows the UI to the user.
- ViewModel: Link b/w model and view and this can have some business logic as well.
- start the emulator or connect to physical device.
- run `flutter devices` to check if your device is available to connect.
- run `flutter pub get`
- run `flutter pub run build_runner build --delete-conflicting-outputs`
- run `flutter run`
flutter pub run build_runner build --delete-conflicting-outputs
- Stacked - For state management, routing and service locator
- sensor_plus - To get accelerometer and gyroscope data
- just_audio - For Audio Player
note: To check the logic used see file -> lib/screens/soundDetail/sound_detail_viewmodel.dart