Untitled

 avatar
unknown
plain_text
2 years ago
6.0 kB
5
Indexable
import 'package:bubble_bottom_bar/bubble_bottom_bar.dart';
import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:task_application/src/home_controller.dart';

class HomeScreen extends StatelessWidget {
  HomeScreen({super.key});
  final HomeController homeController = Get.put(HomeController());

  @override
  Widget build(BuildContext context) {
    return GetBuilder<HomeController>(
        init: homeController,
        builder: (controller) {
          return Scaffold(
            body: SafeArea(
              child: Container(
                color: Colors.white,
                height: double.infinity,
                width: double.infinity,
                child: SingleChildScrollView(
                  physics: const AlwaysScrollableScrollPhysics(),
                  padding: const EdgeInsets.symmetric(
                    horizontal: 25,
                    vertical: 30,
                  ),
                  // child: SingleChildScrollView(
                  child: Column(
                    children: [
                      SizedBox(
                        height: 50,
                        child: ElevatedButton(
                          style: ElevatedButton.styleFrom(
                            backgroundColor:
                                const Color.fromARGB(255, 228, 228, 228),
                            // elevation: 5,
                            shape: RoundedRectangleBorder(
                              borderRadius: BorderRadius.circular(28),
                            ),
                          ),
                          onPressed: (() {}),
                          child: Row(
                            children: const [
                              Icon(
                                Icons.search,
                                color: Colors.black,
                              ),
                              SizedBox(
                                width: 10,
                              ),
                              Text(
                                'Search Categories',
                                style: TextStyle(
                                  color: Color.fromARGB(255, 115, 113, 113),
                                  fontSize: 15,
                                ),
                              ),
                            ],
                          ),
                        ),
                      ),
                      const SizedBox(
                        height: 10,
                      ),
                      ListView.builder(
                        shrinkWrap: true,
                        itemCount: 5,
                        // homeController.res.total,
                        physics: const NeverScrollableScrollPhysics(),
                        itemBuilder: (context, index) {
                          return Padding(
                            padding: const EdgeInsets.symmetric(vertical: 10),
                            child: Container(
                              height: 120,
                              decoration: BoxDecoration(
                                borderRadius: BorderRadius.circular(20.0),
                                color: Color.fromARGB(255, 143, 140, 140),
                              ),
                            ),
                          );
                        },
                      )
                    ],
                  ),
                  // ),
                ),
              ),
            ),
            bottomNavigationBar: BubbleBottomBar(
              hasNotch: true,
              hasInk: false,
              fabLocation: BubbleBottomBarFabLocation.end,
              opacity: .2,
              currentIndex: homeController.currentIndex,
              onTap: homeController.changePage(),
              borderRadius: BorderRadius.vertical(
                top: Radius.circular(16),
              ),
              elevation: 8,
              tilesPadding: EdgeInsets.symmetric(
                vertical: 8.0,
              ),
              items: const <BubbleBottomBarItem>[
                BubbleBottomBarItem(
                  icon: Icon(
                    Icons.home,
                    color: Colors.black,
                  ),
                  activeIcon: Icon(
                    Icons.home,
                    color: Color.fromARGB(255, 124, 124, 124),
                  ),
                  title: Text("Home"),
                ),
                BubbleBottomBarItem(
                    backgroundColor: Color.fromARGB(255, 114, 114, 114),
                    icon: Icon(
                      Icons.luggage,
                      color: Colors.black,
                    ),
                    activeIcon: Icon(
                      Icons.luggage,
                      color: Color.fromARGB(255, 111, 111, 111),
                    ),
                    title: Text("category")),
                BubbleBottomBarItem(
                    backgroundColor: Colors.indigo,
                    icon: Icon(
                      Icons.notifications,
                      color: Colors.black,
                    ),
                    activeIcon: Icon(
                      Icons.notifications,
                      color: Color.fromARGB(255, 123, 123, 124),
                    ),
                    title: Text("notification")),
                BubbleBottomBarItem(
                    backgroundColor: Colors.green,
                    icon: Icon(
                      Icons.person,
                      color: Colors.black,
                    ),
                    activeIcon: Icon(
                      Icons.person,
                      color: Color.fromARGB(255, 137, 139, 137),
                    ),
                    title: Text("profile"))
              ],
            ),
          );
        });
  }
}
Editor is loading...