basic structure with material 3
This commit is contained in:
@@ -6,8 +6,12 @@ class MyApp extends StatelessWidget {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return const MaterialApp(
|
||||
return MaterialApp(
|
||||
title: 'My App',
|
||||
theme: ThemeData(
|
||||
useMaterial3: true,
|
||||
primaryColor: Colors.red,
|
||||
),
|
||||
home: Navigation()
|
||||
);
|
||||
}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import 'dart:ffi';
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'testUI.dart';
|
||||
|
||||
class Navigation extends StatefulWidget {
|
||||
const Navigation({super.key});
|
||||
@@ -11,9 +12,9 @@ class Navigation extends StatefulWidget {
|
||||
|
||||
class _NavigationState extends State<Navigation> {
|
||||
|
||||
int _selectedIndex = 1;
|
||||
int _selectedIndex = 0;
|
||||
static const List<Widget> _widgetOptions = <Widget>[
|
||||
Text("Calendar"),
|
||||
TestUI(),
|
||||
Text("Inbox"),
|
||||
Text("Notes"),
|
||||
];
|
||||
|
||||
29
lib/testUI.dart
Normal file
29
lib/testUI.dart
Normal file
@@ -0,0 +1,29 @@
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class TestUI extends StatefulWidget {
|
||||
const TestUI({super.key});
|
||||
|
||||
@override
|
||||
State<TestUI> createState() => _TestUIState();
|
||||
}
|
||||
|
||||
class _TestUIState extends State<TestUI> {
|
||||
int _test = 0;
|
||||
|
||||
void _onPressed() {
|
||||
setState(() {
|
||||
_test = 1;
|
||||
});
|
||||
}
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
body: Center(
|
||||
child: Column(children: [
|
||||
FloatingActionButton(onPressed: _onPressed),
|
||||
Text('$_test'),
|
||||
],),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user