0.0.3 released, see CHANGELOG.md

This commit is contained in:
Nathan Anderson
2023-11-21 09:45:25 -07:00
parent d4c697dde8
commit dd52ffb398
11 changed files with 535 additions and 267 deletions
+15 -31
View File
@@ -14,23 +14,9 @@ class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Flutter Demo',
debugShowCheckedModeBanner: false,
title: 'Native Stripe Field Demo',
theme: ThemeData(
// This is the theme of your application.
//
// TRY THIS: Try running your application with "flutter run". You'll see
// the application has a blue toolbar. Then, without quitting the app,
// try changing the seedColor in the colorScheme below to Colors.green
// and then invoke "hot reload" (save your changes or press the "hot
// reload" button in a Flutter-supported IDE, or press "r" if you used
// the command line to start the app).
//
// Notice that the counter didn't reset back to zero; the application
// state is not lost during the reload. To reset the state, use hot
// restart instead.
//
// This works for code too, not just values: Most code changes can be
// tested with just a hot reload.
colorScheme: ColorScheme.fromSeed(seedColor: Colors.deepPurple),
useMaterial3: true,
),
@@ -42,15 +28,6 @@ class MyApp extends StatelessWidget {
class MyHomePage extends StatefulWidget {
const MyHomePage({super.key, required this.title});
// This widget is the home page of your application. It is stateful, meaning
// that it has a State object (defined below) that contains fields that affect
// how it looks.
// This class is the configuration for the state. It holds the values (in this
// case the title) provided by the parent (in this case the App widget) and
// used by the build method of the State. Fields in a Widget subclass are
// always marked "final".
final String title;
@override
@@ -58,7 +35,7 @@ class MyHomePage extends StatefulWidget {
}
class _MyHomePageState extends State<MyHomePage> {
ValidState? state;
CardDetailsValidState? state;
String? errorText;
@override
@@ -79,11 +56,18 @@ class _MyHomePageState extends State<MyHomePage> {
),
),
CardTextField(
width: 500,
stripePublishableKey: 'pk_test_abc123importantIDhere',
onStripeResponse: (details) {
if (kDebugMode) print('Got card details: $details');
width: 300,
onCardDetailsComplete: (details) {
if (kDebugMode) {
print(details);
}
},
// textStyle: TextStyle(fontSize: 24.0),
// cardFieldWidth: 260,
// expFieldWidth: 100.0,
// securityFieldWidth: 60.0,
// postalFieldWidth: 130.0,
// iconSize: Size(50.0, 35.0),
overrideValidState: state,
errorText: errorText,
),
@@ -91,7 +75,7 @@ class _MyHomePageState extends State<MyHomePage> {
child: const Text('Set manual error'),
onPressed: () => setState(() {
errorText = 'There is a problem';
state = ValidState.invalidCard;
state = CardDetailsValidState.invalidCard;
}),
)
],