flicker 0.0.3 flicker: ^0.0.3 copied to clipboard
Yet another flushbar
import 'package:flicker/flicker.dart';
import 'package:flutter/material.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(
colorScheme: ColorScheme.fromSeed(seedColor: Colors.deepPurple),
useMaterial3: true,
),
home: const MyHomePage(),
);
}
}
class MyHomePage extends StatefulWidget {
const MyHomePage({super.key});
@override
State<MyHomePage> createState() => _MyHomePageState();
}
class _MyHomePageState extends State<MyHomePage> {
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
backgroundColor: Theme.of(context).colorScheme.inversePrimary,
title: const Text('Demo'),
),
floatingActionButtonLocation: FloatingActionButtonLocation.centerFloat,
floatingActionButton: FloatingActionButton.extended(
onPressed: () => _showFlick(context),
label: const Text('Show'),
),
);
}
void _showFlick(BuildContext context) {
Flicker.of(context).show(
Flick(
alignment: Alignment.topCenter,
margin: const EdgeInsets.all(16),
decoration: BoxDecoration(
color: Colors.red,
borderRadius: BorderRadius.circular(16),
),
child: const Center(
child: Padding(
padding: EdgeInsets.all(8.0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Text(
'Ааааааа Ошибка!',
style: TextStyle(
color: Colors.white,
fontWeight: FontWeight.w500,
),
),
Text(
'Жесть какая лютая ошибка на сервере',
style: TextStyle(
color: Colors.white,
),
),
],
),
),
),
),
);
}
}