flutter_puzzle_vcode 0.0.3
flutter_puzzle_vcode: ^0.0.3 copied to clipboard
refer to vue-puzzle-vcode,flutter project, not dependent on other SDKS
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter/widgets.dart';
import 'package:flutter_puzzle_vcode/flutter_puzzle_vcode.dart';
void main() {
runApp(const MyApp());
}
class MyApp extends StatelessWidget {
const MyApp({super.key});
// This widget is the root of your application.
@override
Widget build(BuildContext context) {
return const MaterialApp(
title: 'Flutter Demo',
home: MyHomePage(title: 'Flutter Demo Home Page'),
);
}
}
class MyHomePage extends StatefulWidget {
const MyHomePage({super.key, required this.title});
final String title;
@override
State<MyHomePage> createState() => _MyHomePageState();
}
class _MyHomePageState extends State<MyHomePage> {
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text(widget.title),
),
body: Center(
child: CupertinoButton(
child: Container(
width: 100,
height: 40,
alignment: Alignment.center,
decoration: BoxDecoration(
color: Colors.deepPurple,
borderRadius: BorderRadius.circular(4),
),
child: const Text(
'登录',
style: TextStyle(
color: Colors.white,
fontSize: 14,
),
),
),
onPressed: () {
showDialog(
context: context,
barrierDismissible: true,
builder: (BuildContext context) {
return FlutterPuzzleVCode(onSuccess: (){
Navigator.pop(context);
},);
});
})),
);
}
}