A Flutter application that generates random word pairs and allows users to save their favorites. The app features a clean Material Design interface and supports both mobile and desktop layouts.
- Random word pair generation
- Navigate through previous and next word pairs
- Save favorite word pairs
- Persistent storage of favorites
- Responsive design that adapts to different screen sizes
- Bottom navigation for mobile and navigation rail for desktop
Before you begin, ensure you have the following installed:
- Flutter (latest stable version)
- Dart (latest stable version)
- An IDE (VS Code, Android Studio, or IntelliJ)
This project relies on the following packages:
dependencies:
flutter:
sdk: flutter
english_words: ^4.0.0
provider: ^6.0.0
shared_preferences: ^2.0.0
dev_dependencies:
flutter_launcher_icons: ^0.13.1
- Clone the repository:
git clone [your-repository-url]
- Navigate to the project directory:
cd name_generator
- Install dependencies:
flutter pub get
- Run the app:
flutter run
The app consists of several key components:
MyApp
: The root widget that sets up the MaterialApp and themeMyAppState
: State management class using ProviderMyHomePage
: Main page with responsive layoutGenerateNamePage
: Page for generating and viewing word pairsFavoritesPage
: Page for viewing and managing saved favoritesBigCard
: Widget for displaying the current word pair
- Generates random word pairs using the english_words package
- Allows navigation through previous and next pairs
- Displays pairs in a visually appealing card format
- Save favorite word pairs with a like button
- View all favorites in a dedicated page
- Remove favorites with a delete button
- Persistent storage using SharedPreferences
- Automatically adapts layout based on screen width
- Uses NavigationRail for larger screens (>= 500px)
- Uses BottomNavigationBar for smaller screens (< 500px)
The app uses Material 3 theming with a custom color scheme. To modify the theme:
- Locate the following code in
MyApp
:
theme: ThemeData(
useMaterial3: true,
colorScheme: ColorScheme.fromSeed(
seedColor: const Color.fromARGB(255, 255, 34, 240)
),
)
- Modify the
seedColor
to change the app's color scheme
To build the release version of the app:
For Android:
flutter build apk --release
For iOS:
flutter build ios --release
The compiled application will be available in the build
directory.
Contributions are welcome! Please feel free to submit a Pull Request.
- Built with Flutter
- Uses the english_words package for word pair generation
- Provider package for state management
- SharedPreferences for persistent storage