Myobil
A simple and elegant splash screen plugin for Flutter applications. Display beautiful loading screens while your app initializes.
Features
- Simple splash screen widget with customizable UI
- Easy-to-use API with minimal configuration
- Includes an in-app browser component for displaying web content
- iOS support (Android coming soon)
- Lightweight and performant
Platform Support
| Platform | Supported |
|---|---|
| iOS | ✅ |
| Android | 🔜 Coming soon |
Installation
Add this to your package's pubspec.yaml file:
dependencies:
myobil: ^0.0.1
Then run:
flutter pub get
Usage
Basic Splash Screen
import 'package:flutter/material.dart';
import 'package:myobil/myobil.dart';
void main() {
runApp(MyApp());
}
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
home: MyobilSplashScreen(
onComplete: () {
// Navigate to your main app
Navigator.pushReplacement(
context,
MaterialPageRoute(builder: (_) => HomeScreen()),
);
},
child: Center(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
FlutterLogo(size: 100),
SizedBox(height: 24),
CircularProgressIndicator(),
],
),
),
),
);
}
}
Custom Splash Screen Design
You can fully customize the splash screen appearance:
MyobilSplashScreen(
onComplete: () {
// Your navigation logic
},
child: Container(
decoration: BoxDecoration(
gradient: LinearGradient(
colors: [Colors.blue, Colors.purple],
),
),
child: Center(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Text(
'My App',
style: TextStyle(
fontSize: 48,
fontWeight: FontWeight.bold,
color: Colors.white,
),
),
SizedBox(height: 24),
CircularProgressIndicator(color: Colors.white),
],
),
),
),
)
In-App Browser
Display web content within your app:
MyobilSafariScreen(
url: 'https://example.com',
loadingImageAsset: 'assets/loading.jpg', // Optional
tapToScreenText: 'Tap to reload', // Optional
)
API Reference
MyobilSplashScreen
Main splash screen widget.
Properties:
child(Widget, required) - The content to display on the splash screenonComplete(VoidCallback, required) - Called when the splash screen completesonSafariNavigation(Function(String)?, optional) - Optional callback for navigationencodedURL(String?, optional) - Optional URL parameterheaderKey(String?, optional) - Optional header key
MyobilSafariScreen
In-app browser screen.
Properties:
url(String, required) - The URL to displayloadingImageAsset(String?, optional) - Path to loading image assettapToScreenText(String?, optional) - Custom instruction text
Example
See the example directory for a complete working sample app.
Platform Setup
iOS
No additional setup required. The plugin works out of the box.
Contributing
Contributions are welcome! Please feel free to submit issues or pull requests.
License
MIT License - see LICENSE file for details.