EAS - PPB

 

 Evaluasi Akhir Semester

Nama    : Syaiful Bahri Dirgantara

NRP      : 5025201203

Kelas    : PPB F


Nama : Syaiful Bahri Dirgantara

NRP : 5025201203

Kelas : PPB - F


  1. Buat pertanyaan/problem yang akan diselesaikan

  • Membuat halaman landing

  • Membuat halaman login

  • Membuat halaman menu

  • Membuat halaman detail menu


  1. Buat spesifikasi dan deskripsi aplikasi yang mampu dibuat

  1. Spesifikasi halaman login

  • Input email

  • Input password

  1. Spesifikasi halaman menu

  • Menampilkan menu produk

  1. Spesifikasi halaman detail menu

  • Menampilkan detail menu produk


  1. Rancang design UI dan implementasi





  1. Implementasikan Rancangan

main.dart :
import 'package:flutter/material.dart';
import 'login.dart';

void main() {
  runApp(StarbucksApp());
}

class StarbucksApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Starbucks App',
      theme: ThemeData(
        primarySwatch: Colors.green,
      ),
      home: HomePage(),
    );
  }
}

class HomePage extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      body: SingleChildScrollView(
        child: Column(
          children: [
            SizedBox(height: 60),
            Image.asset('lib/assets/starbucks_logo.png',
                height: 100), // Add logo
            SizedBox(height: 40),
            Stack(
              children: [
                Image.asset('lib/assets/coffee_cup.png',
                    height: 200), // Add coffee cup image
              ],
            ),
            SizedBox(height: 40),
            Text(
              'Good Coffee',
              style: TextStyle(
                fontSize: 24,
                fontWeight: FontWeight.bold,
                color: Colors.green,
              ),
            ),
            Text(
              'Good Moods',
              style: TextStyle(
                fontSize: 24,
                fontWeight: FontWeight.bold,
              ),
            ),
            SizedBox(height: 20),
            Text(
              '“Experience the perfect blend of rich flavor and aroma with our premium coffee.”',
              textAlign: TextAlign.center,
              style: TextStyle(fontSize: 16),
            ),
            SizedBox(height: 40),
            ElevatedButton(
              onPressed: () {
                Navigator.push(
                  context,
                  MaterialPageRoute(builder: (context) => Login()),
                );
              },
              child: Text('Sign Up'),
              style: ElevatedButton.styleFrom(
                backgroundColor: Colors.black,
                foregroundColor: Colors.white,
                padding: EdgeInsets.symmetric(horizontal: 50, vertical: 15),
                textStyle: TextStyle(fontSize: 16),
              ),
            ),
            SizedBox(height: 20),
            TextButton(
              onPressed: () {},
              child: Text(
                'Already have an account? Log In',
                style: TextStyle(color: Colors.green),
              ),
            ),
          ],
        ),
      ),
    );
  }
}

login.dart :
import 'package:flutter/material.dart';
import 'menu.dart';

class Login extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      backgroundColor: Color(0xFFA3D8B0), // Warna latar belakang
      body: Center(
        child: Padding(
          padding: const EdgeInsets.all(16.0),
          child: Column(
            mainAxisAlignment: MainAxisAlignment.center,
            children: [
              Image.asset(
                'lib/assets/starbucks_logo.png', // Ganti dengan path logo Starbucks Anda
                height: 200,
              ),
              SizedBox(height: 50),
              TextField(
                decoration: InputDecoration(
                  hintText: 'Email',
                  hintStyle: TextStyle(color: Colors.green),
                  filled: true,
                  fillColor: Colors.white,
                  border: OutlineInputBorder(
                    borderRadius: BorderRadius.circular(10.0),
                    borderSide: BorderSide.none,
                  ),
                ),
              ),
              SizedBox(height: 20),
              TextField(
                obscureText: true,
                decoration: InputDecoration(
                  hintText: 'Pass',
                  hintStyle: TextStyle(color: Colors.black),
                  filled: true,
                  fillColor: Colors.white,
                  border: OutlineInputBorder(
                    borderRadius: BorderRadius.circular(10.0),
                    borderSide: BorderSide.none,
                  ),
                ),
              ),
              SizedBox(height: 40),
              ElevatedButton(
                onPressed: () {
                  Navigator.push(
                    context,
                    MaterialPageRoute(builder: (context) => Menu()),
                  );
                },
                style: ElevatedButton.styleFrom(
                  backgroundColor: Colors.black, // Warna background tombol
                  foregroundColor: Colors.white,
                  padding: EdgeInsets.symmetric(horizontal: 100, vertical: 15),
                  shape: RoundedRectangleBorder(
                    borderRadius: BorderRadius.circular(25.0),
                  ),
                ),
                child: Text('LOG IN'),
              ),
            ],
          ),
        ),
      ),
    );
  }
}

