get 1.3.4 copy "get: ^1.3.4" to clipboard
get: ^1.3.4 copied to clipboard

outdated

A consistent Flutter route navigation library that navigate with no context and not rebuild materialApp with each navigation.

example/lib/main.dart

import 'package:flutter/material.dart';
import 'package:get/get.dart';

void main() {
  runApp(MaterialApp(
    title: 'Navigation Basics',
    navigatorKey: Get.key,
    home: FirstRoute(),
  ));
}

class FirstRoute extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text('First Route'),
      ),
      body: Center(
        child: RaisedButton(
          child: Text('Open route'),
          onPressed: () {
            Get.to(SecondRoute());
          },
        ),
      ),
    );
  }
}

class SecondRoute extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text("Second Route"),
      ),
      body: Center(
        child: RaisedButton(
          onPressed: () {
            Get.back();
          },
          child: Text('Go back!'),
        ),
      ),
    );
  }
}
14018
likes
0
pub points
100%
popularity

Publisher

verified publishergetx.site

A consistent Flutter route navigation library that navigate with no context and not rebuild materialApp with each navigation.

Repository (GitHub)
View/report issues

License

unknown (LICENSE)

Dependencies

flutter

More

Packages that depend on get