Skip to content

Commit

Permalink
Update deprecated theme variables, auto-format
Browse files Browse the repository at this point in the history
  • Loading branch information
nohli committed Aug 26, 2023
1 parent f14aca5 commit 8fe0da6
Show file tree
Hide file tree
Showing 7 changed files with 29 additions and 25 deletions.
3 changes: 1 addition & 2 deletions example/lib/complex_example/alpha_picker_page.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import 'package:flutter/material.dart';

import 'package:flutter_hsvcolor_picker/flutter_hsvcolor_picker.dart';

class AlphaPickerPage extends StatefulWidget {
Expand Down Expand Up @@ -32,7 +31,7 @@ class _AlphaPickerPageState extends State<AlphaPickerPage> {
children: <Widget>[
Text(
value.toString(),
style: Theme.of(context).textTheme.headline4,
style: Theme.of(context).textTheme.headlineMedium,
),
const Divider(),

Expand Down
20 changes: 10 additions & 10 deletions example/lib/complex_example/main.dart
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
import 'package:flutter/material.dart';

import 'slider_picker_page.dart';
import 'palette_picker_page.dart';
import 'alpha_picker_page.dart';
import 'color_picker_page.dart';
import 'hex_picker_page.dart';
import 'hsv_picker_page.dart';
import 'rgb_picker_page.dart';
import 'swatches_picker_page.dart';
import 'wheel_picker_page.dart';
import 'palette_hue_picker_page.dart';
import 'palette_picker_page.dart';
import 'palette_saturation_picker_page.dart';
import 'palette_value_picker_page.dart';
import 'hex_picker_page.dart';
import 'alpha_picker_page.dart';
import 'color_picker_page.dart';
import 'rgb_picker_page.dart';
import 'slider_picker_page.dart';
import 'swatches_picker_page.dart';
import 'wheel_picker_page.dart';

void main() => runApp(const MyApp());

Expand Down Expand Up @@ -142,7 +142,7 @@ class _MainPageState extends State<MainPage> {
child: Text(
'HSV Color',
textAlign: TextAlign.center,
style: theme.textTheme.headline5,
style: theme.textTheme.headlineSmall,
),
),

Expand Down Expand Up @@ -224,7 +224,7 @@ class _MainPageState extends State<MainPage> {
child: ElevatedButton(
onPressed: setTheme,
style: ElevatedButton.styleFrom(
primary: Colors.blue.shade400,
backgroundColor: Colors.blue.shade400,
shape: const StadiumBorder(),
),
child: Text(
Expand Down
3 changes: 1 addition & 2 deletions example/lib/complex_example/palette_picker_page.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import 'package:flutter/material.dart';

import 'package:flutter_hsvcolor_picker/flutter_hsvcolor_picker.dart';

class PalettePickerPage extends StatefulWidget {
Expand Down Expand Up @@ -42,7 +41,7 @@ class _PalettePickerPageState extends State<PalettePickerPage> {
((value.dy * 100.0).toInt().toDouble() / 100.0)
.toString() +
' )',
style: Theme.of(context).textTheme.headline4,
style: Theme.of(context).textTheme.headlineMedium,
),
const Divider(),
Expanded(
Expand Down
3 changes: 1 addition & 2 deletions example/lib/complex_example/slider_picker_page.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import 'package:flutter/material.dart';

import 'package:flutter_hsvcolor_picker/flutter_hsvcolor_picker.dart';

class SliderPickerPage extends StatefulWidget {
Expand Down Expand Up @@ -41,7 +40,7 @@ class _SliderPickerPageState extends State<SliderPickerPage> {
children: <Widget>[
Text(
((value * 100.0).toInt().toDouble() / 100.0).toString(),
style: Theme.of(context).textTheme.headline4,
style: Theme.of(context).textTheme.headlineMedium,
),
const Divider(),

Expand Down
13 changes: 9 additions & 4 deletions lib/src/color_picker.dart
Original file line number Diff line number Diff line change
Expand Up @@ -208,11 +208,14 @@ class _ColorPickerState extends State<ColorPicker> {
child: Text(
item.name,
style: _index == _pickers.indexOf(item)
? Theme.of(context).textTheme.headline5?.copyWith(
? Theme.of(context).textTheme.headlineSmall?.copyWith(
fontSize: 18,
color: Theme.of(context).colorScheme.secondary,
)
: Theme.of(context).textTheme.headline5?.copyWith(fontSize: 18),
: Theme.of(context)
.textTheme
.headlineSmall
?.copyWith(fontSize: 18),
),
),
);
Expand Down Expand Up @@ -272,7 +275,8 @@ class _ColorPickerState extends State<ColorPicker> {
iconSize: 32.0,
isExpanded: true,
isDense: true,
style: Theme.of(context).textTheme.headline5?.copyWith(fontSize: 20),
style:
Theme.of(context).textTheme.headlineSmall?.copyWith(fontSize: 20),
value: _pickers[_index],
onChanged: (_IPicker? value) => super.setState(
() => _pickerOnChanged(value),
Expand All @@ -295,7 +299,8 @@ class _ColorPickerState extends State<ColorPicker> {
iconSize: 32.0,
isExpanded: true,
isDense: true,
style: Theme.of(context).textTheme.headline5?.copyWith(fontSize: 20),
style:
Theme.of(context).textTheme.headlineSmall?.copyWith(fontSize: 20),
value: _pickers[_index],
onChanged: (_IPicker? value) => super.setState(
() => _pickerOnChanged(value),
Expand Down
8 changes: 5 additions & 3 deletions lib/src/widgets/hex_picker.dart
Original file line number Diff line number Diff line change
Expand Up @@ -45,15 +45,17 @@ class _HexPickerState extends State<HexPicker> {
child: Text(
'#',
style:
Theme.of(context).textTheme.headline6?.copyWith(fontSize: 18),
Theme.of(context).textTheme.titleLarge?.copyWith(fontSize: 18),
),
),

// TextField
Expanded(
child: TextField(
style:
Theme.of(context).textTheme.headline5?.copyWith(fontSize: 20),
style: Theme.of(context)
.textTheme
.headlineSmall
?.copyWith(fontSize: 20),
focusNode: FocusNode()..addListener(() {}),
controller: widget._controller,
onSubmitted: textOnSubmitted,
Expand Down
4 changes: 2 additions & 2 deletions lib/src/widgets/slider_title.dart
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,15 @@ class SliderTitle extends StatelessWidget {
opacity: 0.7,
child: Text(
title,
style: Theme.of(context).textTheme.headline6?.copyWith(
style: Theme.of(context).textTheme.titleLarge?.copyWith(
fontSize: 18,
),
),
),
const Spacer(),
Text(
text,
style: Theme.of(context).textTheme.headline5?.copyWith(
style: Theme.of(context).textTheme.headlineSmall?.copyWith(
fontSize: 18,
),
),
Expand Down

0 comments on commit 8fe0da6

Please sign in to comment.