This is a simple project that shows how to manage a model, and the AppIntents that use that model, between an iOS app and a widget extension. Look at the WidgetModel.swift file first, then see how it's used both in Widget.swift, AppDelegate.swift, and ViewController.swift.
It also demonstrates how to pass a parameter to an AppIntent (WidgetSelectIntent).
Look for "NOTE:" and you'll find the most important information.