๐
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import 'package:flutter/material.dart'; | |
| class ThemeNotifier with ChangeNotifier { | |
| ThemeData _themeData; | |
| ThemeNotifier(this._themeData); | |
| getTheme() => _themeData; | |
| setTheme(ThemeData themeData) async { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| void main() => runApp( | |
| ChangeNotifierProvider<ThemeNotifier>( | |
| builder: (_) => ThemeNotifier(darkTheme), | |
| child: MyApp(), | |
| ), | |
| ); | |
| class MyApp extends StatelessWidget { | |
| @override | |
| Widget build(BuildContext context) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import 'package:chitr/util/theme_notifier.dart'; | |
| import 'package:chitr/values/strings.dart'; | |
| import 'package:chitr/values/theme.dart'; | |
| import 'package:day_night_switch/day_night_switch.dart'; | |
| import 'package:flutter/material.dart'; | |
| import 'package:flutter/widgets.dart'; | |
| import 'package:provider/provider.dart'; | |
| class SettingsPage extends StatefulWidget { | |
| @override |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import 'dart:io'; | |
| import 'package:camera/camera.dart'; | |
| import 'package:flutter/material.dart'; | |
| import 'package:flutter/services.dart'; | |
| import 'package:flutter_camera/gallery.dart'; | |
| import 'package:flutter_camera/video_timer.dart'; | |
| import 'package:path/path.dart' as path; | |
| import 'package:path_provider/path_provider.dart'; | |
| import 'package:thumbnails/thumbnails.dart'; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import 'dart:math'; | |
| import 'package:flutter/material.dart'; | |
| //Colors | |
| Color crossColor = const Color(0xFF1ABDD5); | |
| Color circleColor = const Color(0xFFD8B9FA); | |
| Color accentColor = const Color(0xFF90A4AE); | |
| void main() => runApp(MyApp()); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class DashLinePainter extends CustomPainter { | |
| final double progress; | |
| DashLinePainter({this.progress}); | |
| Paint _paint = Paint() | |
| ..color = Colors.black | |
| ..strokeWidth = 4.0 | |
| ..style = PaintingStyle.stroke | |
| ..strokeJoin = StrokeJoin.round; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class LinePainter extends CustomPainter { | |
| final double progress; | |
| LinePainter({this.progress}); | |
| Paint _paint = Paint() | |
| ..color = Colors.black | |
| ..strokeWidth = 4.0 | |
| ..style = PaintingStyle.stroke | |
| ..strokeJoin = StrokeJoin.round; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| @override | |
| void paint(Canvas canvas, Size size) { | |
| var path = createPath(); | |
| canvas.drawPath(path, myPaint); | |
| } | |
| Path createPath() { | |
| var path = Path(); | |
| int n = circles.toInt(); | |
| var range = List<int>.generate(n, (i) => i + 1); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| @override | |
| void paint(Canvas canvas, Size size) { | |
| var path = createPath(); | |
| PathMetrics pathMetrics = path.computeMetrics(); | |
| for (PathMetric pathMetric in pathMetrics) { | |
| Path extractPath = pathMetric.extractPath( | |
| 0.0, | |
| pathMetric.length * progress, | |
| ); | |
| canvas.drawPath(extractPath, myPaint); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Path createPath(int sides, double radius) { | |
| var path = Path(); | |
| var angle = (math.pi * 2) / sides; | |
| path.moveTo(radius * math.cos(0.0), radius * math.sin(0.0)); | |
| for (int i = 1; i <= sides; i++) { | |
| double x = radius * math.cos(angle * i); | |
| double y = radius * math.sin(angle * i); | |
| path.lineTo(x, y); | |
| } | |
| path.close(); |