feat(ui_layout): add new package for app compenant and start implementing layouts
This commit is contained in:
@@ -0,0 +1,16 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:wyatt_wyatt_ui_layout/wyatt_wyatt_ui_layout.dart';
|
||||
|
||||
class AppBarLayoutPage extends StatelessWidget {
|
||||
const AppBarLayoutPage({super.key});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) => const AppBarLayout(
|
||||
title: 'App Bar Layout',
|
||||
body: Center(
|
||||
child: Text(
|
||||
'Body',
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,52 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:wyatt_ui_layout_example/pages/app_bar_layout_page.dart';
|
||||
import 'package:wyatt_ui_layout_example/pages/bottom_navigation_bar_layout_page_1.dart';
|
||||
import 'package:wyatt_wyatt_ui_layout/wyatt_wyatt_ui_layout.dart';
|
||||
|
||||
class AvailabaleLayouts extends StatelessWidget {
|
||||
const AvailabaleLayouts({super.key});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) => AppBarLayout(
|
||||
title: 'Available Layouts',
|
||||
body: Center(
|
||||
child: SingleChildScrollView(
|
||||
physics: const BouncingScrollPhysics(),
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
ElevatedButton(
|
||||
onPressed: () {
|
||||
Navigator.push(
|
||||
context,
|
||||
// ignore: inference_failure_on_instance_creation
|
||||
MaterialPageRoute(
|
||||
builder: (context) => const AppBarLayoutPage(),
|
||||
),
|
||||
);
|
||||
},
|
||||
child: const Text(
|
||||
'App Bar Layout',
|
||||
),
|
||||
),
|
||||
ElevatedButton(
|
||||
onPressed: () {
|
||||
Navigator.push(
|
||||
context,
|
||||
// ignore: inference_failure_on_instance_creation
|
||||
MaterialPageRoute(
|
||||
builder: (context) =>
|
||||
const BottomNavigationBarLayoutPage1(),
|
||||
),
|
||||
);
|
||||
},
|
||||
child: const Text(
|
||||
'Bottom Navigation Bar Layout',
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:wyatt_wyatt_ui_layout/wyatt_wyatt_ui_layout.dart';
|
||||
|
||||
class BottomNavigationBarLayoutPage1 extends StatelessWidget {
|
||||
const BottomNavigationBarLayoutPage1({super.key});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) => const BottomNavigationBarLayout(
|
||||
currentIndex: 0,
|
||||
body: AppBarLayout(
|
||||
title: 'Bottom Bar Navigation Layout',
|
||||
body: Center(
|
||||
child: Text('Body'),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:wyatt_wyatt_ui_layout/wyatt_wyatt_ui_layout.dart';
|
||||
|
||||
class BottomNavigationBarLayoutPage2 extends StatelessWidget {
|
||||
const BottomNavigationBarLayoutPage2({super.key});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) => const BottomNavigationBarLayout(
|
||||
currentIndex: 1,
|
||||
body: AppBarLayout(
|
||||
title: 'Bottom Bar Navigation Layout',
|
||||
body: Center(
|
||||
child: Text('Body'),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user