Skip to content

Commit

Permalink
removed material dependency
Browse files Browse the repository at this point in the history
  • Loading branch information
Florent Champigny committed Apr 29, 2020
1 parent dc40eeb commit db70fc7
Show file tree
Hide file tree
Showing 9 changed files with 77 additions and 75 deletions.
2 changes: 1 addition & 1 deletion example/ios/Flutter/.last_build_id
Original file line number Diff line number Diff line change
@@ -1 +1 @@
cfef159417496ef16f851b4f7d1f3939
6595ea39b2066adf130c119d8cae71e7
2 changes: 1 addition & 1 deletion example/pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ packages:
path: ".."
relative: true
source: path
version: "1.0.4"
version: "1.0.7"
flutter_test:
dependency: "direct dev"
description: flutter
Expand Down
Binary file added fonts/NeumorphicIcons.ttf
Binary file not shown.
16 changes: 16 additions & 0 deletions fonts/neumorphic_icons_config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"name": "NeumorphicIcons",
"css_prefix_text": "",
"css_use_suffix": false,
"hinting": true,
"units_per_em": 1000,
"ascent": 850,
"glyphs": [
{
"uid": "83b1dd96a1760c9d049edbba9b96f2b2",
"css": "check",
"code": 59392,
"src": "material"
}
]
}
33 changes: 14 additions & 19 deletions lib/src/colors.dart
Original file line number Diff line number Diff line change
@@ -1,38 +1,33 @@
import 'dart:ui';

import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart' as material;
import 'package:flutter/painting.dart';
import 'package:flutter_neumorphic/src/widget/container.dart';

