Md Mominul Islam | Software and Data Enginnering | SQL Server, .NET, Power BI, Azure Blog

while(!(succeed=try()));

LinkedIn Portfolio Banner

Latest

Home Top Ad

Responsive Ads Here

Post Top Ad

Responsive Ads Here

Sunday, September 7, 2025

Top 150+ Flutter Mobile App Development Interview Questions

 

Table of Contents

  1. Beginner-Level Questions

  2. Intermediate-Level Questions

  3. Expert-Level Questions

  4. Conclusion


Beginner-Level Questions

These questions cover foundational Flutter concepts, Dart basics, and core principles for entry-level candidates.

Flutter Mobile App Development (Beginner)

  1. What is Flutter, and why is it used for mobile app development?

    • Type: Basic Understanding

    • Expected Answer: Flutter is Google’s UI toolkit for building natively compiled apps for mobile, web, and desktop from a single codebase.

    • Example: A Flutter app runs on both iOS and Android with one code.

  2. What is Dart, and how does it relate to Flutter?

    • Type: Conceptual

    • Expected Answer: Dart is the programming language used by Flutter for its client-optimized, object-oriented features.

  3. What is a widget in Flutter?

    • Type: Basic Understanding

    • Expected Answer: Widgets are UI components in Flutter, forming the building blocks of the interface.

    • Example:

      Text('Hello, Flutter!')
  4. What is the difference between StatelessWidget and StatefulWidget?

    • Type: Conceptual

    • Expected Answer: StatelessWidget is immutable, while StatefulWidget manages dynamic state.

    • Example:

      class MyWidget extends StatelessWidget {
        @override
        Widget build(BuildContext context) {
          return Text('Static');
        }
      }
  5. What is the role of the build method in Flutter?

    • Type: Basic Understanding

    • Expected Answer: The build method describes the UI as a function of the widget’s state.

    • Example:

      Widget build(BuildContext context) {
        return Scaffold(body: Text('Hello'));
      }
  6. What is the purpose of the pubspec.yaml file in Flutter?

    • Type: Conceptual

    • Expected Answer: pubspec.yaml manages dependencies, assets, and app metadata.

    • Example:

      dependencies:
        flutter:
          sdk: flutter
        http: ^0.13.4
  7. What is a MaterialApp widget in Flutter?

    • Type: Basic Understanding

    • Expected Answer: MaterialApp provides a Material Design structure with navigation and theming.

    • Example:

      MaterialApp(
        home: Scaffold(appBar: AppBar(title: Text('My App')))
      )
  8. What is the difference between main.dart and other Dart files?

    • Type: Conceptual

    • Expected Answer: main.dart is the entry point of a Flutter app, containing the main function.

  9. What is the role of the Scaffold widget?

    • Type: Basic Understanding

    • Expected Answer: Scaffold provides a basic app structure with app bar, body, and drawer.

    • Example:

      Scaffold(
        appBar: AppBar(title: Text('Home')),
        body: Center(child: Text('Welcome'))
      )
  10. What is hot reload in Flutter, and how does it work?

    • Type: Conceptual

    • Expected Answer: Hot reload updates the UI without restarting the app, preserving state.

  11. What is the purpose of the Column and Row widgets?

    • Type: Basic Understanding

    • Expected Answer: Column arranges children vertically, Row horizontally.

    • Example:

      Column(
        children: [Text('Item 1'), Text('Item 2')]
      )
  12. What is a Text widget in Flutter?

    • Type: Basic Understanding

    • Expected Answer: Text displays a string with customizable styling.

    • Example:

      Text('Hello', style: TextStyle(fontSize: 20))
  13. What is the role of the setState method?

    • Type: Conceptual

    • Expected Answer: setState triggers a UI rebuild when state changes.

    • Example:

      setState(() {
        counter++;
      });
  14. What is the difference between Expanded and Flexible widgets?

    • Type: Conceptual

    • Expected Answer: Expanded forces a child to take available space, Flexible allows flexibility.

    • Example:

      Expanded(child: Text('Expanded'))
  15. What is the purpose of the GestureDetector widget?

    • Type: Basic Understanding

    • Expected Answer: GestureDetector detects user gestures like taps or swipes.

    • Example:

      GestureDetector(
        onTap: () => print('Tapped'),
        child: Text('Tap me')
      )
  16. What is a Flutter package, and how is it used?

    • Type: Conceptual

    • Expected Answer: Packages are reusable libraries added via pubspec.yaml.

    • Example:

      dependencies:
        provider: ^6.0.0
  17. What is the role of the Navigator in Flutter?

    • Type: Basic Understanding

    • Expected Answer: Navigator manages a stack of routes for screen navigation.

    • Example:

      Navigator.push(context, MaterialPageRoute(builder: (context) => SecondScreen()));
  18. What is the difference between push and pop in Flutter navigation?

    • Type: Conceptual

    • Expected Answer: push adds a route to the stack, pop removes the top route.

  19. What is the purpose of the AppBar widget?

    • Type: Basic Understanding

    • Expected Answer: AppBar provides a top bar with title, actions, and navigation.

    • Example:

      AppBar(title: Text('My App'))
  20. What is the role of the async and await keywords in Dart?

    • Type: Conceptual

    • Expected Answer: async marks a function as asynchronous, await pauses execution for a future.

    • Example:

      Future<String> fetchData() async {
        await Future.delayed(Duration(seconds: 1));
        return 'Data';
      }

