skip to Main Content

how to remove appbar when run on web, but running with Anroid and IOS it’s display as normal.
please provide soution to me.

I try to add condition but it’s not working.

I wanna remove appbar on web.

2

Answers


  1. import 'package:flutter/foundation.dart';
    
    appBar: kIsWeb ? null : AppBar(title: const Text("AppBar"),),
    

    demo

    Login or Signup to reply.
  2. import 'package:flutter/foundation.dart' show kIsWeb;
    
    if (kIsWeb) {
       return AppBar(title: const Text("AppBar"),);
    } else {
       return Container();
    }
    

    ***************** OR *****************

    import 'package:flutter/foundation.dart' show kIsWeb;
    
    kIsWeb ? appBar: AppBar(title: const Text("AppBar"),) : null 
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search