Skip to content

Commit

Permalink
Improved styling and started plugins.
Browse files Browse the repository at this point in the history
  • Loading branch information
aloisdeniel committed Oct 14, 2020
1 parent 8294647 commit e212e5f
Show file tree
Hide file tree
Showing 35 changed files with 1,686 additions and 462 deletions.
2 changes: 1 addition & 1 deletion device_frame/example/lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ class _ExampleAppState extends State<ExampleApp> {
),
body: SafeArea(
child: Padding(
padding: const EdgeInsets.all(10.0),
padding: const EdgeInsets.all(10),
child: Builder(
builder: (context) => !isEnabled
? FakeScreen(key: screenKey)
Expand Down
22 changes: 11 additions & 11 deletions device_frame/lib/src/keyboard/virtual_keyboard.dart
Original file line number Diff line number Diff line change
Expand Up @@ -110,13 +110,13 @@ class _VirtualKeyboard extends StatelessWidget {
(x) => Expanded(
child: Padding(
padding: EdgeInsets.only(
right: 12.0,
right: 12,
),
child: VirtualKeyboardButton(
child: Text(
x,
style: TextStyle(
fontSize: 14.0,
fontSize: 14,
color: foregroundColor,
),
),
Expand Down Expand Up @@ -154,7 +154,7 @@ class _VirtualKeyboard extends StatelessWidget {
_row([
Padding(
padding: EdgeInsets.only(
right: 12.0,
right: 12,
),
child: VirtualKeyboardButton(
child: Icon(
Expand All @@ -172,7 +172,7 @@ class _VirtualKeyboard extends StatelessWidget {
),
Padding(
padding: EdgeInsets.only(
right: 12.0,
right: 12,
),
child: VirtualKeyboardButton(
child: Icon(
Expand All @@ -187,13 +187,13 @@ class _VirtualKeyboard extends StatelessWidget {
_row([
Padding(
padding: EdgeInsets.only(
right: 12.0,
right: 12,
),
child: VirtualKeyboardButton(
child: Text(
'123',
style: TextStyle(
fontSize: 14.0,
fontSize: 14,
color: theme.button2ForegroundColor,
),
),
Expand All @@ -202,7 +202,7 @@ class _VirtualKeyboard extends StatelessWidget {
),
Padding(
padding: EdgeInsets.only(
right: 12.0,
right: 12,
),
child: VirtualKeyboardButton(
child: Icon(
Expand All @@ -216,27 +216,27 @@ class _VirtualKeyboard extends StatelessWidget {
Expanded(
child: Padding(
padding: EdgeInsets.only(
right: 12.0,
right: 12,
),
child: VirtualKeyboardButton(
child: Text(
'space',
style: TextStyle(
fontSize: 14.0, color: theme.button2ForegroundColor),
fontSize: 14, color: theme.button2ForegroundColor),
),
backgroundColor: theme.button2BackgroundColor,
),
),
),
Padding(
padding: EdgeInsets.only(
right: 12.0,
right: 12,
),
child: VirtualKeyboardButton(
child: Text(
'return',
style: TextStyle(
fontSize: 14.0, color: theme.button2ForegroundColor),
fontSize: 14, color: theme.button2ForegroundColor),
),
backgroundColor: theme.button2BackgroundColor,
),
Expand Down
2 changes: 1 addition & 1 deletion device_frame/scripts/frame_generator.dart
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ String _parseInsets(String text) {

final splits = text.split(',').map((e) => double.parse(e.trim())).toList();

final left = splits.length > 0 ? splits[0] : 0;
final left = splits.isNotEmpty ? splits[0] : 0;
final top = splits.length > 1 ? splits[1] : left;
final right = splits.length > 2 ? splits[2] : left;
final bottom = splits.length > 3 ? splits[3] : top;
Expand Down
12 changes: 12 additions & 0 deletions device_preview/example/ios/Podfile.lock
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
PODS:
- Flutter (1.0.0)
- path_provider (0.0.1):
- Flutter
- path_provider_linux (0.0.1):
- Flutter
- path_provider_macos (0.0.1):
- Flutter
- path_provider_windows (0.0.1):
- Flutter
- shared_preferences (0.0.1):
Expand All @@ -17,7 +21,9 @@ PODS:

DEPENDENCIES:
- Flutter (from `Flutter`)
- path_provider (from `.symlinks/plugins/path_provider/ios`)
- path_provider_linux (from `.symlinks/plugins/path_provider_linux/ios`)
- path_provider_macos (from `.symlinks/plugins/path_provider_macos/ios`)
- path_provider_windows (from `.symlinks/plugins/path_provider_windows/ios`)
- shared_preferences (from `.symlinks/plugins/shared_preferences/ios`)
- shared_preferences_linux (from `.symlinks/plugins/shared_preferences_linux/ios`)
Expand All @@ -28,8 +34,12 @@ DEPENDENCIES:
EXTERNAL SOURCES:
Flutter:
:path: Flutter
path_provider:
:path: ".symlinks/plugins/path_provider/ios"
path_provider_linux:
:path: ".symlinks/plugins/path_provider_linux/ios"
path_provider_macos:
:path: ".symlinks/plugins/path_provider_macos/ios"
path_provider_windows:
:path: ".symlinks/plugins/path_provider_windows/ios"
shared_preferences:
Expand All @@ -45,7 +55,9 @@ EXTERNAL SOURCES:

SPEC CHECKSUMS:
Flutter: 0e3d915762c693b495b44d77113d4970485de6ec
path_provider: abfe2b5c733d04e238b0d8691db0cfd63a27a93c
path_provider_linux: 4d630dc393e1f20364f3e3b4a2ff41d9674a84e4
path_provider_macos: f760a3c5b04357c380e2fddb6f9db6f3015897e0
path_provider_windows: a2b81600c677ac1959367280991971cb9a1edb3b
shared_preferences: af6bfa751691cdc24be3045c43ec037377ada40d
shared_preferences_linux: afefbfe8d921e207f01ede8b60373d9e3b566b78
Expand Down
8 changes: 1 addition & 7 deletions device_preview/example/lib/gallery/data/gallery_options.dart
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
// found in the LICENSE file.

import 'dart:async';
import 'dart:io' show Platform;

import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
Expand Down Expand Up @@ -66,12 +65,7 @@ class GalleryOptions {
}
}

Locale get locale =>
_locale ??
deviceLocale ??
// TODO: When deviceLocale can be obtained on macOS, this won't be necessary
// https://github.com/flutter/flutter/issues/45343
(!kIsWeb && Platform.isMacOS ? const Locale('en', 'US') : null);
Locale get locale => _locale ?? deviceLocale;

/// Returns the text direction based on the [CustomTextDirection] setting.
/// If the locale cannot be determined, returns null.
Expand Down
12 changes: 6 additions & 6 deletions device_preview/example/lib/gallery/studies/starter/home.dart
Original file line number Diff line number Diff line change
Expand Up @@ -42,19 +42,19 @@ class _HomePageState extends State<HomePage> {
children: [
Text(
(loaded ? 'LOADED' : '...'),
style: textTheme.subhead.copyWith(
style: textTheme.subtitle1.copyWith(
color: colorScheme.onSecondary,
),
),
const SizedBox(height: 10),
Text(
GalleryLocalizations.of(context).starterAppGenericSubtitle,
style: textTheme.subtitle,
style: textTheme.subtitle2,
),
const SizedBox(height: 48),
Text(
GalleryLocalizations.of(context).starterAppGenericBody,
style: textTheme.body1,
style: textTheme.bodyText2,
),
],
),
Expand Down Expand Up @@ -134,7 +134,7 @@ class AdaptiveAppBar extends StatelessWidget implements PreferredSizeWidget {
margin: const EdgeInsetsDirectional.fromSTEB(72, 0, 0, 22),
child: Text(
GalleryLocalizations.of(context).starterAppGenericTitle,
style: themeData.textTheme.headline.copyWith(
style: themeData.textTheme.headline5.copyWith(
color: themeData.colorScheme.onPrimary,
),
),
Expand Down Expand Up @@ -182,11 +182,11 @@ class _ListDrawerState extends State<ListDrawer> {
ListTile(
title: Text(
GalleryLocalizations.of(context).starterAppTitle,
style: textTheme.subtitle,
style: textTheme.subtitle2,
),
subtitle: Text(
GalleryLocalizations.of(context).starterAppGenericSubtitle,
style: textTheme.body2,
style: textTheme.bodyText1,
),
),
const Divider(),
Expand Down
6 changes: 6 additions & 0 deletions device_preview/example/lib/main.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import 'package:device_preview/device_preview.dart';
import 'package:device_preview/plugins.dart';
import 'package:device_preview_example/gallery/l10n/gallery_localizations.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/foundation.dart';
Expand All @@ -18,6 +19,11 @@ void main() {
),*/
Expanded(
child: DevicePreview(
plugins: [
const FileExplorerPlugin(),
const ScreenshotPlugin(),
const SharedPreferencesExplorerPlugin(),
],
availableLocales: GalleryLocalizations.supportedLocales,
builder: (context) => StarterApp(),
),
Expand Down
4 changes: 4 additions & 0 deletions device_preview/lib/plugins.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
export 'src/plugins/plugin.dart';
export 'src/plugins/file_explorer.dart';
export 'src/plugins/screenshot.dart';
export 'src/plugins/shared_preferences_explorer.dart';
Loading

0 comments on commit e212e5f

Please sign in to comment.