flutter_ortho 0.0.3 copy "flutter_ortho: ^0.0.3" to clipboard
flutter_ortho: ^0.0.3 copied to clipboard

outdated

flutter ortho package

example/lib/main.dart

import 'package:flutter/material.dart';
import 'package:flutter_ortho/flutter_ortho.dart';

void main() {
  runApp(const MyApp());
}

class MyApp extends StatelessWidget {
  const MyApp({Key? key}) : super(key: key);

  // This widget is the root of your application.
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Ortho Demo',
      theme: ThemeData(
        primarySwatch: Colors.yellow,
      ),
      home: const OrthoDemoPage(title: 'Ortho Demo Page'),
    );
  }
}

class OrthoDemoPage extends StatefulWidget {
  const OrthoDemoPage({Key? key, required this.title}) : super(key: key);

  final String title;

  @override
  State<OrthoDemoPage> createState() => _OrthoDemoPageState();
}

class _OrthoDemoPageState extends State<OrthoDemoPage> {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text(widget.title),
      ),
      body: Center(
        child: Column(
          mainAxisAlignment: MainAxisAlignment.center,
          children: [
            ElevatedButton(
                style: ElevatedButton.styleFrom(primary: Colors.black),
                onPressed: () async {
                  ///config init to be passed to url
                  const config = {
                    "publicKey": "<your-public-key>",
                    "amount": 90000,
                    "short-url": "<short-url>",
                    "currency": "NGN",
                    "email": "just1and0@tryortho.co",
                    "city": "abuja",
                    "state": "Nigeria"
                  };

                  ///slug name (payment sdk medium)
                  const slug = 'Ortho-okra-short-url-flutter';

                  OrthoModel reply = await FlutterOrtho.create(
                    context: context,
                    slug: slug,
                    config: config,
                  );

                  //do what you want with the reply
                },
                child: const Text(
                  'Open Ortho Widget',
                  style: TextStyle(color: Colors.white),
                )),
          ],
        ),
      ),
    );
  }
}
1
likes
0
points
84
downloads

Publisher

unverified uploader

Weekly Downloads

flutter ortho package

Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

dio, flutter, webview_flutter

More

Packages that depend on flutter_ortho