flutter_device_preview icon indicating copy to clipboard operation
flutter_device_preview copied to clipboard

The getter 'appBuilder' isn't defined for the type 'DevicePreview'.

Open 826327700 opened this issue 2 years ago • 3 comments

I can't run normally according to the example on the official website

826327700 avatar Nov 05 '21 01:11 826327700

Try without this line builder: DevicePreview.appBuilder :

import 'package:device_preview/device_preview.dart';

void main() => runApp(
  DevicePreview(
    enabled: !kReleaseMode,
    builder: (context) => MyApp(), // Wrap your app
  ),
);

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      useInheritedMediaQuery: true,// Set to true
      locale: DevicePreview.locale(context), // Add the locale here
      home: HomePage(),
    );
  }
}

felipe-xavier avatar Nov 19 '21 01:11 felipe-xavier

Just published 1.0.0!

Tell me if it is now fine on your side.

aloisdeniel avatar Dec 01 '21 06:12 aloisdeniel

install all the Dependencies then they working great

nomver avatar Dec 26 '21 22:12 nomver