Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Flutter][3.27.1] Fix SDK dependency #276

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
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
9 changes: 4 additions & 5 deletions example/lib/accessibility/neumorphic_accessibility.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import 'package:example/lib/color_selector.dart';
import 'package:flutter/material.dart';
import 'package:flutter_neumorphic/flutter_neumorphic.dart';

class NeumorphicAccessibility extends StatefulWidget {
Expand Down Expand Up @@ -71,7 +70,7 @@ class __PageState extends State<_Page> {
child: RaisedButton(
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(12)),
color: Theme.of(context).accentColor,
color: Theme.of(context).colorScheme.secondary,
child: Text(
"back",
style: TextStyle(color: Colors.white),
Expand Down Expand Up @@ -104,11 +103,11 @@ class __PageState extends State<_Page> {
int selectedConfiguratorIndex = 0;

Widget _configurators() {
final Color buttonActiveColor = Theme.of(context).accentColor;
final Color buttonActiveColor = Theme.of(context).colorScheme.secondary;
final Color buttonInnactiveColor = Colors.white;

final Color textActiveColor = Colors.white;
final Color textInactiveColor = Colors.black.withOpacity(0.3);
final Color textInactiveColor = Colors.black.withValues(alpha: 0.3);

return Card(
margin: EdgeInsets.all(8),
Expand Down Expand Up @@ -513,7 +512,7 @@ class __PageState extends State<_Page> {
}

Widget shapeWidget() {
final Color buttonActiveColor = Theme.of(context).accentColor;
final Color buttonActiveColor = Theme.of(context).colorScheme.secondary;
final Color buttonInnactiveColor = Colors.white;

final Color iconActiveColor = Colors.white;
Expand Down
2 changes: 0 additions & 2 deletions example/lib/lib/back_button.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import 'package:flutter/material.dart';
import 'package:flutter/widgets.dart';
import 'package:flutter_neumorphic/flutter_neumorphic.dart';

class NeumorphicBack extends StatelessWidget {
Expand Down
8 changes: 4 additions & 4 deletions example/lib/playground/neumorphic_playground.dart
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ class __PageState extends State<_Page> {
child: RaisedButton(
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(12)),
color: Theme.of(context).accentColor,
color: Theme.of(context).colorScheme.secondary,
child: Text(
"back",
style: TextStyle(color: Colors.white),
Expand Down Expand Up @@ -102,7 +102,7 @@ class __PageState extends State<_Page> {
int selectedConfiguratorIndex = 0;

Widget _configurators() {
final Color buttonActiveColor = Theme.of(context).accentColor;
final Color buttonActiveColor = Theme.of(context).colorScheme.secondary;
final Color buttonInnactiveColor = Colors.white;

final Color textActiveColor = Colors.white;
Expand Down Expand Up @@ -622,7 +622,7 @@ class __PageState extends State<_Page> {
}

Widget boxshapeWidget() {
final Color buttonActiveColor = Theme.of(context).accentColor;
final Color buttonActiveColor = Theme.of(context).colorScheme.secondary;
final Color buttonInnactiveColor = Colors.white;

final Color textActiveColor = Colors.white;
Expand Down Expand Up @@ -756,7 +756,7 @@ class __PageState extends State<_Page> {
}

Widget shapeWidget() {
final Color buttonActiveColor = Theme.of(context).accentColor;
final Color buttonActiveColor = Theme.of(context).colorScheme.secondary;
final Color buttonInnactiveColor = Colors.white;

final Color iconActiveColor = Colors.white;
Expand Down
9 changes: 4 additions & 5 deletions example/lib/playground/text_playground.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import 'package:example/lib/color_selector.dart';
import 'package:flutter/material.dart';
import 'package:flutter_neumorphic/flutter_neumorphic.dart';

class NeumorphicTextPlayground extends StatefulWidget {
Expand Down Expand Up @@ -92,7 +91,7 @@ class __PageState extends State<_Page> {
child: RaisedButton(
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(12)),
color: Theme.of(context).accentColor,
color: Theme.of(context).colorScheme.secondary,
child: Text(
"back",
style: TextStyle(color: Colors.white),
Expand Down Expand Up @@ -125,7 +124,7 @@ class __PageState extends State<_Page> {
int selectedConfiguratorIndex = 0;

Widget _configurators() {
final Color buttonActiveColor = Theme.of(context).accentColor;
final Color buttonActiveColor = Theme.of(context).colorScheme.secondary;
final Color buttonInnactiveColor = Colors.white;

final Color textActiveColor = Colors.white;
Expand Down Expand Up @@ -238,7 +237,7 @@ class __PageState extends State<_Page> {
}

Widget shapeWidget() {
final Color buttonActiveColor = Theme.of(context).accentColor;
final Color buttonActiveColor = Theme.of(context).colorScheme.secondary;
final Color buttonInnactiveColor = Colors.white;

final Color iconActiveColor = Colors.white;
Expand Down Expand Up @@ -444,7 +443,7 @@ class __PageState extends State<_Page> {
}

FontWeight _fontWeight() {
switch ((this.fontWeight / 100).toInt()) {
switch (this.fontWeight ~/ 100) {
case 1:
return FontWeight.w100;
case 2:
Expand Down
6 changes: 2 additions & 4 deletions example/lib/sample_neumorphic_playground.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import 'package:example/lib/color_selector.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter_neumorphic/flutter_neumorphic.dart';

void main() => runApp(NeumorphicPlayground());
Expand Down Expand Up @@ -85,7 +83,7 @@ class __PageState extends State<_Page> {
}

Widget _configurators() {
final Color buttonActiveColor = Theme.of(context).accentColor;
final Color buttonActiveColor = Theme.of(context).colorScheme.secondary;
final Color buttonInnactiveColor = Colors.white;

final Color textActiveColor = Colors.white;
Expand Down Expand Up @@ -246,7 +244,7 @@ class __PageState extends State<_Page> {
}

Widget shapeWidget() {
final Color buttonActiveColor = Theme.of(context).accentColor;
final Color buttonActiveColor = Theme.of(context).colorScheme.secondary;
final Color buttonInnactiveColor = Colors.white;

final Color iconActiveColor = Colors.white;
Expand Down
1 change: 0 additions & 1 deletion example/lib/samples/galaxy_sample.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import 'package:example/lib/ThemeConfigurator.dart';
import 'package:example/lib/top_bar.dart';
import 'package:flutter/material.dart';
import 'package:flutter_neumorphic/flutter_neumorphic.dart';

class GalaxySample extends StatelessWidget {
Expand Down
4 changes: 0 additions & 4 deletions example/lib/samples/testla_sample.dart
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
import 'dart:ui';

import 'package:flutter/material.dart';
import 'package:flutter/widgets.dart';
import 'package:flutter_neumorphic/flutter_neumorphic.dart';

class TeslaSample extends StatefulWidget {
Expand Down
3 changes: 1 addition & 2 deletions example/lib/widgets/range_slider/widget_range_slider.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,10 @@ import 'package:example/lib/Code.dart';
import 'package:example/lib/ThemeConfigurator.dart';
import 'package:example/lib/color_selector.dart';
import 'package:example/lib/top_bar.dart';
import 'package:flutter/material.dart';
import 'package:flutter_neumorphic/flutter_neumorphic.dart';

class RangeSliderWidgetPage extends StatefulWidget {
RangeSliderWidgetPage({Key key}) : super(key: key);
RangeSliderWidgetPage({required Key key}) : super(key: key);

@override
createState() => _RangeWidgetPageState();
Expand Down
3 changes: 1 addition & 2 deletions example/lib/widgets/switch/widget_switch.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,10 @@ import 'package:example/lib/Code.dart';
import 'package:example/lib/ThemeConfigurator.dart';
import 'package:example/lib/color_selector.dart';
import 'package:example/lib/top_bar.dart';
import 'package:flutter/material.dart';
import 'package:flutter_neumorphic/flutter_neumorphic.dart';

class SwitchWidgetPage extends StatefulWidget {
SwitchWidgetPage({Key key}) : super(key: key);
SwitchWidgetPage({required Key key}) : super(key: key);

@override
createState() => _WidgetPageState();
Expand Down
3 changes: 1 addition & 2 deletions example/lib/widgets/toggle/widget_toggle.dart
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
import 'package:example/lib/Code.dart';
import 'package:example/lib/ThemeConfigurator.dart';
import 'package:example/lib/top_bar.dart';
import 'package:flutter/material.dart';
import 'package:flutter_neumorphic/flutter_neumorphic.dart';

class ToggleWidgetPage extends StatefulWidget {
ToggleWidgetPage({Key key}) : super(key: key);
ToggleWidgetPage({required Key key}) : super(key: key);

@override
createState() => _WidgetPageState();
Expand Down
3 changes: 1 addition & 2 deletions example/lib/widgets/widgets_home.dart
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import 'package:example/lib/top_bar.dart';
import 'package:example/widgets/appbar/widget_app_bar.dart';
import 'package:example/widgets/toggle/widget_toggle.dart';
import 'package:flutter/material.dart';
import 'package:flutter_neumorphic/flutter_neumorphic.dart';

import 'background/widget_background.dart';
Expand All @@ -18,7 +17,7 @@ import 'slider/widget_slider.dart';
import 'switch/widget_switch.dart';

class WidgetsHome extends StatelessWidget {
Widget _buildButton({String text, VoidCallback onClick}) {
Widget _buildButton({required String text, required VoidCallback onClick}) {
return NeumorphicButton(
margin: EdgeInsets.only(bottom: 12),
padding: EdgeInsets.symmetric(
Expand Down
2 changes: 0 additions & 2 deletions example/macos/Flutter/GeneratedPluginRegistrant.swift
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@
// Generated file. Do not edit.
//

// clang-format off

import FlutterMacOS
import Foundation

Expand Down
2 changes: 1 addition & 1 deletion example/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ description: A new Flutter project.
version: 1.0.0+1

environment:
sdk: ">=2.6.0 <3.0.0"
sdk: '>=3.2.6 <4.0.0'

dependencies:
flutter:
Expand Down
4 changes: 2 additions & 2 deletions lib/src/colors.dart
Original file line number Diff line number Diff line change
Expand Up @@ -85,11 +85,11 @@ class NeumorphicColors {

static Color _applyPercentageOnOpacity(
{required Color maxColor, required double percent}) {
final maxOpacity = maxColor.opacity;
final maxOpacity = maxColor.a;
final maxIntensity = Neumorphic.MAX_INTENSITY;
final newOpacity = percent * maxOpacity / maxIntensity;
final newColor =
maxColor.withOpacity(newOpacity); //<-- intensity act on opacity;
maxColor.withValues(alpha: newOpacity); //<-- intensity act on opacity;
return newColor;
}
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import 'dart:math';
import 'dart:ui';

import '../../../flutter_neumorphic.dart';

Expand Down
2 changes: 0 additions & 2 deletions lib/src/decoration/cache/neumorphic_emboss_painter_cache.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import 'dart:ui';

import '../../../flutter_neumorphic.dart';
import 'abstract_neumorphic_painter_cache.dart';

Expand Down
2 changes: 0 additions & 2 deletions lib/src/decoration/cache/neumorphic_painter_cache.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import 'dart:ui';

import '../../../flutter_neumorphic.dart';
import 'abstract_neumorphic_painter_cache.dart';

Expand Down
1 change: 0 additions & 1 deletion lib/src/decoration/neumorphic_decoration_painter.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
import 'package:flutter/painting.dart';

Expand Down
4 changes: 0 additions & 4 deletions lib/src/decoration/neumorphic_emboss_decoration_painter.dart
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
import 'dart:ui';

import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
import 'package:flutter/painting.dart';

import '../neumorphic_box_shape.dart';
import '../theme/theme.dart';
Expand Down
1 change: 0 additions & 1 deletion lib/src/decoration/neumorphic_text_decoration_painter.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import 'dart:ui' as ui;

import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
import 'package:flutter/painting.dart';

Expand Down
2 changes: 0 additions & 2 deletions lib/src/neumorphic_box_shape.dart
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
import 'package:flutter/widgets.dart';
import 'package:flutter_neumorphic/flutter_neumorphic.dart';
import 'package:flutter_neumorphic/src/shape/rrect_path_provider.dart';
import 'package:flutter_neumorphic/src/shape/stadium_path_provider.dart';

import 'shape/beveled_path_provider.dart';
import 'shape/circle_path_provider.dart';
import 'shape/neumorphic_path_provider.dart';
import 'shape/rect_path_provider.dart';

export 'shape/path/flutter_logo_path_provider.dart';
Expand Down
4 changes: 2 additions & 2 deletions lib/src/shape/beveled_path_provider.dart
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import '../../flutter_neumorphic.dart';
import 'neumorphic_path_provider.dart';
import 'dart:math' as math;

import '../../flutter_neumorphic.dart';

class BeveledPathProvider extends NeumorphicPathProvider {
final BorderRadius borderRadius;

Expand Down
1 change: 0 additions & 1 deletion lib/src/shape/circle_path_provider.dart
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import 'dart:math';

import '../../flutter_neumorphic.dart';
import 'neumorphic_path_provider.dart';

class CirclePathProvider extends NeumorphicPathProvider {
const CirclePathProvider({Listenable? reclip});
Expand Down
1 change: 0 additions & 1 deletion lib/src/shape/rect_path_provider.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import '../../flutter_neumorphic.dart';
import 'neumorphic_path_provider.dart';

class RectPathProvider extends NeumorphicPathProvider {
const RectPathProvider({Listenable? reclip});
Expand Down
1 change: 0 additions & 1 deletion lib/src/shape/rrect_path_provider.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import '../../flutter_neumorphic.dart';
import 'neumorphic_path_provider.dart';

class RRectPathProvider extends NeumorphicPathProvider {
final BorderRadius borderRadius;
Expand Down
3 changes: 0 additions & 3 deletions lib/src/theme/app_bar.dart
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
import 'dart:io';

import 'package:flutter/material.dart';
import 'package:flutter/widgets.dart';

import 'package:flutter_neumorphic/flutter_neumorphic.dart';

@immutable
Expand Down
5 changes: 0 additions & 5 deletions lib/src/theme/inherited_neumorphic_theme.dart
Original file line number Diff line number Diff line change
@@ -1,10 +1,5 @@
import 'package:flutter/foundation.dart';
import 'package:flutter/widgets.dart';
import 'package:flutter_neumorphic/flutter_neumorphic.dart';

import 'theme.dart';
import 'theme_wrapper.dart';

export 'theme.dart';
export 'theme_wrapper.dart';

Expand Down
7 changes: 0 additions & 7 deletions lib/src/theme/neumorphic_theme.dart
Original file line number Diff line number Diff line change
@@ -1,10 +1,4 @@
import 'package:flutter/material.dart';
import 'package:flutter/widgets.dart';

import '../../flutter_neumorphic.dart';
import 'inherited_neumorphic_theme.dart';
import 'theme.dart';
import 'theme_wrapper.dart';

export 'inherited_neumorphic_theme.dart';
export 'theme.dart';
Expand Down Expand Up @@ -106,7 +100,6 @@ class NeumorphicTheme extends StatefulWidget {
}

static double? embossDepth(BuildContext context) {
if (currentTheme(context).depth == null) return null;
return -currentTheme(context).depth.abs();
}

Expand Down
9 changes: 0 additions & 9 deletions lib/src/theme/theme.dart
Original file line number Diff line number Diff line change
@@ -1,15 +1,6 @@
import 'dart:ui';

import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart' show IconThemeData, TextTheme;
import 'package:flutter/painting.dart';
import 'package:flutter_neumorphic/src/theme/app_bar.dart';
import 'package:flutter_neumorphic/src/widget/container.dart';

import '../../flutter_neumorphic.dart';
import '../colors.dart';
import '../light_source.dart';
import '../shape.dart';

export '../colors.dart';
export '../light_source.dart';
Expand Down
Loading