mirror of
https://github.com/SyncrowIOT/web.git
synced 2025-07-09 22:57:21 +00:00
make 4 elements in a row using crossAxisCount
This commit is contained in:
@ -38,8 +38,10 @@ class _HomeWebPageState extends State<HomeWebPage> {
|
||||
child: BlocConsumer<HomeBloc, HomeState>(
|
||||
listener: (BuildContext context, state) {
|
||||
if (state is HomeInitial) {
|
||||
if (homeBloc.user!.hasAcceptedWebAgreement == false && !_dialogShown) {
|
||||
_dialogShown = true; // Set the flag to true to indicate the dialog is showing.
|
||||
if (homeBloc.user!.hasAcceptedWebAgreement == false &&
|
||||
!_dialogShown) {
|
||||
_dialogShown =
|
||||
true; // Set the flag to true to indicate the dialog is showing.
|
||||
Future.delayed(const Duration(seconds: 1), () {
|
||||
showDialog(
|
||||
context: context,
|
||||
@ -98,8 +100,9 @@ class _HomeWebPageState extends State<HomeWebPage> {
|
||||
width: size.width * 0.68,
|
||||
child: GridView.builder(
|
||||
itemCount: homeBloc.homeItems.length,
|
||||
gridDelegate: const SliverGridDelegateWithFixedCrossAxisCount(
|
||||
crossAxisCount: 3, // Adjust as needed.
|
||||
gridDelegate:
|
||||
const SliverGridDelegateWithFixedCrossAxisCount(
|
||||
crossAxisCount: 4, // Adjust as needed.
|
||||
crossAxisSpacing: 20.0,
|
||||
mainAxisSpacing: 20.0,
|
||||
childAspectRatio: 1.5,
|
||||
@ -111,7 +114,8 @@ class _HomeWebPageState extends State<HomeWebPage> {
|
||||
active: homeBloc.homeItems[index].active!,
|
||||
name: homeBloc.homeItems[index].title!,
|
||||
img: homeBloc.homeItems[index].icon!,
|
||||
onTap: () => homeBloc.homeItems[index].onPress(context),
|
||||
onTap: () =>
|
||||
homeBloc.homeItems[index].onPress(context),
|
||||
);
|
||||
},
|
||||
),
|
||||
|
Reference in New Issue
Block a user