Intermediate-Level Questions

These questions target candidates with 2–5 years of experience, focusing on practical scenarios, state management, and advanced Flutter features.

Flutter Mobile App Development (Intermediate)

  1. How do you implement state management in Flutter?

    • Type: Practical

    • Expected Answer: Use setState, Provider, or Riverpod for managing state.

    • Example:

      class CounterProvider extends ChangeNotifier {
        int _counter = 0;
        int get counter => _counter;
        void increment() {
          _counter++;
          notifyListeners();
        }
      }
  2. What is the Provider package, and how is it used?

    • Type: Conceptual

    • Expected Answer: Provider is a state management library for dependency injection and state updates.

    • Example:

      Provider.of<CounterProvider>(context).increment();
  3. How do you handle navigation with named routes in Flutter?

    • Type: Practical

    • Expected Answer: Define routes in MaterialApp and use Navigator.pushNamed.

    • Example:

      MaterialApp(
        routes: {
          '/second': (context) => SecondScreen(),
        },
      )
      Navigator.pushNamed(context, '/second');
  4. What is the difference between Future and Stream in Dart?

    • Type: Conceptual

    • Expected Answer: Future returns a single value, Stream emits multiple values over time.

    • Example:

      Stream<int> countStream() async* {
        for (int i = 0; i < 5; i++) yield i;
      }
  5. How do you implement a ListView in Flutter?

    • Type: Coding Challenge

    • Expected Answer:

      ListView.builder(
        itemCount: items.length,
        itemBuilder: (context, index) => ListTile(title: Text(items[index])),
      )
  6. What is the role of the InheritedWidget in Flutter?

    • Type: Conceptual

    • Expected Answer: InheritedWidget shares data down the widget tree.

    • Example:

      class MyInheritedWidget extends InheritedWidget {
        final int data;
        MyInheritedWidget({required this.data, required Widget child}) : super(child: child);
        @override
        bool updateShouldNotify(covariant MyInheritedWidget oldWidget) => data != oldWidget.data;
      }
  7. How do you handle HTTP requests in Flutter?

    • Type: Practical

    • Expected Answer: Use the http package for API calls.

    • Example:

      import 'package:http/http.dart' as http;
      Future fetchData() async {
        final response = await http.get(Uri.parse('https://api.example.com'));
        return response.body;
      }
  8. What is the purpose of the SafeArea widget?

    • Type: Conceptual

    • Expected Answer: SafeArea ensures content is not obscured by system UI like notches.

    • Example:

      SafeArea(child: Text('Content'))
  9. How do you implement a custom widget in Flutter?

    • Type: Coding Challenge

    • Expected Answer:

      class CustomButton extends StatelessWidget {
        final String text;
        CustomButton({required this.text});
        @override
        Widget build(BuildContext context) {
          return ElevatedButton(child: Text(text), onPressed: () {});
        }
      }
  10. What is the difference between hot reload and hot restart?

    • Type: Conceptual

    • Expected Answer: Hot reload updates UI without losing state, hot restart resets the app.

  11. How do you implement animations in Flutter?

    • Type: Practical

    • Expected Answer: Use AnimationController and AnimatedWidget.

    • Example:

      AnimationController controller;
      Animation<double> animation = Tween<double>(begin: 0, end: 1).animate(controller);
  12. What is the role of the FutureBuilder widget?

    • Type: Conceptual

    • Expected Answer: FutureBuilder builds UI based on the state of a Future.

    • Example:

      FutureBuilder(
        future: fetchData(),
        builder: (context, snapshot) => snapshot.hasData ? Text(snapshot.data) : CircularProgressIndicator(),
      )
  13. How do you handle form validation in Flutter?

    • Type: Practical

    • Expected Answer: Use Form and TextFormField with validators.

    • Example:

      Form(
        key: _formKey,
        child: TextFormField(
          validator: (value) => value.isEmpty ? 'Required' : null,
        ),
      )
  14. What is the purpose of the StreamBuilder widget?

    • Type: Conceptual

    • Expected Answer: StreamBuilder builds UI based on Stream events.

    • Example:

      StreamBuilder(
        stream: countStream(),
        builder: (context, snapshot) => Text('${snapshot.data}'),
      )
  15. How do you implement dependency injection in Flutter?

    • Type: Practical

    • Expected Answer: Use Provider or GetIt for dependency injection.

    • Example:

      final locator = GetIt.instance;
      locator.registerSingleton<AuthService>(AuthService());
  16. What is the role of the ThemeData class in Flutter?

    • Type: Conceptual

    • Expected Answer: ThemeData defines app-wide visual styling.

    • Example:

      ThemeData(primarySwatch: Colors.blue)
  17. How do you implement a responsive UI in Flutter?

    • Type: Practical

    • Expected Answer: Use MediaQuery or LayoutBuilder.

    • Example:

      LayoutBuilder(
        builder: (context, constraints) => constraints.maxWidth > 600 ? Row() : Column(),
      )
  18. What is the difference between Material and Cupertino widgets?

    • Type: Conceptual

    • Expected Answer: Material follows Google’s design, Cupertino follows Apple’s.

  19. How do you handle errors in asynchronous Flutter code?

    • Type: Practical

    • Expected Answer: Use try-catch with Futures or Streams.

    • Example:

      try {
        await fetchData();
      } catch (e) {
        print('Error: $e');
      }
  20. What is the purpose of the flutter run command?

    • Type: Conceptual

    • Expected Answer: Runs the Flutter app on a connected device or emulator.


