adaptive_navigation 0.0.1 adaptive_navigation: ^0.0.1 copied to clipboard
A component to be used in place of the Scaffold widget when you want automatic switching between Navigation Rail and Bottom Navigation Bar.
import 'package:flutter/material.dart';
import 'custom_scaffold.dart';
import 'default_scaffold.dart';
void main() {
runApp(MyApp());
}
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Adaptive Navigation Scaffold Demo',
home: DemoSelector(),
);
}
}
class DemoSelector extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Scaffold(
body: Center(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
RaisedButton(
child: Text('Default Scaffold'),
onPressed: () {
Navigator.of(context).pushReplacement(
MaterialPageRoute(
builder: (context) {
return DefaultScaffoldDemo();
},
),
);
},
),
SizedBox(height: 16),
RaisedButton(
child: Text('Custom Scaffold'),
onPressed: () {
Navigator.of(context).pushReplacement(
MaterialPageRoute(
builder: (context) {
return CustomScaffoldDemo();
},
),
);
},
)
],
),
),
);
}
}