import 'dart:developer';
import 'package:flutter/material.dart';
void main() => runApp(MyApp());
class MyApp extends StatelessWidget{
@override
Widget build(BuildContext context) {
return new MaterialApp(
title: 'My Application',
home: new HomeScreen(title: 'This is title'),
);
}
}
class HomeScreen extends StatefulWidget {
HomeScreen({Key key, this.title}) : super (key: key);
final String title;
@override
_HomeScreenState createState() => new _HomeScreenState();
}
class _HomeScreenState extends State<HomeScreen>{
int counter = 0;
void _incrementCounter() {
setState(() {
counter++;
});
}
void _decrementCounter() {
setState(() {
counter--;
});
}
@override
Widget build(BuildContext context) {
return new Scaffold(
appBar: AppBar(
title: new Text(widget.title),
),
body: Center(
child: Column(
children: <Widget>[
Padding(padding: EdgeInsets.all(40.0), child: Text('Hello $counter!')),
Padding(padding: EdgeInsets.all(40.0), child:
ButtonTheme(
minWidth: 200,
height: 70,
child: RaisedButton(onPressed: _incrementCounter,child: const Text('+'))
)),
ButtonTheme(
minWidth: 200,
height: 70,
child: RaisedButton(onPressed: _decrementCounter,child: const Text('-'))
)
],
),
//child: Text('Hello $counter!'),
),
);
}
}
class SecondScreen extends StatelessWidget {
SecondScreen({Counter counter,this.data}): super (key: key);
int data;
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text('Second screen'),
),
body: ,
);
}
}
Команда LOCK TABLES блокирует указанные в ней таблицы для данного потока