Compare commits
No commits in common. "master" and "v1.1" have entirely different histories.
13
.vscode/launch.json
vendored
13
.vscode/launch.json
vendored
@ -1,13 +0,0 @@
|
|||||||
{
|
|
||||||
// Use IntelliSense to learn about possible attributes.
|
|
||||||
// Hover to view descriptions of existing attributes.
|
|
||||||
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
|
|
||||||
"version": "0.2.0",
|
|
||||||
"configurations": [
|
|
||||||
{
|
|
||||||
"name": "cloudtech_calculator",
|
|
||||||
"request": "launch",
|
|
||||||
"type": "dart"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
@ -2,7 +2,6 @@ import 'package:auto_size_text/auto_size_text.dart';
|
|||||||
import 'package:cloudtech_calculator/theme_model.dart';
|
import 'package:cloudtech_calculator/theme_model.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:provider/provider.dart';
|
import 'package:provider/provider.dart';
|
||||||
import 'route.dart';
|
|
||||||
|
|
||||||
enum Operation {
|
enum Operation {
|
||||||
plus,
|
plus,
|
||||||
@ -257,10 +256,7 @@ class _MyHomePageState extends State<MyHomePage> {
|
|||||||
icon: const Icon(Icons.settings),
|
icon: const Icon(Icons.settings),
|
||||||
tooltip: 'Show Snackbar',
|
tooltip: 'Show Snackbar',
|
||||||
onPressed: () {
|
onPressed: () {
|
||||||
Navigator.push(
|
Provider.of<ThemeModel>(context, listen: false).toggleTheme();
|
||||||
context,
|
|
||||||
MaterialPageRoute(builder: (context) => SecondRoute()),
|
|
||||||
);
|
|
||||||
},
|
},
|
||||||
color: Theme.of(context).accentColor,
|
color: Theme.of(context).accentColor,
|
||||||
)
|
)
|
||||||
|
|||||||
@ -1,52 +0,0 @@
|
|||||||
import 'package:cloudtech_calculator/theme_model.dart';
|
|
||||||
import 'package:flutter/material.dart';
|
|
||||||
import 'package:provider/provider.dart';
|
|
||||||
|
|
||||||
class SecondRoute extends StatefulWidget {
|
|
||||||
@override
|
|
||||||
_SecondRouteState createState() => _SecondRouteState();
|
|
||||||
}
|
|
||||||
|
|
||||||
class _SecondRouteState extends State<SecondRoute> {
|
|
||||||
@override
|
|
||||||
Widget build(BuildContext context) {
|
|
||||||
return Scaffold(
|
|
||||||
appBar: AppBar(
|
|
||||||
title: Text("Настройки калькулятора",
|
|
||||||
style: TextStyle(color: Theme.of(context).accentColor)),
|
|
||||||
shadowColor: const Color(0x00000000),
|
|
||||||
),
|
|
||||||
body: Container(
|
|
||||||
color: Theme.of(context).primaryColor,
|
|
||||||
child: Padding(
|
|
||||||
padding: const EdgeInsets.all(8.0),
|
|
||||||
child: ListView(
|
|
||||||
padding: const EdgeInsets.all(8),
|
|
||||||
children: [
|
|
||||||
ListTile(
|
|
||||||
leading: IconButton(
|
|
||||||
icon: Icon(
|
|
||||||
Icons.settings_display,
|
|
||||||
color: Theme.of(context).accentColor,
|
|
||||||
),
|
|
||||||
onPressed: null),
|
|
||||||
title: Text(
|
|
||||||
"Светлая тема",
|
|
||||||
style: TextStyle(
|
|
||||||
fontWeight: FontWeight.w500,
|
|
||||||
color: Theme.of(context).accentColor),
|
|
||||||
),
|
|
||||||
trailing: Switch(
|
|
||||||
value: Theme.of(context).brightness == Brightness.light,
|
|
||||||
onChanged: (value) {
|
|
||||||
Provider.of<ThemeModel>(context, listen: false)
|
|
||||||
.toggleTheme();
|
|
||||||
},
|
|
||||||
),
|
|
||||||
)
|
|
||||||
],
|
|
||||||
),
|
|
||||||
)),
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1,15 +1,13 @@
|
|||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
|
||||||
ThemeData darkTheme = ThemeData(
|
ThemeData darkTheme = ThemeData.dark().copyWith(
|
||||||
primaryColor: const Color(0xff131618),
|
primaryColor: const Color(0xff131618),
|
||||||
accentColor: Colors.white,
|
accentColor: Colors.white,
|
||||||
brightness: Brightness.dark,
|
|
||||||
textTheme: const TextTheme(bodyText2: TextStyle(color: Color(0xffffffff))),
|
textTheme: const TextTheme(bodyText2: TextStyle(color: Color(0xffffffff))),
|
||||||
);
|
);
|
||||||
|
|
||||||
ThemeData lightTheme = ThemeData(
|
ThemeData lightTheme = ThemeData.light().copyWith(
|
||||||
primaryColor: Colors.white,
|
primaryColor: Colors.white,
|
||||||
accentColor: Colors.green,
|
accentColor: Colors.green,
|
||||||
brightness: Brightness.light,
|
|
||||||
textTheme: const TextTheme(bodyText2: TextStyle(color: Colors.green)),
|
textTheme: const TextTheme(bodyText2: TextStyle(color: Colors.green)),
|
||||||
);
|
);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user