update
This commit is contained in:
parent
2992f4f408
commit
4f46de8d00
3330 changed files with 394553 additions and 76939 deletions
82
.config/Code/User/History/-2e064889/0lGF.dart
Normal file
82
.config/Code/User/History/-2e064889/0lGF.dart
Normal file
|
@ -0,0 +1,82 @@
|
|||
import 'package:flutter/material.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
|
||||
void main(){
|
||||
runApp(const MyApp());
|
||||
}
|
||||
|
||||
class MyApp extends StatelessWidget{
|
||||
const MyApp({super.key});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context){
|
||||
return ChangeNotifierProvider(
|
||||
create: (context) => MyAppState(),
|
||||
child: MaterialApp(
|
||||
title: 'First App',
|
||||
theme: ThemeData(
|
||||
useMaterial3: true,
|
||||
colorScheme: ColorScheme.fromSeed(seedColor: Colors.green)
|
||||
),
|
||||
home: const MyHomePage(),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
class MyAppState extends ChangeNotifier{
|
||||
|
||||
}
|
||||
|
||||
class MyHomePage extends StatefulWidget{
|
||||
const MyHomePage({super.key});
|
||||
|
||||
@override
|
||||
State<MyHomePage> createState() => _MyHomePageState();
|
||||
}
|
||||
|
||||
class _MyHomePageState extends State<MyHomePage>{
|
||||
|
||||
var counter = 0;
|
||||
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context){
|
||||
var sCount = counter.toString();
|
||||
|
||||
return Scaffold(
|
||||
body: Row(
|
||||
children: [
|
||||
SafeArea(
|
||||
child: NavigationRail(
|
||||
destinations: const [
|
||||
NavigationRailDestination(
|
||||
icon: Icon(Icons.home),
|
||||
label: Text('Home'),
|
||||
),
|
||||
NavigationRailDestination(
|
||||
icon: Icon(Icons.favorite),
|
||||
label: Text('Favorites'),
|
||||
),
|
||||
],
|
||||
selectedIndex: 0
|
||||
),
|
||||
),
|
||||
Center(
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
Text('count: $sCount'),
|
||||
ElevatedButton(
|
||||
onPressed: () => counter++,
|
||||
child: const Text('Increment')
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
|
||||
],
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
52
.config/Code/User/History/-2e064889/1Wjd.dart
Normal file
52
.config/Code/User/History/-2e064889/1Wjd.dart
Normal file
|
@ -0,0 +1,52 @@
|
|||
import 'package:flutter/material.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
|
||||
void main(){
|
||||
runApp(const MyApp());
|
||||
}
|
||||
|
||||
class MyApp extends StatelessWidget{
|
||||
const MyApp({super.key});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context){
|
||||
return ChangeNotifierProvider(
|
||||
create: (context) => MyAppState(),
|
||||
child: MaterialApp(
|
||||
title: 'First App',
|
||||
theme: ThemeData(
|
||||
useMaterial3: true,
|
||||
colorScheme: ColorScheme.fromSeed(seedColor: Colors.green)
|
||||
),
|
||||
home: const MyHomePage(),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
class MyAppState extends ChangeNotifier{
|
||||
var counter = 0;
|
||||
}
|
||||
|
||||
class MyHomePage extends StatelessWidget{
|
||||
const MyHomePage({super.key});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context){
|
||||
var appState = context.watch<MyAppState>();
|
||||
var sCount = appState.counter.toString();
|
||||
|
||||
return const Scaffold(
|
||||
body: Center(
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
const Text('count: $sCount'),
|
||||
],
|
||||
),
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
}
|
51
.config/Code/User/History/-2e064889/1ad6.dart
Normal file
51
.config/Code/User/History/-2e064889/1ad6.dart
Normal file
|
@ -0,0 +1,51 @@
|
|||
import 'package:flutter/material.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
|
||||
void main(){
|
||||
runApp(const MyApp());
|
||||
}
|
||||
|
||||
class MyApp extends StatelessWidget{
|
||||
const MyApp({super.key});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context){
|
||||
return ChangeNotifierProvider(
|
||||
create: (context) => MyAppState(),
|
||||
child: MaterialApp(
|
||||
title: 'First App',
|
||||
theme: ThemeData(
|
||||
useMaterial3: true,
|
||||
colorScheme: ColorScheme.fromSeed(seedColor: Colors.green)
|
||||
),
|
||||
home: const MyHomePage(),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
class MyAppState extends ChangeNotifier{
|
||||
var counter = 0;
|
||||
}
|
||||
|
||||
class MyHomePage extends StatelessWidget{
|
||||
const MyHomePage({super.key});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context){
|
||||
var appState = context.watch<MyAppState>();
|
||||
var sCount = appState.counter.toString();
|
||||
|
||||
return Scaffold(
|
||||
body: Center(
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
Text('count: $sCount'),
|
||||
],
|
||||
),
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
}
|
59
.config/Code/User/History/-2e064889/2fyN.dart
Normal file
59
.config/Code/User/History/-2e064889/2fyN.dart
Normal file
|
@ -0,0 +1,59 @@
|
|||
import 'package:flutter/material.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
|
||||
void main(){
|
||||
runApp(const MyApp());
|
||||
}
|
||||
|
||||
class MyApp extends StatelessWidget{
|
||||
const MyApp({super.key});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context){
|
||||
return ChangeNotifierProvider(
|
||||
create: (context) => MyAppState(),
|
||||
child: MaterialApp(
|
||||
title: 'First App',
|
||||
theme: ThemeData(
|
||||
useMaterial3: true,
|
||||
colorScheme: ColorScheme.fromSeed(seedColor: Colors.green)
|
||||
),
|
||||
home: const MyHomePage(),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
class MyAppState extends ChangeNotifier{
|
||||
var counter = 0;
|
||||
|
||||
void increment(){
|
||||
counter++;
|
||||
notifyListeners();
|
||||
}
|
||||
}
|
||||
|
||||
class MyHomePage extends StatelessWidget{
|
||||
const MyHomePage({super.key});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context){
|
||||
var appState = context.watch<MyAppState>();
|
||||
var sCount = appState.counter.toString();
|
||||
|
||||
return Scaffold(
|
||||
body: Center(
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
Text('count: $sCount'),
|
||||
ElevatedButton(
|
||||
onPressed: () => appState.increment(),
|
||||
child: const Text('Increment')),
|
||||
],
|
||||
),
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
}
|
64
.config/Code/User/History/-2e064889/2sZA.dart
Normal file
64
.config/Code/User/History/-2e064889/2sZA.dart
Normal file
|
@ -0,0 +1,64 @@
|
|||
import 'package:flutter/material.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
|
||||
void main(){
|
||||
runApp(const MyApp());
|
||||
}
|
||||
|
||||
class MyApp extends StatelessWidget{
|
||||
const MyApp({super.key});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context){
|
||||
return ChangeNotifierProvider(
|
||||
create: (context) => MyAppState(),
|
||||
child: MaterialApp(
|
||||
title: 'First App',
|
||||
theme: ThemeData(
|
||||
useMaterial3: true,
|
||||
colorScheme: ColorScheme.fromSeed(seedColor: Colors.green)
|
||||
),
|
||||
home: const MyHomePage(),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
class MyAppState extends ChangeNotifier{
|
||||
var counter = 0;
|
||||
|
||||
void increment(){
|
||||
counter++;
|
||||
notifyListeners();
|
||||
}
|
||||
}
|
||||
|
||||
class MyHomePage extends StatefulWidget{
|
||||
const MyHomePage({super.key});
|
||||
|
||||
@override
|
||||
State<MyHomePage> createState() => _MyHomePageState();
|
||||
}
|
||||
|
||||
class _MyHomePageState extends State<MyHomePage> {
|
||||
@override
|
||||
Widget build(BuildContext context){
|
||||
var appState = context.watch<MyAppState>();
|
||||
var sCount = appState.counter.toString();
|
||||
|
||||
return Scaffold(
|
||||
body: Center(
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
Text('count: $sCount'),
|
||||
ElevatedButton(
|
||||
onPressed: () => appState.increment(),
|
||||
child: const Text('Increment')
|
||||
),
|
||||
],
|
||||
),
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
79
.config/Code/User/History/-2e064889/3NVh.dart
Normal file
79
.config/Code/User/History/-2e064889/3NVh.dart
Normal file
|
@ -0,0 +1,79 @@
|
|||
import 'package:flutter/material.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
|
||||
void main(){
|
||||
runApp(const MyApp());
|
||||
}
|
||||
|
||||
class MyApp extends StatelessWidget{
|
||||
const MyApp({super.key});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context){
|
||||
return ChangeNotifierProvider(
|
||||
create: (context) => MyAppState(),
|
||||
child: MaterialApp(
|
||||
title: 'First App',
|
||||
theme: ThemeData(
|
||||
useMaterial3: true,
|
||||
colorScheme: ColorScheme.fromSeed(seedColor: Colors.green)
|
||||
),
|
||||
home: const MyHomePage(),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
class MyAppState extends ChangeNotifier{
|
||||
var counter = 0;
|
||||
|
||||
void increment(){
|
||||
counter++;
|
||||
notifyListeners();
|
||||
}
|
||||
}
|
||||
|
||||
class MyHomePage extends StatefulWidget{
|
||||
const MyHomePage({super.key});
|
||||
|
||||
@override
|
||||
State<MyHomePage> createState() => _MyHomePageState();
|
||||
}
|
||||
|
||||
class _MyHomePageState extends State<MyHomePage> {
|
||||
@override
|
||||
Widget build(BuildContext context){
|
||||
var appState = context.watch<MyAppState>();
|
||||
var sCount = appState.counter.toString();
|
||||
|
||||
return Scaffold(
|
||||
body: Row(
|
||||
children: [
|
||||
SafeArea(
|
||||
child: NavigationRail(
|
||||
destinations: [
|
||||
NavigationRailDestination(
|
||||
icon: Icon(Icons.home),
|
||||
label: Text('Home'),
|
||||
)
|
||||
],
|
||||
selectedIndex: 0)
|
||||
),
|
||||
Center(
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
Text('count: $sCount'),
|
||||
ElevatedButton(
|
||||
onPressed: () => appState.increment(),
|
||||
child: const Text('Increment')
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
|
||||
],
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
50
.config/Code/User/History/-2e064889/51KZ.dart
Normal file
50
.config/Code/User/History/-2e064889/51KZ.dart
Normal file
|
@ -0,0 +1,50 @@
|
|||
import 'package:flutter/material.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
|
||||
void main(){
|
||||
runApp(const MyApp());
|
||||
}
|
||||
|
||||
class MyApp extends StatelessWidget{
|
||||
const MyApp({super.key});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context){
|
||||
return ChangeNotifierProvider(
|
||||
create: (context) => MyAppState(),
|
||||
child: MaterialApp(
|
||||
title: 'First App',
|
||||
theme: ThemeData(
|
||||
useMaterial3: true,
|
||||
colorScheme: ColorScheme.fromSeed(seedColor: Colors.green)
|
||||
),
|
||||
home: const MyHomePage(),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
class MyAppState extends ChangeNotifier{
|
||||
var counter = 0;
|
||||
}
|
||||
|
||||
class MyHomePage extends StatelessWidget{
|
||||
const MyHomePage({super.key});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context){
|
||||
var appState = context.watch<MyAppState>();
|
||||
|
||||
return const Scaffold(
|
||||
body: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
Text('count: '),
|
||||
Text(appState.counter),
|
||||
],
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
}
|
96
.config/Code/User/History/-2e064889/6GMO.dart
Normal file
96
.config/Code/User/History/-2e064889/6GMO.dart
Normal file
|
@ -0,0 +1,96 @@
|
|||
import 'package:flutter/material.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
|
||||
void main(){
|
||||
runApp(const MyApp());
|
||||
}
|
||||
|
||||
class MyApp extends StatelessWidget{
|
||||
const MyApp({super.key});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context){
|
||||
return ChangeNotifierProvider(
|
||||
create: (context) => MyAppState(),
|
||||
child: MaterialApp(
|
||||
title: 'First App',
|
||||
theme: ThemeData(
|
||||
useMaterial3: true,
|
||||
colorScheme: ColorScheme.fromSeed(seedColor: Colors.green)
|
||||
),
|
||||
home: const MyHomePage(),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
class MyAppState extends ChangeNotifier{
|
||||
|
||||
}
|
||||
|
||||
class MyHomePage extends StatefulWidget{
|
||||
const MyHomePage({super.key});
|
||||
|
||||
@override
|
||||
State<MyHomePage> createState() => _MyHomePageState();
|
||||
}
|
||||
|
||||
class _MyHomePageState extends State<MyHomePage>{
|
||||
|
||||
var counter = 0;
|
||||
var selectedIndex = 0;
|
||||
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context){
|
||||
var sCount = counter.toString();
|
||||
|
||||
Widget page;
|
||||
switch(selectedIndex){
|
||||
case 0:
|
||||
}
|
||||
|
||||
return Scaffold(
|
||||
body: Row(
|
||||
children: [
|
||||
SafeArea(
|
||||
child: NavigationRail(
|
||||
destinations: const [
|
||||
NavigationRailDestination(
|
||||
icon: Icon(Icons.home),
|
||||
label: Text('Home'),
|
||||
),
|
||||
NavigationRailDestination(
|
||||
icon: Icon(Icons.favorite),
|
||||
label: Text('Favorites'),
|
||||
),
|
||||
],
|
||||
selectedIndex: selectedIndex,
|
||||
onDestinationSelected: (value) => setState((){
|
||||
selectedIndex = value;
|
||||
}),
|
||||
),
|
||||
),
|
||||
Expanded(
|
||||
child: Center(
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
Text('count: $sCount'),
|
||||
ElevatedButton(
|
||||
onPressed: () => {
|
||||
setState((){
|
||||
counter++;
|
||||
})
|
||||
},
|
||||
child: const Text('Increment')
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
)
|
||||
],
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
77
.config/Code/User/History/-2e064889/6otU.dart
Normal file
77
.config/Code/User/History/-2e064889/6otU.dart
Normal file
|
@ -0,0 +1,77 @@
|
|||
import 'package:flutter/material.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
|
||||
void main(){
|
||||
runApp(const MyApp());
|
||||
}
|
||||
|
||||
class MyApp extends StatelessWidget{
|
||||
const MyApp({super.key});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context){
|
||||
return ChangeNotifierProvider(
|
||||
create: (context) => MyAppState(),
|
||||
child: MaterialApp(
|
||||
title: 'First App',
|
||||
theme: ThemeData(
|
||||
useMaterial3: true,
|
||||
colorScheme: ColorScheme.fromSeed(seedColor: Colors.green)
|
||||
),
|
||||
home: const MyHomePage(),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
class MyAppState extends ChangeNotifier{
|
||||
var counter = 0;
|
||||
|
||||
void increment(){
|
||||
counter++;
|
||||
notifyListeners();
|
||||
}
|
||||
}
|
||||
|
||||
class MyHomePage extends StatefulWidget{
|
||||
const MyHomePage({super.key});
|
||||
|
||||
@override
|
||||
State<MyHomePage> createState() => _MyHomePageState();
|
||||
}
|
||||
|
||||
class _MyHomePageState extends State<MyHomePage> {
|
||||
@override
|
||||
Widget build(BuildContext context){
|
||||
var appState = context.watch<MyAppState>();
|
||||
var sCount = appState.counter.toString();
|
||||
|
||||
return Scaffold(
|
||||
body: Row(
|
||||
children: [
|
||||
SafeArea(
|
||||
child: NavigationRail(
|
||||
destinations: [
|
||||
NavigationRailDestination(
|
||||
icon: Icon(Icons.home), label: Text('Home')
|
||||
)
|
||||
], selectedIndex: 0)
|
||||
),
|
||||
Center(
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
Text('count: $sCount'),
|
||||
ElevatedButton(
|
||||
onPressed: () => appState.increment(),
|
||||
child: const Text('Increment')
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
|
||||
],
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
80
.config/Code/User/History/-2e064889/8VJJ.dart
Normal file
80
.config/Code/User/History/-2e064889/8VJJ.dart
Normal file
|
@ -0,0 +1,80 @@
|
|||
import 'package:flutter/material.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
|
||||
void main(){
|
||||
runApp(const MyApp());
|
||||
}
|
||||
|
||||
class MyApp extends StatelessWidget{
|
||||
const MyApp({super.key});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context){
|
||||
return ChangeNotifierProvider(
|
||||
create: (context) => MyAppState(),
|
||||
child: MaterialApp(
|
||||
title: 'First App',
|
||||
theme: ThemeData(
|
||||
useMaterial3: true,
|
||||
colorScheme: ColorScheme.fromSeed(seedColor: Colors.green)
|
||||
),
|
||||
home: const MyHomePage(),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
class MyAppState extends ChangeNotifier{
|
||||
var counter = 0;
|
||||
|
||||
void increment(){
|
||||
counter++;
|
||||
notifyListeners();
|
||||
}
|
||||
}
|
||||
|
||||
class MyHomePage extends StatefulWidget{
|
||||
const MyHomePage({super.key});
|
||||
|
||||
@override
|
||||
State<MyHomePage> createState() => _MyHomePageState();
|
||||
}
|
||||
|
||||
class _MyHomePageState extends State<MyHomePage> {
|
||||
@override
|
||||
Widget build(BuildContext context){
|
||||
var appState = context.watch<MyAppState>();
|
||||
var sCount = appState.counter.toString();
|
||||
|
||||
return Scaffold(
|
||||
body: Row(
|
||||
children: [
|
||||
SafeArea(
|
||||
child: NavigationRail(
|
||||
destinations: const [
|
||||
NavigationRailDestination(
|
||||
icon: Icon(Icons.home),
|
||||
label: Text('Home'),
|
||||
)
|
||||
],
|
||||
selectedIndex: 0
|
||||
),
|
||||
),
|
||||
Center(
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
Text('count: $sCount'),
|
||||
ElevatedButton(
|
||||
onPressed: () => appState.increment(),
|
||||
child: const Text('Increment')
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
|
||||
],
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
63
.config/Code/User/History/-2e064889/8kwh.dart
Normal file
63
.config/Code/User/History/-2e064889/8kwh.dart
Normal file
|
@ -0,0 +1,63 @@
|
|||
import 'package:flutter/material.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
|
||||
void main(){
|
||||
runApp(const MyApp());
|
||||
}
|
||||
|
||||
class MyApp extends StatelessWidget{
|
||||
const MyApp({super.key});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context){
|
||||
return ChangeNotifierProvider(
|
||||
create: (context) => MyAppState(),
|
||||
child: MaterialApp(
|
||||
title: 'First App',
|
||||
theme: ThemeData(
|
||||
useMaterial3: true,
|
||||
colorScheme: ColorScheme.fromSeed(seedColor: Colors.green)
|
||||
),
|
||||
home: const MyHomePage(),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
class MyAppState extends ChangeNotifier{
|
||||
var counter = 0;
|
||||
|
||||
void increment(){
|
||||
counter++;
|
||||
notifyListeners();
|
||||
}
|
||||
}
|
||||
|
||||
class MyHomePage extends StatefulWidget{
|
||||
const MyHomePage({super.key});
|
||||
|
||||
@override
|
||||
State<MyHomePage> createState() => _MyHomePageState();
|
||||
}
|
||||
|
||||
class _MyHomePageState extends State<MyHomePage> {
|
||||
@override
|
||||
Widget build(BuildContext context){
|
||||
var appState = context.watch<MyAppState>();
|
||||
var sCount = appState.counter.toString();
|
||||
|
||||
return Scaffold(
|
||||
body: Center(
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
Text('count: $sCount'),
|
||||
ElevatedButton(
|
||||
onPressed: () => appState.increment(),
|
||||
child: const Text('Increment')),
|
||||
],
|
||||
),
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
83
.config/Code/User/History/-2e064889/C9dp.dart
Normal file
83
.config/Code/User/History/-2e064889/C9dp.dart
Normal file
|
@ -0,0 +1,83 @@
|
|||
import 'package:flutter/material.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
|
||||
void main(){
|
||||
runApp(const MyApp());
|
||||
}
|
||||
|
||||
class MyApp extends StatelessWidget{
|
||||
const MyApp({super.key});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context){
|
||||
return ChangeNotifierProvider(
|
||||
create: (context) => MyAppState(),
|
||||
child: MaterialApp(
|
||||
title: 'First App',
|
||||
theme: ThemeData(
|
||||
useMaterial3: true,
|
||||
colorScheme: ColorScheme.fromSeed(seedColor: Colors.green)
|
||||
),
|
||||
home: const MyHomePage(),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
class MyHomePage extends StatefulWidget{
|
||||
const MyHomePage({super.key});
|
||||
|
||||
@override
|
||||
State<MyHomePage> createState() => _MyHomePageState();
|
||||
}
|
||||
|
||||
class _MyHomePageState extends State<MyHomePage>{
|
||||
|
||||
var counter = 0;
|
||||
|
||||
void increment(){
|
||||
counter++;
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context){
|
||||
var appState = context.watch<_MyHomePageState>();
|
||||
var sCount = appState.counter.toString();
|
||||
|
||||
return Scaffold(
|
||||
body: Row(
|
||||
children: [
|
||||
SafeArea(
|
||||
child: NavigationRail(
|
||||
destinations: const [
|
||||
NavigationRailDestination(
|
||||
icon: Icon(Icons.home),
|
||||
label: Text('Home'),
|
||||
),
|
||||
NavigationRailDestination(
|
||||
icon: Icon(Icons.favorite),
|
||||
label: Text('Home'),
|
||||
),
|
||||
],
|
||||
selectedIndex: 0
|
||||
),
|
||||
),
|
||||
Center(
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
Text('count: $sCount'),
|
||||
ElevatedButton(
|
||||
onPressed: () => appState.increment(),
|
||||
child: const Text('Increment')
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
|
||||
],
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
59
.config/Code/User/History/-2e064889/CFiD.dart
Normal file
59
.config/Code/User/History/-2e064889/CFiD.dart
Normal file
|
@ -0,0 +1,59 @@
|
|||
import 'package:flutter/material.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
|
||||
void main(){
|
||||
runApp(const MyApp());
|
||||
}
|
||||
|
||||
class MyApp extends StatelessWidget{
|
||||
const MyApp({super.key});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context){
|
||||
return ChangeNotifierProvider(
|
||||
create: (context) => MyAppState(),
|
||||
child: MaterialApp(
|
||||
title: 'First App',
|
||||
theme: ThemeData(
|
||||
useMaterial3: true,
|
||||
colorScheme: ColorScheme.fromSeed(seedColor: Colors.green)
|
||||
),
|
||||
home: const MyHomePage(),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
class MyAppState extends ChangeNotifier{
|
||||
var counter = 0;
|
||||
|
||||
void increment(){
|
||||
counter++;
|
||||
notifyListeners();
|
||||
}
|
||||
}
|
||||
|
||||
class MyHomePage extends StatelessWidget{
|
||||
const MyHomePage({super.key});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context){
|
||||
var appState = context.watch<MyAppState>();
|
||||
var sCount = appState.counter.toString();
|
||||
|
||||
return Scaffold(
|
||||
body: Center(
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
Text('count: $sCount'),
|
||||
ElevatedButton(
|
||||
onPressed: () => appState.increment(),
|
||||
child: const Text('Increment')),
|
||||
],
|
||||
),
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
}
|
79
.config/Code/User/History/-2e064889/Cl8I.dart
Normal file
79
.config/Code/User/History/-2e064889/Cl8I.dart
Normal file
|
@ -0,0 +1,79 @@
|
|||
import 'package:flutter/material.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
|
||||
void main(){
|
||||
runApp(const MyApp());
|
||||
}
|
||||
|
||||
class MyApp extends StatelessWidget{
|
||||
const MyApp({super.key});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context){
|
||||
return ChangeNotifierProvider(
|
||||
create: (context) => MyAppState(),
|
||||
child: MaterialApp(
|
||||
title: 'First App',
|
||||
theme: ThemeData(
|
||||
useMaterial3: true,
|
||||
colorScheme: ColorScheme.fromSeed(seedColor: Colors.green)
|
||||
),
|
||||
home: const MyHomePage(),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
class MyAppState extends ChangeNotifier{
|
||||
var counter = 0;
|
||||
|
||||
void increment(){
|
||||
counter++;
|
||||
notifyListeners();
|
||||
}
|
||||
}
|
||||
|
||||
class MyHomePage extends StatefulWidget{
|
||||
const MyHomePage({super.key});
|
||||
|
||||
@override
|
||||
State<MyHomePage> createState() => _MyHomePageState();
|
||||
}
|
||||
|
||||
class _MyHomePageState extends State<MyHomePage> {
|
||||
@override
|
||||
Widget build(BuildContext context){
|
||||
var appState = context.watch<MyAppState>();
|
||||
var sCount = appState.counter.toString();
|
||||
|
||||
return Scaffold(
|
||||
body: Row(
|
||||
children: [
|
||||
SafeArea(
|
||||
child: NavigationRail(
|
||||
destinations: [
|
||||
const NavigationRailDestination(
|
||||
icon: Icon(Icons.home),
|
||||
label: Text('Home'),
|
||||
)
|
||||
],
|
||||
selectedIndex: 0)
|
||||
),
|
||||
Center(
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
Text('count: $sCount'),
|
||||
ElevatedButton(
|
||||
onPressed: () => appState.increment(),
|
||||
child: const Text('Increment')
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
|
||||
],
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
89
.config/Code/User/History/-2e064889/DP5I.dart
Normal file
89
.config/Code/User/History/-2e064889/DP5I.dart
Normal file
|
@ -0,0 +1,89 @@
|
|||
import 'package:flutter/material.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
|
||||
void main(){
|
||||
runApp(const MyApp());
|
||||
}
|
||||
|
||||
class MyApp extends StatelessWidget{
|
||||
const MyApp({super.key});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context){
|
||||
return ChangeNotifierProvider(
|
||||
create: (context) => MyAppState(),
|
||||
child: MaterialApp(
|
||||
title: 'First App',
|
||||
theme: ThemeData(
|
||||
useMaterial3: true,
|
||||
colorScheme: ColorScheme.fromSeed(seedColor: Colors.green)
|
||||
),
|
||||
home: const MyHomePage(),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
class MyAppState extends ChangeNotifier{
|
||||
|
||||
}
|
||||
|
||||
class MyHomePage extends StatefulWidget{
|
||||
const MyHomePage({super.key});
|
||||
|
||||
@override
|
||||
State<MyHomePage> createState() => _MyHomePageState();
|
||||
}
|
||||
|
||||
class _MyHomePageState extends State<MyHomePage>{
|
||||
|
||||
var counter = 0;
|
||||
var selectedIndex = 0;
|
||||
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context){
|
||||
var sCount = counter.toString();
|
||||
|
||||
return Scaffold(
|
||||
body: Row(
|
||||
children: [
|
||||
SafeArea(
|
||||
child: NavigationRail(
|
||||
destinations: const [
|
||||
NavigationRailDestination(
|
||||
icon: Icon(Icons.home),
|
||||
label: Text('Home'),
|
||||
),
|
||||
NavigationRailDestination(
|
||||
icon: Icon(Icons.favorite),
|
||||
label: Text('Favorites'),
|
||||
),
|
||||
],
|
||||
selectedIndex: selectedIndex,
|
||||
onDestinationSelected: (value) => selectedIndex = value,
|
||||
),
|
||||
),
|
||||
Expanded(
|
||||
child: Center(
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
Text('count: $sCount'),
|
||||
ElevatedButton(
|
||||
onPressed: () => {
|
||||
setState((){
|
||||
counter++;
|
||||
})
|
||||
},
|
||||
child: const Text('Increment')
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
)
|
||||
],
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
50
.config/Code/User/History/-2e064889/ESuK.dart
Normal file
50
.config/Code/User/History/-2e064889/ESuK.dart
Normal file
|
@ -0,0 +1,50 @@
|
|||
import 'package:flutter/material.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
|
||||
void main(){
|
||||
runApp(const MyApp());
|
||||
}
|
||||
|
||||
class MyApp extends StatelessWidget{
|
||||
const MyApp({super.key});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context){
|
||||
return ChangeNotifierProvider(
|
||||
create: (context) => MyAppState(),
|
||||
child: MaterialApp(
|
||||
title: 'First App',
|
||||
theme: ThemeData(
|
||||
useMaterial3: true,
|
||||
colorScheme: ColorScheme.fromSeed(seedColor: Colors.green)
|
||||
),
|
||||
home: const MyHomePage(),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
class MyAppState extends ChangeNotifier{
|
||||
var counter = 0;
|
||||
}
|
||||
|
||||
class MyHomePage extends StatelessWidget{
|
||||
const MyHomePage({super.key});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context){
|
||||
var appState = context.watch<MyAppState>();
|
||||
var sCount = appState.counter.toString();
|
||||
|
||||
return const Scaffold(
|
||||
body: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
Text('count: $sCount'),
|
||||
],
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
}
|
52
.config/Code/User/History/-2e064889/EuJQ.dart
Normal file
52
.config/Code/User/History/-2e064889/EuJQ.dart
Normal file
|
@ -0,0 +1,52 @@
|
|||
import 'package:flutter/material.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
|
||||
void main(){
|
||||
runApp(const MyApp());
|
||||
}
|
||||
|
||||
class MyApp extends StatelessWidget{
|
||||
const MyApp({super.key});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context){
|
||||
return ChangeNotifierProvider(
|
||||
create: (context) => MyAppState(),
|
||||
child: MaterialApp(
|
||||
title: 'First App',
|
||||
theme: ThemeData(
|
||||
useMaterial3: true,
|
||||
colorScheme: ColorScheme.fromSeed(seedColor: Colors.green)
|
||||
),
|
||||
home: const MyHomePage(),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
class MyAppState extends ChangeNotifier{
|
||||
var counter = 0;
|
||||
}
|
||||
|
||||
class MyHomePage extends StatelessWidget{
|
||||
const MyHomePage({super.key});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context){
|
||||
var appState = context.watch<MyAppState>();
|
||||
var sCount = appState.counter.toString();
|
||||
|
||||
return Scaffold(
|
||||
body: Center(
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
Text('count: $sCount'),
|
||||
ElevatedButton(onPressed: () => print('working'), child: Text('hello'))
|
||||
],
|
||||
),
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
}
|
91
.config/Code/User/History/-2e064889/GOTH.dart
Normal file
91
.config/Code/User/History/-2e064889/GOTH.dart
Normal file
|
@ -0,0 +1,91 @@
|
|||
import 'package:flutter/material.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
|
||||
void main(){
|
||||
runApp(const MyApp());
|
||||
}
|
||||
|
||||
class MyApp extends StatelessWidget{
|
||||
const MyApp({super.key});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context){
|
||||
return ChangeNotifierProvider(
|
||||
create: (context) => MyAppState(),
|
||||
child: MaterialApp(
|
||||
title: 'First App',
|
||||
theme: ThemeData(
|
||||
useMaterial3: true,
|
||||
colorScheme: ColorScheme.fromSeed(seedColor: Colors.green)
|
||||
),
|
||||
home: const MyHomePage(),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
class MyAppState extends ChangeNotifier{
|
||||
|
||||
}
|
||||
|
||||
class MyHomePage extends StatefulWidget{
|
||||
const MyHomePage({super.key});
|
||||
|
||||
@override
|
||||
State<MyHomePage> createState() => _MyHomePageState();
|
||||
}
|
||||
|
||||
class _MyHomePageState extends State<MyHomePage>{
|
||||
|
||||
var counter = 0;
|
||||
var selectedIndex = 0;
|
||||
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context){
|
||||
var sCount = counter.toString();
|
||||
|
||||
return Scaffold(
|
||||
body: Row(
|
||||
children: [
|
||||
SafeArea(
|
||||
child: NavigationRail(
|
||||
destinations: const [
|
||||
NavigationRailDestination(
|
||||
icon: Icon(Icons.home),
|
||||
label: Text('Home'),
|
||||
),
|
||||
NavigationRailDestination(
|
||||
icon: Icon(Icons.favorite),
|
||||
label: Text('Favorites'),
|
||||
),
|
||||
],
|
||||
selectedIndex: selectedIndex,
|
||||
onDestinationSelected: (value) => setState((){
|
||||
selectedIndex = value;
|
||||
}),
|
||||
),
|
||||
),
|
||||
Expanded(
|
||||
child: Center(
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
Text('count: $sCount'),
|
||||
ElevatedButton(
|
||||
onPressed: () => {
|
||||
setState((){
|
||||
counter++;
|
||||
})
|
||||
},
|
||||
child: const Text('Increment')
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
)
|
||||
],
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
53
.config/Code/User/History/-2e064889/HVAl.dart
Normal file
53
.config/Code/User/History/-2e064889/HVAl.dart
Normal file
|
@ -0,0 +1,53 @@
|
|||
import 'package:flutter/material.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
|
||||
void main(){
|
||||
runApp(const MyApp());
|
||||
}
|
||||
|
||||
class MyApp extends StatelessWidget{
|
||||
const MyApp({super.key});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context){
|
||||
return ChangeNotifierProvider(
|
||||
create: (context) => MyAppState(),
|
||||
child: MaterialApp(
|
||||
title: 'First App',
|
||||
theme: ThemeData(
|
||||
useMaterial3: true,
|
||||
colorScheme: ColorScheme.fromSeed(seedColor: Colors.green)
|
||||
),
|
||||
home: const MyHomePage(),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
class MyAppState extends ChangeNotifier{
|
||||
var counter = 0;
|
||||
}
|
||||
|
||||
class MyHomePage extends StatelessWidget{
|
||||
const MyHomePage({super.key});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context){
|
||||
var appState = context.watch<MyAppState>();
|
||||
var sCount = appState.counter.toString();
|
||||
const a = 'test';
|
||||
|
||||
return const Scaffold(
|
||||
body: Center(
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
Text('count: $a'),
|
||||
],
|
||||
),
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
}
|
49
.config/Code/User/History/-2e064889/JqF3.dart
Normal file
49
.config/Code/User/History/-2e064889/JqF3.dart
Normal file
|
@ -0,0 +1,49 @@
|
|||
import 'package:flutter/material.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
|
||||
void main(){
|
||||
runApp(const MyApp());
|
||||
}
|
||||
|
||||
class MyApp extends StatelessWidget{
|
||||
const MyApp({super.key});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context){
|
||||
return ChangeNotifierProvider(
|
||||
create: (context) => MyAppState(),
|
||||
child: MaterialApp(
|
||||
title: 'First App',
|
||||
theme: ThemeData(
|
||||
useMaterial3: true,
|
||||
colorScheme: ColorScheme.fromSeed(seedColor: Colors.green)
|
||||
),
|
||||
home: const MyHomePage(),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
class MyAppState extends ChangeNotifier{
|
||||
var counter = 0;
|
||||
}
|
||||
|
||||
class MyHomePage extends StatelessWidget{
|
||||
const MyHomePage({super.key});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context){
|
||||
var appState = context.watch<MyAppState>();
|
||||
|
||||
return const Scaffold(
|
||||
body: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
Text('count: ${appState.counter}')
|
||||
],
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
}
|
59
.config/Code/User/History/-2e064889/LTlm.dart
Normal file
59
.config/Code/User/History/-2e064889/LTlm.dart
Normal file
|
@ -0,0 +1,59 @@
|
|||
import 'package:flutter/material.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
|
||||
void main(){
|
||||
runApp(const MyApp());
|
||||
}
|
||||
|
||||
class MyApp extends StatelessWidget{
|
||||
const MyApp({super.key});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context){
|
||||
return ChangeNotifierProvider(
|
||||
create: (context) => MyAppState(),
|
||||
child: MaterialApp(
|
||||
title: 'First App',
|
||||
theme: ThemeData(
|
||||
useMaterial3: true,
|
||||
colorScheme: ColorScheme.fromSeed(seedColor: const Color.fromARGB(255, 46, 147, 165))
|
||||
),
|
||||
home: const MyHomePage(),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
class MyAppState extends ChangeNotifier{
|
||||
var counter = 0;
|
||||
|
||||
void increment(){
|
||||
counter++;
|
||||
notifyListeners();
|
||||
}
|
||||
}
|
||||
|
||||
class MyHomePage extends StatelessWidget{
|
||||
const MyHomePage({super.key});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context){
|
||||
var appState = context.watch<MyAppState>();
|
||||
var sCount = appState.counter.toString();
|
||||
|
||||
return Scaffold(
|
||||
body: Center(
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
Text('count: $sCount'),
|
||||
ElevatedButton(
|
||||
onPressed: () => appState.increment(),
|
||||
child: const Text('Increment')),
|
||||
],
|
||||
),
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
}
|
51
.config/Code/User/History/-2e064889/LiIY.dart
Normal file
51
.config/Code/User/History/-2e064889/LiIY.dart
Normal file
|
@ -0,0 +1,51 @@
|
|||
import 'package:flutter/material.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
|
||||
void main(){
|
||||
runApp(const MyApp());
|
||||
}
|
||||
|
||||
class MyApp extends StatelessWidget{
|
||||
const MyApp({super.key});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context){
|
||||
return ChangeNotifierProvider(
|
||||
create: (context) => MyAppState(),
|
||||
child: MaterialApp(
|
||||
title: 'First App',
|
||||
theme: ThemeData(
|
||||
useMaterial3: true,
|
||||
colorScheme: ColorScheme.fromSeed(seedColor: Colors.green)
|
||||
),
|
||||
home: const MyHomePage(),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
class MyAppState extends ChangeNotifier{
|
||||
var counter = 0;
|
||||
}
|
||||
|
||||
class MyHomePage extends StatelessWidget{
|
||||
const MyHomePage({super.key});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context){
|
||||
var appState = context.watch<MyAppState>();
|
||||
var sCount = appState.counter.toString();
|
||||
|
||||
return const Scaffold(
|
||||
body: Center(
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
Text('count: '),
|
||||
],
|
||||
),
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
}
|
56
.config/Code/User/History/-2e064889/MU9z.dart
Normal file
56
.config/Code/User/History/-2e064889/MU9z.dart
Normal file
|
@ -0,0 +1,56 @@
|
|||
import 'package:flutter/material.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
|
||||
void main(){
|
||||
runApp(const MyApp());
|
||||
}
|
||||
|
||||
class MyApp extends StatelessWidget{
|
||||
const MyApp({super.key});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context){
|
||||
return ChangeNotifierProvider(
|
||||
create: (context) => MyAppState(),
|
||||
child: MaterialApp(
|
||||
title: 'First App',
|
||||
theme: ThemeData(
|
||||
useMaterial3: true,
|
||||
colorScheme: ColorScheme.fromSeed(seedColor: Colors.green)
|
||||
),
|
||||
home: const MyHomePage(),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
class MyAppState extends ChangeNotifier{
|
||||
var counter = 0;
|
||||
}
|
||||
|
||||
class MyHomePage extends StatelessWidget{
|
||||
const MyHomePage({super.key});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context){
|
||||
var appState = context.watch<MyAppState>();
|
||||
var sCount = appState.counter.toString();
|
||||
|
||||
return Scaffold(
|
||||
body: Center(
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
Text('count: $sCount'),
|
||||
ElevatedButton(
|
||||
onPressed: () => {
|
||||
appState.counter++
|
||||
},
|
||||
child: const Text('Increment')),
|
||||
],
|
||||
),
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
}
|
80
.config/Code/User/History/-2e064889/NpnZ.dart
Normal file
80
.config/Code/User/History/-2e064889/NpnZ.dart
Normal file
|
@ -0,0 +1,80 @@
|
|||
import 'package:flutter/material.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
|
||||
void main(){
|
||||
runApp(const MyApp());
|
||||
}
|
||||
|
||||
class MyApp extends StatelessWidget{
|
||||
const MyApp({super.key});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context){
|
||||
return ChangeNotifierProvider(
|
||||
create: (context) => MyAppState(),
|
||||
child: MaterialApp(
|
||||
title: 'First App',
|
||||
theme: ThemeData(
|
||||
useMaterial3: true,
|
||||
colorScheme: ColorScheme.fromSeed(seedColor: Colors.green)
|
||||
),
|
||||
home: const MyHomePage(),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
class MyAppState extends ChangeNotifier{
|
||||
var counter = 0;
|
||||
|
||||
void increment(){
|
||||
counter++;
|
||||
notifyListeners();
|
||||
}
|
||||
}
|
||||
|
||||
class MyHomePage extends StatefulWidget{
|
||||
const MyHomePage({super.key});
|
||||
|
||||
@override
|
||||
State<MyHomePage> createState() => _MyHomePageState();
|
||||
}
|
||||
|
||||
class _MyHomePageState extends State<MyHomePage> {
|
||||
@override
|
||||
Widget build(BuildContext context){
|
||||
var appState = context.watch<MyAppState>();
|
||||
var sCount = appState.counter.toString();
|
||||
|
||||
return Scaffold(
|
||||
body: Row(
|
||||
children: [
|
||||
SafeArea(
|
||||
child: NavigationRail(
|
||||
destinations: [
|
||||
NavigationRailDestination(
|
||||
icon: const Icon(Icons.home),
|
||||
label: const Text('Home'),
|
||||
)
|
||||
],
|
||||
selectedIndex: 0
|
||||
),
|
||||
),
|
||||
Center(
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
Text('count: $sCount'),
|
||||
ElevatedButton(
|
||||
onPressed: () => appState.increment(),
|
||||
child: const Text('Increment')
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
|
||||
],
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
56
.config/Code/User/History/-2e064889/Q9Eb.dart
Normal file
56
.config/Code/User/History/-2e064889/Q9Eb.dart
Normal file
|
@ -0,0 +1,56 @@
|
|||
import 'package:flutter/material.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
|
||||
void main(){
|
||||
runApp(const MyApp());
|
||||
}
|
||||
|
||||
class MyApp extends StatelessWidget{
|
||||
const MyApp({super.key});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context){
|
||||
return ChangeNotifierProvider(
|
||||
create: (context) => MyAppState(),
|
||||
child: MaterialApp(
|
||||
title: 'First App',
|
||||
theme: ThemeData(
|
||||
useMaterial3: true,
|
||||
colorScheme: ColorScheme.fromSeed(seedColor: Colors.green)
|
||||
),
|
||||
home: const MyHomePage(),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
class MyAppState extends ChangeNotifier{
|
||||
var counter = 0;
|
||||
}
|
||||
|
||||
class MyHomePage extends StatelessWidget{
|
||||
const MyHomePage({super.key});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context){
|
||||
var appState = context.watch<MyAppState>();
|
||||
var sCount = appState.counter.toString();
|
||||
|
||||
return Scaffold(
|
||||
body: Center(
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
Text('count: $sCount'),
|
||||
ElevatedButton(
|
||||
onPressed: () => {
|
||||
appState.counter++
|
||||
},
|
||||
child: const Text('Increment')),
|
||||
],
|
||||
),
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
}
|
51
.config/Code/User/History/-2e064889/WF0U.dart
Normal file
51
.config/Code/User/History/-2e064889/WF0U.dart
Normal file
|
@ -0,0 +1,51 @@
|
|||
import 'package:flutter/material.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
|
||||
void main(){
|
||||
runApp(const MyApp());
|
||||
}
|
||||
|
||||
class MyApp extends StatelessWidget{
|
||||
const MyApp({super.key});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context){
|
||||
return ChangeNotifierProvider(
|
||||
create: (context) => MyAppState(),
|
||||
child: MaterialApp(
|
||||
title: 'First App',
|
||||
theme: ThemeData(
|
||||
useMaterial3: true,
|
||||
colorScheme: ColorScheme.fromSeed(seedColor: Colors.green)
|
||||
),
|
||||
home: const MyHomePage(),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
class MyAppState extends ChangeNotifier{
|
||||
var counter = 0;
|
||||
}
|
||||
|
||||
class MyHomePage extends StatelessWidget{
|
||||
const MyHomePage({super.key});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context){
|
||||
var appState = context.watch<MyAppState>();
|
||||
var sCount = appState.counter.toString();
|
||||
|
||||
return const Scaffold(
|
||||
body: Center(
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
Text('count: $sCount'),
|
||||
],
|
||||
),
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
}
|
51
.config/Code/User/History/-2e064889/WgiO.dart
Normal file
51
.config/Code/User/History/-2e064889/WgiO.dart
Normal file
|
@ -0,0 +1,51 @@
|
|||
import 'package:flutter/material.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
|
||||
void main(){
|
||||
runApp(const MyApp());
|
||||
}
|
||||
|
||||
class MyApp extends StatelessWidget{
|
||||
const MyApp({super.key});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context){
|
||||
return ChangeNotifierProvider(
|
||||
create: (context) => MyAppState(),
|
||||
child: MaterialApp(
|
||||
title: 'First App',
|
||||
theme: ThemeData(
|
||||
useMaterial3: true,
|
||||
colorScheme: ColorScheme.fromSeed(seedColor: Colors.green)
|
||||
),
|
||||
home: const MyHomePage(),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
class MyAppState extends ChangeNotifier{
|
||||
var counter = 0;
|
||||
}
|
||||
|
||||
class MyHomePage extends StatelessWidget{
|
||||
const MyHomePage({super.key});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context){
|
||||
var appState = context.watch<MyAppState>();
|
||||
var sCount = appState.counter.toString();
|
||||
const a = 'test';
|
||||
|
||||
return const Scaffold(
|
||||
body: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
Text('count: $a'),
|
||||
],
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
}
|
87
.config/Code/User/History/-2e064889/YMbX.dart
Normal file
87
.config/Code/User/History/-2e064889/YMbX.dart
Normal file
|
@ -0,0 +1,87 @@
|
|||
import 'package:flutter/material.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
|
||||
void main(){
|
||||
runApp(const MyApp());
|
||||
}
|
||||
|
||||
class MyApp extends StatelessWidget{
|
||||
const MyApp({super.key});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context){
|
||||
return ChangeNotifierProvider(
|
||||
create: (context) => MyAppState(),
|
||||
child: MaterialApp(
|
||||
title: 'First App',
|
||||
theme: ThemeData(
|
||||
useMaterial3: true,
|
||||
colorScheme: ColorScheme.fromSeed(seedColor: Colors.green)
|
||||
),
|
||||
home: const MyHomePage(),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
class MyAppState extends ChangeNotifier{
|
||||
|
||||
}
|
||||
|
||||
class MyHomePage extends StatefulWidget{
|
||||
const MyHomePage({super.key});
|
||||
|
||||
@override
|
||||
State<MyHomePage> createState() => _MyHomePageState();
|
||||
}
|
||||
|
||||
class _MyHomePageState extends State<MyHomePage>{
|
||||
|
||||
var counter = 0;
|
||||
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context){
|
||||
var sCount = counter.toString();
|
||||
|
||||
return Scaffold(
|
||||
body: Row(
|
||||
children: [
|
||||
SafeArea(
|
||||
child: NavigationRail(
|
||||
destinations: const [
|
||||
NavigationRailDestination(
|
||||
icon: Icon(Icons.home),
|
||||
label: Text('Home'),
|
||||
),
|
||||
NavigationRailDestination(
|
||||
icon: Icon(Icons.favorite),
|
||||
label: Text('Favorites'),
|
||||
),
|
||||
],
|
||||
selectedIndex: 0
|
||||
),
|
||||
),
|
||||
Expanded(
|
||||
child: Center(
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
Text('count: $sCount'),
|
||||
ElevatedButton(
|
||||
onPressed: () => {
|
||||
setState((){
|
||||
counter++;
|
||||
})
|
||||
},
|
||||
child: const Text('Increment')
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
)
|
||||
],
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
66
.config/Code/User/History/-2e064889/aOVp.dart
Normal file
66
.config/Code/User/History/-2e064889/aOVp.dart
Normal file
|
@ -0,0 +1,66 @@
|
|||
import 'package:flutter/material.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
import 'dart:io';
|
||||
|
||||
void main(){
|
||||
runApp(const MyApp());
|
||||
Directory dir = Directory('/');
|
||||
var list = dir.listSync();
|
||||
}
|
||||
|
||||
class MyApp extends StatelessWidget{
|
||||
const MyApp({super.key});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context){
|
||||
return ChangeNotifierProvider(
|
||||
create: (context) => MyAppState(),
|
||||
child: MaterialApp(
|
||||
title: 'First App',
|
||||
theme: ThemeData(
|
||||
useMaterial3: true,
|
||||
colorScheme: ColorScheme.fromSeed(seedColor: Colors.green)
|
||||
),
|
||||
home: const MyHomePage(),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
class MyAppState extends ChangeNotifier{
|
||||
var counter = 0;
|
||||
|
||||
void increment(){
|
||||
counter++;
|
||||
notifyListeners();
|
||||
}
|
||||
}
|
||||
|
||||
class MyHomePage extends StatefulWidget{
|
||||
const MyHomePage({super.key});
|
||||
|
||||
@override
|
||||
State<MyHomePage> createState() => _MyHomePageState();
|
||||
}
|
||||
|
||||
class _MyHomePageState extends State<MyHomePage> {
|
||||
@override
|
||||
Widget build(BuildContext context){
|
||||
var appState = context.watch<MyAppState>();
|
||||
var sCount = appState.counter.toString();
|
||||
|
||||
return Scaffold(
|
||||
body: Center(
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
Text('count: $sCount'),
|
||||
ElevatedButton(
|
||||
onPressed: () => appState.increment(),
|
||||
child: const Text('Increment')),
|
||||
],
|
||||
),
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
83
.config/Code/User/History/-2e064889/aa6U.dart
Normal file
83
.config/Code/User/History/-2e064889/aa6U.dart
Normal file
|
@ -0,0 +1,83 @@
|
|||
import 'package:flutter/material.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
|
||||
void main(){
|
||||
runApp(const MyApp());
|
||||
}
|
||||
|
||||
class MyApp extends StatelessWidget{
|
||||
const MyApp({super.key});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context){
|
||||
return ChangeNotifierProvider(
|
||||
create: (context) => MyAppState(),
|
||||
child: MaterialApp(
|
||||
title: 'First App',
|
||||
theme: ThemeData(
|
||||
useMaterial3: true,
|
||||
colorScheme: ColorScheme.fromSeed(seedColor: Colors.green)
|
||||
),
|
||||
home: const MyHomePage(),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
class MyHomePage extends StatefulWidget{
|
||||
const MyHomePage({super.key});
|
||||
|
||||
@override
|
||||
State<MyHomePage> createState() => _MyHomePageState();
|
||||
}
|
||||
|
||||
class _MyHomePageState extends State<MyHomePage>{
|
||||
|
||||
var counter = 0;
|
||||
|
||||
void increment(){
|
||||
counter++;
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context){
|
||||
|
||||
var sCount = counter.toString();
|
||||
|
||||
return Scaffold(
|
||||
body: Row(
|
||||
children: [
|
||||
SafeArea(
|
||||
child: NavigationRail(
|
||||
destinations: const [
|
||||
NavigationRailDestination(
|
||||
icon: Icon(Icons.home),
|
||||
label: Text('Home'),
|
||||
),
|
||||
NavigationRailDestination(
|
||||
icon: Icon(Icons.favorite),
|
||||
label: Text('Home'),
|
||||
),
|
||||
],
|
||||
selectedIndex: 0
|
||||
),
|
||||
),
|
||||
Center(
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
Text('count: $sCount'),
|
||||
ElevatedButton(
|
||||
onPressed: () => increment(),
|
||||
child: const Text('Increment')
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
|
||||
],
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
51
.config/Code/User/History/-2e064889/d1kQ.dart
Normal file
51
.config/Code/User/History/-2e064889/d1kQ.dart
Normal file
|
@ -0,0 +1,51 @@
|
|||
import 'package:flutter/material.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
|
||||
void main(){
|
||||
runApp(const MyApp());
|
||||
}
|
||||
|
||||
class MyApp extends StatelessWidget{
|
||||
const MyApp({super.key});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context){
|
||||
return ChangeNotifierProvider(
|
||||
create: (context) => MyAppState(),
|
||||
child: MaterialApp(
|
||||
title: 'First App',
|
||||
theme: ThemeData(
|
||||
useMaterial3: true,
|
||||
colorScheme: ColorScheme.fromSeed(seedColor: Colors.green)
|
||||
),
|
||||
home: const MyHomePage(),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
class MyAppState extends ChangeNotifier{
|
||||
var counter = 0;
|
||||
}
|
||||
|
||||
class MyHomePage extends StatelessWidget{
|
||||
const MyHomePage({super.key});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context){
|
||||
var appState = context.watch<MyAppState>();
|
||||
const sCount = appState.counter.toString();
|
||||
|
||||
return const Scaffold(
|
||||
body: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
Text('count: '),
|
||||
Text(sCount),
|
||||
],
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
}
|
51
.config/Code/User/History/-2e064889/dAFd.dart
Normal file
51
.config/Code/User/History/-2e064889/dAFd.dart
Normal file
|
@ -0,0 +1,51 @@
|
|||
import 'package:flutter/material.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
|
||||
void main(){
|
||||
runApp(const MyApp());
|
||||
}
|
||||
|
||||
class MyApp extends StatelessWidget{
|
||||
const MyApp({super.key});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context){
|
||||
return ChangeNotifierProvider(
|
||||
create: (context) => MyAppState(),
|
||||
child: MaterialApp(
|
||||
title: 'First App',
|
||||
theme: ThemeData(
|
||||
useMaterial3: true,
|
||||
colorScheme: ColorScheme.fromSeed(seedColor: Colors.green)
|
||||
),
|
||||
home: const MyHomePage(),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
class MyAppState extends ChangeNotifier{
|
||||
var counter = 0;
|
||||
}
|
||||
|
||||
class MyHomePage extends StatelessWidget{
|
||||
const MyHomePage({super.key});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context){
|
||||
var appState = context.watch<MyAppState>();
|
||||
var sCount = appState.counter.toString();
|
||||
|
||||
return const Scaffold(
|
||||
body: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
Text('count: '),
|
||||
Text(sCount),
|
||||
],
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
}
|
50
.config/Code/User/History/-2e064889/dNx1.dart
Normal file
50
.config/Code/User/History/-2e064889/dNx1.dart
Normal file
|
@ -0,0 +1,50 @@
|
|||
import 'package:flutter/material.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
|
||||
void main(){
|
||||
runApp(const MyApp());
|
||||
}
|
||||
|
||||
class MyApp extends StatelessWidget{
|
||||
const MyApp({super.key});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context){
|
||||
return ChangeNotifierProvider(
|
||||
create: (context) => MyAppState(),
|
||||
child: MaterialApp(
|
||||
title: 'First App',
|
||||
theme: ThemeData(
|
||||
useMaterial3: true,
|
||||
colorScheme: ColorScheme.fromSeed(seedColor: Colors.green)
|
||||
),
|
||||
home: const MyHomePage(),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
class MyAppState extends ChangeNotifier{
|
||||
var counter = 0;
|
||||
}
|
||||
|
||||
class MyHomePage extends StatelessWidget{
|
||||
const MyHomePage({super.key});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context){
|
||||
var appState = context.watch<MyAppState>();
|
||||
|
||||
return const Scaffold(
|
||||
body: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
Text('count: '),
|
||||
Text(appState.counter),
|
||||
],
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
}
|
59
.config/Code/User/History/-2e064889/dQKK.dart
Normal file
59
.config/Code/User/History/-2e064889/dQKK.dart
Normal file
|
@ -0,0 +1,59 @@
|
|||
import 'package:flutter/material.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
|
||||
void main(){
|
||||
runApp(const MyApp());
|
||||
}
|
||||
|
||||
class MyApp extends StatelessWidget{
|
||||
const MyApp({super.key});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context){
|
||||
return ChangeNotifierProvider(
|
||||
create: (context) => MyAppState(),
|
||||
child: MaterialApp(
|
||||
title: 'First App',
|
||||
theme: ThemeData(
|
||||
useMaterial3: true,
|
||||
colorScheme: ColorScheme.fromSeed(seedColor: Colors.red)
|
||||
),
|
||||
home: const MyHomePage(),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
class MyAppState extends ChangeNotifier{
|
||||
var counter = 0;
|
||||
|
||||
void increment(){
|
||||
counter++;
|
||||
notifyListeners();
|
||||
}
|
||||
}
|
||||
|
||||
class MyHomePage extends StatelessWidget{
|
||||
const MyHomePage({super.key});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context){
|
||||
var appState = context.watch<MyAppState>();
|
||||
var sCount = appState.counter.toString();
|
||||
|
||||
return Scaffold(
|
||||
body: Center(
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
Text('count: $sCount'),
|
||||
ElevatedButton(
|
||||
onPressed: () => appState.increment(),
|
||||
child: const Text('Increment')),
|
||||
],
|
||||
),
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
}
|
84
.config/Code/User/History/-2e064889/eAJQ.dart
Normal file
84
.config/Code/User/History/-2e064889/eAJQ.dart
Normal file
|
@ -0,0 +1,84 @@
|
|||
import 'package:flutter/material.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
|
||||
void main(){
|
||||
runApp(const MyApp());
|
||||
}
|
||||
|
||||
class MyApp extends StatelessWidget{
|
||||
const MyApp({super.key});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context){
|
||||
return ChangeNotifierProvider(
|
||||
create: (context) => MyAppState(),
|
||||
child: MaterialApp(
|
||||
title: 'First App',
|
||||
theme: ThemeData(
|
||||
useMaterial3: true,
|
||||
colorScheme: ColorScheme.fromSeed(seedColor: Colors.green)
|
||||
),
|
||||
home: const MyHomePage(),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
class MyAppState extends ChangeNotifier{
|
||||
var counter = 0;
|
||||
|
||||
void increment(){
|
||||
counter++;
|
||||
notifyListeners();
|
||||
}
|
||||
}
|
||||
|
||||
class MyHomePage extends StatefulWidget{
|
||||
const MyHomePage({super.key});
|
||||
|
||||
@override
|
||||
State<MyHomePage> createState() => _MyHomePageState();
|
||||
}
|
||||
|
||||
class _MyHomePageState extends State<MyHomePage>{
|
||||
@override
|
||||
Widget build(BuildContext context){
|
||||
var appState = context.watch<MyAppState>();
|
||||
var sCount = appState.counter.toString();
|
||||
|
||||
return Scaffold(
|
||||
body: Row(
|
||||
children: [
|
||||
SafeArea(
|
||||
child: NavigationRail(
|
||||
destinations: const [
|
||||
NavigationRailDestination(
|
||||
icon: Icon(Icons.home),
|
||||
label: Text('Home'),
|
||||
),
|
||||
NavigationRailDestination(
|
||||
icon: Icon(Icons.favorite),
|
||||
label: Text('Home'),
|
||||
),
|
||||
],
|
||||
selectedIndex: 0
|
||||
),
|
||||
),
|
||||
Center(
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
Text('count: $sCount'),
|
||||
ElevatedButton(
|
||||
onPressed: () => appState.increment(),
|
||||
child: const Text('Increment')
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
|
||||
],
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
1
.config/Code/User/History/-2e064889/entries.json
Normal file
1
.config/Code/User/History/-2e064889/entries.json
Normal file
|
@ -0,0 +1 @@
|
|||
{"version":1,"resource":"file:///home/rafayahmad/Stuff/Coding/Flutter/firstthing/firstproject/lib/main.dart","entries":[{"id":"mjCM.dart","timestamp":1723462751695},{"id":"JqF3.dart","timestamp":1723462801225},{"id":"dNx1.dart","timestamp":1723462833759},{"id":"51KZ.dart","timestamp":1723462849272},{"id":"d1kQ.dart","timestamp":1723462878969},{"id":"dAFd.dart","timestamp":1723462918039},{"id":"ESuK.dart","timestamp":1723462989579},{"id":"WgiO.dart","timestamp":1723463005539},{"id":"HVAl.dart","timestamp":1723463047162},{"id":"1Wjd.dart","timestamp":1723463197303},{"id":"LiIY.dart","timestamp":1723463219849},{"id":"WF0U.dart","timestamp":1723463237243},{"id":"1ad6.dart","timestamp":1723463339580},{"id":"EuJQ.dart","timestamp":1723463400463},{"id":"gM7x.dart","timestamp":1723463422753},{"id":"xrwu.dart","timestamp":1723463441276},{"id":"MU9z.dart","timestamp":1723463467550},{"id":"Q9Eb.dart","timestamp":1723463487803},{"id":"jSuo.dart","timestamp":1723463531813},{"id":"CFiD.dart","timestamp":1723463555015},{"id":"y0xV.dart","timestamp":1723463709181},{"id":"LTlm.dart","timestamp":1723463720894},{"id":"dQKK.dart","timestamp":1723463744477},{"id":"2fyN.dart","timestamp":1723472835166},{"id":"uJK1.dart","source":"Convert to StatefulWidget","timestamp":1723474517210},{"id":"aOVp.dart","timestamp":1723521809823},{"id":"ffAN.dart","timestamp":1723521821790},{"id":"8kwh.dart","timestamp":1723521930825},{"id":"2sZA.dart","timestamp":1723522038620},{"id":"6otU.dart","timestamp":1723522272380},{"id":"Cl8I.dart","timestamp":1723522315368},{"id":"3NVh.dart","timestamp":1723522337882},{"id":"NpnZ.dart","timestamp":1723522427349},{"id":"8VJJ.dart","source":"Add 'const' modifier","timestamp":1723522450266},{"id":"yf4P.dart","timestamp":1723522502158},{"id":"x7cF.dart","timestamp":1723522550736},{"id":"C9dp.dart","timestamp":1723522601200},{"id":"aa6U.dart","timestamp":1723522698079},{"id":"eAJQ.dart","timestamp":1723522719681},{"id":"qVLo.dart","timestamp":1723522756008},{"id":"yUbT.dart","timestamp":1723522794879},{"id":"0lGF.dart","timestamp":1723522812010},{"id":"z8XQ.dart","timestamp":1723522850358},{"id":"YMbX.dart","timestamp":1723523038383},{"id":"hqV3.dart","timestamp":1723523058075},{"id":"DP5I.dart","timestamp":1723523104159},{"id":"GOTH.dart","timestamp":1723523135151},{"id":"zkFb.dart","timestamp":1723523183056},{"id":"6GMO.dart","timestamp":1723523206492},{"id":"qQfz.dart","timestamp":1723523410228}]}
|
67
.config/Code/User/History/-2e064889/ffAN.dart
Normal file
67
.config/Code/User/History/-2e064889/ffAN.dart
Normal file
|
@ -0,0 +1,67 @@
|
|||
import 'package:flutter/material.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
import 'dart:io';
|
||||
|
||||
void main(){
|
||||
runApp(const MyApp());
|
||||
Directory dir = Directory('/');
|
||||
var list = dir.listSync();
|
||||
list.forEach(print);
|
||||
}
|
||||
|
||||
class MyApp extends StatelessWidget{
|
||||
const MyApp({super.key});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context){
|
||||
return ChangeNotifierProvider(
|
||||
create: (context) => MyAppState(),
|
||||
child: MaterialApp(
|
||||
title: 'First App',
|
||||
theme: ThemeData(
|
||||
useMaterial3: true,
|
||||
colorScheme: ColorScheme.fromSeed(seedColor: Colors.green)
|
||||
),
|
||||
home: const MyHomePage(),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
class MyAppState extends ChangeNotifier{
|
||||
var counter = 0;
|
||||
|
||||
void increment(){
|
||||
counter++;
|
||||
notifyListeners();
|
||||
}
|
||||
}
|
||||
|
||||
class MyHomePage extends StatefulWidget{
|
||||
const MyHomePage({super.key});
|
||||
|
||||
@override
|
||||
State<MyHomePage> createState() => _MyHomePageState();
|
||||
}
|
||||
|
||||
class _MyHomePageState extends State<MyHomePage> {
|
||||
@override
|
||||
Widget build(BuildContext context){
|
||||
var appState = context.watch<MyAppState>();
|
||||
var sCount = appState.counter.toString();
|
||||
|
||||
return Scaffold(
|
||||
body: Center(
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
Text('count: $sCount'),
|
||||
ElevatedButton(
|
||||
onPressed: () => appState.increment(),
|
||||
child: const Text('Increment')),
|
||||
],
|
||||
),
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
54
.config/Code/User/History/-2e064889/gM7x.dart
Normal file
54
.config/Code/User/History/-2e064889/gM7x.dart
Normal file
|
@ -0,0 +1,54 @@
|
|||
import 'package:flutter/material.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
|
||||
void main(){
|
||||
runApp(const MyApp());
|
||||
}
|
||||
|
||||
class MyApp extends StatelessWidget{
|
||||
const MyApp({super.key});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context){
|
||||
return ChangeNotifierProvider(
|
||||
create: (context) => MyAppState(),
|
||||
child: MaterialApp(
|
||||
title: 'First App',
|
||||
theme: ThemeData(
|
||||
useMaterial3: true,
|
||||
colorScheme: ColorScheme.fromSeed(seedColor: Colors.green)
|
||||
),
|
||||
home: const MyHomePage(),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
class MyAppState extends ChangeNotifier{
|
||||
var counter = 0;
|
||||
}
|
||||
|
||||
class MyHomePage extends StatelessWidget{
|
||||
const MyHomePage({super.key});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context){
|
||||
var appState = context.watch<MyAppState>();
|
||||
var sCount = appState.counter.toString();
|
||||
|
||||
return Scaffold(
|
||||
body: Center(
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
Text('count: $sCount'),
|
||||
ElevatedButton(
|
||||
onPressed: () => print('working'),
|
||||
child: Text('hello')),
|
||||
],
|
||||
),
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
}
|
88
.config/Code/User/History/-2e064889/hqV3.dart
Normal file
88
.config/Code/User/History/-2e064889/hqV3.dart
Normal file
|
@ -0,0 +1,88 @@
|
|||
import 'package:flutter/material.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
|
||||
void main(){
|
||||
runApp(const MyApp());
|
||||
}
|
||||
|
||||
class MyApp extends StatelessWidget{
|
||||
const MyApp({super.key});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context){
|
||||
return ChangeNotifierProvider(
|
||||
create: (context) => MyAppState(),
|
||||
child: MaterialApp(
|
||||
title: 'First App',
|
||||
theme: ThemeData(
|
||||
useMaterial3: true,
|
||||
colorScheme: ColorScheme.fromSeed(seedColor: Colors.green)
|
||||
),
|
||||
home: const MyHomePage(),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
class MyAppState extends ChangeNotifier{
|
||||
|
||||
}
|
||||
|
||||
class MyHomePage extends StatefulWidget{
|
||||
const MyHomePage({super.key});
|
||||
|
||||
@override
|
||||
State<MyHomePage> createState() => _MyHomePageState();
|
||||
}
|
||||
|
||||
class _MyHomePageState extends State<MyHomePage>{
|
||||
|
||||
var counter = 0;
|
||||
var selectedIndex = 0;
|
||||
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context){
|
||||
var sCount = counter.toString();
|
||||
|
||||
return Scaffold(
|
||||
body: Row(
|
||||
children: [
|
||||
SafeArea(
|
||||
child: NavigationRail(
|
||||
destinations: const [
|
||||
NavigationRailDestination(
|
||||
icon: Icon(Icons.home),
|
||||
label: Text('Home'),
|
||||
),
|
||||
NavigationRailDestination(
|
||||
icon: Icon(Icons.favorite),
|
||||
label: Text('Favorites'),
|
||||
),
|
||||
],
|
||||
selectedIndex: 0
|
||||
),
|
||||
),
|
||||
Expanded(
|
||||
child: Center(
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
Text('count: $sCount'),
|
||||
ElevatedButton(
|
||||
onPressed: () => {
|
||||
setState((){
|
||||
counter++;
|
||||
})
|
||||
},
|
||||
child: const Text('Increment')
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
)
|
||||
],
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
61
.config/Code/User/History/-2e064889/jSuo.dart
Normal file
61
.config/Code/User/History/-2e064889/jSuo.dart
Normal file
|
@ -0,0 +1,61 @@
|
|||
import 'package:flutter/material.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
|
||||
void main(){
|
||||
runApp(const MyApp());
|
||||
}
|
||||
|
||||
class MyApp extends StatelessWidget{
|
||||
const MyApp({super.key});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context){
|
||||
return ChangeNotifierProvider(
|
||||
create: (context) => MyAppState(),
|
||||
child: MaterialApp(
|
||||
title: 'First App',
|
||||
theme: ThemeData(
|
||||
useMaterial3: true,
|
||||
colorScheme: ColorScheme.fromSeed(seedColor: Colors.green)
|
||||
),
|
||||
home: const MyHomePage(),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
class MyAppState extends ChangeNotifier{
|
||||
var counter = 0;
|
||||
|
||||
void increment(){
|
||||
counter++;
|
||||
notifyListeners();
|
||||
}
|
||||
}
|
||||
|
||||
class MyHomePage extends StatelessWidget{
|
||||
const MyHomePage({super.key});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context){
|
||||
var appState = context.watch<MyAppState>();
|
||||
var sCount = appState.counter.toString();
|
||||
|
||||
return Scaffold(
|
||||
body: Center(
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
Text('count: $sCount'),
|
||||
ElevatedButton(
|
||||
onPressed: () => {
|
||||
appState.counter++
|
||||
},
|
||||
child: const Text('Increment')),
|
||||
],
|
||||
),
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
}
|
50
.config/Code/User/History/-2e064889/mjCM.dart
Normal file
50
.config/Code/User/History/-2e064889/mjCM.dart
Normal file
|
@ -0,0 +1,50 @@
|
|||
import 'package:flutter/material.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
|
||||
void main(){
|
||||
runApp(const MyApp());
|
||||
}
|
||||
|
||||
class MyApp extends StatelessWidget{
|
||||
const MyApp({super.key});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context){
|
||||
return ChangeNotifierProvider(
|
||||
create: (context) => MyAppState(),
|
||||
child: MaterialApp(
|
||||
title: 'First App',
|
||||
theme: ThemeData(
|
||||
useMaterial3: true,
|
||||
colorScheme: ColorScheme.fromSeed(seedColor: Colors.green)
|
||||
),
|
||||
home: const MyHomePage(),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
class MyAppState extends ChangeNotifier{
|
||||
int counter = 0;
|
||||
}
|
||||
|
||||
class MyHomePage extends StatelessWidget{
|
||||
const MyHomePage({super.key});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context){
|
||||
var appState = context.watch<MyAppState>();
|
||||
var sCount = appState.toString();
|
||||
|
||||
return const Scaffold(
|
||||
body: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
Text('count: $sCount')
|
||||
],
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
}
|
91
.config/Code/User/History/-2e064889/qQfz.dart
Normal file
91
.config/Code/User/History/-2e064889/qQfz.dart
Normal file
|
@ -0,0 +1,91 @@
|
|||
import 'package:flutter/material.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
|
||||
void main(){
|
||||
runApp(const MyApp());
|
||||
}
|
||||
|
||||
class MyApp extends StatelessWidget{
|
||||
const MyApp({super.key});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context){
|
||||
return ChangeNotifierProvider(
|
||||
create: (context) => MyAppState(),
|
||||
child: MaterialApp(
|
||||
title: 'First App',
|
||||
theme: ThemeData(
|
||||
useMaterial3: true,
|
||||
colorScheme: ColorScheme.fromSeed(seedColor: Colors.green)
|
||||
),
|
||||
home: const MyHomePage(),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
class MyAppState extends ChangeNotifier{
|
||||
|
||||
}
|
||||
|
||||
class MyHomePage extends StatefulWidget{
|
||||
const MyHomePage({super.key});
|
||||
|
||||
@override
|
||||
State<MyHomePage> createState() => _MyHomePageState();
|
||||
}
|
||||
|
||||
class _MyHomePageState extends State<MyHomePage>{
|
||||
|
||||
var counter = 0;
|
||||
var selectedIndex = 0;
|
||||
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context){
|
||||
var sCount = counter.toString();
|
||||
|
||||
return Scaffold(
|
||||
body: Row(
|
||||
children: [
|
||||
SafeArea(
|
||||
child: NavigationRail(
|
||||
destinations: const [
|
||||
NavigationRailDestination(
|
||||
icon: Icon(Icons.home),
|
||||
label: Text('Home'),
|
||||
),
|
||||
NavigationRailDestination(
|
||||
icon: Icon(Icons.favorite),
|
||||
label: Text('Favorites'),
|
||||
),
|
||||
],
|
||||
selectedIndex: selectedIndex,
|
||||
onDestinationSelected: (value) => setState((){
|
||||
selectedIndex = value;
|
||||
}),
|
||||
),
|
||||
),
|
||||
Expanded(
|
||||
child: Center(
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
Text('count: $sCount'),
|
||||
ElevatedButton(
|
||||
onPressed: () => {
|
||||
setState((){
|
||||
counter++;
|
||||
})
|
||||
},
|
||||
child: const Text('Increment')
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
)
|
||||
],
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
79
.config/Code/User/History/-2e064889/qVLo.dart
Normal file
79
.config/Code/User/History/-2e064889/qVLo.dart
Normal file
|
@ -0,0 +1,79 @@
|
|||
import 'package:flutter/material.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
|
||||
void main(){
|
||||
runApp(const MyApp());
|
||||
}
|
||||
|
||||
class MyApp extends StatelessWidget{
|
||||
const MyApp({super.key});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context){
|
||||
return ChangeNotifierProvider(
|
||||
create: (context) => MyAppState(),
|
||||
child: MaterialApp(
|
||||
title: 'First App',
|
||||
theme: ThemeData(
|
||||
useMaterial3: true,
|
||||
colorScheme: ColorScheme.fromSeed(seedColor: Colors.green)
|
||||
),
|
||||
home: const MyHomePage(),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
class MyAppState extends ChangeNotifier{
|
||||
|
||||
}
|
||||
|
||||
class MyHomePage extends StatefulWidget{
|
||||
const MyHomePage({super.key});
|
||||
|
||||
@override
|
||||
State<MyHomePage> createState() => _MyHomePageState();
|
||||
}
|
||||
|
||||
class _MyHomePageState extends State<MyHomePage>{
|
||||
@override
|
||||
Widget build(BuildContext context){
|
||||
var appState = context.watch<MyAppState>();
|
||||
var sCount = appState.counter.toString();
|
||||
|
||||
return Scaffold(
|
||||
body: Row(
|
||||
children: [
|
||||
SafeArea(
|
||||
child: NavigationRail(
|
||||
destinations: const [
|
||||
NavigationRailDestination(
|
||||
icon: Icon(Icons.home),
|
||||
label: Text('Home'),
|
||||
),
|
||||
NavigationRailDestination(
|
||||
icon: Icon(Icons.favorite),
|
||||
label: Text('Home'),
|
||||
),
|
||||
],
|
||||
selectedIndex: 0
|
||||
),
|
||||
),
|
||||
Center(
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
Text('count: $sCount'),
|
||||
ElevatedButton(
|
||||
onPressed: () => appState.increment(),
|
||||
child: const Text('Increment')
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
|
||||
],
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
63
.config/Code/User/History/-2e064889/uJK1.dart
Normal file
63
.config/Code/User/History/-2e064889/uJK1.dart
Normal file
|
@ -0,0 +1,63 @@
|
|||
import 'package:flutter/material.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
|
||||
void main(){
|
||||
runApp(const MyApp());
|
||||
}
|
||||
|
||||
class MyApp extends StatelessWidget{
|
||||
const MyApp({super.key});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context){
|
||||
return ChangeNotifierProvider(
|
||||
create: (context) => MyAppState(),
|
||||
child: MaterialApp(
|
||||
title: 'First App',
|
||||
theme: ThemeData(
|
||||
useMaterial3: true,
|
||||
colorScheme: ColorScheme.fromSeed(seedColor: Colors.green)
|
||||
),
|
||||
home: const MyHomePage(),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
class MyAppState extends ChangeNotifier{
|
||||
var counter = 0;
|
||||
|
||||
void increment(){
|
||||
counter++;
|
||||
notifyListeners();
|
||||
}
|
||||
}
|
||||
|
||||
class MyHomePage extends StatefulWidget{
|
||||
const MyHomePage({super.key});
|
||||
|
||||
@override
|
||||
State<MyHomePage> createState() => _MyHomePageState();
|
||||
}
|
||||
|
||||
class _MyHomePageState extends State<MyHomePage> {
|
||||
@override
|
||||
Widget build(BuildContext context){
|
||||
var appState = context.watch<MyAppState>();
|
||||
var sCount = appState.counter.toString();
|
||||
|
||||
return Scaffold(
|
||||
body: Center(
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
Text('count: $sCount'),
|
||||
ElevatedButton(
|
||||
onPressed: () => appState.increment(),
|
||||
child: const Text('Increment')),
|
||||
],
|
||||
),
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
91
.config/Code/User/History/-2e064889/x7cF.dart
Normal file
91
.config/Code/User/History/-2e064889/x7cF.dart
Normal file
|
@ -0,0 +1,91 @@
|
|||
import 'package:flutter/material.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
|
||||
void main(){
|
||||
runApp(const MyApp());
|
||||
}
|
||||
|
||||
class MyApp extends StatelessWidget{
|
||||
const MyApp({super.key});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context){
|
||||
return ChangeNotifierProvider(
|
||||
create: (context) => MyAppState(),
|
||||
child: MaterialApp(
|
||||
title: 'First App',
|
||||
theme: ThemeData(
|
||||
useMaterial3: true,
|
||||
colorScheme: ColorScheme.fromSeed(seedColor: Colors.green)
|
||||
),
|
||||
home: const MyHomePage(),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
class MyAppState extends ChangeNotifier{
|
||||
var counter = 0;
|
||||
|
||||
void increment(){
|
||||
counter++;
|
||||
notifyListeners();
|
||||
}
|
||||
}
|
||||
|
||||
class MyHomePage extends StatefulWidget{
|
||||
const MyHomePage({super.key});
|
||||
|
||||
@override
|
||||
State<MyHomePage> createState() => _MyHomePageState();
|
||||
}
|
||||
|
||||
class _MyHomePageState extends State<MyHomePage>{
|
||||
|
||||
var counter = 0;
|
||||
|
||||
void increment(){
|
||||
counter++;
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context){
|
||||
var appState = context.watch<MyAppState>();
|
||||
var sCount = appState.counter.toString();
|
||||
|
||||
return Scaffold(
|
||||
body: Row(
|
||||
children: [
|
||||
SafeArea(
|
||||
child: NavigationRail(
|
||||
destinations: const [
|
||||
NavigationRailDestination(
|
||||
icon: Icon(Icons.home),
|
||||
label: Text('Home'),
|
||||
),
|
||||
NavigationRailDestination(
|
||||
icon: Icon(Icons.favorite),
|
||||
label: Text('Home'),
|
||||
),
|
||||
],
|
||||
selectedIndex: 0
|
||||
),
|
||||
),
|
||||
Center(
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
Text('count: $sCount'),
|
||||
ElevatedButton(
|
||||
onPressed: () => appState.increment(),
|
||||
child: const Text('Increment')
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
|
||||
],
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
54
.config/Code/User/History/-2e064889/xrwu.dart
Normal file
54
.config/Code/User/History/-2e064889/xrwu.dart
Normal file
|
@ -0,0 +1,54 @@
|
|||
import 'package:flutter/material.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
|
||||
void main(){
|
||||
runApp(const MyApp());
|
||||
}
|
||||
|
||||
class MyApp extends StatelessWidget{
|
||||
const MyApp({super.key});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context){
|
||||
return ChangeNotifierProvider(
|
||||
create: (context) => MyAppState(),
|
||||
child: MaterialApp(
|
||||
title: 'First App',
|
||||
theme: ThemeData(
|
||||
useMaterial3: true,
|
||||
colorScheme: ColorScheme.fromSeed(seedColor: Colors.green)
|
||||
),
|
||||
home: const MyHomePage(),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
class MyAppState extends ChangeNotifier{
|
||||
var counter = 0;
|
||||
}
|
||||
|
||||
class MyHomePage extends StatelessWidget{
|
||||
const MyHomePage({super.key});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context){
|
||||
var appState = context.watch<MyAppState>();
|
||||
var sCount = appState.counter.toString();
|
||||
|
||||
return Scaffold(
|
||||
body: Center(
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
Text('count: $sCount'),
|
||||
ElevatedButton(
|
||||
onPressed: () => print('working'),
|
||||
child: const Text('Increment')),
|
||||
],
|
||||
),
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
}
|
59
.config/Code/User/History/-2e064889/y0xV.dart
Normal file
59
.config/Code/User/History/-2e064889/y0xV.dart
Normal file
|
@ -0,0 +1,59 @@
|
|||
import 'package:flutter/material.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
|
||||
void main(){
|
||||
runApp(const MyApp());
|
||||
}
|
||||
|
||||
class MyApp extends StatelessWidget{
|
||||
const MyApp({super.key});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context){
|
||||
return ChangeNotifierProvider(
|
||||
create: (context) => MyAppState(),
|
||||
child: MaterialApp(
|
||||
title: 'First App',
|
||||
theme: ThemeData(
|
||||
useMaterial3: true,
|
||||
colorScheme: ColorScheme.fromSeed(seedColor: const Color.fromARGB(255, 162, 189, 163))
|
||||
),
|
||||
home: const MyHomePage(),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
class MyAppState extends ChangeNotifier{
|
||||
var counter = 0;
|
||||
|
||||
void increment(){
|
||||
counter++;
|
||||
notifyListeners();
|
||||
}
|
||||
}
|
||||
|
||||
class MyHomePage extends StatelessWidget{
|
||||
const MyHomePage({super.key});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context){
|
||||
var appState = context.watch<MyAppState>();
|
||||
var sCount = appState.counter.toString();
|
||||
|
||||
return Scaffold(
|
||||
body: Center(
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
Text('count: $sCount'),
|
||||
ElevatedButton(
|
||||
onPressed: () => appState.increment(),
|
||||
child: const Text('Increment')),
|
||||
],
|
||||
),
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
}
|
82
.config/Code/User/History/-2e064889/yUbT.dart
Normal file
82
.config/Code/User/History/-2e064889/yUbT.dart
Normal file
|
@ -0,0 +1,82 @@
|
|||
import 'package:flutter/material.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
|
||||
void main(){
|
||||
runApp(const MyApp());
|
||||
}
|
||||
|
||||
class MyApp extends StatelessWidget{
|
||||
const MyApp({super.key});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context){
|
||||
return ChangeNotifierProvider(
|
||||
create: (context) => MyAppState(),
|
||||
child: MaterialApp(
|
||||
title: 'First App',
|
||||
theme: ThemeData(
|
||||
useMaterial3: true,
|
||||
colorScheme: ColorScheme.fromSeed(seedColor: Colors.green)
|
||||
),
|
||||
home: const MyHomePage(),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
class MyAppState extends ChangeNotifier{
|
||||
|
||||
}
|
||||
|
||||
class MyHomePage extends StatefulWidget{
|
||||
const MyHomePage({super.key});
|
||||
|
||||
@override
|
||||
State<MyHomePage> createState() => _MyHomePageState();
|
||||
}
|
||||
|
||||
class _MyHomePageState extends State<MyHomePage>{
|
||||
|
||||
var counter = 0;
|
||||
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context){
|
||||
var sCount = counter.toString();
|
||||
|
||||
return Scaffold(
|
||||
body: Row(
|
||||
children: [
|
||||
SafeArea(
|
||||
child: NavigationRail(
|
||||
destinations: const [
|
||||
NavigationRailDestination(
|
||||
icon: Icon(Icons.home),
|
||||
label: Text('Home'),
|
||||
),
|
||||
NavigationRailDestination(
|
||||
icon: Icon(Icons.favorite),
|
||||
label: Text('Home'),
|
||||
),
|
||||
],
|
||||
selectedIndex: 0
|
||||
),
|
||||
),
|
||||
Center(
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
Text('count: $sCount'),
|
||||
ElevatedButton(
|
||||
onPressed: () => counter++,
|
||||
child: const Text('Increment')
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
|
||||
],
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
84
.config/Code/User/History/-2e064889/yf4P.dart
Normal file
84
.config/Code/User/History/-2e064889/yf4P.dart
Normal file
|
@ -0,0 +1,84 @@
|
|||
import 'package:flutter/material.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
|
||||
void main(){
|
||||
runApp(const MyApp());
|
||||
}
|
||||
|
||||
class MyApp extends StatelessWidget{
|
||||
const MyApp({super.key});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context){
|
||||
return ChangeNotifierProvider(
|
||||
create: (context) => MyAppState(),
|
||||
child: MaterialApp(
|
||||
title: 'First App',
|
||||
theme: ThemeData(
|
||||
useMaterial3: true,
|
||||
colorScheme: ColorScheme.fromSeed(seedColor: Colors.green)
|
||||
),
|
||||
home: const MyHomePage(),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
class MyAppState extends ChangeNotifier{
|
||||
var counter = 0;
|
||||
|
||||
void increment(){
|
||||
counter++;
|
||||
notifyListeners();
|
||||
}
|
||||
}
|
||||
|
||||
class MyHomePage extends StatefulWidget{
|
||||
const MyHomePage({super.key});
|
||||
|
||||
@override
|
||||
State<MyHomePage> createState() => _MyHomePageState();
|
||||
}
|
||||
|
||||
class _MyHomePageState extends State<MyHomePage> {
|
||||
@override
|
||||
Widget build(BuildContext context){
|
||||
var appState = context.watch<MyAppState>();
|
||||
var sCount = appState.counter.toString();
|
||||
|
||||
return Scaffold(
|
||||
body: Row(
|
||||
children: [
|
||||
SafeArea(
|
||||
child: NavigationRail(
|
||||
destinations: const [
|
||||
NavigationRailDestination(
|
||||
icon: Icon(Icons.home),
|
||||
label: Text('Home'),
|
||||
),
|
||||
NavigationRailDestination(
|
||||
icon: Icon(Icons.favorite),
|
||||
label: Text('Home'),
|
||||
),
|
||||
],
|
||||
selectedIndex: 0
|
||||
),
|
||||
),
|
||||
Center(
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
Text('count: $sCount'),
|
||||
ElevatedButton(
|
||||
onPressed: () => appState.increment(),
|
||||
child: const Text('Increment')
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
|
||||
],
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
83
.config/Code/User/History/-2e064889/z8XQ.dart
Normal file
83
.config/Code/User/History/-2e064889/z8XQ.dart
Normal file
|
@ -0,0 +1,83 @@
|
|||
import 'package:flutter/material.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
|
||||
void main(){
|
||||
runApp(const MyApp());
|
||||
}
|
||||
|
||||
class MyApp extends StatelessWidget{
|
||||
const MyApp({super.key});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context){
|
||||
return ChangeNotifierProvider(
|
||||
create: (context) => MyAppState(),
|
||||
child: MaterialApp(
|
||||
title: 'First App',
|
||||
theme: ThemeData(
|
||||
useMaterial3: true,
|
||||
colorScheme: ColorScheme.fromSeed(seedColor: Colors.green)
|
||||
),
|
||||
home: const MyHomePage(),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
class MyAppState extends ChangeNotifier{
|
||||
|
||||
}
|
||||
|
||||
class MyHomePage extends StatefulWidget{
|
||||
const MyHomePage({super.key});
|
||||
|
||||
@override
|
||||
State<MyHomePage> createState() => _MyHomePageState();
|
||||
}
|
||||
|
||||
class _MyHomePageState extends State<MyHomePage>{
|
||||
|
||||
var counter = 0;
|
||||
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context){
|
||||
var sCount = counter.toString();
|
||||
|
||||
return Scaffold(
|
||||
body: Row(
|
||||
children: [
|
||||
SafeArea(
|
||||
child: NavigationRail(
|
||||
destinations: const [
|
||||
NavigationRailDestination(
|
||||
icon: Icon(Icons.home),
|
||||
label: Text('Home'),
|
||||
),
|
||||
NavigationRailDestination(
|
||||
icon: Icon(Icons.favorite),
|
||||
label: Text('Favorites'),
|
||||
),
|
||||
],
|
||||
selectedIndex: 0
|
||||
),
|
||||
),
|
||||
Expanded(
|
||||
child: Center(
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
Text('count: $sCount'),
|
||||
ElevatedButton(
|
||||
onPressed: () => counter++,
|
||||
child: const Text('Increment')
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
)
|
||||
],
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
96
.config/Code/User/History/-2e064889/zkFb.dart
Normal file
96
.config/Code/User/History/-2e064889/zkFb.dart
Normal file
|
@ -0,0 +1,96 @@
|
|||
import 'package:flutter/material.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
|
||||
void main(){
|
||||
runApp(const MyApp());
|
||||
}
|
||||
|
||||
class MyApp extends StatelessWidget{
|
||||
const MyApp({super.key});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context){
|
||||
return ChangeNotifierProvider(
|
||||
create: (context) => MyAppState(),
|
||||
child: MaterialApp(
|
||||
title: 'First App',
|
||||
theme: ThemeData(
|
||||
useMaterial3: true,
|
||||
colorScheme: ColorScheme.fromSeed(seedColor: Colors.green)
|
||||
),
|
||||
home: const MyHomePage(),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
class MyAppState extends ChangeNotifier{
|
||||
|
||||
}
|
||||
|
||||
class MyHomePage extends StatefulWidget{
|
||||
const MyHomePage({super.key});
|
||||
|
||||
@override
|
||||
State<MyHomePage> createState() => _MyHomePageState();
|
||||
}
|
||||
|
||||
class _MyHomePageState extends State<MyHomePage>{
|
||||
|
||||
var counter = 0;
|
||||
var selectedIndex = 0;
|
||||
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context){
|
||||
var sCount = counter.toString();
|
||||
|
||||
Widget page;
|
||||
switch(selectedIndex){
|
||||
case 0: page = MyHomePage();
|
||||
}
|
||||
|
||||
return Scaffold(
|
||||
body: Row(
|
||||
children: [
|
||||
SafeArea(
|
||||
child: NavigationRail(
|
||||
destinations: const [
|
||||
NavigationRailDestination(
|
||||
icon: Icon(Icons.home),
|
||||
label: Text('Home'),
|
||||
),
|
||||
NavigationRailDestination(
|
||||
icon: Icon(Icons.favorite),
|
||||
label: Text('Favorites'),
|
||||
),
|
||||
],
|
||||
selectedIndex: selectedIndex,
|
||||
onDestinationSelected: (value) => setState((){
|
||||
selectedIndex = value;
|
||||
}),
|
||||
),
|
||||
),
|
||||
Expanded(
|
||||
child: Center(
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
Text('count: $sCount'),
|
||||
ElevatedButton(
|
||||
onPressed: () => {
|
||||
setState((){
|
||||
counter++;
|
||||
})
|
||||
},
|
||||
child: const Text('Increment')
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
)
|
||||
],
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue