osam_flutter 1.0.2 copy "osam_flutter: ^1.0.2" to clipboard
osam_flutter: ^1.0.2 copied to clipboard

discontinued
outdated

Navigation and UI elements which fits with Osam library

example/lib/main.dart

import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
import 'package:osam_flutter/osam_flutter.dart';

void main() async {
  runApp(MyApp());
}

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return UseCaseProvider(
      null,
      null,
      null,
      child: PresenterProvider(
        presenter: NavPresenter(),
        child: MaterialApp(
          home: OsamNavigator<NavPresenter>({
            '1': (ctx) => Page1(key: ValueKey('1'), color: Colors.red),
            '2': (ctx) => Page1(key: ValueKey('2'), color: Colors.green),
          }),
        ),
      ),
    );
  }
}

class Page1 extends StatelessWidget {
  final Color color;

  const Page1({Key key, this.color}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    final s = showBottomSheet(context: null, builder: null);
    return Scaffold(
      appBar: AppBar(),
      body: Container(
        color: color,
        child: Center(
          child: RaisedButton(
            onPressed: () => context.presenter<NavPresenter>().push(color == Colors.red ? '2' : '1'),
            child: Text(color == Colors.red ? 'push 2' : 'push 1'),
          ),
        ),
      ),
      floatingActionButton: FloatingActionButton(
        onPressed: () => showDialog(context: context, builder: (ctx) => Text('123')).then((_) {
          print('2134');
        }),
      ),
    );
  }
}

class NavPresenter extends Presenter with NavigationPresenter {
  @override
  NavigationState get navigationState => nav;
}

final nav = NavigationState(['1']);
2
likes
0
pub points
0%
popularity

Publisher

verified publisherrenesanse.net

Navigation and UI elements which fits with Osam library

Repository (GitHub)
View/report issues

License

unknown (LICENSE)

Dependencies

after_layout, flutter, osam, provider

More

Packages that depend on osam_flutter