Expert-Level Questions

These questions challenge senior developers with complex scenarios, advanced Flutter features, and performance optimization.

Flutter Mobile App Development (Expert)

  1. How do you optimize Flutter app performance?

    • Type: Scenario-Based

    • Expected Answer: Use const constructors, minimize rebuilds, and profile with DevTools.

    • Example:

      const Text('Static Text')
  2. What is the role of the BuildContext in Flutter?

    • Type: Conceptual

    • Expected Answer: BuildContext provides widget tree context for accessing ancestors and services.

  3. How do you implement a custom render object in Flutter?

    • Type: Coding Challenge

    • Expected Answer:

      class CustomRenderObject extends RenderBox {
        @override
        void performLayout() {
          size = constraints.biggest;
        }
      }
  4. What is the difference between ChangeNotifier and ValueNotifier?

    • Type: Conceptual

    • Expected Answer: ChangeNotifier is for complex state, ValueNotifier for single values.

    • Example:

      ValueNotifier<int> counter = ValueNotifier(0);
  5. How do you implement platform channels in Flutter?

    • Type: Practical

    • Expected Answer: Use MethodChannel for native communication.

    • Example:

      static const platform = MethodChannel('my_channel');
      String result = await platform.invokeMethod('getData');
  6. What is the role of the Sliver widgets in Flutter?

    • Type: Conceptual

    • Expected Answer: Slivers enable custom scrollable layouts like SliverList.

    • Example:

      CustomScrollView(
        slivers: [SliverList(delegate: SliverChildListDelegate([Text('Item')]))],
      )
  7. How do you handle state persistence in Flutter?

    • Type: Scenario-Based

    • Expected Answer: Use SharedPreferences or SQLite for persistent storage.

    • Example:

      SharedPreferences prefs = await SharedPreferences.getInstance();
      await prefs.setInt('counter', 10);
  8. What is the difference between Bloc and Provider for state management?

    • Type: Conceptual

    • Expected Answer: Bloc uses streams for complex state, Provider is simpler for dependency injection.

  9. How do you implement deep linking in Flutter?

    • Type: Practical

    • Expected Answer: Use uni_links or go_router for deep linking.

    • Example:

      StreamSubscription? _sub = uriLinkStream.listen((Uri? uri) {
        Navigator.pushNamed(context, uri!.path);
      });
  10. What is the role of the RepaintBoundary widget?

    • Type: Conceptual

    • Expected Answer: RepaintBoundary isolates repaints to optimize performance.

    • Example:

      RepaintBoundary(child: CustomPaint())
  11. How do you implement internationalization (i18n) in Flutter?

    • Type: Practical

    • Expected Answer: Use intl package and .arb files.

    • Example:

      AppLocalizations.of(context)!.helloWorld
  12. What is the difference between AnimatedBuilder and AnimatedWidget?

    • Type: Conceptual

    • Expected Answer: AnimatedBuilder is for custom animations, AnimatedWidget is a base class.

  13. How do you handle push notifications in Flutter?

    • Type: Scenario-Based

    • Expected Answer: Use firebase_messaging for push notifications.

    • Example:

      FirebaseMessaging.onMessage.listen((RemoteMessage message) {
        print('Got a message: ${message.notification?.title}');
      });
  14. What is the role of the flutter doctor command?

    • Type: Conceptual

    • Expected Answer: Diagnoses Flutter setup issues and dependencies.

  15. How do you implement a custom scroll behavior in Flutter?

    • Type: Coding Challenge

    • Expected Answer:

      class CustomScrollBehavior extends ScrollBehavior {
        @override
        Widget buildViewportChrome(BuildContext context, Widget child, AxisDirection axisDirection) {
          return child;
        }
      }
  16. What is the difference between async and Future in Dart?

    • Type: Conceptual

    • Expected Answer: async marks a function, Future represents a future value.

  17. How do you optimize image loading in Flutter?

    • Type: Scenario-Based

    • Expected Answer: Use cached_network_image or Image.asset with proper sizing.

    • Example:

      CachedNetworkImage(imageUrl: 'https://example.com/image.jpg')
  18. What is the role of the Key class in Flutter?

    • Type: Conceptual

    • Expected Answer: Keys preserve widget identity across rebuilds.

    • Example:

      Container(key: ValueKey('unique'), child: Text('Keyed'))
  19. How do you implement a custom theme in Flutter?

    • Type: Practical

    • Expected Answer: Extend ThemeData and apply it in MaterialApp.

    • Example:

      ThemeData(
        primaryColor: Colors.blue,
        textTheme: TextTheme(bodyText2: TextStyle(fontSize: 16)),
      )
  20. What is the difference between SingleChildScrollView and ListView?

    • Type: Conceptual

    • Expected Answer: SingleChildScrollView is for single children, ListView for lists.

  21. How do you implement unit testing in Flutter?

    • Type: Practical

    • Expected Answer: Use flutter_test for unit tests.

    • Example:

      test('Counter increments', () {
        expect(counter.increment(), 1);
      });
  22. What is the role of the InheritedNotifier widget?

    • Type: Conceptual

    • Expected Answer: InheritedNotifier shares notifier updates down the widget tree.

  23. How do you handle app lifecycle events in Flutter?

    • Type: Practical

    • Expected Answer: Use WidgetsBindingObserver to listen for lifecycle events.

    • Example:

      class MyWidget extends StatefulWidget {
        @override
        _MyWidgetState createState() => _MyWidgetState();
      }
      class _MyWidgetState extends State<MyWidget> with WidgetsBindingObserver {
        @override
        void didChangeAppLifecycleState(AppLifecycleState state) {
          print('State: $state');
        }
      }
  24. What is the difference between Bloc and Redux in Flutter?

    • Type: Conceptual

    • Expected Answer: Bloc uses streams, Redux uses a single store.

  25. How do you implement a custom painter in Flutter?

    • Type: Coding Challenge

    • Expected Answer:

      class CustomPainter extends CustomPainter {
        @override
        void paint(Canvas canvas, Size size) {
          canvas.drawCircle(Offset(0, 0), 50, Paint());
        }
        @override
        bool shouldRepaint(covariant CustomPainter oldDelegate) => false;
      }
  26. What is the role of the flutter analyze command?

    • Type: Conceptual

    • Expected Answer: Analyzes code for errors and warnings.

  27. How do you handle background tasks in Flutter?

    • Type: Scenario-Based

    • Expected Answer: Use Workmanager or platform channels for background tasks.

    • Example:

      Workmanager().registerOneOffTask('task', 'task');
  28. What is the difference between Stack and Positioned widgets?

    • Type: Conceptual

    • Expected Answer: Stack layers widgets, Positioned sets their positions.

  29. How do you implement a splash screen in Flutter?

    • Type: Practical

    • Expected Answer: Use flutter_native_splash or a custom widget.

    • Example:

      flutter_native_splash:
        color: "#ffffff"
        image: assets/splash.png
  30. What is the role of the flutter clean command?

    • Type: Conceptual

    • Expected Answer: Removes build artifacts to resolve build issues.

  31. How do you implement a grid layout in Flutter?

    • Type: Coding Challenge

    • Expected Answer:

      GridView.builder(
        gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(crossAxisCount: 2),
        itemBuilder: (context, index) => Card(child: Text('Item $index')),
      )
  32. What is the difference between Consumer and Provider.of in the Provider package?

    • Type: Conceptual

    • Expected Answer: Consumer rebuilds specific widgets, Provider.of accesses the provider.

  33. How do you handle device orientation in Flutter?

    • Type: Practical

    • Expected Answer: Use OrientationBuilder or SystemChrome.setPreferredOrientations.

    • Example:

      OrientationBuilder(
        builder: (context, orientation) => orientation == Orientation.portrait ? Text('Portrait') : Text('Landscape'),
      )
  34. What is the role of the flutter pub get command?

    • Type: Conceptual

    • Expected Answer: Fetches dependencies listed in pubspec.yaml.

  35. How do you implement a tabbed interface in Flutter?

    • Type: Coding Challenge

    • Expected Answer:

      DefaultTabController(
        length: 3,
        child: Scaffold(
          appBar: AppBar(
            bottom: TabBar(tabs: [Tab(text: 'Tab 1'), Tab(text: 'Tab 2'), Tab(text: 'Tab 3')]),
          ),
          body: TabBarView(children: [Text('Page 1'), Text('Page 2'), Text('Page 3')]),
        ),
      )
  36. What is the difference between setState and ValueListenableBuilder?

    • Type: Conceptual

    • Expected Answer: setState rebuilds the entire widget, ValueListenableBuilder rebuilds specific parts.

  37. How do you handle file storage in Flutter?

    • Type: Practical

    • Expected Answer: Use path_provider for file access.

    • Example:

      final directory = await getApplicationDocumentsDirectory();
      File('${directory.path}/data.txt').writeAsString('Hello');
  38. What is the role of the flutter build command?

    • Type: Conceptual

    • Expected Answer: Builds the app for deployment (e.g., APK, IPA).

  39. How do you implement a custom scroll physics in Flutter?

    • Type: Coding Challenge

    • Expected Answer:

      class CustomScrollPhysics extends ScrollPhysics {
        @override
        ScrollPhysics applyTo(ScrollPhysics? ancestor) {
          return CustomScrollPhysics();
        }
      }
  40. What is the difference between Opacity and Visibility widgets?

    • Type: Conceptual

    • Expected Answer: Opacity changes transparency, Visibility toggles widget rendering.

  41. How do you implement Firebase authentication in Flutter?

    • Type: Practical

    • Expected Answer: Use firebase_auth for user authentication.

    • Example:

      await FirebaseAuth.instance.signInWithEmailAndPassword(
        email: 'user@example.com',
        password: 'password',
      );
  42. What is the role of the flutter test command?

    • Type: Conceptual

    • Expected Answer: Runs unit and widget tests.

  43. How do you implement a custom app icon in Flutter?

    • Type: Practical

    • Expected Answer: Use flutter_launcher_icons in pubspec.yaml.

    • Example:

      flutter_launcher_icons:
        image_path: "assets/icon.png"
  44. What is the difference between InheritedWidget and Provider?

    • Type: Conceptual

    • Expected Answer: Provider simplifies InheritedWidget for state management.

  45. How do you implement a pull-to-refresh feature in Flutter?

    • Type: Coding Challenge

    • Expected Answer:

      RefreshIndicator(
        onRefresh: () async => await fetchData(),
        child: ListView(),
      )
  46. What is the role of the flutter upgrade command?

    • Type: Conceptual

    • Expected Answer: Upgrades Flutter SDK to the latest version.

  47. How do you handle app localization in Flutter?

    • Type: Practical

    • Expected Answer: Use flutter_localizations and .arb files.

    • Example:

      Localizations.localeOf(context)
  48. What is the difference between FutureBuilder and StreamBuilder?

    • Type: Conceptual

    • Expected Answer: FutureBuilder handles single async results, StreamBuilder handles streams.

  49. How do you implement a custom navigation transition in Flutter?

    • Type: Coding Challenge

    • Expected Answer:

      Navigator.push(
        context,
        PageRouteBuilder(
          pageBuilder: (context, animation, _) => SecondScreen(),
          transitionsBuilder: (context, animation, _, child) => FadeTransition(opacity: animation, child: child),
        ),
      )
  50. What is the role of the flutter create command?

    • Type: Conceptual

    • Expected Answer: Creates a new Flutter project.

  51. How do you implement a background fetch in Flutter?

    • Type: Practical

    • Expected Answer: Use Workmanager or native platform code.

    • Example:

      Workmanager().registerPeriodicTask('fetch', 'fetchTask');
  52. What is the difference between const and final in Dart?

    • Type: Conceptual

    • Expected Answer: const is compile-time constant, final is runtime constant.

  53. How do you implement a custom error widget in Flutter?

    • Type: Coding Challenge

    • Expected Answer:

      ErrorWidget.builder = (FlutterErrorDetails details) => Center(child: Text('Error: ${details.exception}'));
  54. What is the role of the flutter packages get command?

    • Type: Conceptual

    • Expected Answer: Alias for flutter pub get to fetch dependencies.

  55. How do you handle memory leaks in Flutter?

    • Type: Scenario-Based

    • Expected Answer: Use dispose methods and profile with DevTools.

    • Example:

      @override
      void dispose() {
        controller.dispose();
        super.dispose();
      }
  56. What is the difference between MaterialApp and WidgetsApp?

    • Type: Conceptual

    • Expected Answer: MaterialApp includes Material Design, WidgetsApp is a basic app wrapper.

  57. How do you implement a custom dialog in Flutter?

    • Type: Coding Challenge

    • Expected Answer:

      showDialog(
        context: context,
        builder: (context) => AlertDialog(
          title: Text('Custom Dialog'),
          content: Text('Content'),
          actions: [TextButton(child: Text('OK'), onPressed: () => Navigator.pop(context))],
        ),
      )
  58. What is the role of the flutter run --release command?

    • Type: Conceptual

    • Expected Answer: Runs the app in release mode for optimized performance.

  59. How do you implement a custom loading indicator in Flutter?

    • Type: Practical

    • Expected Answer: Create a custom widget or use CircularProgressIndicator.

    • Example:

      CircularProgressIndicator(valueColor: AlwaysStoppedAnimation<Color>(Colors.blue))
  60. What is the difference between BlocProvider and MultiBlocProvider?

    • Type: Conceptual

    • Expected Answer: BlocProvider manages one Bloc, MultiBlocProvider manages multiple.

  61. How do you implement a search feature in Flutter?

    • Type: Coding Challenge

    • Expected Answer:

      TextField(
        onChanged: (value) => setState(() => filteredItems = items.where((item) => item.contains(value)).toList()),
      )
  62. What is the role of the flutter doctor --verbose command?

    • Type: Conceptual

    • Expected Answer: Provides detailed diagnostics for Flutter setup.

  63. How do you handle accessibility in Flutter?

    • Type: Practical

    • Expected Answer: Use Semantics and test with screen readers.

    • Example:

      Semantics(
        label: 'Button',
        child: ElevatedButton(child: Text('Click'), onPressed: () {}),
      )
  64. What is the difference between StatelessWidget and StatefulWidget lifecycle?

    • Type: Conceptual

    • Expected Answer: StatefulWidget has lifecycle methods like initState and dispose.

  65. How do you implement a custom bottom navigation bar in Flutter?

    • Type: Coding Challenge

    • Expected Answer:

      BottomNavigationBar(
        items: [
          BottomNavigationBarItem(icon: Icon(Icons.home), label: 'Home'),
          BottomNavigationBarItem(icon: Icon(Icons.settings), label: 'Settings'),
        ],
        onTap: (index) => setState(() => currentIndex = index),
      )
  66. What is the role of the flutter pub outdated command?

    • Type: Conceptual

    • Expected Answer: Lists outdated dependencies in the project.

  67. How do you implement a dark mode toggle in Flutter?

    • Type: Practical

    • Expected Answer: Use ThemeMode and Provider for theme switching.

    • Example:

      MaterialApp(
        themeMode: Provider.of<ThemeProvider>(context).themeMode,
        theme: ThemeData.light(),
        darkTheme: ThemeData.dark(),
      )
  68. What is the difference between dispose and deactivate in Flutter?

    • Type: Conceptual

    • Expected Answer: dispose cleans up resources, deactivate runs before widget removal.

  69. How do you implement a custom font in Flutter?

    • Type: Practical

    • Expected Answer: Add fonts to pubspec.yaml and use TextStyle.

    • Example:

      flutter:
        fonts:
          - family: CustomFont
            fonts:
              - asset: fonts/CustomFont.ttf
  70. What is the role of the flutter format command?

    • Type: Conceptual

    • Expected Answer: Formats Dart code to follow style guidelines.

  71. How do you implement a carousel slider in Flutter?

    • Type: Coding Challenge

    • Expected Answer:

      CarouselSlider(
        items: images.map((image) => Image.network(image)).toList(),
        options: CarouselOptions(autoPlay: true),
      )
  72. What is the difference between ValueKey and ObjectKey?

    • Type: Conceptual

    • Expected Answer: ValueKey uses a value, ObjectKey uses object identity.

  73. How do you handle real-time data in Flutter?

    • Type: Scenario-Based

    • Expected Answer: Use StreamBuilder with Firebase or WebSockets.

    • Example:

      StreamBuilder(
        stream: FirebaseFirestore.instance.collection('data').snapshots(),
        builder: (context, snapshot) => Text(snapshot.data.toString()),
      )
  74. What is the role of the flutter pub publish command?

    • Type: Conceptual

    • Expected Answer: Publishes a package to pub.dev.

  75. How do you implement a custom app bar in Flutter?

    • Type: Coding Challenge

    • Expected Answer:

      AppBar(
        flexibleSpace: Container(
          decoration: BoxDecoration(gradient: LinearGradient(colors: [Colors.blue, Colors.green])),
        ),
      )
  76. What is the difference between async* and async in Dart?

    • Type: Conceptual

    • Expected Answer: async* is for streams, async for futures.

  77. How do you handle screen transitions in Flutter?

    • Type: Practical

    • Expected Answer: Use PageRouteBuilder for custom transitions.

    • Example:

      Navigator.push(context, PageRouteBuilder(
        pageBuilder: (context, _, __) => SecondScreen(),
        transitionDuration: Duration(seconds: 1),
      ))
  78. What is the role of the flutter gen-l10n command?

    • Type: Conceptual

    • Expected Answer: Generates localization files for i18n.

  79. How do you implement a custom text input formatter in Flutter?

    • Type: Coding Challenge

    • Expected Answer:

      class UpperCaseFormatter extends TextInputFormatter {
        @override
        TextEditingValue formatEditUpdate(oldValue, newValue) {
          return newValue.copyWith(text: newValue.text.toUpperCase());
        }
      }
  80. What is the difference between InheritedModel and InheritedWidget?

    • Type: Conceptual

    • Expected Answer: InheritedModel allows partial updates for specific aspects.

  81. How do you implement a custom splash screen animation?

    • Type: Practical

    • Expected Answer: Use AnimationController with a custom widget.

    • Example:

      AnimationController controller = AnimationController(
        duration: Duration(seconds: 2),
        vsync: this,
      );
  82. What is the role of the flutter analyze --watch command?

    • Type: Conceptual

    • Expected Answer: Continuously analyzes code for errors.

  83. How do you handle offline data in Flutter?

    • Type: Scenario-Based

    • Expected Answer: Use sqflite or hive for local storage.

    • Example:

      var db = await openDatabase('my_db.db');
      await db.insert('table', {'key': 'value'});
  84. What is the difference between runApp and MaterialApp?

    • Type: Conceptual

    • Expected Answer: runApp starts the app, MaterialApp configures the app’s structure.

  85. How do you implement a custom scroll view in Flutter?

    • Type: Coding Challenge

    • Expected Answer:

      CustomScrollView(
        slivers: [
          SliverAppBar(title: Text('Custom')),
          SliverList(delegate: SliverChildListDelegate([Text('Item')])),
        ],
      )
  86. What is the role of the flutter pub cache repair command?

    • Type: Conceptual

    • Expected Answer: Repairs corrupted pub cache.

  87. How do you implement biometric authentication in Flutter?

    • Type: Practical

    • Expected Answer: Use local_auth package.

    • Example:

      final auth = LocalAuthentication();
      bool authenticated = await auth.authenticate(localizedReason: 'Authenticate');
  88. What is the difference between FadeTransition and SlideTransition?

    • Type: Conceptual

    • Expected Answer: FadeTransition changes opacity, SlideTransition moves widgets.

  89. How do you implement a custom validator in Flutter?

    • Type: Coding Challenge

    • Expected Answer:

      TextFormField(
        validator: (value) => value!.length < 6 ? 'Too short' : null,
      )
  90. What is the role of the flutter pub run command?

    • Type: Conceptual

    • Expected Answer: Runs scripts defined in pubspec.yaml.

  91. How do you implement a custom navigation rail in Flutter?

    • Type: Coding Challenge

    • Expected Answer:

      NavigationRail(
        destinations: [
          NavigationRailDestination(icon: Icon(Icons.home), label: Text('Home')),
        ],
        selectedIndex: _selectedIndex,
        onDestinationSelected: (index) => setState(() => _selectedIndex = index),
      )
  92. What is the difference between BuildContext and GlobalKey?

    • Type: Conceptual

    • Expected Answer: BuildContext locates widgets, GlobalKey identifies them uniquely.

  93. How do you implement a custom theme switcher in Flutter?

    • Type: Practical

    • Expected Answer: Use Provider to toggle ThemeMode.

    • Example:

      class ThemeProvider with ChangeNotifier {
        ThemeMode _themeMode = ThemeMode.light;
        ThemeMode get themeMode => _themeMode;
        void toggleTheme() {
          _themeMode = _themeMode == ThemeMode.light ? ThemeMode.dark : ThemeMode.light;
          notifyListeners();
        }
      }
  94. What is the role of the flutter pub upgrade command?

    • Type: Conceptual

    • Expected Answer: Upgrades dependencies to the latest versions.

  95. How do you implement a custom drawer in Flutter?

    • Type: Coding Challenge

    • Expected Answer:

      Scaffold(
        drawer: Drawer(
          child: ListView(
            children: [DrawerHeader(child: Text('Menu')), ListTile(title: Text('Item'))],
          ),
        ),
      )
  96. What is the difference between GestureDetector and InkWell?

    • Type: Conceptual

    • Expected Answer: InkWell provides material ripple effects, GestureDetector is more generic.

  97. How do you handle app versioning in Flutter?

    • Type: Practical

    • Expected Answer: Use package_info_plus to access app version.

    • Example:

      PackageInfo packageInfo = await PackageInfo.fromPlatform();
      String version = packageInfo.version;
  98. What is the role of the flutter pub add command?

    • Type: Conceptual

    • Expected Answer: Adds a dependency to pubspec.yaml.

  99. How do you implement a custom stepper in Flutter?

    • Type: Coding Challenge

    • Expected Answer:

      Stepper(
        steps: [
          Step(title: Text('Step 1'), content: Text('Content')),
          Step(title: Text('Step 2'), content: Text('Content')),
        ],
        currentStep: _currentStep,
        onStepTapped: (step) => setState(() => _currentStep = step),
      )
  100. What is the difference between ClipRect and ClipRRect?

    • Type: Conceptual

    • Expected Answer: ClipRect clips with sharp edges, ClipRRect with rounded corners.

  101. How do you implement a custom progress indicator in Flutter?

    • Type: Coding Challenge

    • Expected Answer:

      CircularProgressIndicator(
        value: 0.5,
        strokeWidth: 8,
        valueColor: AlwaysStoppedAnimation<Color>(Colors.red),
      )
  102. What is the role of the flutter pub outdated --mode=null-safety command?

    • Type: Conceptual

    • Expected Answer: Checks for null-safety compatible dependencies.

  103. How do you implement a custom snackbar in Flutter?

    • Type: Practical

    • Expected Answer:

      ScaffoldMessenger.of(context).showSnackBar(
        SnackBar(content: Text('Custom Snackbar')),
      );
  104. What is the difference between async and sync generators in Dart?

    • Type: Conceptual

    • Expected Answer: Async generators (async*) yield streams, sync generators (sync*) yield iterables.

  105. How do you implement a custom bottom sheet in Flutter?

    • Type: Coding Challenge

    • Expected Answer:

      showModalBottomSheet(
        context: context,
        builder: (context) => Container(
          child: Text('Custom Bottom Sheet'),
          height: 200,
        ),
      )
  106. What is the role of the flutter pub run build_runner build command?

    • Type: Conceptual

    • Expected Answer: Generates code for packages like json_serializable.

  107. How do you implement a custom animated icon in Flutter?

    • Type: Practical

    • Expected Answer:

      AnimatedIcon(
        icon: AnimatedIcons.menu_close,
        progress: controller,
      )
  108. What is the difference between Navigator 1.0 and Navigator 2.0?

    • Type: Conceptual

    • Expected Answer: Navigator 2.0 supports declarative routing and complex navigation.

  109. How do you implement a custom page transition in Flutter?

    • Type: Coding Challenge

    • Expected Answer:

      Navigator.push(
        context,
        PageRouteBuilder(
          pageBuilder: (context, _, __) => SecondScreen(),
          transitionsBuilder: (context, animation, _, child) => ScaleTransition(scale: animation, child: child),
        ),
      )
  110. What is the role of the flutter pub cache clean command?

    • Type: Conceptual

    • Expected Answer: Clears the pub cache to resolve dependency issues.

  111. How do you implement a custom floating action button in Flutter?

    • Type: Coding Challenge

    • Expected Answer:

      FloatingActionButton(
        onPressed: () {},
        child: Icon(Icons.add),
        backgroundColor: Colors.red,
      )
  112. What is the difference between flutter run and flutter build?

    • Type: Conceptual

    • Expected Answer: flutter run runs the app for debugging, flutter build creates a release artifact.

  113. How do you handle app crashes in Flutter?

    • Type: Scenario-Based

    • Expected Answer: Use FlutterError.onError and crash reporting tools like Sentry.

    • Example:

      FlutterError.onError = (details) {
        print('Error: ${details.exception}');
      };
  114. What is the role of the flutter pub deps command?

    • Type: Conceptual

    • Expected Answer: Displays the dependency tree of the project.

  115. How do you implement a custom onboarding screen in Flutter?

    • Type: Coding Challenge

    • Expected Answer:

      PageView(
        children: [
          Container(child: Text('Welcome to Page 1')),
          Container(child: Text('Welcome to Page 2')),
        ],
        onPageChanged: (index) => setState(() => currentPage = index),
      )

Conclusion

This comprehensive guide of 155 Flutter Mobile App Development interview questions for 2025 equips you with the knowledge to excel in technical interviews. Spanning beginner to expert levels, these questions include real-world scenarios, coding examples, and practical challenges to prepare you for competitive exams and real-world applications. Practice the examples, master Flutter and Dart, and explore resources like Flutter Documentation, Pub.dev, and Medium for further study. Ace your Flutter interview and secure your dream role in 2025!

No comments:

Post a Comment

Thanks for your valuable comment...........
Md. Mominul Islam

Post Bottom Ad

Responsive Ads Here