simbadan 0.0.2 simbadan: ^0.0.2 copied to clipboard
A private flutter plugin.
import 'package:flutter/material.dart';
import 'dart:async';
import 'package:flutter/services.dart';
import 'package:simbadan/simbadan.dart';
void main() {
runApp(MyApp());
}
class MyApp extends StatefulWidget {
@override
_MyAppState createState() => _MyAppState();
}
class _MyAppState extends State<MyApp> {
TextEditingController numberToDialController = TextEditingController();
TextEditingController carrierController = TextEditingController();
@override
void initState() {
super.initState();
}
getCarriers() async {
var carriers = await Simbadan.getCarriers();
print(carriers);
}
dialByCarrier() {
var numberToDial = numberToDialController.text;
var carrier = carrierController.text;
Simbadan.dialByCarrier(numberToDial, carrier);
}
@override
Widget build(BuildContext context) {
return MaterialApp(
home: Scaffold(
appBar: AppBar(
title: const Text('Plugin example app'),
),
body: Column(
children: [
RaisedButton(
child: Text("getCarriers()"), onPressed: () => getCarriers()),
TextField(
decoration: InputDecoration(labelText: "numberToDial"),
controller: numberToDialController,
),
TextField(
decoration: InputDecoration(labelText: "carrier"),
controller: carrierController,
),
RaisedButton(
child: Text("dialByCarrier()"),
onPressed: () => dialByCarrier()),
],
),
),
);
}
}