page_not_found 0.0.1
page_not_found: ^0.0.1 copied to clipboard
example/lib/main.dart
import 'package:flutter/material.dart';
import 'package:page_not_found/page_not_found.dart';
void main() {
runApp(const Example());
}
class Example extends StatefulWidget {
const Example({super.key});
@override
State<Example> createState() => _ExampleState();
}
class _ExampleState extends State<Example> {
@override
Widget build(BuildContext context) {
return MaterialApp(
debugShowCheckedModeBanner: false,
home: Scaffold(
// body: PageNotFound.animatedError12(context: context),
body: FutureBuilder<Widget>(
future: PageNotFound.animatedError10(context: context),
builder: (context, snapshot) {
if (snapshot.connectionState == ConnectionState.waiting) {
return const Center(child: CircularProgressIndicator());
} else if (snapshot.hasError) {
return Center(child: Text('Error: ${snapshot.error}'));
} else if (snapshot.hasData) {
return snapshot.data!;
} else {
return const Center(child: Text('Something went wrong.'));
}
},
),
),
);
}
}