Skip to content

Ai-MAFlutter/simple-flutter-random-users

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Simple Random Users App

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.

Features

  • 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_bloc and provider libraries to effectively manage the application's state.
  • Internet Connectivity: Uses the dio library to make HTTP requests for data retrieval.

Architecture

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, where BlocProvider and ChangeNotifierProvider are initialized.
  • lib/screens/: Contains the main screens of the app, such as user_screen.dart and the user_details.dart screen.
  • lib/cubits/: Contains the UsersCubit which manages the state of fetching users.
  • lib/providers/: Contains the RandomUserProvider which handles data fetching.
  • lib/widgets/: Contains reusable UI components like UserItem.
  • lib/services/: Contains the RandomUserService which handles network-related tasks.

How to Run

To get the app up and running on your machine, follow these steps:

  1. Clone the repository:
    git clone [https://github.com/Ai-MAFlutter/simple-flutter-random-users](https://github.com/Ai-MAFlutter/simple-flutter-random-users)

About

Displays user data, including name, email, and profile picture

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors