pti_insurance_test 0.0.5
pti_insurance_test: ^0.0.5 copied to clipboard
Flutter plugin to add PTI Insurance Widget inside your project.
example/lib/main.dart
import 'package:flutter/material.dart';
import 'package:pti_insurance_test/pti_insurance_test.dart';
import 'package:pti_insurance_test/utils/common.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 MaterialApp(
title: 'Flutter Demo',
theme: ThemeData(
// This is the theme of your application.
//
// Try running your application with "flutter run". You'll `see the
// application has a blue toolbar. Then, without quitting the app, try
// changing the primarySwatch below to Colors.green and then invoke
// "hot reload" (press "r" in the console where you ran "flutter run",
// or simply save your changes to "hot reload" in a Flutter IDE).
// Notice that the counter didn't reset back to zero; the application
// is not restarted.
primarySwatch: Colors.blue,
),
home: const MyHomePage(title: 'Flutter Demo Home Page'),
);
}
}
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
State<MyHomePage> createState() => _MyHomePageState();
}
class _MyHomePageState extends State<MyHomePage> {
int _counter = 0;
String token =
"A/YpuiBYLsD3mEwI604+ez3Gwr7Cz3krelOhvQTayBOSCzIjTDeGO21wJnMepVQTbSGAqeKGmlnDRBssr1RUR/negVNVZv5nAcZqVw7bK4MOhNPy5+GVoIRbxzdjkft9kfeY7uNOv4lERwyI7TIYsG8OhwYQM13ZKs4wzM+DmVfmatkPPpBNwcHe2fydh4hDUqHz1QaxdyMbHbnmBmNNHeTvvNjC69FdRuUVD9Gs27/xrwHYcHTSEVbq4Ui8ByV2y6Dy2QHrT4bXG4RdBjuDpbR0cowOcwDJ1JNVVjpSK/yryyWzrbQFZmlkPK/+Ltqj5uAuQBgjkbEELYLNGPNUEilAZJSgi5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0Rq5c4NTuU1K5vjfvQAxp2MiDFzGdXMDHvo09FcOlqTG3x5jGJmcuAjUrrzDo2heAQoN9k2Qz9qzbyivzFzsjiJjB5spAqY31VLgzE43wp+jszMNOD8SjfEFgoi6rHwiHVTwlpxqequy2rFvXGVdV+mTwY10VNkEWlk";
void _incrementCounter() {
// setState(() {
// // This call to setState tells the Flutter framework that something has
// // changed in this State, which causes it to rerun the build method below
// // so that the display can reflect the updated values. If we changed
// // _counter without calling setState(), then the build method would not be
// // called again, and so nothing would appear to happen.
// _counter++;
// });
Navigator.push(
context,
MaterialPageRoute(
builder: (context) => PtiView(
token: token,
kenh: "KTTT",
maCN: "000",
maNV: "XE",
typeView: TypeView.vehicle,
type: TypeFrom.createNew,
)),
);
}
@override
Widget build(BuildContext context) {
// This method is rerun every time setState is called, for instance as done
// by the _incrementCounter method above.
//
// The Flutter framework has been optimized to make rerunning build methods
// fast, so that you can just rebuild anything that needs updating rather
// than having to individually change instances of widgets.
return Scaffold(
appBar: AppBar(
// Here we take the value from the MyHomePage object that was created by
// the App.build method, and use it to set our appbar title.
title: Text(widget.title),
),
body: DemoView(),
floatingActionButton: FloatingActionButton(
onPressed: _incrementCounter,
tooltip: 'Increment',
child: const Icon(Icons.add),
), // This trailing comma makes auto-formatting nicer for build methods.
);
}
}