Skip to content
Merged
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
1 change: 0 additions & 1 deletion example/lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ class MyApp extends StatelessWidget {
);
}

//
class MyHomePage extends StatefulWidget {
@override
_MyHomePageState createState() => _MyHomePageState();
Expand Down
264 changes: 0 additions & 264 deletions example/pubspec.lock
Original file line number Diff line number Diff line change
@@ -1,264 +0,0 @@
# Generated by pub
# See https://dart.dev/tools/pub/glossary#lockfile
packages:
async:
dependency: transitive
description:
name: async
url: "https://pub.dartlang.org"
source: hosted
version: "2.5.0-nullsafety"
boolean_selector:
dependency: transitive
description:
name: boolean_selector
url: "https://pub.dartlang.org"
source: hosted
version: "2.1.0-nullsafety"
characters:
dependency: transitive
description:
name: characters
url: "https://pub.dartlang.org"
source: hosted
version: "1.1.0-nullsafety.2"
charcode:
dependency: transitive
description:
name: charcode
url: "https://pub.dartlang.org"
source: hosted
version: "1.2.0-nullsafety"
clock:
dependency: transitive
description:
name: clock
url: "https://pub.dartlang.org"
source: hosted
version: "1.1.0-nullsafety"
collection:
dependency: transitive
description:
name: collection
url: "https://pub.dartlang.org"
source: hosted
version: "1.15.0-nullsafety.2"
convert:
dependency: transitive
description:
name: convert
url: "https://pub.dartlang.org"
source: hosted
version: "2.1.1"
cupertino_icons:
dependency: "direct main"
description:
name: cupertino_icons
url: "https://pub.dartlang.org"
source: hosted
version: "0.1.3"
fake_async:
dependency: transitive
description:
name: fake_async
url: "https://pub.dartlang.org"
source: hosted
version: "1.1.0-nullsafety"
flutter:
dependency: "direct main"
description: flutter
source: sdk
version: "0.0.0"
flutter_svg:
dependency: "direct main"
description:
name: flutter_svg
url: "https://pub.dartlang.org"
source: hosted
version: "0.18.1"
flutter_test:
dependency: "direct dev"
description: flutter
source: sdk
version: "0.0.0"
flutter_web_plugins:
dependency: transitive
description: flutter
source: sdk
version: "0.0.0"
getwidget:
dependency: "direct main"
description:
path: ".."
relative: true
source: path
version: "1.1.3"
matcher:
dependency: transitive
description:
name: matcher
url: "https://pub.dartlang.org"
source: hosted
version: "0.12.10-nullsafety"
meta:
dependency: transitive
description:
name: meta
url: "https://pub.dartlang.org"
source: hosted
version: "1.3.0-nullsafety.2"
path:
dependency: transitive
description:
name: path
url: "https://pub.dartlang.org"
source: hosted
version: "1.8.0-nullsafety"
path_drawing:
dependency: transitive
description:
name: path_drawing
url: "https://pub.dartlang.org"
source: hosted
version: "0.4.1+1"
path_parsing:
dependency: transitive
description:
name: path_parsing
url: "https://pub.dartlang.org"
source: hosted
version: "0.1.4"
petitparser:
dependency: transitive
description:
name: petitparser
url: "https://pub.dartlang.org"
source: hosted
version: "3.0.4"
platform_detect:
dependency: transitive
description:
name: platform_detect
url: "https://pub.dartlang.org"
source: hosted
version: "1.4.0"
plugin_platform_interface:
dependency: transitive
description:
name: plugin_platform_interface
url: "https://pub.dartlang.org"
source: hosted
version: "1.0.2"
pub_semver:
dependency: transitive
description:
name: pub_semver
url: "https://pub.dartlang.org"
source: hosted
version: "1.4.4"
sky_engine:
dependency: transitive
description: flutter
source: sdk
version: "0.0.99"
source_span:
dependency: transitive
description:
name: source_span
url: "https://pub.dartlang.org"
source: hosted
version: "1.8.0-nullsafety"
stack_trace:
dependency: transitive
description:
name: stack_trace
url: "https://pub.dartlang.org"
source: hosted
version: "1.10.0-nullsafety"
stream_channel:
dependency: transitive
description:
name: stream_channel
url: "https://pub.dartlang.org"
source: hosted
version: "2.1.0-nullsafety"
string_scanner:
dependency: transitive
description:
name: string_scanner
url: "https://pub.dartlang.org"
source: hosted
version: "1.1.0-nullsafety"
term_glyph:
dependency: transitive
description:
name: term_glyph
url: "https://pub.dartlang.org"
source: hosted
version: "1.2.0-nullsafety"
test_api:
dependency: transitive
description:
name: test_api
url: "https://pub.dartlang.org"
source: hosted
version: "0.2.19-nullsafety"
typed_data:
dependency: transitive
description:
name: typed_data
url: "https://pub.dartlang.org"
source: hosted
version: "1.3.0-nullsafety.2"
url_launcher:
dependency: "direct main"
description:
name: url_launcher
url: "https://pub.dartlang.org"
source: hosted
version: "5.5.3"
url_launcher_linux:
dependency: transitive
description:
name: url_launcher_linux
url: "https://pub.dartlang.org"
source: hosted
version: "0.0.1+1"
url_launcher_macos:
dependency: transitive
description:
name: url_launcher_macos
url: "https://pub.dartlang.org"
source: hosted
version: "0.0.1+7"
url_launcher_platform_interface:
dependency: transitive
description:
name: url_launcher_platform_interface
url: "https://pub.dartlang.org"
source: hosted
version: "1.0.8"
url_launcher_web:
dependency: transitive
description:
name: url_launcher_web
url: "https://pub.dartlang.org"
source: hosted
version: "0.1.3+2"
vector_math:
dependency: transitive
description:
name: vector_math
url: "https://pub.dartlang.org"
source: hosted
version: "2.1.0-nullsafety.2"
xml:
dependency: transitive
description:
name: xml
url: "https://pub.dartlang.org"
source: hosted
version: "4.2.0"
sdks:
dart: ">=2.10.0-0.0.dev <2.10.0"
flutter: ">=1.18.0-6.0.pre <2.0.0"
76 changes: 76 additions & 0 deletions lib/components/border/gf_border.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
import 'dart:ui';
import 'package:flutter/material.dart';
import 'package:getwidget/components/border/gf_dashed_border.dart';
import 'package:getwidget/types/gf_border_type.dart';

class GFBorder extends StatelessWidget {
GFBorder({
@required this.child,
this.color = Colors.black,
this.strokeWidth = 1,
this.type = GFBorderType.Rect,
this.dashedLine = const <double>[3, 1],
this.padding = const EdgeInsets.all(10),
this.radius = const Radius.circular(0),
this.customPath,
}) : assert(child != null),
assert(_isValiddashedLine(dashedLine), 'Invalid dash pattern');

/// child of type [Widget] which can be any component or text , etc
final Widget child;

/// padding of time [EdgeInsets] where in padding is given to the border types
final EdgeInsets padding;

/// storkeWidth of type [double] which is used to define the thickness of the border
final double strokeWidth;

/// color of type [Color] or GFColor which is used to change the color of the border type
final Color color;

/// dashedLine of type [List<double>] which is used for the linear and simple dashed line of border
final List<double> dashedLine;

/// type of [GFBorderType] which is used to define the different types of borders ie, circle, Rect, RRect and oval
final GFBorderType type;

/// radius of type [Radius] used to give a curved border only when the border type is RRect, in other cases radius will not work
final Radius radius;

/// customPath of type [PathBuilder] used for drawing the paths
final PathBuilder customPath;

@override
Widget build(BuildContext context) => Stack(
children: <Widget>[
Positioned.fill(
child: CustomPaint(
painter: DashedType(
strokeWidth: strokeWidth,
radius: radius,
color: color,
type: type,
dashedLine: dashedLine,
customPath: customPath,
),
),
),
Container(padding: padding, child: child),
],
);
}

/// the value of dashedLine cannot be 0 or null, it should have some definite and proper value
bool _isValiddashedLine(List<double> dash) {
final Set<double> _dashSet = dash.toSet();
if (_dashSet == null) {
return false;
}
if (_dashSet.length == 1 && _dashSet.elementAt(0) == 0.0) {
return false;
}
if (_dashSet.isEmpty) {
return false;
}
return true;
}
Loading