Skip to content

Instantly share code, notes, and snippets.

@umuieme
Created September 29, 2022 00:54
Show Gist options
  • Save umuieme/6be8e90efb25a39a0d90d3758cc19998 to your computer and use it in GitHub Desktop.
Save umuieme/6be8e90efb25a39a0d90d3758cc19998 to your computer and use it in GitHub Desktop.
Dashboard tab with a button to navigate to the FirstScreen using named navigation.
import 'package:flutter/material.dart';
import 'package:flutter_navigation/navigation/router_info.dart';
class DashboardTab extends StatelessWidget {
const DashboardTab({super.key});
@override
Widget build(BuildContext context) {
return Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
const Text("Dashboard Tab"),
ElevatedButton(
onPressed: () => Navigator.pushNamed(context, RouterInfo.firstScreen,
arguments: "From Dashboard tab"),
child: const Text("go to first screen"),
)
],
);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment