Add printer, add border to array
This commit is contained in:
parent
fb11550ecc
commit
e0ebd82bef
Binary file not shown.
After Width: | Height: | Size: 460 B |
|
@ -3,6 +3,7 @@ import 'package:flutter/services.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:gecko/models/generateWallets.dart';
|
import 'package:gecko/models/generateWallets.dart';
|
||||||
import 'package:gecko/screens/commonElements.dart';
|
import 'package:gecko/screens/commonElements.dart';
|
||||||
|
import 'package:printing/printing.dart';
|
||||||
import 'package:provider/provider.dart';
|
import 'package:provider/provider.dart';
|
||||||
|
|
||||||
// ignore: must_be_immutable
|
// ignore: must_be_immutable
|
||||||
|
@ -70,7 +71,7 @@ class OnboardingStepNine extends StatelessWidget {
|
||||||
fontWeight: FontWeight.w500),
|
fontWeight: FontWeight.w500),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
SizedBox(height: 64),
|
SizedBox(height: 50),
|
||||||
// TextField(
|
// TextField(
|
||||||
// enabled: false,
|
// enabled: false,
|
||||||
// controller: _generateWalletProvider.mnemonicController,
|
// controller: _generateWalletProvider.mnemonicController,
|
||||||
|
@ -84,6 +85,21 @@ class OnboardingStepNine extends StatelessWidget {
|
||||||
// color: Colors.black,
|
// color: Colors.black,
|
||||||
// fontWeight: FontWeight.w400)),
|
// fontWeight: FontWeight.w400)),
|
||||||
sentanceArray(context),
|
sentanceArray(context),
|
||||||
|
SizedBox(height: 15),
|
||||||
|
GestureDetector(
|
||||||
|
onTap: () {
|
||||||
|
Navigator.push(
|
||||||
|
context,
|
||||||
|
MaterialPageRoute(builder: (context) {
|
||||||
|
return PrintWallet(
|
||||||
|
_generateWalletProvider.generatedMnemonic);
|
||||||
|
}),
|
||||||
|
);
|
||||||
|
},
|
||||||
|
child: Image.asset(
|
||||||
|
'assets/printer.png',
|
||||||
|
),
|
||||||
|
),
|
||||||
Expanded(
|
Expanded(
|
||||||
child: Align(
|
child: Align(
|
||||||
alignment: Alignment.bottomCenter,
|
alignment: Alignment.bottomCenter,
|
||||||
|
@ -102,7 +118,7 @@ class OnboardingStepNine extends StatelessWidget {
|
||||||
child: Text("Choisir une autre phrase",
|
child: Text("Choisir une autre phrase",
|
||||||
style: TextStyle(fontSize: 20))),
|
style: TextStyle(fontSize: 20))),
|
||||||
))),
|
))),
|
||||||
SizedBox(height: 20),
|
SizedBox(height: 25),
|
||||||
SizedBox(
|
SizedBox(
|
||||||
width: 350,
|
width: 350,
|
||||||
height: 55,
|
height: 55,
|
||||||
|
@ -171,6 +187,7 @@ Widget sentanceArray(BuildContext context) {
|
||||||
padding: EdgeInsets.symmetric(horizontal: 12),
|
padding: EdgeInsets.symmetric(horizontal: 12),
|
||||||
child: Container(
|
child: Container(
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
|
border: Border.all(color: Colors.black),
|
||||||
color: Colors.grey[300],
|
color: Colors.grey[300],
|
||||||
borderRadius: BorderRadius.all(
|
borderRadius: BorderRadius.all(
|
||||||
const Radius.circular(10),
|
const Radius.circular(10),
|
||||||
|
@ -207,7 +224,6 @@ Widget sentanceArray(BuildContext context) {
|
||||||
}
|
}
|
||||||
|
|
||||||
Widget arrayCell(dataWord) {
|
Widget arrayCell(dataWord) {
|
||||||
print(dataWord);
|
|
||||||
return Container(
|
return Container(
|
||||||
width: 80,
|
width: 80,
|
||||||
child: Column(children: <Widget>[
|
child: Column(children: <Widget>[
|
||||||
|
@ -217,3 +233,24 @@ Widget arrayCell(dataWord) {
|
||||||
style: TextStyle(fontSize: 16, color: Colors.black)),
|
style: TextStyle(fontSize: 16, color: Colors.black)),
|
||||||
]));
|
]));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// ignore: must_be_immutable
|
||||||
|
class PrintWallet extends StatelessWidget {
|
||||||
|
PrintWallet(this.sentence);
|
||||||
|
|
||||||
|
final String sentence;
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
GenerateWalletsProvider _generateWalletProvider =
|
||||||
|
Provider.of<GenerateWalletsProvider>(context);
|
||||||
|
return MaterialApp(
|
||||||
|
home: Scaffold(
|
||||||
|
appBar: AppBar(title: Text('Imprimer ce trousseau')),
|
||||||
|
body: PdfPreview(
|
||||||
|
build: (format) => _generateWalletProvider.printWallet(sentence),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in New Issue