Have a basic GUI Code created in Flutter, can't get it to run on VS Code. Need screenshots of output

40 views Asked by At

I can't seem to get this code to run using VS Code, and I need the results of the emulator (mobile app on an iPhone), is anyone able to run it and get the output? (Can you please post screenshots of it?)

import 'package:flutter/material.dart';

class SearchScreen extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text('Product Catalog Search'),
      ),
      body: Padding(
        padding: EdgeInsets.all(16.0),
        child: Column(
          children: [
            TextField(
              decoration: InputDecoration(
                hintText: 'Enter search keywords',
              ),
            ),
            SizedBox(height: 16.0),
            ElevatedButton(
              onPressed:(){
                //TODO: Implement search functionality
              },
              child: Text('Search'),
            ),
            SizedBox(height: 16.0),
            Expanded(
              child: Center(
                child: Text('No matching products'),
              ),
            ),
          ],
        ),
      ),
    );
  }
}```
2

There are 2 answers

2
Syed Mahfuzur Rahman On

What problem you are facing? I got no problem executing it.

Screenshot: screenshot

run flutter clean and then flutter pub get in the vs code terminal.

2
Don Arias Agokoli On

enter image description here

After compiling your code here is the result