menu.dart :
import 'package:flutter/material.dart';

class Menu extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        backgroundColor: Colors.white,
        elevation: 0,
        leading: Icon(Icons.menu, color: Colors.black),
        actions: [
          Icon(Icons.notifications, color: Colors.black),
          SizedBox(width: 16),
        ],
      ),
      body: Padding(
        padding: const EdgeInsets.all(16.0),
        child: Column(
          crossAxisAlignment: CrossAxisAlignment.start,
          children: [
            Text(
              'Good Morning!',
              style: TextStyle(
                fontSize: 20,
                color: Colors.grey,
              ),
            ),
            Text(
              'Syaiful Bahri Dirgantara',
              style: TextStyle(
                fontSize: 22,
                fontWeight: FontWeight.bold,
              ),
            ),
            SizedBox(height: 16),
            TextField(
              decoration: InputDecoration(
                prefixIcon: Icon(Icons.search),
                hintText: 'Search',
                border: OutlineInputBorder(
                  borderRadius: BorderRadius.circular(30),
                  borderSide: BorderSide.none,
                ),
                filled: true,
                fillColor: Colors.grey[200],
              ),
            ),
            SizedBox(height: 16),
            Row(
              mainAxisAlignment: MainAxisAlignment.spaceAround,
              children: [
                _buildCategoryChip('Popular', true),
                _buildCategoryChip('Coffee', false),
                _buildCategoryChip('Tea', false),
                _buildCategoryChip('Drink', false),
              ],
            ),
            SizedBox(height: 16),
            Expanded(
              child: GridView.count(
                crossAxisCount: 2,
                crossAxisSpacing: 16,
                mainAxisSpacing: 16,
                children: [
                  _buildCoffeeCard('Cafe Latte', 4.5, 30, 'lib/assets/cup.png'),
                  _buildCoffeeCard('Americano', 4.3, 15, 'lib/assets/cup.png'),
                  _buildCoffeeCard('Chocolatte', 4.0, 28, 'lib/assets/cup.png'),
                  _buildCoffeeCard('Cappucino', 4.6, 30, 'lib/assets/cup.png'),
                ],
              ),
            ),
          ],
        ),
      ),
    );
  }

  Widget _buildCategoryChip(String label, bool isSelected) {
    return ChoiceChip(
      label: Text(label),
      selected: isSelected,
      onSelected: (bool selected) {},
      backgroundColor: Colors.grey[200],
      selectedColor: Colors.green,
      labelStyle: TextStyle(color: isSelected ? Colors.white : Colors.black),
    );
  }

  Widget _buildCoffeeCard(
      String name, double rating, int price, String imagePath) {
    return Container(
      decoration: BoxDecoration(
        color: Colors.green,
        borderRadius: BorderRadius.circular(16),
      ),
      child: Column(
        mainAxisAlignment: MainAxisAlignment.center,
        children: [
          Image.asset(imagePath, height: 75),
          SizedBox(height: 8),
          Text(
            name,
            style: TextStyle(
              fontSize: 18,
              color: Colors.white,
              fontWeight: FontWeight.bold,
            ),
          ),
          Text(
            '\$$price',
            style: TextStyle(
              fontSize: 16,
              color: Colors.white,
            ),
          ),
          Row(
            mainAxisAlignment: MainAxisAlignment.center,
            children: [
              Icon(Icons.star, color: Colors.yellow, size: 20),
              SizedBox(width: 4),
              Text(
                rating.toString(),
                style: TextStyle(
                  fontSize: 16,
                  color: Colors.white,
                ),
              ),
            ],
          ),
        ],
      ),
    );
  }
}

  1. Buat presentasi dan demo implementasi upload di Youtube, dan isi lembar monitoring

        link video : https://youtu.be/mg1Rqug6PUM

Komentar

Postingan populer dari blog ini

Tugas 7 - View Model & State in Compose

Tugas 6 - Image Scroll

Tugas 4 - Komponen Button