Skip to content

Instantly share code, notes, and snippets.

@Zujaj
Created May 19, 2022 10:08
Show Gist options
  • Save Zujaj/ad0f92b7c6efd25529d6bfb977018a5d to your computer and use it in GitHub Desktop.
Save Zujaj/ad0f92b7c6efd25529d6bfb977018a5d to your computer and use it in GitHub Desktop.
The SVG Colorization App Main File.
/// 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