Skip to content

Commit 0155042

Browse files
author
Vivek Chib
committed
added loading div in index.html and added theme toggle button
1 parent 3269659 commit 0155042

19 files changed

+221
-82
lines changed

README.md

Lines changed: 26 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,32 @@
1-
# flutter_curve_visualizer
1+
# Flutter Curve Visualizer
22

3-
A new Flutter project.
3+
A web app built with Flutter to visualize animation curves interactively. This tool helps developers
4+
understand and experiment with different Flutter animation curves in a graphical interface.
45

5-
## Getting Started
6+
## Features
67

7-
This project is a starting point for a Flutter application.
8+
- Graphical visualization of animation curves on a graph.
9+
- Interactive controls to select curve category, curve type, and animation duration.
10+
- Play/Pause animation functionality using a Floating Action Button (FAB).
11+
- Preview boxes demonstrating Translate, Scale, Rotate, and Opacity effects.
12+
- Responsive design for seamless use across devices (desktop, tablet, and mobile).
813

9-
A few resources to get you started if this is your first Flutter project:
14+
This app is ideal for exploring and learning how different animation curves work in Flutter
15+
applications.
1016

11-
- [Lab: Write your first Flutter app](https://docs.flutter.dev/get-started/codelab)
12-
- [Cookbook: Useful Flutter samples](https://docs.flutter.dev/cookbook)
17+
## Roadmap
18+
19+
- Add more controls.
20+
21+
- Add Interactive Graph to visualize custom curve.
22+
23+
- Add Switch to toggle theme mode in header.
24+
25+
## Demo
26+
27+
https://vchib1.github.io/flutter-curve-visualizer/
28+
29+
## Authors
30+
31+
- [@vchib1](https://www.github.com/vchib1)
1332

14-
For help getting started with Flutter development, view the
15-
[online documentation](https://docs.flutter.dev/), which offers tutorials,
16-
samples, guidance on mobile development, and a full API reference.

fonts/Outfit-Bold.ttf

54.1 KB
Binary file not shown.

fonts/Outfit-ExtraBold.ttf

54 KB
Binary file not shown.

fonts/Outfit-ExtraLight.ttf

53.7 KB
Binary file not shown.

fonts/Outfit-Light.ttf

53.6 KB
Binary file not shown.

fonts/Outfit-Medium.ttf

53.5 KB
Binary file not shown.

fonts/Outfit-Regular.ttf

53.6 KB
Binary file not shown.

fonts/Outfit-SemiBold.ttf

54.2 KB
Binary file not shown.

fonts/Outfit-Thin.ttf

53.3 KB
Binary file not shown.

lib/main.dart

Lines changed: 28 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,22 @@
11
import 'package:flutter/material.dart';
22
import 'package:flutter_curve_visualizer/screen_mode.dart';
33
import 'package:flutter_curve_visualizer/utils/theme/theme.dart';
4+
import 'package:provider/provider.dart';
5+
import 'package:shared_preferences/shared_preferences.dart';
6+
import 'utils/theme/theme_provider.dart';
47
import 'views/home_page.dart';
58

69
Future<void> main() async {
710
WidgetsFlutterBinding.ensureInitialized();
811

9-
runApp(const MyApp());
12+
final pref = await SharedPreferences.getInstance();
13+
14+
runApp(
15+
ChangeNotifierProvider(
16+
create: (context) => ThemeProvider(pref: pref),
17+
child: const MyApp(),
18+
),
19+
);
1020
}
1121

1222
class MyApp extends StatelessWidget {
@@ -26,20 +36,22 @@ class MyApp extends StatelessWidget {
2636
Widget build(BuildContext context) {
2737
final theme = MaterialTheme(Theme.of(context).textTheme);
2838

29-
return MaterialApp(
30-
debugShowCheckedModeBanner: false,
31-
title: 'Flutter Curve Visualizer',
32-
themeMode: ThemeMode.light,
33-
theme: theme.lightMediumContrast(),
34-
darkTheme: theme.dark(),
35-
home: LayoutBuilder(
36-
builder: (context, constraints) {
37-
return ScreenModeWidget(
38-
mode: getLayoutType(constraints.maxWidth),
39-
child: const HomePage(),
40-
);
41-
},
42-
),
43-
);
39+
return Consumer<ThemeProvider>(builder: (context, themeProvider, child) {
40+
return MaterialApp(
41+
title: 'Flutter Curve Visualizer',
42+
debugShowCheckedModeBanner: false,
43+
themeMode: themeProvider.getThemeMode(),
44+
theme: theme.lightMediumContrast(),
45+
darkTheme: theme.dark(),
46+
home: LayoutBuilder(
47+
builder: (context, constraints) {
48+
return ScreenModeWidget(
49+
mode: getLayoutType(constraints.maxWidth),
50+
child: const HomePage(),
51+
);
52+
},
53+
),
54+
);
55+
});
4456
}
4557
}

0 commit comments

Comments
 (0)