adaptive_components 0.0.7 adaptive_components: ^0.0.7 copied to clipboard
A Flutter package to implement responsive layouts in Material Design.
// Copyright 2020, the Flutter project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
import 'package:flutter/material.dart';
import 'adaptive_column_example.dart';
import 'adaptive_container_example.dart';
void main() {
runApp(const MyApp());
}
class MyApp extends StatelessWidget {
const MyApp({Key? key}) : super(key: key);
@override
Widget build(BuildContext context) {
return const MaterialApp(
title: 'Adaptive Navigation Scaffold Demo',
home: DemoSelector(),
);
}
}
class DemoSelector extends StatelessWidget {
const DemoSelector({Key? key}) : super(key: key);
@override
Widget build(BuildContext context) {
return Scaffold(
body: Center(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
ElevatedButton(
child: const Text('Adaptive Column'),
onPressed: () {
Navigator.of(context).pushReplacement(
MaterialPageRoute(
builder: (context) {
return const AdaptiveColumnsExample();
},
),
);
},
),
ElevatedButton(
child: const Text('Adaptive Container'),
onPressed: () {
Navigator.of(context).pushReplacement(
MaterialPageRoute(
builder: (context) {
return const AdaptiveContainerExample();
},
),
);
},
),
const SizedBox(height: 16),
],
),
),
);
}
}