-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Change drawing_board to syncfusion_flutter_signaturepad
- Loading branch information
1 parent
72bedb8
commit 6de6aee
Showing
7 changed files
with
213 additions
and
197 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
{ | ||
"posts": [ | ||
{ | ||
"title": "고도현", | ||
"date": "2022.02.02", | ||
"content": "sfsdfsfwfewffsdfafawfsfsdfsfwfewffsdfafawfsfsdfsfwfewffsdfafawfsfsdfsfwfewffsdfafawf" | ||
}, | ||
{ | ||
"title": "Hello World", | ||
"date": "2022.02.02", | ||
"content": "sfsdfsfwfewffsdfafawfsfsdfsfwfewffsdfafawfsfsdfsfwfewffsdfafawfsfsdfsfwfewffsdfafawf" | ||
}, | ||
{ | ||
"title": "원호 hi", | ||
"date": "2022.02.02", | ||
"content": "sfsdfsfwfewffsdfafawfsfsdfsfwfewffsdfafawfsfsdfsfwfewffsdfafawfsfsdfsfwfewffsdfafawf" | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,75 +1,79 @@ | ||
import 'dart:ui'; | ||
|
||
import 'package:flutter/material.dart'; | ||
import 'package:flutter_drawing_board/flutter_drawing_board.dart'; | ||
import 'package:secret_diary/pages/home_page.dart'; | ||
import 'package:secret_diary/widgets/custom_button.dart'; | ||
import 'package:syncfusion_flutter_signaturepad/signaturepad.dart'; | ||
|
||
class SignInPage extends StatelessWidget { | ||
final DrawingController _drawingController = DrawingController( | ||
config: DrawConfig( | ||
color: Colors.black, | ||
paintType: PaintType.simpleLine, | ||
thickness: 6.0, | ||
angle: 0, | ||
), | ||
); | ||
final GlobalKey<SfSignaturePadState> _signaturePadKey = GlobalKey(); | ||
|
||
@override | ||
Widget build(BuildContext context) { | ||
return Scaffold( | ||
body: Stack( | ||
fit: StackFit.expand, | ||
children: [ | ||
Image.asset( | ||
'assets/background2.png', | ||
fit: BoxFit.fitHeight, | ||
color: Colors.grey.withOpacity(0.5), | ||
colorBlendMode: BlendMode.modulate, | ||
), | ||
Column( | ||
mainAxisAlignment: MainAxisAlignment.center, | ||
children: [ | ||
const Text( | ||
'Sign to Sign In', | ||
style: TextStyle( | ||
color: Colors.black, | ||
fontSize: 35, | ||
fontWeight: FontWeight.bold), | ||
), | ||
const SizedBox(height: 20), | ||
SizedBox( | ||
width: 350, | ||
height: 280, | ||
child: DrawingBoard( | ||
controller: _drawingController, | ||
background: Container( | ||
decoration: BoxDecoration( | ||
color: Colors.white, | ||
border: Border.all( | ||
width: 6, | ||
color: Colors.black, | ||
), | ||
backgroundColor: Colors.grey, | ||
body: Stack( | ||
fit: StackFit.expand, | ||
children: [ | ||
Image.asset( | ||
'assets/background2.png', | ||
fit: BoxFit.fitHeight, | ||
color: Colors.grey.withOpacity(0.5), | ||
colorBlendMode: BlendMode.modulate, | ||
), | ||
Column( | ||
mainAxisAlignment: MainAxisAlignment.center, | ||
children: [ | ||
const Text( | ||
'Sign to Sign In', | ||
style: TextStyle( | ||
color: Colors.black, | ||
fontSize: 35, | ||
fontWeight: FontWeight.bold), | ||
), | ||
const SizedBox(height: 20), | ||
Container( | ||
child: SfSignaturePad( | ||
key: _signaturePadKey, | ||
minimumStrokeWidth: 3, | ||
maximumStrokeWidth: 3, | ||
strokeColor: Colors.black, | ||
backgroundColor: Colors.white, | ||
), | ||
height: 200, | ||
width: 300, | ||
decoration: BoxDecoration( | ||
border: Border.all( | ||
width: 6, | ||
color: Colors.black, | ||
), | ||
), | ||
), | ||
), | ||
const SizedBox(height: 50), | ||
CustomButton( | ||
text: '로그인', | ||
backgroundColor: Colors.white, | ||
onPressed: () { | ||
Navigator.pop(context); | ||
Navigator.pop(context); | ||
Navigator.push( | ||
context, | ||
MaterialPageRoute( | ||
builder: (context) => HomePage(), | ||
), | ||
); | ||
}, | ||
), | ||
], | ||
), | ||
], | ||
)); | ||
const SizedBox(height: 50), | ||
CustomButton( | ||
text: '로그인', | ||
backgroundColor: Colors.white, | ||
onPressed: () async { | ||
// final data = await _signaturePadKey.currentState! | ||
// .toImage(pixelRatio: 3.0); | ||
// final bytes = | ||
// await data.toByteData(format: ImageByteFormat.png); | ||
// final image = bytes!.buffer.asUint8List(); | ||
|
||
Navigator.pop(context); | ||
Navigator.pop(context); | ||
Navigator.push( | ||
context, | ||
MaterialPageRoute( | ||
builder: (context) => HomePage(), | ||
), | ||
); | ||
}, | ||
), | ||
], | ||
), | ||
], | ||
), | ||
); | ||
} | ||
} |
Oops, something went wrong.