|
| 1 | +import 'package:flutter/material.dart'; |
| 2 | +import 'package:fluttersdk_wind/fluttersdk_wind.dart'; |
| 3 | + |
| 4 | +import 'pages/backgrounds/background_color.dart'; |
| 5 | +import 'pages/borders/border_color.dart'; |
| 6 | +import 'pages/borders/border_radius.dart'; |
| 7 | +import 'pages/borders/border_width.dart'; |
| 8 | +import 'pages/core/dark_mode.dart'; |
| 9 | +import 'pages/core/responsive_design.dart'; |
| 10 | +import 'pages/core/state_based_styling.dart'; |
| 11 | +import 'pages/core/utility_first_flutter.dart'; |
| 12 | +import 'pages/core/utility_first_wind.dart'; |
| 13 | +import 'pages/effects/shadow.dart'; |
| 14 | +import 'pages/flex/align_items.dart'; |
| 15 | +import 'pages/flex/alignment.dart'; |
| 16 | +import 'pages/flex/axis_sizes.dart'; |
| 17 | +import 'pages/flex/flex_direction.dart'; |
| 18 | +import 'pages/flex/flex_fit.dart'; |
| 19 | +import 'pages/flex/flex_x.dart'; |
| 20 | +import 'pages/flex/gap.dart'; |
| 21 | +import 'pages/flex/gap_dynamic.dart'; |
| 22 | +import 'pages/flex/justify_content.dart'; |
| 23 | +import 'pages/flex/scrollable_overflow.dart'; |
| 24 | +import 'pages/home.dart'; |
| 25 | +import 'pages/sizing/height.dart'; |
| 26 | +import 'pages/sizing/width.dart'; |
| 27 | +import 'pages/spacing/margin.dart'; |
| 28 | +import 'pages/spacing/padding.dart'; |
| 29 | +import 'pages/typography/font_size.dart'; |
| 30 | +import 'pages/typography/font_style.dart'; |
| 31 | +import 'pages/typography/font_weight.dart'; |
| 32 | +import 'pages/typography/letter_spacing.dart'; |
| 33 | +import 'pages/typography/line_height.dart'; |
| 34 | +import 'pages/typography/text_alignment.dart'; |
| 35 | +import 'pages/typography/text_color.dart'; |
| 36 | +import 'pages/typography/text_decoration.dart'; |
| 37 | +import 'pages/typography/text_transform.dart'; |
| 38 | +import 'pages/widgets/wcontainer.dart'; |
| 39 | +import 'pages/widgets/wflex.dart'; |
| 40 | +import 'pages/widgets/wflexcontainer.dart'; |
| 41 | +import 'pages/widgets/wflexible.dart'; |
| 42 | +import 'pages/widgets/wtext.dart'; |
| 43 | + |
| 44 | +class MyApp extends StatelessWidget { |
| 45 | + final Widget Function(BuildContext) appCallback; |
| 46 | + |
| 47 | + const MyApp({super.key, required this.appCallback}); |
| 48 | + |
| 49 | + @override |
| 50 | + Widget build(BuildContext context) { |
| 51 | + return appCallback(context); |
| 52 | + } |
| 53 | +} |
| 54 | + |
| 55 | +class AppLayoutWidget extends StatefulWidget { |
| 56 | + final Widget body; |
| 57 | + |
| 58 | + const AppLayoutWidget(this.body, {super.key}); |
| 59 | + |
| 60 | + @override |
| 61 | + createState() => _AppLayoutWidgetState(); |
| 62 | +} |
| 63 | + |
| 64 | +class _AppLayoutWidgetState extends State<AppLayoutWidget> { |
| 65 | + @override |
| 66 | + Widget build(BuildContext context) { |
| 67 | + return Title( |
| 68 | + title: 'Wind Demo', |
| 69 | + color: wColor('primary'), |
| 70 | + child: Scaffold(backgroundColor: wColor('white'), body: widget.body), |
| 71 | + ); |
| 72 | + } |
| 73 | +} |
| 74 | + |
| 75 | +void main() { |
| 76 | + WindTheme.addColor( |
| 77 | + 'primary', |
| 78 | + MaterialColor(0xff0986e0, { |
| 79 | + 50: Color(0xffa5d7fb), |
| 80 | + 100: Color(0xff92cffb), |
| 81 | + 200: Color(0xff6abdf9), |
| 82 | + 300: Color(0xff43acf7), |
| 83 | + 400: Color(0xff1c9bf6), |
| 84 | + 500: Color(0xff0986e0), |
| 85 | + 600: Color(0xff0766aa), |
| 86 | + 700: Color(0xff054574), |
| 87 | + 800: Color(0xff02253e), |
| 88 | + 900: Color(0xff000508), |
| 89 | + 950: Color(0xff000000), |
| 90 | + })); |
| 91 | + |
| 92 | + runApp(MyApp( |
| 93 | + appCallback: (context) { |
| 94 | + return MaterialApp( |
| 95 | + title: 'Wind Demo', |
| 96 | + theme: WindTheme.toThemeCallback(context), |
| 97 | + home: AppLayoutWidget(Home()), |
| 98 | + routes: { |
| 99 | + '/core/utility_first_wind': (context) => |
| 100 | + AppLayoutWidget(UtilityFirstWind()), |
| 101 | + '/core/utility_first_flutter': (context) => |
| 102 | + AppLayoutWidget(UtilityFirstFlutter()), |
| 103 | + '/core/state_based_styling': (context) => |
| 104 | + AppLayoutWidget(StateBasedStyling()), |
| 105 | + '/core/responsive_design': (context) => |
| 106 | + AppLayoutWidget(ResponsiveDesign()), |
| 107 | + '/core/dark_mode': (context) => AppLayoutWidget(DarkMode()), |
| 108 | + '/flex/align_items': (context) => AppLayoutWidget(AlignItems()), |
| 109 | + '/flex/flex_direction': (context) => AppLayoutWidget(FlexDirection()), |
| 110 | + '/flex/justify_content': (context) => |
| 111 | + AppLayoutWidget(JustifyContent()), |
| 112 | + '/flex/gap': (context) => AppLayoutWidget(Gap()), |
| 113 | + '/flex/gap_dynamic': (context) => AppLayoutWidget(GapDynamic()), |
| 114 | + '/flex/axis_sizes': (context) => AppLayoutWidget(AxisSizes()), |
| 115 | + '/flex/scrollable_overflow': (context) => |
| 116 | + AppLayoutWidget(ScrollableOverflow()), |
| 117 | + '/flex/flex_fit': (context) => AppLayoutWidget(FlexFitWidget()), |
| 118 | + '/flex/flex_x': (context) => AppLayoutWidget(FlexX()), |
| 119 | + '/flex/alignments': (context) => AppLayoutWidget(AlignmentWidget()), |
| 120 | + '/flex/alignment_top_left': (context) => |
| 121 | + AppLayoutWidget(AlignmentTopLeftWidget()), |
| 122 | + '/flex/alignment_complex': (context) => |
| 123 | + AppLayoutWidget(AlignmentComplex()), |
| 124 | + '/borders/border_width': (context) => AppLayoutWidget(BorderWidth()), |
| 125 | + '/borders/border_color': (context) => AppLayoutWidget(BorderColor()), |
| 126 | + '/borders/border_color_custom': (context) => |
| 127 | + AppLayoutWidget(BorderColorCustom()), |
| 128 | + '/borders/border_radius': (context) => |
| 129 | + AppLayoutWidget(BorderRadiusWidget()), |
| 130 | + '/borders/border_radius_custom': (context) => |
| 131 | + AppLayoutWidget(BorderRadiusCustom()), |
| 132 | + '/backgrounds/background_color': (context) => |
| 133 | + AppLayoutWidget(BackgroundColor()), |
| 134 | + '/backgrounds/background_color_custom': (context) => |
| 135 | + AppLayoutWidget(BackgroundColorCustom()), |
| 136 | + '/typography/text_alignment_center': (context) => |
| 137 | + AppLayoutWidget(TextAlignmentCenter()), |
| 138 | + '/typography/text_alignment_right': (context) => |
| 139 | + AppLayoutWidget(TextAlignmentRight()), |
| 140 | + '/typography/text_alignment_justify': (context) => |
| 141 | + AppLayoutWidget(TextAlignmentJustify()), |
| 142 | + '/typography/text_color_predefined': (context) => |
| 143 | + AppLayoutWidget(TextColorPredefined()), |
| 144 | + '/typography/text_color_arbitrary': (context) => |
| 145 | + AppLayoutWidget(TextColorArbitrary()), |
| 146 | + '/typography/text_decoration': (context) => |
| 147 | + AppLayoutWidget(TextDecorationWidget()), |
| 148 | + '/typography/text_transform': (context) => |
| 149 | + AppLayoutWidget(TextTransformWidget()), |
| 150 | + '/typography/font_size': (context) => AppLayoutWidget(FontSizeWidget()), |
| 151 | + '/typography/font_size_arbitrary': (context) => |
| 152 | + AppLayoutWidget(FontSizeArbitraryWidget()), |
| 153 | + '/typography/font_weight': (context) => |
| 154 | + AppLayoutWidget(FontWeightWidget()), |
| 155 | + '/typography/font_style': (context) => |
| 156 | + AppLayoutWidget(FontStyleWidget()), |
| 157 | + '/typography/line_height': (context) => |
| 158 | + AppLayoutWidget(LineHeightWidget()), |
| 159 | + '/typography/letter_spacing': (context) => |
| 160 | + AppLayoutWidget(LetterSpacingWidget()), |
| 161 | + '/effects/shadow': (context) => AppLayoutWidget(ShadowWidget()), |
| 162 | + '/effects/shadow_custom': (context) => |
| 163 | + AppLayoutWidget(ShadowCustomWidget()), |
| 164 | + '/sizing/width': (context) => AppLayoutWidget(WidthWidget()), |
| 165 | + '/sizing/max_width': (context) => AppLayoutWidget(MaxWidthWidget()), |
| 166 | + '/sizing/min_width': (context) => AppLayoutWidget(MinWidthWidget()), |
| 167 | + '/sizing/height': (context) => AppLayoutWidget(HeightWidget()), |
| 168 | + '/sizing/max_height': (context) => AppLayoutWidget(MaxHeightWidget()), |
| 169 | + '/sizing/min_height': (context) => AppLayoutWidget(MinHeightWidget()), |
| 170 | + '/spacing/padding': (context) => AppLayoutWidget(PaddingWidget()), |
| 171 | + '/spacing/padding_arbitrary': (context) => |
| 172 | + AppLayoutWidget(PaddingArbitraryWidget()), |
| 173 | + '/spacing/padding_specific': (context) => |
| 174 | + AppLayoutWidget(PaddingSpecificWidget()), |
| 175 | + '/spacing/margin': (context) => AppLayoutWidget(MarginWidget()), |
| 176 | + '/spacing/margin_arbitrary': (context) => |
| 177 | + AppLayoutWidget(MarginArbitraryWidget()), |
| 178 | + '/spacing/margin_specific': (context) => |
| 179 | + AppLayoutWidget(MarginSpecificWidget()), |
| 180 | + '/widgets/wtext': (context) => AppLayoutWidget(WTextWidget()), |
| 181 | + '/widgets/wtext_parameters': (context) => |
| 182 | + AppLayoutWidget(WTextParameterWidget()), |
| 183 | + '/widgets/wflex': (context) => AppLayoutWidget(WFlexWidget()), |
| 184 | + '/widgets/wflexcontainer': (context) => |
| 185 | + AppLayoutWidget(WFlexContainerWidget()), |
| 186 | + '/widgets/wflexible': (context) => |
| 187 | + AppLayoutWidget(WFlexibleWidget()), |
| 188 | + '/widgets/wcontainer': (context) => |
| 189 | + AppLayoutWidget(WContainerWidget()), |
| 190 | + }, |
| 191 | + ); |
| 192 | + }, |
| 193 | + )); |
| 194 | +} |
0 commit comments