osam_flutter 2.2.2 osam_flutter: ^2.2.2 copied to clipboard
Navigation and UI elements which fits with Osam library
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:osam_flutter/osam_flutter.dart';
final navKey = GlobalKey<NavigatorState>();
void main() async {
final core = Core();
runApp(MaterialApp(
navigatorKey: navKey,
home: App(core),
));
}
class App extends StatefulWidget {
final Core core;
const App(this.core);
@override
_AppState createState() => _AppState();
}
class _AppState extends State<App> {
@override
Widget build(BuildContext context) {
return OsamNavigator(
log: true,
key: navKey,
routes: {
'1'
},
);
}
}
class Core extends BaseState<Core> {
var num = 0;
var news = <News>[];
@override
List<Object> get props => [news, num];
}
class News extends BaseState<News> {
bool isFavorite = false;
final id;
News(this.id);
@override
List<Object> get props => [isFavorite, id];
}