From 8d30fffc2b978ff509c5d883ca1ea726c3d2107b Mon Sep 17 00:00:00 2001 From: Kingkor Roy Tirtho Date: Thu, 1 Jun 2023 12:28:11 +0600 Subject: [PATCH] chore: add device preview package --- lib/main.dart | 10 ++++++++-- pubspec.lock | 40 ++++++++++++++++++++++++++++++++++++++++ pubspec.yaml | 1 + 3 files changed, 49 insertions(+), 2 deletions(-) diff --git a/lib/main.dart b/lib/main.dart index e90328245..55629a69f 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -2,6 +2,7 @@ import 'dart:io'; import 'package:args/args.dart'; import 'package:catcher/catcher.dart'; +import 'package:device_preview/device_preview.dart'; import 'package:fl_query/fl_query.dart'; import 'package:flutter/foundation.dart'; import 'package:flutter/material.dart'; @@ -133,7 +134,9 @@ Future main(List rawArgs) async { ]), runAppFunction: () { runApp( - Builder( + DevicePreview( + availableLocales: L10n.all, + enabled: !kReleaseMode, builder: (context) { return ProviderScope( overrides: [ @@ -240,7 +243,10 @@ class SpotubeState extends ConsumerState { debugShowCheckedModeBanner: false, title: 'Spotube', builder: (context, child) { - return DragToResizeArea(child: child!); + return DevicePreview.appBuilder( + context, + DragToResizeArea(child: child!), + ); }, themeMode: themeMode, theme: theme(paletteColor ?? accentMaterialColor, Brightness.light), diff --git a/pubspec.lock b/pubspec.lock index e171afaac..29f765d7b 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -426,6 +426,14 @@ packages: url: "https://pub.dev" source: hosted version: "0.7.8" + device_frame: + dependency: transitive + description: + name: device_frame + sha256: afe76182aec178d171953d9b4a50a43c57c7cf3c77d8b09a48bf30c8fa04dd9d + url: "https://pub.dev" + source: hosted + version: "1.1.0" device_info_plus: dependency: transitive description: @@ -442,6 +450,14 @@ packages: url: "https://pub.dev" source: hosted version: "7.0.0" + device_preview: + dependency: "direct main" + description: + name: device_preview + sha256: "2f097bf31b929e15e6756dbe0ec1bcb63952ab9ed51c25dc5a2c722d2b21fdaf" + url: "https://pub.dev" + source: hosted + version: "1.1.0" dio: dependency: transitive description: @@ -772,6 +788,14 @@ packages: url: "https://pub.dev" source: hosted version: "8.1.3" + freezed_annotation: + dependency: transitive + description: + name: freezed_annotation + sha256: aeac15850ef1b38ee368d4c53ba9a847e900bb2c53a4db3f6881cbb3cb684338 + url: "https://pub.dev" + source: hosted + version: "2.2.0" frontend_server_client: dependency: transitive description: @@ -1119,6 +1143,14 @@ packages: url: "https://pub.dev" source: hosted version: "3.0.1" + nested: + dependency: transitive + description: + name: nested + sha256: "03bac4c528c64c95c722ec99280375a6f2fc708eec17c7b3f07253b626cd2a20" + url: "https://pub.dev" + source: hosted + version: "1.0.0" oauth2: dependency: transitive description: @@ -1352,6 +1384,14 @@ packages: url: "https://pub.dev" source: hosted version: "4.2.4" + provider: + dependency: transitive + description: + name: provider + sha256: cdbe7530b12ecd9eb455bdaa2fcb8d4dad22e80b8afb4798b41479d5ce26847f + url: "https://pub.dev" + source: hosted + version: "6.0.5" pub_api_client: dependency: "direct dev" description: diff --git a/pubspec.yaml b/pubspec.yaml index 2d20d0030..2c80b92a9 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -102,6 +102,7 @@ dependencies: url: https://github.com/KRTirtho/piped_client ref: eaade37d0938d31dbfa35bb5152caca4e284bda6 supabase_flutter: ^1.9.1 + device_preview: ^1.1.0 dev_dependencies: build_runner: ^2.3.2