basic structure with material 3
This commit is contained in:
@@ -6,8 +6,12 @@ class MyApp extends StatelessWidget {
|
|||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return const MaterialApp(
|
return MaterialApp(
|
||||||
title: 'My App',
|
title: 'My App',
|
||||||
|
theme: ThemeData(
|
||||||
|
useMaterial3: true,
|
||||||
|
primaryColor: Colors.red,
|
||||||
|
),
|
||||||
home: Navigation()
|
home: Navigation()
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
import 'dart:ffi';
|
import 'dart:ffi';
|
||||||
|
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
import 'testUI.dart';
|
||||||
|
|
||||||
class Navigation extends StatefulWidget {
|
class Navigation extends StatefulWidget {
|
||||||
const Navigation({super.key});
|
const Navigation({super.key});
|
||||||
@@ -11,9 +12,9 @@ class Navigation extends StatefulWidget {
|
|||||||
|
|
||||||
class _NavigationState extends State<Navigation> {
|
class _NavigationState extends State<Navigation> {
|
||||||
|
|
||||||
int _selectedIndex = 1;
|
int _selectedIndex = 0;
|
||||||
static const List<Widget> _widgetOptions = <Widget>[
|
static const List<Widget> _widgetOptions = <Widget>[
|
||||||
Text("Calendar"),
|
TestUI(),
|
||||||
Text("Inbox"),
|
Text("Inbox"),
|
||||||
Text("Notes"),
|
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