Commit 08f0fa0
Changed files (2)
lib
components
screens
subsettings
lib/components/color_picker.dart
@@ -140,7 +140,7 @@ class _ColorPickerState extends State<ColorPicker> {
/// Shows a dialog with a ColorPicker and with an cancel button inside.
///
/// Returns the selected color or null when cancel is pressed.
-Future<Color?> showColorPickerDialog(BuildContext context, Color? initialColor) async {
+Future<Color?> showColorPickerDialog(BuildContext context, [Color? initialColor]) async {
return await showDialog(
context: context,
builder: (_) {
lib/screens/subsettings/graph_markings.dart
@@ -1,9 +1,9 @@
+import 'package:blood_pressure_app/components/color_picker.dart';
import 'package:blood_pressure_app/components/input_dialoge.dart';
import 'package:blood_pressure_app/model/horizontal_graph_line.dart';
import 'package:blood_pressure_app/model/storage/settings_store.dart';
import 'package:flutter/material.dart';
import 'package:flutter_gen/gen_l10n/app_localizations.dart';
-import 'package:flutter_material_color_picker/flutter_material_color_picker.dart';
import 'package:provider/provider.dart';
class GraphMarkingsScreen extends StatelessWidget {
@@ -38,14 +38,7 @@ class GraphMarkingsScreen extends StatelessWidget {
leading: const Icon(Icons.add),
title: Text(localizations.addLine),
onTap: () async {
- final color = await showDialog<Color>(context: context,
- builder: (context) => SimpleDialog(
- children: [MaterialColorPicker(
- circleSize: 53,
- onMainColorChange: (color) {
- Navigator.of(context).pop(color);
- },
- )],));
+ final color = await showColorPickerDialog(context);
if (!context.mounted) return;
final height = await showDialog<int>(context: context,
builder: (context) => NumberInputDialoge(