A simple Flutter application that displays a list of random users by connecting to an external API. This project demonstrates how to build a data-driven app using best practices for state management.
- Display User List: Shows a list of random users with their pictures, names, and email addresses.
- User Details: Tapping on any user navigates to a separate screen to display more details about them.
- Refresh Data: The app includes a Floating Action Button to refresh the user list and fetch new data.
- State Management: The project uses both the
flutter_blocandproviderlibraries to effectively manage the application's state. - Internet Connectivity: Uses the
diolibrary to make HTTP requests for data retrieval.
This app uses a simple and organized architecture that separates the user interface from the application logic:
lib/main.dart: The main entry point of the app, whereBlocProviderandChangeNotifierProviderare initialized.lib/screens/: Contains the main screens of the app, such asuser_screen.dartand theuser_details.dartscreen.lib/cubits/: Contains theUsersCubitwhich manages the state of fetching users.lib/providers/: Contains theRandomUserProviderwhich handles data fetching.lib/widgets/: Contains reusable UI components likeUserItem.lib/services/: Contains theRandomUserServicewhich handles network-related tasks.
To get the app up and running on your machine, follow these steps:
- Clone the repository:
git clone [https://github.com/Ai-MAFlutter/simple-flutter-random-users](https://github.com/Ai-MAFlutter/simple-flutter-random-users)