Day 7: Week 1 Review — Project Refactor and UI Login Progress
Sun, May 2025 19:20:49
Hello friends! Time flies, doesn’t it? We’ve already reached Day 7 of our coding journey this week. In this article, we’re going to do a week one review. The main focus is on the project refactoring process we started and, of course, a key milestone: "We’ve successfully built the login UI!" Cool, right?
Let’s break down the process together — why we needed a refactor, the step-by-step of building the login UI, and our plans moving forward. I wrote this article in a relaxed but in-depth style, so it feels like we’re chatting over coffee while talking code.
🚀 Why Refactor in the First Week?
The first week is all about laying the foundation. We’ve set up the project, created the initial structure, and started coding. But after 5-6 days of speed-coding, there are usually some things that need cleaning up:
- File naming isn’t consistent
- Folder structure is messy
- Code is still “trial & error”, not clean yet
So, refactoring on Day 7 is crucial to make our project more scalable and maintainable in the future. We don’t want to be confused looking for files or functions three weeks from now. 😅
🔧 What Did We Refactor?
Folder Structure:
- Before:
lib/screens,lib/widgets,lib/pages - After refactor:
lib/features/auth,lib/common,lib/core
We’re using a feature-based structure. So everything related to auth (login, register, etc.) is in one folder:
features/auth. It’s more modular and easier to maintain.- Before:
- File Naming:
- From:
loginPage.darttologin_page.dart - Following Flutter-style snake_case naming convention for consistency
- From:
- State Management:
- Started separating
StatefulWidgetfrom its logic - Began using
providerto store login state (still basic)
- Started separating
- Theme and Styling:
- Moved colors and text styles to a single
theme.dartfile - To avoid repeating
TextStyle(... fontSize: 16)everywhere
- Moved colors and text styles to a single
🎨 This Week’s Progress: Building the Login UI
Finally, we’ve built the login UI! It might be simple, but it’s a huge milestone since login is the gateway to all other features.
🧩 UI Design
Our login UI includes the following components:
- Top logo/illustration
- Email input
- Password input
- Login button
- "Forgot password" and "Don’t have an account? Register" links
The design is simple, modern, and responsive.
📱 Login UI Implementation
class LoginPage extends StatelessWidget {
const LoginPage({super.key});
@override
Widget build(BuildContext context) {
return Scaffold(
body: Padding(
padding: const EdgeInsets.all(24.0),
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Text('Login', style: Theme.of(context).textTheme.headlineMedium),
const SizedBox(height: 32),
TextField(
decoration: InputDecoration(
labelText: 'Email',
border: OutlineInputBorder(),
),
),
const SizedBox(height: 16),
TextField(
obscureText: true,
decoration: InputDecoration(
labelText: 'Password',
border: OutlineInputBorder(),
),
),
const SizedBox(height: 24),
ElevatedButton(
onPressed: () {},
child: const Text('Login'),
),
TextButton(
onPressed: () {},
child: const Text('Forgot password?'),
),
TextButton(
onPressed: () {},
child: const Text('Don’t have an account? Register'),
)
],
),
),
);
}
}
Easy to understand, readable, and simple to modify later.
💡 Tips from the Process:
- Use
constwherever possible for performance - Think about padding and spacing from the start
- Test on multiple device/emulator screen sizes
📋 Weekly Progress Recap
Here’s a summary of our progress in week one:
| Day | Focus | Status |
|---|---|---|
| 1 | Project setup + folder struct | ✅ Done |
| 2 | Basic UI creation | ✅ Done |
| 3 | Build login screen | ✅ Done |
| 4 | Add simple navigation | ✅ Done |
| 5 | Connect to mock backend | ⚠️ Still dummy |
| 6 | Fix padding/layout bugs | ✅ Done |
| 7 | Refactor + Review | ✅ Done |
This progress checklist is important for tracking development and keeping motivation high. Don’t forget to review every week!
🧭 Next Week’s Plan
What’s our goal for the second week?
- Backend integration (login):
- Try connecting to an API
- Store user token
- Form Validation:
- Check email format, empty password, etc.
- Cleaner State Management:
- Use
Provideror advancedRiverpod
- Use
- Try SharedPreferences:
- Save login status locally
- Start Home Page after successful login
🔁 Closing Thoughts: Learning Is Iterative
The first week isn’t about perfection. It’s about trying, failing, refactoring, learning, and repeating. Refactoring is part of learning. The login UI may look simple, but it’s a stepping stone to more complex features.
Stay consistent, evaluate, and enjoy the journey. Coding isn’t just about the end result—it’s about how we grow with the code we write.
See you in week two!