[ui] UI theme should match repertory blue #61
All checks were successful
BlockStorage/repertory/pipeline/head This commit looks good
All checks were successful
BlockStorage/repertory/pipeline/head This commit looks good
This commit is contained in:
@@ -8,6 +8,30 @@ import 'package:repertory/constants.dart' as constants;
|
|||||||
import 'package:repertory/models/auth.dart';
|
import 'package:repertory/models/auth.dart';
|
||||||
import 'package:sodium_libs/sodium_libs.dart' show SecureKey, StringX;
|
import 'package:sodium_libs/sodium_libs.dart' show SecureKey, StringX;
|
||||||
|
|
||||||
|
Future doShowDialog(BuildContext context, Widget child) => showDialog(
|
||||||
|
context: context,
|
||||||
|
builder: (context) {
|
||||||
|
final theme = Theme.of(context);
|
||||||
|
final scheme = theme.colorScheme;
|
||||||
|
return Theme(
|
||||||
|
data: theme.copyWith(
|
||||||
|
dialogTheme: DialogThemeData(
|
||||||
|
backgroundColor: scheme.primary.withValues(alpha: 0.15),
|
||||||
|
surfaceTintColor: Colors.transparent,
|
||||||
|
shape: RoundedRectangleBorder(
|
||||||
|
borderRadius: BorderRadius.circular(constants.borderRadius),
|
||||||
|
side: BorderSide(
|
||||||
|
color: scheme.outlineVariant.withValues(alpha: 0.08),
|
||||||
|
width: 1,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
child: child,
|
||||||
|
);
|
||||||
|
},
|
||||||
|
);
|
||||||
|
|
||||||
typedef Validator = bool Function(String);
|
typedef Validator = bool Function(String);
|
||||||
|
|
||||||
class NullPasswordException implements Exception {
|
class NullPasswordException implements Exception {
|
||||||
@@ -347,26 +371,9 @@ Future<String?> editMountLocation(
|
|||||||
}) async {
|
}) async {
|
||||||
String? currentLocation = location;
|
String? currentLocation = location;
|
||||||
final controller = TextEditingController(text: currentLocation);
|
final controller = TextEditingController(text: currentLocation);
|
||||||
return await showDialog(
|
return await doShowDialog(
|
||||||
context: context,
|
context,
|
||||||
builder: (context) {
|
StatefulBuilder(
|
||||||
var theme = Theme.of(context);
|
|
||||||
var scheme = theme.colorScheme;
|
|
||||||
return Theme(
|
|
||||||
data: theme.copyWith(
|
|
||||||
dialogTheme: DialogThemeData(
|
|
||||||
backgroundColor: scheme.surface.withValues(alpha: 0.40),
|
|
||||||
surfaceTintColor: Colors.transparent,
|
|
||||||
shape: RoundedRectangleBorder(
|
|
||||||
borderRadius: BorderRadius.circular(constants.borderRadius),
|
|
||||||
side: BorderSide(
|
|
||||||
color: scheme.outlineVariant.withValues(alpha: 0.08),
|
|
||||||
width: 1,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
child: StatefulBuilder(
|
|
||||||
builder: (context, setState) {
|
builder: (context, setState) {
|
||||||
return AlertDialog(
|
return AlertDialog(
|
||||||
actions: [
|
actions: [
|
||||||
@@ -377,8 +384,7 @@ Future<String?> editMountLocation(
|
|||||||
TextButton(
|
TextButton(
|
||||||
child: const Text('OK'),
|
child: const Text('OK'),
|
||||||
onPressed: () {
|
onPressed: () {
|
||||||
final result = getSettingValidators('Path')
|
final result = getSettingValidators('Path').firstWhereOrNull(
|
||||||
.firstWhereOrNull(
|
|
||||||
(validator) => !validator(currentLocation ?? ''),
|
(validator) => !validator(currentLocation ?? ''),
|
||||||
);
|
);
|
||||||
if (result != null) {
|
if (result != null) {
|
||||||
@@ -395,14 +401,12 @@ Future<String?> editMountLocation(
|
|||||||
? TextField(
|
? TextField(
|
||||||
autofocus: true,
|
autofocus: true,
|
||||||
controller: controller,
|
controller: controller,
|
||||||
onChanged: (value) =>
|
onChanged: (value) => setState(() => currentLocation = value),
|
||||||
setState(() => currentLocation = value),
|
|
||||||
)
|
)
|
||||||
: DropdownButton<String>(
|
: DropdownButton<String>(
|
||||||
hint: const Text("Select drive"),
|
hint: const Text("Select drive"),
|
||||||
value: currentLocation,
|
value: currentLocation,
|
||||||
onChanged: (value) =>
|
onChanged: (value) => setState(() => currentLocation = value),
|
||||||
setState(() => currentLocation = value),
|
|
||||||
items: available.map<DropdownMenuItem<String>>((item) {
|
items: available.map<DropdownMenuItem<String>>((item) {
|
||||||
return DropdownMenuItem<String>(
|
return DropdownMenuItem<String>(
|
||||||
value: item,
|
value: item,
|
||||||
@@ -415,30 +419,4 @@ Future<String?> editMountLocation(
|
|||||||
},
|
},
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
},
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Future doShowDialog(BuildContext context, Widget child) => showDialog(
|
|
||||||
context: context,
|
|
||||||
builder: (context) {
|
|
||||||
final theme = Theme.of(context);
|
|
||||||
final scheme = theme.colorScheme;
|
|
||||||
return Theme(
|
|
||||||
data: theme.copyWith(
|
|
||||||
dialogTheme: DialogThemeData(
|
|
||||||
backgroundColor: scheme.surface.withValues(alpha: 0.40),
|
|
||||||
surfaceTintColor: Colors.transparent,
|
|
||||||
shape: RoundedRectangleBorder(
|
|
||||||
borderRadius: BorderRadius.circular(constants.borderRadius),
|
|
||||||
side: BorderSide(
|
|
||||||
color: scheme.outlineVariant.withValues(alpha: 0.08),
|
|
||||||
width: 1,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
child: child,
|
|
||||||
);
|
|
||||||
},
|
|
||||||
);
|
|
||||||
|
@@ -8,6 +8,7 @@ import 'package:repertory/models/auth.dart';
|
|||||||
class Settings with ChangeNotifier {
|
class Settings with ChangeNotifier {
|
||||||
final Auth _auth;
|
final Auth _auth;
|
||||||
bool _autoStart = false;
|
bool _autoStart = false;
|
||||||
|
bool _enableAnimations = true;
|
||||||
|
|
||||||
Settings(this._auth) {
|
Settings(this._auth) {
|
||||||
_auth.addListener(() {
|
_auth.addListener(() {
|
||||||
@@ -18,6 +19,11 @@ class Settings with ChangeNotifier {
|
|||||||
}
|
}
|
||||||
|
|
||||||
bool get autoStart => _autoStart;
|
bool get autoStart => _autoStart;
|
||||||
|
bool get enableAnimations => _enableAnimations;
|
||||||
|
set enableAnimations(bool enable) {
|
||||||
|
_enableAnimations = enable;
|
||||||
|
notifyListeners();
|
||||||
|
}
|
||||||
|
|
||||||
void _reset() {
|
void _reset() {
|
||||||
_autoStart = false;
|
_autoStart = false;
|
||||||
|
@@ -9,6 +9,7 @@ import 'package:repertory/helpers.dart';
|
|||||||
import 'package:repertory/models/auth.dart';
|
import 'package:repertory/models/auth.dart';
|
||||||
import 'package:repertory/models/mount.dart';
|
import 'package:repertory/models/mount.dart';
|
||||||
import 'package:repertory/models/mount_list.dart';
|
import 'package:repertory/models/mount_list.dart';
|
||||||
|
import 'package:repertory/models/settings.dart';
|
||||||
import 'package:repertory/types/mount_config.dart';
|
import 'package:repertory/types/mount_config.dart';
|
||||||
import 'package:repertory/widgets/aurora_sweep.dart';
|
import 'package:repertory/widgets/aurora_sweep.dart';
|
||||||
import 'package:repertory/widgets/mount_settings.dart';
|
import 'package:repertory/widgets/mount_settings.dart';
|
||||||
@@ -92,11 +93,10 @@ class _AddMountScreenState extends State<AddMountScreen> {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
const AuroraSweep(
|
Consumer<Settings>(
|
||||||
enabled: true,
|
builder: (_, settings, _) {
|
||||||
duration: Duration(seconds: 28),
|
return AuroraSweep(enabled: settings.enableAnimations);
|
||||||
primaryAlphaA: 0.04,
|
},
|
||||||
primaryAlphaB: 0.03,
|
|
||||||
),
|
),
|
||||||
Positioned.fill(
|
Positioned.fill(
|
||||||
child: BackdropFilter(
|
child: BackdropFilter(
|
||||||
@@ -214,7 +214,7 @@ class _AddMountScreenState extends State<AddMountScreen> {
|
|||||||
),
|
),
|
||||||
const SizedBox(width: constants.padding),
|
const SizedBox(width: constants.padding),
|
||||||
DropdownButton<String>(
|
DropdownButton<String>(
|
||||||
value: _mountType,
|
value: _mountType.isEmpty ? null : _mountType,
|
||||||
autofocus: true,
|
autofocus: true,
|
||||||
underline: const SizedBox.shrink(),
|
underline: const SizedBox.shrink(),
|
||||||
onChanged: (mountType) {
|
onChanged: (mountType) {
|
||||||
@@ -298,7 +298,8 @@ class _AddMountScreenState extends State<AddMountScreen> {
|
|||||||
const SizedBox(height: constants.padding),
|
const SizedBox(height: constants.padding),
|
||||||
Row(
|
Row(
|
||||||
children: [
|
children: [
|
||||||
ElevatedButton.icon(
|
IntrinsicWidth(
|
||||||
|
child: ElevatedButton.icon(
|
||||||
label: const Text('Test'),
|
label: const Text('Test'),
|
||||||
icon: const Icon(Icons.check),
|
icon: const Icon(Icons.check),
|
||||||
style: ElevatedButton.styleFrom(
|
style: ElevatedButton.styleFrom(
|
||||||
@@ -321,15 +322,19 @@ class _AddMountScreenState extends State<AddMountScreen> {
|
|||||||
),
|
),
|
||||||
onPressed: _handleProviderTest,
|
onPressed: _handleProviderTest,
|
||||||
),
|
),
|
||||||
|
),
|
||||||
const SizedBox(width: constants.padding),
|
const SizedBox(width: constants.padding),
|
||||||
ElevatedButton.icon(
|
IntrinsicWidth(
|
||||||
|
child: ElevatedButton.icon(
|
||||||
label: const Text('Add'),
|
label: const Text('Add'),
|
||||||
icon: const Icon(Icons.add),
|
icon: const Icon(Icons.add),
|
||||||
style: ElevatedButton.styleFrom(
|
style: ElevatedButton.styleFrom(
|
||||||
backgroundColor: scheme.primary,
|
backgroundColor: scheme.primary,
|
||||||
foregroundColor: scheme.onPrimary,
|
foregroundColor: scheme.onPrimary,
|
||||||
elevation: 8,
|
elevation: 8,
|
||||||
shadowColor: scheme.primary.withValues(alpha: 0.45),
|
shadowColor: scheme.primary.withValues(
|
||||||
|
alpha: 0.45,
|
||||||
|
),
|
||||||
shape: RoundedRectangleBorder(
|
shape: RoundedRectangleBorder(
|
||||||
borderRadius: BorderRadius.circular(
|
borderRadius: BorderRadius.circular(
|
||||||
constants.borderRadius,
|
constants.borderRadius,
|
||||||
@@ -369,7 +374,10 @@ class _AddMountScreenState extends State<AddMountScreen> {
|
|||||||
final bucket =
|
final bucket =
|
||||||
_settings[_mountType]!["${_mountType}Config"]["Bucket"]
|
_settings[_mountType]!["${_mountType}Config"]["Bucket"]
|
||||||
as String;
|
as String;
|
||||||
if (mountList.hasBucketName(_mountType, bucket)) {
|
if (mountList.hasBucketName(
|
||||||
|
_mountType,
|
||||||
|
bucket,
|
||||||
|
)) {
|
||||||
return displayErrorMessage(
|
return displayErrorMessage(
|
||||||
context,
|
context,
|
||||||
"Bucket '$bucket' already exists",
|
"Bucket '$bucket' already exists",
|
||||||
@@ -392,6 +400,7 @@ class _AddMountScreenState extends State<AddMountScreen> {
|
|||||||
Navigator.pop(context);
|
Navigator.pop(context);
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
|
@@ -5,6 +5,7 @@ import 'package:flutter/material.dart';
|
|||||||
import 'package:provider/provider.dart';
|
import 'package:provider/provider.dart';
|
||||||
import 'package:repertory/constants.dart' as constants;
|
import 'package:repertory/constants.dart' as constants;
|
||||||
import 'package:repertory/models/auth.dart';
|
import 'package:repertory/models/auth.dart';
|
||||||
|
import 'package:repertory/models/settings.dart';
|
||||||
import 'package:repertory/widgets/aurora_sweep.dart';
|
import 'package:repertory/widgets/aurora_sweep.dart';
|
||||||
|
|
||||||
class AuthScreen extends StatefulWidget {
|
class AuthScreen extends StatefulWidget {
|
||||||
@@ -97,7 +98,11 @@ class _AuthScreenState extends State<AuthScreen> {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
const AuroraSweep(),
|
Consumer<Settings>(
|
||||||
|
builder: (_, settings, _) {
|
||||||
|
return AuroraSweep(enabled: settings.enableAnimations);
|
||||||
|
},
|
||||||
|
),
|
||||||
Positioned.fill(
|
Positioned.fill(
|
||||||
child: BackdropFilter(
|
child: BackdropFilter(
|
||||||
filter: ImageFilter.blur(sigmaX: 10, sigmaY: 10),
|
filter: ImageFilter.blur(sigmaX: 10, sigmaY: 10),
|
||||||
|
@@ -8,6 +8,7 @@ import 'package:provider/provider.dart';
|
|||||||
import 'package:repertory/constants.dart' as constants;
|
import 'package:repertory/constants.dart' as constants;
|
||||||
import 'package:repertory/models/auth.dart';
|
import 'package:repertory/models/auth.dart';
|
||||||
import 'package:repertory/models/mount.dart';
|
import 'package:repertory/models/mount.dart';
|
||||||
|
import 'package:repertory/models/settings.dart';
|
||||||
import 'package:repertory/widgets/aurora_sweep.dart';
|
import 'package:repertory/widgets/aurora_sweep.dart';
|
||||||
import 'package:repertory/widgets/mount_settings.dart';
|
import 'package:repertory/widgets/mount_settings.dart';
|
||||||
|
|
||||||
@@ -43,11 +44,10 @@ class _EditMountScreenState extends State<EditMountScreen> {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
const AuroraSweep(
|
Consumer<Settings>(
|
||||||
enabled: true,
|
builder: (_, settings, _) {
|
||||||
duration: Duration(seconds: 28),
|
return AuroraSweep(enabled: settings.enableAnimations);
|
||||||
primaryAlphaA: 0.04,
|
},
|
||||||
primaryAlphaB: 0.03,
|
|
||||||
),
|
),
|
||||||
Positioned.fill(
|
Positioned.fill(
|
||||||
child: BackdropFilter(
|
child: BackdropFilter(
|
||||||
|
@@ -9,6 +9,7 @@ import 'package:provider/provider.dart';
|
|||||||
import 'package:repertory/constants.dart' as constants;
|
import 'package:repertory/constants.dart' as constants;
|
||||||
import 'package:repertory/helpers.dart';
|
import 'package:repertory/helpers.dart';
|
||||||
import 'package:repertory/models/auth.dart';
|
import 'package:repertory/models/auth.dart';
|
||||||
|
import 'package:repertory/models/settings.dart';
|
||||||
import 'package:repertory/widgets/aurora_sweep.dart';
|
import 'package:repertory/widgets/aurora_sweep.dart';
|
||||||
import 'package:repertory/widgets/ui_settings.dart';
|
import 'package:repertory/widgets/ui_settings.dart';
|
||||||
|
|
||||||
@@ -41,11 +42,10 @@ class _EditSettingsScreenState extends State<EditSettingsScreen> {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
const AuroraSweep(
|
Consumer<Settings>(
|
||||||
enabled: true,
|
builder: (_, settings, _) {
|
||||||
duration: Duration(seconds: 28),
|
return AuroraSweep(enabled: settings.enableAnimations);
|
||||||
primaryAlphaA: 0.04,
|
},
|
||||||
primaryAlphaB: 0.03,
|
|
||||||
),
|
),
|
||||||
Positioned.fill(
|
Positioned.fill(
|
||||||
child: BackdropFilter(
|
child: BackdropFilter(
|
||||||
|
@@ -5,6 +5,7 @@ import 'package:flutter/material.dart';
|
|||||||
import 'package:provider/provider.dart';
|
import 'package:provider/provider.dart';
|
||||||
import 'package:repertory/constants.dart' as constants;
|
import 'package:repertory/constants.dart' as constants;
|
||||||
import 'package:repertory/models/auth.dart';
|
import 'package:repertory/models/auth.dart';
|
||||||
|
import 'package:repertory/models/settings.dart';
|
||||||
import 'package:repertory/widgets/mount_list_widget.dart';
|
import 'package:repertory/widgets/mount_list_widget.dart';
|
||||||
import 'package:repertory/widgets/aurora_sweep.dart';
|
import 'package:repertory/widgets/aurora_sweep.dart';
|
||||||
|
|
||||||
@@ -37,11 +38,10 @@ class _HomeScreeState extends State<HomeScreen> {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
const AuroraSweep(
|
Consumer<Settings>(
|
||||||
enabled: true,
|
builder: (_, settings, _) {
|
||||||
duration: Duration(seconds: 28),
|
return AuroraSweep(enabled: settings.enableAnimations);
|
||||||
primaryAlphaA: 0.04,
|
},
|
||||||
primaryAlphaB: 0.03,
|
|
||||||
),
|
),
|
||||||
Positioned.fill(
|
Positioned.fill(
|
||||||
child: BackdropFilter(
|
child: BackdropFilter(
|
||||||
|
Reference in New Issue
Block a user