Skip to content
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
70 changes: 68 additions & 2 deletions lib/modules/lab/pages/lab_page.dart
Original file line number Diff line number Diff line change
@@ -1,12 +1,78 @@
import 'package:flutter/gestures.dart';
import 'package:flutter/material.dart';
import 'package:hand_signature/signature.dart';

class LabPage extends StatelessWidget {
const LabPage({super.key});

@override
Widget build(BuildContext context) {
return const Center(
child: Text('Play around with gestures on this page'),
return DefaultTabController(
initialIndex: 1,
length: 3,
child: TabBarView(
children: [
Container(height: 200, color: Colors.pink),
ListView(
children: [
Column(
children: [
Row(
children: const [
Flexible(
child: Text(
'The grey section is the signature pad which should absorb all gestures, on mobile this will look a bit funky at the moment'),
),
],
),
const SignatureSection(),
...List.generate(
20,
(index) {
return Container(height: 300, width: 300, color: index.isEven ? Colors.red : Colors.blue);
},
),
],
),
],
),
Container(height: 200, color: Colors.green),
],
),
);
}
}

class SignatureSection extends StatefulWidget {
const SignatureSection({
Key? key,
}) : super(key: key);

@override
State<SignatureSection> createState() => _SignatureSectionState();
}

class _SignatureSectionState extends State<SignatureSection> {
final control = HandSignatureControl();

@override
Widget build(BuildContext context) {
return Container(
color: Colors.grey[200],
height: 300,
width: 300,
child: RawGestureDetector(
gestures: {
EagerGestureRecognizer:
GestureRecognizerFactoryWithHandlers<EagerGestureRecognizer>(
() => EagerGestureRecognizer(),
(EagerGestureRecognizer instance) {})
},
child: HandSignature(
control: control,
type: SignatureDrawType.shape,
),
),
);
}
}
43 changes: 43 additions & 0 deletions pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,13 @@ packages:
url: "https://pub.dartlang.org"
source: hosted
version: "2.0.1"
flutter_svg:
dependency: transitive
description:
name: flutter_svg
url: "https://pub.dartlang.org"
source: hosted
version: "1.1.4"
flutter_test:
dependency: "direct dev"
description: flutter
Expand All @@ -137,6 +144,13 @@ packages:
url: "https://pub.dartlang.org"
source: hosted
version: "2.1.0"
hand_signature:
dependency: "direct main"
description:
name: hand_signature
url: "https://pub.dartlang.org"
source: hosted
version: "2.3.0+1"
http_multi_server:
dependency: transitive
description:
Expand Down Expand Up @@ -235,6 +249,27 @@ packages:
url: "https://pub.dartlang.org"
source: hosted
version: "1.8.2"
path_drawing:
dependency: transitive
description:
name: path_drawing
url: "https://pub.dartlang.org"
source: hosted
version: "1.0.1"
path_parsing:
dependency: transitive
description:
name: path_parsing
url: "https://pub.dartlang.org"
source: hosted
version: "1.0.1"
petitparser:
dependency: transitive
description:
name: petitparser
url: "https://pub.dartlang.org"
source: hosted
version: "5.0.0"
pool:
dependency: transitive
description:
Expand Down Expand Up @@ -394,6 +429,13 @@ packages:
url: "https://pub.dartlang.org"
source: hosted
version: "1.1.0"
xml:
dependency: transitive
description:
name: xml
url: "https://pub.dartlang.org"
source: hosted
version: "6.1.0"
yaml:
dependency: transitive
description:
Expand All @@ -403,3 +445,4 @@ packages:
version: "3.1.1"
sdks:
dart: ">=2.17.5 <3.0.0"
flutter: ">=2.11.0-0.1.pre"
1 change: 1 addition & 0 deletions pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ dependencies:
cupertino_icons: ^1.0.2
mocktail: ^0.3.0
font_awesome_flutter: ^10.2.1
hand_signature: ^2.3.0+1

dev_dependencies:
flutter_test:
Expand Down