auto_animated 1.2.1
auto_animated: ^1.2.1 copied to clipboard
Widgets starting auto play animation when mounted. It is already possible to animate the list and icons.
example/lib/main.dart
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:auto_animated_example/screens/icon_button.dart';
import 'package:auto_animated_example/screens/list.dart';
void main() => runApp(MyApp());
class MyApp extends StatefulWidget {
MyApp({Key key}) : super(key: key) {
SystemChrome.setSystemUIOverlayStyle(SystemUiOverlayStyle(
statusBarColor: Colors.transparent,
statusBarBrightness: Brightness.light,
statusBarIconBrightness: Brightness.dark,
systemNavigationBarColor: Colors.white,
systemNavigationBarIconBrightness: Brightness.dark,
));
}
@override
_MyAppState createState() => _MyAppState();
}
class _MyAppState extends State<MyApp> {
int _selectedIndex = 0;
final List<Widget> _children = [
AutoAnimatedListExample(),
AutoAnimatedIconButtonExample(),
];
void _onItemTapped(int index) {
setState(() {
_selectedIndex = index;
});
}
@override
Widget build(BuildContext context) => MaterialApp(
home: Scaffold(
backgroundColor: Colors.grey[100],
body: _children[_selectedIndex],
bottomNavigationBar: BottomNavigationBar(
backgroundColor: Colors.white,
items: const <BottomNavigationBarItem>[
BottomNavigationBarItem(
icon: Icon(Icons.list),
title: Text('List'),
),
BottomNavigationBarItem(
icon: Icon(Icons.check_circle),
title: Text('IconButton'),
),
],
currentIndex: _selectedIndex,
// selectedItemColor: Colors.amber[800],
onTap: _onItemTapped,
),
),
);
}
copied to clipboard