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

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": "core-flow",
                  };

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

                  OrthoModel reply = await FlutterOrtho.create(
                    orthoKey: 'ortho-flow-testt',
                    context: context,
                    bottomSheetColor: Colors.green,
                    slug: slug,
                    config: config,
                  );

                  debugPrint(reply.data);

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

Publisher

unverified uploader

flutter ortho package

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (LICENSE)

Dependencies

dio, flutter, webview_flutter

More

Packages that depend on flutter_ortho