/// Defines default colors used in Neumorphic theme & shadows generators
@immutable
class NeumorphicColors {
static const background = Color(0xFFDDE6E8);
static const accent = material.Colors.blue;
static const variant = material.Colors.cyan;
static const disabled = material.Colors.grey;
static const accent = Color(0xFF2196F3);
static const variant = Color(0xFF00BCD4);
static const disabled = Color(0xFF9E9E9E);

static const darkBackground = Color(0xFF2D2F2F);
static const darkAccent = material.Colors.green;
static const darkVariant = material.Colors.blueGrey;
static const darkDisabled = material.Colors.white70;
static const darkDefaultTextColor = material.Colors.white70;
static const darkAccent = Color(0xFF4CAF50);
static const darkVariant = Color(0xFF607D8B);
static const darkDisabled = Color(0xB3FFFFFF);
static const darkDefaultTextColor = Color(0xB3FFFFFF);

static const Color decorationMaxWhiteColor =
material.Colors.white; //for intensity = 1
static const Color decorationMaxDarkColor =
material.Colors.black54; //for intensity = 1
static const Color decorationMaxWhiteColor = Color(0xFFFFFFFF); //for intensity = 1
static const Color decorationMaxDarkColor = Color(0x8A000000); //for intensity = 1

static const Color embossMaxWhiteColor =
material.Colors.white60; //for intensity = 1
static const Color embossMaxDarkColor =
material.Colors.black45; //for intensity = 1
static const Color embossMaxWhiteColor = Color(0x99FFFFFF); //for intensity = 1
static const Color embossMaxDarkColor = Color(0x73000000); //for intensity = 1

static const Color _gradientShaderDarkColor = material.Colors.black54;
static const Color _gradientShaderWhiteColor = material.Colors.white;
static const Color _gradientShaderDarkColor = Color(0x8A000000);
static const Color _gradientShaderWhiteColor = Color(0xFFFFFFFF);

static const Color defaultTextColor = material.Colors.black;
static const Color defaultTextColor = Color(0xFF000000);

NeumorphicColors._();

Expand Down
29 changes: 29 additions & 0 deletions lib/src/neumorphic_icons.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
/// Flutter icons NeumorphicIcons
/// Copyright (C) 2020 by original authors @ fluttericon.com, fontello.com
/// This font was generated by FlutterIcon.com, which is derived from Fontello.
///
/// To use this font, place it in your fonts/ directory and include the
/// following in your pubspec.yaml
///
/// flutter:
/// fonts:
/// - family: NeumorphicIcons
/// fonts:
/// - asset: fonts/NeumorphicIcons.ttf
///
///
/// * Material Design Icons, Copyright (C) Google, Inc
/// Author: Google
/// License: Apache 2.0 (https://www.apache.org/licenses/LICENSE-2.0)
/// Homepage: https://design.google.com/icons/
///
import 'package:flutter/widgets.dart';

class NeumorphicIcons {
NeumorphicIcons._();

static const _kFontFam = 'NeumorphicIcons';
static const _kFontPkg = "flutter_neumorphic";

static const IconData check = IconData(0xe800, fontFamily: _kFontFam, fontPackage: _kFontPkg);
}
4 changes: 2 additions & 2 deletions lib/src/widget/checkbox.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import 'package:flutter/material.dart' as material;
import 'package:flutter/widgets.dart';
import 'package:flutter_neumorphic/src/neumorphic_icons.dart';
import 'package:flutter_neumorphic/src/widget/container.dart';

import '../NeumorphicBoxShape.dart';
Expand Down Expand Up @@ -181,7 +181,7 @@ class NeumorphicCheckbox extends StatelessWidget {
minDistance: selectedDepth.abs(),
boxShape: NeumorphicBoxShape.roundRect(BorderRadius.circular(5),),
child: Icon(
material.Icons.check,
NeumorphicIcons.check,
color: iconColor,
size: 20.0,
),
Expand Down
62 changes: 10 additions & 52 deletions pubspec.lock
Original file line number Diff line number Diff line change
@@ -1,20 +1,6 @@
# Generated by pub
# See https://dart.dev/tools/pub/glossary#lockfile
packages:
archive:
dependency: transitive
description:
name: archive
url: "https://pub.dartlang.org"
source: hosted
version: "2.0.13"
args:
dependency: transitive
description:
name: args
url: "https://pub.dartlang.org"
source: hosted
version: "1.6.0"
async:
dependency: transitive
description:
Expand All @@ -36,27 +22,27 @@ packages:
url: "https://pub.dartlang.org"
source: hosted
version: "1.1.3"
collection:
clock:
dependency: transitive
description:
name: collection
name: clock
url: "https://pub.dartlang.org"
source: hosted
version: "1.14.12"
convert:
version: "1.0.1"
collection:
dependency: transitive
description:
name: convert
name: collection
url: "https://pub.dartlang.org"
source: hosted
version: "2.1.1"
crypto:
version: "1.14.12"
fake_async:
dependency: transitive
description:
name: crypto
name: fake_async
url: "https://pub.dartlang.org"
source: hosted
version: "2.1.4"
version: "1.1.0"
flutter:
dependency: "direct main"
description: flutter
Expand All @@ -67,13 +53,6 @@ packages:
description: flutter
source: sdk
version: "0.0.0"
image:
dependency: transitive
description:
name: image
url: "https://pub.dartlang.org"
source: hosted
version: "2.1.12"
matcher:
dependency: transitive
description:
Expand All @@ -94,21 +73,7 @@ packages:
name: path
url: "https://pub.dartlang.org"
source: hosted
version: "1.6.4"
petitparser:
dependency: transitive
description:
name: petitparser
url: "https://pub.dartlang.org"
source: hosted
version: "2.4.0"
quiver:
dependency: transitive
description:
name: quiver
url: "https://pub.dartlang.org"
source: hosted
version: "2.1.3"
version: "1.7.0"
sky_engine:
dependency: transitive
description: flutter
Expand Down Expand Up @@ -170,12 +135,5 @@ packages:
url: "https://pub.dartlang.org"
source: hosted
version: "2.0.8"
xml:
dependency: transitive
description:
name: xml
url: "https://pub.dartlang.org"
source: hosted
version: "3.6.1"
sdks:
dart: ">=2.6.0 <3.0.0"
4 changes: 4 additions & 0 deletions pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,7 @@ dev_dependencies:
sdk: flutter

flutter:
fonts:
- family: NeumorphicIcons
fonts:
- asset: fonts/NeumorphicIcons.ttf

0 comments on commit db70fc7

Please sign in to comment.