Untitled

 avatar
unknown
dart
3 years ago
3.8 kB
5
Indexable
emptyContainer('Organisasi', 'Tambah Data Organisasi',
                      'Tambahkan data organisasi', context)
//----------------------------------
Container emptyContainer(
    String header, String textButton, String desc, BuildContext context,) {
  final detailProfil = Get.put(DetailProfilController());

  return Container(
    width: MediaQuery.of(context).size.width,
    color: Colors.white,
    child: Padding(
      padding: const EdgeInsets.only(left: 16, top: 16, bottom: 16),
      child: Column(
        crossAxisAlignment: CrossAxisAlignment.start,
        children: [
          Text(
            header,
            style: TextStyle(
                fontWeight: FontWeight.w600,
                fontSize: 18.sp,
                color: Colors.black),
          ),
          SizedBox(
            height: 16.h,
          ),
          InkWell(
            onTap: () {
              buttomSheetTest(context);
            },
            child: Row(
              mainAxisAlignment: MainAxisAlignment.center,
              children: [
                Container(
                  height: 35,
                  alignment: Alignment.center,
                  child: Padding(
                    padding: const EdgeInsets.only(left: 5, right: 5),
                    child: Row(
                      children: [
                        Icon(
                          Icons.add_circle_outline,
                          color: Colors.white,
                        ),
                        SizedBox(
                          width: 10.w,
                        ),
                        Text(
                          textButton,
                          style: TextStyle(
                              fontWeight: FontWeight.w500,
                              fontSize: 14.sp,
                              color: Colors.white),
                        ),
                      ],
                    ),
                  ),
                  decoration: BoxDecoration(
                    borderRadius: BorderRadius.circular(15),
                    color: Color.fromRGBO(242, 34, 40, 1),
                    boxShadow: [
                      BoxShadow(
                          color: Color.fromRGBO(242, 34, 40, 1),
                          spreadRadius: 2),
                    ],
                  ),
                ),
              ],
            ),
          ),
          SizedBox(
            height: 16.h,
          ),
          Center(
            child: Text(
              desc,
              textAlign: TextAlign.center,
            ),
          )
        ],
      ),
    ),
  );
}

Future buttomSheetTest(BuildContext context) {
  return showMaterialModalBottomSheet(
      context: context,
      useRootNavigator: true,
      builder: (context) => Container(
          height: .85.sh,
          padding: EdgeInsets.fromLTRB(16.w, 16.h, 16.w, 0),
          child: Column(
            children: [Text('Hello')],
          )),
      shape: RoundedRectangleBorder(
          borderRadius: BorderRadius.only(
              topLeft: Radius.circular(16.r), topRight: Radius.circular(16.r))),
      backgroundColor: kGreyColor1);
}
Future buttomSheetTest2(BuildContext context) {
  return showMaterialModalBottomSheet(
      context: context,
      useRootNavigator: true,
      builder: (context) => Container(
          height: .85.sh,
          padding: EdgeInsets.fromLTRB(16.w, 16.h, 16.w, 0),
          child: Column(
            children: [Text('Hello')],
          )),
      shape: RoundedRectangleBorder(
          borderRadius: BorderRadius.only(
              topLeft: Radius.circular(16.r), topRight: Radius.circular(16.r))),
      backgroundColor: kGreyColor1);
}