Jul 3, 2024
filters and previews:
filters directory.previews directory.pubspec.yaml file and include the Deep AR Flutter package.Pages, models, data, and a constant.dart file.models directory:
filters.dart file with a simple Filters class with image and filter path attributes.data directory:
filter_data.dart file with a list of filters.Pages directory:
homepage.dart file.buildButtons function to display camera control buttons:
buildCameraPreview function that returns a SizedBox with the Deep AR preview wrapped in a Transform.scale widget.buildFilters function to display a list of filters:
onTap property to call the switchEffect method of the Deep AR controller, passing the effect file path of the selected filter.main widget's build method:
FutureBuilder with the future set to initialize the controller.builder, check the connection state: