flutter_meon_ipo 1.0.0
flutter_meon_ipo: ^1.0.0 copied to clipboard
A Flutter package for integrating Meon IPO WebView functionality into your mobile applications.
example/lib/main.dart
import 'package:flutter/material.dart';
import 'package:flutter_meon_ipo/flutter_meon_ipo.dart';
void main() {
runApp(const MyApp());
}
class MyApp extends StatelessWidget {
const MyApp({super.key});
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Meon IPO Example',
theme: ThemeData(
colorScheme: ColorScheme.fromSeed(seedColor: const Color(0xFF0066CC)),
useMaterial3: true,
),
home: const MeonIPOExample(),
);
}
}
class MeonIPOExample extends StatefulWidget {
const MeonIPOExample({super.key});
@override
State<MeonIPOExample> createState() => _MeonIPOExampleState();
}
class _MeonIPOExampleState extends State<MeonIPOExample> {
String _status = 'Ready';
int _progress = 0;
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
backgroundColor: Theme.of(context).colorScheme.inversePrimary,
title: const Text('Meon IPO Example'),
bottom: PreferredSize(
preferredSize: const Size.fromHeight(60.0),
child: Padding(
padding: const EdgeInsets.all(16.0),
child: Column(
children: [
Text(
'Status: $_status',
style: const TextStyle(fontSize: 14),
),
const SizedBox(height: 8),
if (_progress > 0 && _progress < 100)
LinearProgressIndicator(
value: _progress / 100,
backgroundColor: Colors.grey[300],
valueColor: const AlwaysStoppedAnimation<Color>(
Color(0xFF0066CC),
),
),
],
),
),
),
),
body: MeonIPO(
companyName: 'ndaindia',
onLoadStart: () {
setState(() {
_status = 'Loading...';
_progress = 0;
});
debugPrint('🚀 Loading started');
},
onProgress: (progress) {
setState(() {
_progress = progress;
_status = 'Loading... $progress%';
});
debugPrint('📊 Progress: $progress%');
},
onLoadEnd: () {
setState(() {
_status = 'Loaded successfully';
_progress = 100;
});
debugPrint('✅ Loading finished');
},
onError: (error) {
setState(() {
_status = 'Error: ${error.description}';
});
debugPrint('❌ Error: ${error.description}');
},
// Optional: Custom loading widget
loadingWidget: Container(
color: Colors.white,
child: Center(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
const CircularProgressIndicator(
color: Color(0xFF0066CC),
),
const SizedBox(height: 16),
Text(
'Loading IPO Information...',
style: TextStyle(
fontSize: 16,
color: Colors.grey[600],
),
),
],
),
),
),
// Optional: Custom background color
backgroundColor: Colors.white,
),
);
}
}