Skip to content
This repository was archived by the owner on Feb 22, 2023. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
updated
  • Loading branch information
Hans Muller committed Jan 7, 2021
commit 7e8807b9544a9d8a38d09091209a131ab710475b
17 changes: 5 additions & 12 deletions packages/camera/camera/example/lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -313,6 +313,9 @@ class _CameraExampleHomeState extends State<CameraExampleHome>
}

Widget _exposureModeControlRowWidget() {
final ButtonStyle style = TextButton.styleFrom(
Copy link
Contributor

@bparrishMines bparrishMines Jan 7, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The first and second button change are based on ExposureMode.auto and ExposureMode.locked, respectively. I think you might have missed the styles were slightly different.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch! I'll fix it.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done. PTAL

primary: controller?.value?.exposureMode == ExposureMode.auto ? Colors.orange : Colors.blue,
);
return SizeTransition(
sizeFactor: _exposureModeControlRowAnimation,
child: ClipRect(
Expand All @@ -329,12 +332,7 @@ class _CameraExampleHomeState extends State<CameraExampleHome>
children: [
TextButton(
child: Text('AUTO'),
style: TextButton.styleFrom(
primary:
controller?.value?.exposureMode == ExposureMode.auto
? Colors.orange
: Colors.blue,
),
style: style,
onPressed: controller != null
? () =>
onSetExposureModeButtonPressed(ExposureMode.auto)
Expand All @@ -346,12 +344,7 @@ class _CameraExampleHomeState extends State<CameraExampleHome>
),
TextButton(
child: Text('LOCKED'),
style: TextButton.styleFrom(
primary:
controller?.value?.exposureMode == ExposureMode.auto
? Colors.orange
: Colors.blue,
),
style: style,
onPressed: controller != null
? () =>
onSetExposureModeButtonPressed(ExposureMode.locked)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,10 @@ class GetDirectoryPage extends StatelessWidget {
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
ElevatedButton(
color: Colors.blue,
textColor: Colors.white,
style: ElevatedButton.styleFrom(
primary: Colors.blue,
onPrimary: Colors.white,
),
child: Text('Press to ask user to choose a directory'),
onPressed: () => _getDirectoryPath(context),
),
Expand Down
19 changes: 9 additions & 10 deletions packages/file_selector/file_selector/example/lib/home_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ import 'package:flutter/material.dart';
class HomePage extends StatelessWidget {
@override
Widget build(BuildContext context) {
final ButtonStyle style = ElevatedButton.styleFrom(
primary: Colors.blue,
onPrimary: Colors.white,
);
return Scaffold(
appBar: AppBar(
title: Text('File Selector Demo Home Page'),
Expand All @@ -13,36 +17,31 @@ class HomePage extends StatelessWidget {
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
ElevatedButton(
color: Colors.blue,
textColor: Colors.white,
style: style,
child: Text('Open a text file'),
onPressed: () => Navigator.pushNamed(context, '/open/text'),
),
SizedBox(height: 10),
ElevatedButton(
color: Colors.blue,
textColor: Colors.white,
style: style,
child: Text('Open an image'),
onPressed: () => Navigator.pushNamed(context, '/open/image'),
),
SizedBox(height: 10),
ElevatedButton(
color: Colors.blue,
textColor: Colors.white,
style: style,
child: Text('Open multiple images'),
onPressed: () => Navigator.pushNamed(context, '/open/images'),
),
SizedBox(height: 10),
ElevatedButton(
color: Colors.blue,
textColor: Colors.white,
style: style,
child: Text('Save a file'),
onPressed: () => Navigator.pushNamed(context, '/save/text'),
),
SizedBox(height: 10),
ElevatedButton(
color: Colors.blue,
textColor: Colors.white,
style: style,
child: Text('Open a get directory dialog'),
onPressed: () => Navigator.pushNamed(context, '/directory'),
),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,10 @@ class OpenImagePage extends StatelessWidget {
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
ElevatedButton(
color: Colors.blue,
textColor: Colors.white,
style: ElevatedButton.styleFrom(
primary: Colors.blue,
onPrimary: Colors.white,
),
child: Text('Press to open an image file(png, jpg)'),
onPressed: () => _openImageFile(context),
),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,10 @@ class OpenMultipleImagesPage extends StatelessWidget {
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
ElevatedButton(
color: Colors.blue,
textColor: Colors.white,
style: ElevatedButton.styleFrom(
primary: Colors.blue,
onPrimary: Colors.white,
),
child: Text('Press to open multiple images (png, jpg)'),
onPressed: () => _openImageFile(context),
),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,10 @@ class OpenTextPage extends StatelessWidget {
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
ElevatedButton(
color: Colors.blue,
textColor: Colors.white,
style: ElevatedButton.styleFrom(
primary: Colors.blue,
onPrimary: Colors.white,
),
child: Text('Press to open a text file (json, txt)'),
onPressed: () => _openTextFile(context),
),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,10 @@ class SaveTextPage extends StatelessWidget {
),
SizedBox(height: 10),
ElevatedButton(
color: Colors.blue,
textColor: Colors.white,
style: ElevatedButton.styleFrom(
primary: Colors.blue,
onPrimary: Colors.white,
),
child: Text('Press to save a text file'),
onPressed: () => _saveFile(),
),
Expand Down