Created
October 13, 2023 17:15
-
-
Save shekarsiri/2e4bcbf681fa209cef624e8e48cea04b to your computer and use it in GitHub Desktop.
flutter-strcuture
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Ensure we're in the right directory | |
if [ ! -d "./lib" ]; then | |
echo "This script should be run from the root of your Flutter project!" | |
exit 1 | |
fi | |
# Create core directories and files | |
mkdir -p core/constants | |
touch core/constants/api_constants.dart | |
mkdir -p core/utils | |
mkdir -p core/models | |
touch core/models/user.dart | |
mkdir -p core/blocs/login | |
touch core/blocs/login/login_bloc.dart | |
touch core/blocs/login/login_event.dart | |
touch core/blocs/login/login_state.dart | |
mkdir -p core/blocs/signup | |
touch core/blocs/signup/signup_bloc.dart | |
touch core/blocs/signup/signup_event.dart | |
touch core/blocs/signup/signup_state.dart | |
mkdir -p core/blocs/profile | |
touch core/blocs/profile/profile_bloc.dart | |
touch core/blocs/profile/profile_event.dart | |
touch core/blocs/profile/profile_state.dart | |
# Create data directories and files | |
mkdir -p data/repositories | |
touch data/repositories/user_repository.dart | |
mkdir -p data/services | |
touch data/services/api_service.dart | |
touch data/services/auth_service.dart | |
# Create presentation directories and files | |
mkdir -p presentation/screens/login | |
touch presentation/screens/login/login_screen.dart | |
mkdir -p presentation/screens/signup | |
touch presentation/screens/signup/signup_screen.dart | |
mkdir -p presentation/screens/profile | |
touch presentation/screens/profile/profile_screen.dart | |
mkdir presentation/widgets | |
mkdir presentation/themes | |
touch presentation/themes/app_theme.dart | |
# Feedback to user | |
echo "Directory and file structure created successfully!" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment