Created
May 19, 2022 10:08
-
-
Save Zujaj/ad0f92b7c6efd25529d6bfb977018a5d to your computer and use it in GitHub Desktop.
The SVG Colorization App Main File.
This file contains 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
/// Holds the svg asset text. | |
String svgCode = ''; | |
void main() async { | |
// Do Not Remove This Line. | |
WidgetsFlutterBinding.ensureInitialized(); | |
// Extract The Text From The Asset SVG File. | |
svgCode = await rootBundle.loadString("assets/car_front.svg"); | |
runApp(const SVGColorizationApp()); | |
} | |
class SVGColorizationApp extends StatelessWidget { | |
const SVGColorizationApp({Key? key}) : super(key: key); | |
@override | |
Widget build(BuildContext context) { | |
return MultiProvider( | |
providers: [ | |
ChangeNotifierProvider<SVGData>.value( | |
value: SVGData(svgCode), | |
), | |
ChangeNotifierProvider<PreviousColor>.value( | |
value: PreviousColor('#f7ebcb')) | |
], | |
child: MaterialApp( | |
title: 'SVG Colorization', | |
debugShowCheckedModeBanner: false, | |
scrollBehavior: CustomScrollBehavior(), | |
theme: ThemeData( | |
primarySwatch: Colors.blue, | |
), | |
home: const Home(), | |
), | |
); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment