maintenance_banner 0.1.1
maintenance_banner: ^0.1.1 copied to clipboard
A Flutter package for displaying maintenance banners in your app
example/lib/main.dart
import 'package:flutter/material.dart';
import 'package:maintenance_banner/maintenance_banner.dart';
import 'package:maintenance_banner_example/home_page.dart';
void main() {
runApp(const MyApp());
}
class MyApp extends StatefulWidget {
const MyApp({super.key});
@override
State<MyApp> createState() => _MyAppState();
}
class _MyAppState extends State<MyApp> {
bool isUnderMaintenance = true;
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Maintenance Banner Example',
theme: ThemeData(
colorScheme: ColorScheme.fromSeed(
seedColor: Colors.deepPurple,
brightness: Brightness.light,
),
useMaterial3: true,
),
home: MaintenanceWrapper(
isUnderMaintenance: isUnderMaintenance,
banner: Container(
height: 40,
decoration: BoxDecoration(
gradient: LinearGradient(
colors: [
Colors.orange.shade400,
Colors.orange.shade600,
],
),
),
child: const Center(
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Icon(
Icons.build_circle,
color: Colors.white,
size: 20,
),
SizedBox(width: 8),
Text(
'Application under maintenance',
style: TextStyle(
color: Colors.white,
fontWeight: FontWeight.w600,
fontSize: 14,
),
),
],
),
),
),
child: const HomePage(),
),
);
}
}