We are trying get very specific customization possibility than what material design provides by default. One approach of course is to create a design similar to flutter material. But creating entire design system from scratch is cumbersome. So we are trying to reuse flutter material and then customize it with minimal changes.
- Copied material folder from flutter to a test package.
- Copied material.dart to src of test package and commented “export ‘widgets.dart’;”
- Created a new widget TestInputField and imported both local material.dart and flutter/widgets.
import 'package:flutter/widgets.dart'; import '../../material.dart';
- Added a demo app and included a new widget TestInputField in it.
flutter runon demo (GitHub - msbasanth/test_widgets)
- Getting error “
No material widget found textfield widgets require a material widget ancestor”. We tried wrapping with Scaffold/Material no help. At the same time if we switch to
package:flutter/materialinstead of locally copied one it works fine.
Is there a similar or better approach with which we can create custom widgets without writing it from scratch?