Skip to content

Commit

Permalink
chore: add device preview package
Browse files Browse the repository at this point in the history
  • Loading branch information
KRTirtho committed Jun 1, 2023
1 parent 8944581 commit 8d30fff
Show file tree
Hide file tree
Showing 3 changed files with 49 additions and 2 deletions.
10 changes: 8 additions & 2 deletions lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -133,7 +134,9 @@ Future<void> main(List<String> rawArgs) async {
]),
runAppFunction: () {
runApp(
Builder(
DevicePreview(
availableLocales: L10n.all,
enabled: !kReleaseMode,
builder: (context) {
return ProviderScope(
overrides: [
Expand Down Expand Up @@ -240,7 +243,10 @@ class SpotubeState extends ConsumerState<Spotube> {
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),
Expand Down
40 changes: 40 additions & 0 deletions pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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:
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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:
Expand Down
1 change: 1 addition & 0 deletions pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 8d30fff

Please sign in to comment.