Note:
This package is designed to work on Web platforms only.
|
|
Add to your pubspec.yaml
:
dependencies:
ubunutu_terminal: ^0.1.0
Run:
flutter pub get
import 'package:flutter/material.dart';
import 'package:ubunutu_terminal/ubunutu_terminal.dart';
void main() => runApp(const MyApp());
class MyApp extends StatelessWidget {
const MyApp({super.key});
@override
Widget build(BuildContext context) {
final commands = {
'hello': '👋 Hello, Terminal User!',
'date': '📅 ${DateTime.now()}',
'help': '''
📚 Available Commands:
• hello - Greet the user
• date - Show current date/time
• help - Display this help
• clear - Clear terminal
''',
};
return MaterialApp(
theme: ThemeData.dark(),
home: Scaffold(
body: TerminalPage(
terminalPrompt: 'user@ubuntu',
commands: commands,
),
),
);
}
}
Create rich terminal experiences with custom commands:
final Map<String, String> commands = {
'welcome': '''
╔════════════════════════════════╗
║ Welcome to Ubuntu Terminal! ║
║ Type 'help' to get started ║
╚════════════════════════════════╝
''',
'system': '''
OS: Ubuntu Terminal Emulator
Version: 1.0.0
Flutter: ${Theme.of(context).platform}
''',
'time': '🕒 ${DateTime.now().toLocal()}',
'help': '''
📋 Command List:
• welcome - Show welcome message
• system - Display system info
• time - Show current time
• clear - Clear terminal
'''
};
The terminal automatically adapts to different screen sizes while maintaining optimal usability:
Minimum Requirements:
└── Width: 400px
└── Height: 300px
Recommended:
└── Width: 80% of screen width
└── Height: 80% of screen height
// Automatically adjusts to screen size
_widthFactor = 0.8; // 80% width
_heightFactor = 0.8; // 80% height
- ⌨️ Command history navigation (↑/↓ arrows)
- 📋 Copy/paste functionality
- 🔍 Text selection support
- 📝 Command auto-completion
- ⚡ Keyboard shortcuts
- 🔄 Configurable buffer size
We welcome contributions! Here's how you can help:
- 🍴 Fork the repository
- 🌿 Create your feature branch (
git checkout -b feature/amazing-feature
) - 💻 Code your magic
- 📝 Commit changes (
git commit -m 'Add amazing feature'
) - 🚀 Push to the branch (
git push origin feature/amazing-feature
) - 🔍 Open a Pull Request
Licensed under the MIT License - see the LICENSE file for details.
Rohan Karn
- GitHub: @rohankarn35
- LinkedIn: Connect with me
If you find this package helpful:
- ⭐ Star the repository
- 🐛 Report bugs via issues
- 💡 Suggest features
- 🔀 Submit pull requests
Built with ❤️ by Rohan Karn